From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- src/3rdparty/sqlite/config.h | 4 +- src/3rdparty/sqlite/trolltech.patch | 4 +- src/attic/qtmultilineedit.cpp | 24 +- src/attic/qtmultilineedit.h | 4 +- src/attic/qttableview.cpp | 6 +- src/attic/qttableview.h | 2 +- src/canvas/ntqcanvas.h | 816 ++++++++++++++++++++ src/canvas/qcanvas.cpp | 44 +- src/canvas/qcanvas.h | 816 -------------------- src/canvas/qt_canvas.pri | 2 +- src/codecs/ntqbig5codec.h | 89 +++ src/codecs/ntqeucjpcodec.h | 111 +++ src/codecs/ntqeuckrcodec.h | 100 +++ src/codecs/ntqgb18030codec.h | 115 +++ src/codecs/ntqgbkcodec.h | 47 ++ src/codecs/ntqjiscodec.h | 111 +++ src/codecs/ntqjpunicode.h | 179 +++++ src/codecs/ntqrtlcodec.h | 67 ++ src/codecs/ntqsjiscodec.h | 111 +++ src/codecs/ntqtextcodec.h | 134 ++++ src/codecs/ntqtextcodecfactory.h | 59 ++ src/codecs/ntqtextcodecplugin.h | 70 ++ src/codecs/ntqtsciicodec.h | 94 +++ src/codecs/ntqutfcodec.h | 78 ++ src/codecs/qbig5codec.cpp | 4 +- src/codecs/qbig5codec.h | 89 --- src/codecs/qeucjpcodec.cpp | 4 +- src/codecs/qeucjpcodec.h | 111 --- src/codecs/qeuckrcodec.cpp | 4 +- src/codecs/qeuckrcodec.h | 100 --- src/codecs/qfontcodecs_p.h | 4 +- src/codecs/qfontjpcodec.cpp | 2 +- src/codecs/qgb18030codec.cpp | 6 +- src/codecs/qgb18030codec.h | 115 --- src/codecs/qgbkcodec.h | 47 -- src/codecs/qisciicodec_p.h | 2 +- src/codecs/qjiscodec.cpp | 2 +- src/codecs/qjiscodec.h | 111 --- src/codecs/qjpunicode.cpp | 6 +- src/codecs/qjpunicode.h | 179 ----- src/codecs/qrtlcodec.cpp | 4 +- src/codecs/qrtlcodec.h | 67 -- src/codecs/qsjiscodec.cpp | 4 +- src/codecs/qsjiscodec.h | 111 --- src/codecs/qt_codecs.pri | 26 +- src/codecs/qtextcodec.cpp | 40 +- src/codecs/qtextcodec.h | 134 ---- src/codecs/qtextcodecfactory.cpp | 6 +- src/codecs/qtextcodecfactory.h | 59 -- src/codecs/qtextcodecplugin.cpp | 4 +- src/codecs/qtextcodecplugin.h | 70 -- src/codecs/qtsciicodec.cpp | 4 +- src/codecs/qtsciicodec.h | 94 --- src/codecs/qutfcodec.cpp | 2 +- src/codecs/qutfcodec.h | 78 -- src/compat/ntqapp.h | 25 + src/compat/ntqarray.h | 27 + src/compat/ntqbitarry.h | 25 + src/compat/ntqbttngrp.h | 25 + src/compat/ntqchkbox.h | 25 + src/compat/ntqclipbrd.h | 25 + src/compat/ntqcollect.h | 25 + src/compat/ntqcollection.h | 27 + src/compat/ntqcombo.h | 25 + src/compat/ntqconnect.h | 25 + src/compat/ntqdatetm.h | 25 + src/compat/ntqdrawutl.h | 25 + src/compat/ntqdstream.h | 25 + src/compat/ntqfiledef.h | 25 + src/compat/ntqfiledlg.h | 25 + src/compat/ntqfileinf.h | 25 + src/compat/ntqfontinf.h | 25 + src/compat/ntqfontmet.h | 25 + src/compat/ntqgrpbox.h | 25 + src/compat/ntqintcach.h | 25 + src/compat/ntqiodev.h | 25 + src/compat/ntqlcdnum.h | 25 + src/compat/ntqlined.h | 25 + src/compat/ntqlist.h | 27 + src/compat/ntqmenudta.h | 25 + src/compat/ntqmetaobj.h | 25 + src/compat/ntqmlined.h | 25 + src/compat/ntqmsgbox.h | 25 + src/compat/ntqmultilinedit.h | 25 + src/compat/ntqobjcoll.h | 26 + src/compat/ntqobjdefs.h | 25 + src/compat/ntqpaintd.h | 25 + src/compat/ntqpaintdc.h | 25 + src/compat/ntqpdevmet.h | 25 + src/compat/ntqpmcache.h | 25 + src/compat/ntqpntarry.h | 25 + src/compat/ntqpopmenu.h | 25 + src/compat/ntqprndlg.h | 25 + src/compat/ntqprogbar.h | 25 + src/compat/ntqprogdlg.h | 25 + src/compat/ntqpsprn.h | 25 + src/compat/ntqpushbt.h | 25 + src/compat/ntqqueue.h | 27 + src/compat/ntqradiobt.h | 25 + src/compat/ntqrangect.h | 25 + src/compat/ntqscrbar.h | 25 + src/compat/ntqsocknot.h | 25 + src/compat/ntqstack.h | 27 + src/compat/ntqtabdlg.h | 25 + src/compat/ntqtstream.h | 25 + src/compat/ntqvector.h | 27 + src/compat/ntqwidcoll.h | 26 + src/compat/ntqwindefs.h | 25 + src/compat/qapp.h | 25 - src/compat/qarray.h | 27 - src/compat/qbitarry.h | 25 - src/compat/qbttngrp.h | 25 - src/compat/qchkbox.h | 25 - src/compat/qclipbrd.h | 25 - src/compat/qcollect.h | 25 - src/compat/qcollection.h | 27 - src/compat/qcombo.h | 25 - src/compat/qconnect.h | 25 - src/compat/qdatetm.h | 25 - src/compat/qdrawutl.h | 25 - src/compat/qdstream.h | 25 - src/compat/qfiledef.h | 25 - src/compat/qfiledlg.h | 25 - src/compat/qfileinf.h | 25 - src/compat/qfontinf.h | 25 - src/compat/qfontmet.h | 25 - src/compat/qgrpbox.h | 25 - src/compat/qintcach.h | 25 - src/compat/qiodev.h | 25 - src/compat/qlcdnum.h | 25 - src/compat/qlined.h | 25 - src/compat/qlist.h | 27 - src/compat/qmenudta.h | 25 - src/compat/qmetaobj.h | 25 - src/compat/qmlined.h | 25 - src/compat/qmsgbox.h | 25 - src/compat/qmultilinedit.h | 25 - src/compat/qobjcoll.h | 26 - src/compat/qobjdefs.h | 25 - src/compat/qpaintd.h | 25 - src/compat/qpaintdc.h | 25 - src/compat/qpdevmet.h | 25 - src/compat/qpmcache.h | 25 - src/compat/qpntarry.h | 25 - src/compat/qpopmenu.h | 25 - src/compat/qprndlg.h | 25 - src/compat/qprogbar.h | 25 - src/compat/qprogdlg.h | 25 - src/compat/qpsprn.h | 25 - src/compat/qpushbt.h | 25 - src/compat/qqueue.h | 27 - src/compat/qradiobt.h | 25 - src/compat/qrangect.h | 25 - src/compat/qscrbar.h | 25 - src/compat/qsocknot.h | 25 - src/compat/qstack.h | 27 - src/compat/qtabdlg.h | 25 - src/compat/qtstream.h | 25 - src/compat/qvector.h | 27 - src/compat/qwidcoll.h | 26 - src/compat/qwindefs.h | 25 - src/dialogs/ntqcolordialog.h | 93 +++ src/dialogs/ntqdialog.h | 141 ++++ src/dialogs/ntqerrormessage.h | 89 +++ src/dialogs/ntqfiledialog.h | 347 +++++++++ src/dialogs/ntqfontdialog.h | 112 +++ src/dialogs/ntqinputdialog.h | 107 +++ src/dialogs/ntqmessagebox.h | 223 ++++++ src/dialogs/ntqprintdialog.h | 103 +++ src/dialogs/ntqprogressdialog.h | 141 ++++ src/dialogs/ntqsemimodal.h | 66 ++ src/dialogs/ntqtabdialog.h | 146 ++++ src/dialogs/ntqwizard.h | 142 ++++ src/dialogs/qcolordialog.cpp | 34 +- src/dialogs/qcolordialog.h | 93 --- src/dialogs/qdialog.cpp | 26 +- src/dialogs/qdialog.h | 141 ---- src/dialogs/qerrormessage.cpp | 22 +- src/dialogs/qerrormessage.h | 89 --- src/dialogs/qfiledialog.cpp | 86 +-- src/dialogs/qfiledialog.h | 347 --------- src/dialogs/qfontdialog.cpp | 36 +- src/dialogs/qfontdialog.h | 112 --- src/dialogs/qinputdialog.cpp | 20 +- src/dialogs/qinputdialog.h | 107 --- src/dialogs/qmessagebox.cpp | 18 +- src/dialogs/qmessagebox.h | 223 ------ src/dialogs/qprintdialog.cpp | 44 +- src/dialogs/qprintdialog.h | 103 --- src/dialogs/qprogressdialog.cpp | 22 +- src/dialogs/qprogressdialog.h | 141 ---- src/dialogs/qsemimodal.h | 66 -- src/dialogs/qt_dialogs.pri | 24 +- src/dialogs/qtabdialog.cpp | 24 +- src/dialogs/qtabdialog.h | 146 ---- src/dialogs/qwizard.cpp | 22 +- src/dialogs/qwizard.h | 142 ---- src/iconview/ntqiconview.h | 518 +++++++++++++ src/iconview/qiconview.cpp | 56 +- src/iconview/qiconview.h | 518 ------------- src/iconview/qt_iconview.pri | 2 +- src/inputmethod/ntqinputcontextfactory.h | 59 ++ src/inputmethod/ntqinputcontextplugin.h | 67 ++ src/inputmethod/qinputcontextfactory.cpp | 8 +- src/inputmethod/qinputcontextfactory.h | 59 -- src/inputmethod/qinputcontextplugin.cpp | 4 +- src/inputmethod/qinputcontextplugin.h | 67 -- src/inputmethod/qt_inputmethod.pri | 4 +- src/kernel/ntq1xcompatibility.h | 49 ++ src/kernel/ntqabstractlayout.h | 54 ++ src/kernel/ntqaccel.h | 110 +++ src/kernel/ntqaccessible.h | 295 +++++++ src/kernel/ntqapplication.h | 555 ++++++++++++++ src/kernel/ntqasyncimageio.h | 111 +++ src/kernel/ntqasyncio.h | 120 +++ src/kernel/ntqbitmap.h | 73 ++ src/kernel/ntqbrush.h | 94 +++ src/kernel/ntqclipboard.h | 134 ++++ src/kernel/ntqcolor.h | 229 ++++++ src/kernel/ntqconnection.h | 78 ++ src/kernel/ntqcursor.h | 153 ++++ src/kernel/ntqdesktopwidget.h | 103 +++ src/kernel/ntqdragobject.h | 279 +++++++ src/kernel/ntqdrawutil.h | 128 ++++ src/kernel/ntqdropsite.h | 59 ++ src/kernel/ntqevent.h | 617 +++++++++++++++ src/kernel/ntqeventloop.h | 122 +++ src/kernel/ntqfocusdata.h | 70 ++ src/kernel/ntqfont.h | 372 +++++++++ src/kernel/ntqfontdatabase.h | 227 ++++++ src/kernel/ntqfontinfo.h | 91 +++ src/kernel/ntqfontmetrics.h | 117 +++ src/kernel/ntqgif.h | 61 ++ src/kernel/ntqgplugin.h | 130 ++++ src/kernel/ntqguardedptr.h | 144 ++++ src/kernel/ntqiconset.h | 132 ++++ src/kernel/ntqimage.h | 425 +++++++++++ src/kernel/ntqimageformatplugin.h | 67 ++ src/kernel/ntqinputcontext.h | 143 ++++ src/kernel/ntqjpegio.h | 52 ++ src/kernel/ntqkeycode.h | 50 ++ src/kernel/ntqkeysequence.h | 109 +++ src/kernel/ntqlayout.h | 473 ++++++++++++ src/kernel/ntqlocalfs.h | 75 ++ src/kernel/ntqmetaobject.h | 286 +++++++ src/kernel/ntqmime.h | 200 +++++ src/kernel/ntqmngio.h | 53 ++ src/kernel/ntqmovie.h | 120 +++ src/kernel/ntqnamespace.h | 1030 +++++++++++++++++++++++++ src/kernel/ntqnetworkprotocol.h | 244 ++++++ src/kernel/ntqobject.h | 265 +++++++ src/kernel/ntqobjectcleanuphandler.h | 68 ++ src/kernel/ntqobjectdefs.h | 177 +++++ src/kernel/ntqobjectdict.h | 66 ++ src/kernel/ntqobjectlist.h | 92 +++ src/kernel/ntqpaintdevice.h | 421 ++++++++++ src/kernel/ntqpaintdevicedefs.h | 48 ++ src/kernel/ntqpaintdevicemetrics.h | 83 ++ src/kernel/ntqpainter.h | 721 ++++++++++++++++++ src/kernel/ntqpalette.h | 189 +++++ src/kernel/ntqpen.h | 102 +++ src/kernel/ntqpicture.h | 127 ++++ src/kernel/ntqpixmap.h | 354 +++++++++ src/kernel/ntqpixmapcache.h | 63 ++ src/kernel/ntqpngio.h | 107 +++ src/kernel/ntqpoint.h | 219 ++++++ src/kernel/ntqpointarray.h | 118 +++ src/kernel/ntqpolygonscanner.h | 61 ++ src/kernel/ntqprinter.h | 284 +++++++ src/kernel/ntqprocess.h | 178 +++++ src/kernel/ntqrect.h | 276 +++++++ src/kernel/ntqregion.h | 177 +++++ src/kernel/ntqsession.h | 47 ++ src/kernel/ntqsessionmanager.h | 99 +++ src/kernel/ntqsignal.h | 94 +++ src/kernel/ntqsignalmapper.h | 78 ++ src/kernel/ntqsignalslotimp.h | 97 +++ src/kernel/ntqsimplerichtext.h | 104 +++ src/kernel/ntqsize.h | 237 ++++++ src/kernel/ntqsizegrip.h | 74 ++ src/kernel/ntqsizepolicy.h | 128 ++++ src/kernel/ntqsocketnotifier.h | 93 +++ src/kernel/ntqsound.h | 125 +++ src/kernel/ntqstyle.h | 758 ++++++++++++++++++ src/kernel/ntqstylesheet.h | 253 ++++++ src/kernel/ntqt.h | 375 +++++++++ src/kernel/ntqthread.h | 130 ++++ src/kernel/ntqtimer.h | 91 +++ src/kernel/ntqtranslator.h | 167 ++++ src/kernel/ntqurl.h | 130 ++++ src/kernel/ntqurlinfo.h | 144 ++++ src/kernel/ntqurloperator.h | 129 ++++ src/kernel/ntqvariant.h | 396 ++++++++++ src/kernel/ntqvfbhdr.h | 71 ++ src/kernel/ntqwidget.h | 1094 ++++++++++++++++++++++++++ src/kernel/ntqwidgetintdict.h | 75 ++ src/kernel/ntqwidgetlist.h | 67 ++ src/kernel/ntqwindowdefs.h | 197 +++++ src/kernel/ntqwmatrix.h | 129 ++++ src/kernel/q1xcompatibility.h | 49 -- src/kernel/qabstractlayout.cpp | 8 +- src/kernel/qabstractlayout.h | 54 -- src/kernel/qaccel.cpp | 24 +- src/kernel/qaccel.h | 110 --- src/kernel/qaccessible.cpp | 14 +- src/kernel/qaccessible.h | 295 ------- src/kernel/qapplication.cpp | 62 +- src/kernel/qapplication.h | 555 -------------- src/kernel/qapplication_x11.cpp | 54 +- src/kernel/qasyncimageio.cpp | 32 +- src/kernel/qasyncimageio.h | 111 --- src/kernel/qasyncio.cpp | 14 +- src/kernel/qasyncio.h | 120 --- src/kernel/qbitmap.cpp | 6 +- src/kernel/qbitmap.h | 73 -- src/kernel/qbrush.h | 94 --- src/kernel/qclipboard.cpp | 10 +- src/kernel/qclipboard.h | 134 ---- src/kernel/qclipboard_x11.cpp | 20 +- src/kernel/qcolor.cpp | 8 +- src/kernel/qcolor.h | 229 ------ src/kernel/qcolor_p.cpp | 4 +- src/kernel/qcolor_x11.cpp | 8 +- src/kernel/qconnection.cpp | 4 +- src/kernel/qconnection.h | 78 -- src/kernel/qcursor.cpp | 10 +- src/kernel/qcursor.h | 153 ---- src/kernel/qcursor_x11.cpp | 12 +- src/kernel/qdesktopwidget.h | 103 --- src/kernel/qdesktopwidget_x11.cpp | 6 +- src/kernel/qdnd_x11.cpp | 26 +- src/kernel/qdragobject.cpp | 32 +- src/kernel/qdragobject.h | 279 ------- src/kernel/qdrawutil.cpp | 22 +- src/kernel/qdrawutil.h | 128 ---- src/kernel/qdropsite.cpp | 6 +- src/kernel/qdropsite.h | 59 -- src/kernel/qevent.cpp | 46 +- src/kernel/qevent.h | 617 --------------- src/kernel/qeventloop.cpp | 6 +- src/kernel/qeventloop.h | 122 --- src/kernel/qeventloop_p.h | 4 +- src/kernel/qeventloop_unix.cpp | 6 +- src/kernel/qeventloop_x11.cpp | 8 +- src/kernel/qfocusdata.cpp | 4 +- src/kernel/qfocusdata.h | 70 -- src/kernel/qfont.cpp | 34 +- src/kernel/qfont.h | 372 --------- src/kernel/qfont_x11.cpp | 18 +- src/kernel/qfontdata_p.h | 6 +- src/kernel/qfontdatabase.cpp | 14 +- src/kernel/qfontdatabase.h | 227 ------ src/kernel/qfontdatabase_x11.cpp | 4 +- src/kernel/qfontengine_p.h | 8 +- src/kernel/qfontengine_x11.cpp | 20 +- src/kernel/qfontinfo.h | 91 --- src/kernel/qfontmetrics.h | 117 --- src/kernel/qgif.h | 61 -- src/kernel/qgplugin.cpp | 2 +- src/kernel/qgplugin.h | 130 ---- src/kernel/qguardedptr.cpp | 4 +- src/kernel/qguardedptr.h | 144 ---- src/kernel/qiconset.cpp | 12 +- src/kernel/qiconset.h | 132 ---- src/kernel/qimage.cpp | 46 +- src/kernel/qimage.h | 425 ----------- src/kernel/qimageformatplugin.cpp | 6 +- src/kernel/qimageformatplugin.h | 67 -- src/kernel/qinputcontext.cpp | 10 +- src/kernel/qinputcontext.h | 143 ---- src/kernel/qinputcontext_p.h | 6 +- src/kernel/qinputcontext_x11.cpp | 6 +- src/kernel/qinternal.cpp | 8 +- src/kernel/qinternal_p.h | 10 +- src/kernel/qjpegio.cpp | 6 +- src/kernel/qjpegio.h | 52 -- src/kernel/qkeycode.h | 50 -- src/kernel/qkeysequence.cpp | 18 +- src/kernel/qkeysequence.h | 109 --- src/kernel/qlayout.cpp | 10 +- src/kernel/qlayout.h | 473 ------------ src/kernel/qlayoutengine.cpp | 2 +- src/kernel/qlayoutengine_p.h | 4 +- src/kernel/qlocalfs.cpp | 16 +- src/kernel/qlocalfs.h | 75 -- src/kernel/qlock_p.h | 2 +- src/kernel/qmetaobject.cpp | 12 +- src/kernel/qmetaobject.h | 286 ------- src/kernel/qmime.cpp | 22 +- src/kernel/qmime.h | 200 ----- src/kernel/qmngio.cpp | 14 +- src/kernel/qmngio.h | 53 -- src/kernel/qmotifdnd_x11.cpp | 4 +- src/kernel/qmovie.cpp | 26 +- src/kernel/qmovie.h | 120 --- src/kernel/qnamespace.h | 1030 ------------------------- src/kernel/qnetworkprotocol.cpp | 14 +- src/kernel/qnetworkprotocol.h | 244 ------ src/kernel/qobject.cpp | 28 +- src/kernel/qobject.h | 265 ------- src/kernel/qobjectcleanuphandler.cpp | 6 +- src/kernel/qobjectcleanuphandler.h | 68 -- src/kernel/qobjectdefs.h | 177 ----- src/kernel/qobjectdict.h | 66 -- src/kernel/qobjectlist.h | 92 --- src/kernel/qpaintdevice.h | 421 ---------- src/kernel/qpaintdevice_x11.cpp | 18 +- src/kernel/qpaintdevicedefs.h | 48 -- src/kernel/qpaintdevicemetrics.cpp | 4 +- src/kernel/qpaintdevicemetrics.h | 83 -- src/kernel/qpainter.cpp | 30 +- src/kernel/qpainter.h | 721 ------------------ src/kernel/qpainter_x11.cpp | 20 +- src/kernel/qpalette.cpp | 10 +- src/kernel/qpalette.h | 189 ----- src/kernel/qpen.h | 102 --- src/kernel/qpicture.cpp | 16 +- src/kernel/qpicture.h | 127 ---- src/kernel/qpixmap.cpp | 28 +- src/kernel/qpixmap.h | 354 --------- src/kernel/qpixmap_x11.cpp | 10 +- src/kernel/qpixmapcache.cpp | 10 +- src/kernel/qpixmapcache.h | 63 -- src/kernel/qpngio.cpp | 12 +- src/kernel/qpngio.h | 107 --- src/kernel/qpoint.cpp | 6 +- src/kernel/qpoint.h | 219 ------ src/kernel/qpointarray.cpp | 10 +- src/kernel/qpointarray.h | 118 --- src/kernel/qpolygonscanner.cpp | 4 +- src/kernel/qpolygonscanner.h | 61 -- src/kernel/qprinter.cpp | 4 +- src/kernel/qprinter.h | 284 ------- src/kernel/qprinter_p.h | 6 +- src/kernel/qprinter_unix.cpp | 8 +- src/kernel/qprocess.cpp | 6 +- src/kernel/qprocess.h | 178 ----- src/kernel/qprocess_unix.cpp | 16 +- src/kernel/qpsprinter.cpp | 36 +- src/kernel/qpsprinter_p.h | 4 +- src/kernel/qrect.cpp | 6 +- src/kernel/qrect.h | 276 ------- src/kernel/qregion.cpp | 10 +- src/kernel/qregion.h | 177 ----- src/kernel/qregion_x11.cpp | 10 +- src/kernel/qrichtext.cpp | 42 +- src/kernel/qrichtext_p.h | 42 +- src/kernel/qscriptengine.cpp | 6 +- src/kernel/qscriptengine_x11.cpp | 4 +- src/kernel/qsession.h | 47 -- src/kernel/qsessionmanager.h | 99 --- src/kernel/qsharedmemory_p.h | 2 +- src/kernel/qsignal.cpp | 10 +- src/kernel/qsignal.h | 94 --- src/kernel/qsignalmapper.cpp | 6 +- src/kernel/qsignalmapper.h | 78 -- src/kernel/qsignalslotimp.h | 97 --- src/kernel/qsimplerichtext.cpp | 6 +- src/kernel/qsimplerichtext.h | 104 --- src/kernel/qsize.cpp | 6 +- src/kernel/qsize.h | 237 ------ src/kernel/qsizegrip.cpp | 12 +- src/kernel/qsizegrip.h | 74 -- src/kernel/qsizepolicy.h | 128 ---- src/kernel/qsocketnotifier.cpp | 10 +- src/kernel/qsocketnotifier.h | 93 --- src/kernel/qsound.cpp | 6 +- src/kernel/qsound.h | 125 --- src/kernel/qsound_x11.cpp | 8 +- src/kernel/qstyle.cpp | 14 +- src/kernel/qstyle.h | 758 ------------------ src/kernel/qstylesheet.cpp | 12 +- src/kernel/qstylesheet.h | 253 ------ src/kernel/qt.h | 375 --------- src/kernel/qt_gfx.pri | 6 +- src/kernel/qt_kernel.pri | 168 ++-- src/kernel/qt_pch.h | 34 +- src/kernel/qt_x11_p.h | 2 +- src/kernel/qtextengine.cpp | 4 +- src/kernel/qtextengine_p.h | 6 +- src/kernel/qtextlayout.cpp | 6 +- src/kernel/qtextlayout_p.h | 6 +- src/kernel/qthread.cpp | 6 +- src/kernel/qthread.h | 130 ---- src/kernel/qthread_unix.cpp | 4 +- src/kernel/qtimer.cpp | 12 +- src/kernel/qtimer.h | 91 --- src/kernel/qtkdeintegration_x11.cpp | 12 +- src/kernel/qtkdeintegration_x11_p.h | 2 +- src/kernel/qtranslator.cpp | 22 +- src/kernel/qtranslator.h | 167 ---- src/kernel/qucomextra.cpp | 2 +- src/kernel/qurl.cpp | 10 +- src/kernel/qurl.h | 130 ---- src/kernel/qurlinfo.cpp | 10 +- src/kernel/qurlinfo.h | 144 ---- src/kernel/qurloperator.cpp | 16 +- src/kernel/qurloperator.h | 129 ---- src/kernel/qvariant.cpp | 52 +- src/kernel/qvariant.h | 396 ---------- src/kernel/qvfbhdr.h | 71 -- src/kernel/qwidget.cpp | 40 +- src/kernel/qwidget.h | 1094 -------------------------- src/kernel/qwidget_x11.cpp | 24 +- src/kernel/qwidgetcreate_x11.cpp | 2 +- src/kernel/qwidgetintdict.h | 75 -- src/kernel/qwidgetlist.h | 67 -- src/kernel/qwindowdefs.h | 197 ----- src/kernel/qwmatrix.cpp | 8 +- src/kernel/qwmatrix.h | 129 ---- src/moc/moc.l | 2 +- src/moc/moc.y | 32 +- src/moc/moc_lex.cpp | 2 +- src/moc/moc_yacc.cpp | 32 +- src/network/ntqdns.h | 170 +++++ src/network/ntqftp.h | 202 +++++ src/network/ntqhostaddress.h | 101 +++ src/network/ntqhttp.h | 277 +++++++ src/network/ntqnetwork.h | 60 ++ src/network/ntqserversocket.h | 94 +++ src/network/ntqsocket.h | 156 ++++ src/network/ntqsocketdevice.h | 170 +++++ src/network/qdns.cpp | 30 +- src/network/qdns.h | 170 ----- src/network/qftp.cpp | 24 +- src/network/qftp.h | 202 ----- src/network/qhostaddress.cpp | 6 +- src/network/qhostaddress.h | 101 --- src/network/qhttp.cpp | 28 +- src/network/qhttp.h | 277 ------- src/network/qnetwork.cpp | 12 +- src/network/qnetwork.h | 60 -- src/network/qserversocket.cpp | 6 +- src/network/qserversocket.h | 94 --- src/network/qsocket.cpp | 12 +- src/network/qsocket.h | 156 ---- src/network/qsocketdevice.cpp | 6 +- src/network/qsocketdevice.h | 170 ----- src/network/qsocketdevice_unix.cpp | 4 +- src/network/qt_network.pri | 16 +- src/opengl/ntqgl.h | 541 +++++++++++++ src/opengl/ntqglcolormap.h | 99 +++ src/opengl/qgl.cpp | 20 +- src/opengl/qgl.h | 541 ------------- src/opengl/qgl_x11.cpp | 12 +- src/opengl/qglcolormap.cpp | 10 +- src/opengl/qglcolormap.h | 99 --- src/opengl/qt_opengl.pri | 4 +- src/qt.pro | 10 +- src/qt_install.pri | 4 +- src/sql/drivers/cache/qsqlcachedresult.cpp | 2 +- src/sql/drivers/cache/qsqlcachedresult.h | 10 +- src/sql/drivers/ibase/qsql_ibase.cpp | 2 +- src/sql/drivers/ibase/qsql_ibase.h | 4 +- src/sql/drivers/mysql/qsql_mysql.cpp | 6 +- src/sql/drivers/mysql/qsql_mysql.h | 8 +- src/sql/drivers/odbc/qsql_odbc.cpp | 6 +- src/sql/drivers/odbc/qsql_odbc.h | 12 +- src/sql/drivers/psql/qsql_psql.cpp | 8 +- src/sql/drivers/psql/qsql_psql.h | 6 +- src/sql/drivers/sqlite/qsql_sqlite.cpp | 10 +- src/sql/drivers/sqlite/qsql_sqlite.h | 8 +- src/sql/ntqdatabrowser.h | 177 +++++ src/sql/ntqdatatable.h | 244 ++++++ src/sql/ntqdataview.h | 90 +++ src/sql/ntqeditorfactory.h | 76 ++ src/sql/ntqsql.h | 100 +++ src/sql/ntqsqlcursor.h | 160 ++++ src/sql/ntqsqldatabase.h | 155 ++++ src/sql/ntqsqldriver.h | 125 +++ src/sql/ntqsqldriverplugin.h | 72 ++ src/sql/ntqsqleditorfactory.h | 77 ++ src/sql/ntqsqlerror.h | 93 +++ src/sql/ntqsqlfield.h | 154 ++++ src/sql/ntqsqlform.h | 108 +++ src/sql/ntqsqlindex.h | 99 +++ src/sql/ntqsqlpropertymap.h | 78 ++ src/sql/ntqsqlquery.h | 133 ++++ src/sql/ntqsqlrecord.h | 141 ++++ src/sql/ntqsqlresult.h | 115 +++ src/sql/ntqsqlselectcursor.h | 104 +++ src/sql/qdatabrowser.cpp | 8 +- src/sql/qdatabrowser.h | 177 ----- src/sql/qdatatable.cpp | 26 +- src/sql/qdatatable.h | 244 ------ src/sql/qdataview.cpp | 4 +- src/sql/qdataview.h | 90 --- src/sql/qeditorfactory.cpp | 16 +- src/sql/qeditorfactory.h | 76 -- src/sql/qsql.cpp | 2 +- src/sql/qsql.h | 100 --- src/sql/qsqlcursor.cpp | 14 +- src/sql/qsqlcursor.h | 160 ---- src/sql/qsqldatabase.cpp | 18 +- src/sql/qsqldatabase.h | 155 ---- src/sql/qsqldriver.cpp | 6 +- src/sql/qsqldriver.h | 125 --- src/sql/qsqldriverplugin.cpp | 4 +- src/sql/qsqldriverplugin.h | 72 -- src/sql/qsqleditorfactory.cpp | 18 +- src/sql/qsqleditorfactory.h | 77 -- src/sql/qsqlerror.cpp | 6 +- src/sql/qsqlerror.h | 93 --- src/sql/qsqlextension_p.h | 12 +- src/sql/qsqlfield.cpp | 6 +- src/sql/qsqlfield.h | 154 ---- src/sql/qsqlform.cpp | 14 +- src/sql/qsqlform.h | 108 --- src/sql/qsqlindex.cpp | 6 +- src/sql/qsqlindex.h | 99 --- src/sql/qsqlmanager_p.cpp | 16 +- src/sql/qsqlmanager_p.h | 14 +- src/sql/qsqlpropertymap.cpp | 12 +- src/sql/qsqlpropertymap.h | 78 -- src/sql/qsqlquery.cpp | 14 +- src/sql/qsqlquery.h | 133 ---- src/sql/qsqlrecord.cpp | 14 +- src/sql/qsqlrecord.h | 141 ---- src/sql/qsqlresult.cpp | 2 +- src/sql/qsqlresult.h | 115 --- src/sql/qsqlselectcursor.cpp | 6 +- src/sql/qsqlselectcursor.h | 104 --- src/sql/qt_sql.pri | 38 +- src/styles/ntqcdestyle.h | 86 +++ src/styles/ntqcommonstyle.h | 137 ++++ src/styles/ntqcompactstyle.h | 75 ++ src/styles/ntqinterlacestyle.h | 107 +++ src/styles/ntqmotifplusstyle.h | 124 +++ src/styles/ntqmotifstyle.h | 136 ++++ src/styles/ntqplatinumstyle.h | 117 +++ src/styles/ntqsgistyle.h | 133 ++++ src/styles/ntqstylefactory.h | 62 ++ src/styles/ntqstyleplugin.h | 72 ++ src/styles/ntqwindowsstyle.h | 135 ++++ src/styles/qcdestyle.cpp | 10 +- src/styles/qcdestyle.h | 86 --- src/styles/qcommonstyle.cpp | 50 +- src/styles/qcommonstyle.h | 137 ---- src/styles/qcompactstyle.cpp | 14 +- src/styles/qcompactstyle.h | 75 -- src/styles/qinterlacestyle.cpp | 26 +- src/styles/qinterlacestyle.h | 107 --- src/styles/qmotifplusstyle.cpp | 40 +- src/styles/qmotifplusstyle.h | 124 --- src/styles/qmotifstyle.cpp | 42 +- src/styles/qmotifstyle.h | 136 ---- src/styles/qplatinumstyle.cpp | 22 +- src/styles/qplatinumstyle.h | 117 --- src/styles/qsgistyle.cpp | 36 +- src/styles/qsgistyle.h | 133 ---- src/styles/qstylefactory.cpp | 20 +- src/styles/qstylefactory.h | 62 -- src/styles/qstyleplugin.cpp | 8 +- src/styles/qstyleplugin.h | 72 -- src/styles/qt_styles.pri | 22 +- src/styles/qwindowsstyle.cpp | 50 +- src/styles/qwindowsstyle.h | 135 ---- src/table/ntqtable.h | 564 ++++++++++++++ src/table/qt_table.pri | 2 +- src/table/qtable.cpp | 36 +- src/table/qtable.h | 564 -------------- src/tools/ntqasciicache.h | 125 +++ src/tools/ntqasciidict.h | 123 +++ src/tools/ntqbitarray.h | 169 ++++ src/tools/ntqbuffer.h | 103 +++ src/tools/ntqcache.h | 121 +++ src/tools/ntqcleanuphandler.h | 130 ++++ src/tools/ntqcstring.h | 396 ++++++++++ src/tools/ntqdatastream.h | 193 +++++ src/tools/ntqdatetime.h | 253 ++++++ src/tools/ntqdeepcopy.h | 80 ++ src/tools/ntqdict.h | 123 +++ src/tools/ntqdir.h | 250 ++++++ src/tools/ntqfeatures.h | 994 ++++++++++++++++++++++++ src/tools/ntqfile.h | 131 ++++ src/tools/ntqfileinfo.h | 157 ++++ src/tools/ntqgarray.h | 134 ++++ src/tools/ntqgcache.h | 131 ++++ src/tools/ntqgdict.h | 225 ++++++ src/tools/ntqgeneric.h | 46 ++ src/tools/ntqglist.h | 271 +++++++ src/tools/ntqglobal.h | 1141 ++++++++++++++++++++++++++++ src/tools/ntqgvector.h | 124 +++ src/tools/ntqintcache.h | 124 +++ src/tools/ntqintdict.h | 119 +++ src/tools/ntqiodevice.h | 164 ++++ src/tools/ntqlibrary.h | 86 +++ src/tools/ntqlocale.h | 494 ++++++++++++ src/tools/ntqmap.h | 877 +++++++++++++++++++++ src/tools/ntqmemarray.h | 121 +++ src/tools/ntqmutex.h | 114 +++ src/tools/ntqpair.h | 109 +++ src/tools/ntqptrcollection.h | 80 ++ src/tools/ntqptrdict.h | 118 +++ src/tools/ntqptrlist.h | 195 +++++ src/tools/ntqptrqueue.h | 94 +++ src/tools/ntqptrstack.h | 94 +++ src/tools/ntqptrvector.h | 118 +++ src/tools/ntqregexp.h | 120 +++ src/tools/ntqsemaphore.h | 81 ++ src/tools/ntqsettings.h | 159 ++++ src/tools/ntqshared.h | 58 ++ src/tools/ntqsortedlist.h | 63 ++ src/tools/ntqstring.h | 1115 +++++++++++++++++++++++++++ src/tools/ntqstringlist.h | 106 +++ src/tools/ntqstrlist.h | 109 +++ src/tools/ntqstrvec.h | 85 +++ src/tools/ntqtextstream.h | 338 ++++++++ src/tools/ntqthreadstorage.h | 95 +++ src/tools/ntqtl.h | 325 ++++++++ src/tools/ntquuid.h | 194 +++++ src/tools/ntqvaluelist.h | 670 ++++++++++++++++ src/tools/ntqvaluestack.h | 67 ++ src/tools/ntqvaluevector.h | 577 ++++++++++++++ src/tools/ntqwaitcondition.h | 79 ++ src/tools/ntqwinexport.h | 224 ++++++ src/tools/qasciicache.h | 125 --- src/tools/qasciidict.h | 123 --- src/tools/qbitarray.cpp | 8 +- src/tools/qbitarray.h | 169 ---- src/tools/qbuffer.cpp | 4 +- src/tools/qbuffer.h | 103 --- src/tools/qcache.h | 121 --- src/tools/qcleanuphandler.h | 130 ---- src/tools/qcom_p.h | 6 +- src/tools/qcomlibrary.cpp | 10 +- src/tools/qcomlibrary_p.h | 2 +- src/tools/qcomponentfactory.cpp | 6 +- src/tools/qcstring.cpp | 8 +- src/tools/qcstring.h | 396 ---------- src/tools/qdatastream.cpp | 6 +- src/tools/qdatastream.h | 193 ----- src/tools/qdatetime.cpp | 12 +- src/tools/qdatetime.h | 253 ------ src/tools/qdeepcopy.cpp | 4 +- src/tools/qdeepcopy.h | 80 -- src/tools/qdict.h | 123 --- src/tools/qdir.cpp | 18 +- src/tools/qdir.h | 250 ------ src/tools/qdir_p.h | 4 +- src/tools/qdir_unix.cpp | 8 +- src/tools/qfeatures.h | 994 ------------------------ src/tools/qfile.cpp | 6 +- src/tools/qfile.h | 131 ---- src/tools/qfile_unix.cpp | 2 +- src/tools/qfileinfo.cpp | 8 +- src/tools/qfileinfo.h | 157 ---- src/tools/qfileinfo_unix.cpp | 6 +- src/tools/qgarray.cpp | 8 +- src/tools/qgarray.h | 134 ---- src/tools/qgcache.cpp | 12 +- src/tools/qgcache.h | 131 ---- src/tools/qgdict.cpp | 10 +- src/tools/qgdict.h | 225 ------ src/tools/qgeneric.h | 46 -- src/tools/qglist.cpp | 16 +- src/tools/qglist.h | 271 ------- src/tools/qglobal.cpp | 10 +- src/tools/qglobal.h | 1141 ---------------------------- src/tools/qgpluginmanager.cpp | 6 +- src/tools/qgpluginmanager_p.h | 8 +- src/tools/qgvector.cpp | 10 +- src/tools/qgvector.h | 124 --- src/tools/qintcache.h | 124 --- src/tools/qintdict.h | 119 --- src/tools/qiodevice.cpp | 4 +- src/tools/qiodevice.h | 164 ---- src/tools/qlibrary.cpp | 6 +- src/tools/qlibrary.h | 86 --- src/tools/qlibrary_p.h | 4 +- src/tools/qlocale.cpp | 6 +- src/tools/qlocale.h | 494 ------------ src/tools/qlocale_p.h | 2 +- src/tools/qmap.cpp | 2 +- src/tools/qmap.h | 877 --------------------- src/tools/qmemarray.h | 121 --- src/tools/qmutex.h | 114 --- src/tools/qmutex_unix.cpp | 6 +- src/tools/qmutexpool.cpp | 2 +- src/tools/qmutexpool_p.h | 4 +- src/tools/qpair.h | 109 --- src/tools/qptrcollection.cpp | 4 +- src/tools/qptrcollection.h | 80 -- src/tools/qptrdict.h | 118 --- src/tools/qptrlist.h | 195 ----- src/tools/qptrqueue.h | 94 --- src/tools/qptrstack.h | 94 --- src/tools/qptrvector.h | 118 --- src/tools/qregexp.cpp | 24 +- src/tools/qregexp.h | 120 --- src/tools/qsemaphore.cpp | 8 +- src/tools/qsemaphore.h | 81 -- src/tools/qsettings.cpp | 16 +- src/tools/qsettings.h | 159 ---- src/tools/qsettings_p.h | 6 +- src/tools/qshared.h | 58 -- src/tools/qsortedlist.h | 63 -- src/tools/qstring.cpp | 26 +- src/tools/qstring.h | 1115 --------------------------- src/tools/qstringlist.cpp | 18 +- src/tools/qstringlist.h | 106 --- src/tools/qstrlist.h | 109 --- src/tools/qstrvec.h | 85 --- src/tools/qt_tools.pri | 102 +-- src/tools/qtextstream.cpp | 14 +- src/tools/qtextstream.h | 338 -------- src/tools/qthreadinstance_p.h | 4 +- src/tools/qthreadstorage.h | 95 --- src/tools/qthreadstorage_unix.cpp | 2 +- src/tools/qtl.h | 325 -------- src/tools/qucom_p.h | 4 +- src/tools/qunicodetables.cpp | 4 +- src/tools/qunicodetables_p.h | 2 +- src/tools/quuid.cpp | 8 +- src/tools/quuid.h | 194 ----- src/tools/qvaluelist.h | 670 ---------------- src/tools/qvaluestack.h | 67 -- src/tools/qvaluevector.h | 577 -------------- src/tools/qwaitcondition.h | 79 -- src/tools/qwaitcondition_unix.cpp | 6 +- src/tools/qwinexport.cpp | 56 +- src/tools/qwinexport.h | 224 ------ src/widgets/ntqaction.h | 218 ++++++ src/widgets/ntqbutton.h | 234 ++++++ src/widgets/ntqbuttongroup.h | 121 +++ src/widgets/ntqcheckbox.h | 96 +++ src/widgets/ntqcombobox.h | 206 +++++ src/widgets/ntqdatetimeedit.h | 293 +++++++ src/widgets/ntqdial.h | 153 ++++ src/widgets/ntqdockarea.h | 191 +++++ src/widgets/ntqdockwindow.h | 237 ++++++ src/widgets/ntqframe.h | 171 +++++ src/widgets/ntqgrid.h | 77 ++ src/widgets/ntqgridview.h | 139 ++++ src/widgets/ntqgroupbox.h | 165 ++++ src/widgets/ntqhbox.h | 76 ++ src/widgets/ntqhbuttongroup.h | 68 ++ src/widgets/ntqheader.h | 219 ++++++ src/widgets/ntqhgroupbox.h | 67 ++ src/widgets/ntqlabel.h | 174 +++++ src/widgets/ntqlcdnumber.h | 146 ++++ src/widgets/ntqlineedit.h | 232 ++++++ src/widgets/ntqlistbox.h | 435 +++++++++++ src/widgets/ntqlistview.h | 605 +++++++++++++++ src/widgets/ntqmainwindow.h | 261 +++++++ src/widgets/ntqmenubar.h | 205 +++++ src/widgets/ntqmenudata.h | 286 +++++++ src/widgets/ntqmultilineedit.h | 141 ++++ src/widgets/ntqpopupmenu.h | 201 +++++ src/widgets/ntqprogressbar.h | 149 ++++ src/widgets/ntqpushbutton.h | 149 ++++ src/widgets/ntqradiobutton.h | 91 +++ src/widgets/ntqrangecontrol.h | 194 +++++ src/widgets/ntqscrollbar.h | 197 +++++ src/widgets/ntqscrollview.h | 269 +++++++ src/widgets/ntqslider.h | 199 +++++ src/widgets/ntqspinbox.h | 172 +++++ src/widgets/ntqsplashscreen.h | 80 ++ src/widgets/ntqsplitter.h | 225 ++++++ src/widgets/ntqstatusbar.h | 96 +++ src/widgets/ntqsyntaxhighlighter.h | 81 ++ src/widgets/ntqtabbar.h | 186 +++++ src/widgets/ntqtabwidget.h | 162 ++++ src/widgets/ntqtextbrowser.h | 107 +++ src/widgets/ntqtextedit.h | 616 +++++++++++++++ src/widgets/ntqtextview.h | 74 ++ src/widgets/ntqtoolbar.h | 117 +++ src/widgets/ntqtoolbox.h | 126 +++ src/widgets/ntqtoolbutton.h | 192 +++++ src/widgets/ntqtooltip.h | 149 ++++ src/widgets/ntqvalidator.h | 169 ++++ src/widgets/ntqvbox.h | 65 ++ src/widgets/ntqvbuttongroup.h | 69 ++ src/widgets/ntqvgroupbox.h | 68 ++ src/widgets/ntqwhatsthis.h | 81 ++ src/widgets/ntqwidgetplugin.h | 120 +++ src/widgets/ntqwidgetstack.h | 112 +++ src/widgets/qaction.cpp | 26 +- src/widgets/qaction.h | 218 ------ src/widgets/qbutton.cpp | 26 +- src/widgets/qbutton.h | 234 ------ src/widgets/qbuttongroup.cpp | 12 +- src/widgets/qbuttongroup.h | 121 --- src/widgets/qcheckbox.cpp | 20 +- src/widgets/qcheckbox.h | 96 --- src/widgets/qcombobox.cpp | 32 +- src/widgets/qcombobox.h | 206 ----- src/widgets/qdatetimeedit.cpp | 22 +- src/widgets/qdatetimeedit.h | 293 ------- src/widgets/qdial.cpp | 20 +- src/widgets/qdial.h | 153 ---- src/widgets/qdialogbuttons.cpp | 18 +- src/widgets/qdialogbuttons_p.h | 2 +- src/widgets/qdockarea.cpp | 20 +- src/widgets/qdockarea.h | 191 ----- src/widgets/qdockwindow.cpp | 32 +- src/widgets/qdockwindow.h | 237 ------ src/widgets/qeffects.cpp | 16 +- src/widgets/qeffects_p.h | 2 +- src/widgets/qframe.cpp | 12 +- src/widgets/qframe.h | 171 ----- src/widgets/qgrid.cpp | 8 +- src/widgets/qgrid.h | 77 -- src/widgets/qgridview.cpp | 6 +- src/widgets/qgridview.h | 139 ---- src/widgets/qgroupbox.cpp | 30 +- src/widgets/qgroupbox.h | 165 ---- src/widgets/qhbox.cpp | 10 +- src/widgets/qhbox.h | 76 -- src/widgets/qhbuttongroup.cpp | 4 +- src/widgets/qhbuttongroup.h | 68 -- src/widgets/qheader.cpp | 18 +- src/widgets/qheader.h | 219 ------ src/widgets/qhgroupbox.cpp | 4 +- src/widgets/qhgroupbox.h | 67 -- src/widgets/qlabel.cpp | 26 +- src/widgets/qlabel.h | 174 ----- src/widgets/qlcdnumber.cpp | 8 +- src/widgets/qlcdnumber.h | 146 ---- src/widgets/qlineedit.cpp | 38 +- src/widgets/qlineedit.h | 232 ------ src/widgets/qlistbox.cpp | 38 +- src/widgets/qlistbox.h | 435 ----------- src/widgets/qlistview.cpp | 50 +- src/widgets/qlistview.h | 605 --------------- src/widgets/qmainwindow.cpp | 46 +- src/widgets/qmainwindow.h | 261 ------- src/widgets/qmenubar.cpp | 30 +- src/widgets/qmenubar.h | 205 ----- src/widgets/qmenudata.cpp | 24 +- src/widgets/qmenudata.h | 286 ------- src/widgets/qmultilineedit.cpp | 26 +- src/widgets/qmultilineedit.h | 141 ---- src/widgets/qpopupmenu.cpp | 36 +- src/widgets/qpopupmenu.h | 201 ----- src/widgets/qprogressbar.cpp | 14 +- src/widgets/qprogressbar.h | 149 ---- src/widgets/qpushbutton.cpp | 28 +- src/widgets/qpushbutton.h | 149 ---- src/widgets/qradiobutton.cpp | 22 +- src/widgets/qradiobutton.h | 91 --- src/widgets/qrangecontrol.cpp | 6 +- src/widgets/qrangecontrol.h | 194 ----- src/widgets/qscrollbar.cpp | 16 +- src/widgets/qscrollbar.h | 197 ----- src/widgets/qscrollview.cpp | 28 +- src/widgets/qscrollview.h | 269 ------- src/widgets/qslider.cpp | 16 +- src/widgets/qslider.h | 199 ----- src/widgets/qspinbox.cpp | 22 +- src/widgets/qspinbox.h | 172 ----- src/widgets/qspinwidget.cpp | 10 +- src/widgets/qsplashscreen.cpp | 10 +- src/widgets/qsplashscreen.h | 80 -- src/widgets/qsplitter.cpp | 20 +- src/widgets/qsplitter.h | 225 ------ src/widgets/qstatusbar.cpp | 18 +- src/widgets/qstatusbar.h | 96 --- src/widgets/qsyntaxhighlighter.cpp | 8 +- src/widgets/qsyntaxhighlighter.h | 81 -- src/widgets/qsyntaxhighlighter_p.h | 2 +- src/widgets/qt_widgets.pri | 114 +-- src/widgets/qtabbar.cpp | 26 +- src/widgets/qtabbar.h | 186 ----- src/widgets/qtabwidget.cpp | 22 +- src/widgets/qtabwidget.h | 162 ---- src/widgets/qtextbrowser.cpp | 32 +- src/widgets/qtextbrowser.h | 107 --- src/widgets/qtextedit.cpp | 62 +- src/widgets/qtextedit.h | 616 --------------- src/widgets/qtextview.cpp | 2 +- src/widgets/qtextview.h | 74 -- src/widgets/qtitlebar.cpp | 20 +- src/widgets/qtitlebar_p.h | 4 +- src/widgets/qtoolbar.cpp | 34 +- src/widgets/qtoolbar.h | 117 --- src/widgets/qtoolbox.cpp | 28 +- src/widgets/qtoolbox.h | 126 --- src/widgets/qtoolbutton.cpp | 32 +- src/widgets/qtoolbutton.h | 192 ----- src/widgets/qtooltip.cpp | 16 +- src/widgets/qtooltip.h | 149 ---- src/widgets/qvalidator.cpp | 2 +- src/widgets/qvalidator.h | 169 ---- src/widgets/qvbox.cpp | 4 +- src/widgets/qvbox.h | 65 -- src/widgets/qvbuttongroup.cpp | 4 +- src/widgets/qvbuttongroup.h | 69 -- src/widgets/qvgroupbox.cpp | 4 +- src/widgets/qvgroupbox.h | 68 -- src/widgets/qwhatsthis.cpp | 32 +- src/widgets/qwhatsthis.h | 81 -- src/widgets/qwidgetinterface_p.h | 2 +- src/widgets/qwidgetplugin.cpp | 12 +- src/widgets/qwidgetplugin.h | 120 --- src/widgets/qwidgetresizehandler.cpp | 8 +- src/widgets/qwidgetresizehandler_p.h | 2 +- src/widgets/qwidgetstack.cpp | 14 +- src/widgets/qwidgetstack.h | 112 --- src/workspace/ntqworkspace.h | 169 ++++ src/workspace/qt_workspace.pri | 2 +- src/workspace/qworkspace.cpp | 56 +- src/workspace/qworkspace.h | 169 ---- src/xml/ntqdom.h | 677 +++++++++++++++++ src/xml/ntqxml.h | 531 +++++++++++++ src/xml/qdom.cpp | 52 +- src/xml/qdom.h | 677 ----------------- src/xml/qsvgdevice.cpp | 18 +- src/xml/qsvgdevice_p.h | 6 +- src/xml/qt_xml.pri | 2 +- src/xml/qxml.cpp | 44 +- src/xml/qxml.h | 531 ------------- 1012 files changed, 56070 insertions(+), 56070 deletions(-) create mode 100644 src/canvas/ntqcanvas.h delete mode 100644 src/canvas/qcanvas.h create mode 100644 src/codecs/ntqbig5codec.h create mode 100644 src/codecs/ntqeucjpcodec.h create mode 100644 src/codecs/ntqeuckrcodec.h create mode 100644 src/codecs/ntqgb18030codec.h create mode 100644 src/codecs/ntqgbkcodec.h create mode 100644 src/codecs/ntqjiscodec.h create mode 100644 src/codecs/ntqjpunicode.h create mode 100644 src/codecs/ntqrtlcodec.h create mode 100644 src/codecs/ntqsjiscodec.h create mode 100644 src/codecs/ntqtextcodec.h create mode 100644 src/codecs/ntqtextcodecfactory.h create mode 100644 src/codecs/ntqtextcodecplugin.h create mode 100644 src/codecs/ntqtsciicodec.h create mode 100644 src/codecs/ntqutfcodec.h delete mode 100644 src/codecs/qbig5codec.h delete mode 100644 src/codecs/qeucjpcodec.h delete mode 100644 src/codecs/qeuckrcodec.h delete mode 100644 src/codecs/qgb18030codec.h delete mode 100644 src/codecs/qgbkcodec.h delete mode 100644 src/codecs/qjiscodec.h delete mode 100644 src/codecs/qjpunicode.h delete mode 100644 src/codecs/qrtlcodec.h delete mode 100644 src/codecs/qsjiscodec.h delete mode 100644 src/codecs/qtextcodec.h delete mode 100644 src/codecs/qtextcodecfactory.h delete mode 100644 src/codecs/qtextcodecplugin.h delete mode 100644 src/codecs/qtsciicodec.h delete mode 100644 src/codecs/qutfcodec.h create mode 100644 src/compat/ntqapp.h create mode 100644 src/compat/ntqarray.h create mode 100644 src/compat/ntqbitarry.h create mode 100644 src/compat/ntqbttngrp.h create mode 100644 src/compat/ntqchkbox.h create mode 100644 src/compat/ntqclipbrd.h create mode 100644 src/compat/ntqcollect.h create mode 100644 src/compat/ntqcollection.h create mode 100644 src/compat/ntqcombo.h create mode 100644 src/compat/ntqconnect.h create mode 100644 src/compat/ntqdatetm.h create mode 100644 src/compat/ntqdrawutl.h create mode 100644 src/compat/ntqdstream.h create mode 100644 src/compat/ntqfiledef.h create mode 100644 src/compat/ntqfiledlg.h create mode 100644 src/compat/ntqfileinf.h create mode 100644 src/compat/ntqfontinf.h create mode 100644 src/compat/ntqfontmet.h create mode 100644 src/compat/ntqgrpbox.h create mode 100644 src/compat/ntqintcach.h create mode 100644 src/compat/ntqiodev.h create mode 100644 src/compat/ntqlcdnum.h create mode 100644 src/compat/ntqlined.h create mode 100644 src/compat/ntqlist.h create mode 100644 src/compat/ntqmenudta.h create mode 100644 src/compat/ntqmetaobj.h create mode 100644 src/compat/ntqmlined.h create mode 100644 src/compat/ntqmsgbox.h create mode 100644 src/compat/ntqmultilinedit.h create mode 100644 src/compat/ntqobjcoll.h create mode 100644 src/compat/ntqobjdefs.h create mode 100644 src/compat/ntqpaintd.h create mode 100644 src/compat/ntqpaintdc.h create mode 100644 src/compat/ntqpdevmet.h create mode 100644 src/compat/ntqpmcache.h create mode 100644 src/compat/ntqpntarry.h create mode 100644 src/compat/ntqpopmenu.h create mode 100644 src/compat/ntqprndlg.h create mode 100644 src/compat/ntqprogbar.h create mode 100644 src/compat/ntqprogdlg.h create mode 100644 src/compat/ntqpsprn.h create mode 100644 src/compat/ntqpushbt.h create mode 100644 src/compat/ntqqueue.h create mode 100644 src/compat/ntqradiobt.h create mode 100644 src/compat/ntqrangect.h create mode 100644 src/compat/ntqscrbar.h create mode 100644 src/compat/ntqsocknot.h create mode 100644 src/compat/ntqstack.h create mode 100644 src/compat/ntqtabdlg.h create mode 100644 src/compat/ntqtstream.h create mode 100644 src/compat/ntqvector.h create mode 100644 src/compat/ntqwidcoll.h create mode 100644 src/compat/ntqwindefs.h delete mode 100644 src/compat/qapp.h delete mode 100644 src/compat/qarray.h delete mode 100644 src/compat/qbitarry.h delete mode 100644 src/compat/qbttngrp.h delete mode 100644 src/compat/qchkbox.h delete mode 100644 src/compat/qclipbrd.h delete mode 100644 src/compat/qcollect.h delete mode 100644 src/compat/qcollection.h delete mode 100644 src/compat/qcombo.h delete mode 100644 src/compat/qconnect.h delete mode 100644 src/compat/qdatetm.h delete mode 100644 src/compat/qdrawutl.h delete mode 100644 src/compat/qdstream.h delete mode 100644 src/compat/qfiledef.h delete mode 100644 src/compat/qfiledlg.h delete mode 100644 src/compat/qfileinf.h delete mode 100644 src/compat/qfontinf.h delete mode 100644 src/compat/qfontmet.h delete mode 100644 src/compat/qgrpbox.h delete mode 100644 src/compat/qintcach.h delete mode 100644 src/compat/qiodev.h delete mode 100644 src/compat/qlcdnum.h delete mode 100644 src/compat/qlined.h delete mode 100644 src/compat/qlist.h delete mode 100644 src/compat/qmenudta.h delete mode 100644 src/compat/qmetaobj.h delete mode 100644 src/compat/qmlined.h delete mode 100644 src/compat/qmsgbox.h delete mode 100644 src/compat/qmultilinedit.h delete mode 100644 src/compat/qobjcoll.h delete mode 100644 src/compat/qobjdefs.h delete mode 100644 src/compat/qpaintd.h delete mode 100644 src/compat/qpaintdc.h delete mode 100644 src/compat/qpdevmet.h delete mode 100644 src/compat/qpmcache.h delete mode 100644 src/compat/qpntarry.h delete mode 100644 src/compat/qpopmenu.h delete mode 100644 src/compat/qprndlg.h delete mode 100644 src/compat/qprogbar.h delete mode 100644 src/compat/qprogdlg.h delete mode 100644 src/compat/qpsprn.h delete mode 100644 src/compat/qpushbt.h delete mode 100644 src/compat/qqueue.h delete mode 100644 src/compat/qradiobt.h delete mode 100644 src/compat/qrangect.h delete mode 100644 src/compat/qscrbar.h delete mode 100644 src/compat/qsocknot.h delete mode 100644 src/compat/qstack.h delete mode 100644 src/compat/qtabdlg.h delete mode 100644 src/compat/qtstream.h delete mode 100644 src/compat/qvector.h delete mode 100644 src/compat/qwidcoll.h delete mode 100644 src/compat/qwindefs.h create mode 100644 src/dialogs/ntqcolordialog.h create mode 100644 src/dialogs/ntqdialog.h create mode 100644 src/dialogs/ntqerrormessage.h create mode 100644 src/dialogs/ntqfiledialog.h create mode 100644 src/dialogs/ntqfontdialog.h create mode 100644 src/dialogs/ntqinputdialog.h create mode 100644 src/dialogs/ntqmessagebox.h create mode 100644 src/dialogs/ntqprintdialog.h create mode 100644 src/dialogs/ntqprogressdialog.h create mode 100644 src/dialogs/ntqsemimodal.h create mode 100644 src/dialogs/ntqtabdialog.h create mode 100644 src/dialogs/ntqwizard.h delete mode 100644 src/dialogs/qcolordialog.h delete mode 100644 src/dialogs/qdialog.h delete mode 100644 src/dialogs/qerrormessage.h delete mode 100644 src/dialogs/qfiledialog.h delete mode 100644 src/dialogs/qfontdialog.h delete mode 100644 src/dialogs/qinputdialog.h delete mode 100644 src/dialogs/qmessagebox.h delete mode 100644 src/dialogs/qprintdialog.h delete mode 100644 src/dialogs/qprogressdialog.h delete mode 100644 src/dialogs/qsemimodal.h delete mode 100644 src/dialogs/qtabdialog.h delete mode 100644 src/dialogs/qwizard.h create mode 100644 src/iconview/ntqiconview.h delete mode 100644 src/iconview/qiconview.h create mode 100644 src/inputmethod/ntqinputcontextfactory.h create mode 100644 src/inputmethod/ntqinputcontextplugin.h delete mode 100644 src/inputmethod/qinputcontextfactory.h delete mode 100644 src/inputmethod/qinputcontextplugin.h create mode 100644 src/kernel/ntq1xcompatibility.h create mode 100644 src/kernel/ntqabstractlayout.h create mode 100644 src/kernel/ntqaccel.h create mode 100644 src/kernel/ntqaccessible.h create mode 100644 src/kernel/ntqapplication.h create mode 100644 src/kernel/ntqasyncimageio.h create mode 100644 src/kernel/ntqasyncio.h create mode 100644 src/kernel/ntqbitmap.h create mode 100644 src/kernel/ntqbrush.h create mode 100644 src/kernel/ntqclipboard.h create mode 100644 src/kernel/ntqcolor.h create mode 100644 src/kernel/ntqconnection.h create mode 100644 src/kernel/ntqcursor.h create mode 100644 src/kernel/ntqdesktopwidget.h create mode 100644 src/kernel/ntqdragobject.h create mode 100644 src/kernel/ntqdrawutil.h create mode 100644 src/kernel/ntqdropsite.h create mode 100644 src/kernel/ntqevent.h create mode 100644 src/kernel/ntqeventloop.h create mode 100644 src/kernel/ntqfocusdata.h create mode 100644 src/kernel/ntqfont.h create mode 100644 src/kernel/ntqfontdatabase.h create mode 100644 src/kernel/ntqfontinfo.h create mode 100644 src/kernel/ntqfontmetrics.h create mode 100644 src/kernel/ntqgif.h create mode 100644 src/kernel/ntqgplugin.h create mode 100644 src/kernel/ntqguardedptr.h create mode 100644 src/kernel/ntqiconset.h create mode 100644 src/kernel/ntqimage.h create mode 100644 src/kernel/ntqimageformatplugin.h create mode 100644 src/kernel/ntqinputcontext.h create mode 100644 src/kernel/ntqjpegio.h create mode 100644 src/kernel/ntqkeycode.h create mode 100644 src/kernel/ntqkeysequence.h create mode 100644 src/kernel/ntqlayout.h create mode 100644 src/kernel/ntqlocalfs.h create mode 100644 src/kernel/ntqmetaobject.h create mode 100644 src/kernel/ntqmime.h create mode 100644 src/kernel/ntqmngio.h create mode 100644 src/kernel/ntqmovie.h create mode 100644 src/kernel/ntqnamespace.h create mode 100644 src/kernel/ntqnetworkprotocol.h create mode 100644 src/kernel/ntqobject.h create mode 100644 src/kernel/ntqobjectcleanuphandler.h create mode 100644 src/kernel/ntqobjectdefs.h create mode 100644 src/kernel/ntqobjectdict.h create mode 100644 src/kernel/ntqobjectlist.h create mode 100644 src/kernel/ntqpaintdevice.h create mode 100644 src/kernel/ntqpaintdevicedefs.h create mode 100644 src/kernel/ntqpaintdevicemetrics.h create mode 100644 src/kernel/ntqpainter.h create mode 100644 src/kernel/ntqpalette.h create mode 100644 src/kernel/ntqpen.h create mode 100644 src/kernel/ntqpicture.h create mode 100644 src/kernel/ntqpixmap.h create mode 100644 src/kernel/ntqpixmapcache.h create mode 100644 src/kernel/ntqpngio.h create mode 100644 src/kernel/ntqpoint.h create mode 100644 src/kernel/ntqpointarray.h create mode 100644 src/kernel/ntqpolygonscanner.h create mode 100644 src/kernel/ntqprinter.h create mode 100644 src/kernel/ntqprocess.h create mode 100644 src/kernel/ntqrect.h create mode 100644 src/kernel/ntqregion.h create mode 100644 src/kernel/ntqsession.h create mode 100644 src/kernel/ntqsessionmanager.h create mode 100644 src/kernel/ntqsignal.h create mode 100644 src/kernel/ntqsignalmapper.h create mode 100644 src/kernel/ntqsignalslotimp.h create mode 100644 src/kernel/ntqsimplerichtext.h create mode 100644 src/kernel/ntqsize.h create mode 100644 src/kernel/ntqsizegrip.h create mode 100644 src/kernel/ntqsizepolicy.h create mode 100644 src/kernel/ntqsocketnotifier.h create mode 100644 src/kernel/ntqsound.h create mode 100644 src/kernel/ntqstyle.h create mode 100644 src/kernel/ntqstylesheet.h create mode 100644 src/kernel/ntqt.h create mode 100644 src/kernel/ntqthread.h create mode 100644 src/kernel/ntqtimer.h create mode 100644 src/kernel/ntqtranslator.h create mode 100644 src/kernel/ntqurl.h create mode 100644 src/kernel/ntqurlinfo.h create mode 100644 src/kernel/ntqurloperator.h create mode 100644 src/kernel/ntqvariant.h create mode 100644 src/kernel/ntqvfbhdr.h create mode 100644 src/kernel/ntqwidget.h create mode 100644 src/kernel/ntqwidgetintdict.h create mode 100644 src/kernel/ntqwidgetlist.h create mode 100644 src/kernel/ntqwindowdefs.h create mode 100644 src/kernel/ntqwmatrix.h delete mode 100644 src/kernel/q1xcompatibility.h delete mode 100644 src/kernel/qabstractlayout.h delete mode 100644 src/kernel/qaccel.h delete mode 100644 src/kernel/qaccessible.h delete mode 100644 src/kernel/qapplication.h delete mode 100644 src/kernel/qasyncimageio.h delete mode 100644 src/kernel/qasyncio.h delete mode 100644 src/kernel/qbitmap.h delete mode 100644 src/kernel/qbrush.h delete mode 100644 src/kernel/qclipboard.h delete mode 100644 src/kernel/qcolor.h delete mode 100644 src/kernel/qconnection.h delete mode 100644 src/kernel/qcursor.h delete mode 100644 src/kernel/qdesktopwidget.h delete mode 100644 src/kernel/qdragobject.h delete mode 100644 src/kernel/qdrawutil.h delete mode 100644 src/kernel/qdropsite.h delete mode 100644 src/kernel/qevent.h delete mode 100644 src/kernel/qeventloop.h delete mode 100644 src/kernel/qfocusdata.h delete mode 100644 src/kernel/qfont.h delete mode 100644 src/kernel/qfontdatabase.h delete mode 100644 src/kernel/qfontinfo.h delete mode 100644 src/kernel/qfontmetrics.h delete mode 100644 src/kernel/qgif.h delete mode 100644 src/kernel/qgplugin.h delete mode 100644 src/kernel/qguardedptr.h delete mode 100644 src/kernel/qiconset.h delete mode 100644 src/kernel/qimage.h delete mode 100644 src/kernel/qimageformatplugin.h delete mode 100644 src/kernel/qinputcontext.h delete mode 100644 src/kernel/qjpegio.h delete mode 100644 src/kernel/qkeycode.h delete mode 100644 src/kernel/qkeysequence.h delete mode 100644 src/kernel/qlayout.h delete mode 100644 src/kernel/qlocalfs.h delete mode 100644 src/kernel/qmetaobject.h delete mode 100644 src/kernel/qmime.h delete mode 100644 src/kernel/qmngio.h delete mode 100644 src/kernel/qmovie.h delete mode 100644 src/kernel/qnamespace.h delete mode 100644 src/kernel/qnetworkprotocol.h delete mode 100644 src/kernel/qobject.h delete mode 100644 src/kernel/qobjectcleanuphandler.h delete mode 100644 src/kernel/qobjectdefs.h delete mode 100644 src/kernel/qobjectdict.h delete mode 100644 src/kernel/qobjectlist.h delete mode 100644 src/kernel/qpaintdevice.h delete mode 100644 src/kernel/qpaintdevicedefs.h delete mode 100644 src/kernel/qpaintdevicemetrics.h delete mode 100644 src/kernel/qpainter.h delete mode 100644 src/kernel/qpalette.h delete mode 100644 src/kernel/qpen.h delete mode 100644 src/kernel/qpicture.h delete mode 100644 src/kernel/qpixmap.h delete mode 100644 src/kernel/qpixmapcache.h delete mode 100644 src/kernel/qpngio.h delete mode 100644 src/kernel/qpoint.h delete mode 100644 src/kernel/qpointarray.h delete mode 100644 src/kernel/qpolygonscanner.h delete mode 100644 src/kernel/qprinter.h delete mode 100644 src/kernel/qprocess.h delete mode 100644 src/kernel/qrect.h delete mode 100644 src/kernel/qregion.h delete mode 100644 src/kernel/qsession.h delete mode 100644 src/kernel/qsessionmanager.h delete mode 100644 src/kernel/qsignal.h delete mode 100644 src/kernel/qsignalmapper.h delete mode 100644 src/kernel/qsignalslotimp.h delete mode 100644 src/kernel/qsimplerichtext.h delete mode 100644 src/kernel/qsize.h delete mode 100644 src/kernel/qsizegrip.h delete mode 100644 src/kernel/qsizepolicy.h delete mode 100644 src/kernel/qsocketnotifier.h delete mode 100644 src/kernel/qsound.h delete mode 100644 src/kernel/qstyle.h delete mode 100644 src/kernel/qstylesheet.h delete mode 100644 src/kernel/qt.h delete mode 100644 src/kernel/qthread.h delete mode 100644 src/kernel/qtimer.h delete mode 100644 src/kernel/qtranslator.h delete mode 100644 src/kernel/qurl.h delete mode 100644 src/kernel/qurlinfo.h delete mode 100644 src/kernel/qurloperator.h delete mode 100644 src/kernel/qvariant.h delete mode 100644 src/kernel/qvfbhdr.h delete mode 100644 src/kernel/qwidget.h delete mode 100644 src/kernel/qwidgetintdict.h delete mode 100644 src/kernel/qwidgetlist.h delete mode 100644 src/kernel/qwindowdefs.h delete mode 100644 src/kernel/qwmatrix.h create mode 100644 src/network/ntqdns.h create mode 100644 src/network/ntqftp.h create mode 100644 src/network/ntqhostaddress.h create mode 100644 src/network/ntqhttp.h create mode 100644 src/network/ntqnetwork.h create mode 100644 src/network/ntqserversocket.h create mode 100644 src/network/ntqsocket.h create mode 100644 src/network/ntqsocketdevice.h delete mode 100644 src/network/qdns.h delete mode 100644 src/network/qftp.h delete mode 100644 src/network/qhostaddress.h delete mode 100644 src/network/qhttp.h delete mode 100644 src/network/qnetwork.h delete mode 100644 src/network/qserversocket.h delete mode 100644 src/network/qsocket.h delete mode 100644 src/network/qsocketdevice.h create mode 100644 src/opengl/ntqgl.h create mode 100644 src/opengl/ntqglcolormap.h delete mode 100644 src/opengl/qgl.h delete mode 100644 src/opengl/qglcolormap.h create mode 100644 src/sql/ntqdatabrowser.h create mode 100644 src/sql/ntqdatatable.h create mode 100644 src/sql/ntqdataview.h create mode 100644 src/sql/ntqeditorfactory.h create mode 100644 src/sql/ntqsql.h create mode 100644 src/sql/ntqsqlcursor.h create mode 100644 src/sql/ntqsqldatabase.h create mode 100644 src/sql/ntqsqldriver.h create mode 100644 src/sql/ntqsqldriverplugin.h create mode 100644 src/sql/ntqsqleditorfactory.h create mode 100644 src/sql/ntqsqlerror.h create mode 100644 src/sql/ntqsqlfield.h create mode 100644 src/sql/ntqsqlform.h create mode 100644 src/sql/ntqsqlindex.h create mode 100644 src/sql/ntqsqlpropertymap.h create mode 100644 src/sql/ntqsqlquery.h create mode 100644 src/sql/ntqsqlrecord.h create mode 100644 src/sql/ntqsqlresult.h create mode 100644 src/sql/ntqsqlselectcursor.h delete mode 100644 src/sql/qdatabrowser.h delete mode 100644 src/sql/qdatatable.h delete mode 100644 src/sql/qdataview.h delete mode 100644 src/sql/qeditorfactory.h delete mode 100644 src/sql/qsql.h delete mode 100644 src/sql/qsqlcursor.h delete mode 100644 src/sql/qsqldatabase.h delete mode 100644 src/sql/qsqldriver.h delete mode 100644 src/sql/qsqldriverplugin.h delete mode 100644 src/sql/qsqleditorfactory.h delete mode 100644 src/sql/qsqlerror.h delete mode 100644 src/sql/qsqlfield.h delete mode 100644 src/sql/qsqlform.h delete mode 100644 src/sql/qsqlindex.h delete mode 100644 src/sql/qsqlpropertymap.h delete mode 100644 src/sql/qsqlquery.h delete mode 100644 src/sql/qsqlrecord.h delete mode 100644 src/sql/qsqlresult.h delete mode 100644 src/sql/qsqlselectcursor.h create mode 100644 src/styles/ntqcdestyle.h create mode 100644 src/styles/ntqcommonstyle.h create mode 100644 src/styles/ntqcompactstyle.h create mode 100644 src/styles/ntqinterlacestyle.h create mode 100644 src/styles/ntqmotifplusstyle.h create mode 100644 src/styles/ntqmotifstyle.h create mode 100644 src/styles/ntqplatinumstyle.h create mode 100644 src/styles/ntqsgistyle.h create mode 100644 src/styles/ntqstylefactory.h create mode 100644 src/styles/ntqstyleplugin.h create mode 100644 src/styles/ntqwindowsstyle.h delete mode 100644 src/styles/qcdestyle.h delete mode 100644 src/styles/qcommonstyle.h delete mode 100644 src/styles/qcompactstyle.h delete mode 100644 src/styles/qinterlacestyle.h delete mode 100644 src/styles/qmotifplusstyle.h delete mode 100644 src/styles/qmotifstyle.h delete mode 100644 src/styles/qplatinumstyle.h delete mode 100644 src/styles/qsgistyle.h delete mode 100644 src/styles/qstylefactory.h delete mode 100644 src/styles/qstyleplugin.h delete mode 100644 src/styles/qwindowsstyle.h create mode 100644 src/table/ntqtable.h delete mode 100644 src/table/qtable.h create mode 100644 src/tools/ntqasciicache.h create mode 100644 src/tools/ntqasciidict.h create mode 100644 src/tools/ntqbitarray.h create mode 100644 src/tools/ntqbuffer.h create mode 100644 src/tools/ntqcache.h create mode 100644 src/tools/ntqcleanuphandler.h create mode 100644 src/tools/ntqcstring.h create mode 100644 src/tools/ntqdatastream.h create mode 100644 src/tools/ntqdatetime.h create mode 100644 src/tools/ntqdeepcopy.h create mode 100644 src/tools/ntqdict.h create mode 100644 src/tools/ntqdir.h create mode 100644 src/tools/ntqfeatures.h create mode 100644 src/tools/ntqfile.h create mode 100644 src/tools/ntqfileinfo.h create mode 100644 src/tools/ntqgarray.h create mode 100644 src/tools/ntqgcache.h create mode 100644 src/tools/ntqgdict.h create mode 100644 src/tools/ntqgeneric.h create mode 100644 src/tools/ntqglist.h create mode 100644 src/tools/ntqglobal.h create mode 100644 src/tools/ntqgvector.h create mode 100644 src/tools/ntqintcache.h create mode 100644 src/tools/ntqintdict.h create mode 100644 src/tools/ntqiodevice.h create mode 100644 src/tools/ntqlibrary.h create mode 100644 src/tools/ntqlocale.h create mode 100644 src/tools/ntqmap.h create mode 100644 src/tools/ntqmemarray.h create mode 100644 src/tools/ntqmutex.h create mode 100644 src/tools/ntqpair.h create mode 100644 src/tools/ntqptrcollection.h create mode 100644 src/tools/ntqptrdict.h create mode 100644 src/tools/ntqptrlist.h create mode 100644 src/tools/ntqptrqueue.h create mode 100644 src/tools/ntqptrstack.h create mode 100644 src/tools/ntqptrvector.h create mode 100644 src/tools/ntqregexp.h create mode 100644 src/tools/ntqsemaphore.h create mode 100644 src/tools/ntqsettings.h create mode 100644 src/tools/ntqshared.h create mode 100644 src/tools/ntqsortedlist.h create mode 100644 src/tools/ntqstring.h create mode 100644 src/tools/ntqstringlist.h create mode 100644 src/tools/ntqstrlist.h create mode 100644 src/tools/ntqstrvec.h create mode 100644 src/tools/ntqtextstream.h create mode 100644 src/tools/ntqthreadstorage.h create mode 100644 src/tools/ntqtl.h create mode 100644 src/tools/ntquuid.h create mode 100644 src/tools/ntqvaluelist.h create mode 100644 src/tools/ntqvaluestack.h create mode 100644 src/tools/ntqvaluevector.h create mode 100644 src/tools/ntqwaitcondition.h create mode 100644 src/tools/ntqwinexport.h delete mode 100644 src/tools/qasciicache.h delete mode 100644 src/tools/qasciidict.h delete mode 100644 src/tools/qbitarray.h delete mode 100644 src/tools/qbuffer.h delete mode 100644 src/tools/qcache.h delete mode 100644 src/tools/qcleanuphandler.h delete mode 100644 src/tools/qcstring.h delete mode 100644 src/tools/qdatastream.h delete mode 100644 src/tools/qdatetime.h delete mode 100644 src/tools/qdeepcopy.h delete mode 100644 src/tools/qdict.h delete mode 100644 src/tools/qdir.h delete mode 100644 src/tools/qfeatures.h delete mode 100644 src/tools/qfile.h delete mode 100644 src/tools/qfileinfo.h delete mode 100644 src/tools/qgarray.h delete mode 100644 src/tools/qgcache.h delete mode 100644 src/tools/qgdict.h delete mode 100644 src/tools/qgeneric.h delete mode 100644 src/tools/qglist.h delete mode 100644 src/tools/qglobal.h delete mode 100644 src/tools/qgvector.h delete mode 100644 src/tools/qintcache.h delete mode 100644 src/tools/qintdict.h delete mode 100644 src/tools/qiodevice.h delete mode 100644 src/tools/qlibrary.h delete mode 100644 src/tools/qlocale.h delete mode 100644 src/tools/qmap.h delete mode 100644 src/tools/qmemarray.h delete mode 100644 src/tools/qmutex.h delete mode 100644 src/tools/qpair.h delete mode 100644 src/tools/qptrcollection.h delete mode 100644 src/tools/qptrdict.h delete mode 100644 src/tools/qptrlist.h delete mode 100644 src/tools/qptrqueue.h delete mode 100644 src/tools/qptrstack.h delete mode 100644 src/tools/qptrvector.h delete mode 100644 src/tools/qregexp.h delete mode 100644 src/tools/qsemaphore.h delete mode 100644 src/tools/qsettings.h delete mode 100644 src/tools/qshared.h delete mode 100644 src/tools/qsortedlist.h delete mode 100644 src/tools/qstring.h delete mode 100644 src/tools/qstringlist.h delete mode 100644 src/tools/qstrlist.h delete mode 100644 src/tools/qstrvec.h delete mode 100644 src/tools/qtextstream.h delete mode 100644 src/tools/qthreadstorage.h delete mode 100644 src/tools/qtl.h delete mode 100644 src/tools/quuid.h delete mode 100644 src/tools/qvaluelist.h delete mode 100644 src/tools/qvaluestack.h delete mode 100644 src/tools/qvaluevector.h delete mode 100644 src/tools/qwaitcondition.h delete mode 100644 src/tools/qwinexport.h create mode 100644 src/widgets/ntqaction.h create mode 100644 src/widgets/ntqbutton.h create mode 100644 src/widgets/ntqbuttongroup.h create mode 100644 src/widgets/ntqcheckbox.h create mode 100644 src/widgets/ntqcombobox.h create mode 100644 src/widgets/ntqdatetimeedit.h create mode 100644 src/widgets/ntqdial.h create mode 100644 src/widgets/ntqdockarea.h create mode 100644 src/widgets/ntqdockwindow.h create mode 100644 src/widgets/ntqframe.h create mode 100644 src/widgets/ntqgrid.h create mode 100644 src/widgets/ntqgridview.h create mode 100644 src/widgets/ntqgroupbox.h create mode 100644 src/widgets/ntqhbox.h create mode 100644 src/widgets/ntqhbuttongroup.h create mode 100644 src/widgets/ntqheader.h create mode 100644 src/widgets/ntqhgroupbox.h create mode 100644 src/widgets/ntqlabel.h create mode 100644 src/widgets/ntqlcdnumber.h create mode 100644 src/widgets/ntqlineedit.h create mode 100644 src/widgets/ntqlistbox.h create mode 100644 src/widgets/ntqlistview.h create mode 100644 src/widgets/ntqmainwindow.h create mode 100644 src/widgets/ntqmenubar.h create mode 100644 src/widgets/ntqmenudata.h create mode 100644 src/widgets/ntqmultilineedit.h create mode 100644 src/widgets/ntqpopupmenu.h create mode 100644 src/widgets/ntqprogressbar.h create mode 100644 src/widgets/ntqpushbutton.h create mode 100644 src/widgets/ntqradiobutton.h create mode 100644 src/widgets/ntqrangecontrol.h create mode 100644 src/widgets/ntqscrollbar.h create mode 100644 src/widgets/ntqscrollview.h create mode 100644 src/widgets/ntqslider.h create mode 100644 src/widgets/ntqspinbox.h create mode 100644 src/widgets/ntqsplashscreen.h create mode 100644 src/widgets/ntqsplitter.h create mode 100644 src/widgets/ntqstatusbar.h create mode 100644 src/widgets/ntqsyntaxhighlighter.h create mode 100644 src/widgets/ntqtabbar.h create mode 100644 src/widgets/ntqtabwidget.h create mode 100644 src/widgets/ntqtextbrowser.h create mode 100644 src/widgets/ntqtextedit.h create mode 100644 src/widgets/ntqtextview.h create mode 100644 src/widgets/ntqtoolbar.h create mode 100644 src/widgets/ntqtoolbox.h create mode 100644 src/widgets/ntqtoolbutton.h create mode 100644 src/widgets/ntqtooltip.h create mode 100644 src/widgets/ntqvalidator.h create mode 100644 src/widgets/ntqvbox.h create mode 100644 src/widgets/ntqvbuttongroup.h create mode 100644 src/widgets/ntqvgroupbox.h create mode 100644 src/widgets/ntqwhatsthis.h create mode 100644 src/widgets/ntqwidgetplugin.h create mode 100644 src/widgets/ntqwidgetstack.h delete mode 100644 src/widgets/qaction.h delete mode 100644 src/widgets/qbutton.h delete mode 100644 src/widgets/qbuttongroup.h delete mode 100644 src/widgets/qcheckbox.h delete mode 100644 src/widgets/qcombobox.h delete mode 100644 src/widgets/qdatetimeedit.h delete mode 100644 src/widgets/qdial.h delete mode 100644 src/widgets/qdockarea.h delete mode 100644 src/widgets/qdockwindow.h delete mode 100644 src/widgets/qframe.h delete mode 100644 src/widgets/qgrid.h delete mode 100644 src/widgets/qgridview.h delete mode 100644 src/widgets/qgroupbox.h delete mode 100644 src/widgets/qhbox.h delete mode 100644 src/widgets/qhbuttongroup.h delete mode 100644 src/widgets/qheader.h delete mode 100644 src/widgets/qhgroupbox.h delete mode 100644 src/widgets/qlabel.h delete mode 100644 src/widgets/qlcdnumber.h delete mode 100644 src/widgets/qlineedit.h delete mode 100644 src/widgets/qlistbox.h delete mode 100644 src/widgets/qlistview.h delete mode 100644 src/widgets/qmainwindow.h delete mode 100644 src/widgets/qmenubar.h delete mode 100644 src/widgets/qmenudata.h delete mode 100644 src/widgets/qmultilineedit.h delete mode 100644 src/widgets/qpopupmenu.h delete mode 100644 src/widgets/qprogressbar.h delete mode 100644 src/widgets/qpushbutton.h delete mode 100644 src/widgets/qradiobutton.h delete mode 100644 src/widgets/qrangecontrol.h delete mode 100644 src/widgets/qscrollbar.h delete mode 100644 src/widgets/qscrollview.h delete mode 100644 src/widgets/qslider.h delete mode 100644 src/widgets/qspinbox.h delete mode 100644 src/widgets/qsplashscreen.h delete mode 100644 src/widgets/qsplitter.h delete mode 100644 src/widgets/qstatusbar.h delete mode 100644 src/widgets/qsyntaxhighlighter.h delete mode 100644 src/widgets/qtabbar.h delete mode 100644 src/widgets/qtabwidget.h delete mode 100644 src/widgets/qtextbrowser.h delete mode 100644 src/widgets/qtextedit.h delete mode 100644 src/widgets/qtextview.h delete mode 100644 src/widgets/qtoolbar.h delete mode 100644 src/widgets/qtoolbox.h delete mode 100644 src/widgets/qtoolbutton.h delete mode 100644 src/widgets/qtooltip.h delete mode 100644 src/widgets/qvalidator.h delete mode 100644 src/widgets/qvbox.h delete mode 100644 src/widgets/qvbuttongroup.h delete mode 100644 src/widgets/qvgroupbox.h delete mode 100644 src/widgets/qwhatsthis.h delete mode 100644 src/widgets/qwidgetplugin.h delete mode 100644 src/widgets/qwidgetstack.h create mode 100644 src/workspace/ntqworkspace.h delete mode 100644 src/workspace/qworkspace.h create mode 100644 src/xml/ntqdom.h create mode 100644 src/xml/ntqxml.h delete mode 100644 src/xml/qdom.h delete mode 100644 src/xml/qxml.h (limited to 'src') diff --git a/src/3rdparty/sqlite/config.h b/src/3rdparty/sqlite/config.h index ae29a5723..b17d48a88 100644 --- a/src/3rdparty/sqlite/config.h +++ b/src/3rdparty/sqlite/config.h @@ -1,5 +1,5 @@ -#include -#include +#include +#include #ifndef QT_POINTER_SIZE # ifdef Q_OS_WIN32 diff --git a/src/3rdparty/sqlite/trolltech.patch b/src/3rdparty/sqlite/trolltech.patch index cbafffbd4..81d408d1a 100644 --- a/src/3rdparty/sqlite/trolltech.patch +++ b/src/3rdparty/sqlite/trolltech.patch @@ -3,8 +3,8 @@ diff -du ./config.h /home/harald/troll/qt-3.3/src/3rdparty/sqlite/config.h +++ /home/harald/troll/qt-3.3/src/3rdparty/sqlite/config.h 2004-01-08 14:29:23.000000000 +0100 @@ -1 +1,23 @@ -#define SQLITE_PTR_SZ 4 -+#include -+#include ++#include ++#include + +#ifndef QT_POINTER_SIZE +# ifdef Q_OS_WIN32 diff --git a/src/attic/qtmultilineedit.cpp b/src/attic/qtmultilineedit.cpp index 773bbbde6..79c3700fb 100644 --- a/src/attic/qtmultilineedit.cpp +++ b/src/attic/qtmultilineedit.cpp @@ -13,19 +13,19 @@ #include "qtmultilineedit.h" #ifndef QT_NO_QTMULTILINEEDIT -#include "qpainter.h" -#include "qscrollbar.h" -#include "qclipboard.h" -#include "qpixmap.h" -#include "qregexp.h" -#include "qapplication.h" -#include "qdragobject.h" -#include "qpopupmenu.h" -#include "qtimer.h" -#include "qdict.h" -#include "qcursor.h" +#include "ntqpainter.h" +#include "ntqscrollbar.h" +#include "ntqclipboard.h" +#include "ntqpixmap.h" +#include "ntqregexp.h" +#include "ntqapplication.h" +#include "ntqdragobject.h" +#include "ntqpopupmenu.h" +#include "ntqtimer.h" +#include "ntqdict.h" +#include "ntqcursor.h" #ifndef QT_NO_COMPAT -#include "qstyle.h" +#include "ntqstyle.h" #endif diff --git a/src/attic/qtmultilineedit.h b/src/attic/qtmultilineedit.h index b7e52b03d..3b7ccd25c 100644 --- a/src/attic/qtmultilineedit.h +++ b/src/attic/qtmultilineedit.h @@ -16,8 +16,8 @@ #ifndef QT_H #include "qttableview.h" -#include "qstring.h" -#include "qptrlist.h" +#include "ntqstring.h" +#include "ntqptrlist.h" #endif // QT_H #ifndef QT_NO_QTMULTILINEEDIT diff --git a/src/attic/qttableview.cpp b/src/attic/qttableview.cpp index c93ef7c99..e608ae92f 100644 --- a/src/attic/qttableview.cpp +++ b/src/attic/qttableview.cpp @@ -13,9 +13,9 @@ #include "qttableview.h" #ifndef QT_NO_QTTABLEVIEW -#include "qscrollbar.h" -#include "qpainter.h" -#include "qdrawutil.h" +#include "ntqscrollbar.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" #include enum ScrollBarDirtyFlags { diff --git a/src/attic/qttableview.h b/src/attic/qttableview.h index 158cb661c..4dfb38ce7 100644 --- a/src/attic/qttableview.h +++ b/src/attic/qttableview.h @@ -15,7 +15,7 @@ #define TQTTABLEVIEW_H #ifndef QT_H -#include "qframe.h" +#include "ntqframe.h" #endif // QT_H #ifndef QT_NO_QTTABLEVIEW diff --git a/src/canvas/ntqcanvas.h b/src/canvas/ntqcanvas.h new file mode 100644 index 000000000..b104fd8a6 --- /dev/null +++ b/src/canvas/ntqcanvas.h @@ -0,0 +1,816 @@ +/********************************************************************** +** +** Definition of TQCanvas classes +** +** Created : 991211 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the canvas module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCANVAS_H +#define TQCANVAS_H + +#ifndef QT_H +#include "ntqscrollview.h" +#include "ntqpixmap.h" +#include "ntqptrlist.h" +#include "ntqbrush.h" +#include "ntqpen.h" +#include "ntqvaluelist.h" +#include "ntqpointarray.h" +#endif // QT_H + +#if !defined( QT_MODULE_CANVAS ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_CANVAS ) +#define TQM_EXPORT_CANVAS +#define TQM_TEMPLATE_EXTERN_CANVAS +#else +#define TQM_EXPORT_CANVAS Q_EXPORT +#define TQM_TEMPLATE_EXTERN_CANVAS Q_TEMPLATE_EXTERN +#endif + +#ifndef QT_NO_CANVAS + + +class TQCanvasSprite; +class TQCanvasPolygonalItem; +class TQCanvasRectangle; +class TQCanvasPolygon; +class TQCanvasEllipse; +class TQCanvasText; +class TQCanvasLine; +class TQCanvasChunk; +class TQCanvas; +class TQCanvasItem; +class TQCanvasView; +class TQCanvasPixmap; + +#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) ) +// MOC_SKIP_BEGIN +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueListIterator< TQCanvasItem* >; +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueList< TQCanvasItem* >; +// MOC_SKIP_END +#endif + +class TQM_EXPORT_CANVAS TQCanvasItemList : public TQValueList { +public: + void sort(); + void drawUnique( TQPainter& painter ); + TQCanvasItemList operator+(const TQCanvasItemList &l) const; +}; + + +class TQCanvasItemExtra; + +class TQM_EXPORT_CANVAS TQCanvasItem : public TQt +{ +public: + TQCanvasItem(TQCanvas* canvas); + virtual ~TQCanvasItem(); + + double x() const + { return myx; } + double y() const + { return myy; } + double z() const + { return myz; } // (depth) + + virtual void moveBy(double dx, double dy); + void move(double x, double y); + void setX(double a) { move(a,y()); } + void setY(double a) { move(x(),a); } + void setZ(double a) { myz=a; changeChunks(); } + + bool animated() const; + virtual void setAnimated(bool y); + virtual void setVelocity( double vx, double vy); + void setXVelocity( double vx ) { setVelocity(vx,yVelocity()); } + void setYVelocity( double vy ) { setVelocity(xVelocity(),vy); } + double xVelocity() const; + double yVelocity() const; + virtual void advance(int stage); + + virtual bool collidesWith( const TQCanvasItem* ) const=0; + + TQCanvasItemList collisions(bool exact /* NO DEFAULT */ ) const; + + virtual void setCanvas(TQCanvas*); + + virtual void draw(TQPainter&)=0; + + void show(); + void hide(); + + virtual void setVisible(bool yes); + bool isVisible() const + { return (bool)vis; } + virtual void setSelected(bool yes); + bool isSelected() const + { return (bool)sel; } + virtual void setEnabled(bool yes); + bool isEnabled() const + { return (bool)ena; } + virtual void setActive(bool yes); + bool isActive() const + { return (bool)act; } +#ifndef QT_NO_COMPAT + bool visible() const + { return (bool)vis; } + bool selected() const + { return (bool)sel; } + bool enabled() const + { return (bool)ena; } + bool active() const + { return (bool)act; } +#endif + + enum RttiValues { + Rtti_Item = 0, + Rtti_Sprite = 1, + Rtti_PolygonalItem = 2, + Rtti_Text = 3, + Rtti_Polygon = 4, + Rtti_Rectangle = 5, + Rtti_Ellipse = 6, + Rtti_Line = 7, + Rtti_Spline = 8 + }; + + virtual int rtti() const; + static int RTTI; + + virtual TQRect boundingRect() const=0; + virtual TQRect boundingRectAdvanced() const; + + TQCanvas* canvas() const + { return cnv; } + +protected: + void update() { changeChunks(); } + +private: + // For friendly subclasses... + + friend class TQCanvasPolygonalItem; + friend class TQCanvasSprite; + friend class TQCanvasRectangle; + friend class TQCanvasPolygon; + friend class TQCanvasEllipse; + friend class TQCanvasText; + friend class TQCanvasLine; + + virtual TQPointArray chunks() const; + virtual void addToChunks(); + virtual void removeFromChunks(); + virtual void changeChunks(); + virtual bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const = 0; + // End of friend stuff + + TQCanvas* cnv; + static TQCanvas* current_canvas; + double myx,myy,myz; + TQCanvasItemExtra *ext; + TQCanvasItemExtra& extra(); + uint ani:1; + uint vis:1; + uint val:1; + uint sel:1; + uint ena:1; + uint act:1; +}; + + +class TQCanvasData; + +class TQM_EXPORT_CANVAS TQCanvas : public TQObject +{ + Q_OBJECT +public: + TQCanvas( TQObject* parent = 0, const char* name = 0 ); + TQCanvas(int w, int h); + TQCanvas( TQPixmap p, int h, int v, int tilewidth, int tileheight ); + + virtual ~TQCanvas(); + + virtual void setTiles( TQPixmap tiles, int h, int v, + int tilewidth, int tileheight ); + virtual void setBackgroundPixmap( const TQPixmap& p ); + TQPixmap backgroundPixmap() const; + + virtual void setBackgroundColor( const TQColor& c ); + TQColor backgroundColor() const; + + virtual void setTile( int x, int y, int tilenum ); + int tile( int x, int y ) const + { return grid[x+y*htiles]; } + + int tilesHorizontally() const + { return htiles; } + int tilesVertically() const + { return vtiles; } + + int tileWidth() const + { return tilew; } + int tileHeight() const + { return tileh; } + + virtual void resize(int width, int height); + int width() const + { return awidth; } + int height() const + { return aheight; } + TQSize size() const + { return TQSize(awidth,aheight); } + TQRect rect() const + { return TQRect( 0, 0, awidth, aheight ); } + bool onCanvas( int x, int y ) const + { return x>=0 && y>=0 && x=0 && y>=0 && x, TQPtrList hotspots); + + TQCanvasPixmapArray(TQValueList, TQPointArray hotspots = TQPointArray() ); + ~TQCanvasPixmapArray(); + +#ifndef QT_NO_IMAGEIO + bool readPixmaps(const TQString& datafilenamepattern, int framecount=0); + bool readCollisionMasks(const TQString& filenamepattern); +#endif + + // deprecated + bool operator!(); // Failure check. + bool isValid() const; + + TQCanvasPixmap* image(int i) const + { return img ? img[i] : 0; } + void setImage(int i, TQCanvasPixmap* p); + uint count() const + { return (uint)framecount; } + +private: +#if defined(Q_DISABLE_COPY) + TQCanvasPixmapArray( const TQCanvasPixmapArray & ); + TQCanvasPixmapArray &operator=( const TQCanvasPixmapArray & ); +#endif +#ifndef QT_NO_IMAGEIO + bool readPixmaps(const TQString& datafilenamepattern, int framecount, bool maskonly); +#endif + + void reset(); + int framecount; + TQCanvasPixmap** img; +}; + + +class TQM_EXPORT_CANVAS TQCanvasSprite : public TQCanvasItem +{ +public: + TQCanvasSprite(TQCanvasPixmapArray* array, TQCanvas* canvas); + + void setSequence(TQCanvasPixmapArray* seq); + + virtual ~TQCanvasSprite(); + + void move(double x, double y); + virtual void move(double x, double y, int frame); + void setFrame(int); + enum FrameAnimationType { Cycle, Oscillate }; + virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0); + int frame() const + { return frm; } + int frameCount() const + { return images->count(); } + + int rtti() const; + static int RTTI; + + bool collidesWith( const TQCanvasItem* ) const; + + TQRect boundingRect() const; + + // is there a reason for these to be protected? Lars +//protected: + + int width() const; + int height() const; + + int leftEdge() const; + int topEdge() const; + int rightEdge() const; + int bottomEdge() const; + + int leftEdge(int nx) const; + int topEdge(int ny) const; + int rightEdge(int nx) const; + int bottomEdge(int ny) const; + TQCanvasPixmap* image() const + { return images->image(frm); } + virtual TQCanvasPixmap* imageAdvanced() const; + TQCanvasPixmap* image(int f) const + { return images->image(f); } + virtual void advance(int stage); + +public: + void draw(TQPainter& painter); + +private: +#if defined(Q_DISABLE_COPY) + TQCanvasSprite( const TQCanvasSprite & ); + TQCanvasSprite &operator=( const TQCanvasSprite & ); +#endif + void addToChunks(); + void removeFromChunks(); + void changeChunks(); + + int frm; + ushort anim_val; + uint anim_state:2; + uint anim_type:14; + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + + friend bool qt_testCollision( const TQCanvasSprite* s1, + const TQCanvasSprite* s2 ); + + TQCanvasPixmapArray* images; +}; + +class TQPolygonalProcessor; + +class TQM_EXPORT_CANVAS TQCanvasPolygonalItem : public TQCanvasItem +{ +public: + TQCanvasPolygonalItem(TQCanvas* canvas); + virtual ~TQCanvasPolygonalItem(); + + bool collidesWith( const TQCanvasItem* ) const; + + virtual void setPen(TQPen p); + virtual void setBrush(TQBrush b); + + TQPen pen() const + { return pn; } + TQBrush brush() const + { return br; } + + virtual TQPointArray areaPoints() const=0; + virtual TQPointArray areaPointsAdvanced() const; + TQRect boundingRect() const; + + int rtti() const; + static int RTTI; + +protected: + void draw(TQPainter &); + virtual void drawShape(TQPainter &) = 0; + + bool winding() const; + void setWinding(bool); + + void invalidate(); + bool isValid() const + { return (bool)val; } + +private: + void scanPolygon( const TQPointArray& pa, int winding, + TQPolygonalProcessor& process ) const; + TQPointArray chunks() const; + + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + + TQBrush br; + TQPen pn; + uint wind:1; +}; + + +class TQM_EXPORT_CANVAS TQCanvasRectangle : public TQCanvasPolygonalItem +{ +public: + TQCanvasRectangle(TQCanvas* canvas); + TQCanvasRectangle(const TQRect&, TQCanvas* canvas); + TQCanvasRectangle(int x, int y, int width, int height, TQCanvas* canvas); + + ~TQCanvasRectangle(); + + int width() const; + int height() const; + void setSize(int w, int h); + TQSize size() const + { return TQSize(w,h); } + TQPointArray areaPoints() const; + TQRect rect() const + { return TQRect(int(x()),int(y()),w,h); } + + bool collidesWith( const TQCanvasItem* ) const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(TQPainter &); + TQPointArray chunks() const; + +private: + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + + int w, h; +}; + + +class TQM_EXPORT_CANVAS TQCanvasPolygon : public TQCanvasPolygonalItem +{ +public: + TQCanvasPolygon(TQCanvas* canvas); + ~TQCanvasPolygon(); + void setPoints(TQPointArray); + TQPointArray points() const; + void moveBy(double dx, double dy); + + TQPointArray areaPoints() const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(TQPainter &); + TQPointArray poly; +}; + + +class TQM_EXPORT_CANVAS TQCanvasSpline : public TQCanvasPolygon +{ +public: + TQCanvasSpline(TQCanvas* canvas); + ~TQCanvasSpline(); + + void setControlPoints(TQPointArray, bool closed=TRUE); + TQPointArray controlPoints() const; + bool closed() const; + + int rtti() const; + static int RTTI; + +private: + void recalcPoly(); + TQPointArray bez; + bool cl; +}; + + +class TQM_EXPORT_CANVAS TQCanvasLine : public TQCanvasPolygonalItem +{ +public: + TQCanvasLine(TQCanvas* canvas); + ~TQCanvasLine(); + void setPoints(int x1, int y1, int x2, int y2); + + TQPoint startPoint() const + { return TQPoint(x1,y1); } + TQPoint endPoint() const + { return TQPoint(x2,y2); } + + int rtti() const; + static int RTTI; + + void setPen(TQPen p); + void moveBy(double dx, double dy); + +protected: + void drawShape(TQPainter &); + TQPointArray areaPoints() const; + +private: + int x1,y1,x2,y2; +}; + + +class TQM_EXPORT_CANVAS TQCanvasEllipse : public TQCanvasPolygonalItem +{ + +public: + TQCanvasEllipse( TQCanvas* canvas ); + TQCanvasEllipse( int width, int height, TQCanvas* canvas ); + TQCanvasEllipse( int width, int height, int startangle, int angle, + TQCanvas* canvas ); + + ~TQCanvasEllipse(); + + int width() const; + int height() const; + void setSize(int w, int h); + void setAngles(int start, int length); + int angleStart() const + { return a1; } + int angleLength() const + { return a2; } + TQPointArray areaPoints() const; + + bool collidesWith( const TQCanvasItem* ) const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(TQPainter &); + +private: + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + int w, h; + int a1, a2; +}; + + +class TQCanvasTextExtra; + +class TQM_EXPORT_CANVAS TQCanvasText : public TQCanvasItem +{ +public: + TQCanvasText(TQCanvas* canvas); + TQCanvasText(const TQString&, TQCanvas* canvas); + TQCanvasText(const TQString&, TQFont, TQCanvas* canvas); + + virtual ~TQCanvasText(); + + void setText( const TQString& ); + void setFont( const TQFont& ); + void setColor( const TQColor& ); + TQString text() const; + TQFont font() const; + TQColor color() const; + + void moveBy(double dx, double dy); + + int textFlags() const + { return flags; } + void setTextFlags(int); + + TQRect boundingRect() const; + + bool collidesWith( const TQCanvasItem* ) const; + + int rtti() const; + static int RTTI; + +protected: + virtual void draw(TQPainter&); + +private: +#if defined(Q_DISABLE_COPY) + TQCanvasText( const TQCanvasText & ); + TQCanvasText &operator=( const TQCanvasText & ); +#endif + void addToChunks(); + void removeFromChunks(); + void changeChunks(); + + void setRect(); + TQRect brect; + TQString txt; + int flags; + TQFont fnt; + TQColor col; + TQCanvasTextExtra* extra; + + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; +}; + +#define Q_DEFINED_QCANVAS +#include "ntqwinexport.h" +#endif // QT_NO_CANVAS + +#endif // TQCANVAS_H diff --git a/src/canvas/qcanvas.cpp b/src/canvas/qcanvas.cpp index 167e02094..7b337fb49 100644 --- a/src/canvas/qcanvas.cpp +++ b/src/canvas/qcanvas.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qcanvas.h" +#include "ntqcanvas.h" #ifndef QT_NO_CANVAS -#include "qapplication.h" -#include "qbitmap.h" -#include "qimage.h" -#include "qptrdict.h" -#include "qpainter.h" -#include "qpolygonscanner.h" -#include "qtimer.h" -#include "qtl.h" +#include "ntqapplication.h" +#include "ntqbitmap.h" +#include "ntqimage.h" +#include "ntqptrdict.h" +#include "ntqpainter.h" +#include "ntqpolygonscanner.h" +#include "ntqtimer.h" +#include "ntqtl.h" #include @@ -436,7 +436,7 @@ static int scm(int a, int b) /*! - \class TQCanvas qcanvas.h + \class TQCanvas ntqcanvas.h \brief The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -1844,7 +1844,7 @@ class TQCanvasItemExtra { /*! - \class TQCanvasItem qcanvas.h + \class TQCanvasItem ntqcanvas.h \brief The TQCanvasItem class provides an abstract graphic object on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -2484,7 +2484,7 @@ static bool collision_double_dispatch( const TQCanvasSprite* s1, /*! - \class TQCanvasSprite qcanvas.h + \class TQCanvasSprite ntqcanvas.h \brief The TQCanvasSprite class provides an animated canvas item on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -2801,7 +2801,7 @@ TQRect TQCanvasItem::boundingRectAdvanced() const } /*! - \class TQCanvasPixmap qcanvas.h + \class TQCanvasPixmap ntqcanvas.h \brief The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -2931,7 +2931,7 @@ TQCanvasPixmap::~TQCanvasPixmap() */ /*! - \class TQCanvasPixmapArray qcanvas.h + \class TQCanvasPixmapArray ntqcanvas.h \brief The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -3457,7 +3457,7 @@ void TQCanvasSprite::draw(TQPainter& painter) } /*! - \class TQCanvasView qcanvas.h + \class TQCanvasView ntqcanvas.h \brief The TQCanvasView class provides an on-screen view of a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -3726,7 +3726,7 @@ TQSize TQCanvasView::sizeHint() const // ### TQt 4.0 customer request: operate on doubles rather than int. // ### I know, almost impossible due to the use of TQRegion etc. /*! - \class TQCanvasPolygonalItem qcanvas.h + \class TQCanvasPolygonalItem ntqcanvas.h \brief The TQCanvasPolygonalItem class provides a polygonal canvas item on a TQCanvas. \if defined(commercial) @@ -4135,7 +4135,7 @@ void TQCanvasPolygonalItem::setBrush(TQBrush b) /*! - \class TQCanvasPolygon qcanvas.h + \class TQCanvasPolygon ntqcanvas.h \brief The TQCanvasPolygon class provides a polygon on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -4228,7 +4228,7 @@ void TQCanvasPolygon::moveBy(double dx, double dy) } /*! - \class TQCanvasSpline qcanvas.h + \class TQCanvasSpline ntqcanvas.h \brief The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -4390,7 +4390,7 @@ TQPointArray TQCanvasPolygon::areaPoints() const // points -- that way for some uses just the constructor call would be // required? /*! - \class TQCanvasLine qcanvas.h + \class TQCanvasLine ntqcanvas.h \brief The TQCanvasLine class provides a line on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -4534,7 +4534,7 @@ void TQCanvasLine::moveBy(double dx, double dy) } /*! - \class TQCanvasRectangle qcanvas.h + \class TQCanvasRectangle ntqcanvas.h \brief The TQCanvasRectangle class provides a rectangle on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -4672,7 +4672,7 @@ void TQCanvasRectangle::drawShape(TQPainter & p) /*! - \class TQCanvasEllipse qcanvas.h + \class TQCanvasEllipse ntqcanvas.h \brief The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -4859,7 +4859,7 @@ void TQCanvasEllipse::drawShape(TQPainter & p) /*! - \class TQCanvasText qcanvas.h + \class TQCanvasText ntqcanvas.h \brief The TQCanvasText class provides a text object on a TQCanvas. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/canvas/qcanvas.h b/src/canvas/qcanvas.h deleted file mode 100644 index 37c30816d..000000000 --- a/src/canvas/qcanvas.h +++ /dev/null @@ -1,816 +0,0 @@ -/********************************************************************** -** -** Definition of TQCanvas classes -** -** Created : 991211 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the canvas module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCANVAS_H -#define TQCANVAS_H - -#ifndef QT_H -#include "qscrollview.h" -#include "qpixmap.h" -#include "qptrlist.h" -#include "qbrush.h" -#include "qpen.h" -#include "qvaluelist.h" -#include "qpointarray.h" -#endif // QT_H - -#if !defined( QT_MODULE_CANVAS ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_CANVAS ) -#define TQM_EXPORT_CANVAS -#define TQM_TEMPLATE_EXTERN_CANVAS -#else -#define TQM_EXPORT_CANVAS Q_EXPORT -#define TQM_TEMPLATE_EXTERN_CANVAS Q_TEMPLATE_EXTERN -#endif - -#ifndef QT_NO_CANVAS - - -class TQCanvasSprite; -class TQCanvasPolygonalItem; -class TQCanvasRectangle; -class TQCanvasPolygon; -class TQCanvasEllipse; -class TQCanvasText; -class TQCanvasLine; -class TQCanvasChunk; -class TQCanvas; -class TQCanvasItem; -class TQCanvasView; -class TQCanvasPixmap; - -#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) ) -// MOC_SKIP_BEGIN -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueListIterator< TQCanvasItem* >; -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueList< TQCanvasItem* >; -// MOC_SKIP_END -#endif - -class TQM_EXPORT_CANVAS TQCanvasItemList : public TQValueList { -public: - void sort(); - void drawUnique( TQPainter& painter ); - TQCanvasItemList operator+(const TQCanvasItemList &l) const; -}; - - -class TQCanvasItemExtra; - -class TQM_EXPORT_CANVAS TQCanvasItem : public TQt -{ -public: - TQCanvasItem(TQCanvas* canvas); - virtual ~TQCanvasItem(); - - double x() const - { return myx; } - double y() const - { return myy; } - double z() const - { return myz; } // (depth) - - virtual void moveBy(double dx, double dy); - void move(double x, double y); - void setX(double a) { move(a,y()); } - void setY(double a) { move(x(),a); } - void setZ(double a) { myz=a; changeChunks(); } - - bool animated() const; - virtual void setAnimated(bool y); - virtual void setVelocity( double vx, double vy); - void setXVelocity( double vx ) { setVelocity(vx,yVelocity()); } - void setYVelocity( double vy ) { setVelocity(xVelocity(),vy); } - double xVelocity() const; - double yVelocity() const; - virtual void advance(int stage); - - virtual bool collidesWith( const TQCanvasItem* ) const=0; - - TQCanvasItemList collisions(bool exact /* NO DEFAULT */ ) const; - - virtual void setCanvas(TQCanvas*); - - virtual void draw(TQPainter&)=0; - - void show(); - void hide(); - - virtual void setVisible(bool yes); - bool isVisible() const - { return (bool)vis; } - virtual void setSelected(bool yes); - bool isSelected() const - { return (bool)sel; } - virtual void setEnabled(bool yes); - bool isEnabled() const - { return (bool)ena; } - virtual void setActive(bool yes); - bool isActive() const - { return (bool)act; } -#ifndef QT_NO_COMPAT - bool visible() const - { return (bool)vis; } - bool selected() const - { return (bool)sel; } - bool enabled() const - { return (bool)ena; } - bool active() const - { return (bool)act; } -#endif - - enum RttiValues { - Rtti_Item = 0, - Rtti_Sprite = 1, - Rtti_PolygonalItem = 2, - Rtti_Text = 3, - Rtti_Polygon = 4, - Rtti_Rectangle = 5, - Rtti_Ellipse = 6, - Rtti_Line = 7, - Rtti_Spline = 8 - }; - - virtual int rtti() const; - static int RTTI; - - virtual TQRect boundingRect() const=0; - virtual TQRect boundingRectAdvanced() const; - - TQCanvas* canvas() const - { return cnv; } - -protected: - void update() { changeChunks(); } - -private: - // For friendly subclasses... - - friend class TQCanvasPolygonalItem; - friend class TQCanvasSprite; - friend class TQCanvasRectangle; - friend class TQCanvasPolygon; - friend class TQCanvasEllipse; - friend class TQCanvasText; - friend class TQCanvasLine; - - virtual TQPointArray chunks() const; - virtual void addToChunks(); - virtual void removeFromChunks(); - virtual void changeChunks(); - virtual bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const = 0; - // End of friend stuff - - TQCanvas* cnv; - static TQCanvas* current_canvas; - double myx,myy,myz; - TQCanvasItemExtra *ext; - TQCanvasItemExtra& extra(); - uint ani:1; - uint vis:1; - uint val:1; - uint sel:1; - uint ena:1; - uint act:1; -}; - - -class TQCanvasData; - -class TQM_EXPORT_CANVAS TQCanvas : public TQObject -{ - Q_OBJECT -public: - TQCanvas( TQObject* parent = 0, const char* name = 0 ); - TQCanvas(int w, int h); - TQCanvas( TQPixmap p, int h, int v, int tilewidth, int tileheight ); - - virtual ~TQCanvas(); - - virtual void setTiles( TQPixmap tiles, int h, int v, - int tilewidth, int tileheight ); - virtual void setBackgroundPixmap( const TQPixmap& p ); - TQPixmap backgroundPixmap() const; - - virtual void setBackgroundColor( const TQColor& c ); - TQColor backgroundColor() const; - - virtual void setTile( int x, int y, int tilenum ); - int tile( int x, int y ) const - { return grid[x+y*htiles]; } - - int tilesHorizontally() const - { return htiles; } - int tilesVertically() const - { return vtiles; } - - int tileWidth() const - { return tilew; } - int tileHeight() const - { return tileh; } - - virtual void resize(int width, int height); - int width() const - { return awidth; } - int height() const - { return aheight; } - TQSize size() const - { return TQSize(awidth,aheight); } - TQRect rect() const - { return TQRect( 0, 0, awidth, aheight ); } - bool onCanvas( int x, int y ) const - { return x>=0 && y>=0 && x=0 && y>=0 && x, TQPtrList hotspots); - - TQCanvasPixmapArray(TQValueList, TQPointArray hotspots = TQPointArray() ); - ~TQCanvasPixmapArray(); - -#ifndef QT_NO_IMAGEIO - bool readPixmaps(const TQString& datafilenamepattern, int framecount=0); - bool readCollisionMasks(const TQString& filenamepattern); -#endif - - // deprecated - bool operator!(); // Failure check. - bool isValid() const; - - TQCanvasPixmap* image(int i) const - { return img ? img[i] : 0; } - void setImage(int i, TQCanvasPixmap* p); - uint count() const - { return (uint)framecount; } - -private: -#if defined(Q_DISABLE_COPY) - TQCanvasPixmapArray( const TQCanvasPixmapArray & ); - TQCanvasPixmapArray &operator=( const TQCanvasPixmapArray & ); -#endif -#ifndef QT_NO_IMAGEIO - bool readPixmaps(const TQString& datafilenamepattern, int framecount, bool maskonly); -#endif - - void reset(); - int framecount; - TQCanvasPixmap** img; -}; - - -class TQM_EXPORT_CANVAS TQCanvasSprite : public TQCanvasItem -{ -public: - TQCanvasSprite(TQCanvasPixmapArray* array, TQCanvas* canvas); - - void setSequence(TQCanvasPixmapArray* seq); - - virtual ~TQCanvasSprite(); - - void move(double x, double y); - virtual void move(double x, double y, int frame); - void setFrame(int); - enum FrameAnimationType { Cycle, Oscillate }; - virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0); - int frame() const - { return frm; } - int frameCount() const - { return images->count(); } - - int rtti() const; - static int RTTI; - - bool collidesWith( const TQCanvasItem* ) const; - - TQRect boundingRect() const; - - // is there a reason for these to be protected? Lars -//protected: - - int width() const; - int height() const; - - int leftEdge() const; - int topEdge() const; - int rightEdge() const; - int bottomEdge() const; - - int leftEdge(int nx) const; - int topEdge(int ny) const; - int rightEdge(int nx) const; - int bottomEdge(int ny) const; - TQCanvasPixmap* image() const - { return images->image(frm); } - virtual TQCanvasPixmap* imageAdvanced() const; - TQCanvasPixmap* image(int f) const - { return images->image(f); } - virtual void advance(int stage); - -public: - void draw(TQPainter& painter); - -private: -#if defined(Q_DISABLE_COPY) - TQCanvasSprite( const TQCanvasSprite & ); - TQCanvasSprite &operator=( const TQCanvasSprite & ); -#endif - void addToChunks(); - void removeFromChunks(); - void changeChunks(); - - int frm; - ushort anim_val; - uint anim_state:2; - uint anim_type:14; - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - - friend bool qt_testCollision( const TQCanvasSprite* s1, - const TQCanvasSprite* s2 ); - - TQCanvasPixmapArray* images; -}; - -class TQPolygonalProcessor; - -class TQM_EXPORT_CANVAS TQCanvasPolygonalItem : public TQCanvasItem -{ -public: - TQCanvasPolygonalItem(TQCanvas* canvas); - virtual ~TQCanvasPolygonalItem(); - - bool collidesWith( const TQCanvasItem* ) const; - - virtual void setPen(TQPen p); - virtual void setBrush(TQBrush b); - - TQPen pen() const - { return pn; } - TQBrush brush() const - { return br; } - - virtual TQPointArray areaPoints() const=0; - virtual TQPointArray areaPointsAdvanced() const; - TQRect boundingRect() const; - - int rtti() const; - static int RTTI; - -protected: - void draw(TQPainter &); - virtual void drawShape(TQPainter &) = 0; - - bool winding() const; - void setWinding(bool); - - void invalidate(); - bool isValid() const - { return (bool)val; } - -private: - void scanPolygon( const TQPointArray& pa, int winding, - TQPolygonalProcessor& process ) const; - TQPointArray chunks() const; - - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - - TQBrush br; - TQPen pn; - uint wind:1; -}; - - -class TQM_EXPORT_CANVAS TQCanvasRectangle : public TQCanvasPolygonalItem -{ -public: - TQCanvasRectangle(TQCanvas* canvas); - TQCanvasRectangle(const TQRect&, TQCanvas* canvas); - TQCanvasRectangle(int x, int y, int width, int height, TQCanvas* canvas); - - ~TQCanvasRectangle(); - - int width() const; - int height() const; - void setSize(int w, int h); - TQSize size() const - { return TQSize(w,h); } - TQPointArray areaPoints() const; - TQRect rect() const - { return TQRect(int(x()),int(y()),w,h); } - - bool collidesWith( const TQCanvasItem* ) const; - - int rtti() const; - static int RTTI; - -protected: - void drawShape(TQPainter &); - TQPointArray chunks() const; - -private: - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - - int w, h; -}; - - -class TQM_EXPORT_CANVAS TQCanvasPolygon : public TQCanvasPolygonalItem -{ -public: - TQCanvasPolygon(TQCanvas* canvas); - ~TQCanvasPolygon(); - void setPoints(TQPointArray); - TQPointArray points() const; - void moveBy(double dx, double dy); - - TQPointArray areaPoints() const; - - int rtti() const; - static int RTTI; - -protected: - void drawShape(TQPainter &); - TQPointArray poly; -}; - - -class TQM_EXPORT_CANVAS TQCanvasSpline : public TQCanvasPolygon -{ -public: - TQCanvasSpline(TQCanvas* canvas); - ~TQCanvasSpline(); - - void setControlPoints(TQPointArray, bool closed=TRUE); - TQPointArray controlPoints() const; - bool closed() const; - - int rtti() const; - static int RTTI; - -private: - void recalcPoly(); - TQPointArray bez; - bool cl; -}; - - -class TQM_EXPORT_CANVAS TQCanvasLine : public TQCanvasPolygonalItem -{ -public: - TQCanvasLine(TQCanvas* canvas); - ~TQCanvasLine(); - void setPoints(int x1, int y1, int x2, int y2); - - TQPoint startPoint() const - { return TQPoint(x1,y1); } - TQPoint endPoint() const - { return TQPoint(x2,y2); } - - int rtti() const; - static int RTTI; - - void setPen(TQPen p); - void moveBy(double dx, double dy); - -protected: - void drawShape(TQPainter &); - TQPointArray areaPoints() const; - -private: - int x1,y1,x2,y2; -}; - - -class TQM_EXPORT_CANVAS TQCanvasEllipse : public TQCanvasPolygonalItem -{ - -public: - TQCanvasEllipse( TQCanvas* canvas ); - TQCanvasEllipse( int width, int height, TQCanvas* canvas ); - TQCanvasEllipse( int width, int height, int startangle, int angle, - TQCanvas* canvas ); - - ~TQCanvasEllipse(); - - int width() const; - int height() const; - void setSize(int w, int h); - void setAngles(int start, int length); - int angleStart() const - { return a1; } - int angleLength() const - { return a2; } - TQPointArray areaPoints() const; - - bool collidesWith( const TQCanvasItem* ) const; - - int rtti() const; - static int RTTI; - -protected: - void drawShape(TQPainter &); - -private: - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - int w, h; - int a1, a2; -}; - - -class TQCanvasTextExtra; - -class TQM_EXPORT_CANVAS TQCanvasText : public TQCanvasItem -{ -public: - TQCanvasText(TQCanvas* canvas); - TQCanvasText(const TQString&, TQCanvas* canvas); - TQCanvasText(const TQString&, TQFont, TQCanvas* canvas); - - virtual ~TQCanvasText(); - - void setText( const TQString& ); - void setFont( const TQFont& ); - void setColor( const TQColor& ); - TQString text() const; - TQFont font() const; - TQColor color() const; - - void moveBy(double dx, double dy); - - int textFlags() const - { return flags; } - void setTextFlags(int); - - TQRect boundingRect() const; - - bool collidesWith( const TQCanvasItem* ) const; - - int rtti() const; - static int RTTI; - -protected: - virtual void draw(TQPainter&); - -private: -#if defined(Q_DISABLE_COPY) - TQCanvasText( const TQCanvasText & ); - TQCanvasText &operator=( const TQCanvasText & ); -#endif - void addToChunks(); - void removeFromChunks(); - void changeChunks(); - - void setRect(); - TQRect brect; - TQString txt; - int flags; - TQFont fnt; - TQColor col; - TQCanvasTextExtra* extra; - - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; -}; - -#define Q_DEFINED_QCANVAS -#include "qwinexport.h" -#endif // QT_NO_CANVAS - -#endif // TQCANVAS_H diff --git a/src/canvas/qt_canvas.pri b/src/canvas/qt_canvas.pri index 779a52153..ad3ee30bb 100644 --- a/src/canvas/qt_canvas.pri +++ b/src/canvas/qt_canvas.pri @@ -1,6 +1,6 @@ # Qt canvas module canvas { - HEADERS += $$CANVAS_H/qcanvas.h + HEADERS += $$CANVAS_H/ntqcanvas.h SOURCES += $$CANVAS_CPP/qcanvas.cpp } diff --git a/src/codecs/ntqbig5codec.h b/src/codecs/ntqbig5codec.h new file mode 100644 index 000000000..24b8747ec --- /dev/null +++ b/src/codecs/ntqbig5codec.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Definition of TQBig5Codec class +** +** Created : 990713 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Most of the code here was originally written by Ming-Che Chuang and +// is included in TQt with the author's permission, and the grateful +// thanks of the Trolltech team. + +#ifndef TQBIG5CODEC_H +#define TQBIG5CODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#endif // QT_H + +#ifndef QT_NO_BIG_CODECS + +class TQBig5Codec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +class TQBig5hkscsCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +#endif +#endif diff --git a/src/codecs/ntqeucjpcodec.h b/src/codecs/ntqeucjpcodec.h new file mode 100644 index 000000000..b5d6e7d88 --- /dev/null +++ b/src/codecs/ntqeucjpcodec.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Definition of TQEucJpCodec class +** +** Created : 990225 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Most of the code here was originally written by Serika Kurusugawa +// a.k.a. Junji Takagi, and is included in TQt with the author's permission, +// and the grateful thanks of the Trolltech team. + +/* + * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef TQEUCJPCODEC_H +#define TQEUCJPCODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#include "ntqjpunicode.h" +#endif // QT_H + +#ifndef QT_NO_BIG_CODECS + +#if defined(QT_PLUGIN) +#define Q_EXPORT_CODECS_JP +#else +#define Q_EXPORT_CODECS_JP Q_EXPORT +#endif + +class Q_EXPORT_CODECS_JP TQEucJpCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + const char* mimeName() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; + + TQEucJpCodec(); + ~TQEucJpCodec(); + +protected: + const TQJpUnicodeConv *conv; +}; + +#endif +#endif diff --git a/src/codecs/ntqeuckrcodec.h b/src/codecs/ntqeuckrcodec.h new file mode 100644 index 000000000..7235ca31a --- /dev/null +++ b/src/codecs/ntqeuckrcodec.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Definition of TQEucKrCodec class +** +** Created : 990303 +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +/* + * Copyright (C) 1999-2000 Mizi Research Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef TQEUCKRCODEC_H +#define TQEUCKRCODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#endif // QT_H + +#ifndef QT_NO_BIG_CODECS + +#if defined(QT_PLUGIN) +#define Q_EXPORT_CODECS_KR +#else +#define Q_EXPORT_CODECS_KR Q_EXPORT +#endif + +class Q_EXPORT_CODECS_KR TQEucKrCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + const char* mimeName() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +#endif +#endif diff --git a/src/codecs/ntqgb18030codec.h b/src/codecs/ntqgb18030codec.h new file mode 100644 index 000000000..fa7f897c9 --- /dev/null +++ b/src/codecs/ntqgb18030codec.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Definition of TQGb18030Codec class +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Contributed by James Su + +#ifndef TQGB18030CODEC_H +#define TQGB18030CODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#endif // QT_H + + +#ifndef QT_NO_BIG_CODECS + +#if defined(QT_PLUGIN) +#define Q_EXPORT_CODECS_CN +#else +#define Q_EXPORT_CODECS_CN Q_EXPORT +#endif + +class Q_EXPORT_CODECS_CN TQGb18030Codec : public TQTextCodec { +public: + TQGb18030Codec(); + + int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +class Q_EXPORT_CODECS_CN TQGbkCodec : public TQGb18030Codec { +public: + TQGbkCodec(); + + int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQGb18030Codec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +class Q_EXPORT_CODECS_CN TQGb2312Codec : public TQGb18030Codec { +public: + TQGb2312Codec(); + + int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQGb18030Codec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +#endif +#endif diff --git a/src/codecs/ntqgbkcodec.h b/src/codecs/ntqgbkcodec.h new file mode 100644 index 000000000..6701ac935 --- /dev/null +++ b/src/codecs/ntqgbkcodec.h @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Contributed by James Su + +#ifndef TQGBKCODEC_H +#define TQGBKCODEC_H +#ifndef QT_H +#include "ntqgb18030codec.h" +#endif // QT_H +#endif diff --git a/src/codecs/ntqjiscodec.h b/src/codecs/ntqjiscodec.h new file mode 100644 index 000000000..00cbf7cde --- /dev/null +++ b/src/codecs/ntqjiscodec.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Definition of TQJisCodec class +** +** Created : 990225 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Most of the code here was originally written by Serika Kurusugawa +// a.k.a. Junji Takagi, and is included in TQt with the author's permission, +// and the grateful thanks of the Trolltech team. + +/* + * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef TQJISCODEC_H +#define TQJISCODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#include "ntqjpunicode.h" +#endif // QT_H + +#ifndef QT_NO_BIG_CODECS + +#if defined(QT_PLUGIN) +#define Q_EXPORT_CODECS_JP +#else +#define Q_EXPORT_CODECS_JP Q_EXPORT +#endif + +class Q_EXPORT_CODECS_JP TQJisCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + const char* mimeName() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; + + TQJisCodec(); + ~TQJisCodec(); + +protected: + const TQJpUnicodeConv *conv; +}; + +#endif +#endif diff --git a/src/codecs/ntqjpunicode.h b/src/codecs/ntqjpunicode.h new file mode 100644 index 000000000..eb0c8f712 --- /dev/null +++ b/src/codecs/ntqjpunicode.h @@ -0,0 +1,179 @@ +/**************************************************************************** +** +** Definition of TQJpUnicodeConv class +** +** Created : 990225 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Most of the code here was originally written by Serika Kurusugawa +// a.k.a. Junji Takagi, and is included in TQt with the author's permission, +// and the grateful thanks of the Trolltech team. + +/* + * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef TQJPUNICODE_H +#define TQJPUNICODE_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#ifndef QT_NO_BIG_CODECS + +#if defined(QT_PLUGIN) +#define Q_EXPORT_CODECS_JP +#else +#define Q_EXPORT_CODECS_JP Q_EXPORT +#endif + +class Q_EXPORT_CODECS_JP TQJpUnicodeConv { +public: + enum Rules { + // "ASCII" is ANSI X.3.4-1986, a.k.a. US-ASCII here. + Default = 0x0000, + + Unicode = 0x0001, + Unicode_JISX0201 = 0x0001, + Unicode_ASCII = 0x0002, + JISX0221_JISX0201 = 0x0003, + JISX0221_ASCII = 0x0004, + Sun_JDK117 = 0x0005, + Microsoft_CP932 = 0x0006, + + NEC_VDC = 0x0100, // NEC Vender Defined Char + UDC = 0x0200, // User Defined Char + IBM_VDC = 0x0400 // IBM Vender Defined Char + }; + static TQJpUnicodeConv *newConverter(int rule); + + virtual uint asciiToUnicode(uint h, uint l) const; + /*virtual*/ uint jisx0201ToUnicode(uint h, uint l) const; + virtual uint jisx0201LatinToUnicode(uint h, uint l) const; + /*virtual*/ uint jisx0201KanaToUnicode(uint h, uint l) const; + virtual uint jisx0208ToUnicode(uint h, uint l) const; + virtual uint jisx0212ToUnicode(uint h, uint l) const; + + uint asciiToUnicode(uint ascii) const { + return asciiToUnicode((ascii & 0xff00) >> 8, (ascii & 0x00ff)); + } + uint jisx0201ToUnicode(uint jis) const { + return jisx0201ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); + } + uint jisx0201LatinToUnicode(uint jis) const { + return jisx0201LatinToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); + } + uint jisx0201KanaToUnicode(uint jis) const { + return jisx0201KanaToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); + } + uint jisx0208ToUnicode(uint jis) const { + return jisx0208ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); + } + uint jisx0212ToUnicode(uint jis) const { + return jisx0212ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); + } + + virtual uint unicodeToAscii(uint h, uint l) const; + /*virtual*/ uint unicodeToJisx0201(uint h, uint l) const; + virtual uint unicodeToJisx0201Latin(uint h, uint l) const; + /*virtual*/ uint unicodeToJisx0201Kana(uint h, uint l) const; + virtual uint unicodeToJisx0208(uint h, uint l) const; + virtual uint unicodeToJisx0212(uint h, uint l) const; + + uint unicodeToAscii(uint unicode) const { + return unicodeToAscii((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + uint unicodeToJisx0201(uint unicode) const { + return unicodeToJisx0201((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + uint unicodeToJisx0201Latin(uint unicode) const { + return unicodeToJisx0201Latin((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + uint unicodeToJisx0201Kana(uint unicode) const { + return unicodeToJisx0201Kana((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + uint unicodeToJisx0208(uint unicode) const { + return unicodeToJisx0208((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + uint unicodeToJisx0212(uint unicode) const { + return unicodeToJisx0212((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + + uint sjisToUnicode(uint h, uint l) const; + uint unicodeToSjis(uint h, uint l) const; + uint sjisibmvdcToUnicode(uint h, uint l) const; + uint unicodeToSjisibmvdc(uint h, uint l) const; + uint cp932ToUnicode(uint h, uint l) const; + uint unicodeToCp932(uint h, uint l) const; + + uint sjisToUnicode(uint sjis) const { + return sjisToUnicode((sjis & 0xff00) >> 8, (sjis & 0x00ff)); + } + uint unicodeToSjis(uint unicode) const { + return unicodeToSjis((unicode & 0xff00) >> 8, (unicode & 0x00ff)); + } + +protected: + TQJpUnicodeConv(int r) : rule(r) {} + +private: + int rule; +}; + +#endif // QT_NO_BIG_CODECS +#endif /* TQJPUNICODE_H */ diff --git a/src/codecs/ntqrtlcodec.h b/src/codecs/ntqrtlcodec.h new file mode 100644 index 000000000..bb031da45 --- /dev/null +++ b/src/codecs/ntqrtlcodec.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Implementation of TQTextCodec class +** +** Created : 981015 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQRTLCODEC_H +#define TQRTLCODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#endif // QT_H + +#ifndef QT_NO_CODEC_HEBREW + +class Q_EXPORT TQHebrewCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + const char* mimeName() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; +}; + +#endif + +#endif diff --git a/src/codecs/ntqsjiscodec.h b/src/codecs/ntqsjiscodec.h new file mode 100644 index 000000000..9bac66caf --- /dev/null +++ b/src/codecs/ntqsjiscodec.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Definition of TQSjisCodec class +** +** Created : 990225 +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Most of the code here was originally written by Serika Kurusugawa +// a.k.a. Junji Takagi, and is included in TQt with the author's permission, +// and the grateful thanks of the Trolltech team. + +/* + * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef TQSJISCODEC_H +#define TQSJISCODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#include "ntqjpunicode.h" +#endif // QT_H + +#ifndef QT_NO_BIG_CODECS + +#if defined(QT_PLUGIN) +#define Q_EXPORT_CODECS_JP +#else +#define Q_EXPORT_CODECS_JP Q_EXPORT +#endif + +class Q_EXPORT_CODECS_JP TQSjisCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + const char* mimeName() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; + + TQSjisCodec(); + ~TQSjisCodec(); + +protected: + const TQJpUnicodeConv *conv; +}; + +#endif +#endif diff --git a/src/codecs/ntqtextcodec.h b/src/codecs/ntqtextcodec.h new file mode 100644 index 000000000..d6ea1a3bd --- /dev/null +++ b/src/codecs/ntqtextcodec.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Definition of TQTextCodec class +** +** Created : 981015 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTCODEC_H +#define TQTEXTCODEC_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_TEXTCODEC + +class TQTextCodec; +class TQIODevice; +class TQFont; + +class Q_EXPORT TQTextEncoder { +public: + virtual ~TQTextEncoder(); + virtual TQCString fromUnicode(const TQString& uc, int& lenInOut) = 0; +}; + +class Q_EXPORT TQTextDecoder { +public: + virtual ~TQTextDecoder(); + virtual TQString toUnicode(const char* chars, int len) = 0; +}; + +class Q_EXPORT TQTextCodec { +public: + virtual ~TQTextCodec(); + +#ifndef QT_NO_CODECS + static TQTextCodec* loadCharmap(TQIODevice*); + static TQTextCodec* loadCharmapFile(TQString filename); +#endif //QT_NO_CODECS + static TQTextCodec* codecForMib(int mib); + static TQTextCodec* codecForName(const char* hint, int accuracy=0); + static TQTextCodec* codecForContent(const char* chars, int len); + static TQTextCodec* codecForIndex(int i); + static TQTextCodec* codecForLocale(); + static void setCodecForLocale(TQTextCodec *c); + + static TQTextCodec* codecForTr(); + static void setCodecForTr(TQTextCodec *c); + static TQTextCodec* codecForCStrings(); + static void setCodecForCStrings(TQTextCodec *c); + + 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; + virtual TQTextEncoder* makeEncoder() const; + + virtual TQString toUnicode(const char* chars, int len) const; + virtual TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + + TQCString fromUnicode(const TQString& uc) const; + TQString toUnicode(const TQByteArray&, int len) const; + TQString toUnicode(const TQByteArray&) const; + TQString toUnicode(const TQCString&, int len) const; + TQString toUnicode(const TQCString&) const; + TQString toUnicode(const char* chars) const; + virtual bool canEncode( TQChar ) const; + virtual bool canEncode( const TQString& ) const; + + virtual int heuristicContentMatch(const char* chars, int len) const = 0; + virtual int heuristicNameMatch(const char* hint) const; + + virtual TQByteArray fromUnicode(const TQString& uc, int from, int len) const; + virtual unsigned short characterFromUnicode(const TQString &str, int pos) const; + +protected: + TQTextCodec(); + static int simpleHeuristicNameMatch(const char* name, const char* hint); + +private: + friend class TQFont; + friend class TQFontEngineXLFD; + void fromUnicodeInternal( const TQChar *in, unsigned short *out, int length ); + + static TQTextCodec *cftr; + static TQTextCodec *cfcs; +}; + +inline TQTextCodec* TQTextCodec::codecForTr() { return cftr; } +inline void TQTextCodec::setCodecForTr(TQTextCodec *c) { cftr = c; } +inline TQTextCodec* TQTextCodec::codecForCStrings() { return cfcs; } +inline void TQTextCodec::setCodecForCStrings(TQTextCodec *c) { cfcs = c; } + +#endif // QT_NO_TEXTCODEC +#endif // TQTEXTCODEC_H diff --git a/src/codecs/ntqtextcodecfactory.h b/src/codecs/ntqtextcodecfactory.h new file mode 100644 index 000000000..94b4dddad --- /dev/null +++ b/src/codecs/ntqtextcodecfactory.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Definition of TQTextCodecFactory class +** +** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTCODECFACTORY_H +#define TQTEXTCODECFACTORY_H + +#ifndef QT_H +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_TEXTCODEC + +class TQTextCodec; + +class Q_EXPORT TQTextCodecFactory +{ +public: + static TQTextCodec *createForName( const TQString & ); + static TQTextCodec *createForMib( int ); +}; + +#endif // QT_NO_TEXTCODEC + +#endif // TQTEXTCODECFACTORY_H diff --git a/src/codecs/ntqtextcodecplugin.h b/src/codecs/ntqtextcodecplugin.h new file mode 100644 index 000000000..787941f51 --- /dev/null +++ b/src/codecs/ntqtextcodecplugin.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Definition of TQTextCodecPlugin class +** +** Created : 010920 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTCODECPLUGIN_H +#define TQTEXTCODECPLUGIN_H + +#ifndef QT_H +#include "ntqgplugin.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_TEXTCODECPLUGIN +class TQTextCodec; +class TQTextCodecPluginPrivate; + +class Q_EXPORT TQTextCodecPlugin : public TQGPlugin +{ + Q_OBJECT +public: + TQTextCodecPlugin(); + ~TQTextCodecPlugin(); + + virtual TQStringList names() const = 0; + virtual TQTextCodec *createForName( const TQString &name ) = 0; + + virtual TQValueList mibEnums() const = 0; + virtual TQTextCodec *createForMib( int mib ) = 0; + +private: + TQTextCodecPluginPrivate *d; +}; +#endif // QT_NO_TEXTCODECPLUGIN +#endif // TQTEXTCODECPLUGIN_H diff --git a/src/codecs/ntqtsciicodec.h b/src/codecs/ntqtsciicodec.h new file mode 100644 index 000000000..4b881b135 --- /dev/null +++ b/src/codecs/ntqtsciicodec.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Definition of TQTsciiCodec class +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +// Most of the code here was originally written by Hans Petter Bieker, +// and is included in TQt with the author's permission, and the grateful +// thanks of the Trolltech team. + +/* + * Copyright (C) 2000 Hans Petter Bieker. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef TQTSCIICODEC_H +#define TQTSCIICODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#endif // QT_H + +#ifndef QT_NO_CODECS + +class Q_EXPORT TQTsciiCodec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; + int heuristicNameMatch(const char* hint) const; +}; + +#endif + +#endif diff --git a/src/codecs/ntqutfcodec.h b/src/codecs/ntqutfcodec.h new file mode 100644 index 000000000..8955b6c2c --- /dev/null +++ b/src/codecs/ntqutfcodec.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Definition of TQUtf{8,16}Codec class +** +** Created : 981015 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQUTFCODEC_H +#define TQUTFCODEC_H + +#ifndef QT_H +#include "ntqtextcodec.h" +#endif // QT_H + +#ifndef QT_NO_TEXTCODEC + +class Q_EXPORT TQUtf8Codec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + +#if !defined(Q_NO_USING_KEYWORD) + using TQTextCodec::fromUnicode; +#endif + TQCString fromUnicode(const TQString& uc, int& lenInOut) const; + TQString toUnicode(const char* chars, int len) const; + + int heuristicContentMatch(const char* chars, int len) const; +}; + +class Q_EXPORT TQUtf16Codec : public TQTextCodec { +public: + virtual int mibEnum() const; + const char* name() const; + + TQTextDecoder* makeDecoder() const; + TQTextEncoder* makeEncoder() const; + + int heuristicContentMatch(const char* chars, int len) const; +}; + +#endif //QT_NO_TEXTCODEC +#endif // TQUTFCODEC_H diff --git a/src/codecs/qbig5codec.cpp b/src/codecs/qbig5codec.cpp index 9fdc45fac..efb90ff39 100644 --- a/src/codecs/qbig5codec.cpp +++ b/src/codecs/qbig5codec.cpp @@ -39,7 +39,7 @@ **********************************************************************/ /*! - \class TQBig5Codec qbig5codec.h + \class TQBig5Codec ntqbig5codec.h \ingroup i18n \brief The TQBig5Codec class provides conversion to and from the Big5 encoding. @@ -98,7 +98,7 @@ SUCH DAMAGE. */ -#include "qbig5codec.h" +#include "ntqbig5codec.h" #ifndef QT_NO_BIG_CODECS diff --git a/src/codecs/qbig5codec.h b/src/codecs/qbig5codec.h deleted file mode 100644 index c32f3a63b..000000000 --- a/src/codecs/qbig5codec.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Definition of TQBig5Codec class -** -** Created : 990713 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Most of the code here was originally written by Ming-Che Chuang and -// is included in TQt with the author's permission, and the grateful -// thanks of the Trolltech team. - -#ifndef TQBIG5CODEC_H -#define TQBIG5CODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#endif // QT_H - -#ifndef QT_NO_BIG_CODECS - -class TQBig5Codec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -class TQBig5hkscsCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -#endif -#endif diff --git a/src/codecs/qeucjpcodec.cpp b/src/codecs/qeucjpcodec.cpp index a869b9144..1b5a3c897 100644 --- a/src/codecs/qeucjpcodec.cpp +++ b/src/codecs/qeucjpcodec.cpp @@ -42,7 +42,7 @@ // a.k.a. Junji Takagi, and is included in TQt with the author's permission, // and the grateful thanks of the Trolltech team. -/*! \class TQEucJpCodec qeucjpcodec.h +/*! \class TQEucJpCodec ntqeucjpcodec.h \reentrant \ingroup i18n @@ -114,7 +114,7 @@ * SUCH DAMAGE. */ -#include "qeucjpcodec.h" +#include "ntqeucjpcodec.h" #ifndef QT_NO_BIG_CODECS diff --git a/src/codecs/qeucjpcodec.h b/src/codecs/qeucjpcodec.h deleted file mode 100644 index 31154b619..000000000 --- a/src/codecs/qeucjpcodec.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Definition of TQEucJpCodec class -** -** Created : 990225 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Most of the code here was originally written by Serika Kurusugawa -// a.k.a. Junji Takagi, and is included in TQt with the author's permission, -// and the grateful thanks of the Trolltech team. - -/* - * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef TQEUCJPCODEC_H -#define TQEUCJPCODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#include "qjpunicode.h" -#endif // QT_H - -#ifndef QT_NO_BIG_CODECS - -#if defined(QT_PLUGIN) -#define Q_EXPORT_CODECS_JP -#else -#define Q_EXPORT_CODECS_JP Q_EXPORT -#endif - -class Q_EXPORT_CODECS_JP TQEucJpCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - const char* mimeName() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; - - TQEucJpCodec(); - ~TQEucJpCodec(); - -protected: - const TQJpUnicodeConv *conv; -}; - -#endif -#endif diff --git a/src/codecs/qeuckrcodec.cpp b/src/codecs/qeuckrcodec.cpp index fc799bd84..547c00e80 100644 --- a/src/codecs/qeuckrcodec.cpp +++ b/src/codecs/qeuckrcodec.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -/*! \class TQEucKrCodec qeuckrcodec.h +/*! \class TQEucKrCodec ntqeuckrcodec.h \reentrant \ingroup i18n @@ -92,7 +92,7 @@ int heuristicNameMatch(const char* hint) const; */ -#include "qeuckrcodec.h" +#include "ntqeuckrcodec.h" #ifndef QT_NO_BIG_CODECS diff --git a/src/codecs/qeuckrcodec.h b/src/codecs/qeuckrcodec.h deleted file mode 100644 index 0c8371d0d..000000000 --- a/src/codecs/qeuckrcodec.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Definition of TQEucKrCodec class -** -** Created : 990303 -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -/* - * Copyright (C) 1999-2000 Mizi Research Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef TQEUCKRCODEC_H -#define TQEUCKRCODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#endif // QT_H - -#ifndef QT_NO_BIG_CODECS - -#if defined(QT_PLUGIN) -#define Q_EXPORT_CODECS_KR -#else -#define Q_EXPORT_CODECS_KR Q_EXPORT -#endif - -class Q_EXPORT_CODECS_KR TQEucKrCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - const char* mimeName() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -#endif -#endif diff --git a/src/codecs/qfontcodecs_p.h b/src/codecs/qfontcodecs_p.h index b78738fd8..d323fbb92 100644 --- a/src/codecs/qfontcodecs_p.h +++ b/src/codecs/qfontcodecs_p.h @@ -54,8 +54,8 @@ // #ifndef QT_H -#include "qglobal.h" -#include "qtextcodec.h" +#include "ntqglobal.h" +#include "ntqtextcodec.h" #endif // QT_H diff --git a/src/codecs/qfontjpcodec.cpp b/src/codecs/qfontjpcodec.cpp index 8cdac2dee..365f21e0e 100644 --- a/src/codecs/qfontjpcodec.cpp +++ b/src/codecs/qfontjpcodec.cpp @@ -42,7 +42,7 @@ #ifndef QT_NO_CODECS #ifndef QT_NO_BIG_CODECS -#include "qjpunicode.h" +#include "ntqjpunicode.h" // JIS X 0201 diff --git a/src/codecs/qgb18030codec.cpp b/src/codecs/qgb18030codec.cpp index 257cbb587..938967071 100644 --- a/src/codecs/qgb18030codec.cpp +++ b/src/codecs/qgb18030codec.cpp @@ -35,7 +35,7 @@ ** **********************************************************************/ -/*! \class TQGb18030Codec qgb18030codec.h +/*! \class TQGb18030Codec ntqgb18030codec.h \reentrant \ingroup i18n @@ -115,10 +115,10 @@ SUCH DAMAGE. */ -#include "qgb18030codec.h" +#include "ntqgb18030codec.h" #if (QT_VERSION-0 >= 0x040000) -#error "move obsolete header into the src/compat directory" +#error "move obsolete header into the src/compat directory" #endif #ifndef QT_NO_BIG_CODECS diff --git a/src/codecs/qgb18030codec.h b/src/codecs/qgb18030codec.h deleted file mode 100644 index a0f88dd84..000000000 --- a/src/codecs/qgb18030codec.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGb18030Codec class -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Contributed by James Su - -#ifndef TQGB18030CODEC_H -#define TQGB18030CODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#endif // QT_H - - -#ifndef QT_NO_BIG_CODECS - -#if defined(QT_PLUGIN) -#define Q_EXPORT_CODECS_CN -#else -#define Q_EXPORT_CODECS_CN Q_EXPORT -#endif - -class Q_EXPORT_CODECS_CN TQGb18030Codec : public TQTextCodec { -public: - TQGb18030Codec(); - - int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -class Q_EXPORT_CODECS_CN TQGbkCodec : public TQGb18030Codec { -public: - TQGbkCodec(); - - int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQGb18030Codec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -class Q_EXPORT_CODECS_CN TQGb2312Codec : public TQGb18030Codec { -public: - TQGb2312Codec(); - - int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQGb18030Codec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -#endif -#endif diff --git a/src/codecs/qgbkcodec.h b/src/codecs/qgbkcodec.h deleted file mode 100644 index df13073d7..000000000 --- a/src/codecs/qgbkcodec.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Contributed by James Su - -#ifndef TQGBKCODEC_H -#define TQGBKCODEC_H -#ifndef QT_H -#include "qgb18030codec.h" -#endif // QT_H -#endif diff --git a/src/codecs/qisciicodec_p.h b/src/codecs/qisciicodec_p.h index 6f2f43edb..ebf9fe14b 100644 --- a/src/codecs/qisciicodec_p.h +++ b/src/codecs/qisciicodec_p.h @@ -2,7 +2,7 @@ #define TQISCIICODEC_H #ifndef QT_H -#include "qtextcodec.h" +#include "ntqtextcodec.h" #endif // QT_H #ifndef QT_NO_CODECS diff --git a/src/codecs/qjiscodec.cpp b/src/codecs/qjiscodec.cpp index f0ecfdb65..5f5afbb9b 100644 --- a/src/codecs/qjiscodec.cpp +++ b/src/codecs/qjiscodec.cpp @@ -132,7 +132,7 @@ SUCH DAMAGE. */ -#include "qjiscodec.h" +#include "ntqjiscodec.h" #ifndef QT_NO_BIG_CODECS diff --git a/src/codecs/qjiscodec.h b/src/codecs/qjiscodec.h deleted file mode 100644 index 02dc2acf0..000000000 --- a/src/codecs/qjiscodec.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Definition of TQJisCodec class -** -** Created : 990225 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Most of the code here was originally written by Serika Kurusugawa -// a.k.a. Junji Takagi, and is included in TQt with the author's permission, -// and the grateful thanks of the Trolltech team. - -/* - * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef TQJISCODEC_H -#define TQJISCODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#include "qjpunicode.h" -#endif // QT_H - -#ifndef QT_NO_BIG_CODECS - -#if defined(QT_PLUGIN) -#define Q_EXPORT_CODECS_JP -#else -#define Q_EXPORT_CODECS_JP Q_EXPORT -#endif - -class Q_EXPORT_CODECS_JP TQJisCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - const char* mimeName() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; - - TQJisCodec(); - ~TQJisCodec(); - -protected: - const TQJpUnicodeConv *conv; -}; - -#endif -#endif diff --git a/src/codecs/qjpunicode.cpp b/src/codecs/qjpunicode.cpp index bc2d19328..1a6c34aea 100644 --- a/src/codecs/qjpunicode.cpp +++ b/src/codecs/qjpunicode.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -/*! \class TQJpUnicodeConv qjpunicode.h +/*! \class TQJpUnicodeConv ntqjpunicode.h \reentrant \ingroup i18n @@ -82,9 +82,9 @@ SUCH DAMAGE. */ -#include "qjpunicode.h" +#include "ntqjpunicode.h" #ifndef QT_NO_BIG_CODECS -#include "qcstring.h" +#include "ntqcstring.h" #ifdef Q_OS_TEMP #include "qwinfunctions_wce.h" #endif diff --git a/src/codecs/qjpunicode.h b/src/codecs/qjpunicode.h deleted file mode 100644 index 15107d7c2..000000000 --- a/src/codecs/qjpunicode.h +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -** -** Definition of TQJpUnicodeConv class -** -** Created : 990225 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Most of the code here was originally written by Serika Kurusugawa -// a.k.a. Junji Takagi, and is included in TQt with the author's permission, -// and the grateful thanks of the Trolltech team. - -/* - * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef TQJPUNICODE_H -#define TQJPUNICODE_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#ifndef QT_NO_BIG_CODECS - -#if defined(QT_PLUGIN) -#define Q_EXPORT_CODECS_JP -#else -#define Q_EXPORT_CODECS_JP Q_EXPORT -#endif - -class Q_EXPORT_CODECS_JP TQJpUnicodeConv { -public: - enum Rules { - // "ASCII" is ANSI X.3.4-1986, a.k.a. US-ASCII here. - Default = 0x0000, - - Unicode = 0x0001, - Unicode_JISX0201 = 0x0001, - Unicode_ASCII = 0x0002, - JISX0221_JISX0201 = 0x0003, - JISX0221_ASCII = 0x0004, - Sun_JDK117 = 0x0005, - Microsoft_CP932 = 0x0006, - - NEC_VDC = 0x0100, // NEC Vender Defined Char - UDC = 0x0200, // User Defined Char - IBM_VDC = 0x0400 // IBM Vender Defined Char - }; - static TQJpUnicodeConv *newConverter(int rule); - - virtual uint asciiToUnicode(uint h, uint l) const; - /*virtual*/ uint jisx0201ToUnicode(uint h, uint l) const; - virtual uint jisx0201LatinToUnicode(uint h, uint l) const; - /*virtual*/ uint jisx0201KanaToUnicode(uint h, uint l) const; - virtual uint jisx0208ToUnicode(uint h, uint l) const; - virtual uint jisx0212ToUnicode(uint h, uint l) const; - - uint asciiToUnicode(uint ascii) const { - return asciiToUnicode((ascii & 0xff00) >> 8, (ascii & 0x00ff)); - } - uint jisx0201ToUnicode(uint jis) const { - return jisx0201ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0201LatinToUnicode(uint jis) const { - return jisx0201LatinToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0201KanaToUnicode(uint jis) const { - return jisx0201KanaToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0208ToUnicode(uint jis) const { - return jisx0208ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - uint jisx0212ToUnicode(uint jis) const { - return jisx0212ToUnicode((jis & 0xff00) >> 8, (jis & 0x00ff)); - } - - virtual uint unicodeToAscii(uint h, uint l) const; - /*virtual*/ uint unicodeToJisx0201(uint h, uint l) const; - virtual uint unicodeToJisx0201Latin(uint h, uint l) const; - /*virtual*/ uint unicodeToJisx0201Kana(uint h, uint l) const; - virtual uint unicodeToJisx0208(uint h, uint l) const; - virtual uint unicodeToJisx0212(uint h, uint l) const; - - uint unicodeToAscii(uint unicode) const { - return unicodeToAscii((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0201(uint unicode) const { - return unicodeToJisx0201((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0201Latin(uint unicode) const { - return unicodeToJisx0201Latin((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0201Kana(uint unicode) const { - return unicodeToJisx0201Kana((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0208(uint unicode) const { - return unicodeToJisx0208((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - uint unicodeToJisx0212(uint unicode) const { - return unicodeToJisx0212((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - - uint sjisToUnicode(uint h, uint l) const; - uint unicodeToSjis(uint h, uint l) const; - uint sjisibmvdcToUnicode(uint h, uint l) const; - uint unicodeToSjisibmvdc(uint h, uint l) const; - uint cp932ToUnicode(uint h, uint l) const; - uint unicodeToCp932(uint h, uint l) const; - - uint sjisToUnicode(uint sjis) const { - return sjisToUnicode((sjis & 0xff00) >> 8, (sjis & 0x00ff)); - } - uint unicodeToSjis(uint unicode) const { - return unicodeToSjis((unicode & 0xff00) >> 8, (unicode & 0x00ff)); - } - -protected: - TQJpUnicodeConv(int r) : rule(r) {} - -private: - int rule; -}; - -#endif // QT_NO_BIG_CODECS -#endif /* TQJPUNICODE_H */ diff --git a/src/codecs/qrtlcodec.cpp b/src/codecs/qrtlcodec.cpp index 75a049c7e..fa1585ec8 100644 --- a/src/codecs/qrtlcodec.cpp +++ b/src/codecs/qrtlcodec.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qrtlcodec.h" +#include "ntqrtlcodec.h" #include #ifndef QT_NO_CODEC_HEBREW @@ -359,7 +359,7 @@ static TQChar::Direction findBasicDirection(TQString str) /*! - \class TQHebrewCodec qrtlcodec.h + \class TQHebrewCodec ntqrtlcodec.h \reentrant \ingroup i18n diff --git a/src/codecs/qrtlcodec.h b/src/codecs/qrtlcodec.h deleted file mode 100644 index 1ddbbde7a..000000000 --- a/src/codecs/qrtlcodec.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQTextCodec class -** -** Created : 981015 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQRTLCODEC_H -#define TQRTLCODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#endif // QT_H - -#ifndef QT_NO_CODEC_HEBREW - -class Q_EXPORT TQHebrewCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - const char* mimeName() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; -}; - -#endif - -#endif diff --git a/src/codecs/qsjiscodec.cpp b/src/codecs/qsjiscodec.cpp index e6666a02b..9d2df5109 100644 --- a/src/codecs/qsjiscodec.cpp +++ b/src/codecs/qsjiscodec.cpp @@ -42,7 +42,7 @@ // a.k.a. Junji Takagi, and is included in TQt with the author's permission, // and the grateful thanks of the Trolltech team. -/*! \class TQSjisCodec qsjiscodec.h +/*! \class TQSjisCodec ntqsjiscodec.h \reentrant \ingroup i18n \brief The TQSjisCodec class provides conversion to and from Shift-JIS. @@ -90,7 +90,7 @@ SUCH DAMAGE. */ -#include "qsjiscodec.h" +#include "ntqsjiscodec.h" #ifndef QT_NO_BIG_CODECS diff --git a/src/codecs/qsjiscodec.h b/src/codecs/qsjiscodec.h deleted file mode 100644 index 4e85505ef..000000000 --- a/src/codecs/qsjiscodec.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSjisCodec class -** -** Created : 990225 -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Most of the code here was originally written by Serika Kurusugawa -// a.k.a. Junji Takagi, and is included in TQt with the author's permission, -// and the grateful thanks of the Trolltech team. - -/* - * Copyright (C) 1999 Serika Kurusugawa, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef TQSJISCODEC_H -#define TQSJISCODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#include "qjpunicode.h" -#endif // QT_H - -#ifndef QT_NO_BIG_CODECS - -#if defined(QT_PLUGIN) -#define Q_EXPORT_CODECS_JP -#else -#define Q_EXPORT_CODECS_JP Q_EXPORT -#endif - -class Q_EXPORT_CODECS_JP TQSjisCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - const char* mimeName() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; - - TQSjisCodec(); - ~TQSjisCodec(); - -protected: - const TQJpUnicodeConv *conv; -}; - -#endif -#endif diff --git a/src/codecs/qt_codecs.pri b/src/codecs/qt_codecs.pri index 344557299..3753a5dae 100644 --- a/src/codecs/qt_codecs.pri +++ b/src/codecs/qt_codecs.pri @@ -5,21 +5,21 @@ tools { CODECS_P = codecs HEADERS += \ #$$CODECS_H/qasmocodec.h \ - $$CODECS_H/qbig5codec.h \ - $$CODECS_H/qeucjpcodec.h \ - $$CODECS_H/qeuckrcodec.h \ + $$CODECS_H/ntqbig5codec.h \ + $$CODECS_H/ntqeucjpcodec.h \ + $$CODECS_H/ntqeuckrcodec.h \ $$CODECS_P/qisciicodec_p.h \ - $$CODECS_H/qgb18030codec.h \ - $$CODECS_H/qjiscodec.h \ - $$CODECS_H/qjpunicode.h \ - $$CODECS_H/qrtlcodec.h \ - $$CODECS_H/qsjiscodec.h \ - $$CODECS_H/qtextcodec.h \ - $$CODECS_H/qtsciicodec.h \ - $$CODECS_H/qutfcodec.h \ + $$CODECS_H/ntqgb18030codec.h \ + $$CODECS_H/ntqjiscodec.h \ + $$CODECS_H/ntqjpunicode.h \ + $$CODECS_H/ntqrtlcodec.h \ + $$CODECS_H/ntqsjiscodec.h \ + $$CODECS_H/ntqtextcodec.h \ + $$CODECS_H/ntqtsciicodec.h \ + $$CODECS_H/ntqutfcodec.h \ $$CODECS_P/qtextcodecinterface_p.h \ - $$CODECS_H/qtextcodecfactory.h \ - $$CODECS_H/qtextcodecplugin.h + $$CODECS_H/ntqtextcodecfactory.h \ + $$CODECS_H/ntqtextcodecplugin.h SOURCES += \ #$$CODECS_CPP/qasmocodec.cpp \ diff --git a/src/codecs/qtextcodec.cpp b/src/codecs/qtextcodec.cpp index c08d465fa..23b6ff51a 100644 --- a/src/codecs/qtextcodec.cpp +++ b/src/codecs/qtextcodec.cpp @@ -45,30 +45,30 @@ # undef open #endif -#include "qtextcodec.h" +#include "ntqtextcodec.h" #ifndef QT_NO_TEXTCODEC -#include "qvaluelist.h" -#include "qtextcodecfactory.h" -#include "qutfcodec.h" -#include "qnamespace.h" +#include "ntqvaluelist.h" +#include "ntqtextcodecfactory.h" +#include "ntqutfcodec.h" +#include "ntqnamespace.h" #ifndef QT_NO_CODECS -#include "qrtlcodec.h" -#include "qtsciicodec.h" +#include "ntqrtlcodec.h" +#include "ntqtsciicodec.h" #include "qisciicodec_p.h" #endif // QT_NO_CODECS #ifndef QT_NO_BIG_CODECS -#include "qbig5codec.h" -#include "qeucjpcodec.h" -#include "qeuckrcodec.h" -#include "qgb18030codec.h" -#include "qjiscodec.h" -#include "qjpunicode.h" -#include "qsjiscodec.h" +#include "ntqbig5codec.h" +#include "ntqeucjpcodec.h" +#include "ntqeuckrcodec.h" +#include "ntqgb18030codec.h" +#include "ntqjiscodec.h" +#include "ntqjpunicode.h" +#include "ntqsjiscodec.h" #endif // QT_NO_BIG_CODECS -#include "qfile.h" -#include "qstrlist.h" -#include "qstring.h" +#include "ntqfile.h" +#include "ntqstrlist.h" +#include "ntqstring.h" #include "../tools/qlocale_p.h" #if !defined(QT_NO_CODECS) && !defined(QT_NO_BIG_CODECS) && defined(Q_WS_X11) @@ -202,7 +202,7 @@ TQString TQTextStatelessDecoder::toUnicode(const char* chars, int len) /*! - \class TQTextCodec qtextcodec.h + \class TQTextCodec ntqtextcodec.h \brief The TQTextCodec class provides conversion between text encodings. \reentrant \ingroup i18n @@ -1160,7 +1160,7 @@ bool TQTextCodec::canEncode( const TQString& s ) const /*! - \class TQTextEncoder qtextcodec.h + \class TQTextEncoder ntqtextcodec.h \brief The TQTextEncoder class provides a state-based encoder. \reentrant \ingroup i18n @@ -1192,7 +1192,7 @@ TQTextEncoder::~TQTextEncoder() */ /*! - \class TQTextDecoder qtextcodec.h + \class TQTextDecoder ntqtextcodec.h \brief The TQTextDecoder class provides a state-based decoder. \reentrant \ingroup i18n diff --git a/src/codecs/qtextcodec.h b/src/codecs/qtextcodec.h deleted file mode 100644 index 5fb16c1dc..000000000 --- a/src/codecs/qtextcodec.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTextCodec class -** -** Created : 981015 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTCODEC_H -#define TQTEXTCODEC_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_TEXTCODEC - -class TQTextCodec; -class TQIODevice; -class TQFont; - -class Q_EXPORT TQTextEncoder { -public: - virtual ~TQTextEncoder(); - virtual TQCString fromUnicode(const TQString& uc, int& lenInOut) = 0; -}; - -class Q_EXPORT TQTextDecoder { -public: - virtual ~TQTextDecoder(); - virtual TQString toUnicode(const char* chars, int len) = 0; -}; - -class Q_EXPORT TQTextCodec { -public: - virtual ~TQTextCodec(); - -#ifndef QT_NO_CODECS - static TQTextCodec* loadCharmap(TQIODevice*); - static TQTextCodec* loadCharmapFile(TQString filename); -#endif //QT_NO_CODECS - static TQTextCodec* codecForMib(int mib); - static TQTextCodec* codecForName(const char* hint, int accuracy=0); - static TQTextCodec* codecForContent(const char* chars, int len); - static TQTextCodec* codecForIndex(int i); - static TQTextCodec* codecForLocale(); - static void setCodecForLocale(TQTextCodec *c); - - static TQTextCodec* codecForTr(); - static void setCodecForTr(TQTextCodec *c); - static TQTextCodec* codecForCStrings(); - static void setCodecForCStrings(TQTextCodec *c); - - 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; - virtual TQTextEncoder* makeEncoder() const; - - virtual TQString toUnicode(const char* chars, int len) const; - virtual TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - - TQCString fromUnicode(const TQString& uc) const; - TQString toUnicode(const TQByteArray&, int len) const; - TQString toUnicode(const TQByteArray&) const; - TQString toUnicode(const TQCString&, int len) const; - TQString toUnicode(const TQCString&) const; - TQString toUnicode(const char* chars) const; - virtual bool canEncode( TQChar ) const; - virtual bool canEncode( const TQString& ) const; - - virtual int heuristicContentMatch(const char* chars, int len) const = 0; - virtual int heuristicNameMatch(const char* hint) const; - - virtual TQByteArray fromUnicode(const TQString& uc, int from, int len) const; - virtual unsigned short characterFromUnicode(const TQString &str, int pos) const; - -protected: - TQTextCodec(); - static int simpleHeuristicNameMatch(const char* name, const char* hint); - -private: - friend class TQFont; - friend class TQFontEngineXLFD; - void fromUnicodeInternal( const TQChar *in, unsigned short *out, int length ); - - static TQTextCodec *cftr; - static TQTextCodec *cfcs; -}; - -inline TQTextCodec* TQTextCodec::codecForTr() { return cftr; } -inline void TQTextCodec::setCodecForTr(TQTextCodec *c) { cftr = c; } -inline TQTextCodec* TQTextCodec::codecForCStrings() { return cfcs; } -inline void TQTextCodec::setCodecForCStrings(TQTextCodec *c) { cfcs = c; } - -#endif // QT_NO_TEXTCODEC -#endif // TQTEXTCODEC_H diff --git a/src/codecs/qtextcodecfactory.cpp b/src/codecs/qtextcodecfactory.cpp index a0ccedbcd..71e5ed125 100644 --- a/src/codecs/qtextcodecfactory.cpp +++ b/src/codecs/qtextcodecfactory.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qtextcodecfactory.h" +#include "ntqtextcodecfactory.h" #ifndef QT_NO_TEXTCODEC #ifndef QT_NO_COMPONENT -#include "qapplication.h" -#include "qcleanuphandler.h" +#include "ntqapplication.h" +#include "ntqcleanuphandler.h" #include #include "qtextcodecinterface_p.h" diff --git a/src/codecs/qtextcodecfactory.h b/src/codecs/qtextcodecfactory.h deleted file mode 100644 index 8e1bf38ad..000000000 --- a/src/codecs/qtextcodecfactory.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTextCodecFactory class -** -** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTCODECFACTORY_H -#define TQTEXTCODECFACTORY_H - -#ifndef QT_H -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_TEXTCODEC - -class TQTextCodec; - -class Q_EXPORT TQTextCodecFactory -{ -public: - static TQTextCodec *createForName( const TQString & ); - static TQTextCodec *createForMib( int ); -}; - -#endif // QT_NO_TEXTCODEC - -#endif // TQTEXTCODECFACTORY_H diff --git a/src/codecs/qtextcodecplugin.cpp b/src/codecs/qtextcodecplugin.cpp index 29264c9dd..6f084584d 100644 --- a/src/codecs/qtextcodecplugin.cpp +++ b/src/codecs/qtextcodecplugin.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qtextcodecplugin.h" +#include "ntqtextcodecplugin.h" #ifndef QT_NO_TEXTCODECPLUGIN #include "qtextcodecinterface_p.h" /*! - \class TQTextCodecPlugin qtextcodecplugin.h + \class TQTextCodecPlugin ntqtextcodecplugin.h \brief The TQTextCodecPlugin class provides an abstract base for custom TQTextCodec plugins. \reentrant \ingroup plugins diff --git a/src/codecs/qtextcodecplugin.h b/src/codecs/qtextcodecplugin.h deleted file mode 100644 index b9393a023..000000000 --- a/src/codecs/qtextcodecplugin.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTextCodecPlugin class -** -** Created : 010920 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTCODECPLUGIN_H -#define TQTEXTCODECPLUGIN_H - -#ifndef QT_H -#include "qgplugin.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_TEXTCODECPLUGIN -class TQTextCodec; -class TQTextCodecPluginPrivate; - -class Q_EXPORT TQTextCodecPlugin : public TQGPlugin -{ - Q_OBJECT -public: - TQTextCodecPlugin(); - ~TQTextCodecPlugin(); - - virtual TQStringList names() const = 0; - virtual TQTextCodec *createForName( const TQString &name ) = 0; - - virtual TQValueList mibEnums() const = 0; - virtual TQTextCodec *createForMib( int mib ) = 0; - -private: - TQTextCodecPluginPrivate *d; -}; -#endif // QT_NO_TEXTCODECPLUGIN -#endif // TQTEXTCODECPLUGIN_H diff --git a/src/codecs/qtsciicodec.cpp b/src/codecs/qtsciicodec.cpp index 5d6825272..87fc18b3f 100644 --- a/src/codecs/qtsciicodec.cpp +++ b/src/codecs/qtsciicodec.cpp @@ -40,7 +40,7 @@ // and is included in TQt with the author's permission, and the grateful // thanks of the Trolltech team. -/*! \class TQTsciiCodec qtsciicodec.h +/*! \class TQTsciiCodec ntqtsciicodec.h \reentrant \ingroup i18n @@ -92,7 +92,7 @@ SUCH DAMAGE. */ -#include "qtsciicodec.h" +#include "ntqtsciicodec.h" #ifndef QT_NO_CODECS diff --git a/src/codecs/qtsciicodec.h b/src/codecs/qtsciicodec.h deleted file mode 100644 index abe0b3a99..000000000 --- a/src/codecs/qtsciicodec.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTsciiCodec class -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -// Most of the code here was originally written by Hans Petter Bieker, -// and is included in TQt with the author's permission, and the grateful -// thanks of the Trolltech team. - -/* - * Copyright (C) 2000 Hans Petter Bieker. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSETQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef TQTSCIICODEC_H -#define TQTSCIICODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#endif // QT_H - -#ifndef QT_NO_CODECS - -class Q_EXPORT TQTsciiCodec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; - int heuristicNameMatch(const char* hint) const; -}; - -#endif - -#endif diff --git a/src/codecs/qutfcodec.cpp b/src/codecs/qutfcodec.cpp index a95663614..4943ac8c2 100644 --- a/src/codecs/qutfcodec.cpp +++ b/src/codecs/qutfcodec.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qutfcodec.h" +#include "ntqutfcodec.h" #ifndef QT_NO_TEXTCODEC diff --git a/src/codecs/qutfcodec.h b/src/codecs/qutfcodec.h deleted file mode 100644 index d34c27925..000000000 --- a/src/codecs/qutfcodec.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Definition of TQUtf{8,16}Codec class -** -** Created : 981015 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQUTFCODEC_H -#define TQUTFCODEC_H - -#ifndef QT_H -#include "qtextcodec.h" -#endif // QT_H - -#ifndef QT_NO_TEXTCODEC - -class Q_EXPORT TQUtf8Codec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - -#if !defined(Q_NO_USING_KEYWORD) - using TQTextCodec::fromUnicode; -#endif - TQCString fromUnicode(const TQString& uc, int& lenInOut) const; - TQString toUnicode(const char* chars, int len) const; - - int heuristicContentMatch(const char* chars, int len) const; -}; - -class Q_EXPORT TQUtf16Codec : public TQTextCodec { -public: - virtual int mibEnum() const; - const char* name() const; - - TQTextDecoder* makeDecoder() const; - TQTextEncoder* makeEncoder() const; - - int heuristicContentMatch(const char* chars, int len) const; -}; - -#endif //QT_NO_TEXTCODEC -#endif // TQUTFCODEC_H diff --git a/src/compat/ntqapp.h b/src/compat/ntqapp.h new file mode 100644 index 000000000..05e743317 --- /dev/null +++ b/src/compat/ntqapp.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQAPP_H +#define TQAPP_H +#include "ntqapplication.h" +#endif diff --git a/src/compat/ntqarray.h b/src/compat/ntqarray.h new file mode 100644 index 000000000..dc29acdaa --- /dev/null +++ b/src/compat/ntqarray.h @@ -0,0 +1,27 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQARRAY_H +#define TQARRAY_H +#ifndef QT_NO_COMPAT +#include "ntqmemarray.h" +#endif +#endif diff --git a/src/compat/ntqbitarry.h b/src/compat/ntqbitarry.h new file mode 100644 index 000000000..9ed0f5629 --- /dev/null +++ b/src/compat/ntqbitarry.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQBITARRY_H +#define TQBITARRY_H +#include "ntqbitarray.h" +#endif diff --git a/src/compat/ntqbttngrp.h b/src/compat/ntqbttngrp.h new file mode 100644 index 000000000..410c3b440 --- /dev/null +++ b/src/compat/ntqbttngrp.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQBTTNGRP_H +#define TQBTTNGRP_H +#include "ntqbuttongroup.h" +#endif diff --git a/src/compat/ntqchkbox.h b/src/compat/ntqchkbox.h new file mode 100644 index 000000000..a7e8005e0 --- /dev/null +++ b/src/compat/ntqchkbox.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQCHKBOX_H +#define TQCHKBOX_H +#include "ntqcheckbox.h" +#endif diff --git a/src/compat/ntqclipbrd.h b/src/compat/ntqclipbrd.h new file mode 100644 index 000000000..abc51a374 --- /dev/null +++ b/src/compat/ntqclipbrd.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQCLIPBRD_H +#define TQCLIPBRD_H +#include "ntqclipboard.h" +#endif diff --git a/src/compat/ntqcollect.h b/src/compat/ntqcollect.h new file mode 100644 index 000000000..3fd294de9 --- /dev/null +++ b/src/compat/ntqcollect.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQCOLLECT_H +#define TQCOLLECT_H +#include "ntqptrcollection.h" +#endif diff --git a/src/compat/ntqcollection.h b/src/compat/ntqcollection.h new file mode 100644 index 000000000..e7ddd71d8 --- /dev/null +++ b/src/compat/ntqcollection.h @@ -0,0 +1,27 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQCOLLECTION_H +#define TQCOLLECTION_H +#ifndef QT_NO_COMPAT +#include "ntqptrcollection.h" +#endif +#endif diff --git a/src/compat/ntqcombo.h b/src/compat/ntqcombo.h new file mode 100644 index 000000000..024a6df05 --- /dev/null +++ b/src/compat/ntqcombo.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQCOMBO_H +#define TQCOMBO_H +#include "ntqcombobox.h" +#endif diff --git a/src/compat/ntqconnect.h b/src/compat/ntqconnect.h new file mode 100644 index 000000000..ef922de1b --- /dev/null +++ b/src/compat/ntqconnect.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQCONNECT_H +#define TQCONNECT_H +#include "ntqconnection.h" +#endif diff --git a/src/compat/ntqdatetm.h b/src/compat/ntqdatetm.h new file mode 100644 index 000000000..26acdb8b3 --- /dev/null +++ b/src/compat/ntqdatetm.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQDATETM_H +#define TQDATETM_H +#include "ntqdatetime.h" +#endif diff --git a/src/compat/ntqdrawutl.h b/src/compat/ntqdrawutl.h new file mode 100644 index 000000000..145dae668 --- /dev/null +++ b/src/compat/ntqdrawutl.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQDRAWUTL_H +#define TQDRAWUTL_H +#include "ntqdrawutil.h" +#endif diff --git a/src/compat/ntqdstream.h b/src/compat/ntqdstream.h new file mode 100644 index 000000000..081ff0f8b --- /dev/null +++ b/src/compat/ntqdstream.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQDSTREAM_H +#define TQDSTREAM_H +#include "ntqdatastream.h" +#endif diff --git a/src/compat/ntqfiledef.h b/src/compat/ntqfiledef.h new file mode 100644 index 000000000..03537ac91 --- /dev/null +++ b/src/compat/ntqfiledef.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQFILEDEF_H +#define TQFILEDEF_H +#include +#endif diff --git a/src/compat/ntqfiledlg.h b/src/compat/ntqfiledlg.h new file mode 100644 index 000000000..c00fd631d --- /dev/null +++ b/src/compat/ntqfiledlg.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQFILEDLG_H +#define TQFILEDLG_H +#include "ntqfiledialog.h" +#endif diff --git a/src/compat/ntqfileinf.h b/src/compat/ntqfileinf.h new file mode 100644 index 000000000..8d976b4bc --- /dev/null +++ b/src/compat/ntqfileinf.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQFILEINF_H +#define TQFILEINF_H +#include "ntqfileinfo.h" +#endif diff --git a/src/compat/ntqfontinf.h b/src/compat/ntqfontinf.h new file mode 100644 index 000000000..c0c6d8cc1 --- /dev/null +++ b/src/compat/ntqfontinf.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQFONTINF_H +#define TQFONTINF_H +#include "ntqfontinfo.h" +#endif diff --git a/src/compat/ntqfontmet.h b/src/compat/ntqfontmet.h new file mode 100644 index 000000000..ad7c115c4 --- /dev/null +++ b/src/compat/ntqfontmet.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQFONTMET_H +#define TQFONTMET_H +#include "ntqfontmetrics.h" +#endif diff --git a/src/compat/ntqgrpbox.h b/src/compat/ntqgrpbox.h new file mode 100644 index 000000000..d8ad712b0 --- /dev/null +++ b/src/compat/ntqgrpbox.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQGRPBOX_H +#define TQGRPBOX_H +#include "ntqgroupbox.h" +#endif diff --git a/src/compat/ntqintcach.h b/src/compat/ntqintcach.h new file mode 100644 index 000000000..a9ee0bafc --- /dev/null +++ b/src/compat/ntqintcach.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQINTCACH_H +#define TQINTCACH_H +#include "ntqintcache.h" +#endif diff --git a/src/compat/ntqiodev.h b/src/compat/ntqiodev.h new file mode 100644 index 000000000..83dd74901 --- /dev/null +++ b/src/compat/ntqiodev.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQIODEV_H +#define TQIODEV_H +#include "ntqiodevice.h" +#endif diff --git a/src/compat/ntqlcdnum.h b/src/compat/ntqlcdnum.h new file mode 100644 index 000000000..b6e5c4e59 --- /dev/null +++ b/src/compat/ntqlcdnum.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQLCDNUM_H +#define TQLCDNUM_H +#include "ntqlcdnumber.h" +#endif diff --git a/src/compat/ntqlined.h b/src/compat/ntqlined.h new file mode 100644 index 000000000..c573061da --- /dev/null +++ b/src/compat/ntqlined.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQLINED_H +#define TQLINED_H +#include "ntqlineedit.h" +#endif diff --git a/src/compat/ntqlist.h b/src/compat/ntqlist.h new file mode 100644 index 000000000..444cb3be3 --- /dev/null +++ b/src/compat/ntqlist.h @@ -0,0 +1,27 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQLIST_H +#define TQLIST_H +#ifndef QT_NO_COMPAT +#include "ntqptrlist.h" +#endif +#endif diff --git a/src/compat/ntqmenudta.h b/src/compat/ntqmenudta.h new file mode 100644 index 000000000..86f3e75d5 --- /dev/null +++ b/src/compat/ntqmenudta.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQMENUDTA_H +#define TQMENUDTA_H +#include "ntqmenudata.h" +#endif diff --git a/src/compat/ntqmetaobj.h b/src/compat/ntqmetaobj.h new file mode 100644 index 000000000..a8f237c0f --- /dev/null +++ b/src/compat/ntqmetaobj.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQMETAOBJ_H +#define TQMETAOBJ_H +#include "ntqmetaobject.h" +#endif diff --git a/src/compat/ntqmlined.h b/src/compat/ntqmlined.h new file mode 100644 index 000000000..28e1ab908 --- /dev/null +++ b/src/compat/ntqmlined.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQMLINED_H +#define TQMLINED_H +#include "ntqmultilineedit.h" +#endif diff --git a/src/compat/ntqmsgbox.h b/src/compat/ntqmsgbox.h new file mode 100644 index 000000000..55d34c51f --- /dev/null +++ b/src/compat/ntqmsgbox.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQMSGBOX_H +#define TQMSGBOX_H +#include "ntqmessagebox.h" +#endif diff --git a/src/compat/ntqmultilinedit.h b/src/compat/ntqmultilinedit.h new file mode 100644 index 000000000..e530f469c --- /dev/null +++ b/src/compat/ntqmultilinedit.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQMULTILINEDIT_H +#define TQMULTILINEDIT_H +#include "ntqmultilineedit.h" +#endif diff --git a/src/compat/ntqobjcoll.h b/src/compat/ntqobjcoll.h new file mode 100644 index 000000000..643c363b8 --- /dev/null +++ b/src/compat/ntqobjcoll.h @@ -0,0 +1,26 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQOBJCOLL_H +#define TQOBJCOLL_H +#include "ntqobjectlist.h" +#include "ntqobjectdict.h" +#endif diff --git a/src/compat/ntqobjdefs.h b/src/compat/ntqobjdefs.h new file mode 100644 index 000000000..63bf8ce18 --- /dev/null +++ b/src/compat/ntqobjdefs.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQOBJDEFS_H +#define TQOBJDEFS_H +#include "ntqobjectdefs.h" +#endif diff --git a/src/compat/ntqpaintd.h b/src/compat/ntqpaintd.h new file mode 100644 index 000000000..9fee2c004 --- /dev/null +++ b/src/compat/ntqpaintd.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPAINTD_H +#define TQPAINTD_H +#include "ntqpaintdevice.h" +#endif diff --git a/src/compat/ntqpaintdc.h b/src/compat/ntqpaintdc.h new file mode 100644 index 000000000..d598bedf7 --- /dev/null +++ b/src/compat/ntqpaintdc.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPAINTDC_H +#define TQPAINTDC_H +#include "ntqpaintdevicedefs.h" +#endif diff --git a/src/compat/ntqpdevmet.h b/src/compat/ntqpdevmet.h new file mode 100644 index 000000000..eb54dd3b7 --- /dev/null +++ b/src/compat/ntqpdevmet.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPDEVMET_H +#define TQPDEVMET_H +#include "ntqpaintdevicemetrics.h" +#endif diff --git a/src/compat/ntqpmcache.h b/src/compat/ntqpmcache.h new file mode 100644 index 000000000..cf3b4915e --- /dev/null +++ b/src/compat/ntqpmcache.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPMCACHE_H +#define TQPMCACHE_H +#include "ntqpixmapcache.h" +#endif diff --git a/src/compat/ntqpntarry.h b/src/compat/ntqpntarry.h new file mode 100644 index 000000000..4de05006f --- /dev/null +++ b/src/compat/ntqpntarry.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPNTARRY_H +#define TQPNTARRY_H +#include "ntqpointarray.h" +#endif diff --git a/src/compat/ntqpopmenu.h b/src/compat/ntqpopmenu.h new file mode 100644 index 000000000..4fb4ea582 --- /dev/null +++ b/src/compat/ntqpopmenu.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPOPMENU_H +#define TQPOPMENU_H +#include "ntqpopupmenu.h" +#endif diff --git a/src/compat/ntqprndlg.h b/src/compat/ntqprndlg.h new file mode 100644 index 000000000..7913d4491 --- /dev/null +++ b/src/compat/ntqprndlg.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPRNDLG_H +#define TQPRNDLG_H +#include "ntqprintdialog.h" +#endif diff --git a/src/compat/ntqprogbar.h b/src/compat/ntqprogbar.h new file mode 100644 index 000000000..be0f41ff6 --- /dev/null +++ b/src/compat/ntqprogbar.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPROGBAR_H +#define TQPROGBAR_H +#include "ntqprogressbar.h" +#endif diff --git a/src/compat/ntqprogdlg.h b/src/compat/ntqprogdlg.h new file mode 100644 index 000000000..00dd30038 --- /dev/null +++ b/src/compat/ntqprogdlg.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPROGDLG_H +#define TQPROGDLG_H +#include "ntqprogressdialog.h" +#endif diff --git a/src/compat/ntqpsprn.h b/src/compat/ntqpsprn.h new file mode 100644 index 000000000..f8f0f6d27 --- /dev/null +++ b/src/compat/ntqpsprn.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPSPRN_H +#define TQPSPRN_H +#include +#endif diff --git a/src/compat/ntqpushbt.h b/src/compat/ntqpushbt.h new file mode 100644 index 000000000..3c77ad073 --- /dev/null +++ b/src/compat/ntqpushbt.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQPUSHBT_H +#define TQPUSHBT_H +#include "ntqpushbutton.h" +#endif diff --git a/src/compat/ntqqueue.h b/src/compat/ntqqueue.h new file mode 100644 index 000000000..0af0f1c99 --- /dev/null +++ b/src/compat/ntqqueue.h @@ -0,0 +1,27 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQQUEUE_H +#define TQQUEUE_H +#ifndef QT_NO_COMPAT +#include "ntqptrqueue.h" +#endif +#endif diff --git a/src/compat/ntqradiobt.h b/src/compat/ntqradiobt.h new file mode 100644 index 000000000..bcb48d68f --- /dev/null +++ b/src/compat/ntqradiobt.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQRADIOBT_H +#define TQRADIOBT_H +#include "ntqradiobutton.h" +#endif diff --git a/src/compat/ntqrangect.h b/src/compat/ntqrangect.h new file mode 100644 index 000000000..87fc5c6e4 --- /dev/null +++ b/src/compat/ntqrangect.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQRANGECT_H +#define TQRANGECT_H +#include "ntqrangecontrol.h" +#endif diff --git a/src/compat/ntqscrbar.h b/src/compat/ntqscrbar.h new file mode 100644 index 000000000..ad435e83f --- /dev/null +++ b/src/compat/ntqscrbar.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQSCRBAR_H +#define TQSCRBAR_H +#include "ntqscrollbar.h" +#endif diff --git a/src/compat/ntqsocknot.h b/src/compat/ntqsocknot.h new file mode 100644 index 000000000..da6fc4825 --- /dev/null +++ b/src/compat/ntqsocknot.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQSOCKNOT_H +#define TQSOCKNOT_H +#include "ntqsocketnotifier.h" +#endif diff --git a/src/compat/ntqstack.h b/src/compat/ntqstack.h new file mode 100644 index 000000000..43d3ad9ac --- /dev/null +++ b/src/compat/ntqstack.h @@ -0,0 +1,27 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQSTACK_H +#define TQSTACK_H +#ifndef QT_NO_COMPAT +#include "ntqptrstack.h" +#endif +#endif diff --git a/src/compat/ntqtabdlg.h b/src/compat/ntqtabdlg.h new file mode 100644 index 000000000..1469373c9 --- /dev/null +++ b/src/compat/ntqtabdlg.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQTABDLG_H +#define TQTABDLG_H +#include "ntqtabdialog.h" +#endif diff --git a/src/compat/ntqtstream.h b/src/compat/ntqtstream.h new file mode 100644 index 000000000..fcdd3aa7c --- /dev/null +++ b/src/compat/ntqtstream.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQTSTREAM_H +#define TQTSTREAM_H +#include "ntqtextstream.h" +#endif diff --git a/src/compat/ntqvector.h b/src/compat/ntqvector.h new file mode 100644 index 000000000..116edaf38 --- /dev/null +++ b/src/compat/ntqvector.h @@ -0,0 +1,27 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQVECTOR_H +#define TQVECTOR_H +#ifndef QT_NO_COMPAT +#include "ntqptrvector.h" +#endif +#endif diff --git a/src/compat/ntqwidcoll.h b/src/compat/ntqwidcoll.h new file mode 100644 index 000000000..7a0a8162b --- /dev/null +++ b/src/compat/ntqwidcoll.h @@ -0,0 +1,26 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQWIDCOLL_H +#define TQWIDCOLL_H +#include "ntqwidgetlist.h" +#include "ntqwidgetintdict.h" +#endif diff --git a/src/compat/ntqwindefs.h b/src/compat/ntqwindefs.h new file mode 100644 index 000000000..a818f2a82 --- /dev/null +++ b/src/compat/ntqwindefs.h @@ -0,0 +1,25 @@ +/**************************************************************************** +** +** Compatibility file - should only be included by legacy code. +** It #includes the file which obsoletes this one. +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** This file is part of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech ASA of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** Licensees holding valid TQt Professional Edition licenses may use this +** file in accordance with the TQt Professional Edition License Agreement +** provided with the TQt Professional Edition. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about the Professional Edition licensing, or see +** http://www.trolltech.com/qpl/ for TQPL licensing information. +** +*****************************************************************************/ +#ifndef TQWINDEFS_H +#define TQWINDEFS_H +#include "ntqwindowdefs.h" +#endif diff --git a/src/compat/qapp.h b/src/compat/qapp.h deleted file mode 100644 index e71c7c87b..000000000 --- a/src/compat/qapp.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQAPP_H -#define TQAPP_H -#include "qapplication.h" -#endif diff --git a/src/compat/qarray.h b/src/compat/qarray.h deleted file mode 100644 index a0ded7f5b..000000000 --- a/src/compat/qarray.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQARRAY_H -#define TQARRAY_H -#ifndef QT_NO_COMPAT -#include "qmemarray.h" -#endif -#endif diff --git a/src/compat/qbitarry.h b/src/compat/qbitarry.h deleted file mode 100644 index 7928b2f88..000000000 --- a/src/compat/qbitarry.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQBITARRY_H -#define TQBITARRY_H -#include "qbitarray.h" -#endif diff --git a/src/compat/qbttngrp.h b/src/compat/qbttngrp.h deleted file mode 100644 index a91d1bcef..000000000 --- a/src/compat/qbttngrp.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQBTTNGRP_H -#define TQBTTNGRP_H -#include "qbuttongroup.h" -#endif diff --git a/src/compat/qchkbox.h b/src/compat/qchkbox.h deleted file mode 100644 index fd5a2d51a..000000000 --- a/src/compat/qchkbox.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQCHKBOX_H -#define TQCHKBOX_H -#include "qcheckbox.h" -#endif diff --git a/src/compat/qclipbrd.h b/src/compat/qclipbrd.h deleted file mode 100644 index d20dd332e..000000000 --- a/src/compat/qclipbrd.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQCLIPBRD_H -#define TQCLIPBRD_H -#include "qclipboard.h" -#endif diff --git a/src/compat/qcollect.h b/src/compat/qcollect.h deleted file mode 100644 index 58e00e6cb..000000000 --- a/src/compat/qcollect.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQCOLLECT_H -#define TQCOLLECT_H -#include "qptrcollection.h" -#endif diff --git a/src/compat/qcollection.h b/src/compat/qcollection.h deleted file mode 100644 index c78d60581..000000000 --- a/src/compat/qcollection.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQCOLLECTION_H -#define TQCOLLECTION_H -#ifndef QT_NO_COMPAT -#include "qptrcollection.h" -#endif -#endif diff --git a/src/compat/qcombo.h b/src/compat/qcombo.h deleted file mode 100644 index 52bccf577..000000000 --- a/src/compat/qcombo.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQCOMBO_H -#define TQCOMBO_H -#include "qcombobox.h" -#endif diff --git a/src/compat/qconnect.h b/src/compat/qconnect.h deleted file mode 100644 index c42868bef..000000000 --- a/src/compat/qconnect.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQCONNECT_H -#define TQCONNECT_H -#include "qconnection.h" -#endif diff --git a/src/compat/qdatetm.h b/src/compat/qdatetm.h deleted file mode 100644 index 611c48f28..000000000 --- a/src/compat/qdatetm.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQDATETM_H -#define TQDATETM_H -#include "qdatetime.h" -#endif diff --git a/src/compat/qdrawutl.h b/src/compat/qdrawutl.h deleted file mode 100644 index bf51159b5..000000000 --- a/src/compat/qdrawutl.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQDRAWUTL_H -#define TQDRAWUTL_H -#include "qdrawutil.h" -#endif diff --git a/src/compat/qdstream.h b/src/compat/qdstream.h deleted file mode 100644 index f92557be4..000000000 --- a/src/compat/qdstream.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQDSTREAM_H -#define TQDSTREAM_H -#include "qdatastream.h" -#endif diff --git a/src/compat/qfiledef.h b/src/compat/qfiledef.h deleted file mode 100644 index 03537ac91..000000000 --- a/src/compat/qfiledef.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQFILEDEF_H -#define TQFILEDEF_H -#include -#endif diff --git a/src/compat/qfiledlg.h b/src/compat/qfiledlg.h deleted file mode 100644 index 309ae12b5..000000000 --- a/src/compat/qfiledlg.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQFILEDLG_H -#define TQFILEDLG_H -#include "qfiledialog.h" -#endif diff --git a/src/compat/qfileinf.h b/src/compat/qfileinf.h deleted file mode 100644 index e4cba44a5..000000000 --- a/src/compat/qfileinf.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQFILEINF_H -#define TQFILEINF_H -#include "qfileinfo.h" -#endif diff --git a/src/compat/qfontinf.h b/src/compat/qfontinf.h deleted file mode 100644 index 2da955847..000000000 --- a/src/compat/qfontinf.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQFONTINF_H -#define TQFONTINF_H -#include "qfontinfo.h" -#endif diff --git a/src/compat/qfontmet.h b/src/compat/qfontmet.h deleted file mode 100644 index f2da52713..000000000 --- a/src/compat/qfontmet.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQFONTMET_H -#define TQFONTMET_H -#include "qfontmetrics.h" -#endif diff --git a/src/compat/qgrpbox.h b/src/compat/qgrpbox.h deleted file mode 100644 index 31bc81d64..000000000 --- a/src/compat/qgrpbox.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQGRPBOX_H -#define TQGRPBOX_H -#include "qgroupbox.h" -#endif diff --git a/src/compat/qintcach.h b/src/compat/qintcach.h deleted file mode 100644 index 09b3e0856..000000000 --- a/src/compat/qintcach.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQINTCACH_H -#define TQINTCACH_H -#include "qintcache.h" -#endif diff --git a/src/compat/qiodev.h b/src/compat/qiodev.h deleted file mode 100644 index 65afe35d4..000000000 --- a/src/compat/qiodev.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQIODEV_H -#define TQIODEV_H -#include "qiodevice.h" -#endif diff --git a/src/compat/qlcdnum.h b/src/compat/qlcdnum.h deleted file mode 100644 index 11b2b3d27..000000000 --- a/src/compat/qlcdnum.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQLCDNUM_H -#define TQLCDNUM_H -#include "qlcdnumber.h" -#endif diff --git a/src/compat/qlined.h b/src/compat/qlined.h deleted file mode 100644 index 460f0cbfe..000000000 --- a/src/compat/qlined.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQLINED_H -#define TQLINED_H -#include "qlineedit.h" -#endif diff --git a/src/compat/qlist.h b/src/compat/qlist.h deleted file mode 100644 index b1c3a585d..000000000 --- a/src/compat/qlist.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQLIST_H -#define TQLIST_H -#ifndef QT_NO_COMPAT -#include "qptrlist.h" -#endif -#endif diff --git a/src/compat/qmenudta.h b/src/compat/qmenudta.h deleted file mode 100644 index 7d8836817..000000000 --- a/src/compat/qmenudta.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQMENUDTA_H -#define TQMENUDTA_H -#include "qmenudata.h" -#endif diff --git a/src/compat/qmetaobj.h b/src/compat/qmetaobj.h deleted file mode 100644 index b6fa96e51..000000000 --- a/src/compat/qmetaobj.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQMETAOBJ_H -#define TQMETAOBJ_H -#include "qmetaobject.h" -#endif diff --git a/src/compat/qmlined.h b/src/compat/qmlined.h deleted file mode 100644 index 98101e581..000000000 --- a/src/compat/qmlined.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQMLINED_H -#define TQMLINED_H -#include "qmultilineedit.h" -#endif diff --git a/src/compat/qmsgbox.h b/src/compat/qmsgbox.h deleted file mode 100644 index e0c2ff04c..000000000 --- a/src/compat/qmsgbox.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQMSGBOX_H -#define TQMSGBOX_H -#include "qmessagebox.h" -#endif diff --git a/src/compat/qmultilinedit.h b/src/compat/qmultilinedit.h deleted file mode 100644 index 43274d641..000000000 --- a/src/compat/qmultilinedit.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQMULTILINEDIT_H -#define TQMULTILINEDIT_H -#include "qmultilineedit.h" -#endif diff --git a/src/compat/qobjcoll.h b/src/compat/qobjcoll.h deleted file mode 100644 index 9432ee4a0..000000000 --- a/src/compat/qobjcoll.h +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQOBJCOLL_H -#define TQOBJCOLL_H -#include "qobjectlist.h" -#include "qobjectdict.h" -#endif diff --git a/src/compat/qobjdefs.h b/src/compat/qobjdefs.h deleted file mode 100644 index f8280891b..000000000 --- a/src/compat/qobjdefs.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQOBJDEFS_H -#define TQOBJDEFS_H -#include "qobjectdefs.h" -#endif diff --git a/src/compat/qpaintd.h b/src/compat/qpaintd.h deleted file mode 100644 index aa0c46de7..000000000 --- a/src/compat/qpaintd.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPAINTD_H -#define TQPAINTD_H -#include "qpaintdevice.h" -#endif diff --git a/src/compat/qpaintdc.h b/src/compat/qpaintdc.h deleted file mode 100644 index cfb7bbd88..000000000 --- a/src/compat/qpaintdc.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPAINTDC_H -#define TQPAINTDC_H -#include "qpaintdevicedefs.h" -#endif diff --git a/src/compat/qpdevmet.h b/src/compat/qpdevmet.h deleted file mode 100644 index a2978de3e..000000000 --- a/src/compat/qpdevmet.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPDEVMET_H -#define TQPDEVMET_H -#include "qpaintdevicemetrics.h" -#endif diff --git a/src/compat/qpmcache.h b/src/compat/qpmcache.h deleted file mode 100644 index e2917720e..000000000 --- a/src/compat/qpmcache.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPMCACHE_H -#define TQPMCACHE_H -#include "qpixmapcache.h" -#endif diff --git a/src/compat/qpntarry.h b/src/compat/qpntarry.h deleted file mode 100644 index f8289def4..000000000 --- a/src/compat/qpntarry.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPNTARRY_H -#define TQPNTARRY_H -#include "qpointarray.h" -#endif diff --git a/src/compat/qpopmenu.h b/src/compat/qpopmenu.h deleted file mode 100644 index e900339a2..000000000 --- a/src/compat/qpopmenu.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPOPMENU_H -#define TQPOPMENU_H -#include "qpopupmenu.h" -#endif diff --git a/src/compat/qprndlg.h b/src/compat/qprndlg.h deleted file mode 100644 index 945a75b7c..000000000 --- a/src/compat/qprndlg.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPRNDLG_H -#define TQPRNDLG_H -#include "qprintdialog.h" -#endif diff --git a/src/compat/qprogbar.h b/src/compat/qprogbar.h deleted file mode 100644 index b4ba1ae57..000000000 --- a/src/compat/qprogbar.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPROGBAR_H -#define TQPROGBAR_H -#include "qprogressbar.h" -#endif diff --git a/src/compat/qprogdlg.h b/src/compat/qprogdlg.h deleted file mode 100644 index 2a341546d..000000000 --- a/src/compat/qprogdlg.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPROGDLG_H -#define TQPROGDLG_H -#include "qprogressdialog.h" -#endif diff --git a/src/compat/qpsprn.h b/src/compat/qpsprn.h deleted file mode 100644 index f8f0f6d27..000000000 --- a/src/compat/qpsprn.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPSPRN_H -#define TQPSPRN_H -#include -#endif diff --git a/src/compat/qpushbt.h b/src/compat/qpushbt.h deleted file mode 100644 index 337fa989d..000000000 --- a/src/compat/qpushbt.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQPUSHBT_H -#define TQPUSHBT_H -#include "qpushbutton.h" -#endif diff --git a/src/compat/qqueue.h b/src/compat/qqueue.h deleted file mode 100644 index c8356a546..000000000 --- a/src/compat/qqueue.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQQUEUE_H -#define TQQUEUE_H -#ifndef QT_NO_COMPAT -#include "qptrqueue.h" -#endif -#endif diff --git a/src/compat/qradiobt.h b/src/compat/qradiobt.h deleted file mode 100644 index bef69abe4..000000000 --- a/src/compat/qradiobt.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQRADIOBT_H -#define TQRADIOBT_H -#include "qradiobutton.h" -#endif diff --git a/src/compat/qrangect.h b/src/compat/qrangect.h deleted file mode 100644 index 7247a795f..000000000 --- a/src/compat/qrangect.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQRANGECT_H -#define TQRANGECT_H -#include "qrangecontrol.h" -#endif diff --git a/src/compat/qscrbar.h b/src/compat/qscrbar.h deleted file mode 100644 index 870b0139c..000000000 --- a/src/compat/qscrbar.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQSCRBAR_H -#define TQSCRBAR_H -#include "qscrollbar.h" -#endif diff --git a/src/compat/qsocknot.h b/src/compat/qsocknot.h deleted file mode 100644 index 55ef3a2ff..000000000 --- a/src/compat/qsocknot.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQSOCKNOT_H -#define TQSOCKNOT_H -#include "qsocketnotifier.h" -#endif diff --git a/src/compat/qstack.h b/src/compat/qstack.h deleted file mode 100644 index db69e37a4..000000000 --- a/src/compat/qstack.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQSTACK_H -#define TQSTACK_H -#ifndef QT_NO_COMPAT -#include "qptrstack.h" -#endif -#endif diff --git a/src/compat/qtabdlg.h b/src/compat/qtabdlg.h deleted file mode 100644 index 98aef91df..000000000 --- a/src/compat/qtabdlg.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQTABDLG_H -#define TQTABDLG_H -#include "qtabdialog.h" -#endif diff --git a/src/compat/qtstream.h b/src/compat/qtstream.h deleted file mode 100644 index cc0f1233a..000000000 --- a/src/compat/qtstream.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQTSTREAM_H -#define TQTSTREAM_H -#include "qtextstream.h" -#endif diff --git a/src/compat/qvector.h b/src/compat/qvector.h deleted file mode 100644 index 27d9b0901..000000000 --- a/src/compat/qvector.h +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQVECTOR_H -#define TQVECTOR_H -#ifndef QT_NO_COMPAT -#include "qptrvector.h" -#endif -#endif diff --git a/src/compat/qwidcoll.h b/src/compat/qwidcoll.h deleted file mode 100644 index 34b27d72d..000000000 --- a/src/compat/qwidcoll.h +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQWIDCOLL_H -#define TQWIDCOLL_H -#include "qwidgetlist.h" -#include "qwidgetintdict.h" -#endif diff --git a/src/compat/qwindefs.h b/src/compat/qwindefs.h deleted file mode 100644 index 62c5c4a2d..000000000 --- a/src/compat/qwindefs.h +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** -** -** Compatibility file - should only be included by legacy code. -** It #includes the file which obsoletes this one. -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** This file is part of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech ASA of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** Licensees holding valid TQt Professional Edition licenses may use this -** file in accordance with the TQt Professional Edition License Agreement -** provided with the TQt Professional Edition. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about the Professional Edition licensing, or see -** http://www.trolltech.com/qpl/ for TQPL licensing information. -** -*****************************************************************************/ -#ifndef TQWINDEFS_H -#define TQWINDEFS_H -#include "qwindowdefs.h" -#endif diff --git a/src/dialogs/ntqcolordialog.h b/src/dialogs/ntqcolordialog.h new file mode 100644 index 000000000..c3490ef53 --- /dev/null +++ b/src/dialogs/ntqcolordialog.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Definition of TQColorDialog class +** +** Created : 990222 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCOLORDIALOG_H +#define TQCOLORDIALOG_H + +#ifndef QT_H +#include "ntqdialog.h" +#endif // QT_H + +#ifndef QT_NO_COLORDIALOG + +class TQColorDialogPrivate; + +class Q_EXPORT TQColorDialog : public TQDialog +{ + Q_OBJECT + +public: + static TQColor getColor( const TQColor& init = white, TQWidget* parent=0, const char* name=0 ); + static TQRgb getRgba( TQRgb, bool* ok = 0, + TQWidget* parent=0, const char* name=0 ); + + static int customCount(); + static TQRgb customColor( int ); + static void setCustomColor( int, TQRgb ); + static void setStandardColor( int, TQRgb ); + +private: + ~TQColorDialog(); + TQColorDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE ); + + void setColor( const TQColor& ); + TQColor color() const; + + bool selectColor( const TQColor& ); + + void setSelectedAlpha( int ); + int selectedAlpha() const; + + void showCustom( bool=TRUE ); + +private: // Disabled copy constructor and operator= + TQColorDialogPrivate *d; + friend class TQColorDialogPrivate; + friend class TQColorShower; + +#if defined(Q_DISABLE_COPY) + TQColorDialog( const TQColorDialog & ); + TQColorDialog& operator=( const TQColorDialog & ); +#endif +}; + +#endif + +#endif //TQCOLORDIALOG_H diff --git a/src/dialogs/ntqdialog.h b/src/dialogs/ntqdialog.h new file mode 100644 index 000000000..bc9670af6 --- /dev/null +++ b/src/dialogs/ntqdialog.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Definition of TQDialog class +** +** Created : 950502 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDIALOG_H +#define TQDIALOG_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H +#ifndef QT_NO_DIALOG +#if 0 +Q_OBJECT +#endif + +class TQPushButton; +class TQDialogPrivate; + +class Q_EXPORT TQDialog : public TQWidget +{ +friend class TQPushButton; + Q_OBJECT + Q_PROPERTY( bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled ) + Q_PROPERTY( bool modal READ isModal WRITE setModal ) + +public: + Q_EXPLICIT TQDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, + WFlags f=0 ); + ~TQDialog(); + + enum DialogCode { Rejected, Accepted }; + + int result() const { return rescode; } + + void show(); + void hide(); + void move( int x, int y ); + void move( const TQPoint &p ); + void resize( int w, int h ); + void resize( const TQSize & ); + void setGeometry( int x, int y, int w, int h ); + void setGeometry( const TQRect & ); + + void setOrientation( Orientation orientation ); + Orientation orientation() const; + + void setExtension( TQWidget* extension ); + TQWidget* extension() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void setSizeGripEnabled( bool ); + bool isSizeGripEnabled() const; + + void setModal( bool modal ); + bool isModal() const; +#ifdef Q_OS_TEMP + bool event( TQEvent * ); +#endif + +public slots: + int exec(); + +protected slots: + virtual void done( int ); + virtual void accept(); + virtual void reject(); + + void showExtension( bool ); + +protected: + void setResult( int r ) { rescode = r; } + void keyPressEvent( TQKeyEvent * ); + void closeEvent( TQCloseEvent * ); + void resizeEvent( TQResizeEvent * ); + void contextMenuEvent( TQContextMenuEvent * ); + bool eventFilter( TQObject *, TQEvent * ); + void adjustPosition( TQWidget*); + +private: + void setDefault( TQPushButton * ); + void setMainDefault( TQPushButton * ); + void hideDefault(); +#ifdef Q_OS_TEMP + void hideSpecial(); +#endif + + int rescode; + uint did_move : 1; + uint has_relpos : 1; + uint did_resize : 1; + uint in_loop: 1; + void adjustPositionInternal( TQWidget*, bool useRelPos = FALSE ); + TQDialogPrivate* d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQDialog( const TQDialog & ); + TQDialog &operator=( const TQDialog & ); +#endif +}; + +#endif // QT_NO_DIALOG +#endif // TQDIALOG_H diff --git a/src/dialogs/ntqerrormessage.h b/src/dialogs/ntqerrormessage.h new file mode 100644 index 000000000..91634fbf7 --- /dev/null +++ b/src/dialogs/ntqerrormessage.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Definition of a nice qInstallErrorMessage() handler +** +** Created : 000527, after Kalle Dalheimer's birthday +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQERRORMESSAGE_H +#define TQERRORMESSAGE_H + +#ifndef QT_H +#include "ntqdialog.h" +#endif // QT_H + +#ifndef QT_NO_ERRORMESSAGE +class TQPushButton; +class TQCheckBox; +class TQLabel; +class TQTextView; +class TQStringList; +template class TQDict; + + +class Q_EXPORT TQErrorMessage: public TQDialog { + Q_OBJECT +public: + TQErrorMessage( TQWidget* parent, const char* name=0 ); + ~TQErrorMessage(); + + static TQErrorMessage * qtHandler(); + +public slots: + void message( const TQString & ); + +protected: + void done( int ); + +private: + TQPushButton * ok; + TQCheckBox * again; + TQTextView * errors; + TQLabel * icon; + TQStringList * pending; + TQDict * doNotShow; + + bool nextPending(); + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQErrorMessage( const TQErrorMessage & ); + TQErrorMessage &operator=( const TQErrorMessage & ); +#endif +}; + +#endif //QT_NO_ERRORMESSAGE + +#endif diff --git a/src/dialogs/ntqfiledialog.h b/src/dialogs/ntqfiledialog.h new file mode 100644 index 000000000..cc811b636 --- /dev/null +++ b/src/dialogs/ntqfiledialog.h @@ -0,0 +1,347 @@ +/**************************************************************************** +** +** Definition of TQFileDialog class +** +** Created : 950428 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFILEDIALOG_H +#define TQFILEDIALOG_H + +class TQPushButton; +class TQButton; +class TQLabel; +class TQWidget; +class TQFileDialog; +class TQTimer; +class TQNetworkOperation; +class TQLineEdit; +class TQListViewItem; +class TQListBoxItem; +class TQFileDialogPrivate; +class TQFileDialogTQFileListView; + +#ifndef QT_H +#include "ntqdir.h" +#include "ntqdialog.h" +#include "ntqurloperator.h" +#include "ntqurlinfo.h" +#endif // QT_H + +#if __GNUC__ - 0 > 3 +#pragma GCC system_header +#endif + +#ifndef QT_NO_FILEDIALOG + +class Q_EXPORT TQFileIconProvider : public TQObject +{ + Q_OBJECT +public: + TQFileIconProvider( TQObject * parent = 0, const char* name = 0 ); + virtual const TQPixmap * pixmap( const TQFileInfo & ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQFileIconProvider( const TQFileIconProvider & ); + TQFileIconProvider& operator=( const TQFileIconProvider & ); +#endif +}; + +class Q_EXPORT TQFilePreview +{ +public: + TQFilePreview(); + virtual void previewUrl( const TQUrl &url ) = 0; + +}; + +class Q_EXPORT TQFileDialog : public TQDialog +{ + Q_OBJECT + Q_ENUMS( Mode ViewMode PreviewMode ) + // ##### Why are this read-only properties ? + Q_PROPERTY( TQString selectedFile READ selectedFile ) + Q_PROPERTY( TQString selectedFilter READ selectedFilter ) + Q_PROPERTY( TQStringList selectedFiles READ selectedFiles ) + // #### Should not we be able to set the path ? + Q_PROPERTY( TQString dirPath READ dirPath ) + Q_PROPERTY( bool showHiddenFiles READ showHiddenFiles WRITE setShowHiddenFiles ) + Q_PROPERTY( Mode mode READ mode WRITE setMode ) + Q_PROPERTY( ViewMode viewMode READ viewMode WRITE setViewMode ) + Q_PROPERTY( PreviewMode previewMode READ previewMode WRITE setPreviewMode ) + Q_PROPERTY( bool infoPreview READ isInfoPreviewEnabled WRITE setInfoPreviewEnabled ) + Q_PROPERTY( bool contentsPreview READ isContentsPreviewEnabled WRITE setContentsPreviewEnabled ) + +public: + TQFileDialog( const TQString& dirName, const TQString& filter = TQString::null, + TQWidget* parent=0, const char* name=0, bool modal = FALSE ); + TQFileDialog( TQWidget* parent=0, const char* name=0, bool modal = FALSE ); + ~TQFileDialog(); + + // recommended static functions + + static TQString getOpenFileName( const TQString &initially = TQString::null, + const TQString &filter = TQString::null, + TQWidget *parent = 0, const char* name = 0, + const TQString &caption = TQString::null, + TQString *selectedFilter = 0, + bool resolveSymlinks = TRUE); + static TQString getSaveFileName( const TQString &initially = TQString::null, + const TQString &filter = TQString::null, + TQWidget *parent = 0, const char* name = 0, + const TQString &caption = TQString::null, + TQString *selectedFilter = 0, + bool resolveSymlinks = TRUE); + static TQString getExistingDirectory( const TQString &dir = TQString::null, + TQWidget *parent = 0, + const char* name = 0, + const TQString &caption = TQString::null, + bool dirOnly = TRUE, + bool resolveSymlinks = TRUE); + static TQStringList getOpenFileNames( const TQString &filter= TQString::null, + const TQString &dir = TQString::null, + TQWidget *parent = 0, + const char* name = 0, + const TQString &caption = TQString::null, + TQString *selectedFilter = 0, + bool resolveSymlinks = TRUE); + + // other static functions + + static void setIconProvider( TQFileIconProvider * ); + static TQFileIconProvider * iconProvider(); + + // non-static function for special needs + + TQString selectedFile() const; + TQString selectedFilter() const; + virtual void setSelectedFilter( const TQString& ); + virtual void setSelectedFilter( int ); + + void setSelection( const TQString &); + + void selectAll( bool b ); + + TQStringList selectedFiles() const; + + TQString dirPath() const; + + void setDir( const TQDir & ); + const TQDir *dir() const; + + void setShowHiddenFiles( bool s ); + bool showHiddenFiles() const; + + void rereadDir(); + 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 m ); + ViewMode viewMode() const; + void setPreviewMode( PreviewMode m ); + PreviewMode previewMode() const; + + bool eventFilter( TQObject *, TQEvent * ); + + bool isInfoPreviewEnabled() const; + bool isContentsPreviewEnabled() const; + void setInfoPreviewEnabled( bool ); + void setContentsPreviewEnabled( bool ); + + void setInfoPreview( TQWidget *w, TQFilePreview *preview ); + void setContentsPreview( TQWidget *w, TQFilePreview *preview ); + + TQUrl url() const; + + void addFilter( const TQString &filter ); + +public slots: + void done( int ); + void setDir( const TQString& ); + void setUrl( const TQUrlOperator &url ); + void setFilter( const TQString& ); + void setFilters( const TQString& ); + void setFilters( const char ** ); + void setFilters( const TQStringList& ); + +protected: + void resizeEvent( TQResizeEvent * ); + void keyPressEvent( TQKeyEvent * ); + + void addWidgets( TQLabel *, TQWidget *, TQPushButton * ); + void addToolButton( TQButton *b, bool separator = FALSE ); + void addLeftWidget( TQWidget *w ); + void addRightWidget( TQWidget *w ); + +signals: + void fileHighlighted( const TQString& ); + void fileSelected( const TQString& ); + void filesSelected( const TQStringList& ); + void dirEntered( const TQString& ); + void filterSelected( const TQString& ); + +private slots: + void detailViewSelectionChanged(); + void listBoxSelectionChanged(); + void changeMode( int ); + void fileNameEditReturnPressed(); + void stopCopy(); + void removeProgressDia(); + + void fileSelected( int ); + void fileHighlighted( int ); + void dirSelected( int ); + void pathSelected( int ); + + void updateFileNameEdit( TQListViewItem *); + void selectDirectoryOrFile( TQListViewItem * ); + void popupContextMenu( TQListViewItem *, const TQPoint &, int ); + void popupContextMenu( TQListBoxItem *, const TQPoint & ); + void updateFileNameEdit( TQListBoxItem *); + void selectDirectoryOrFile( TQListBoxItem * ); + void fileNameEditDone(); + + void okClicked(); + void filterClicked(); // not used + void cancelClicked(); + + void cdUpClicked(); + void newFolderClicked(); + + void fixupNameEdit(); + + void doMimeTypeLookup(); + + void updateGeometries(); + void modeButtonsDestroyed(); + void urlStart( TQNetworkOperation *op ); + void urlFinished( TQNetworkOperation *op ); + void dataTransferProgress( int bytesDone, int bytesTotal, TQNetworkOperation * ); + void insertEntry( const TQValueList &fi, TQNetworkOperation *op ); + void removeEntry( TQNetworkOperation * ); + void createdDirectory( const TQUrlInfo &info, TQNetworkOperation * ); + void itemChanged( TQNetworkOperation * ); + void goBack(); + +private: + enum PopupAction { + PA_Open = 0, + PA_Delete, + PA_Rename, + PA_SortName, + PA_SortSize, + PA_SortType, + PA_SortDate, + PA_SortUnsorted, + PA_Cancel, + PA_Reload, + PA_Hidden + }; + + void init(); + bool trySetSelection( bool isDir, const TQUrlOperator &, bool ); + void deleteFile( const TQString &filename ); + void popupContextMenu( const TQString &filename, bool withSort, + PopupAction &action, const TQPoint &p ); + void updatePreviews( const TQUrl &u ); + + TQDir reserved; // was cwd + TQString fileName; + + friend class TQFileDialogTQFileListView; + friend class TQFileListBox; + + TQFileDialogPrivate *d; + TQFileDialogTQFileListView *files; + + TQLineEdit *nameEdit; // also filter + TQPushButton *okB; + TQPushButton *cancelB; + +#if defined(Q_WS_WIN) + static TQString winGetOpenFileName( const TQString &initialSelection, + const TQString &filter, + TQString* workingDirectory, + TQWidget *parent = 0, + const char* name = 0, + const TQString& caption = TQString::null, + TQString* selectedFilter = 0 ); + static TQString winGetSaveFileName( const TQString &initialSelection, + const TQString &filter, + TQString* workingDirectory, + TQWidget *parent = 0, + const char* name = 0, + const TQString& caption = TQString::null, + TQString* selectedFilter = 0 ); + static TQStringList winGetOpenFileNames( const TQString &filter, + TQString* workingDirectory, + TQWidget *parent = 0, + const char* name = 0, + const TQString& caption = TQString::null, + TQString* selectedFilter = 0 ); + static TQString winGetExistingDirectory( const TQString &initialDirectory, + TQWidget* parent = 0, + const char* name = 0, + const TQString& caption = TQString::null); + static TQString resolveLinkFile( const TQString& linkfile ); +#endif +#if defined(Q_WS_MACX) || defined(Q_WS_MAC9) + static TQString macGetSaveFileName( const TQString &, const TQString &, + TQString *, TQWidget *, const char*, + const TQString&, TQString *); + static TQStringList macGetOpenFileNames( const TQString &, TQString*, + TQWidget *, const char *, + const TQString&, TQString *, + bool = TRUE, bool = FALSE ); +#endif + + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQFileDialog( const TQFileDialog & ); + TQFileDialog &operator=( const TQFileDialog & ); +#endif +}; + +#endif + +#endif // TQFILEDIALOG_H diff --git a/src/dialogs/ntqfontdialog.h b/src/dialogs/ntqfontdialog.h new file mode 100644 index 000000000..bcb5e06dc --- /dev/null +++ b/src/dialogs/ntqfontdialog.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Definition of TQFontDialog +** +** Created : 970605 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFONTDIALOG_H +#define TQFONTDIALOG_H + +#include "ntqwindowdefs.h" + +#ifndef QT_NO_FONTDIALOG + +// +// W A R N I N G +// ------------- +// +// This class is under development and has private constructors. +// +// You may use the public static getFont() functions which are guaranteed +// to be available in the future. +// + +#ifndef QT_H +#include "ntqdialog.h" +#include "ntqfont.h" +#endif // QT_H + +class TQFontDialogPrivate; + +class Q_EXPORT TQFontDialog: public TQDialog +{ + Q_OBJECT + +public: + static TQFont getFont( bool *ok, const TQFont &def, + TQWidget* parent=0, const char* name=0); + static TQFont getFont( bool *ok, TQWidget* parent=0, const char* name=0); + +private: + static TQFont getFont( bool *ok, const TQFont *def, + TQWidget* parent=0, const char* name=0); + + TQFontDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, + WFlags f=0 ); + ~TQFontDialog(); + + TQFont font() const; + void setFont( const TQFont &font ); + + bool eventFilter( TQObject *, TQEvent * ); + + void updateFamilies(); + void updateStyles(); + void updateSizes(); + +private slots: + void sizeChanged( const TQString &); + void familyHighlighted( int ); + void scriptHighlighted( int ); + void styleHighlighted( int ); + void sizeHighlighted( const TQString & ); + void updateSample(); + +private: + friend class TQFontDialogPrivate; + TQFontDialogPrivate * d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQFontDialog( const TQFontDialog & ); + TQFontDialog& operator=( const TQFontDialog & ); +#endif +}; + +#endif + +#endif // TQFONTDIALOG_H diff --git a/src/dialogs/ntqinputdialog.h b/src/dialogs/ntqinputdialog.h new file mode 100644 index 000000000..7b21503bb --- /dev/null +++ b/src/dialogs/ntqinputdialog.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Definition of TQInputDialog class +** +** Created : 991212 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQINPUTDIALOG_H +#define TQINPUTDIALOG_H + +#ifndef QT_H +#include "ntqdialog.h" +#include "ntqstring.h" +#include "ntqlineedit.h" +#endif // QT_H + +#ifndef QT_NO_INPUTDIALOG + +class TQSpinBox; +class TQComboBox; +class TQInputDialogPrivate; + +class Q_EXPORT TQInputDialog : public TQDialog +{ + Q_OBJECT + +private: + enum Type { LineEdit, SpinBox, ComboBox, EditableComboBox }; + + TQInputDialog( const TQString &label, TQWidget* parent=0, const char* name=0, + bool modal = TRUE, Type type = LineEdit ); //### 4.0: widget flag! + ~TQInputDialog(); + + TQLineEdit *lineEdit() const; + TQSpinBox *spinBox() const; + TQComboBox *comboBox() const; + TQComboBox *editableComboBox() const; + + void setType( Type t ); + Type type() const; + +public: + //### 4.0: widget flag! + static TQString getText( const TQString &caption, const TQString &label, TQLineEdit::EchoMode echo = TQLineEdit::Normal, + const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0 ); + static int getInteger( const TQString &caption, const TQString &label, int value = 0, int minValue = -2147483647, + int maxValue = 2147483647, + int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0 ); + static double getDouble( const TQString &caption, const TQString &label, double value = 0, + double minValue = -2147483647, double maxValue = 2147483647, + int decimals = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0 ); + 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 ); + +private slots: + void textChanged( const TQString &s ); + void tryAccept(); + +private: + TQInputDialogPrivate *d; + friend class TQInputDialogPrivate; /* to avoid 'has no friends' warnings... */ + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQInputDialog( const TQInputDialog & ); + TQInputDialog &operator=( const TQInputDialog & ); +#endif +}; + +#endif // QT_NO_INPUTDIALOG + +#endif // TQINPUTDIALOG_H + diff --git a/src/dialogs/ntqmessagebox.h b/src/dialogs/ntqmessagebox.h new file mode 100644 index 000000000..5ab38f78c --- /dev/null +++ b/src/dialogs/ntqmessagebox.h @@ -0,0 +1,223 @@ +/**************************************************************************** +** +** Definition of TQMessageBox class +** +** Created : 950503 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMESSAGEBOX_H +#define TQMESSAGEBOX_H + +#ifndef QT_H +#include "ntqdialog.h" +#endif // QT_H + +#ifndef QT_NO_MESSAGEBOX + +class TQLabel; +class TQPushButton; +struct TQMessageBoxData; + +class Q_EXPORT TQMessageBox : public TQDialog +{ + Q_OBJECT + Q_ENUMS( Icon ) + Q_PROPERTY( TQString text READ text WRITE setText ) + Q_PROPERTY( Icon icon READ icon WRITE setIcon ) + Q_PROPERTY( TQPixmap iconPixmap READ iconPixmap WRITE setIconPixmap ) + Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) + +public: + enum Icon { NoIcon = 0, Information = 1, Warning = 2, Critical = 3, + Question = 4 }; + + TQMessageBox( TQWidget* parent=0, const char* name=0 ); + TQMessageBox( const TQString& caption, const TQString &text, Icon icon, + int button0, int button1, int button2, + TQWidget* parent=0, const char* name=0, bool modal=TRUE, + WFlags f=WStyle_DialogBorder ); + ~TQMessageBox(); + + enum { NoButton = 0, Ok = 1, Cancel = 2, Yes = 3, No = 4, Abort = 5, + Retry = 6, Ignore = 7, YesAll = 8, NoAll = 9, ButtonMask = 0xff, + Default = 0x100, Escape = 0x200, FlagMask = 0x300 }; + + static int information( TQWidget *parent, const TQString &caption, + const TQString& text, + int button0, int button1=0, int button2=0 ); + static int information( TQWidget *parent, const TQString &caption, + const TQString& text, + const TQString& button0Text = TQString::null, + const TQString& button1Text = TQString::null, + const TQString& button2Text = TQString::null, + int defaultButtonNumber = 0, + int escapeButtonNumber = -1 ); + + static int question( TQWidget *parent, const TQString &caption, + const TQString& text, + int button0, int button1=0, int button2=0 ); + static int question( TQWidget *parent, const TQString &caption, + const TQString& text, + const TQString& button0Text = TQString::null, + const TQString& button1Text = TQString::null, + const TQString& button2Text = TQString::null, + int defaultButtonNumber = 0, + int escapeButtonNumber = -1 ); + + static int warning( TQWidget *parent, const TQString &caption, + const TQString& text, + int button0, int button1, int button2=0 ); + static int warning( TQWidget *parent, const TQString &caption, + const TQString& text, + const TQString& button0Text = TQString::null, + const TQString& button1Text = TQString::null, + const TQString& button2Text = TQString::null, + int defaultButtonNumber = 0, + int escapeButtonNumber = -1 ); + + static int critical( TQWidget *parent, const TQString &caption, + const TQString& text, + int button0, int button1, int button2=0 ); + static int critical( TQWidget *parent, const TQString &caption, + const TQString& text, + const TQString& button0Text = TQString::null, + const TQString& button1Text = TQString::null, + const TQString& button2Text = TQString::null, + int defaultButtonNumber = 0, + int escapeButtonNumber = -1 ); + + static void about( TQWidget *parent, const TQString &caption, + const TQString& text ); + + static void aboutTQt( TQWidget *parent, + const TQString& caption=TQString::null ); + +/* OBSOLETE */ + static int message( const TQString &caption, + const TQString& text, + const TQString& buttonText=TQString::null, + TQWidget *parent=0, const char * =0 ) { + return TQMessageBox::information( parent, caption, text, + buttonText.isEmpty() + ? tr("OK") : buttonText ) == 0; + } + +/* OBSOLETE */ + static bool query( const TQString &caption, + const TQString& text, + const TQString& yesButtonText=TQString::null, + const TQString& noButtonText=TQString::null, + TQWidget *parent=0, const char * = 0 ) { + return TQMessageBox::information( parent, caption, text, + yesButtonText.isEmpty() + ? tr("OK") : yesButtonText, + noButtonText ) == 0; + } + + 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 button ) const; + void setButtonText( int button, const TQString &); + + void adjustSize(); + +/* OBSOLETE */ + static TQPixmap standardIcon( Icon icon, GUIStyle ); + + static TQPixmap standardIcon( Icon icon ); + + TextFormat textFormat() const; + void setTextFormat( TextFormat ); + +protected: + void resizeEvent( TQResizeEvent * ); + void showEvent( TQShowEvent * ); + void closeEvent( TQCloseEvent * ); + void keyPressEvent( TQKeyEvent * ); + void styleChanged( TQStyle& ); + +private slots: + void buttonClicked(); + +private: + void init( int, int, int ); + int indexOf( int ) const; + void resizeButtons(); + TQLabel *label; + TQMessageBoxData *mbd; + void *reserved1; + void *reserved2; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMessageBox( const TQMessageBox & ); + TQMessageBox &operator=( const TQMessageBox & ); +#endif +}; + +/* +* Macro to be used at the beginning of main(), e.g. +* +* #include +* #include +* int main( int argc, char**argv ) +* { +* QT_REQUIRE_VERSION( argc, argv, "3.0.5" ) +* ... +* } +*/ +#define QT_REQUIRE_VERSION( argc, argv, str ) { TQString s=TQString::fromLatin1(str);\ +TQString sq=TQString::fromLatin1(qVersion()); if ( (sq.section('.',0,0).toInt()<<16)+\ +(sq.section('.',1,1).toInt()<<8)+sq.section('.',2,2).toInt()<(s.section('.',0,0).toInt()<<16)+\ +(s.section('.',1,1).toInt()<<8)+s.section('.',2,2).toInt() ){if ( !qApp){ int c=0; new \ +TQApplication(argc,argv);} TQString s = TQApplication::tr("Executable '%1' requires TQt "\ + "%2, found TQt %3.").arg(TQString::fromLatin1(qAppName())).arg(TQString::fromLatin1(\ +str)).arg(TQString::fromLatin1(qVersion()) ); TQMessageBox::critical( 0, TQApplication::tr(\ +"Incompatible TQt Library Error" ), s, TQMessageBox::Abort,0 ); qFatal(s.ascii()); }} + + +#endif // QT_NO_MESSAGEBOX + +#endif // TQMESSAGEBOX_H diff --git a/src/dialogs/ntqprintdialog.h b/src/dialogs/ntqprintdialog.h new file mode 100644 index 000000000..ea46c6fed --- /dev/null +++ b/src/dialogs/ntqprintdialog.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Definition of print dialog. +** +** Created : 950829 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPRINTDIALOG_H +#define TQPRINTDIALOG_H + +#ifndef QT_H +#include "ntqdialog.h" +#endif // QT_H + +#ifndef QT_NO_PRINTDIALOG + +class TQGroupBox; +class TQPrintDialogPrivate; +class TQListView; + +class Q_EXPORT TQPrintDialog : public TQDialog +{ + Q_OBJECT +public: + TQPrintDialog( TQPrinter *, TQWidget* parent=0, const char* name=0 ); + ~TQPrintDialog(); + + static bool getPrinterSetup( TQPrinter *, TQWidget* = 0 ); + static void setGlobalPrintDialog( TQPrintDialog * ); + + void setPrinter( TQPrinter *, bool = FALSE ); + TQPrinter * printer() const; + + void addButton( TQPushButton *but ); + +private slots: + void browseClicked(); + void okClicked(); + + void printerOrFileSelected( int ); + void landscapeSelected( int ); + void paperSizeSelected( int ); + void orientSelected( int ); + void pageOrderSelected( int ); + void colorModeSelected( int ); + void setNumCopies( int ); + void printRangeSelected( int ); + void setFirstPage( int ); + void setLastPage( int ); + + void fileNameEditChanged( const TQString &text ); + +private: + TQPrintDialogPrivate *d; + + TQGroupBox * setupDestination(); + TQGroupBox * setupOptions(); + TQGroupBox * setupPaper(); + TQGroupBox * setupPrinterSettings(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPrintDialog( const TQPrintDialog & ); + TQPrintDialog &operator=( const TQPrintDialog & ); +#endif +}; + +#endif + +#endif // TQPRINTDIALOG_H diff --git a/src/dialogs/ntqprogressdialog.h b/src/dialogs/ntqprogressdialog.h new file mode 100644 index 000000000..e480f2862 --- /dev/null +++ b/src/dialogs/ntqprogressdialog.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Definition of TQProgressDialog class +** +** Created : 970520 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPROGRESSDIALOG_H +#define TQPROGRESSDIALOG_H + +#ifndef QT_H +#include "ntqsemimodal.h" +#include "ntqlabel.h" // ### remove or keep for users' convenience? +#include "ntqprogressbar.h" // ### remove or keep for users' convenience? +#endif // QT_H + +#ifndef QT_NO_PROGRESSDIALOG + +class TQPushButton; +class TQTimer; +class TQProgressDialogData; + +class Q_EXPORT TQProgressDialog : public TQDialog +{ + Q_OBJECT + Q_PROPERTY( bool wasCancelled READ wasCancelled DESIGNABLE false STORED false ) // ### remove in 4.0 + Q_PROPERTY( bool wasCanceled READ wasCanceled ) + Q_PROPERTY( int totalSteps READ totalSteps WRITE setTotalSteps ) + Q_PROPERTY( int progress READ progress WRITE setProgress ) + Q_PROPERTY( bool autoReset READ autoReset WRITE setAutoReset ) + Q_PROPERTY( bool autoClose READ autoClose WRITE setAutoClose ) + Q_PROPERTY( int minimumDuration READ minimumDuration WRITE setMinimumDuration ) + Q_PROPERTY( TQString labelText READ labelText WRITE setLabelText ) + +public: + TQProgressDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, + WFlags f=0 ); + TQProgressDialog( const TQString& labelText, const TQString &cancelButtonText, + int totalSteps, TQWidget* parent=0, const char* name=0, + bool modal=FALSE, WFlags f=0 ); + ~TQProgressDialog(); + + void setLabel( TQLabel * ); + void setCancelButton( TQPushButton * ); + void setBar( TQProgressBar * ); + + // ### TQt 4.0: remove wasCancelled() in 4.0 + bool wasCancelled() const; + inline bool wasCanceled() const { return wasCancelled(); } + + int totalSteps() const; + int progress() const; + + TQSize sizeHint() const; + + TQString labelText() const; + + void setAutoReset( bool b ); + bool autoReset() const; + void setAutoClose( bool b ); + bool autoClose() const; + +public slots: + void cancel(); + void reset(); + void setTotalSteps( int totalSteps ); + void setProgress( int progress ); + void setProgress( int progress, int totalSteps ); + void setLabelText( const TQString &); + void setCancelButtonText( const TQString &); + + void setMinimumDuration( int ms ); +public: + int minimumDuration() const; + +signals: + // ### remove cancelled() in 4.0 + void cancelled(); + void canceled(); + +protected: + void resizeEvent( TQResizeEvent * ); + void closeEvent( TQCloseEvent * ); + void styleChange( TQStyle& ); + void showEvent( TQShowEvent *e ); + +protected slots: + void forceShow(); + +private: + void init( TQWidget *creator, const TQString& lbl, const TQString &canc, + int totstps); + void layout(); + TQLabel *label() const; + TQProgressBar *bar() const; + TQProgressDialogData *d; + TQTimer *forceTimer; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQProgressDialog( const TQProgressDialog & ); + TQProgressDialog &operator=( const TQProgressDialog & ); +#endif +}; + +#endif // QT_NO_PROGRESSDIALOG + +#endif // TQPROGRESSDIALOG_H diff --git a/src/dialogs/ntqsemimodal.h b/src/dialogs/ntqsemimodal.h new file mode 100644 index 000000000..ff015b7f6 --- /dev/null +++ b/src/dialogs/ntqsemimodal.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Definition of TQSemiModal class for source compatibility +** +** Created : 001010 +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSEMIMODAL_H +#define TQSEMIMODAL_H + +#ifndef QT_H +#include "ntqdialog.h" +#endif // QT_H + +#ifndef QT_NO_COMPAT +#ifndef QT_NO_SEMIMODAL +class Q_EXPORT TQSemiModal : public TQDialog +{ + Q_OBJECT +public: + TQSemiModal( TQWidget* parent=0, const char* name=0, bool modal=FALSE, WFlags f=0 ) + : TQDialog( parent, name, modal, f ) { } + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSemiModal( const TQSemiModal & ); + TQSemiModal &operator=( const TQSemiModal & ); +#endif +}; +#endif +#endif + +#endif // TQSEMIMODAL_H diff --git a/src/dialogs/ntqtabdialog.h b/src/dialogs/ntqtabdialog.h new file mode 100644 index 000000000..216225289 --- /dev/null +++ b/src/dialogs/ntqtabdialog.h @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Definition of TQTabDialog class +** +** Created : 960825 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTABDIALOG_H +#define TQTABDIALOG_H + +#ifndef QT_H +#include "ntqdialog.h" +#include "ntqiconset.h" +#endif // QT_H + +#ifndef QT_NO_TABDIALOG + +class TQTabBar; +class TQTab; +class TQTabDialogPrivate; + +class Q_EXPORT TQTabDialog : public TQDialog +{ + Q_OBJECT +public: + TQTabDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, + WFlags f=0 ); + ~TQTabDialog(); + + void show(); + void setFont( const TQFont & font ); + + void addTab( TQWidget *, const TQString &); + void addTab( TQWidget *child, const TQIconSet& iconset, const TQString &label); + void addTab( TQWidget *, TQTab* ); + + void insertTab( TQWidget *, const TQString &, int index = -1); + void insertTab( TQWidget *child, const TQIconSet& iconset, const TQString &label, int index = -1); + void insertTab( TQWidget *, TQTab*, int index = -1 ); + + void changeTab( TQWidget *, const TQString &); + void changeTab( TQWidget *child, const TQIconSet& iconset, const TQString &label); + + bool isTabEnabled( TQWidget * ) const; + void setTabEnabled( TQWidget *, bool ); + bool isTabEnabled( const char* ) const; // compatibility + void setTabEnabled( const char*, bool ); // compatibility + + void showPage( TQWidget * ); + void removePage( TQWidget * ); + TQString tabLabel( TQWidget * ); + + TQWidget * currentPage() const; + + void setDefaultButton( const TQString &text ); + void setDefaultButton(); + bool hasDefaultButton() const; + + void setHelpButton( const TQString &text ); + void setHelpButton(); + bool hasHelpButton() const; + + void setCancelButton( const TQString &text ); + void setCancelButton(); + bool hasCancelButton() const; + + void setApplyButton( const TQString &text ); + void setApplyButton(); + bool hasApplyButton() const; + +#ifndef Q_QDOC + void setOKButton( const TQString &text = TQString::null ); +#endif + void setOkButton( const TQString &text ); + 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 * ); + void selected( const TQString& ); // obsolete + +private slots: + void showTab( int i ); + +private: + void setSizes(); + void setUpLayout(); + + TQTabDialogPrivate *d; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTabDialog( const TQTabDialog & ); + TQTabDialog& operator=( const TQTabDialog & ); +#endif +}; + +#endif // QT_NO_TABDIALOG + +#endif // TQTABDIALOG_H diff --git a/src/dialogs/ntqwizard.h b/src/dialogs/ntqwizard.h new file mode 100644 index 000000000..b366f29ca --- /dev/null +++ b/src/dialogs/ntqwizard.h @@ -0,0 +1,142 @@ +/**************************************************************************** +** +** Definition of the TQWizard class. +** +** Created : 990101 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the dialogs module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWIZARDDIALOG_H +#define TQWIZARDDIALOG_H + + +#ifndef QT_H +#include "ntqdialog.h" +#endif // QT_H + +#ifndef QT_NO_WIZARD + +class TQHBoxLayout; +class TQWizardPrivate; + +class Q_EXPORT TQWizard : public TQDialog +{ + Q_OBJECT + Q_PROPERTY( TQFont titleFont READ titleFont WRITE setTitleFont ) + +public: + TQWizard( TQWidget* parent=0, const char* name=0, bool modal=FALSE, + WFlags f=0 ); + ~TQWizard(); + + void show(); + + void setFont( const TQFont & font ); + + virtual void addPage( TQWidget *, const TQString & ); + virtual void insertPage( TQWidget*, 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 ); + + // obsolete + virtual void setFinish( 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: + void setBackEnabled( bool ); + void setNextEnabled( bool ); + + void setHelpEnabled( bool ); + + void setNextPage( TQWidget * ); + + void updateButtons(); + + void layOut(); + + TQWizardPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQWizard( const TQWizard & ); + TQWizard& operator=( const TQWizard & ); +#endif +}; + +#endif // QT_NO_WIZARD + +#endif // TQWIZARD_H diff --git a/src/dialogs/qcolordialog.cpp b/src/dialogs/qcolordialog.cpp index 0a3be03fb..e275f02b9 100644 --- a/src/dialogs/qcolordialog.cpp +++ b/src/dialogs/qcolordialog.cpp @@ -38,25 +38,25 @@ ** **********************************************************************/ -#include "qcolordialog.h" +#include "ntqcolordialog.h" #ifndef QT_NO_COLORDIALOG -#include "qpainter.h" -#include "qlayout.h" -#include "qlabel.h" -#include "qpushbutton.h" -#include "qlineedit.h" -#include "qimage.h" -#include "qpixmap.h" -#include "qdrawutil.h" -#include "qvalidator.h" -#include "qdragobject.h" -#include "qgridview.h" -#include "qapplication.h" -#include "qstyle.h" -#include "qsettings.h" -#include "qpopupmenu.h" +#include "ntqpainter.h" +#include "ntqlayout.h" +#include "ntqlabel.h" +#include "ntqpushbutton.h" +#include "ntqlineedit.h" +#include "ntqimage.h" +#include "ntqpixmap.h" +#include "ntqdrawutil.h" +#include "ntqvalidator.h" +#include "ntqdragobject.h" +#include "ntqgridview.h" +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqsettings.h" +#include "ntqpopupmenu.h" #ifdef Q_WS_MAC TQRgb macGetRgba( TQRgb initial, bool *ok, TQWidget *parent, const char* name ); @@ -1416,7 +1416,7 @@ void TQColorDialogPrivate::addCustom() /*! - \class TQColorDialog qcolordialog.h + \class TQColorDialog ntqcolordialog.h \brief The TQColorDialog class provides a dialog widget for specifying colors. \mainclass \ingroup dialogs diff --git a/src/dialogs/qcolordialog.h b/src/dialogs/qcolordialog.h deleted file mode 100644 index 28c8ee1c0..000000000 --- a/src/dialogs/qcolordialog.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Definition of TQColorDialog class -** -** Created : 990222 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCOLORDIALOG_H -#define TQCOLORDIALOG_H - -#ifndef QT_H -#include "qdialog.h" -#endif // QT_H - -#ifndef QT_NO_COLORDIALOG - -class TQColorDialogPrivate; - -class Q_EXPORT TQColorDialog : public TQDialog -{ - Q_OBJECT - -public: - static TQColor getColor( const TQColor& init = white, TQWidget* parent=0, const char* name=0 ); - static TQRgb getRgba( TQRgb, bool* ok = 0, - TQWidget* parent=0, const char* name=0 ); - - static int customCount(); - static TQRgb customColor( int ); - static void setCustomColor( int, TQRgb ); - static void setStandardColor( int, TQRgb ); - -private: - ~TQColorDialog(); - TQColorDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE ); - - void setColor( const TQColor& ); - TQColor color() const; - - bool selectColor( const TQColor& ); - - void setSelectedAlpha( int ); - int selectedAlpha() const; - - void showCustom( bool=TRUE ); - -private: // Disabled copy constructor and operator= - TQColorDialogPrivate *d; - friend class TQColorDialogPrivate; - friend class TQColorShower; - -#if defined(Q_DISABLE_COPY) - TQColorDialog( const TQColorDialog & ); - TQColorDialog& operator=( const TQColorDialog & ); -#endif -}; - -#endif - -#endif //TQCOLORDIALOG_H diff --git a/src/dialogs/qdialog.cpp b/src/dialogs/qdialog.cpp index 4f99ae9e6..1ef49e0c0 100644 --- a/src/dialogs/qdialog.cpp +++ b/src/dialogs/qdialog.cpp @@ -38,22 +38,22 @@ ** **********************************************************************/ -#include "qdialog.h" +#include "ntqdialog.h" #ifndef QT_NO_DIALOG -#include "qpushbutton.h" -#include "qfocusdata.h" -#include "qapplication.h" -#include "qobjectlist.h" -#include "qwidgetlist.h" -#include "qlayout.h" -#include "qsizegrip.h" -#include "qwhatsthis.h" -#include "qpopupmenu.h" -#include "qcursor.h" +#include "ntqpushbutton.h" +#include "ntqfocusdata.h" +#include "ntqapplication.h" +#include "ntqobjectlist.h" +#include "ntqwidgetlist.h" +#include "ntqlayout.h" +#include "ntqsizegrip.h" +#include "ntqwhatsthis.h" +#include "ntqpopupmenu.h" +#include "ntqcursor.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #if defined( Q_OS_TEMP ) #include "qt_windows.h" @@ -344,7 +344,7 @@ void TQDialog::hideDefault() Hides special buttons which are rather shown in the titlebar on WinCE, to conserve screen space. */ -# include "qmessagebox.h" +# include "ntqmessagebox.h" extern const char * mb_texts[]; // Defined in qmessagebox.cpp void TQDialog::hideSpecial() { diff --git a/src/dialogs/qdialog.h b/src/dialogs/qdialog.h deleted file mode 100644 index 068b4d360..000000000 --- a/src/dialogs/qdialog.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDialog class -** -** Created : 950502 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDIALOG_H -#define TQDIALOG_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H -#ifndef QT_NO_DIALOG -#if 0 -Q_OBJECT -#endif - -class TQPushButton; -class TQDialogPrivate; - -class Q_EXPORT TQDialog : public TQWidget -{ -friend class TQPushButton; - Q_OBJECT - Q_PROPERTY( bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled ) - Q_PROPERTY( bool modal READ isModal WRITE setModal ) - -public: - Q_EXPLICIT TQDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, - WFlags f=0 ); - ~TQDialog(); - - enum DialogCode { Rejected, Accepted }; - - int result() const { return rescode; } - - void show(); - void hide(); - void move( int x, int y ); - void move( const TQPoint &p ); - void resize( int w, int h ); - void resize( const TQSize & ); - void setGeometry( int x, int y, int w, int h ); - void setGeometry( const TQRect & ); - - void setOrientation( Orientation orientation ); - Orientation orientation() const; - - void setExtension( TQWidget* extension ); - TQWidget* extension() const; - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - - void setSizeGripEnabled( bool ); - bool isSizeGripEnabled() const; - - void setModal( bool modal ); - bool isModal() const; -#ifdef Q_OS_TEMP - bool event( TQEvent * ); -#endif - -public slots: - int exec(); - -protected slots: - virtual void done( int ); - virtual void accept(); - virtual void reject(); - - void showExtension( bool ); - -protected: - void setResult( int r ) { rescode = r; } - void keyPressEvent( TQKeyEvent * ); - void closeEvent( TQCloseEvent * ); - void resizeEvent( TQResizeEvent * ); - void contextMenuEvent( TQContextMenuEvent * ); - bool eventFilter( TQObject *, TQEvent * ); - void adjustPosition( TQWidget*); - -private: - void setDefault( TQPushButton * ); - void setMainDefault( TQPushButton * ); - void hideDefault(); -#ifdef Q_OS_TEMP - void hideSpecial(); -#endif - - int rescode; - uint did_move : 1; - uint has_relpos : 1; - uint did_resize : 1; - uint in_loop: 1; - void adjustPositionInternal( TQWidget*, bool useRelPos = FALSE ); - TQDialogPrivate* d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQDialog( const TQDialog & ); - TQDialog &operator=( const TQDialog & ); -#endif -}; - -#endif // QT_NO_DIALOG -#endif // TQDIALOG_H diff --git a/src/dialogs/qerrormessage.cpp b/src/dialogs/qerrormessage.cpp index 7352ee641..a33872bb8 100644 --- a/src/dialogs/qerrormessage.cpp +++ b/src/dialogs/qerrormessage.cpp @@ -38,20 +38,20 @@ ** **********************************************************************/ -#include "qerrormessage.h" +#include "ntqerrormessage.h" #ifndef QT_NO_ERRORMESSAGE -#include "qapplication.h" -#include "qcheckbox.h" -#include "qdict.h" -#include "qlabel.h" -#include "qlayout.h" -#include "qmessagebox.h" -#include "qpushbutton.h" -#include "qstringlist.h" -#include "qstylesheet.h" -#include "qtextview.h" +#include "ntqapplication.h" +#include "ntqcheckbox.h" +#include "ntqdict.h" +#include "ntqlabel.h" +#include "ntqlayout.h" +#include "ntqmessagebox.h" +#include "ntqpushbutton.h" +#include "ntqstringlist.h" +#include "ntqstylesheet.h" +#include "ntqtextview.h" #include #include diff --git a/src/dialogs/qerrormessage.h b/src/dialogs/qerrormessage.h deleted file mode 100644 index fffb7c73b..000000000 --- a/src/dialogs/qerrormessage.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Definition of a nice qInstallErrorMessage() handler -** -** Created : 000527, after Kalle Dalheimer's birthday -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQERRORMESSAGE_H -#define TQERRORMESSAGE_H - -#ifndef QT_H -#include "qdialog.h" -#endif // QT_H - -#ifndef QT_NO_ERRORMESSAGE -class TQPushButton; -class TQCheckBox; -class TQLabel; -class TQTextView; -class TQStringList; -template class TQDict; - - -class Q_EXPORT TQErrorMessage: public TQDialog { - Q_OBJECT -public: - TQErrorMessage( TQWidget* parent, const char* name=0 ); - ~TQErrorMessage(); - - static TQErrorMessage * qtHandler(); - -public slots: - void message( const TQString & ); - -protected: - void done( int ); - -private: - TQPushButton * ok; - TQCheckBox * again; - TQTextView * errors; - TQLabel * icon; - TQStringList * pending; - TQDict * doNotShow; - - bool nextPending(); - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQErrorMessage( const TQErrorMessage & ); - TQErrorMessage &operator=( const TQErrorMessage & ); -#endif -}; - -#endif //QT_NO_ERRORMESSAGE - -#endif diff --git a/src/dialogs/qfiledialog.cpp b/src/dialogs/qfiledialog.cpp index c9032f853..cfa6dd39d 100644 --- a/src/dialogs/qfiledialog.cpp +++ b/src/dialogs/qfiledialog.cpp @@ -50,50 +50,50 @@ # undef truncate #endif -#include "qfiledialog.h" +#include "ntqfiledialog.h" #ifndef QT_NO_FILEDIALOG #include "private/qapplication_p.h" -#include "qapplication.h" -#include "qbitmap.h" -#include "qbuttongroup.h" -#include "qcheckbox.h" -#include "qcleanuphandler.h" -#include "qcombobox.h" -#include "qcstring.h" -#include "qcursor.h" -#include "qdragobject.h" -#include "qfile.h" -#include "qguardedptr.h" -#include "qhbox.h" -#include "qheader.h" -#include "qlabel.h" -#include "qlayout.h" -#include "qlibrary.h" -#include "qlineedit.h" -#include "qlistbox.h" -#include "qlistview.h" -#include "qmap.h" -#include "qmessagebox.h" -#include "qmime.h" -#include "qnetworkprotocol.h" -#include "qobjectlist.h" -#include "qpainter.h" -#include "qpopupmenu.h" -#include "qprogressbar.h" -#include "qptrvector.h" -#include "qpushbutton.h" -#include "qregexp.h" -#include "qsemimodal.h" -#include "qsplitter.h" -#include "qstrlist.h" -#include "qstyle.h" -#include "qtimer.h" -#include "qtoolbutton.h" -#include "qtooltip.h" -#include "qvbox.h" -#include "qwidgetstack.h" +#include "ntqapplication.h" +#include "ntqbitmap.h" +#include "ntqbuttongroup.h" +#include "ntqcheckbox.h" +#include "ntqcleanuphandler.h" +#include "ntqcombobox.h" +#include "ntqcstring.h" +#include "ntqcursor.h" +#include "ntqdragobject.h" +#include "ntqfile.h" +#include "ntqguardedptr.h" +#include "ntqhbox.h" +#include "ntqheader.h" +#include "ntqlabel.h" +#include "ntqlayout.h" +#include "ntqlibrary.h" +#include "ntqlineedit.h" +#include "ntqlistbox.h" +#include "ntqlistview.h" +#include "ntqmap.h" +#include "ntqmessagebox.h" +#include "ntqmime.h" +#include "ntqnetworkprotocol.h" +#include "ntqobjectlist.h" +#include "ntqpainter.h" +#include "ntqpopupmenu.h" +#include "ntqprogressbar.h" +#include "ntqptrvector.h" +#include "ntqpushbutton.h" +#include "ntqregexp.h" +#include "ntqsemimodal.h" +#include "ntqsplitter.h" +#include "ntqstrlist.h" +#include "ntqstyle.h" +#include "ntqtimer.h" +#include "ntqtoolbutton.h" +#include "ntqtooltip.h" +#include "ntqvbox.h" +#include "ntqwidgetstack.h" #ifdef Q_WS_X11 #include "private/qtkdeintegration_x11_p.h" @@ -2164,7 +2164,7 @@ static TQStringList makeFiltersList( const TQString &filter ) } /*! - \class TQFileDialog qfiledialog.h + \class TQFileDialog ntqfiledialog.h \brief The TQFileDialog class provides dialogs that allow users to select files or directories. \ingroup dialogs \mainclass @@ -4968,7 +4968,7 @@ void TQFileDialog::keyPressEvent( TQKeyEvent * ke ) } -/*! \class TQFileIconProvider qfiledialog.h +/*! \class TQFileIconProvider ntqfiledialog.h \brief The TQFileIconProvider class provides icons for TQFileDialog to use. @@ -6445,7 +6445,7 @@ void TQFileDialog::goBack() // preview widget from TQWidget and from this class' indeed. /*! - \class TQFilePreview qfiledialog.h + \class TQFilePreview ntqfiledialog.h \ingroup misc \brief The TQFilePreview class provides file previewing in TQFileDialog. diff --git a/src/dialogs/qfiledialog.h b/src/dialogs/qfiledialog.h deleted file mode 100644 index ee13267e5..000000000 --- a/src/dialogs/qfiledialog.h +++ /dev/null @@ -1,347 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFileDialog class -** -** Created : 950428 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFILEDIALOG_H -#define TQFILEDIALOG_H - -class TQPushButton; -class TQButton; -class TQLabel; -class TQWidget; -class TQFileDialog; -class TQTimer; -class TQNetworkOperation; -class TQLineEdit; -class TQListViewItem; -class TQListBoxItem; -class TQFileDialogPrivate; -class TQFileDialogTQFileListView; - -#ifndef QT_H -#include "qdir.h" -#include "qdialog.h" -#include "qurloperator.h" -#include "qurlinfo.h" -#endif // QT_H - -#if __GNUC__ - 0 > 3 -#pragma GCC system_header -#endif - -#ifndef QT_NO_FILEDIALOG - -class Q_EXPORT TQFileIconProvider : public TQObject -{ - Q_OBJECT -public: - TQFileIconProvider( TQObject * parent = 0, const char* name = 0 ); - virtual const TQPixmap * pixmap( const TQFileInfo & ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQFileIconProvider( const TQFileIconProvider & ); - TQFileIconProvider& operator=( const TQFileIconProvider & ); -#endif -}; - -class Q_EXPORT TQFilePreview -{ -public: - TQFilePreview(); - virtual void previewUrl( const TQUrl &url ) = 0; - -}; - -class Q_EXPORT TQFileDialog : public TQDialog -{ - Q_OBJECT - Q_ENUMS( Mode ViewMode PreviewMode ) - // ##### Why are this read-only properties ? - Q_PROPERTY( TQString selectedFile READ selectedFile ) - Q_PROPERTY( TQString selectedFilter READ selectedFilter ) - Q_PROPERTY( TQStringList selectedFiles READ selectedFiles ) - // #### Should not we be able to set the path ? - Q_PROPERTY( TQString dirPath READ dirPath ) - Q_PROPERTY( bool showHiddenFiles READ showHiddenFiles WRITE setShowHiddenFiles ) - Q_PROPERTY( Mode mode READ mode WRITE setMode ) - Q_PROPERTY( ViewMode viewMode READ viewMode WRITE setViewMode ) - Q_PROPERTY( PreviewMode previewMode READ previewMode WRITE setPreviewMode ) - Q_PROPERTY( bool infoPreview READ isInfoPreviewEnabled WRITE setInfoPreviewEnabled ) - Q_PROPERTY( bool contentsPreview READ isContentsPreviewEnabled WRITE setContentsPreviewEnabled ) - -public: - TQFileDialog( const TQString& dirName, const TQString& filter = TQString::null, - TQWidget* parent=0, const char* name=0, bool modal = FALSE ); - TQFileDialog( TQWidget* parent=0, const char* name=0, bool modal = FALSE ); - ~TQFileDialog(); - - // recommended static functions - - static TQString getOpenFileName( const TQString &initially = TQString::null, - const TQString &filter = TQString::null, - TQWidget *parent = 0, const char* name = 0, - const TQString &caption = TQString::null, - TQString *selectedFilter = 0, - bool resolveSymlinks = TRUE); - static TQString getSaveFileName( const TQString &initially = TQString::null, - const TQString &filter = TQString::null, - TQWidget *parent = 0, const char* name = 0, - const TQString &caption = TQString::null, - TQString *selectedFilter = 0, - bool resolveSymlinks = TRUE); - static TQString getExistingDirectory( const TQString &dir = TQString::null, - TQWidget *parent = 0, - const char* name = 0, - const TQString &caption = TQString::null, - bool dirOnly = TRUE, - bool resolveSymlinks = TRUE); - static TQStringList getOpenFileNames( const TQString &filter= TQString::null, - const TQString &dir = TQString::null, - TQWidget *parent = 0, - const char* name = 0, - const TQString &caption = TQString::null, - TQString *selectedFilter = 0, - bool resolveSymlinks = TRUE); - - // other static functions - - static void setIconProvider( TQFileIconProvider * ); - static TQFileIconProvider * iconProvider(); - - // non-static function for special needs - - TQString selectedFile() const; - TQString selectedFilter() const; - virtual void setSelectedFilter( const TQString& ); - virtual void setSelectedFilter( int ); - - void setSelection( const TQString &); - - void selectAll( bool b ); - - TQStringList selectedFiles() const; - - TQString dirPath() const; - - void setDir( const TQDir & ); - const TQDir *dir() const; - - void setShowHiddenFiles( bool s ); - bool showHiddenFiles() const; - - void rereadDir(); - 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 m ); - ViewMode viewMode() const; - void setPreviewMode( PreviewMode m ); - PreviewMode previewMode() const; - - bool eventFilter( TQObject *, TQEvent * ); - - bool isInfoPreviewEnabled() const; - bool isContentsPreviewEnabled() const; - void setInfoPreviewEnabled( bool ); - void setContentsPreviewEnabled( bool ); - - void setInfoPreview( TQWidget *w, TQFilePreview *preview ); - void setContentsPreview( TQWidget *w, TQFilePreview *preview ); - - TQUrl url() const; - - void addFilter( const TQString &filter ); - -public slots: - void done( int ); - void setDir( const TQString& ); - void setUrl( const TQUrlOperator &url ); - void setFilter( const TQString& ); - void setFilters( const TQString& ); - void setFilters( const char ** ); - void setFilters( const TQStringList& ); - -protected: - void resizeEvent( TQResizeEvent * ); - void keyPressEvent( TQKeyEvent * ); - - void addWidgets( TQLabel *, TQWidget *, TQPushButton * ); - void addToolButton( TQButton *b, bool separator = FALSE ); - void addLeftWidget( TQWidget *w ); - void addRightWidget( TQWidget *w ); - -signals: - void fileHighlighted( const TQString& ); - void fileSelected( const TQString& ); - void filesSelected( const TQStringList& ); - void dirEntered( const TQString& ); - void filterSelected( const TQString& ); - -private slots: - void detailViewSelectionChanged(); - void listBoxSelectionChanged(); - void changeMode( int ); - void fileNameEditReturnPressed(); - void stopCopy(); - void removeProgressDia(); - - void fileSelected( int ); - void fileHighlighted( int ); - void dirSelected( int ); - void pathSelected( int ); - - void updateFileNameEdit( TQListViewItem *); - void selectDirectoryOrFile( TQListViewItem * ); - void popupContextMenu( TQListViewItem *, const TQPoint &, int ); - void popupContextMenu( TQListBoxItem *, const TQPoint & ); - void updateFileNameEdit( TQListBoxItem *); - void selectDirectoryOrFile( TQListBoxItem * ); - void fileNameEditDone(); - - void okClicked(); - void filterClicked(); // not used - void cancelClicked(); - - void cdUpClicked(); - void newFolderClicked(); - - void fixupNameEdit(); - - void doMimeTypeLookup(); - - void updateGeometries(); - void modeButtonsDestroyed(); - void urlStart( TQNetworkOperation *op ); - void urlFinished( TQNetworkOperation *op ); - void dataTransferProgress( int bytesDone, int bytesTotal, TQNetworkOperation * ); - void insertEntry( const TQValueList &fi, TQNetworkOperation *op ); - void removeEntry( TQNetworkOperation * ); - void createdDirectory( const TQUrlInfo &info, TQNetworkOperation * ); - void itemChanged( TQNetworkOperation * ); - void goBack(); - -private: - enum PopupAction { - PA_Open = 0, - PA_Delete, - PA_Rename, - PA_SortName, - PA_SortSize, - PA_SortType, - PA_SortDate, - PA_SortUnsorted, - PA_Cancel, - PA_Reload, - PA_Hidden - }; - - void init(); - bool trySetSelection( bool isDir, const TQUrlOperator &, bool ); - void deleteFile( const TQString &filename ); - void popupContextMenu( const TQString &filename, bool withSort, - PopupAction &action, const TQPoint &p ); - void updatePreviews( const TQUrl &u ); - - TQDir reserved; // was cwd - TQString fileName; - - friend class TQFileDialogTQFileListView; - friend class TQFileListBox; - - TQFileDialogPrivate *d; - TQFileDialogTQFileListView *files; - - TQLineEdit *nameEdit; // also filter - TQPushButton *okB; - TQPushButton *cancelB; - -#if defined(Q_WS_WIN) - static TQString winGetOpenFileName( const TQString &initialSelection, - const TQString &filter, - TQString* workingDirectory, - TQWidget *parent = 0, - const char* name = 0, - const TQString& caption = TQString::null, - TQString* selectedFilter = 0 ); - static TQString winGetSaveFileName( const TQString &initialSelection, - const TQString &filter, - TQString* workingDirectory, - TQWidget *parent = 0, - const char* name = 0, - const TQString& caption = TQString::null, - TQString* selectedFilter = 0 ); - static TQStringList winGetOpenFileNames( const TQString &filter, - TQString* workingDirectory, - TQWidget *parent = 0, - const char* name = 0, - const TQString& caption = TQString::null, - TQString* selectedFilter = 0 ); - static TQString winGetExistingDirectory( const TQString &initialDirectory, - TQWidget* parent = 0, - const char* name = 0, - const TQString& caption = TQString::null); - static TQString resolveLinkFile( const TQString& linkfile ); -#endif -#if defined(Q_WS_MACX) || defined(Q_WS_MAC9) - static TQString macGetSaveFileName( const TQString &, const TQString &, - TQString *, TQWidget *, const char*, - const TQString&, TQString *); - static TQStringList macGetOpenFileNames( const TQString &, TQString*, - TQWidget *, const char *, - const TQString&, TQString *, - bool = TRUE, bool = FALSE ); -#endif - - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQFileDialog( const TQFileDialog & ); - TQFileDialog &operator=( const TQFileDialog & ); -#endif -}; - -#endif - -#endif // TQFILEDIALOG_H diff --git a/src/dialogs/qfontdialog.cpp b/src/dialogs/qfontdialog.cpp index 317a2ec1e..48ecb3d61 100644 --- a/src/dialogs/qfontdialog.cpp +++ b/src/dialogs/qfontdialog.cpp @@ -38,33 +38,33 @@ ** **********************************************************************/ -#include "qwindowdefs.h" +#include "ntqwindowdefs.h" #ifndef QT_NO_FONTDIALOG -#include "qfontdialog.h" - -#include "qlineedit.h" -#include "qlistbox.h" -#include "qpushbutton.h" -#include "qcheckbox.h" -#include "qcombobox.h" -#include "qlayout.h" -#include "qvgroupbox.h" -#include "qhgroupbox.h" -#include "qlabel.h" -#include "qapplication.h" -#include "qfontdatabase.h" -#include "qstyle.h" +#include "ntqfontdialog.h" + +#include "ntqlineedit.h" +#include "ntqlistbox.h" +#include "ntqpushbutton.h" +#include "ntqcheckbox.h" +#include "ntqcombobox.h" +#include "ntqlayout.h" +#include "ntqvgroupbox.h" +#include "ntqhgroupbox.h" +#include "ntqlabel.h" +#include "ntqapplication.h" +#include "ntqfontdatabase.h" +#include "ntqstyle.h" #include -#include +#include #ifdef Q_WS_X11 #include "private/qtkdeintegration_x11_p.h" #endif /*! - \class TQFontDialog qfontdialog.h + \class TQFontDialog ntqfontdialog.h \ingroup dialogs \mainclass \brief The TQFontDialog class provides a dialog widget for selecting a font. @@ -470,7 +470,7 @@ bool TQFontDialog::eventFilter( TQObject * o , TQEvent * e ) #endif #ifdef SHOW_FONTS_IN_FAMILIES -#include "qpainter.h" +#include "ntqpainter.h" #include class TQListBoxFontText : public TQListBoxText diff --git a/src/dialogs/qfontdialog.h b/src/dialogs/qfontdialog.h deleted file mode 100644 index 53e625f23..000000000 --- a/src/dialogs/qfontdialog.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFontDialog -** -** Created : 970605 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFONTDIALOG_H -#define TQFONTDIALOG_H - -#include "qwindowdefs.h" - -#ifndef QT_NO_FONTDIALOG - -// -// W A R N I N G -// ------------- -// -// This class is under development and has private constructors. -// -// You may use the public static getFont() functions which are guaranteed -// to be available in the future. -// - -#ifndef QT_H -#include "qdialog.h" -#include "qfont.h" -#endif // QT_H - -class TQFontDialogPrivate; - -class Q_EXPORT TQFontDialog: public TQDialog -{ - Q_OBJECT - -public: - static TQFont getFont( bool *ok, const TQFont &def, - TQWidget* parent=0, const char* name=0); - static TQFont getFont( bool *ok, TQWidget* parent=0, const char* name=0); - -private: - static TQFont getFont( bool *ok, const TQFont *def, - TQWidget* parent=0, const char* name=0); - - TQFontDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, - WFlags f=0 ); - ~TQFontDialog(); - - TQFont font() const; - void setFont( const TQFont &font ); - - bool eventFilter( TQObject *, TQEvent * ); - - void updateFamilies(); - void updateStyles(); - void updateSizes(); - -private slots: - void sizeChanged( const TQString &); - void familyHighlighted( int ); - void scriptHighlighted( int ); - void styleHighlighted( int ); - void sizeHighlighted( const TQString & ); - void updateSample(); - -private: - friend class TQFontDialogPrivate; - TQFontDialogPrivate * d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQFontDialog( const TQFontDialog & ); - TQFontDialog& operator=( const TQFontDialog & ); -#endif -}; - -#endif - -#endif // TQFONTDIALOG_H diff --git a/src/dialogs/qinputdialog.cpp b/src/dialogs/qinputdialog.cpp index a75d24b5c..7b285da97 100644 --- a/src/dialogs/qinputdialog.cpp +++ b/src/dialogs/qinputdialog.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qinputdialog.h" +#include "ntqinputdialog.h" #ifndef QT_NO_INPUTDIALOG -#include "qlayout.h" -#include "qlabel.h" -#include "qlineedit.h" -#include "qpushbutton.h" -#include "qspinbox.h" -#include "qcombobox.h" -#include "qwidgetstack.h" -#include "qvalidator.h" -#include "qapplication.h" +#include "ntqlayout.h" +#include "ntqlabel.h" +#include "ntqlineedit.h" +#include "ntqpushbutton.h" +#include "ntqspinbox.h" +#include "ntqcombobox.h" +#include "ntqwidgetstack.h" +#include "ntqvalidator.h" +#include "ntqapplication.h" class TQInputDialogPrivate { diff --git a/src/dialogs/qinputdialog.h b/src/dialogs/qinputdialog.h deleted file mode 100644 index 96db6e557..000000000 --- a/src/dialogs/qinputdialog.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Definition of TQInputDialog class -** -** Created : 991212 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQINPUTDIALOG_H -#define TQINPUTDIALOG_H - -#ifndef QT_H -#include "qdialog.h" -#include "qstring.h" -#include "qlineedit.h" -#endif // QT_H - -#ifndef QT_NO_INPUTDIALOG - -class TQSpinBox; -class TQComboBox; -class TQInputDialogPrivate; - -class Q_EXPORT TQInputDialog : public TQDialog -{ - Q_OBJECT - -private: - enum Type { LineEdit, SpinBox, ComboBox, EditableComboBox }; - - TQInputDialog( const TQString &label, TQWidget* parent=0, const char* name=0, - bool modal = TRUE, Type type = LineEdit ); //### 4.0: widget flag! - ~TQInputDialog(); - - TQLineEdit *lineEdit() const; - TQSpinBox *spinBox() const; - TQComboBox *comboBox() const; - TQComboBox *editableComboBox() const; - - void setType( Type t ); - Type type() const; - -public: - //### 4.0: widget flag! - static TQString getText( const TQString &caption, const TQString &label, TQLineEdit::EchoMode echo = TQLineEdit::Normal, - const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0 ); - static int getInteger( const TQString &caption, const TQString &label, int value = 0, int minValue = -2147483647, - int maxValue = 2147483647, - int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0 ); - static double getDouble( const TQString &caption, const TQString &label, double value = 0, - double minValue = -2147483647, double maxValue = 2147483647, - int decimals = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0 ); - 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 ); - -private slots: - void textChanged( const TQString &s ); - void tryAccept(); - -private: - TQInputDialogPrivate *d; - friend class TQInputDialogPrivate; /* to avoid 'has no friends' warnings... */ - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQInputDialog( const TQInputDialog & ); - TQInputDialog &operator=( const TQInputDialog & ); -#endif -}; - -#endif // QT_NO_INPUTDIALOG - -#endif // TQINPUTDIALOG_H - diff --git a/src/dialogs/qmessagebox.cpp b/src/dialogs/qmessagebox.cpp index e0545de32..fc902b5a0 100644 --- a/src/dialogs/qmessagebox.cpp +++ b/src/dialogs/qmessagebox.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qmessagebox.h" +#include "ntqmessagebox.h" #ifndef QT_NO_MESSAGEBOX -#include "qaccel.h" -#include "qlabel.h" -#include "qpushbutton.h" -#include "qimage.h" -#include "qapplication.h" -#include "qstyle.h" -#include "qobjectlist.h" +#include "ntqaccel.h" +#include "ntqlabel.h" +#include "ntqpushbutton.h" +#include "ntqimage.h" +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqobjectlist.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #if defined QT_NON_COMMERCIAL #include "qnc_win.h" diff --git a/src/dialogs/qmessagebox.h b/src/dialogs/qmessagebox.h deleted file mode 100644 index 65a7b6244..000000000 --- a/src/dialogs/qmessagebox.h +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMessageBox class -** -** Created : 950503 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMESSAGEBOX_H -#define TQMESSAGEBOX_H - -#ifndef QT_H -#include "qdialog.h" -#endif // QT_H - -#ifndef QT_NO_MESSAGEBOX - -class TQLabel; -class TQPushButton; -struct TQMessageBoxData; - -class Q_EXPORT TQMessageBox : public TQDialog -{ - Q_OBJECT - Q_ENUMS( Icon ) - Q_PROPERTY( TQString text READ text WRITE setText ) - Q_PROPERTY( Icon icon READ icon WRITE setIcon ) - Q_PROPERTY( TQPixmap iconPixmap READ iconPixmap WRITE setIconPixmap ) - Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) - -public: - enum Icon { NoIcon = 0, Information = 1, Warning = 2, Critical = 3, - Question = 4 }; - - TQMessageBox( TQWidget* parent=0, const char* name=0 ); - TQMessageBox( const TQString& caption, const TQString &text, Icon icon, - int button0, int button1, int button2, - TQWidget* parent=0, const char* name=0, bool modal=TRUE, - WFlags f=WStyle_DialogBorder ); - ~TQMessageBox(); - - enum { NoButton = 0, Ok = 1, Cancel = 2, Yes = 3, No = 4, Abort = 5, - Retry = 6, Ignore = 7, YesAll = 8, NoAll = 9, ButtonMask = 0xff, - Default = 0x100, Escape = 0x200, FlagMask = 0x300 }; - - static int information( TQWidget *parent, const TQString &caption, - const TQString& text, - int button0, int button1=0, int button2=0 ); - static int information( TQWidget *parent, const TQString &caption, - const TQString& text, - const TQString& button0Text = TQString::null, - const TQString& button1Text = TQString::null, - const TQString& button2Text = TQString::null, - int defaultButtonNumber = 0, - int escapeButtonNumber = -1 ); - - static int question( TQWidget *parent, const TQString &caption, - const TQString& text, - int button0, int button1=0, int button2=0 ); - static int question( TQWidget *parent, const TQString &caption, - const TQString& text, - const TQString& button0Text = TQString::null, - const TQString& button1Text = TQString::null, - const TQString& button2Text = TQString::null, - int defaultButtonNumber = 0, - int escapeButtonNumber = -1 ); - - static int warning( TQWidget *parent, const TQString &caption, - const TQString& text, - int button0, int button1, int button2=0 ); - static int warning( TQWidget *parent, const TQString &caption, - const TQString& text, - const TQString& button0Text = TQString::null, - const TQString& button1Text = TQString::null, - const TQString& button2Text = TQString::null, - int defaultButtonNumber = 0, - int escapeButtonNumber = -1 ); - - static int critical( TQWidget *parent, const TQString &caption, - const TQString& text, - int button0, int button1, int button2=0 ); - static int critical( TQWidget *parent, const TQString &caption, - const TQString& text, - const TQString& button0Text = TQString::null, - const TQString& button1Text = TQString::null, - const TQString& button2Text = TQString::null, - int defaultButtonNumber = 0, - int escapeButtonNumber = -1 ); - - static void about( TQWidget *parent, const TQString &caption, - const TQString& text ); - - static void aboutTQt( TQWidget *parent, - const TQString& caption=TQString::null ); - -/* OBSOLETE */ - static int message( const TQString &caption, - const TQString& text, - const TQString& buttonText=TQString::null, - TQWidget *parent=0, const char * =0 ) { - return TQMessageBox::information( parent, caption, text, - buttonText.isEmpty() - ? tr("OK") : buttonText ) == 0; - } - -/* OBSOLETE */ - static bool query( const TQString &caption, - const TQString& text, - const TQString& yesButtonText=TQString::null, - const TQString& noButtonText=TQString::null, - TQWidget *parent=0, const char * = 0 ) { - return TQMessageBox::information( parent, caption, text, - yesButtonText.isEmpty() - ? tr("OK") : yesButtonText, - noButtonText ) == 0; - } - - 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 button ) const; - void setButtonText( int button, const TQString &); - - void adjustSize(); - -/* OBSOLETE */ - static TQPixmap standardIcon( Icon icon, GUIStyle ); - - static TQPixmap standardIcon( Icon icon ); - - TextFormat textFormat() const; - void setTextFormat( TextFormat ); - -protected: - void resizeEvent( TQResizeEvent * ); - void showEvent( TQShowEvent * ); - void closeEvent( TQCloseEvent * ); - void keyPressEvent( TQKeyEvent * ); - void styleChanged( TQStyle& ); - -private slots: - void buttonClicked(); - -private: - void init( int, int, int ); - int indexOf( int ) const; - void resizeButtons(); - TQLabel *label; - TQMessageBoxData *mbd; - void *reserved1; - void *reserved2; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMessageBox( const TQMessageBox & ); - TQMessageBox &operator=( const TQMessageBox & ); -#endif -}; - -/* -* Macro to be used at the beginning of main(), e.g. -* -* #include -* #include -* int main( int argc, char**argv ) -* { -* QT_REQUIRE_VERSION( argc, argv, "3.0.5" ) -* ... -* } -*/ -#define QT_REQUIRE_VERSION( argc, argv, str ) { TQString s=TQString::fromLatin1(str);\ -TQString sq=TQString::fromLatin1(qVersion()); if ( (sq.section('.',0,0).toInt()<<16)+\ -(sq.section('.',1,1).toInt()<<8)+sq.section('.',2,2).toInt()<(s.section('.',0,0).toInt()<<16)+\ -(s.section('.',1,1).toInt()<<8)+s.section('.',2,2).toInt() ){if ( !qApp){ int c=0; new \ -TQApplication(argc,argv);} TQString s = TQApplication::tr("Executable '%1' requires TQt "\ - "%2, found TQt %3.").arg(TQString::fromLatin1(qAppName())).arg(TQString::fromLatin1(\ -str)).arg(TQString::fromLatin1(qVersion()) ); TQMessageBox::critical( 0, TQApplication::tr(\ -"Incompatible TQt Library Error" ), s, TQMessageBox::Abort,0 ); qFatal(s.ascii()); }} - - -#endif // QT_NO_MESSAGEBOX - -#endif // TQMESSAGEBOX_H diff --git a/src/dialogs/qprintdialog.cpp b/src/dialogs/qprintdialog.cpp index 0e00609e4..f46d1a5e6 100644 --- a/src/dialogs/qprintdialog.cpp +++ b/src/dialogs/qprintdialog.cpp @@ -38,31 +38,31 @@ ** **********************************************************************/ -#include "qprintdialog.h" +#include "ntqprintdialog.h" #ifndef QT_NO_PRINTDIALOG -#include "qfiledialog.h" -#include "qfile.h" -#include "qtextstream.h" -#include "qcombobox.h" -#include "qframe.h" -#include "qlabel.h" -#include "qlineedit.h" -#include "qpushbutton.h" -#include "qprinter.h" -#include "qlistview.h" -#include "qlayout.h" -#include "qbuttongroup.h" -#include "qradiobutton.h" -#include "qspinbox.h" -#include "qapplication.h" -#include "qheader.h" -#include "qstyle.h" -#include "qstring.h" -#include "qregexp.h" +#include "ntqfiledialog.h" +#include "ntqfile.h" +#include "ntqtextstream.h" +#include "ntqcombobox.h" +#include "ntqframe.h" +#include "ntqlabel.h" +#include "ntqlineedit.h" +#include "ntqpushbutton.h" +#include "ntqprinter.h" +#include "ntqlistview.h" +#include "ntqlayout.h" +#include "ntqbuttongroup.h" +#include "ntqradiobutton.h" +#include "ntqspinbox.h" +#include "ntqapplication.h" +#include "ntqheader.h" +#include "ntqstyle.h" +#include "ntqstring.h" +#include "ntqregexp.h" #if !defined(QT_NO_CUPS) || !defined(QT_NO_NIS) -#include "qlibrary.h" +#include "ntqlibrary.h" #endif #ifndef QT_NO_NIS @@ -825,7 +825,7 @@ static void qpd_cleanup_globaldialog() } /*! - \class TQPrintDialog qprintdialog.h + \class TQPrintDialog ntqprintdialog.h \brief The TQPrintDialog class provides a dialog for specifying the printer's configuration. diff --git a/src/dialogs/qprintdialog.h b/src/dialogs/qprintdialog.h deleted file mode 100644 index 4d411850a..000000000 --- a/src/dialogs/qprintdialog.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Definition of print dialog. -** -** Created : 950829 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPRINTDIALOG_H -#define TQPRINTDIALOG_H - -#ifndef QT_H -#include "qdialog.h" -#endif // QT_H - -#ifndef QT_NO_PRINTDIALOG - -class TQGroupBox; -class TQPrintDialogPrivate; -class TQListView; - -class Q_EXPORT TQPrintDialog : public TQDialog -{ - Q_OBJECT -public: - TQPrintDialog( TQPrinter *, TQWidget* parent=0, const char* name=0 ); - ~TQPrintDialog(); - - static bool getPrinterSetup( TQPrinter *, TQWidget* = 0 ); - static void setGlobalPrintDialog( TQPrintDialog * ); - - void setPrinter( TQPrinter *, bool = FALSE ); - TQPrinter * printer() const; - - void addButton( TQPushButton *but ); - -private slots: - void browseClicked(); - void okClicked(); - - void printerOrFileSelected( int ); - void landscapeSelected( int ); - void paperSizeSelected( int ); - void orientSelected( int ); - void pageOrderSelected( int ); - void colorModeSelected( int ); - void setNumCopies( int ); - void printRangeSelected( int ); - void setFirstPage( int ); - void setLastPage( int ); - - void fileNameEditChanged( const TQString &text ); - -private: - TQPrintDialogPrivate *d; - - TQGroupBox * setupDestination(); - TQGroupBox * setupOptions(); - TQGroupBox * setupPaper(); - TQGroupBox * setupPrinterSettings(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPrintDialog( const TQPrintDialog & ); - TQPrintDialog &operator=( const TQPrintDialog & ); -#endif -}; - -#endif - -#endif // TQPRINTDIALOG_H diff --git a/src/dialogs/qprogressdialog.cpp b/src/dialogs/qprogressdialog.cpp index a0f63467e..d29b4c581 100644 --- a/src/dialogs/qprogressdialog.cpp +++ b/src/dialogs/qprogressdialog.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qprogressdialog.h" +#include "ntqprogressdialog.h" #ifndef QT_NO_PROGRESSDIALOG -#include "qaccel.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qdatetime.h" -#include "qapplication.h" -#include "qstyle.h" -#include "qpushbutton.h" -#include "qcursor.h" -#include "qtimer.h" +#include "ntqaccel.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqdatetime.h" +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqpushbutton.h" +#include "ntqcursor.h" +#include "ntqtimer.h" #include // If the operation is expected to take this long (as predicted by @@ -100,7 +100,7 @@ public: /*! - \class TQProgressDialog qprogressdialog.h + \class TQProgressDialog ntqprogressdialog.h \brief The TQProgressDialog class provides feedback on the progress of a slow operation. \ingroup dialogs \mainclass diff --git a/src/dialogs/qprogressdialog.h b/src/dialogs/qprogressdialog.h deleted file mode 100644 index 13b3129a8..000000000 --- a/src/dialogs/qprogressdialog.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Definition of TQProgressDialog class -** -** Created : 970520 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPROGRESSDIALOG_H -#define TQPROGRESSDIALOG_H - -#ifndef QT_H -#include "qsemimodal.h" -#include "qlabel.h" // ### remove or keep for users' convenience? -#include "qprogressbar.h" // ### remove or keep for users' convenience? -#endif // QT_H - -#ifndef QT_NO_PROGRESSDIALOG - -class TQPushButton; -class TQTimer; -class TQProgressDialogData; - -class Q_EXPORT TQProgressDialog : public TQDialog -{ - Q_OBJECT - Q_PROPERTY( bool wasCancelled READ wasCancelled DESIGNABLE false STORED false ) // ### remove in 4.0 - Q_PROPERTY( bool wasCanceled READ wasCanceled ) - Q_PROPERTY( int totalSteps READ totalSteps WRITE setTotalSteps ) - Q_PROPERTY( int progress READ progress WRITE setProgress ) - Q_PROPERTY( bool autoReset READ autoReset WRITE setAutoReset ) - Q_PROPERTY( bool autoClose READ autoClose WRITE setAutoClose ) - Q_PROPERTY( int minimumDuration READ minimumDuration WRITE setMinimumDuration ) - Q_PROPERTY( TQString labelText READ labelText WRITE setLabelText ) - -public: - TQProgressDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, - WFlags f=0 ); - TQProgressDialog( const TQString& labelText, const TQString &cancelButtonText, - int totalSteps, TQWidget* parent=0, const char* name=0, - bool modal=FALSE, WFlags f=0 ); - ~TQProgressDialog(); - - void setLabel( TQLabel * ); - void setCancelButton( TQPushButton * ); - void setBar( TQProgressBar * ); - - // ### TQt 4.0: remove wasCancelled() in 4.0 - bool wasCancelled() const; - inline bool wasCanceled() const { return wasCancelled(); } - - int totalSteps() const; - int progress() const; - - TQSize sizeHint() const; - - TQString labelText() const; - - void setAutoReset( bool b ); - bool autoReset() const; - void setAutoClose( bool b ); - bool autoClose() const; - -public slots: - void cancel(); - void reset(); - void setTotalSteps( int totalSteps ); - void setProgress( int progress ); - void setProgress( int progress, int totalSteps ); - void setLabelText( const TQString &); - void setCancelButtonText( const TQString &); - - void setMinimumDuration( int ms ); -public: - int minimumDuration() const; - -signals: - // ### remove cancelled() in 4.0 - void cancelled(); - void canceled(); - -protected: - void resizeEvent( TQResizeEvent * ); - void closeEvent( TQCloseEvent * ); - void styleChange( TQStyle& ); - void showEvent( TQShowEvent *e ); - -protected slots: - void forceShow(); - -private: - void init( TQWidget *creator, const TQString& lbl, const TQString &canc, - int totstps); - void layout(); - TQLabel *label() const; - TQProgressBar *bar() const; - TQProgressDialogData *d; - TQTimer *forceTimer; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQProgressDialog( const TQProgressDialog & ); - TQProgressDialog &operator=( const TQProgressDialog & ); -#endif -}; - -#endif // QT_NO_PROGRESSDIALOG - -#endif // TQPROGRESSDIALOG_H diff --git a/src/dialogs/qsemimodal.h b/src/dialogs/qsemimodal.h deleted file mode 100644 index 580b97bd9..000000000 --- a/src/dialogs/qsemimodal.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSemiModal class for source compatibility -** -** Created : 001010 -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSEMIMODAL_H -#define TQSEMIMODAL_H - -#ifndef QT_H -#include "qdialog.h" -#endif // QT_H - -#ifndef QT_NO_COMPAT -#ifndef QT_NO_SEMIMODAL -class Q_EXPORT TQSemiModal : public TQDialog -{ - Q_OBJECT -public: - TQSemiModal( TQWidget* parent=0, const char* name=0, bool modal=FALSE, WFlags f=0 ) - : TQDialog( parent, name, modal, f ) { } - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSemiModal( const TQSemiModal & ); - TQSemiModal &operator=( const TQSemiModal & ); -#endif -}; -#endif -#endif - -#endif // TQSEMIMODAL_H diff --git a/src/dialogs/qt_dialogs.pri b/src/dialogs/qt_dialogs.pri index 9bd899205..deada26e9 100644 --- a/src/dialogs/qt_dialogs.pri +++ b/src/dialogs/qt_dialogs.pri @@ -3,22 +3,22 @@ dialogs { DIALOGS_P = dialogs - HEADERS += $$DIALOGS_H/qcolordialog.h \ - $$DIALOGS_H/qdialog.h \ - $$DIALOGS_H/qerrormessage.h \ - $$DIALOGS_H/qfiledialog.h \ - $$DIALOGS_H/qfontdialog.h \ - $$DIALOGS_H/qmessagebox.h \ - $$DIALOGS_H/qprogressdialog.h \ - $$DIALOGS_H/qsemimodal.h \ - $$DIALOGS_H/qtabdialog.h \ - $$DIALOGS_H/qwizard.h \ - $$DIALOGS_H/qinputdialog.h + HEADERS += $$DIALOGS_H/ntqcolordialog.h \ + $$DIALOGS_H/ntqdialog.h \ + $$DIALOGS_H/ntqerrormessage.h \ + $$DIALOGS_H/ntqfiledialog.h \ + $$DIALOGS_H/ntqfontdialog.h \ + $$DIALOGS_H/ntqmessagebox.h \ + $$DIALOGS_H/ntqprogressdialog.h \ + $$DIALOGS_H/ntqsemimodal.h \ + $$DIALOGS_H/ntqtabdialog.h \ + $$DIALOGS_H/ntqwizard.h \ + $$DIALOGS_H/ntqinputdialog.h !embedded:mac:SOURCES += $$DIALOGS_CPP/qfiledialog_mac.cpp $$DIALOGS_CPP/qcolordialog_mac.cpp win32:SOURCES += $$DIALOGS_CPP/qfiledialog_win.cpp unix:SOURCES += $$DIALOGS_CPP/qprintdialog.cpp - unix:HEADERS += $$DIALOGS_H/qprintdialog.h + unix:HEADERS += $$DIALOGS_H/ntqprintdialog.h SOURCES += $$DIALOGS_CPP/qcolordialog.cpp \ $$DIALOGS_CPP/qdialog.cpp \ diff --git a/src/dialogs/qtabdialog.cpp b/src/dialogs/qtabdialog.cpp index 8360158b0..2315e4ac1 100644 --- a/src/dialogs/qtabdialog.cpp +++ b/src/dialogs/qtabdialog.cpp @@ -38,23 +38,23 @@ ** **********************************************************************/ -#include "qtabdialog.h" +#include "ntqtabdialog.h" #ifndef QT_NO_TABDIALOG -#include "qobjectlist.h" -#include "qtabbar.h" -#include "qtabwidget.h" -#include "qpushbutton.h" -#include "qpainter.h" -#include "qpixmap.h" -#include "qapplication.h" -#include "qtabwidget.h" -#include "qwidgetstack.h" -#include "qlayout.h" +#include "ntqobjectlist.h" +#include "ntqtabbar.h" +#include "ntqtabwidget.h" +#include "ntqpushbutton.h" +#include "ntqpainter.h" +#include "ntqpixmap.h" +#include "ntqapplication.h" +#include "ntqtabwidget.h" +#include "ntqwidgetstack.h" +#include "ntqlayout.h" /*! - \class TQTabDialog qtabdialog.h + \class TQTabDialog ntqtabdialog.h \brief The TQTabDialog class provides a stack of tabbed widgets. diff --git a/src/dialogs/qtabdialog.h b/src/dialogs/qtabdialog.h deleted file mode 100644 index 6391f6630..000000000 --- a/src/dialogs/qtabdialog.h +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTabDialog class -** -** Created : 960825 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTABDIALOG_H -#define TQTABDIALOG_H - -#ifndef QT_H -#include "qdialog.h" -#include "qiconset.h" -#endif // QT_H - -#ifndef QT_NO_TABDIALOG - -class TQTabBar; -class TQTab; -class TQTabDialogPrivate; - -class Q_EXPORT TQTabDialog : public TQDialog -{ - Q_OBJECT -public: - TQTabDialog( TQWidget* parent=0, const char* name=0, bool modal=FALSE, - WFlags f=0 ); - ~TQTabDialog(); - - void show(); - void setFont( const TQFont & font ); - - void addTab( TQWidget *, const TQString &); - void addTab( TQWidget *child, const TQIconSet& iconset, const TQString &label); - void addTab( TQWidget *, TQTab* ); - - void insertTab( TQWidget *, const TQString &, int index = -1); - void insertTab( TQWidget *child, const TQIconSet& iconset, const TQString &label, int index = -1); - void insertTab( TQWidget *, TQTab*, int index = -1 ); - - void changeTab( TQWidget *, const TQString &); - void changeTab( TQWidget *child, const TQIconSet& iconset, const TQString &label); - - bool isTabEnabled( TQWidget * ) const; - void setTabEnabled( TQWidget *, bool ); - bool isTabEnabled( const char* ) const; // compatibility - void setTabEnabled( const char*, bool ); // compatibility - - void showPage( TQWidget * ); - void removePage( TQWidget * ); - TQString tabLabel( TQWidget * ); - - TQWidget * currentPage() const; - - void setDefaultButton( const TQString &text ); - void setDefaultButton(); - bool hasDefaultButton() const; - - void setHelpButton( const TQString &text ); - void setHelpButton(); - bool hasHelpButton() const; - - void setCancelButton( const TQString &text ); - void setCancelButton(); - bool hasCancelButton() const; - - void setApplyButton( const TQString &text ); - void setApplyButton(); - bool hasApplyButton() const; - -#ifndef Q_QDOC - void setOKButton( const TQString &text = TQString::null ); -#endif - void setOkButton( const TQString &text ); - 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 * ); - void selected( const TQString& ); // obsolete - -private slots: - void showTab( int i ); - -private: - void setSizes(); - void setUpLayout(); - - TQTabDialogPrivate *d; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTabDialog( const TQTabDialog & ); - TQTabDialog& operator=( const TQTabDialog & ); -#endif -}; - -#endif // QT_NO_TABDIALOG - -#endif // TQTABDIALOG_H diff --git a/src/dialogs/qwizard.cpp b/src/dialogs/qwizard.cpp index 3b79098fc..8ab1d13c2 100644 --- a/src/dialogs/qwizard.cpp +++ b/src/dialogs/qwizard.cpp @@ -38,25 +38,25 @@ ** **********************************************************************/ -#include "qwizard.h" +#include "ntqwizard.h" #ifndef QT_NO_WIZARD -#include "qlayout.h" -#include "qpushbutton.h" -#include "qcursor.h" -#include "qlabel.h" -#include "qwidgetstack.h" -#include "qapplication.h" -#include "qptrlist.h" -#include "qpainter.h" -#include "qaccel.h" +#include "ntqlayout.h" +#include "ntqpushbutton.h" +#include "ntqcursor.h" +#include "ntqlabel.h" +#include "ntqwidgetstack.h" +#include "ntqapplication.h" +#include "ntqptrlist.h" +#include "ntqpainter.h" +#include "ntqaccel.h" /*! \file wizard/wizard.cpp */ /*! \file wizard/wizard.h */ /*! - \class TQWizard qwizard.h + \class TQWizard ntqwizard.h \brief The TQWizard class provides a framework for wizard dialogs. \ingroup abstractwidgets diff --git a/src/dialogs/qwizard.h b/src/dialogs/qwizard.h deleted file mode 100644 index 04754fb7b..000000000 --- a/src/dialogs/qwizard.h +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQWizard class. -** -** Created : 990101 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the dialogs module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWIZARDDIALOG_H -#define TQWIZARDDIALOG_H - - -#ifndef QT_H -#include "qdialog.h" -#endif // QT_H - -#ifndef QT_NO_WIZARD - -class TQHBoxLayout; -class TQWizardPrivate; - -class Q_EXPORT TQWizard : public TQDialog -{ - Q_OBJECT - Q_PROPERTY( TQFont titleFont READ titleFont WRITE setTitleFont ) - -public: - TQWizard( TQWidget* parent=0, const char* name=0, bool modal=FALSE, - WFlags f=0 ); - ~TQWizard(); - - void show(); - - void setFont( const TQFont & font ); - - virtual void addPage( TQWidget *, const TQString & ); - virtual void insertPage( TQWidget*, 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 ); - - // obsolete - virtual void setFinish( 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: - void setBackEnabled( bool ); - void setNextEnabled( bool ); - - void setHelpEnabled( bool ); - - void setNextPage( TQWidget * ); - - void updateButtons(); - - void layOut(); - - TQWizardPrivate *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQWizard( const TQWizard & ); - TQWizard& operator=( const TQWizard & ); -#endif -}; - -#endif // QT_NO_WIZARD - -#endif // TQWIZARD_H diff --git a/src/iconview/ntqiconview.h b/src/iconview/ntqiconview.h new file mode 100644 index 000000000..ea905fa56 --- /dev/null +++ b/src/iconview/ntqiconview.h @@ -0,0 +1,518 @@ +/**************************************************************************** +** +** Definition of TQIconView widget class +** +** Created : 990707 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the iconview module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQICONVIEW_H +#define TQICONVIEW_H + +#ifndef QT_H +#include "ntqscrollview.h" +#include "ntqstring.h" +#include "ntqrect.h" +#include "ntqpoint.h" +#include "ntqsize.h" +#include "ntqfont.h" // TQString->TQFont conversion +#include "ntqdragobject.h" +#include "ntqbitmap.h" +#include "ntqpicture.h" +#endif // QT_H + +#ifndef QT_NO_ICONVIEW + +#if !defined( QT_MODULE_ICONVIEW ) || defined( QT_INTERNAL_ICONVIEW ) +#define TQM_EXPORT_ICONVIEW +#else +#define TQM_EXPORT_ICONVIEW Q_EXPORT +#endif + +class TQIconView; +class TQPainter; +class TQMimeSource; +class TQMouseEvent; +class TQDragEnterEvent; +class TQDragMoveEvent; +class TQDragLeaveEvent; +class TQKeyEvent; +class TQFocusEvent; +class TQShowEvent; +class TQIconViewItem; +class TQIconViewItemLineEdit; +class TQStringList; +class TQIconDragPrivate; + +#ifndef QT_NO_DRAGANDDROP + +class TQM_EXPORT_ICONVIEW TQIconDragItem +{ +public: + TQIconDragItem(); + virtual ~TQIconDragItem(); + virtual TQByteArray data() const; + virtual void setData( const TQByteArray &d ); + bool operator== ( const TQIconDragItem& ) const; + +private: + TQByteArray ba; + +}; + +class TQM_EXPORT_ICONVIEW TQIconDrag : public TQDragObject +{ + Q_OBJECT +public: + TQIconDrag( TQWidget * dragSource, const char* name = 0 ); + virtual ~TQIconDrag(); + + void append( const TQIconDragItem &item, const TQRect &pr, const TQRect &tr ); + + virtual const char* format( int i ) const; + static bool canDecode( TQMimeSource* e ); + virtual TQByteArray encodedData( const char* mime ) const; + +private: + TQIconDragPrivate *d; + TQChar endMark; + + friend class TQIconView; + friend class TQIconViewPrivate; +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQIconDrag( const TQIconDrag & ); + TQIconDrag &operator=( const TQIconDrag & ); +#endif +}; + +#endif + +class TQIconViewToolTip; +class TQIconViewItemPrivate; + +class TQM_EXPORT_ICONVIEW TQIconViewItem : public TQt +{ + friend class TQIconView; + friend class TQIconViewToolTip; + friend class TQIconViewItemLineEdit; + +public: + TQIconViewItem( TQIconView *parent ); + TQIconViewItem( TQIconView *parent, TQIconViewItem *after ); + TQIconViewItem( TQIconView *parent, const TQString &text ); + TQIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text ); + TQIconViewItem( TQIconView *parent, const TQString &text, const TQPixmap &icon ); + TQIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text, const TQPixmap &icon ); +#ifndef QT_NO_PICTURE + TQIconViewItem( TQIconView *parent, const TQString &text, const TQPicture &picture ); + TQIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text, const TQPicture &picture ); +#endif + virtual ~TQIconViewItem(); + + virtual void setRenameEnabled( bool allow ); + virtual void setDragEnabled( bool allow ); + virtual void setDropEnabled( bool allow ); + + virtual TQString text() const; + virtual TQPixmap *pixmap() const; +#ifndef QT_NO_PICTURE + virtual TQPicture *picture() const; +#endif + 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 s, bool cb ); + virtual void setSelected( bool s ); + virtual void setSelectable( bool s ); + + bool isSelected() const; + bool isSelectable() const; + + void setVisible( bool b ); + bool isVisible() const; + + virtual void repaint(); + + virtual bool move( int x, int y ); + virtual void moveBy( int dx, int dy ); + virtual bool move( const TQPoint &pnt ); + virtual void moveBy( const TQPoint &pnt ); + + TQRect rect() const; + int x() const; + int y() const; + int width() const; + int height() const; + TQSize size() const; + TQPoint pos() const; + TQRect textRect( bool relative = TRUE ) const; + TQRect pixmapRect( bool relative = TRUE ) const; + bool contains( const TQPoint& pnt ) const; + bool intersects( const TQRect& r ) const; + + virtual bool acceptDrop( const TQMimeSource *mime ) const; + +#ifndef QT_NO_TEXTEDIT + void rename(); +#endif + + virtual int compare( TQIconViewItem *i ) const; + + virtual void setText( const TQString &text ); + virtual void setPixmap( const TQPixmap &icon ); +#ifndef QT_NO_PICTURE + virtual void setPicture( const TQPicture &icon ); +#endif + virtual void setText( const TQString &text, bool recalc, bool redraw = TRUE ); + virtual void setPixmap( const TQPixmap &icon, bool recalc, bool redraw = TRUE ); + virtual void setKey( const TQString &k ); + + virtual int rtti() const; + static int RTTI; + +protected: +#ifndef QT_NO_TEXTEDIT + virtual void removeRenameBox(); +#endif + virtual void calcRect( const TQString &text_ = TQString::null ); + virtual void paintItem( TQPainter *p, const TQColorGroup &cg ); + virtual void paintFocus( TQPainter *p, const TQColorGroup &cg ); +#ifndef QT_NO_DRAGANDDROP + virtual void dropped( TQDropEvent *e, const TQValueList &lst ); +#endif + virtual void dragEntered(); + virtual void dragLeft(); + void setItemRect( const TQRect &r ); + void setTextRect( const TQRect &r ); + void setPixmapRect( const TQRect &r ); + void calcTmpText(); + TQString tempText() const; + +private: + void init( TQIconViewItem *after = 0 +#ifndef QT_NO_PICTURE + , TQPicture *pic = 0 +#endif + ); +#ifndef QT_NO_TEXTEDIT + void renameItem(); + void cancelRenameItem(); +#endif + void checkRect(); + + TQIconView *view; + TQString itemText, itemKey; + TQString tmpText; + TQPixmap *itemIcon; +#ifndef QT_NO_PICTURE + TQPicture *itemPic; +#endif + TQIconViewItem *prev, *next; + uint allow_rename : 1; + uint allow_drag : 1; + uint allow_drop : 1; + uint visible : 1; + uint selected : 1; + uint selectable : 1; + uint dirty : 1; + uint wordWrapDirty : 1; + TQRect itemRect, itemTextRect, itemIconRect; +#ifndef QT_NO_TEXTEDIT + TQIconViewItemLineEdit *renameBox; +#endif + TQRect oldRect; + + TQIconViewItemPrivate *d; + +}; + +class TQIconViewPrivate; /* don't touch */ + +class TQM_EXPORT_ICONVIEW TQIconView : public TQScrollView +{ + friend class TQIconViewItem; + friend class TQIconViewPrivate; + friend class TQIconViewToolTip; + + Q_OBJECT + // #### sorting and sort direction do not work + Q_ENUMS( SelectionMode ItemTextPos Arrangement ResizeMode ) + Q_PROPERTY( bool sorting READ sorting ) + Q_PROPERTY( bool sortDirection READ sortDirection ) + Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) + Q_PROPERTY( int gridX READ gridX WRITE setGridX ) + Q_PROPERTY( int gridY READ gridY WRITE setGridY ) + Q_PROPERTY( int spacing READ spacing WRITE setSpacing ) + Q_PROPERTY( ItemTextPos itemTextPos READ itemTextPos WRITE setItemTextPos ) + Q_PROPERTY( TQBrush itemTextBackground READ itemTextBackground WRITE setItemTextBackground ) + Q_PROPERTY( Arrangement arrangement READ arrangement WRITE setArrangement ) + Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode ) + Q_PROPERTY( int maxItemWidth READ maxItemWidth WRITE setMaxItemWidth ) + Q_PROPERTY( int maxItemTextLength READ maxItemTextLength WRITE setMaxItemTextLength ) + Q_PROPERTY( bool autoArrange READ autoArrange WRITE setAutoArrange ) + Q_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable ) + Q_PROPERTY( bool wordWrapIconText READ wordWrapIconText WRITE setWordWrapIconText ) + Q_PROPERTY( bool showToolTips READ showToolTips WRITE setShowToolTips ) + Q_PROPERTY( uint count READ count ) + +public: + enum SelectionMode { + Single = 0, + Multi, + Extended, + NoSelection + }; + enum Arrangement { + LeftToRight = 0, + TopToBottom + }; + enum ResizeMode { + Fixed = 0, + Adjust + }; + enum ItemTextPos { + Bottom = 0, + Right + }; + + TQIconView( TQWidget* parent=0, const char* name=0, WFlags f = 0 ); + virtual ~TQIconView(); + + virtual void insertItem( TQIconViewItem *item, TQIconViewItem *after = 0L ); + virtual void takeItem( TQIconViewItem *item ); + + int index( const TQIconViewItem *item ) const; + + TQIconViewItem *firstItem() const; + TQIconViewItem *lastItem() const; + TQIconViewItem *currentItem() const; + virtual void setCurrentItem( TQIconViewItem *item ); + virtual void setSelected( TQIconViewItem *item, bool s, bool cb = FALSE ); + + uint count() const; + +public: + virtual void showEvent( TQShowEvent * ); + + virtual void setSelectionMode( SelectionMode m ); + SelectionMode selectionMode() const; + + TQIconViewItem *findItem( const TQPoint &pos ) const; + TQIconViewItem *findItem( const TQString &text, ComparisonFlags compare = BeginsWith ) const; + virtual void selectAll( bool select ); + virtual void clearSelection(); + virtual void invertSelection(); + + virtual void repaintItem( TQIconViewItem *item ); + void repaintSelectedItems(); + + void ensureItemVisible( TQIconViewItem *item ); + TQIconViewItem* findFirstVisibleItem( const TQRect &r ) const; + TQIconViewItem* findLastVisibleItem( const TQRect &r ) const; + + virtual void clear(); + + virtual void setGridX( int rx ); + virtual void setGridY( int ry ); + int gridX() const; + int gridY() const; + virtual void setSpacing( int sp ); + int spacing() const; + virtual void setItemTextPos( ItemTextPos pos ); + ItemTextPos itemTextPos() const; + virtual void setItemTextBackground( const TQBrush &b ); + TQBrush itemTextBackground() const; + virtual void setArrangement( Arrangement am ); + Arrangement arrangement() const; + virtual void setResizeMode( ResizeMode am ); + ResizeMode resizeMode() const; + virtual void setMaxItemWidth( int w ); + int maxItemWidth() const; + virtual void setMaxItemTextLength( int w ); + int maxItemTextLength() const; + virtual void setAutoArrange( bool b ); + bool autoArrange() const; + virtual void setShowToolTips( bool b ); + bool showToolTips() const; + + void setSorting( bool sort, bool ascending = TRUE ); + bool sorting() const; + bool sortDirection() const; + + virtual void setItemsMovable( bool b ); + bool itemsMovable() const; + virtual void setWordWrapIconText( bool b ); + bool wordWrapIconText() const; + + bool eventFilter( TQObject * o, TQEvent * ); + + TQSize minimumSizeHint() const; + TQSize sizeHint() const; + + virtual void sort( bool ascending = TRUE ); + + virtual void setFont( const TQFont & ); + virtual void setPalette( const TQPalette & ); + + bool isRenaming() const; + +public slots: + virtual void arrangeItemsInGrid( const TQSize &grid, bool update = TRUE ); + virtual void arrangeItemsInGrid( bool update = TRUE ); + virtual void setContentsPos( int x, int y ); + virtual void updateContents(); + +signals: + void selectionChanged(); + void selectionChanged( TQIconViewItem *item ); + void currentChanged( TQIconViewItem *item ); + void clicked( TQIconViewItem * ); + void clicked( TQIconViewItem *, const TQPoint & ); + void pressed( TQIconViewItem * ); + void pressed( TQIconViewItem *, const TQPoint & ); + + void doubleClicked( TQIconViewItem *item ); + void returnPressed( TQIconViewItem *item ); + void rightButtonClicked( TQIconViewItem* item, const TQPoint& pos ); + void rightButtonPressed( TQIconViewItem* item, const TQPoint& pos ); + void mouseButtonPressed( int button, TQIconViewItem* item, const TQPoint& pos ); + void mouseButtonClicked( int button, TQIconViewItem* item, const TQPoint& pos ); + void contextMenuRequested( TQIconViewItem* item, const TQPoint &pos ); + +#ifndef QT_NO_DRAGANDDROP + void dropped( TQDropEvent *e, const TQValueList &lst ); +#endif + void moved(); + void onItem( TQIconViewItem *item ); + void onViewport(); + void itemRenamed( TQIconViewItem *item, const TQString & ); + void itemRenamed( TQIconViewItem *item ); + +protected slots: + virtual void doAutoScroll(); + virtual void adjustItems(); + virtual void slotUpdate(); + +private slots: + void movedContents( int dx, int dy ); + +protected: + void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); + void contentsMousePressEvent( TQMouseEvent *e ); + void contentsMouseReleaseEvent( TQMouseEvent *e ); + void contentsMouseMoveEvent( TQMouseEvent *e ); + void contentsMouseDoubleClickEvent( TQMouseEvent *e ); + void contentsContextMenuEvent( TQContextMenuEvent *e ); + +#ifndef QT_NO_DRAGANDDROP + void contentsDragEnterEvent( TQDragEnterEvent *e ); + void contentsDragMoveEvent( TQDragMoveEvent *e ); + void contentsDragLeaveEvent( TQDragLeaveEvent *e ); + void contentsDropEvent( TQDropEvent *e ); +#endif + + void resizeEvent( TQResizeEvent* e ); + void keyPressEvent( TQKeyEvent *e ); + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); + void enterEvent( TQEvent *e ); + + virtual void drawRubber( TQPainter *p ); +#ifndef QT_NO_DRAGANDDROP + virtual TQDragObject *dragObject(); + virtual void startDrag(); +#endif + virtual void insertInGrid( TQIconViewItem *item ); + virtual void drawBackground( TQPainter *p, const TQRect &r ); + + void emitSelectionChanged( TQIconViewItem * i = 0 ); + void emitRenamed( TQIconViewItem *item ); + + TQIconViewItem *makeRowLayout( TQIconViewItem *begin, int &y, bool &changed ); + + void styleChange( TQStyle& ); + void windowActivationChange( bool ); + +private: + void contentsMousePressEventEx( TQMouseEvent *e ); + virtual void drawDragShapes( const TQPoint &pnt ); +#ifndef QT_NO_DRAGANDDROP + virtual void initDragEnter( TQDropEvent *e ); +#endif + void drawContents( TQPainter* ); + TQIconViewItem* findItemByName( TQIconViewItem *start ); + void handleItemChange( TQIconViewItem *old, bool shift, + bool control, bool homeend = FALSE); + + int calcGridNum( int w, int x ) const; + TQIconViewItem *rowBegin( TQIconViewItem *item ) const; + void updateItemContainer( TQIconViewItem *item ); + void appendItemContainer(); + void rebuildContainers(); + enum Direction { + DirUp = 0, + DirDown, + DirLeft, + DirRight + }; + TQIconViewItem* findItem( Direction dir, + const TQPoint &relativeTo, + const TQRect &searchRect ) const; + bool neighbourItem( Direction dir, + const TQPoint &relativeTo, + const TQIconViewItem *item ) const; + TQBitmap mask( TQPixmap *pix ) const; + + TQIconViewPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQIconView( const TQIconView & ); + TQIconView& operator=( const TQIconView & ); +#endif +}; + +#endif // QT_NO_ICONVIEW + +#endif // TQICONVIEW_H diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp index 4efbb0717..fbcf3316b 100644 --- a/src/iconview/qiconview.cpp +++ b/src/iconview/qiconview.cpp @@ -38,39 +38,39 @@ ** **********************************************************************/ -#include "qglobal.h" +#include "ntqglobal.h" #if defined(Q_CC_BOR) // needed for qsort() because of a std namespace problem on Borland #include "qplatformdefs.h" #endif -#include "qiconview.h" +#include "ntqiconview.h" #ifndef QT_NO_ICONVIEW -#include "qfontmetrics.h" -#include "qpainter.h" -#include "qevent.h" -#include "qpalette.h" -#include "qmime.h" -#include "qimage.h" -#include "qpen.h" -#include "qbrush.h" -#include "qtimer.h" -#include "qcursor.h" -#include "qapplication.h" -#include "qtextedit.h" -#include "qmemarray.h" -#include "qptrlist.h" -#include "qvbox.h" -#include "qtooltip.h" -#include "qbitmap.h" -#include "qpixmapcache.h" -#include "qptrdict.h" -#include "qstringlist.h" -#include "qcleanuphandler.h" +#include "ntqfontmetrics.h" +#include "ntqpainter.h" +#include "ntqevent.h" +#include "ntqpalette.h" +#include "ntqmime.h" +#include "ntqimage.h" +#include "ntqpen.h" +#include "ntqbrush.h" +#include "ntqtimer.h" +#include "ntqcursor.h" +#include "ntqapplication.h" +#include "ntqtextedit.h" +#include "ntqmemarray.h" +#include "ntqptrlist.h" +#include "ntqvbox.h" +#include "ntqtooltip.h" +#include "ntqbitmap.h" +#include "ntqpixmapcache.h" +#include "ntqptrdict.h" +#include "ntqstringlist.h" +#include "ntqcleanuphandler.h" #include "private/qrichtext_p.h" -#include "qstyle.h" +#include "ntqstyle.h" #include #include @@ -499,7 +499,7 @@ void TQIconViewItemLineEdit::focusOutEvent( TQFocusEvent *e ) /*! - \class TQIconDragItem qiconview.h + \class TQIconDragItem ntqiconview.h \ingroup draganddrop \brief The TQIconDragItem class encapsulates a drag item. @@ -587,7 +587,7 @@ bool TQIconDragData::operator==( const TQIconDragData &i ) const /*! - \class TQIconDrag qiconview.h + \class TQIconDrag ntqiconview.h \brief The TQIconDrag class supports drag and drop operations within a TQIconView. @@ -802,7 +802,7 @@ void TQIconDragData::setTextRect( const TQRect &r ) /*! - \class TQIconViewItem qiconview.h + \class TQIconViewItem ntqiconview.h \brief The TQIconViewItem class provides a single item in a TQIconView. \ingroup advanced @@ -2294,7 +2294,7 @@ void TQIconViewItem::checkRect() /*! - \class TQIconView qiconview.h + \class TQIconView ntqiconview.h \brief The TQIconView class provides an area with movable labelled icons. \module iconview diff --git a/src/iconview/qiconview.h b/src/iconview/qiconview.h deleted file mode 100644 index ee8bbd267..000000000 --- a/src/iconview/qiconview.h +++ /dev/null @@ -1,518 +0,0 @@ -/**************************************************************************** -** -** Definition of TQIconView widget class -** -** Created : 990707 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the iconview module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQICONVIEW_H -#define TQICONVIEW_H - -#ifndef QT_H -#include "qscrollview.h" -#include "qstring.h" -#include "qrect.h" -#include "qpoint.h" -#include "qsize.h" -#include "qfont.h" // TQString->TQFont conversion -#include "qdragobject.h" -#include "qbitmap.h" -#include "qpicture.h" -#endif // QT_H - -#ifndef QT_NO_ICONVIEW - -#if !defined( QT_MODULE_ICONVIEW ) || defined( QT_INTERNAL_ICONVIEW ) -#define TQM_EXPORT_ICONVIEW -#else -#define TQM_EXPORT_ICONVIEW Q_EXPORT -#endif - -class TQIconView; -class TQPainter; -class TQMimeSource; -class TQMouseEvent; -class TQDragEnterEvent; -class TQDragMoveEvent; -class TQDragLeaveEvent; -class TQKeyEvent; -class TQFocusEvent; -class TQShowEvent; -class TQIconViewItem; -class TQIconViewItemLineEdit; -class TQStringList; -class TQIconDragPrivate; - -#ifndef QT_NO_DRAGANDDROP - -class TQM_EXPORT_ICONVIEW TQIconDragItem -{ -public: - TQIconDragItem(); - virtual ~TQIconDragItem(); - virtual TQByteArray data() const; - virtual void setData( const TQByteArray &d ); - bool operator== ( const TQIconDragItem& ) const; - -private: - TQByteArray ba; - -}; - -class TQM_EXPORT_ICONVIEW TQIconDrag : public TQDragObject -{ - Q_OBJECT -public: - TQIconDrag( TQWidget * dragSource, const char* name = 0 ); - virtual ~TQIconDrag(); - - void append( const TQIconDragItem &item, const TQRect &pr, const TQRect &tr ); - - virtual const char* format( int i ) const; - static bool canDecode( TQMimeSource* e ); - virtual TQByteArray encodedData( const char* mime ) const; - -private: - TQIconDragPrivate *d; - TQChar endMark; - - friend class TQIconView; - friend class TQIconViewPrivate; -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQIconDrag( const TQIconDrag & ); - TQIconDrag &operator=( const TQIconDrag & ); -#endif -}; - -#endif - -class TQIconViewToolTip; -class TQIconViewItemPrivate; - -class TQM_EXPORT_ICONVIEW TQIconViewItem : public TQt -{ - friend class TQIconView; - friend class TQIconViewToolTip; - friend class TQIconViewItemLineEdit; - -public: - TQIconViewItem( TQIconView *parent ); - TQIconViewItem( TQIconView *parent, TQIconViewItem *after ); - TQIconViewItem( TQIconView *parent, const TQString &text ); - TQIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text ); - TQIconViewItem( TQIconView *parent, const TQString &text, const TQPixmap &icon ); - TQIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text, const TQPixmap &icon ); -#ifndef QT_NO_PICTURE - TQIconViewItem( TQIconView *parent, const TQString &text, const TQPicture &picture ); - TQIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text, const TQPicture &picture ); -#endif - virtual ~TQIconViewItem(); - - virtual void setRenameEnabled( bool allow ); - virtual void setDragEnabled( bool allow ); - virtual void setDropEnabled( bool allow ); - - virtual TQString text() const; - virtual TQPixmap *pixmap() const; -#ifndef QT_NO_PICTURE - virtual TQPicture *picture() const; -#endif - 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 s, bool cb ); - virtual void setSelected( bool s ); - virtual void setSelectable( bool s ); - - bool isSelected() const; - bool isSelectable() const; - - void setVisible( bool b ); - bool isVisible() const; - - virtual void repaint(); - - virtual bool move( int x, int y ); - virtual void moveBy( int dx, int dy ); - virtual bool move( const TQPoint &pnt ); - virtual void moveBy( const TQPoint &pnt ); - - TQRect rect() const; - int x() const; - int y() const; - int width() const; - int height() const; - TQSize size() const; - TQPoint pos() const; - TQRect textRect( bool relative = TRUE ) const; - TQRect pixmapRect( bool relative = TRUE ) const; - bool contains( const TQPoint& pnt ) const; - bool intersects( const TQRect& r ) const; - - virtual bool acceptDrop( const TQMimeSource *mime ) const; - -#ifndef QT_NO_TEXTEDIT - void rename(); -#endif - - virtual int compare( TQIconViewItem *i ) const; - - virtual void setText( const TQString &text ); - virtual void setPixmap( const TQPixmap &icon ); -#ifndef QT_NO_PICTURE - virtual void setPicture( const TQPicture &icon ); -#endif - virtual void setText( const TQString &text, bool recalc, bool redraw = TRUE ); - virtual void setPixmap( const TQPixmap &icon, bool recalc, bool redraw = TRUE ); - virtual void setKey( const TQString &k ); - - virtual int rtti() const; - static int RTTI; - -protected: -#ifndef QT_NO_TEXTEDIT - virtual void removeRenameBox(); -#endif - virtual void calcRect( const TQString &text_ = TQString::null ); - virtual void paintItem( TQPainter *p, const TQColorGroup &cg ); - virtual void paintFocus( TQPainter *p, const TQColorGroup &cg ); -#ifndef QT_NO_DRAGANDDROP - virtual void dropped( TQDropEvent *e, const TQValueList &lst ); -#endif - virtual void dragEntered(); - virtual void dragLeft(); - void setItemRect( const TQRect &r ); - void setTextRect( const TQRect &r ); - void setPixmapRect( const TQRect &r ); - void calcTmpText(); - TQString tempText() const; - -private: - void init( TQIconViewItem *after = 0 -#ifndef QT_NO_PICTURE - , TQPicture *pic = 0 -#endif - ); -#ifndef QT_NO_TEXTEDIT - void renameItem(); - void cancelRenameItem(); -#endif - void checkRect(); - - TQIconView *view; - TQString itemText, itemKey; - TQString tmpText; - TQPixmap *itemIcon; -#ifndef QT_NO_PICTURE - TQPicture *itemPic; -#endif - TQIconViewItem *prev, *next; - uint allow_rename : 1; - uint allow_drag : 1; - uint allow_drop : 1; - uint visible : 1; - uint selected : 1; - uint selectable : 1; - uint dirty : 1; - uint wordWrapDirty : 1; - TQRect itemRect, itemTextRect, itemIconRect; -#ifndef QT_NO_TEXTEDIT - TQIconViewItemLineEdit *renameBox; -#endif - TQRect oldRect; - - TQIconViewItemPrivate *d; - -}; - -class TQIconViewPrivate; /* don't touch */ - -class TQM_EXPORT_ICONVIEW TQIconView : public TQScrollView -{ - friend class TQIconViewItem; - friend class TQIconViewPrivate; - friend class TQIconViewToolTip; - - Q_OBJECT - // #### sorting and sort direction do not work - Q_ENUMS( SelectionMode ItemTextPos Arrangement ResizeMode ) - Q_PROPERTY( bool sorting READ sorting ) - Q_PROPERTY( bool sortDirection READ sortDirection ) - Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) - Q_PROPERTY( int gridX READ gridX WRITE setGridX ) - Q_PROPERTY( int gridY READ gridY WRITE setGridY ) - Q_PROPERTY( int spacing READ spacing WRITE setSpacing ) - Q_PROPERTY( ItemTextPos itemTextPos READ itemTextPos WRITE setItemTextPos ) - Q_PROPERTY( TQBrush itemTextBackground READ itemTextBackground WRITE setItemTextBackground ) - Q_PROPERTY( Arrangement arrangement READ arrangement WRITE setArrangement ) - Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode ) - Q_PROPERTY( int maxItemWidth READ maxItemWidth WRITE setMaxItemWidth ) - Q_PROPERTY( int maxItemTextLength READ maxItemTextLength WRITE setMaxItemTextLength ) - Q_PROPERTY( bool autoArrange READ autoArrange WRITE setAutoArrange ) - Q_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable ) - Q_PROPERTY( bool wordWrapIconText READ wordWrapIconText WRITE setWordWrapIconText ) - Q_PROPERTY( bool showToolTips READ showToolTips WRITE setShowToolTips ) - Q_PROPERTY( uint count READ count ) - -public: - enum SelectionMode { - Single = 0, - Multi, - Extended, - NoSelection - }; - enum Arrangement { - LeftToRight = 0, - TopToBottom - }; - enum ResizeMode { - Fixed = 0, - Adjust - }; - enum ItemTextPos { - Bottom = 0, - Right - }; - - TQIconView( TQWidget* parent=0, const char* name=0, WFlags f = 0 ); - virtual ~TQIconView(); - - virtual void insertItem( TQIconViewItem *item, TQIconViewItem *after = 0L ); - virtual void takeItem( TQIconViewItem *item ); - - int index( const TQIconViewItem *item ) const; - - TQIconViewItem *firstItem() const; - TQIconViewItem *lastItem() const; - TQIconViewItem *currentItem() const; - virtual void setCurrentItem( TQIconViewItem *item ); - virtual void setSelected( TQIconViewItem *item, bool s, bool cb = FALSE ); - - uint count() const; - -public: - virtual void showEvent( TQShowEvent * ); - - virtual void setSelectionMode( SelectionMode m ); - SelectionMode selectionMode() const; - - TQIconViewItem *findItem( const TQPoint &pos ) const; - TQIconViewItem *findItem( const TQString &text, ComparisonFlags compare = BeginsWith ) const; - virtual void selectAll( bool select ); - virtual void clearSelection(); - virtual void invertSelection(); - - virtual void repaintItem( TQIconViewItem *item ); - void repaintSelectedItems(); - - void ensureItemVisible( TQIconViewItem *item ); - TQIconViewItem* findFirstVisibleItem( const TQRect &r ) const; - TQIconViewItem* findLastVisibleItem( const TQRect &r ) const; - - virtual void clear(); - - virtual void setGridX( int rx ); - virtual void setGridY( int ry ); - int gridX() const; - int gridY() const; - virtual void setSpacing( int sp ); - int spacing() const; - virtual void setItemTextPos( ItemTextPos pos ); - ItemTextPos itemTextPos() const; - virtual void setItemTextBackground( const TQBrush &b ); - TQBrush itemTextBackground() const; - virtual void setArrangement( Arrangement am ); - Arrangement arrangement() const; - virtual void setResizeMode( ResizeMode am ); - ResizeMode resizeMode() const; - virtual void setMaxItemWidth( int w ); - int maxItemWidth() const; - virtual void setMaxItemTextLength( int w ); - int maxItemTextLength() const; - virtual void setAutoArrange( bool b ); - bool autoArrange() const; - virtual void setShowToolTips( bool b ); - bool showToolTips() const; - - void setSorting( bool sort, bool ascending = TRUE ); - bool sorting() const; - bool sortDirection() const; - - virtual void setItemsMovable( bool b ); - bool itemsMovable() const; - virtual void setWordWrapIconText( bool b ); - bool wordWrapIconText() const; - - bool eventFilter( TQObject * o, TQEvent * ); - - TQSize minimumSizeHint() const; - TQSize sizeHint() const; - - virtual void sort( bool ascending = TRUE ); - - virtual void setFont( const TQFont & ); - virtual void setPalette( const TQPalette & ); - - bool isRenaming() const; - -public slots: - virtual void arrangeItemsInGrid( const TQSize &grid, bool update = TRUE ); - virtual void arrangeItemsInGrid( bool update = TRUE ); - virtual void setContentsPos( int x, int y ); - virtual void updateContents(); - -signals: - void selectionChanged(); - void selectionChanged( TQIconViewItem *item ); - void currentChanged( TQIconViewItem *item ); - void clicked( TQIconViewItem * ); - void clicked( TQIconViewItem *, const TQPoint & ); - void pressed( TQIconViewItem * ); - void pressed( TQIconViewItem *, const TQPoint & ); - - void doubleClicked( TQIconViewItem *item ); - void returnPressed( TQIconViewItem *item ); - void rightButtonClicked( TQIconViewItem* item, const TQPoint& pos ); - void rightButtonPressed( TQIconViewItem* item, const TQPoint& pos ); - void mouseButtonPressed( int button, TQIconViewItem* item, const TQPoint& pos ); - void mouseButtonClicked( int button, TQIconViewItem* item, const TQPoint& pos ); - void contextMenuRequested( TQIconViewItem* item, const TQPoint &pos ); - -#ifndef QT_NO_DRAGANDDROP - void dropped( TQDropEvent *e, const TQValueList &lst ); -#endif - void moved(); - void onItem( TQIconViewItem *item ); - void onViewport(); - void itemRenamed( TQIconViewItem *item, const TQString & ); - void itemRenamed( TQIconViewItem *item ); - -protected slots: - virtual void doAutoScroll(); - virtual void adjustItems(); - virtual void slotUpdate(); - -private slots: - void movedContents( int dx, int dy ); - -protected: - void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); - void contentsMousePressEvent( TQMouseEvent *e ); - void contentsMouseReleaseEvent( TQMouseEvent *e ); - void contentsMouseMoveEvent( TQMouseEvent *e ); - void contentsMouseDoubleClickEvent( TQMouseEvent *e ); - void contentsContextMenuEvent( TQContextMenuEvent *e ); - -#ifndef QT_NO_DRAGANDDROP - void contentsDragEnterEvent( TQDragEnterEvent *e ); - void contentsDragMoveEvent( TQDragMoveEvent *e ); - void contentsDragLeaveEvent( TQDragLeaveEvent *e ); - void contentsDropEvent( TQDropEvent *e ); -#endif - - void resizeEvent( TQResizeEvent* e ); - void keyPressEvent( TQKeyEvent *e ); - void focusInEvent( TQFocusEvent *e ); - void focusOutEvent( TQFocusEvent *e ); - void enterEvent( TQEvent *e ); - - virtual void drawRubber( TQPainter *p ); -#ifndef QT_NO_DRAGANDDROP - virtual TQDragObject *dragObject(); - virtual void startDrag(); -#endif - virtual void insertInGrid( TQIconViewItem *item ); - virtual void drawBackground( TQPainter *p, const TQRect &r ); - - void emitSelectionChanged( TQIconViewItem * i = 0 ); - void emitRenamed( TQIconViewItem *item ); - - TQIconViewItem *makeRowLayout( TQIconViewItem *begin, int &y, bool &changed ); - - void styleChange( TQStyle& ); - void windowActivationChange( bool ); - -private: - void contentsMousePressEventEx( TQMouseEvent *e ); - virtual void drawDragShapes( const TQPoint &pnt ); -#ifndef QT_NO_DRAGANDDROP - virtual void initDragEnter( TQDropEvent *e ); -#endif - void drawContents( TQPainter* ); - TQIconViewItem* findItemByName( TQIconViewItem *start ); - void handleItemChange( TQIconViewItem *old, bool shift, - bool control, bool homeend = FALSE); - - int calcGridNum( int w, int x ) const; - TQIconViewItem *rowBegin( TQIconViewItem *item ) const; - void updateItemContainer( TQIconViewItem *item ); - void appendItemContainer(); - void rebuildContainers(); - enum Direction { - DirUp = 0, - DirDown, - DirLeft, - DirRight - }; - TQIconViewItem* findItem( Direction dir, - const TQPoint &relativeTo, - const TQRect &searchRect ) const; - bool neighbourItem( Direction dir, - const TQPoint &relativeTo, - const TQIconViewItem *item ) const; - TQBitmap mask( TQPixmap *pix ) const; - - TQIconViewPrivate *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQIconView( const TQIconView & ); - TQIconView& operator=( const TQIconView & ); -#endif -}; - -#endif // QT_NO_ICONVIEW - -#endif // TQICONVIEW_H diff --git a/src/iconview/qt_iconview.pri b/src/iconview/qt_iconview.pri index 198885ed7..df1613b5d 100644 --- a/src/iconview/qt_iconview.pri +++ b/src/iconview/qt_iconview.pri @@ -1,6 +1,6 @@ # Qt iconview module iconview { - HEADERS += $$ICONVIEW_H/qiconview.h + HEADERS += $$ICONVIEW_H/ntqiconview.h SOURCES += $$ICONVIEW_CPP/qiconview.cpp } diff --git a/src/inputmethod/ntqinputcontextfactory.h b/src/inputmethod/ntqinputcontextfactory.h new file mode 100644 index 000000000..29ecda7f3 --- /dev/null +++ b/src/inputmethod/ntqinputcontextfactory.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** $Id: ntqinputcontextfactory.h,v 1.1.1.1 2004/05/11 11:16:49 daisuke Exp $ +** +** Definition of TQInputContextFactory class +** +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef TQINPUTCONTEXTFACTORY_H +#define TQINPUTCONTEXTFACTORY_H + +#ifndef QT_H +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_IM + +class TQInputContext; +class TQWidget; + +class Q_EXPORT TQInputContextFactory +{ +public: + static TQStringList keys(); + static TQInputContext *create( const TQString &key, TQWidget *widget ); // should be a toplevel widget + static TQStringList languages( const TQString &key ); + static TQString displayName( const TQString &key ); + static TQString description( const TQString &key ); +}; +#endif //QT_NO_IM + +#endif //TQINPUTCONTEXTFACTORY_H diff --git a/src/inputmethod/ntqinputcontextplugin.h b/src/inputmethod/ntqinputcontextplugin.h new file mode 100644 index 000000000..92875c52e --- /dev/null +++ b/src/inputmethod/ntqinputcontextplugin.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** $Id: ntqinputcontextplugin.h,v 1.2 2004/06/20 18:43:11 daisuke Exp $ +** +** Definition of TQInputContextPlugin class +** +** Created : 010920 +** +** Copyright (C) 2001 Trolltech AS. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef TQINPUTCONTEXTPLUGIN_H +#define TQINPUTCONTEXTPLUGIN_H + +#ifndef QT_H +#include "ntqgplugin.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_IM +class TQInputContext; +class TQInputContextPluginPrivate; + +class Q_EXPORT TQInputContextPlugin : public TQGPlugin +{ + Q_OBJECT +public: + TQInputContextPlugin(); + ~TQInputContextPlugin(); + + virtual TQStringList keys() const = 0; + virtual TQInputContext *create( const TQString &key ) = 0; + virtual TQStringList languages( const TQString &key ) = 0; + virtual TQString displayName( const TQString &key ) = 0; + virtual TQString description( const TQString &key ) = 0; + +private: + TQInputContextPluginPrivate *d; +}; +#endif // QT_NO_IM +#endif // TQINPUTCONTEXTPLUGIN_H diff --git a/src/inputmethod/qinputcontextfactory.cpp b/src/inputmethod/qinputcontextfactory.cpp index a1ac4f35d..ae4391525 100644 --- a/src/inputmethod/qinputcontextfactory.cpp +++ b/src/inputmethod/qinputcontextfactory.cpp @@ -36,12 +36,12 @@ **********************************************************************/ #include "qinputcontextinterface_p.h" // up here for GCC 2.7.* compatibility -#include "qinputcontextfactory.h" -#include "qinputcontext.h" +#include "ntqinputcontextfactory.h" +#include "ntqinputcontext.h" #ifndef QT_NO_IM -#include "qapplication.h" +#include "ntqapplication.h" #ifdef QT_THREAD_SUPPORT #include @@ -49,7 +49,7 @@ #include -#include "qcleanuphandler.h" +#include "ntqcleanuphandler.h" #include #ifndef QT_NO_COMPONENT diff --git a/src/inputmethod/qinputcontextfactory.h b/src/inputmethod/qinputcontextfactory.h deleted file mode 100644 index 515593fe8..000000000 --- a/src/inputmethod/qinputcontextfactory.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** $Id: qinputcontextfactory.h,v 1.1.1.1 2004/05/11 11:16:49 daisuke Exp $ -** -** Definition of TQInputContextFactory class -** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition -** licenses may use this file in accordance with the TQt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about TQt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for TQPL licensing information. -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef TQINPUTCONTEXTFACTORY_H -#define TQINPUTCONTEXTFACTORY_H - -#ifndef QT_H -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_IM - -class TQInputContext; -class TQWidget; - -class Q_EXPORT TQInputContextFactory -{ -public: - static TQStringList keys(); - static TQInputContext *create( const TQString &key, TQWidget *widget ); // should be a toplevel widget - static TQStringList languages( const TQString &key ); - static TQString displayName( const TQString &key ); - static TQString description( const TQString &key ); -}; -#endif //QT_NO_IM - -#endif //TQINPUTCONTEXTFACTORY_H diff --git a/src/inputmethod/qinputcontextplugin.cpp b/src/inputmethod/qinputcontextplugin.cpp index fa34e07e9..3b474d2ff 100644 --- a/src/inputmethod/qinputcontextplugin.cpp +++ b/src/inputmethod/qinputcontextplugin.cpp @@ -35,7 +35,7 @@ ** **********************************************************************/ -#include "qinputcontextplugin.h" +#include "ntqinputcontextplugin.h" #ifndef QT_NO_IM #ifndef QT_NO_COMPONENT @@ -43,7 +43,7 @@ #include "qinputcontextinterface_p.h" /*! - \class TQInputContextPlugin qinputcontextplugin.h + \class TQInputContextPlugin ntqinputcontextplugin.h \brief The TQInputContextPlugin class provides an abstract base for custom TQInputContext plugins. \reentrant \ingroup plugins diff --git a/src/inputmethod/qinputcontextplugin.h b/src/inputmethod/qinputcontextplugin.h deleted file mode 100644 index e54f54cc3..000000000 --- a/src/inputmethod/qinputcontextplugin.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** $Id: qinputcontextplugin.h,v 1.2 2004/06/20 18:43:11 daisuke Exp $ -** -** Definition of TQInputContextPlugin class -** -** Created : 010920 -** -** Copyright (C) 2001 Trolltech AS. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition -** licenses may use this file in accordance with the TQt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about TQt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for TQPL licensing information. -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef TQINPUTCONTEXTPLUGIN_H -#define TQINPUTCONTEXTPLUGIN_H - -#ifndef QT_H -#include "qgplugin.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_IM -class TQInputContext; -class TQInputContextPluginPrivate; - -class Q_EXPORT TQInputContextPlugin : public TQGPlugin -{ - Q_OBJECT -public: - TQInputContextPlugin(); - ~TQInputContextPlugin(); - - virtual TQStringList keys() const = 0; - virtual TQInputContext *create( const TQString &key ) = 0; - virtual TQStringList languages( const TQString &key ) = 0; - virtual TQString displayName( const TQString &key ) = 0; - virtual TQString description( const TQString &key ) = 0; - -private: - TQInputContextPluginPrivate *d; -}; -#endif // QT_NO_IM -#endif // TQINPUTCONTEXTPLUGIN_H diff --git a/src/inputmethod/qt_inputmethod.pri b/src/inputmethod/qt_inputmethod.pri index d9ac32aec..202bba267 100644 --- a/src/inputmethod/qt_inputmethod.pri +++ b/src/inputmethod/qt_inputmethod.pri @@ -2,9 +2,9 @@ inputmethod { INPUTMETHOD_P = inputmethod - HEADERS +=$$INPUTMETHOD_H/qinputcontextfactory.h \ + HEADERS +=$$INPUTMETHOD_H/ntqinputcontextfactory.h \ $$INPUTMETHOD_P/qinputcontextinterface_p.h \ - $$INPUTMETHOD_H/qinputcontextplugin.h + $$INPUTMETHOD_H/ntqinputcontextplugin.h SOURCES +=$$INPUTMETHOD_CPP/qinputcontextfactory.cpp \ $$INPUTMETHOD_CPP/qinputcontextplugin.cpp } diff --git a/src/kernel/ntq1xcompatibility.h b/src/kernel/ntq1xcompatibility.h new file mode 100644 index 000000000..8ace504b5 --- /dev/null +++ b/src/kernel/ntq1xcompatibility.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Various macros etc. to ease porting from TQt 1.x to 2.0. THIS FILE +** WILL CHANGE OR DISAPPEAR IN THE NEXT VERSION OF TQt. +** +** Created : 980824 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef Q1XCOMPATIBILITY_H +#define Q1XCOMPATIBILITY_H + +#error "Compatibility with TQt 1.x is no longer guaranteed. Please" +#error "update your code (for example using qt20fix script). We" +#error "apologize for any inconvenience." + +#endif // Q1XCOMPATIBILITY_H diff --git a/src/kernel/ntqabstractlayout.h b/src/kernel/ntqabstractlayout.h new file mode 100644 index 000000000..88a0eeff9 --- /dev/null +++ b/src/kernel/ntqabstractlayout.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Definition of layout classes +** +** Created : 960416 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQABSTRACTLAYOUT_H +#define TQABSTRACTLAYOUT_H + +/* + This header is provided for source compatibility only. +*/ + +#ifndef QT_H +#ifndef QT_NO_COMPAT +#include "ntqlayout.h" +#endif +#endif // QT_H + +#endif diff --git a/src/kernel/ntqaccel.h b/src/kernel/ntqaccel.h new file mode 100644 index 000000000..717d2acef --- /dev/null +++ b/src/kernel/ntqaccel.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Definition of TQAccel class +** +** Created : 950419 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQACCEL_H +#define TQACCEL_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqkeysequence.h" +#endif // QT_H + +#ifndef QT_NO_ACCEL + +class TQAccelPrivate; + +class Q_EXPORT TQAccel : public TQObject // accelerator class +{ + Q_OBJECT +public: + TQAccel( TQWidget *parent, const char *name=0 ); + TQAccel( TQWidget* watch, TQObject *parent, const char *name=0 ); + ~TQAccel(); + + bool isEnabled() const; + void setEnabled( bool ); + + uint count() const; + + int insertItem( const TQKeySequence& key, int id=-1); + void removeItem( int id ); + void clear(); + + TQKeySequence key( int id ); + int findKey( const TQKeySequence& key ) const; + + bool isItemEnabled( int id ) const; + void setItemEnabled( int id, bool enable ); + + bool connectItem( int id, const TQObject *receiver, const char* member ); + bool disconnectItem( int id, const TQObject *receiver, const char* member ); + + void repairEventFilter(); + + void setWhatsThis( int id, const TQString& ); + TQString whatsThis( int id ) const; + void setIgnoreWhatsThis( bool ); + bool ignoreWhatsThis() const; + + static TQKeySequence shortcutKey( const TQString & ); + static TQString keyToString(TQKeySequence k ); + static TQKeySequence stringToKey( const TQString & ); + +signals: + void activated( int id ); + void activatedAmbiguously( int id ); + +protected: + bool eventFilter( TQObject *, TQEvent * ); + +private: + TQAccelPrivate * d; + +private: +#if defined(Q_DISABLE_COPY) + TQAccel( const TQAccel & ); + TQAccel &operator=( const TQAccel & ); +#endif + friend class TQAccelPrivate; + friend class TQAccelManager; +}; + +#endif // QT_NO_ACCEL +#endif // TQACCEL_H diff --git a/src/kernel/ntqaccessible.h b/src/kernel/ntqaccessible.h new file mode 100644 index 000000000..4dccd594d --- /dev/null +++ b/src/kernel/ntqaccessible.h @@ -0,0 +1,295 @@ +/**************************************************************************** +** +** Definition of TQAccessible and TQAccessibleObject classes +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQACCESSIBLE_H +#define TQACCESSIBLE_H + +#ifndef QT_H +#include "ntqobject.h" +#include +#include "ntqrect.h" +#include "ntqguardedptr.h" +#include "ntqmemarray.h" +#endif // QT_H + +#if defined(QT_ACCESSIBILITY_SUPPORT) + +struct TQAccessibleInterface; + +class Q_EXPORT TQAccessible +{ +private: +#ifdef Q_WS_MAC + static TQMAC_PASCAL OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); + static TQObject *queryAccessibleObject(TQAccessibleInterface *); +#endif +public: + enum Event { + SoundPlayed = 0x0001, + Alert = 0x0002, + ForegroundChanged = 0x0003, + MenuStart = 0x0004, + MenuEnd = 0x0005, + PopupMenuStart = 0x0006, + PopupMenuEnd = 0x0007, + ContextHelpStart = 0x000C, + ContextHelpEnd = 0x000D, + DragDropStart = 0x000E, + DragDropEnd = 0x000F, + DialogStart = 0x0010, + DialogEnd = 0x0011, + ScrollingStart = 0x0012, + ScrollingEnd = 0x0013, + + MenuCommand = 0x0018, + + ObjectCreated = 0x8000, + ObjectDestroyed = 0x8001, + ObjectShow = 0x8002, + ObjectHide = 0x8003, + ObjectReorder = 0x8004, + Focus = 0x8005, + Selection = 0x8006, + SelectionAdd = 0x8007, + SelectionRemove = 0x8008, + SelectionWithin = 0x8009, + StateChanged = 0x800A, + LocationChanged = 0x800B, + NameChanged = 0x800C, + DescriptionChanged = 0x800D, + ValueChanged = 0x800E, + ParentChanged = 0x800F, + HelpChanged = 0x80A0, + DefaultActionChanged= 0x80B0, + AcceleratorChanged = 0x80C0 + }; + + enum State { + Normal = 0x00000000, + Unavailable = 0x00000001, + Selected = 0x00000002, + Focused = 0x00000004, + Pressed = 0x00000008, + Checked = 0x00000010, + Mixed = 0x00000020, + ReadOnly = 0x00000040, + HotTracked = 0x00000080, + Default = 0x00000100, + Expanded = 0x00000200, + Collapsed = 0x00000400, + Busy = 0x00000800, + Floating = 0x00001000, + Marqueed = 0x00002000, + Animated = 0x00004000, + Invisible = 0x00008000, + Offscreen = 0x00010000, + Sizeable = 0x00020000, + Moveable = 0x00040000, + SelfVoicing = 0x00080000, + Focusable = 0x00100000, + Selectable = 0x00200000, + Linked = 0x00400000, + Traversed = 0x00800000, + MultiSelectable = 0x01000000, + ExtSelectable = 0x02000000, + AlertLow = 0x04000000, + AlertMedium = 0x08000000, + AlertHigh = 0x10000000, + Protected = 0x20000000, + Valid = 0x3fffffff + }; + + enum Role { + NoRole = 0x00000000, + TitleBar = 0x00000001, + MenuBar = 0x00000002, + ScrollBar = 0x00000003, + Grip = 0x00000004, + Sound = 0x00000005, + Cursor = 0x00000006, + Caret = 0x00000007, + AlertMessage = 0x00000008, + Window = 0x00000009, + Client = 0x0000000A, + PopupMenu = 0x0000000B, + MenuItem = 0x0000000C, + ToolTip = 0x0000000D, + Application = 0x0000000E, + Document = 0x0000000F, + Pane = 0x00000010, + Chart = 0x00000011, + Dialog = 0x00000012, + Border = 0x00000013, + Grouping = 0x00000014, + Separator = 0x00000015, + ToolBar = 0x00000016, + StatusBar = 0x00000017, + Table = 0x00000018, + ColumnHeader = 0x00000019, + RowHeader = 0x0000001A, + Column = 0x0000001B, + Row = 0x0000001C, + Cell = 0x0000001D, + Link = 0x0000001E, + HelpBalloon = 0x0000001F, + Character = 0x00000020, + List = 0x00000021, + ListItem = 0x00000022, + Outline = 0x00000023, + OutlineItem = 0x00000024, + PageTab = 0x00000025, + PropertyPage = 0x00000026, + Indicator = 0x00000027, + Graphic = 0x00000028, + StaticText = 0x00000029, + EditableText = 0x0000002A, // Editable, selectable, etc. + PushButton = 0x0000002B, + CheckBox = 0x0000002C, + RadioButton = 0x0000002D, + ComboBox = 0x0000002E, + DropLest = 0x0000002F, + ProgressBar = 0x00000030, + Dial = 0x00000031, + HotkeyField = 0x00000032, + Slider = 0x00000033, + SpinBox = 0x00000034, + Diagram = 0x00000035, + Animation = 0x00000036, + Equation = 0x00000037, + ButtonDropDown = 0x00000038, + ButtonMenu = 0x00000039, + ButtonDropGrid = 0x0000003A, + Whitespace = 0x0000003B, + PageTabList = 0x0000003C, + Clock = 0x0000003D + }; + + enum NavDirection { + NavUp = 0x00000001, + NavDown = 0x00000002, + NavLeft = 0x00000003, + NavRight = 0x00000004, + NavNext = 0x00000005, + NavPrevious = 0x00000006, + NavFirstChild = 0x00000007, + NavLastChild = 0x00000008, + NavFocusChild = 0x00000009 + }; + + enum Text { + Name = 0, + Description, + Value, + Help, + Accelerator, + DefaultAction + }; + + static TQRESULT queryAccessibleInterface( TQObject *, TQAccessibleInterface ** ); + static void updateAccessibility( TQObject *, int who, Event reason ); + static bool isActive(); + + static void initialize(); + static void cleanup(); +}; + +// {EC86CB9C-5DA0-4c43-A739-13EBDF1C6B14} +#define IID_QAccessible TQUuid( 0xec86cb9c, 0x5da0, 0x4c43, 0xa7, 0x39, 0x13, 0xeb, 0xdf, 0x1c, 0x6b, 0x14 ) + +struct Q_EXPORT TQAccessibleInterface : public TQAccessible, public TQUnknownInterface +{ + // check for valid pointers + virtual bool isValid() const = 0; + + // hierarchy + virtual int childCount() const = 0; + virtual TQRESULT queryChild( int control, TQAccessibleInterface** ) const = 0; + virtual TQRESULT queryParent( TQAccessibleInterface** ) const = 0; + + // navigation + virtual int controlAt( int x, int y ) const = 0; + virtual TQRect rect( int control ) const = 0; + virtual int navigate( NavDirection direction, int startControl ) const = 0; + + // properties and state + virtual TQString text( Text t, int control ) const = 0; + virtual void setText( Text t, int control, const TQString &text ) = 0; + virtual Role role( int control ) const = 0; + virtual State state( int control ) const = 0; + virtual TQMemArray selection() const = 0; + + // methods + virtual bool doDefaultAction( int control ) = 0; + virtual bool setFocus( int control ) = 0; + virtual bool setSelected( int control, bool on, bool extend ) = 0; + virtual void clearSelection() = 0; +}; + +// {49F4C6A7-412F-41DE-9E24-648843421FD3} +#ifndef IID_QAccessibleFactory +#define IID_QAccessibleFactory TQUuid( 0x49f4c6a7, 0x412f, 0x41de, 0x9e, 0x24, 0x64, 0x88, 0x43, 0x42, 0x1f, 0xd3 ) +#endif + +struct Q_EXPORT TQAccessibleFactoryInterface : public TQAccessible, public TQFeatureListInterface +{ + virtual TQRESULT createAccessibleInterface( const TQString &, TQObject *, TQAccessibleInterface** ) = 0; +}; + +class Q_EXPORT TQAccessibleObject : public TQObject, public TQAccessibleInterface +{ +public: + TQAccessibleObject( TQObject *object ); + virtual ~TQAccessibleObject(); + + TQRESULT queryInterface( const TQUuid &, TQUnknownInterface** ); + Q_REFCOUNT + + bool isValid() const; + +protected: + TQObject *object() const; + +private: + TQGuardedPtr object_; +}; + +#define Q_DEFINED_QACCESSIBLE_OBJECT +#include "ntqwinexport.h" +#endif //QT_ACCESSIBILITY_SUPPORT + +#endif //TQACCESSIBLE_H diff --git a/src/kernel/ntqapplication.h b/src/kernel/ntqapplication.h new file mode 100644 index 000000000..2ab779760 --- /dev/null +++ b/src/kernel/ntqapplication.h @@ -0,0 +1,555 @@ +/**************************************************************************** +** +** Definition of TQApplication class +** +** Created : 931107 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQAPPLICATION_H +#define TQAPPLICATION_H + +#ifndef QT_H +#include "ntqdesktopwidget.h" +#include "ntqasciidict.h" +#include "ntqpalette.h" +#include "ntqtranslator.h" +#include "ntqstrlist.h" +#include "ntqstringlist.h" +#endif // QT_H + +class TQSessionManager; +class TQStyle; +class TQTranslator; +class TQEventLoop; +#if defined(Q_WS_X11) +class TQIMEvent; +#endif +#if defined(Q_WS_QWS) +class TQWSDecoration; +#endif + +#ifdef QT_THREAD_SUPPORT +class TQMutex; +#endif // QT_THREAD_SUPPORT + + +class TQApplication; +extern Q_EXPORT TQApplication *qApp; // global application object + + +class Q_EXPORT TQApplication : public TQObject +{ + Q_OBJECT +public: + TQApplication( int &argc, char **argv ); + TQApplication( int &argc, char **argv, bool GUIenabled ); + enum Type { Tty, GuiClient, GuiServer }; + TQApplication( int &argc, char **argv, Type ); +#if defined(Q_WS_X11) + TQApplication( Display* dpy, HANDLE visual = 0, HANDLE cmap = 0 ); + TQApplication( Display *dpy, int argc, char **argv, + HANDLE visual = 0, HANDLE cmap= 0 ); +#endif + virtual ~TQApplication(); + + int argc() const; + char **argv() const; + + Type type() const; + +#ifndef QT_NO_STYLE + static TQStyle &style(); + static void setStyle( TQStyle* ); + static TQStyle* setStyle( const TQString& ); +#endif +#ifndef Q_QDOC + enum ColorMode { NormalColors, CustomColors }; + static ColorMode colorMode(); + static void setColorMode( TQApplication::ColorMode ); +#endif + + enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 }; + static int colorSpec(); + static void setColorSpec( int ); +#ifndef QT_NO_CURSOR + static TQCursor *overrideCursor(); + static void setOverrideCursor( const TQCursor &, bool replace=FALSE ); + static void restoreOverrideCursor(); +#endif + static bool hasGlobalMouseTracking(); + static void setGlobalMouseTracking( bool enable ); +#ifndef QT_NO_PALETTE + static TQPalette palette( const TQWidget* = 0 ); + static void setPalette( const TQPalette &, bool informWidgets=FALSE, + const char* className = 0 ); +#endif + static TQFont font( const TQWidget* = 0 ); + static void setFont( const TQFont &, bool informWidgets=FALSE, + const char* className = 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(); +#ifndef QT_NO_CLIPBOARD + static TQClipboard *clipboard(); +#endif + TQWidget *focusWidget() const; + TQWidget *activeWindow() const; + + static TQWidget *widgetAt( int x, int y, bool child=FALSE ); + static TQWidget *widgetAt( const TQPoint &, bool child=FALSE ); + + static TQEventLoop *eventLoop(); + + int exec(); + void processEvents(); + void processEvents( int maxtime ); + void processOneEvent(); + bool hasPendingEvents(); + int enter_loop(); + void exit_loop(); + int loopLevel() const; + static void exit( int retcode=0 ); + + static bool sendEvent( TQObject *receiver, TQEvent *event ); + static void postEvent( TQObject *receiver, TQEvent *event ); + static void sendPostedEvents( TQObject *receiver, int event_type ); + static void sendPostedEvents(); + + static void removePostedEvents( TQObject *receiver ); + + virtual bool notify( TQObject *, TQEvent * ); + + static bool startingUp(); + static bool closingDown(); + + static void flushX(); + static void flush(); + static void syncX(); + + static void beep(); + +#ifndef QT_NO_TRANSLATION +# ifndef QT_NO_TEXTCODEC + void setDefaultCodec( TQTextCodec * ); + TQTextCodec* defaultCodec() const; +# endif + void installTranslator( TQTranslator * ); + void removeTranslator( TQTranslator * ); +#endif + enum Encoding { DefaultCodec, UnicodeUTF8 }; + TQString translate( const char * context, + const char * key, + const char * comment = 0, + Encoding encoding = DefaultCodec ) const; +#ifndef QT_NO_DIR + TQString applicationDirPath(); + TQString applicationFilePath(); +#endif +#ifndef QT_NO_PALETTE + // obsolete functions + static void setWinStyleHighlightColor( const TQColor &c ) { + TQPalette p( palette() ); + p.setColor( TQColorGroup::Highlight, c ); + setPalette( p, TRUE); + } + static const TQColor &winStyleHighlightColor() { + return palette().active().highlight(); + } +#endif + static void setDesktopSettingsAware( bool ); + static bool desktopSettingsAware(); + + static void setCursorFlashTime( int ); + static int cursorFlashTime(); + + static void setDoubleClickInterval( int ); + static int doubleClickInterval(); +#ifndef QT_NO_WHEELEVENT + static void setWheelScrollLines( int ); + static int wheelScrollLines(); +#endif + static void setGlobalStrut( const TQSize & ); + static TQSize globalStrut(); + +#ifndef QT_NO_COMPONENT + static void setLibraryPaths( const TQStringList & ); + static TQStringList libraryPaths(); + static void addLibraryPath( const TQString & ); + static void removeLibraryPath( const TQString & ); +#endif // QT_NO_COMPONENT + static void setStartDragTime( int ms ); + static int startDragTime(); + static void setStartDragDistance( int l ); + static int startDragDistance(); + + static void setReverseLayout( bool b ); + static bool reverseLayout(); + + static int horizontalAlignment( int align ); + + static bool isEffectEnabled( TQt::UIEffect ); + static void setEffectEnabled( TQt::UIEffect, bool enable = TRUE ); + +#if defined(Q_WS_MAC) + virtual bool macEventFilter( EventHandlerCallRef, EventRef ); +#endif +#if defined(Q_WS_WIN) + virtual bool winEventFilter( MSG * ); +#endif +#if defined(Q_WS_X11) + virtual bool x11EventFilter( XEvent * ); + virtual int x11ClientMessage( TQWidget*, XEvent*, bool passive_only); + int x11ProcessEvent( XEvent* ); +#endif +#if defined(Q_WS_QWS) + virtual bool qwsEventFilter( TQWSEvent * ); + int qwsProcessEvent( TQWSEvent* ); + void qwsSetCustomColors( TQRgb *colortable, int start, int numColors ); +/*! + \internal + Returns true if the process is GUI server +*/ + bool qwsIsGUIServer(); +#ifndef QT_NO_QWS_MANAGER + static TQWSDecoration &qwsDecoration(); + static void qwsSetDecoration( TQWSDecoration *); +#endif +#endif + +#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) + static WindowsVersion winVersion(); +#elif defined(Q_OS_MAC) + static MacintoshVersion macVersion(); +#endif +#if defined(Q_WS_WIN) + void winFocus( TQWidget *, bool ); + static void winMouseButtonUp(); +#endif + +#ifndef QT_NO_SESSIONMANAGER + // session management + bool isSessionRestored() const; + TQString sessionId() const; + TQString sessionKey() const; + virtual void commitData( TQSessionManager& sm ); + virtual void saveState( TQSessionManager& sm ); +#endif +#if defined(Q_WS_X11) +#if !defined(QT_NO_IM_EXTENSIONS) + virtual TQWidget *locateICHolderWidget( TQWidget *w ); + virtual TQWidgetList *icHolderWidgets(); + static void create_im(); + static void close_im(); +#else + TQWidget *locateICHolderWidget( TQWidget *w ); + TQWidgetList *icHolderWidgets(); + static void create_xim(); + static void close_xim(); +#endif + static TQString defaultInputMethod(); + void changeAllInputContext( const TQString & ); + static bool x11_apply_settings(); +#endif + void wakeUpGuiThread(); +#if defined(QT_THREAD_SUPPORT) + void lock(); + void unlock(bool wakeUpGui = TRUE); + bool locked(); + bool tryLock(); +#endif + +signals: + void lastWindowClosed(); + void aboutToQuit(); + void guiThreadAwake(); + +public slots: + void quit(); + void closeAllWindows(); + void aboutTQt(); + +#if defined(Q_WS_QWS) +protected: + void setArgs(int, char **); +#endif + +protected: + bool event(TQEvent *); + +private: + void construct( int &argc, char **argv, Type ); + void initialize( int, char ** ); + void init_precmdline(); + void process_cmdline( int* argcptr, char ** argv ); + bool internalNotify( TQObject *, TQEvent * ); +#if defined(Q_WS_QWS) + static TQWidget *findChildWidget( const TQWidget *p, const TQPoint &pos ); + static TQWidget *findWidget( const TQObjectList&, const TQPoint &, bool rec ); +#endif + +#if defined(Q_WS_MAC) + bool do_mouse_down(Point *, bool *); + static TQMAC_PASCAL OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); + static TQMAC_PASCAL OSStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long); + static TQMAC_PASCAL void qt_context_timer_callbk(EventLoopTimerRef, void *); + static TQMAC_PASCAL void qt_select_timer_callbk(EventLoopTimerRef, void *); + static bool qt_mac_apply_settings(); + friend class TQMacInputMethod; + friend TQMAC_PASCAL OSStatus qt_window_event(EventHandlerCallRef, EventRef, void *); + friend void qt_mac_update_os_settings(); + friend bool qt_set_socket_handler( int, int, TQObject *, bool); + friend void qt_mac_destroy_widget(TQWidget *); + friend void qt_init(int *, char **, TQApplication::Type); +#endif + +#if defined(Q_WS_X11) +private slots: + void postIMEvent( TQObject *receiver, TQIMEvent *event ); +#endif + +private: +#ifdef QT_THREAD_SUPPORT + static TQMutex *qt_mutex; +#endif // QT_THREAD_SUPPORT + + int app_argc; + char **app_argv; + bool quit_now; + int quit_code; + static TQStyle *app_style; + static int app_cspec; +#ifndef QT_NO_PALETTE + static TQPalette *app_pal; +#endif + static TQFont *app_font; +#ifndef QT_NO_CURSOR + static TQCursor *app_cursor; +#endif + static TQEventLoop* eventloop; + static int app_tracking; + static bool is_app_running; + static bool is_app_closing; + static bool app_exit_loop; + static int loop_level; + static TQWidget *main_widget; + static TQWidget *focus_widget; + static TQWidget *active_window; + static bool obey_desktop_settings; + static int cursor_flash_time; + static int mouse_double_click_time; + static int wheel_scroll_lines; + static int composedUnicode; // Value, meta-composed character + + static bool animate_ui; + static bool animate_menu; + static bool animate_tooltip; + static bool animate_combo; + static bool fade_menu; + static bool fade_tooltip; + static bool animate_toolbox; + static bool widgetCount; // Coupled with -widgetcount switch + static bool metaComposeUnicode; + + TQValueList *translators; +#ifndef QT_NO_SESSIONMANAGER + TQSessionManager *session_manager; + TQString session_id; + static TQString* session_key; + bool is_session_restored; +#endif +#if defined(Q_WS_X11) +#if !defined (QT_NO_STYLE) + static void x11_initialize_style(); +#endif + static TQString defaultIM; // default input method's name in this application. +#endif + + static TQSize app_strut; +#ifndef QT_NO_COMPONENT + static TQStringList *app_libpaths; +#endif + static TQAsciiDict *app_palettes; + static TQAsciiDict *app_fonts; + + static TQWidgetList *popupWidgets; + bool inPopupMode() const; + void closePopup( TQWidget *popup ); + void openPopup( TQWidget *popup ); + void setActiveWindow( TQWidget* act ); + + static bool sendSpontaneousEvent( TQObject *receiver, TQEvent *event ); + static void removePostedEvent( TQEvent * ); + static void removePostedEvents( TQObject *receiver, int event_type ); + + friend class TQWidget; + friend class TQETWidget; + friend class TQDialog; + friend class TQAccelManager; + friend class TQEvent; + friend class TQTranslator; + friend class TQEventLoop; + friend Q_EXPORT void qt_ucm_initialize( TQApplication * ); +#if defined(Q_WS_WIN) + friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* ); +#endif +#if defined(Q_WS_QWS) + friend class TQInputContext; +#endif +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQApplication( const TQApplication & ); + TQApplication &operator=( const TQApplication & ); +#endif +}; + +inline int TQApplication::argc() const +{ + return app_argc; +} + +inline char **TQApplication::argv() const +{ + return app_argv; +} + +#if defined(Q_WS_QWS) +inline void TQApplication::setArgs(int c, char **v) +{ + app_argc = c; + app_argv = v; +} +#endif + +#ifndef QT_NO_CURSOR +inline TQCursor *TQApplication::overrideCursor() +{ + return app_cursor; +} +#endif +inline bool TQApplication::hasGlobalMouseTracking() +{ + return app_tracking > 0; +} + +inline TQWidget *TQApplication::mainWidget() const +{ + return main_widget; +} + +inline TQWidget *TQApplication::focusWidget() const +{ + return focus_widget; +} + +inline TQWidget *TQApplication::activeWindow() const +{ + return active_window; +} + +inline TQWidget *TQApplication::widgetAt( const TQPoint &p, bool child ) +{ + return widgetAt( p.x(), p.y(), child ); +} + +inline bool TQApplication::inPopupMode() const +{ + return popupWidgets != 0; +} +#ifndef QT_NO_SESSIONMANAGER +inline bool TQApplication::isSessionRestored() const +{ + return is_session_restored; +} + +inline TQString TQApplication::sessionId() const +{ + return session_id; +} + +inline TQString TQApplication::sessionKey() const +{ + return session_key ? *session_key : TQString::null; +} +#endif +inline TQSize TQApplication::globalStrut() +{ + return app_strut; +} + +inline bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event ) +{ if ( event ) event->spont = FALSE; return qApp ? qApp->notify( receiver, event ) : FALSE; } + +inline bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event ) +{ if ( event ) event->spont = TRUE; return qApp ? qApp->notify( receiver, event ) : FALSE; } + +#ifdef QT_NO_TRANSLATION +// Simple versions +inline TQString TQApplication::translate( const char *, const char *sourceText, + const char *, Encoding encoding ) const +{ +#ifndef QT_NO_TEXTCODEC + if ( encoding == UnicodeUTF8 ) + return TQString::fromUtf8( sourceText ); + else +#endif + return TQString::fromLatin1( sourceText ); +} +#endif + +inline int TQApplication::horizontalAlignment( int align ) +{ + align &= AlignHorizontal_Mask; + if ( align == AlignAuto ) { + if ( reverseLayout() ) + align = AlignRight; + else + align = AlignLeft; + } + return align; +} + +#endif // TQAPPLICATION_H + diff --git a/src/kernel/ntqasyncimageio.h b/src/kernel/ntqasyncimageio.h new file mode 100644 index 000000000..25401c06e --- /dev/null +++ b/src/kernel/ntqasyncimageio.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Definition of asynchronous image/movie loading classes +** +** Created : 970617 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQASYNCIMAGEIO_H +#define TQASYNCIMAGEIO_H + +#ifndef QT_H +#include "ntqimage.h" +#endif // QT_H + +#ifndef QT_NO_ASYNC_IMAGE_IO + +#if __GNUC__ - 0 > 3 +#pragma GCC system_header +#endif + +class Q_EXPORT TQImageConsumer { +public: + virtual void end()=0; + + // Change transfer type 1. + virtual void changed( const TQRect& ) = 0; + virtual void frameDone() = 0; + + // Change transfer type 2. + virtual void frameDone( const TQPoint&, const TQRect& ) = 0; + + virtual void setLooping( int ) = 0; + virtual void setFramePeriod( int ) = 0; + virtual void setSize( int, int ) = 0; +}; + +class Q_EXPORT TQImageFormat { +public: + virtual ~TQImageFormat(); + virtual int decode( TQImage& img, TQImageConsumer* consumer, + const uchar* buffer, int length ) = 0; +}; + +class Q_EXPORT TQImageFormatType { +public: + virtual ~TQImageFormatType(); + virtual TQImageFormat* decoderFor( const uchar* buffer, int length ) = 0; + virtual const char* formatName() const = 0; +protected: + TQImageFormatType(); +}; + +class TQImageDecoderPrivate; +class Q_EXPORT TQImageDecoder { +public: + TQImageDecoder( TQImageConsumer* c ); + ~TQImageDecoder(); + + const TQImage& image() { return img; } + int decode( const uchar* buffer, int length ); + + static const char* formatName( const uchar* buffer, int length ); + static TQImageFormatType* format( const char* name ); // direct use - no decode() + + static TQStrList inputFormats(); + static void registerDecoderFactory( TQImageFormatType* ); + static void unregisterDecoderFactory( TQImageFormatType* ); + +private: + TQImageFormat* actual_decoder; + TQImageConsumer* consumer; + TQImage img; + TQImageDecoderPrivate *d; +}; + +#endif // QT_NO_ASYNC_IMAGE_IO + +#endif // TQASYNCIMAGEIO_H diff --git a/src/kernel/ntqasyncio.h b/src/kernel/ntqasyncio.h new file mode 100644 index 000000000..878b2f75a --- /dev/null +++ b/src/kernel/ntqasyncio.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Definition of asynchronous I/O classes +** +** Created : 970617 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQASYNCIO_H +#define TQASYNCIO_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqsignal.h" +#include "ntqtimer.h" +#endif // QT_H + +#ifndef QT_NO_ASYNC_IO + +class TQIODevice; + +class Q_EXPORT TQAsyncIO { +public: + virtual ~TQAsyncIO(); + void connect(TQObject*, const char *member); + +protected: + void ready(); + +private: + TQSignal signal; +}; + +class Q_EXPORT TQDataSink : public TQAsyncIO { +public: + // Call this to know how much I can take. + virtual int readyToReceive()=0; + virtual void receive(const uchar*, int count)=0; + virtual void eof()=0; + void maybeReady(); +}; + +class Q_EXPORT TQDataSource : public TQAsyncIO { +public: + virtual int readyToSend()=0; // returns -1 when never any more ready + virtual void sendTo(TQDataSink*, int count)=0; + void maybeReady(); + + virtual bool rewindable() const; + virtual void enableRewind(bool); + virtual void rewind(); +}; + +class Q_EXPORT TQIODeviceSource : public TQDataSource { + const int buf_size; + uchar *buffer; + TQIODevice* iod; + bool rew; + +public: + TQIODeviceSource(TQIODevice*, int bufsize=4096); + ~TQIODeviceSource(); + + int readyToSend(); + void sendTo(TQDataSink* sink, int n); + bool rewindable() const; + void enableRewind(bool on); + void rewind(); +}; + +class Q_EXPORT TQDataPump : public TQObject { + Q_OBJECT + int interval; + TQTimer timer; + TQDataSource* source; + TQDataSink* sink; + +public: + TQDataPump(TQDataSource*, TQDataSink*); + +private slots: + void kickStart(); + void tryToPump(); +}; + +#endif // QT_NO_ASYNC_IO + +#endif diff --git a/src/kernel/ntqbitmap.h b/src/kernel/ntqbitmap.h new file mode 100644 index 000000000..90fe694e4 --- /dev/null +++ b/src/kernel/ntqbitmap.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Definition of TQBitmap class +** +** Created : 941020 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQBITMAP_H +#define TQBITMAP_H + +#ifndef QT_H +#include "ntqpixmap.h" +#endif // QT_H + + +class Q_EXPORT TQBitmap : public TQPixmap +{ +public: + TQBitmap(); + TQBitmap( int w, int h, bool clear = FALSE, + TQPixmap::Optimization = TQPixmap::DefaultOptim ); + TQBitmap( const TQSize &, bool clear = FALSE, + TQPixmap::Optimization = TQPixmap::DefaultOptim ); + TQBitmap( int w, int h, const uchar *bits, bool isXbitmap=FALSE ); + TQBitmap( const TQSize &, const uchar *bits, bool isXbitmap=FALSE ); + TQBitmap( const TQBitmap & ); +#ifndef QT_NO_IMAGEIO + TQBitmap( const TQString &fileName, const char *format=0 ); +#endif + TQBitmap &operator=( const TQBitmap & ); + TQBitmap &operator=( const TQPixmap & ); + TQBitmap &operator=( const TQImage & ); + +#ifndef QT_NO_PIXMAP_TRANSFORMATION + TQBitmap xForm( const TQWMatrix & ) const; +#endif +}; + + +#endif // TQBITMAP_H diff --git a/src/kernel/ntqbrush.h b/src/kernel/ntqbrush.h new file mode 100644 index 000000000..72c61d4e6 --- /dev/null +++ b/src/kernel/ntqbrush.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Definition of TQBrush class +** +** Created : 940112 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQBRUSH_H +#define TQBRUSH_H + +#ifndef QT_H +#include "ntqcolor.h" +#include "ntqshared.h" +#endif // QT_H + + +class Q_EXPORT TQBrush: public TQt +{ +friend class TQPainter; +public: + TQBrush(); + TQBrush( BrushStyle ); + TQBrush( const TQColor &, BrushStyle=SolidPattern ); + TQBrush( const TQColor &, const TQPixmap & ); + TQBrush( const TQBrush & ); + ~TQBrush(); + TQBrush &operator=( const TQBrush & ); + + BrushStyle style() const { return data->style; } + void setStyle( BrushStyle ); + const TQColor &color()const { return data->color; } + void setColor( const TQColor & ); + TQPixmap *pixmap() const { return data->pixmap; } + void setPixmap( const TQPixmap & ); + + bool operator==( const TQBrush &p ) const; + bool operator!=( const TQBrush &b ) const + { return !(operator==(b)); } + +private: + TQBrush copy() const; + void detach(); + void init( const TQColor &, BrushStyle ); + struct TQBrushData : public TQShared { // brush data + BrushStyle style; + TQColor color; + TQPixmap *pixmap; + } *data; +}; + + +/***************************************************************************** + TQBrush stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQBrush & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQBrush & ); +#endif + +#endif // TQBRUSH_H diff --git a/src/kernel/ntqclipboard.h b/src/kernel/ntqclipboard.h new file mode 100644 index 000000000..f61005d9c --- /dev/null +++ b/src/kernel/ntqclipboard.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Definition of TQClipboard class +** +** Created : 960430 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCLIPBOARD_H +#define TQCLIPBOARD_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqobject.h" +#endif // QT_H + +#ifndef QT_NO_CLIPBOARD + +class TQMimeSource; + +class Q_EXPORT TQClipboard : public TQObject +{ + Q_OBJECT +private: + TQClipboard( TQObject *parent=0, const char *name=0 ); + ~TQClipboard(); + +public: + enum Mode { Clipboard, Selection }; + + void clear( Mode mode ); // ### default arg = Clipboard in 4.0 + void clear(); // ### remove 4.0 + + bool supportsSelection() const; + bool ownsSelection() const; + bool ownsClipboard() const; + + void setSelectionMode(bool enable); // ### remove 4.0 + bool selectionModeEnabled() const; // ### remove 4.0 + + // ### default arg mode = Clipboard in 4.0 for all of these + TQString text( Mode mode ) const; + TQString text( TQCString& subtype, Mode mode ) const; + void setText( const TQString &, Mode mode ); + +#ifndef QT_NO_MIMECLIPBOARD + TQMimeSource *data( Mode mode ) const; + void setData( TQMimeSource*, Mode mode ); + + TQImage image( Mode mode ) const; + TQPixmap pixmap( Mode mode ) const; + void setImage( const TQImage &, Mode mode ); + void setPixmap( const TQPixmap &, Mode mode ); +#endif + + // ### remove all of these in 4.0 + TQString text() const; + TQString text(TQCString& subtype) const; + void setText( const TQString &); + +#ifndef QT_NO_MIMECLIPBOARD + TQMimeSource *data() const; + void setData( TQMimeSource* ); + + TQImage image() const; + TQPixmap pixmap() const; + void setImage( const TQImage & ); + void setPixmap( const TQPixmap & ); +#endif + +signals: + void selectionChanged(); + void dataChanged(); + +private slots: + void ownerDestroyed(); + +protected: + void connectNotify( const char * ); + bool event( TQEvent * ); + + friend class TQApplication; + friend class TQBaseApplication; + friend class TQDragManager; + friend class TQMimeSource; + +private: +#if defined(Q_WS_MAC) + void loadScrap(bool convert); + void saveScrap(); +#endif + + // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQClipboard( const TQClipboard & ); + TQClipboard &operator=( const TQClipboard & ); +#endif +}; + +#endif // QT_NO_CLIPBOARD + +#endif // TQCLIPBOARD_H diff --git a/src/kernel/ntqcolor.h b/src/kernel/ntqcolor.h new file mode 100644 index 000000000..fd9e7630b --- /dev/null +++ b/src/kernel/ntqcolor.h @@ -0,0 +1,229 @@ +/**************************************************************************** +** +** Definition of TQColor class +** +** Created : 940112 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCOLOR_H +#define TQCOLOR_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqstringlist.h" +#endif // QT_H + +const TQRgb RGB_MASK = 0x00ffffff; // masks RGB values + +Q_EXPORT inline int qRed( TQRgb rgb ) // get red part of RGB +{ return (int)((rgb >> 16) & 0xff); } + +Q_EXPORT inline int qGreen( TQRgb rgb ) // get green part of RGB +{ return (int)((rgb >> 8) & 0xff); } + +Q_EXPORT inline int qBlue( TQRgb rgb ) // get blue part of RGB +{ return (int)(rgb & 0xff); } + +Q_EXPORT inline int qAlpha( TQRgb rgb ) // get alpha part of RGBA +{ return (int)((rgb >> 24) & 0xff); } + +Q_EXPORT inline TQRgb qRgb( int r, int g, int b )// set RGB value +{ return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); } + +Q_EXPORT inline TQRgb qRgba( int r, int g, int b, int a )// set RGBA value +{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); } + +Q_EXPORT inline int qGray( int r, int g, int b )// convert R,G,B to gray 0..255 +{ return (r*11+g*16+b*5)/32; } + +Q_EXPORT inline int qGray( TQRgb rgb ) // convert RGB to gray 0..255 +{ return qGray( qRed(rgb), qGreen(rgb), qBlue(rgb) ); } + + +class Q_EXPORT TQColor +{ +public: + enum Spec { Rgb, Hsv }; + + TQColor(); + TQColor( int r, int g, int b ); + TQColor( int x, int y, int z, Spec ); + TQColor( TQRgb rgb, uint pixel=0xffffffff); + TQColor( const TQString& name ); + TQColor( const char *name ); + TQColor( const TQColor & ); + TQColor &operator=( const TQColor & ); + + bool isValid() const; + bool isDirty() const; + TQString name() const; + void setNamedColor( const TQString& name ); + + TQRgb rgb() const; + void setRgb( int r, int g, int b ); + void setRgb( TQRgb rgb ); + void getRgb( int *r, int *g, int *b ) const { rgb( r, g, b ); } + void rgb( int *r, int *g, int *b ) const; // obsolete + + int red() const; + int green() const; + int blue() const; + + void setHsv( int h, int s, int v ); + void getHsv( int *h, int *s, int *v ) const { hsv( h, s, v ); } + void hsv( int *h, int *s, int *v ) const; // obsolete + void getHsv( int &h, int &s, int &v ) const { hsv( &h, &s, &v ); } // obsolete + + TQColor light( int f = 150 ) const; + TQColor dark( int f = 200 ) const; + + bool operator==( const TQColor &c ) const; + bool operator!=( const TQColor &c ) const; + + uint alloc(); + uint pixel() const; + +#if defined(Q_WS_X11) + // ### in 4.0, make this take a default argument of -1 for default screen? + uint alloc( int screen ); + uint pixel( int screen ) const; +#endif + + static int maxColors(); + static int numBitPlanes(); + + static int enterAllocContext(); + static void leaveAllocContext(); + static int currentAllocContext(); + static void destroyAllocContext( int ); + +#if defined(Q_WS_WIN) + static const TQRgb* palette( int* numEntries = 0 ); + static int setPaletteEntries( const TQRgb* entries, int numEntries, + int base = -1 ); + static HPALETTE hPal() { return hpal; } + static uint realizePal( TQWidget * ); +#endif + + static void initialize(); + static void cleanup(); +#ifndef QT_NO_STRINGLIST + static TQStringList colorNames(); +#endif + enum { Dirt = 0x44495254, Invalid = 0x49000000 }; + +private: + void setSystemNamedColor( const TQString& name ); + void setPixel( uint pixel ); + static void initGlobalColors(); + static uint argbToPix32(TQRgb); + static TQColor* globalColors(); + static bool color_init; + static bool globals_init; +#if defined(Q_WS_WIN) + static HPALETTE hpal; +#endif + static enum ColorModel { d8, d32 } colormodel; + union { + TQRgb argb; + struct D8 { + TQRgb argb; + uchar pix; + uchar invalid; + uchar dirty; + uchar direct; + } d8; + struct D32 { + TQRgb argb; + uint pix; + bool invalid() const { return argb == TQColor::Invalid && pix == TQColor::Dirt; } + bool probablyDirty() const { return pix == TQColor::Dirt; } + } d32; + } d; +}; + + +inline TQColor::TQColor() +{ d.d32.argb = Invalid; d.d32.pix = Dirt; } + +inline TQColor::TQColor( int r, int g, int b ) +{ + d.d32.argb = Invalid; + d.d32.pix = Dirt; + setRgb( r, g, b ); +} + +inline TQRgb TQColor::rgb() const +{ return d.argb; } + +inline int TQColor::red() const +{ return qRed(d.argb); } + +inline int TQColor::green() const +{ return qGreen(d.argb); } + +inline int TQColor::blue() const +{ return qBlue(d.argb); } + +inline bool TQColor::isValid() const +{ + if ( colormodel == d8 ) + return !d.d8.invalid; + else + return !d.d32.invalid(); +} + +inline bool TQColor::operator==( const TQColor &c ) const +{ + return d.argb == c.d.argb && isValid() == c.isValid(); +} + +inline bool TQColor::operator!=( const TQColor &c ) const +{ + return !operator==(c); +} + + +/***************************************************************************** + TQColor stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQColor & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQColor & ); +#endif + +#endif // TQCOLOR_H diff --git a/src/kernel/ntqconnection.h b/src/kernel/ntqconnection.h new file mode 100644 index 000000000..db562210e --- /dev/null +++ b/src/kernel/ntqconnection.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Definition of TQConnection class +** +** Created : 930417 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCONNECTION_H +#define TQCONNECTION_H + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H + +class Q_EXPORT TQConnection +{ +public: + TQConnection( const TQObject *, int, const char *memberName, int memberType ); + ~TQConnection() {} + + bool isConnected() const { return obj != 0; } + + TQObject *object() const { return obj; } // get object/member pointer + int member() const { return mbr; } + const char *memberName() const { return mbr_name; } + int memberType() const { return mbr_type; } + int numArgs() const { return nargs; } + +private: + TQObject *obj; // object connected to + int mbr; // member connected to + const char *mbr_name; + int mbr_type; + int nargs; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQConnection( const TQConnection & ); + TQConnection &operator=( const TQConnection & ); +#endif +}; + +#define Q_DEFINED_QCONNECTION +#include "ntqwinexport.h" +#endif // TQCONNECTION_H diff --git a/src/kernel/ntqcursor.h b/src/kernel/ntqcursor.h new file mode 100644 index 000000000..70c91e95b --- /dev/null +++ b/src/kernel/ntqcursor.h @@ -0,0 +1,153 @@ +/**************************************************************************** +** +** Definition of TQCursor class +** +** Created : 940219 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCURSOR_H +#define TQCURSOR_H + +#ifndef QT_H +#include "ntqpoint.h" +#include "ntqshared.h" +#endif // QT_H + +/* + ### The fake cursor has to go first with old qdoc. +*/ +#ifdef QT_NO_CURSOR + +class Q_EXPORT TQCursor : public TQt +{ +public: + static TQPoint pos(); + static void setPos( int x, int y ); + static void setPos( const TQPoint & ); +private: + TQCursor(); +}; + +#endif // QT_NO_CURSOR + +#ifndef QT_NO_CURSOR + +struct TQCursorData; + + +class Q_EXPORT TQCursor : public TQt +{ +public: + TQCursor(); // create default arrow cursor + TQCursor( int shape ); + TQCursor( const TQBitmap &bitmap, const TQBitmap &mask, + int hotX=-1, int hotY=-1 ); + TQCursor( const TQPixmap &pixmap, + int hotX=-1, int hotY=-1 ); + TQCursor( const TQCursor & ); + ~TQCursor(); + TQCursor &operator=( const TQCursor & ); + + int shape() const; + void setShape( int ); + + const TQBitmap *bitmap() const; + const TQBitmap *mask() const; + TQPoint hotSpot() const; + +#if defined(Q_WS_WIN) + HCURSOR handle() const; + TQCursor( HCURSOR ); +#elif defined(Q_WS_X11) + HANDLE handle() const; + TQCursor( HANDLE ); +#elif defined(Q_WS_MAC) + HANDLE handle() const; +#elif defined(Q_WS_QWS) + HANDLE handle() const; +#endif + + static TQPoint pos(); + static void setPos( int x, int y ); + static void setPos( const TQPoint & ); + + static void initialize(); + static void cleanup(); + +#if defined(Q_WS_X11) + static int x11Screen(); +#endif +private: + void setBitmap( const TQBitmap &bitmap, const TQBitmap &mask, + int hotX, int hotY ); + void update() const; + TQCursorData *data; + TQCursor *find_cur(int); +#if defined(Q_WS_MAC) + friend void qt_mac_set_cursor(const TQCursor *c, const Point *p); +#endif +}; + + +#if !defined(QT_CLEAN_NAMESPACE) +// CursorShape is defined in X11/X.h +#ifdef CursorShape +#define X_CursorShape CursorShape +#undef CursorShape +#endif +typedef TQt::CursorShape TQCursorShape; +#ifdef X_CursorShape +#define CursorShape X_CursorShape +#endif +#endif + + +/***************************************************************************** + TQCursor stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQCursor & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQCursor & ); +#endif +#endif // QT_NO_CURSOR + + +inline void TQCursor::setPos( const TQPoint &p ) +{ + setPos( p.x(), p.y() ); +} + +#endif // TQCURSOR_H diff --git a/src/kernel/ntqdesktopwidget.h b/src/kernel/ntqdesktopwidget.h new file mode 100644 index 000000000..cf24fe6ca --- /dev/null +++ b/src/kernel/ntqdesktopwidget.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Definition of TQDesktopWidget class. +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDESKTOPWIDGET_H +#define TQDESKTOPWIDGET_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +class TQApplication; +class TQDesktopWidgetPrivate; /* Don't touch! */ + +class Q_EXPORT TQDesktopWidget : public TQWidget +{ + Q_OBJECT +public: + TQDesktopWidget(); + ~TQDesktopWidget(); + + bool isVirtualDesktop() const; + + int numScreens() const; + int primaryScreen() const; + + int screenNumber( TQWidget *widget = 0 ) const; // ### 4.0: const TQWidget* + int screenNumber( const TQPoint & ) const; + + TQWidget *screen( int screen = -1 ); + + const TQRect& screenGeometry( int screen = -1 ) const; + const TQRect& screenGeometry( TQWidget *widget ) const + { return screenGeometry( screenNumber( widget ) ); } + const TQRect& screenGeometry( const TQPoint &point ) const + { return screenGeometry( screenNumber( point ) ); } + + const TQRect& availableGeometry( int screen = -1 ) const; + const TQRect& availableGeometry( TQWidget *widget ) const + { return availableGeometry( screenNumber( widget ) ); } + const TQRect& availableGeometry( const TQPoint &point ) const + { return availableGeometry( screenNumber( point ) ); } + + void insertChild( TQObject * ); + + inline void emitResizedSignal(int value) { emit resized(value); } + +signals: + void resized( int ); + void workAreaResized( int ); + +protected: + void resizeEvent( TQResizeEvent *e ); + +private: + TQDesktopWidgetPrivate *d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDesktopWidget( const TQDesktopWidget & ); + TQDesktopWidget &operator=( const TQDesktopWidget & ); +#endif + + friend class TQApplication; +#ifdef Q_WS_QWS + friend class TQWSDisplay; +#endif +}; + +#endif //TQDESKTOPWIDGET_H diff --git a/src/kernel/ntqdragobject.h b/src/kernel/ntqdragobject.h new file mode 100644 index 000000000..303ceb99f --- /dev/null +++ b/src/kernel/ntqdragobject.h @@ -0,0 +1,279 @@ +/**************************************************************************** +** +** Definition of TQDragObject +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDRAGOBJECT_H +#define TQDRAGOBJECT_H + +class TQWidget; +class TQTextDragPrivate; +class TQDragObjectData; +class TQStoredDragData; +class TQImageDragData; + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqimage.h" +#include "ntqstrlist.h" +#include "ntqcolor.h" +#endif // QT_H + +#ifndef QT_NO_MIME + +class Q_EXPORT TQDragObject: public TQObject, public TQMimeSource { + Q_OBJECT +public: + TQDragObject( TQWidget * dragSource = 0, const char * name = 0 ); + virtual ~TQDragObject(); + +#ifndef QT_NO_DRAGANDDROP + bool drag(); + bool dragMove(); + void dragCopy(); + void dragLink(); + + virtual void setPixmap(TQPixmap); + virtual void setPixmap(TQPixmap, const TQPoint& hotspot); + TQPixmap pixmap() const; + TQPoint pixmapHotSpot() const; +#endif + + TQWidget * source(); + static TQWidget * target(); + + static void setTarget(TQWidget*); + +#ifndef QT_NO_DRAGANDDROP + enum DragMode { DragDefault, DragCopy, DragMove, DragLink, DragCopyOrMove }; + +protected: + virtual bool drag(DragMode); +#endif + +private: + TQDragObjectData * d; +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDragObject( const TQDragObject & ); + TQDragObject &operator=( const TQDragObject & ); +#endif +}; + +class Q_EXPORT TQStoredDrag: public TQDragObject { + Q_OBJECT + TQStoredDragData * d; + +public: + TQStoredDrag( const char * mimeType, + TQWidget * dragSource = 0, const char * name = 0 ); + ~TQStoredDrag(); + + virtual void setEncodedData( const TQByteArray & ); + + const char * format(int i) const; + virtual TQByteArray encodedData(const char*) const; + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQStoredDrag( const TQStoredDrag & ); + TQStoredDrag &operator=( const TQStoredDrag & ); +#endif +}; + +class Q_EXPORT TQTextDrag: public TQDragObject { + Q_OBJECT + TQTextDragPrivate* d; +public: + TQTextDrag( const TQString &, + TQWidget * dragSource = 0, const char * name = 0 ); + TQTextDrag( TQWidget * dragSource = 0, const char * name = 0 ); + ~TQTextDrag(); + + virtual void setText( const TQString &); + virtual void setSubtype( const TQCString &); + + const char * format(int i) const; + virtual TQByteArray encodedData(const char*) const; + + static bool canDecode( const TQMimeSource* e ); + static bool decode( const TQMimeSource* e, TQString& s ); + static bool decode( const TQMimeSource* e, TQString& s, TQCString& subtype ); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQTextDrag( const TQTextDrag & ); + TQTextDrag &operator=( const TQTextDrag & ); +#endif +}; + +class Q_EXPORT TQImageDrag: public TQDragObject { + Q_OBJECT + TQImage img; + TQStrList ofmts; + TQImageDragData* d; + +public: + TQImageDrag( TQImage image, TQWidget * dragSource = 0, const char * name = 0 ); + TQImageDrag( TQWidget * dragSource = 0, const char * name = 0 ); + ~TQImageDrag(); + + virtual void setImage( TQImage image ); + + const char * format(int i) const; + virtual TQByteArray encodedData(const char*) const; + + static bool canDecode( const TQMimeSource* e ); + static bool decode( const TQMimeSource* e, TQImage& i ); + static bool decode( const TQMimeSource* e, TQPixmap& i ); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQImageDrag( const TQImageDrag & ); + TQImageDrag &operator=( const TQImageDrag & ); +#endif +}; + + +class Q_EXPORT TQUriDrag: public TQStoredDrag { + Q_OBJECT + +public: + TQUriDrag( TQStrList uris, TQWidget * dragSource = 0, const char * name = 0 ); + TQUriDrag( TQWidget * dragSource = 0, const char * name = 0 ); + ~TQUriDrag(); + + void setFilenames( const TQStringList & fnames ) { setFileNames( fnames ); } + void setFileNames( const TQStringList & fnames ); + void setUnicodeUris( const TQStringList & uuris ); + virtual void setUris( TQStrList uris ); + + 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* e ); + static bool decode( const TQMimeSource* e, TQStrList& i ); + static bool decodeToUnicodeUris( const TQMimeSource* e, TQStringList& i ); + static bool decodeLocalFiles( const TQMimeSource* e, TQStringList& i ); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQUriDrag( const TQUriDrag & ); + TQUriDrag &operator=( const TQUriDrag & ); +#endif +}; + +class Q_EXPORT TQColorDrag : public TQStoredDrag +{ + Q_OBJECT + TQColor color; + +public: + TQColorDrag( const TQColor &col, TQWidget *dragsource = 0, const char *name = 0 ); + TQColorDrag( TQWidget * dragSource = 0, const char * name = 0 ); + void setColor( const TQColor &col ); + + static bool canDecode( TQMimeSource * ); + static bool decode( TQMimeSource *, TQColor &col ); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQColorDrag( const TQColorDrag & ); + TQColorDrag &operator=( const TQColorDrag & ); +#endif +}; + +#ifndef QT_NO_COMPAT +typedef TQUriDrag TQUrlDrag; +#endif + +#ifndef QT_NO_DRAGANDDROP + +// TQDragManager is not part of the public API. It is defined in a +// header file simply so different .cpp files can implement different +// member functions. +// + +class Q_EXPORT TQDragManager: public TQObject { + Q_OBJECT + +private: + TQDragManager(); + ~TQDragManager(); + // only friend classes can use TQDragManager. + friend class TQDragObject; + friend class TQDragMoveEvent; + friend class TQDropEvent; + friend class TQApplication; + + bool eventFilter( TQObject *, TQEvent * ); + void timerEvent( TQTimerEvent* ); + + bool drag( TQDragObject *, TQDragObject::DragMode ); + + void cancel( bool deleteSource = TRUE ); + void move( const TQPoint & ); + void drop(); + void updatePixmap(); + void updatePixmap( const TQPoint& cursorPos ); + +private: + TQDragObject * object; + bool updateMode( ButtonState newstate ); + void updateCursor(); +#if defined(Q_WS_X11) + void createCursors(); +#endif + + TQWidget * dragSource; + TQWidget * dropWidget; + bool beingCancelled; + bool restoreCursor; + bool willDrop; + + TQPixmap *pm_cursor; + int n_cursor; +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDragManager( const TQDragManager & ); + TQDragManager &operator=( const TQDragManager & ); +#endif +}; + +#endif + +#endif // QT_NO_MIME + +#endif // TQDRAGOBJECT_H diff --git a/src/kernel/ntqdrawutil.h b/src/kernel/ntqdrawutil.h new file mode 100644 index 000000000..2d3e1fefd --- /dev/null +++ b/src/kernel/ntqdrawutil.h @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Definition of draw utilities +** +** Created : 950920 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDRAWUTIL_H +#define TQDRAWUTIL_H + +#ifndef QT_H +#include "ntqnamespace.h" +#include "ntqstring.h" // char*->TQString conversion +#endif // QT_H + +class TQPainter; +class TQColorGroup; +class TQPoint; +class TQBrush; +class TQRect; +class TQPixmap; + +#ifndef QT_NO_DRAWUTIL +// +// Standard shade drawing +// + +Q_EXPORT void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, + const TQColorGroup &g, bool sunken = TRUE, + int lineWidth = 1, int midLineWidth = 0 ); + +Q_EXPORT void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, + const TQColorGroup &g, bool sunken = TRUE, + int lineWidth = 1, int midLineWidth = 0 ); + +Q_EXPORT void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, int midLineWidth = 0, + const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawShadeRect( TQPainter *p, const TQRect &r, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, int midLineWidth = 0, + const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawShadePanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawShadePanel( TQPainter *p, const TQRect &r, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken = FALSE, + const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawWinButton( TQPainter *p, const TQRect &r, + const TQColorGroup &g, bool sunken = FALSE, + const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken=FALSE, + const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawWinPanel( TQPainter *p, const TQRect &r, + const TQColorGroup &, bool sunken=FALSE, + const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawPlainRect( TQPainter *p, int x, int y, int w, int h, const TQColor &, + int lineWidth = 1, const TQBrush *fill = 0 ); + +Q_EXPORT void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &, + int lineWidth = 1, const TQBrush *fill = 0 ); + + +// +// Other obsolete drawing functions. +// Use TQStyle::itemRect(), TQStyle::drawItem() and TQStyle::drawArrow() instead. +// +Q_EXPORT TQRect qItemRect( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, + int flags, bool enabled, + const TQPixmap *pixmap, const TQString& text, int len=-1 ); + +Q_EXPORT void qDrawItem( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, + int flags, const TQColorGroup &g, bool enabled, + const TQPixmap *pixmap, const TQString& text, + int len=-1, const TQColor* penColor = 0 ); + +Q_EXPORT void qDrawArrow( TQPainter *p, TQt::ArrowType type, TQt::GUIStyle style, bool down, + int x, int y, int w, int h, + const TQColorGroup &g, bool enabled ); + +#endif // QT_NO_DRAWUTIL +#endif // TQDRAWUTIL_H diff --git a/src/kernel/ntqdropsite.h b/src/kernel/ntqdropsite.h new file mode 100644 index 000000000..952be802c --- /dev/null +++ b/src/kernel/ntqdropsite.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Definitation of Drag and Drop support +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDROPSITE_H +#define TQDROPSITE_H + +#ifndef QT_H +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H +#endif + + +class TQWidget; + + +class Q_EXPORT TQDropSite { +public: + TQDropSite( TQWidget* parent ); + virtual ~TQDropSite(); +}; + + +#endif // TQDROPSITE_H diff --git a/src/kernel/ntqevent.h b/src/kernel/ntqevent.h new file mode 100644 index 000000000..08dc69b6c --- /dev/null +++ b/src/kernel/ntqevent.h @@ -0,0 +1,617 @@ +/**************************************************************************** +** +** Definition of event classes +** +** Created : 931029 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQEVENT_H +#define TQEVENT_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqregion.h" +#include "ntqnamespace.h" +#include "ntqmime.h" +#include "ntqpair.h" +#endif // QT_H + +class Q_EXPORT TQEvent: public TQt // event base class +{ +public: + enum Type { + + /* + If you get a strange compiler error on the line with None, + it's probably because you're also including X11 headers, + which #define the symbol None. Put the X11 includes after + the TQt includes to solve this problem. + */ + + None = 0, // invalid event + + + Timer = 1, // timer event + MouseButtonPress = 2, // mouse button pressed + MouseButtonRelease = 3, // mouse button released + MouseButtonDblClick = 4, // mouse button double click + MouseMove = 5, // mouse move + KeyPress = 6, // key pressed + KeyRelease = 7, // key released + FocusIn = 8, // keyboard focus received + FocusOut = 9, // keyboard focus lost + Enter = 10, // mouse enters widget + Leave = 11, // mouse leaves widget + Paint = 12, // paint widget + Move = 13, // move widget + Resize = 14, // resize widget + Create = 15, // after object creation + Destroy = 16, // during object destruction + Show = 17, // widget is shown + Hide = 18, // widget is hidden + Close = 19, // request to close widget + Quit = 20, // request to quit application + Reparent = 21, // widget has been reparented + ShowMinimized = 22, // widget is shown minimized + ShowNormal = 23, // widget is shown normal + WindowActivate = 24, // window was activated + WindowDeactivate = 25, // window was deactivated + ShowToParent = 26, // widget is shown to parent + HideToParent = 27, // widget is hidden to parent + ShowMaximized = 28, // widget is shown maximized + ShowFullScreen = 29, // widget is shown full-screen + Accel = 30, // accelerator event + Wheel = 31, // wheel event + AccelAvailable = 32, // accelerator available event + CaptionChange = 33, // caption changed + IconChange = 34, // icon changed + ParentFontChange = 35, // parent font changed + ApplicationFontChange = 36, // application font changed + ParentPaletteChange = 37, // parent palette changed + ApplicationPaletteChange = 38, // application palette changed + PaletteChange = 39, // widget palette changed + Clipboard = 40, // internal clipboard event + Speech = 42, // reserved for speech input + SockAct = 50, // socket activation + AccelOverride = 51, // accelerator override event + DeferredDelete = 52, // deferred delete event + DragEnter = 60, // drag moves into widget + DragMove = 61, // drag moves in widget + DragLeave = 62, // drag leaves or is cancelled + Drop = 63, // actual drop + DragResponse = 64, // drag accepted/rejected + ChildInserted = 70, // new child widget + ChildRemoved = 71, // deleted child widget + LayoutHint = 72, // child min/max size changed + ShowWindowRequest = 73, // widget's window should be mapped + WindowBlocked = 74, // window is about to be blocked modally + WindowUnblocked = 75, // windows modal blocking has ended + ActivateControl = 80, // ActiveX activation + DeactivateControl = 81, // ActiveX deactivation + ContextMenu = 82, // context popup menu + IMStart = 83, // input method composition start + IMCompose = 84, // input method composition + IMEnd = 85, // input method composition end + Accessibility = 86, // accessibility information is requested + TabletMove = 87, // Wacom tablet event + LocaleChange = 88, // the system locale changed + LanguageChange = 89, // the application language changed + LayoutDirectionChange = 90, // the layout direction changed + Style = 91, // internal style event + TabletPress = 92, // tablet press + TabletRelease = 93, // tablet release + OkRequest = 94, // CE (Ok) button pressed + HelpRequest = 95, // CE (?) button pressed + WindowStateChange = 96, // window state has changed + IconDrag = 97, // proxy icon dragged + User = 1000, // first user event id + MaxUser = 65535 // last user event id + }; + + + TQEvent( Type type ) : t(type), posted(FALSE), spont(FALSE) {} + virtual ~TQEvent(); + Type type() const { return t; } + bool spontaneous() const { return spont; } +protected: + Type t; +private: + uint posted : 1; + uint spont : 1; + + + friend class TQApplication; + friend class TQAccelManager; + friend class TQBaseApplication; + friend class TQETWidget; +}; + + +class Q_EXPORT TQTimerEvent : public TQEvent +{ +public: + TQTimerEvent( int timerId ) + : TQEvent(Timer), id(timerId) {} + int timerId() const { return id; } +protected: + int id; +}; + + +class Q_EXPORT TQMouseEvent : public TQEvent +{ +public: + TQMouseEvent( Type type, const TQPoint &pos, int button, int state ); + + TQMouseEvent( Type type, const TQPoint &pos, const TQPoint&globalPos, + int button, int state ) + : TQEvent(type), p(pos), g(globalPos), b((ushort)button),s((ushort)state),accpt(TRUE) {}; + + const TQPoint &pos() const { return p; } + const TQPoint &globalPos() const { return g; } + int x() const { return p.x(); } + int y() const { return p.y(); } + int globalX() const { return g.x(); } + int globalY() const { return g.y(); } + ButtonState button() const { return (ButtonState) b; } + ButtonState state() const { return (ButtonState) s; } + ButtonState stateAfter() const; + bool isAccepted() const { return accpt; } + void accept() { accpt = TRUE; } + void ignore() { accpt = FALSE; } +protected: + TQPoint p; + TQPoint g; + ushort b; + ushort s; + uint accpt:1; +}; + + +#ifndef QT_NO_WHEELEVENT +class Q_EXPORT TQWheelEvent : public TQEvent +{ +public: + TQWheelEvent( const TQPoint &pos, int delta, int state, Orientation orient = Vertical ); + TQWheelEvent( const TQPoint &pos, const TQPoint& globalPos, int delta, int state, Orientation orient = Vertical ) + : TQEvent(Wheel), p(pos), g(globalPos), d(delta), s((ushort)state), + accpt(TRUE), o(orient) {} + int delta() const { return d; } + const TQPoint &pos() const { return p; } + const TQPoint &globalPos() const { return g; } + int x() const { return p.x(); } + int y() const { return p.y(); } + int globalX() const { return g.x(); } + int globalY() const { return g.y(); } + ButtonState state() const { return ButtonState(s); } + Orientation orientation() const { return o; } + bool isAccepted() const { return accpt; } + void accept() { accpt = TRUE; } + void ignore() { accpt = FALSE; } +protected: + TQPoint p; + TQPoint g; + int d; + ushort s; + bool accpt; + Orientation o; +}; +#endif + +class Q_EXPORT TQTabletEvent : public TQEvent +{ +public: + enum TabletDevice { NoDevice = -1, Puck, Stylus, Eraser }; + TQTabletEvent( Type t, const TQPoint &pos, const TQPoint &globalPos, int device, + int pressure, int xTilt, int yTilt, const TQPair &uId ); + TQTabletEvent( const TQPoint &pos, const TQPoint &globalPos, int device, + int pressure, int xTilt, int yTilt, const TQPair &uId ) + : TQEvent( TabletMove ), mPos( pos ), mGPos( globalPos ), mDev( device ), + mPress( pressure ), mXT( xTilt ), mYT( yTilt ), mType( uId.first ), + mPhy( uId.second ), mbAcc(TRUE) + {} + int pressure() const { return mPress; } + int xTilt() const { return mXT; } + int yTilt() const { return mYT; } + const TQPoint &pos() const { return mPos; } + const TQPoint &globalPos() const { return mGPos; } + int x() const { return mPos.x(); } + int y() const { return mPos.y(); } + int globalX() const { return mGPos.x(); } + int globalY() const { return mGPos.y(); } + TabletDevice device() const { return TabletDevice(mDev); } + int isAccepted() const { return mbAcc; } + void accept() { mbAcc = TRUE; } + void ignore() { mbAcc = FALSE; } + TQPair uniqueId() { return TQPair( mType, mPhy); } +protected: + TQPoint mPos; + TQPoint mGPos; + int mDev, + mPress, + mXT, + mYT, + mType, + mPhy; + bool mbAcc; + +}; + +class Q_EXPORT TQKeyEvent : public TQEvent +{ +public: + TQKeyEvent( Type type, int key, int ascii, int state, + const TQString& text=TQString::null, bool autorep=FALSE, ushort count=1 ) + : TQEvent(type), txt(text), k((ushort)key), s((ushort)state), + a((uchar)ascii), accpt(TRUE), autor(autorep), c(count) + { + if ( key >= Key_Back && key <= Key_MediaLast ) + accpt = FALSE; + } + int key() const { return k; } + int ascii() const { return a; } + ButtonState state() const { return ButtonState(s); } + ButtonState stateAfter() const; + bool isAccepted() const { return accpt; } + TQString text() const { return txt; } + bool isAutoRepeat() const { return autor; } + int count() const { return int(c); } + void accept() { accpt = TRUE; } + void ignore() { accpt = FALSE; } + +protected: + TQString txt; + ushort k, s; + uchar a; + uint accpt:1; + uint autor:1; + ushort c; +}; + + +class Q_EXPORT TQFocusEvent : public TQEvent +{ +public: + + TQFocusEvent( Type type ) + : TQEvent(type) {} + + bool gotFocus() const { return type() == FocusIn; } + bool lostFocus() const { return type() == FocusOut; } + + enum Reason { Mouse, Tab, Backtab, ActiveWindow, Popup, Shortcut, Other }; + static Reason reason(); + static void setReason( Reason reason ); + static void resetReason(); + +private: + static Reason m_reason; + static Reason prev_reason; +}; + + +class Q_EXPORT TQPaintEvent : public TQEvent +{ +public: + TQPaintEvent( const TQRegion& paintRegion, bool erased = TRUE) + : TQEvent(Paint), + rec(paintRegion.boundingRect()), + reg(paintRegion), + erase(erased){} + TQPaintEvent( const TQRect &paintRect, bool erased = TRUE ) + : TQEvent(Paint), + rec(paintRect), + reg(paintRect), + erase(erased){} + TQPaintEvent( const TQRegion &paintRegion, const TQRect &paintRect, bool erased = TRUE ) + : TQEvent(Paint), + rec(paintRect), + reg(paintRegion), + erase(erased){} + + const TQRect &rect() const { return rec; } + const TQRegion ®ion() const { return reg; } + bool erased() const { return erase; } +protected: + friend class TQApplication; + friend class TQBaseApplication; + TQRect rec; + TQRegion reg; + bool erase; +}; + + +class Q_EXPORT TQMoveEvent : public TQEvent +{ +public: + TQMoveEvent( const TQPoint &pos, const TQPoint &oldPos ) + : TQEvent(Move), p(pos), oldp(oldPos) {} + const TQPoint &pos() const { return p; } + const TQPoint &oldPos()const { return oldp;} +protected: + TQPoint p, oldp; + friend class TQApplication; + friend class TQBaseApplication; +}; + + +class Q_EXPORT TQResizeEvent : public TQEvent +{ +public: + TQResizeEvent( const TQSize &size, const TQSize &oldSize ) + : TQEvent(Resize), s(size), olds(oldSize) {} + const TQSize &size() const { return s; } + const TQSize &oldSize()const { return olds;} +protected: + TQSize s, olds; + friend class TQApplication; + friend class TQBaseApplication; +}; + + +class Q_EXPORT TQCloseEvent : public TQEvent +{ +public: + TQCloseEvent() + : TQEvent(Close), accpt(FALSE) {} + bool isAccepted() const { return accpt; } + void accept() { accpt = TRUE; } + void ignore() { accpt = FALSE; } +protected: + bool accpt; +}; + + +class Q_EXPORT TQIconDragEvent : public TQEvent +{ +public: + TQIconDragEvent() + : TQEvent(IconDrag), accpt(FALSE) {} + + bool isAccepted() const { return accpt; } + void accept() { accpt = TRUE; } + void ignore() { accpt = FALSE; } +protected: + bool accpt; +}; + +class Q_EXPORT TQShowEvent : public TQEvent +{ +public: + TQShowEvent() + : TQEvent(Show) {} +}; + + +class Q_EXPORT TQHideEvent : public TQEvent +{ +public: + TQHideEvent() + : TQEvent(Hide) {} +}; + +class Q_EXPORT TQContextMenuEvent : public TQEvent +{ +public: + enum Reason { Mouse, Keyboard, Other }; + TQContextMenuEvent( Reason reason, const TQPoint &pos, const TQPoint &globalPos, int state ) + : TQEvent( ContextMenu ), p( pos ), gp( globalPos ), accpt( TRUE ), consum( TRUE ), + reas( reason ), s((ushort)state) {} + TQContextMenuEvent( Reason reason, const TQPoint &pos, int state ); + + int x() const { return p.x(); } + int y() const { return p.y(); } + int globalX() const { return gp.x(); } + int globalY() const { return gp.y(); } + + const TQPoint& pos() const { return p; } + const TQPoint& globalPos() const { return gp; } + + ButtonState state() const { return (ButtonState) s; } + bool isAccepted() const { return accpt; } + bool isConsumed() const { return consum; } + void consume() { accpt = FALSE; consum = TRUE; } + void accept() { accpt = TRUE; consum = TRUE; } + void ignore() { accpt = FALSE; consum = FALSE; } + + Reason reason() const { return Reason( reas ); } + +protected: + TQPoint p; + TQPoint gp; + bool accpt; + bool consum; + uint reas:8; + ushort s; +}; + + +class Q_EXPORT TQIMEvent : public TQEvent +{ +public: + TQIMEvent( Type type, const TQString &text, int cursorPosition ) + : TQEvent(type), txt(text), cpos(cursorPosition), a(TRUE) {} + const TQString &text() const { return txt; } + int cursorPos() const { return cpos; } + bool isAccepted() const { return a; } + void accept() { a = TRUE; } + void ignore() { a = FALSE; } + int selectionLength() const; + +private: + TQString txt; + int cpos; + bool a; +}; + +class Q_EXPORT TQIMComposeEvent : public TQIMEvent +{ +public: + TQIMComposeEvent( Type type, const TQString &text, int cursorPosition, + int selLength ) + : TQIMEvent( type, text, cursorPosition ), selLen( selLength ) { } + +private: + int selLen; + + friend class TQIMEvent; +}; + +inline int TQIMEvent::selectionLength() const +{ + if ( type() != IMCompose ) return 0; + TQIMComposeEvent *that = (TQIMComposeEvent *) this; + return that->selLen; +} + + +#ifndef QT_NO_DRAGANDDROP + +// This class is rather closed at the moment. If you need to create your +// own DND event objects, write to qt-bugs@trolltech.com and we'll try to +// find a way to extend it so it covers your needs. + +class Q_EXPORT TQDropEvent : public TQEvent, public TQMimeSource +{ +public: + TQDropEvent( const TQPoint& pos, Type typ=Drop ) + : TQEvent(typ), p(pos), + act(0), accpt(0), accptact(0), resv(0), + d(0) + {} + const TQPoint &pos() const { return p; } + bool isAccepted() const { return accpt || accptact; } + void accept(bool y=TRUE) { accpt = y; } + void ignore() { accpt = FALSE; } + + bool isActionAccepted() const { return accptact; } + void acceptAction(bool y=TRUE) { accptact = y; } + enum Action { Copy, Link, Move, Private, UserAction=100 }; + void setAction( Action a ) { act = (uint)a; } + Action action() const { return Action(act); } + + TQWidget* source() const; + const char* format( int n = 0 ) const; + TQByteArray encodedData( const char* ) const; + bool provides( const char* ) const; + + TQByteArray data(const char* f) const { return encodedData(f); } + + void setPoint( const TQPoint& np ) { p = np; } + +protected: + TQPoint p; + uint act:8; + uint accpt:1; + uint accptact:1; + uint resv:5; + void * d; +}; + + + +class Q_EXPORT TQDragMoveEvent : public TQDropEvent +{ +public: + TQDragMoveEvent( const TQPoint& pos, Type typ=DragMove ) + : TQDropEvent(pos,typ), + rect( pos, TQSize( 1, 1 ) ) {} + TQRect answerRect() const { return rect; } + void accept( bool y=TRUE ) { TQDropEvent::accept(y); } + void accept( const TQRect & r) { accpt = TRUE; rect = r; } + void ignore( const TQRect & r) { accpt =FALSE; rect = r; } + void ignore() { TQDropEvent::ignore(); } + +protected: + TQRect rect; +}; + + +class Q_EXPORT TQDragEnterEvent : public TQDragMoveEvent +{ +public: + TQDragEnterEvent( const TQPoint& pos ) : + TQDragMoveEvent(pos, DragEnter) { } +}; + + +/* An internal class */ +class Q_EXPORT TQDragResponseEvent : public TQEvent +{ +public: + TQDragResponseEvent( bool accepted ) + : TQEvent(DragResponse), a(accepted) {} + bool dragAccepted() const { return a; } +protected: + bool a; +}; + + +class Q_EXPORT TQDragLeaveEvent : public TQEvent +{ +public: + TQDragLeaveEvent() + : TQEvent(DragLeave) {} +}; + +#endif // QT_NO_DRAGANDDROP + +class Q_EXPORT TQChildEvent : public TQEvent +{ +public: + TQChildEvent( Type type, TQObject *child ) + : TQEvent(type), c(child) {} + TQObject *child() const { return c; } + bool inserted() const { return t == ChildInserted; } + bool removed() const { return t == ChildRemoved; } +protected: + TQObject *c; +}; + + +class Q_EXPORT TQCustomEvent : public TQEvent +{ +public: + TQCustomEvent( int type ); + TQCustomEvent( Type type, void *data ) + : TQEvent(type), d(data) {}; + void *data() const { return d; } + void setData( void* data ) { d = data; } +private: + void *d; +}; + +#endif // TQEVENT_H diff --git a/src/kernel/ntqeventloop.h b/src/kernel/ntqeventloop.h new file mode 100644 index 000000000..2a98a33e2 --- /dev/null +++ b/src/kernel/ntqeventloop.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Declaration of TQEventLoop class +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQEVENTLOOP_H +#define TQEVENTLOOP_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqsocketnotifier.h" +#endif // QT_H + +class TQEventLoopPrivate; +class TQSocketNotifier; +class TQTimer; +#ifdef Q_WS_MAC +struct timeval; //stdc struct +struct TimerInfo; //internal structure (qeventloop_mac.cpp) +#endif + +#if defined(QT_THREAD_SUPPORT) +class TQMutex; +#endif // QT_THREAD_SUPPORT + + +class Q_EXPORT TQEventLoop : public TQObject +{ + Q_OBJECT + +public: + TQEventLoop( TQObject *parent = 0, const char *name = 0 ); + ~TQEventLoop(); + + enum ProcessEvents { + AllEvents = 0x00, + ExcludeUserInput = 0x01, + ExcludeSocketNotifiers = 0x02, + WaitForMore = 0x04 + }; + typedef uint ProcessEventsFlags; + + void processEvents( ProcessEventsFlags flags, int maxtime ); + virtual bool processEvents( ProcessEventsFlags flags ); + + virtual bool hasPendingEvents() const; + + virtual void registerSocketNotifier( TQSocketNotifier * ); + virtual void unregisterSocketNotifier( TQSocketNotifier * ); + void setSocketNotifierPending( TQSocketNotifier * ); + int activateSocketNotifiers(); + + int activateTimers(); + int timeToWait() const; + + virtual int exec(); + virtual void exit( int retcode = 0 ); + + virtual int enterLoop(); + virtual void exitLoop(); + virtual int loopLevel() const; + + virtual void wakeUp(); + +signals: + void awake(); + void aboutToBlock(); + +private: +#if defined(Q_WS_MAC) + friend TQMAC_PASCAL void qt_mac_select_timer_callbk(EventLoopTimerRef, void *); + int macHandleSelect(timeval *); + void macHandleTimer(TimerInfo *); +#endif // Q_WS_MAC + + // internal initialization/cleanup - implemented in various platform specific files + void init(); + void cleanup(); + virtual void appStartingUp(); + virtual void appClosingDown(); + + // data for the default implementation - other implementations should not + // use/need this data + TQEventLoopPrivate *d; + + friend class TQApplication; +}; + +#endif // TQEVENTLOOP_H diff --git a/src/kernel/ntqfocusdata.h b/src/kernel/ntqfocusdata.h new file mode 100644 index 000000000..8a44a5031 --- /dev/null +++ b/src/kernel/ntqfocusdata.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Definition of internal TQFocusData class +** +** Created : 980405 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFOCUSDATA_H +#define TQFOCUSDATA_H + +#ifndef QT_H +#include "ntqwidgetlist.h" +#endif // QT_H + + +class Q_EXPORT TQFocusData { +public: + TQWidget* focusWidget() const { return it.current(); } + + TQWidget* home(); + TQWidget* next(); + TQWidget* prev(); + TQWidget* first() const; + TQWidget* last() const; + int count() const { return focusWidgets.count(); } + +private: + friend class TQWidget; + + TQFocusData() + : it(focusWidgets) {} + TQWidgetList focusWidgets; + TQWidgetListIt it; +}; + + +#endif // TQFOCUSDATA_H diff --git a/src/kernel/ntqfont.h b/src/kernel/ntqfont.h new file mode 100644 index 000000000..0d205410e --- /dev/null +++ b/src/kernel/ntqfont.h @@ -0,0 +1,372 @@ +/**************************************************************************** +** +** Definition of TQFont class +** +** Created : 940514 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFONT_H +#define TQFONT_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqstring.h" +#endif // QT_H + + +class TQFontPrivate; /* don't touch */ +class TQStringList; +class TQTextFormatCollection; + +class Q_EXPORT TQFont +{ +public: + enum StyleHint { + Helvetica, SansSerif = Helvetica, + Times, Serif = Times, + Courier, TypeWriter = Courier, + OldEnglish, Decorative = OldEnglish, + System, + AnyStyle + }; + + enum StyleStrategy { + PreferDefault = 0x0001, + PreferBitmap = 0x0002, + PreferDevice = 0x0004, + PreferOutline = 0x0008, + ForceOutline = 0x0010, + PreferMatch = 0x0020, + PreferQuality = 0x0040, + PreferAntialias = 0x0080, + NoAntialias = 0x0100, + OpenGLCompatible = 0x0200 + }; + + enum Weight { + Light = 25, + Normal = 50, + DemiBold = 63, + Bold = 75, + Black = 87 + }; + + enum Stretch { + UltraCondensed = 50, + ExtraCondensed = 62, + Condensed = 75, + SemiCondensed = 87, + Unstretched = 100, + SemiExpanded = 112, + Expanded = 125, + ExtraExpanded = 150, + UltraExpanded = 200 + }; + + // default font + TQFont(); + // specific font +#ifdef Q_QDOC + TQFont( const TQString &family, int pointSize = 12, int weight = Normal, + bool italic = FALSE ); +#else + TQFont( const TQString &family, int pointSize = -1, int weight = -1, + bool italic = FALSE ); +#endif + // copy constructor + TQFont( const TQFont & ); + + ~TQFont(); + + TQString family() const; + void setFamily( const TQString &); + + int pointSize() const; + float pointSizeFloat() const; + void setPointSize( int ); + void setPointSizeFloat( float ); + + int pixelSize() const; + void setPixelSize( int ); + void setPixelSizeFloat( float ); + + 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 s ); + + int stretch() const; + void setStretch( int ); + + // is raw mode still needed? + bool rawMode() const; + void setRawMode( bool ); + + // dupicated from TQFontInfo + bool exactMatch() const; + + TQFont &operator=( const TQFont & ); + bool operator==( const TQFont & ) const; + bool operator!=( const TQFont & ) const; + bool isCopyOf( const TQFont & ) const; + + +#ifdef Q_WS_WIN + HFONT handle() const; +#else // !Q_WS_WIN + TQt::HANDLE handle() const; +#endif // Q_WS_WIN + + + // needed for X11 + void setRawName( const TQString & ); + TQString rawName() const; + + TQString key() const; + + TQString toString() const; + bool fromString(const TQString &); + +#ifndef QT_NO_STRINGLIST + 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 &); +#endif //QT_NO_STRINGLIST + static void initialize(); + static void cleanup(); +#ifndef Q_WS_QWS + static void cacheStatistics(); +#endif + +#if defined(Q_WS_QWS) + void qwsRenderToDisk(bool all=TRUE); +#endif + + + // a copy of this lives in qunicodetables.cpp, as we can't include + // ntqfont.h it in tools/. Do not modify without changing the script + // enum in qunicodetable_p.h aswell. + enum Script { + // European Alphabetic Scripts + Latin, + Greek, + Cyrillic, + Armenian, + Georgian, + Runic, + Ogham, + SpacingModifiers, + CombiningMarks, + + // Middle Eastern Scripts + Hebrew, + Arabic, + Syriac, + Thaana, + + // South and Southeast Asian Scripts + Devanagari, + Bengali, + Gurmukhi, + Gujarati, + Oriya, + Tamil, + Telugu, + Kannada, + Malayalam, + Sinhala, + Thai, + Lao, + Tibetan, + Myanmar, + Khmer, + + // East Asian Scripts + Han, + Hiragana, + Katakana, + Hangul, + Bopomofo, + Yi, + + // Additional Scripts + Ethiopic, + Cherokee, + CanadianAboriginal, + Mongolian, + + // Symbols + CurrencySymbols, + LetterlikeSymbols, + NumberForms, + MathematicalOperators, + TechnicalSymbols, + GeometricSymbols, + MiscellaneousSymbols, + EnclosedAndSquare, + Braille, + + Unicode, + + // some scripts added in Unicode 3.2 + Tagalog, + Hanunoo, + Buhid, + Tagbanwa, + + KatakanaHalfWidth, + + // from Unicode 4.0 + Limbu, + TaiLe, + + // End +#if !defined(Q_QDOC) + NScripts, + UnknownScript = NScripts, + + NoScript, + + // ---------------------------------------- + // Dear User, you can see values > NScript, + // but they are internal - do not touch. + + Han_Japanese, + Han_SimplifiedChinese, + Han_TraditionalChinese, + Han_Korean, + + LastPrivateScript +#endif + }; + + TQString defaultFamily() const; + TQString lastResortFamily() const; + TQString lastResortFont() const; + +#ifndef QT_NO_COMPAT + + static TQFont defaultFont(); + static void setDefaultFont( const TQFont & ); + +#endif // QT_NO_COMPAT + + TQFont resolve( const TQFont & ) const; + +protected: + // why protected? + bool dirty() const; + int deciPointSize() const; + +private: + TQFont( TQFontPrivate *, TQPaintDevice *pd ); + + void detach(); + +#if defined(Q_WS_MAC) + void macSetFont(TQPaintDevice *); +#elif defined(Q_WS_X11) + void x11SetScreen( int screen = -1 ); + int x11Screen() const; +#endif + + friend class TQFontMetrics; + friend class TQFontInfo; + friend class TQPainter; + friend class TQPSPrinterFont; + friend class TQApplication; + friend class TQWidget; + friend class TQTextFormatCollection; + friend class TQTextLayout; + friend class TQTextItem; + friend class TQGLContext; +#if defined(Q_WS_X11) && !defined(QT_NO_XFTFREETYPE) + friend TQt::HANDLE qt_xft_handle(const TQFont &font); +#endif +#ifndef QT_NO_DATASTREAM + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQFont & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQFont & ); +#endif + + TQFontPrivate *d; +}; + + +inline bool TQFont::bold() const +{ return weight() > Normal; } + + +inline void TQFont::setBold( bool enable ) +{ setWeight( enable ? Bold : Normal ); } + + + + +/***************************************************************************** + TQFont stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQFont & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQFont & ); +#endif + + +#endif // TQFONT_H diff --git a/src/kernel/ntqfontdatabase.h b/src/kernel/ntqfontdatabase.h new file mode 100644 index 000000000..482e36634 --- /dev/null +++ b/src/kernel/ntqfontdatabase.h @@ -0,0 +1,227 @@ +/**************************************************************************** +** +** Definition of the TQFontDatabase class +** +** Created : 981126 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFONTDATABASE_H +#define TQFONTDATABASE_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqfont.h" +#include "ntqvaluelist.h" +#endif // QT_H + + +#ifndef QT_NO_FONTDATABASE + +class TQFontStylePrivate; /* Don't touch! */ +struct TQtFontStyle; +struct TQtFontFamily; +struct TQtFontFoundry; +struct TQFontDef; +class TQFontEngine; +#ifdef Q_WS_QWS +class TQDiskFont; +#endif + +class TQFontDatabasePrivate; + +class Q_EXPORT TQFontDatabase +{ +public: + static TQValueList standardSizes(); + + TQFontDatabase(); + + 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); + +#ifdef Q_WS_QWS + static void qwsAddDiskFont( TQDiskFont *qdf ); +#endif + + // For source compatibility with < 3.0 +#ifndef QT_NO_COMPAT + + TQStringList families(bool) const; + TQStringList styles( const TQString &, const TQString & ) const; + TQValueList pointSizes( const TQString &, const TQString &, const TQString & ); + TQValueList smoothSizes( const TQString &, const TQString &, const TQString & ); + + TQFont font( const TQString &, const TQString &, int, const TQString &); + + bool isBitmapScalable( const TQString &, const TQString &, const TQString & ) const; + bool isSmoothlyScalable( const TQString &, const TQString &, const TQString & ) const; + bool isScalable( const TQString &, const TQString &, const TQString & ) const; + bool isFixedPitch( const TQString &, const TQString &, const TQString & ) const; + + bool italic( const TQString &, const TQString &, const TQString & ) const; + bool bold( const TQString &, const TQString &, const TQString & ) const; + int weight( const TQString &, const TQString &, const TQString & ) const; + +#endif // QT_NO_COMPAT + +private: +#if defined(Q_WS_X11) || defined(Q_WS_WIN) + static TQFontEngine *findFont( TQFont::Script script, const TQFontPrivate *fp, + const TQFontDef &request, int force_encoding_id = -1 ); +#endif // Q_WS_X11 + + static void createDatabase(); + + static void parseFontName(const TQString &name, TQString &foundry, TQString &family); + + friend struct TQFontDef; + friend class TQFontPrivate; + friend class TQFontDialog; + friend class TQFontEngineLatinXLFD; + + TQFontDatabasePrivate *d; +}; + + +#ifndef QT_NO_COMPAT + +inline TQStringList TQFontDatabase::families( bool ) const +{ + return families(); +} + +inline TQStringList TQFontDatabase::styles( const TQString &family, + const TQString & ) const +{ + return styles(family); +} + +inline TQValueList TQFontDatabase::pointSizes( const TQString &family, + const TQString &style , + const TQString & ) +{ + return pointSizes(family, style); +} + +inline TQValueList TQFontDatabase::smoothSizes( const TQString &family, + const TQString &style, + const TQString & ) +{ + return smoothSizes(family, style); +} + +inline TQFont TQFontDatabase::font( const TQString &familyName, + const TQString &style, + int pointSize, + const TQString &) +{ + return font(familyName, style, pointSize); +} + +inline bool TQFontDatabase::isBitmapScalable( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return isBitmapScalable(family, style); +} + +inline bool TQFontDatabase::isSmoothlyScalable( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return isSmoothlyScalable(family, style); +} + +inline bool TQFontDatabase::isScalable( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return isScalable(family, style); +} + +inline bool TQFontDatabase::isFixedPitch( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return isFixedPitch(family, style); +} + +inline bool TQFontDatabase::italic( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return italic(family, style); +} + +inline bool TQFontDatabase::bold( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return bold(family, style); +} + +inline int TQFontDatabase::weight( const TQString &family, + const TQString &style, + const TQString & ) const +{ + return weight(family, style); +} + +#endif // QT_NO_COMPAT + +#endif // QT_NO_FONTDATABASE + +#endif // TQFONTDATABASE_H diff --git a/src/kernel/ntqfontinfo.h b/src/kernel/ntqfontinfo.h new file mode 100644 index 000000000..175aaa320 --- /dev/null +++ b/src/kernel/ntqfontinfo.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Definition of TQFontInfo class +** +** Created : 950131 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFONTINFO_H +#define TQFONTINFO_H + +#ifndef QT_H +#include "ntqfont.h" +#endif // QT_H + + +class Q_EXPORT TQFontInfo +{ +public: + TQFontInfo( const TQFont & ); + TQFontInfo( const TQFont &, TQFont::Script ); + TQFontInfo( const TQFontInfo & ); + ~TQFontInfo(); + + TQFontInfo &operator=( 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; + + +private: + TQFontInfo( const TQPainter * ); + + TQFontPrivate *d; + TQPainter *painter; + int fscript; + + friend class TQWidget; + friend class TQPainter; +}; + + +inline bool TQFontInfo::bold() const +{ return weight() > TQFont::Normal; } + + +#endif // TQFONTINFO_H diff --git a/src/kernel/ntqfontmetrics.h b/src/kernel/ntqfontmetrics.h new file mode 100644 index 000000000..7c8c7b610 --- /dev/null +++ b/src/kernel/ntqfontmetrics.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Definition of TQFontMetrics class +** +** Created : 940514 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFONTMETRICS_H +#define TQFONTMETRICS_H + +#ifndef QT_H +#include "ntqfont.h" +#include "ntqrect.h" +#endif // QT_H + +#ifdef Q_WS_QWS +class TQFontEngine; +#endif + +class TQTextCodec; +class TQTextParag; + +class Q_EXPORT TQFontMetrics +{ +public: + TQFontMetrics( const TQFont & ); + TQFontMetrics( const TQFont &, TQFont::Script ); + TQFontMetrics( const TQFontMetrics & ); + ~TQFontMetrics(); + + TQFontMetrics &operator=( 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 len = -1 ) const; + + int width( TQChar ) const; +#ifndef QT_NO_COMPAT + int width( char c ) const { return width( (TQChar) c ); } +#endif + + int charWidth( const TQString &str, int pos ) const; + TQRect boundingRect( const TQString &, int len = -1 ) const; + TQRect boundingRect( TQChar ) const; + TQRect boundingRect( int x, int y, int w, int h, int flags, + const TQString& str, int len=-1, int tabstops=0, + int *tabarray=0, TQTextParag **intern=0 ) const; + TQSize size( int flags, + const TQString& str, int len=-1, int tabstops=0, + int *tabarray=0, TQTextParag **intern=0 ) const; + + int underlinePos() const; + int overlinePos() const; + int strikeOutPos() const; + int lineWidth() const; + +private: + TQFontMetrics( const TQPainter * ); + + friend class TQWidget; + friend class TQPainter; + friend class TQTextFormat; +#if defined( Q_WS_MAC ) + friend class TQFontPrivate; +#endif + + TQFontPrivate *d; + TQPainter *painter; + int fscript; +}; + + +#endif // TQFONTMETRICS_H diff --git a/src/kernel/ntqgif.h b/src/kernel/ntqgif.h new file mode 100644 index 000000000..f5fee77be --- /dev/null +++ b/src/kernel/ntqgif.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** To enable built-in reading of GIF images in TQt, change the definition +** below to "#define QT_BUILTIN_GIF_READER 1". +** +** To disable built-in reading of GIF images in TQt, change the definition +** below to "#define QT_BUILTIN_GIF_READER 0". +** +** WARNING: +** A separate license from Unisys may be required to use the gif +** reader. See http://www.unisys.com/about__unisys/lzw/ +** for information from Unisys +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGIF_H +#define TQGIF_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#ifndef QT_BUILTIN_GIF_READER +#define QT_BUILTIN_GIF_READER 0 +#endif + +bool qt_builtin_gif_reader(); + +#endif // TQGIF_H diff --git a/src/kernel/ntqgplugin.h b/src/kernel/ntqgplugin.h new file mode 100644 index 000000000..d7bbcbee0 --- /dev/null +++ b/src/kernel/ntqgplugin.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** ... +** +** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGPLUGIN_H +#define TQGPLUGIN_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the TQt API. It exists for the convenience +// of a number of TQt sources files. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// +// + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H + +#ifndef QT_NO_COMPONENT + +#ifndef Q_EXTERN_C +#ifdef __cplusplus +#define Q_EXTERN_C extern "C" +#else +#define Q_EXTERN_C extern +#endif +#endif + +#ifndef Q_EXPORT_PLUGIN +#if defined(QT_THREAD_SUPPORT) +#define QT_THREADED_BUILD 1 +#define Q_PLUGIN_FLAGS_STRING "11" +#else +#define QT_THREADED_BUILD 0 +#define Q_PLUGIN_FLAGS_STRING "01" +#endif + +// this is duplicated at Q_UCM_VERIFICATION_DATA in qcom_p.h +// NOTE: if you change pattern, you MUST change the pattern in +// qcomlibrary.cpp as well. changing the pattern will break all +// backwards compatibility as well (no old plugins will be loaded). +#ifndef Q_PLUGIN_VERIFICATION_DATA +# define Q_PLUGIN_VERIFICATION_DATA \ + static const char *qt_ucm_verification_data = \ + "pattern=""QT_UCM_VERIFICATION_DATA""\n" \ + "version="QT_VERSION_STR"\n" \ + "flags="Q_PLUGIN_FLAGS_STRING"\n" \ + "buildkey="QT_BUILD_KEY"\0"; +#endif // Q_PLUGIN_VERIFICATION_DATA + +#define Q_PLUGIN_INSTANTIATE( IMPLEMENTATION ) \ + { \ + IMPLEMENTATION *i = new IMPLEMENTATION; \ + return i->iface(); \ + } + +#if defined(Q_WS_WIN) && defined(Q_CC_BOR) +# define Q_STDCALL __stdcall +#else +# define Q_STDCALL +#endif + +#define Q_EXPORT_PLUGIN(PLUGIN) \ + Q_PLUGIN_VERIFICATION_DATA \ + Q_EXTERN_C Q_EXPORT \ + const char * Q_STDCALL qt_ucm_query_verification_data() \ + { return qt_ucm_verification_data; } \ + Q_EXTERN_C Q_EXPORT TQUnknownInterface* Q_STDCALL ucm_instantiate() \ + Q_PLUGIN_INSTANTIATE( PLUGIN ) +#endif + +struct TQUnknownInterface; + +class Q_EXPORT TQGPlugin : public TQObject +{ + Q_OBJECT +public: + TQGPlugin( TQUnknownInterface *i ); + ~TQGPlugin(); + + TQUnknownInterface* iface(); + void setIface( TQUnknownInterface *iface ); + +private: + TQGPlugin(); + TQUnknownInterface* _iface; +}; + +#endif // QT_NO_COMPONENT + +#endif // TQGPLUGIN_H diff --git a/src/kernel/ntqguardedptr.h b/src/kernel/ntqguardedptr.h new file mode 100644 index 000000000..21a4d154f --- /dev/null +++ b/src/kernel/ntqguardedptr.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Definition of TQGuardedPtr class +** +** Created : 990929 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGUARDEDPTR_H +#define TQGUARDEDPTR_H + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H + +// ### 4.0: rename to something without Private in it. Not really internal. +class Q_EXPORT TQGuardedPtrPrivate : public TQObject, public TQShared +{ + Q_OBJECT +public: + TQGuardedPtrPrivate( TQObject* ); + ~TQGuardedPtrPrivate(); + + TQObject* object() const; + void reconnect( TQObject* ); + +private slots: + void objectDestroyed(); + +private: + TQObject* obj; +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQGuardedPtrPrivate( const TQGuardedPtrPrivate & ); + TQGuardedPtrPrivate &operator=( const TQGuardedPtrPrivate & ); +#endif +}; + +template +class TQGuardedPtr +{ +public: + TQGuardedPtr() : priv( new TQGuardedPtrPrivate( 0 ) ) {} + + TQGuardedPtr( T* o) { + priv = new TQGuardedPtrPrivate( (TQObject*)o ); + } + + TQGuardedPtr(const TQGuardedPtr &p) { + priv = p.priv; + ref(); + } + + ~TQGuardedPtr() { deref(); } + + TQGuardedPtr &operator=(const TQGuardedPtr &p) { + if ( priv != p.priv ) { + deref(); + priv = p.priv; + ref(); + } + return *this; + } + + TQGuardedPtr &operator=(T* o) { + if ( priv && priv->count == 1 ) { + priv->reconnect( (TQObject*)o ); + } else { + deref(); + priv = new TQGuardedPtrPrivate( (TQObject*)o ); + } + return *this; + } + + bool operator==( const TQGuardedPtr &p ) const { + return (T*)(*this) == (T*) p; + } + + bool operator!= ( const TQGuardedPtr& p ) const { + return !( *this == p ); + } + + bool isNull() const { return !priv || !priv->object(); } + + T* operator->() const { return (T*)(priv?priv->object():0); } + + T& operator*() const { return *((T*)(priv?priv->object():0)); } + + operator T*() const { return (T*)(priv?priv->object():0); } + +private: + + void ref() { if (priv) priv->ref(); } + + void deref() { + if ( priv && priv->deref() ) + delete priv; + } + + TQGuardedPtrPrivate* priv; +}; + + + + +inline TQObject* TQGuardedPtrPrivate::object() const +{ + return obj; +} + +#define Q_DEFINED_QGUARDEDPTR +#include "ntqwinexport.h" +#endif diff --git a/src/kernel/ntqiconset.h b/src/kernel/ntqiconset.h new file mode 100644 index 000000000..7ecbfa52a --- /dev/null +++ b/src/kernel/ntqiconset.h @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Definition of TQIconSet class +** +** Created : 980318 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQICONSET_H +#define TQICONSET_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqpixmap.h" +#endif // QT_H + +#ifndef QT_NO_ICONSET + +class TQIconFactory; +class TQIconSetPrivate; + +// ### Remove all 'virtual' functions in TQIconSet (but not TQIconFactory) in TQt 4.0 +class Q_EXPORT TQIconSet +{ +public: + // the implementation makes assumptions about the value of these + enum Size { Automatic, Small, Large }; + enum Mode { Normal, Disabled, Active }; + enum State { On, Off }; + + TQIconSet(); + TQIconSet( const TQPixmap& pixmap, Size size = Automatic ); + TQIconSet( const TQPixmap& smallPix, const TQPixmap& largePix ); + TQIconSet( const TQIconSet& other ); + virtual ~TQIconSet(); + + void reset( const TQPixmap& pixmap, Size size ); + + virtual void setPixmap( const TQPixmap& pixmap, Size size, + Mode mode = Normal, State state = Off ); + virtual void setPixmap( const TQString& fileName, Size size, + Mode mode = Normal, State state = Off ); + TQPixmap pixmap( Size size, Mode mode, State state = Off ) const; + TQPixmap pixmap( Size size, bool enabled, State state = Off ) const; + TQPixmap pixmap() const; + bool isGenerated( Size size, Mode mode, State state = Off ) const; + void clearGenerated(); + void installIconFactory( TQIconFactory *factory ); + + bool isNull() const; + + void detach(); + + TQIconSet& operator=( const TQIconSet& other ); + + // static functions + static void setIconSize( Size which, const TQSize& size ); + static const TQSize& iconSize( Size which ); + +#ifndef Q_QDOC + Q_DUMMY_COMPARISON_OPERATOR(TQIconSet) +#endif + +private: + void normalize( Size& which, const TQSize& pixSize ); + TQPixmap *createScaled( Size size, const TQPixmap *suppliedPix ) const; + TQPixmap *createDisabled( Size size, State state ) const; + + TQIconSetPrivate *d; +}; + +class Q_EXPORT TQIconFactory : private TQShared +{ +public: + TQIconFactory(); + virtual ~TQIconFactory(); + + virtual TQPixmap *createPixmap( const TQIconSet& iconSet, TQIconSet::Size size, + TQIconSet::Mode mode, TQIconSet::State state ); + void setAutoDelete( bool autoDelete ) { autoDel = autoDelete; } + bool autoDelete() const { return autoDel; } + + static TQIconFactory *defaultFactory(); + static void installDefaultFactory( TQIconFactory *factory ); + +private: +#if defined(Q_DISABLE_COPY) + TQIconFactory( const TQIconFactory & ); + TQIconFactory &operator=( const TQIconFactory & ); +#endif + + friend class TQIconSet; + friend class TQIconSetPrivate; + + uint autoDel : 1; + uint unused : 31; +}; + +#endif // QT_NO_ICONSET +#endif diff --git a/src/kernel/ntqimage.h b/src/kernel/ntqimage.h new file mode 100644 index 000000000..34b585b7e --- /dev/null +++ b/src/kernel/ntqimage.h @@ -0,0 +1,425 @@ +/**************************************************************************** +** +** Definition of TQImage and TQImageIO classes +** +** Created : 950207 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQIMAGE_H +#define TQIMAGE_H + +#ifndef QT_H +#include "ntqpixmap.h" +#include "ntqstrlist.h" +#include "ntqstringlist.h" +#endif // QT_H + +class TQImageDataMisc; // internal +#ifndef QT_NO_IMAGE_TEXT +class Q_EXPORT TQImageTextKeyLang { +public: + TQImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { } + TQImageTextKeyLang() { } + + TQCString key; + TQCString lang; + + bool operator< (const TQImageTextKeyLang& other) const + { return (key < other.key) || ((key==other.key) && (lang < other.lang)); } + bool operator== (const TQImageTextKeyLang& other) const + { return (key==other.key) && (lang==other.lang); } +}; +#endif //QT_NO_IMAGE_TEXT + + +class Q_EXPORT TQImage +{ +public: + enum Endian { IgnoreEndian, BigEndian, LittleEndian }; + + TQImage(); + TQImage( int width, int height, int depth, int numColors=0, + Endian bitOrder=IgnoreEndian ); + TQImage( const TQSize&, int depth, int numColors=0, + Endian bitOrder=IgnoreEndian ); +#ifndef QT_NO_IMAGEIO + TQImage( const TQString &fileName, const char* format=0 ); + TQImage( const char * const xpm[] ); + TQImage( const TQByteArray &data ); +#endif + TQImage( uchar* data, int w, int h, int depth, + TQRgb* colortable, int numColors, + Endian bitOrder ); +#ifdef Q_WS_QWS + TQImage( uchar* data, int w, int h, int depth, int pbl, + TQRgb* colortable, int numColors, + Endian bitOrder ); +#endif + TQImage( const TQImage & ); + ~TQImage(); + + TQImage &operator=( const TQImage & ); + TQImage &operator=( const TQPixmap & ); + bool operator==( const TQImage & ) const; + bool operator!=( const TQImage & ) const; + void detach(); + TQImage copy() const; + TQImage copy(int x, int y, int w, int h, int conversion_flags=0) const; + TQImage copy(const TQRect&) const; +#ifndef QT_NO_MIME + static TQImage fromMimeSource( const TQString& abs_name ); +#endif + bool isNull() const { return data->bits == 0; } + + int width() const { return data->w; } + int height() const { return data->h; } + TQSize size() const { return TQSize(data->w,data->h); } + TQRect rect() const { return TQRect(0,0,data->w,data->h); } + int depth() const { return data->d; } + int numColors() const { return data->ncols; } + Endian bitOrder() const { return (Endian) data->bitordr; } + + TQRgb color( int i ) const; + void setColor( int i, TQRgb c ); + void setNumColors( int ); + + bool hasAlphaBuffer() const; + void setAlphaBuffer( bool ); + + bool allGray() const; + bool isGrayscale() const; + + uchar *bits() const; + uchar *scanLine( int ) const; + uchar **jumpTable() const; + TQRgb *colorTable() const; + int numBytes() const; + int bytesPerLine() const; + +#ifdef Q_WS_QWS + TQGfx * graphicsContext(); +#endif + + bool create( int width, int height, int depth, int numColors=0, + Endian bitOrder=IgnoreEndian ); + bool create( const TQSize&, int depth, int numColors=0, + Endian bitOrder=IgnoreEndian ); + void reset(); + + void fill( uint pixel ); + void invertPixels( bool invertAlpha = TRUE ); + + TQImage convertDepth( int ) const; +#ifndef QT_NO_IMAGE_TRUECOLOR + TQImage convertDepthWithPalette( int, TQRgb* p, int pc, int cf=0 ) const; +#endif + TQImage convertDepth( int, int conversion_flags ) const; + TQImage convertBitOrder( Endian ) const; + + enum ScaleMode { + ScaleFree, + ScaleMin, + ScaleMax + }; +#ifndef QT_NO_IMAGE_SMOOTHSCALE + TQImage smoothScale( int w, int h, ScaleMode mode=ScaleFree ) const; + TQImage smoothScale( const TQSize& s, ScaleMode mode=ScaleFree ) const; +#endif +#ifndef QT_NO_IMAGE_TRANSFORMATION + TQImage scale( int w, int h, ScaleMode mode=ScaleFree ) const; + TQImage scale( const TQSize& s, ScaleMode mode=ScaleFree ) const; + TQImage scaleWidth( int w ) const; + TQImage scaleHeight( int h ) const; + TQImage xForm( const TQWMatrix &matrix ) const; +#endif + +#ifndef QT_NO_IMAGE_DITHER_TO_1 + TQImage createAlphaMask( int conversion_flags=0 ) const; +#endif +#ifndef QT_NO_IMAGE_HEURISTIC_MASK + TQImage createHeuristicMask( bool clipTight=TRUE ) const; +#endif +#ifndef QT_NO_IMAGE_MIRROR + TQImage mirror() const; + TQImage mirror(bool horizontally, bool vertically) const; +#endif + TQImage swapRGB() const; + + static Endian systemBitOrder(); + static Endian systemByteOrder(); + +#ifndef QT_NO_IMAGEIO + static const char* imageFormat( const TQString &fileName ); + static TQStrList inputFormats(); + static TQStrList outputFormats(); +#ifndef QT_NO_STRINGLIST + static TQStringList inputFormatList(); + static TQStringList outputFormatList(); +#endif + bool load( const TQString &fileName, const char* format=0 ); + bool loadFromData( const uchar *buf, uint len, + const char *format=0 ); + bool loadFromData( TQByteArray data, const char* format=0 ); + bool save( const TQString &fileName, const char* format, + int quality=-1 ) const; + bool save( TQIODevice * device, const char* format, + int quality=-1 ) const; +#endif //QT_NO_IMAGEIO + + bool valid( int x, int y ) const; + int pixelIndex( int x, int y ) const; + TQRgb pixel( int x, int y ) const; + void setPixel( int x, int y, uint index_or_rgb ); + + // Auxiliary data + int dotsPerMeterX() const; + int dotsPerMeterY() const; + void setDotsPerMeterX(int); + void setDotsPerMeterY(int); + TQPoint offset() const; + void setOffset(const TQPoint&); +#ifndef QT_NO_IMAGE_TEXT + TQValueList textList() const; + TQStringList textLanguages() const; + TQStringList textKeys() const; + TQString text(const char* key, const char* lang=0) const; + TQString text(const TQImageTextKeyLang&) const; + void setText(const char* key, const char* lang, const TQString&); +#endif +private: + void init(); + void reinit(); + void freeBits(); + static void warningIndexRange( const char *, int ); + + struct TQImageData : public TQShared { // internal image data + int w; // image width + int h; // image height + int d; // image depth + int ncols; // number of colors + int nbytes; // number of bytes data + int bitordr; // bit order (1 bit depth) + TQRgb *ctbl; // color table + uchar **bits; // image data + bool alpha; // alpha buffer + int dpmx; // dots per meter X (or 0) + int dpmy; // dots per meter Y (or 0) + TQPoint offset; // offset in pixels +#ifndef QT_NO_IMAGE_TEXT + TQImageDataMisc* misc; // less common stuff +#endif + bool ctbl_mine; // this allocated ctbl + } *data; +#ifndef QT_NO_IMAGE_TEXT + TQImageDataMisc& misc() const; +#endif +#ifndef QT_NO_IMAGEIO + bool doImageIO( TQImageIO* io, int quality ) const; +#endif + friend Q_EXPORT void bitBlt( TQImage* dst, int dx, int dy, + const TQImage* src, int sx, int sy, + int sw, int sh, int conversion_flags ); +}; + + +// TQImage stream functions + +#if !defined(QT_NO_DATASTREAM) && !defined(QT_NO_IMAGEIO) +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQImage & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQImage & ); +#endif + +#ifndef QT_NO_IMAGEIO +class TQIODevice; +typedef void (*image_io_handler)( TQImageIO * ); // image IO handler + + +struct TQImageIOData; + + +class Q_EXPORT TQImageIO +{ +public: + TQImageIO(); + TQImageIO( TQIODevice *ioDevice, const char *format ); + TQImageIO( const TQString &fileName, const char* format ); + ~TQImageIO(); + + + const TQImage &image() const { return im; } + int status() const { return iostat; } + const char *format() const { return frmt; } + TQIODevice *ioDevice() const { return iodev; } + TQString fileName() const { return fname; } + int quality() const; + TQString description() const { return descr; } + 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 &fileName ); + static const char *imageFormat( TQIODevice * ); + static TQStrList inputFormats(); + static TQStrList outputFormats(); + + static void defineIOHandler( const char *format, + const char *header, + const char *flags, + image_io_handler read_image, + image_io_handler write_image ); + +private: + void init(); + + TQImage im; // image + int iostat; // IO status + TQCString frmt; // image format + TQIODevice *iodev; // IO device + TQString fname; // file name + char *params; // image parameters //### change to TQImageIOData *d in 3.0 + TQString descr; // image description + TQImageIOData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQImageIO( const TQImageIO & ); + TQImageIO &operator=( const TQImageIO & ); +#endif +}; + +#endif //QT_NO_IMAGEIO + +Q_EXPORT void bitBlt( TQImage* dst, int dx, int dy, const TQImage* src, + int sx=0, int sy=0, int sw=-1, int sh=-1, + int conversion_flags=0 ); + + +/***************************************************************************** + TQImage member functions + *****************************************************************************/ + +inline bool TQImage::hasAlphaBuffer() const +{ + return data->alpha; +} + +inline uchar *TQImage::bits() const +{ + return data->bits ? data->bits[0] : 0; +} + +inline uchar **TQImage::jumpTable() const +{ + return data->bits; +} + +inline TQRgb *TQImage::colorTable() const +{ + return data->ctbl; +} + +inline int TQImage::numBytes() const +{ + return data->nbytes; +} + +inline int TQImage::bytesPerLine() const +{ + return data->h ? data->nbytes/data->h : 0; +} + +inline TQImage TQImage::copy(const TQRect& r) const +{ + return copy(r.x(), r.y(), r.width(), r.height()); +} + +inline TQRgb TQImage::color( int i ) const +{ +#if defined(QT_CHECK_RANGE) + if ( i >= data->ncols ) + warningIndexRange( "color", i ); +#endif + return data->ctbl ? data->ctbl[i] : (TQRgb)-1; +} + +inline void TQImage::setColor( int i, TQRgb c ) +{ +#if defined(QT_CHECK_RANGE) + if ( i >= data->ncols ) + warningIndexRange( "setColor", i ); +#endif + if ( data->ctbl ) + data->ctbl[i] = c; +} + +inline uchar *TQImage::scanLine( int i ) const +{ +#if defined(QT_CHECK_RANGE) + if ( i >= data->h ) + warningIndexRange( "scanLine", i ); +#endif + return data->bits ? data->bits[i] : 0; +} + +inline int TQImage::dotsPerMeterX() const +{ + return data->dpmx; +} + +inline int TQImage::dotsPerMeterY() const +{ + return data->dpmy; +} + +inline TQPoint TQImage::offset() const +{ + return data->offset; +} + + +#endif // TQIMAGE_H diff --git a/src/kernel/ntqimageformatplugin.h b/src/kernel/ntqimageformatplugin.h new file mode 100644 index 000000000..db9fb3806 --- /dev/null +++ b/src/kernel/ntqimageformatplugin.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Definition of ??? +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQIMAGEFORMATPLUGIN_H +#define TQIMAGEFORMATPLUGIN_H + +#ifndef QT_H +#include "ntqgplugin.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_IMAGEFORMATPLUGIN +class TQImageFormat; +class TQImageFormatPluginPrivate; + +class Q_EXPORT TQImageFormatPlugin : public TQGPlugin +{ + Q_OBJECT +public: + TQImageFormatPlugin(); + ~TQImageFormatPlugin(); + + virtual TQStringList keys() const = 0; + virtual bool loadImage( const TQString &format, const TQString &filename, TQImage *image ); + virtual bool saveImage( const TQString &format, const TQString &filename, const TQImage &image ); + virtual bool installIOHandler( const TQString &format ) = 0; + +private: + TQImageFormatPluginPrivate *d; +}; +#endif // QT_NO_IMAGEFORMATPLUGIN +#endif // TQIMAGEFORMATPLUGIN_H diff --git a/src/kernel/ntqinputcontext.h b/src/kernel/ntqinputcontext.h new file mode 100644 index 000000000..cc3eafae9 --- /dev/null +++ b/src/kernel/ntqinputcontext.h @@ -0,0 +1,143 @@ +/**************************************************************************** +** $Id: ntqinputcontext.h,v 1.8 2004/06/22 06:47:30 daisuke Exp $ +** +** Definition of TQInputContext +** +** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef TQINPUTCONTEXT_H +#define TQINPUTCONTEXT_H + +#ifndef QT_NO_IM + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqglobal.h" +#include "ntqevent.h" +#include "ntqstring.h" +#if (QT_VERSION-0 >= 0x040000) +#include "ntqlist.h" +#include "ntqaction.h" +#else +#include "ntqptrlist.h" +#endif +#endif + +class TQWidget; +class TQFont; +class TQPopupMenu; +class TQInputContextPrivate; + + +struct TQInputContextMenu { + enum Action { + NoSeparator, + InsertSeparator + }; +#if !(QT_VERSION-0 >= 0x040000) + TQString title; + TQPopupMenu *popup; +#endif +}; + + +class TQInputContext : public TQObject +{ + Q_OBJECT +public: + TQInputContext( TQObject *parent = 0 ); + virtual ~TQInputContext(); + + virtual TQString identifierName(); + virtual TQString language(); + +#if defined(Q_WS_X11) + virtual bool x11FilterEvent( TQWidget *keywidget, XEvent *event ); +#endif // Q_WS_X11 + virtual bool filterEvent( const TQEvent *event ); + virtual void reset(); + + virtual void setFocus(); + virtual void unsetFocus(); + virtual void setMicroFocus( int x, int y, int w, int h, TQFont *f = 0 ); + virtual void mouseHandler( int x, TQEvent::Type type, + TQt::ButtonState button, TQt::ButtonState state ); + virtual TQFont font() const; + virtual bool isComposing() const; + virtual bool isPreeditRelocationEnabled(); + +#if (QT_VERSION-0 >= 0x040000) + virtual TQList actions(); + void addActionsTo( TQMenu *menu, TQInputContextMenu::Action action = TQInputContextMenu::InsertSeparator ); +#else + virtual TQPtrList *menus(); + void addMenusTo( TQPopupMenu *popup, TQInputContextMenu::Action action = TQInputContextMenu::InsertSeparator ); +#endif + +#if defined(Q_WS_X11) + // these functions are not recommended for ordinary use + virtual TQWidget *focusWidget() const; + virtual TQWidget *holderWidget() const; + + // these functions must not be used by ordinary input method + virtual void setFocusWidget( TQWidget *w ); + virtual void setHolderWidget( TQWidget *w ); + virtual void releaseComposingWidget( TQWidget *w ); +#endif + +signals: + void deletionRequested(); + void imEventGenerated( TQObject *receiver, TQIMEvent *e ); + +protected: + virtual void sendIMEvent( TQEvent::Type type, + const TQString &text = TQString::null, + int cursorPosition = -1, int selLength = 0 ); + +private: + void sendIMEventInternal( TQEvent::Type type, + const TQString &text = TQString::null, + int cursorPosition = -1, int selLength = 0 ); + + TQInputContextPrivate *d; + + friend class TQWidget; + friend class TQInputContextFactory; + +private: // Disabled copy constructor and operator= + TQInputContext( const TQInputContext & ); + TQInputContext &operator=( const TQInputContext & ); + +}; + +#endif //Q_NO_IM + +#endif // TQINPUTCONTEXT_H diff --git a/src/kernel/ntqjpegio.h b/src/kernel/ntqjpegio.h new file mode 100644 index 000000000..43e240296 --- /dev/null +++ b/src/kernel/ntqjpegio.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Definition of JPEG TQImage IOHandler +** +** Created : 970621 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQJPEGIO_H +#define TQJPEGIO_H + +#include "ntqglobal.h" + +#ifndef QT_NO_IMAGEIO_JPEG + +void qInitJpegIO(); + +#endif // QT_NO_IMAGEIO_JPEG + +#endif // TQJPEGIO_H diff --git a/src/kernel/ntqkeycode.h b/src/kernel/ntqkeycode.h new file mode 100644 index 000000000..bca9305ba --- /dev/null +++ b/src/kernel/ntqkeycode.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Definition of keyboard codes +** +** Created : 931030 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQKEYCODE_H +#define TQKEYCODE_H + +#ifndef QT_H +#include "ntqnamespace.h" +#endif // QT_H + +// all key codes are now in the TQt namespace class + +#endif // TQKEYCODE_H diff --git a/src/kernel/ntqkeysequence.h b/src/kernel/ntqkeysequence.h new file mode 100644 index 000000000..f77bebc59 --- /dev/null +++ b/src/kernel/ntqkeysequence.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Definition of TQKeySequence class +** +** Created : 0108007 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQKEYSETQUENCE_H +#define TQKEYSETQUENCE_H + +#ifndef QT_H +#ifndef QT_H +#include "ntqnamespace.h" +#include "ntqstring.h" +#endif // QT_H +#endif + +#ifndef QT_NO_ACCEL + +/***************************************************************************** + TQKeySequence stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +class TQKeySequence; +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQKeySequence & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQKeySequence & ); +#endif + +class TQKeySequencePrivate; + +class Q_EXPORT TQKeySequence : public TQt +{ +public: + TQKeySequence(); + TQKeySequence( const TQString& key ); + TQKeySequence( int key ); + TQKeySequence( int k1, int k2, int k3 = 0, int k4 = 0 ); + TQKeySequence( const TQKeySequence & ); + ~TQKeySequence(); + + uint count() const; + bool isEmpty() const; + TQt::SequenceMatch matches( const TQKeySequence & ) const; + + operator TQString() const; + operator int () const; + int operator[]( uint ) const; + TQKeySequence &operator=( const TQKeySequence & ); + bool operator==( const TQKeySequence& ) const; + bool operator!= ( const TQKeySequence& ) const; + +private: + static int decodeString( const TQString & ); + static TQString encodeString( int ); + int assign( TQString ); + void setKey( int key, int index ); + + TQKeySequencePrivate* d; + + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQKeySequence & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQKeySequence & ); + friend class TQAccelManager; +}; + +#else + +class Q_EXPORT TQKeySequence : public TQt +{ +public: + TQKeySequence() {} + TQKeySequence( int ) {} +}; + +#endif //QT_NO_ACCEL + +#endif diff --git a/src/kernel/ntqlayout.h b/src/kernel/ntqlayout.h new file mode 100644 index 000000000..c461724a1 --- /dev/null +++ b/src/kernel/ntqlayout.h @@ -0,0 +1,473 @@ +/**************************************************************************** +** +** Definition of layout classes +** +** Created : 960416 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLAYOUT_H +#define TQLAYOUT_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqsizepolicy.h" +#include "ntqwidget.h" +#endif // QT_H + +#include + +#ifndef QT_NO_LAYOUT + +#if 0 +Q_OBJECT +#endif + +static const int TQLAYOUTSIZE_MAX = INT_MAX/256/16; + +class TQGridLayoutBox; +class TQGridLayoutData; +class TQLayout; +class TQLayoutItem; +struct TQLayoutData; +class TQMenuBar; +class TQSpacerItem; +class TQWidget; + +class Q_EXPORT TQGLayoutIterator : public TQShared +{ +public: + virtual ~TQGLayoutIterator(); + virtual TQLayoutItem *next() = 0; + virtual TQLayoutItem *current() = 0; + virtual TQLayoutItem *takeCurrent() = 0; +}; + +class Q_EXPORT TQLayoutIterator +{ +public: + TQLayoutIterator( TQGLayoutIterator *i ) : it( i ) { } + TQLayoutIterator( const TQLayoutIterator &i ) : it( i.it ) { + if ( it ) + it->ref(); + } + ~TQLayoutIterator() { if ( it && it->deref() ) delete it; } + TQLayoutIterator &operator=( const TQLayoutIterator &i ) { + if ( i.it ) + i.it->ref(); + if ( it && it->deref() ) + delete it; + it = i.it; + return *this; + } + TQLayoutItem *operator++() { return it ? it->next() : 0; } + TQLayoutItem *current() { return it ? it->current() : 0; } + TQLayoutItem *takeCurrent() { return it ? it->takeCurrent() : 0; } + void deleteCurrent(); + +private: + TQGLayoutIterator *it; +}; + +class Q_EXPORT TQLayoutItem +{ +public: + TQLayoutItem( int alignment = 0 ) : align( alignment ) { } + virtual ~TQLayoutItem(); + 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; + // ### add minimumHeightForWidth( int ) in TQt 4.0 + virtual void invalidate(); + + virtual TQWidget *widget(); + virtual TQLayoutIterator iterator(); + virtual TQLayout *layout(); + virtual TQSpacerItem *spacerItem(); + + int alignment() const { return align; } + virtual void setAlignment( int a ); + +protected: + int align; +}; + +class Q_EXPORT TQSpacerItem : public TQLayoutItem +{ +public: + TQSpacerItem( int w, int h, + TQSizePolicy::SizeType hData = TQSizePolicy::Minimum, + TQSizePolicy::SizeType vData = TQSizePolicy::Minimum ) + : width( w ), height( h ), sizeP( hData, vData ) { } + void changeSize( int w, int h, + TQSizePolicy::SizeType hData = TQSizePolicy::Minimum, + TQSizePolicy::SizeType vData = 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(); + +private: + int width; + int height; + TQSizePolicy sizeP; + TQRect rect; +}; + +class Q_EXPORT TQWidgetItem : public TQLayoutItem +{ +public: + TQWidgetItem( TQWidget *w ) : wid( w ) { } + 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; + +private: + TQWidget *wid; +}; + +class Q_EXPORT TQLayout : public TQObject, public TQLayoutItem +{ + Q_OBJECT + Q_ENUMS( ResizeMode ) + Q_PROPERTY( int margin READ margin WRITE setMargin ) + Q_PROPERTY( int spacing READ spacing WRITE setSpacing ) + Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode ) + +public: + // ### TQt 4.0: put 'Auto' first in enum + enum ResizeMode { FreeResize, Minimum, Fixed, Auto }; + + TQLayout( TQWidget *parent, int margin = 0, int spacing = -1, + const char *name = 0 ); + TQLayout( TQLayout *parentLayout, int spacing = -1, const char *name = 0 ); + TQLayout( int spacing = -1, const char *name = 0 ); + ~TQLayout(); + + int margin() const { return outsideBorder; } + int spacing() const { return insideSpacing; } + + virtual void setMargin( int ); + virtual void setSpacing( int ); + + int defaultBorder() const { return insideSpacing; } + void freeze( int w, int h ); + void freeze() { setResizeMode( Fixed ); } + + void setResizeMode( ResizeMode ); + ResizeMode resizeMode() const; + +#ifndef QT_NO_MENUBAR + virtual void setMenuBar( TQMenuBar *w ); + TQMenuBar *menuBar() const { return menubar; } +#endif + + TQWidget *mainWidget(); + bool isTopLevel() const { return topLevel; } + + virtual void setAutoAdd( bool ); + bool autoAdd() const { return autoNewChild; } + + void invalidate(); + TQRect geometry() const; + bool activate(); + + void add( TQWidget *w ) { addItem( new TQWidgetItem(w) ); } + virtual void addItem( TQLayoutItem * ) = 0; + + void remove( TQWidget *w ); + void removeItem( TQLayoutItem * ); + + TQSizePolicy::ExpandData expanding() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + void setGeometry( const TQRect& ) = 0; + TQLayoutIterator iterator() = 0; + bool isEmpty() const; + + int totalHeightForWidth( int w ) const; + TQSize totalMinimumSize() const; + TQSize totalMaximumSize() const; + TQSize totalSizeHint() const; + TQLayout *layout(); + + bool supportsMargin() const { return marginImpl; } + + void setEnabled( bool ); + bool isEnabled() const; + +protected: + bool eventFilter( TQObject *, TQEvent * ); + void childEvent( TQChildEvent *e ); + void addChildLayout( TQLayout *l ); + void deleteAllItems(); + + void setSupportsMargin( bool ); + TQRect alignmentRect( const TQRect& ) const; + +private: + void setWidgetLayout( TQWidget *, TQLayout * ); + void init(); + int insideSpacing; + int outsideBorder; + uint topLevel : 1; + uint enabled : 1; + uint autoNewChild : 1; + uint frozen : 1; + uint activated : 1; + uint marginImpl : 1; + uint autoMinimum : 1; + uint autoResizeMode : 1; + TQRect rect; + TQLayoutData *extraData; +#ifndef QT_NO_MENUBAR + TQMenuBar *menubar; +#endif + +private: +#if defined(Q_DISABLE_COPY) + TQLayout( const TQLayout & ); + TQLayout &operator=( const TQLayout & ); +#endif + + static void propagateSpacing( TQLayout *layout ); +}; + +inline void TQLayoutIterator::deleteCurrent() +{ + delete takeCurrent(); +} + +class Q_EXPORT TQGridLayout : public TQLayout +{ + Q_OBJECT +public: + TQGridLayout( TQWidget *parent, int nRows = 1, int nCols = 1, int border = 0, + int spacing = -1, const char *name = 0 ); + TQGridLayout( int nRows = 1, int nCols = 1, int spacing = -1, + const char *name = 0 ); + TQGridLayout( TQLayout *parentLayout, int nRows = 1, int nCols = 1, + int spacing = -1, const char *name = 0 ); + ~TQGridLayout(); + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + + // ### remove 'virtual' in 4.0 (or add 'virtual' to set{Row,Col}Spacing()) + virtual void setRowStretch( int row, int stretch ); + virtual void setColStretch( int col, int stretch ); + int rowStretch( int row ) const; + int colStretch( int col ) const; + + void setRowSpacing( int row, int minSize ); + void setColSpacing( int col, int minSize ); + int rowSpacing( int row ) const; + int colSpacing( int col ) const; + + int numRows() const; + int numCols() const; + TQRect cellGeometry( int row, int col ) const; + + bool hasHeightForWidth() const; + int heightForWidth( int ) const; + int minimumHeightForWidth( int ) const; + + TQSizePolicy::ExpandData expanding() const; + void invalidate(); + + void addItem( TQLayoutItem * ); + void addItem( TQLayoutItem *item, int row, int col ); + void addMultiCell( TQLayoutItem *, int fromRow, int toRow, + int fromCol, int toCol, int align = 0 ); + + void addWidget( TQWidget *, int row, int col, int align = 0 ); + void addMultiCellWidget( TQWidget *, int fromRow, int toRow, + int fromCol, int toCol, int align = 0 ); + void addLayout( TQLayout *layout, int row, int col); + void addMultiCellLayout( TQLayout *layout, int fromRow, int toRow, + int fromCol, int toCol, int align = 0 ); + void addRowSpacing( int row, int minsize ); + void addColSpacing( int col, int minsize ); + + void expand( int rows, int cols ); + + enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }; + void setOrigin( Corner ); + Corner origin() const; + TQLayoutIterator iterator(); + void setGeometry( const TQRect& ); + +protected: + bool findWidget( TQWidget* w, int *r, int *c ); + void add( TQLayoutItem*, int row, int col ); + +private: +#if defined(Q_DISABLE_COPY) + TQGridLayout( const TQGridLayout & ); + TQGridLayout &operator=( const TQGridLayout & ); +#endif + + void init( int rows, int cols ); + TQGridLayoutData *data; +}; + +class TQBoxLayoutData; +class TQDockWindow; + +class Q_EXPORT TQBoxLayout : public TQLayout +{ + Q_OBJECT +public: + enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, + Down = TopToBottom, Up = BottomToTop }; + + TQBoxLayout( TQWidget *parent, Direction, int border = 0, int spacing = -1, + const char *name = 0 ); + TQBoxLayout( TQLayout *parentLayout, Direction, int spacing = -1, + const char *name = 0 ); + TQBoxLayout( Direction, int spacing = -1, const char *name = 0 ); + ~TQBoxLayout(); + + void addItem( TQLayoutItem * ); + + Direction direction() const { return dir; } + void setDirection( Direction ); + + void addSpacing( int size ); + void addStretch( int stretch = 0 ); + void addWidget( TQWidget *, int stretch = 0, int alignment = 0 ); + void addLayout( TQLayout *layout, int stretch = 0 ); + void addStrut( int ); + + void insertSpacing( int index, int size ); + void insertStretch( int index, int stretch = 0 ); + void insertWidget( int index, TQWidget *widget, int stretch = 0, + int alignment = 0 ); + void insertLayout( int index, TQLayout *layout, int stretch = 0 ); + + bool setStretchFactor( TQWidget*, int stretch ); + bool setStretchFactor( TQLayout *l, int stretch ); + + 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& ); + + int findWidget( TQWidget* w ); + +protected: + void insertItem( int index, TQLayoutItem * ); + +private: + friend class TQDockWindow; +#if defined(Q_DISABLE_COPY) + TQBoxLayout( const TQBoxLayout & ); + TQBoxLayout &operator=( const TQBoxLayout & ); +#endif + + void setupGeom(); + void calcHfw( int ); + TQBoxLayoutData *data; + Direction dir; + TQBoxLayout *createTmpCopy(); +}; + +class Q_EXPORT TQHBoxLayout : public TQBoxLayout +{ + Q_OBJECT +public: + TQHBoxLayout( TQWidget *parent, int border = 0, + int spacing = -1, const char *name = 0 ); + TQHBoxLayout( TQLayout *parentLayout, + int spacing = -1, const char *name = 0 ); + TQHBoxLayout( int spacing = -1, const char *name = 0 ); + + ~TQHBoxLayout(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQHBoxLayout( const TQHBoxLayout & ); + TQHBoxLayout &operator=( const TQHBoxLayout & ); +#endif +}; + +class Q_EXPORT TQVBoxLayout : public TQBoxLayout +{ + Q_OBJECT +public: + TQVBoxLayout( TQWidget *parent, int border = 0, + int spacing = -1, const char *name = 0 ); + TQVBoxLayout( TQLayout *parentLayout, + int spacing = -1, const char *name = 0 ); + TQVBoxLayout( int spacing = -1, const char *name = 0 ); + + ~TQVBoxLayout(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQVBoxLayout( const TQVBoxLayout & ); + TQVBoxLayout &operator=( const TQVBoxLayout & ); +#endif +}; + +#endif // QT_NO_LAYOUT +#endif // TQLAYOUT_H diff --git a/src/kernel/ntqlocalfs.h b/src/kernel/ntqlocalfs.h new file mode 100644 index 000000000..ac1d6c189 --- /dev/null +++ b/src/kernel/ntqlocalfs.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Definition of TQLocalFs class +** +** Created : 950429 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLOCALFS_H +#define TQLOCALFS_H + +#ifndef QT_H +#include "ntqnetworkprotocol.h" +#include "ntqdir.h" +#endif // QT_H + +#ifndef QT_NO_NETWORKPROTOCOL + +class Q_EXPORT TQLocalFs : public TQNetworkProtocol +{ + Q_OBJECT + +public: + TQLocalFs(); + virtual int supportedOperations() const; + +protected: + virtual void operationListChildren( TQNetworkOperation *op ); + virtual void operationMkDir( TQNetworkOperation *op ); + virtual void operationRemove( TQNetworkOperation *op ); + virtual void operationRename( TQNetworkOperation *op ); + virtual void operationGet( TQNetworkOperation *op ); + virtual void operationPut( TQNetworkOperation *op ); + +private: + int calcBlockSize( int totalSize ) const; + TQDir dir; + +}; + +#endif // QT_NO_NETWORKPROTOCOL + +#endif // TQLOCALFS_H diff --git a/src/kernel/ntqmetaobject.h b/src/kernel/ntqmetaobject.h new file mode 100644 index 000000000..e269024b6 --- /dev/null +++ b/src/kernel/ntqmetaobject.h @@ -0,0 +1,286 @@ +/**************************************************************************** +** +** Definition of TQMetaObject class +** +** Created : 930419 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMETAOBJECT_H +#define TQMETAOBJECT_H + +#ifndef QT_H +#include "ntqconnection.h" +#include "ntqstrlist.h" +#endif // QT_H + +#ifndef Q_MOC_OUTPUT_REVISION +#define Q_MOC_OUTPUT_REVISION 26 +#endif + +class TQObject; +struct TQUMethod; +class TQMetaObjectPrivate; + +struct TQMetaData // - member function meta data +{ // for signal and slots + const char *name; // - member name + const TQUMethod* method; // - detailed method description + enum Access { Private, Protected, Public }; + Access access; // - access permission +}; + +#ifndef QT_NO_PROPERTIES +struct TQMetaEnum // enumerator meta data +{ // for properties + const char *name; // - enumerator name + uint count; // - number of values + struct Item // - a name/value pair + { + const char *key; + int value; + }; + const Item *items; // - the name/value pairs + bool set; // whether enum has to be treated as a set +}; +#endif + +#ifndef QT_NO_PROPERTIES + +class Q_EXPORT TQMetaProperty // property meta data +{ +public: + const char* type() const { return t; } // type of the property + const char* name() const { return n; } // name of the property + + bool writable() const; + bool isValid() const; + + bool isSetType() const; + bool isEnumType() const; + TQStrList enumKeys() const; // enumeration names + + int keyToValue( const char* key ) const; // enum and set conversion functions + const char* valueToKey( int value ) const; + int keysToValue( const TQStrList& keys ) const; + TQStrList valueToKeys( int value ) const; + + bool designable( TQObject* = 0 ) const; + bool scriptable( TQObject* = 0 ) const; + bool stored( TQObject* = 0 ) const; + + bool reset( TQObject* ) const; + + const char* t; // internal + const char* n; // internal + + enum Flags { + Invalid = 0x00000000, + Readable = 0x00000001, + Writable = 0x00000002, + EnumOrSet = 0x00000004, + UnresolvedEnum = 0x00000008, + StdSet = 0x00000100, + Override = 0x00000200 + }; + + uint flags; // internal + bool testFlags( uint f ) const; // internal + bool stdSet() const; // internal + int id() const; // internal + + TQMetaObject** meta; // internal + + const TQMetaEnum* enumData; // internal + int _id; // internal + void clear(); // internal +}; + +inline bool TQMetaProperty::testFlags( uint f ) const +{ return (flags & (uint)f) != (uint)0; } + +#endif // QT_NO_PROPERTIES + +struct TQClassInfo // class info meta data +{ + const char* name; // - name of the info + const char* value; // - value of the info +}; + +class Q_EXPORT TQMetaObject // meta object class +{ +public: + TQMetaObject( const char * const class_name, TQMetaObject *superclass, + const TQMetaData * const slot_data, int n_slots, + const TQMetaData * const signal_data, int n_signals, +#ifndef QT_NO_PROPERTIES + const TQMetaProperty *const prop_data, int n_props, + const TQMetaEnum *const enum_data, int n_enums, +#endif + const TQClassInfo *const class_info, int n_info ); + +#ifndef QT_NO_PROPERTIES + TQMetaObject( const char * const class_name, TQMetaObject *superclass, + const TQMetaData * const slot_data, int n_slots, + const TQMetaData * const signal_data, int n_signals, + const TQMetaProperty *const prop_data, int n_props, + const TQMetaEnum *const enum_data, int n_enums, + bool (*qt_static_property)(TQObject*, int, int, TQVariant*), + const TQClassInfo *const class_info, int n_info ); +#endif + + + virtual ~TQMetaObject(); + + const char *className() const { return classname; } + const char *superClassName() const { return superclassname; } + + TQMetaObject *superClass() const { return superclass; } + + bool inherits( const char* clname ) const; + + int numSlots( bool super = FALSE ) const; + int numSignals( bool super = FALSE ) const; + + int findSlot( const char *, bool super = FALSE ) const; + int findSignal( const char *, bool super = FALSE ) const; + + const TQMetaData *slot( int index, bool super = FALSE ) const; + const TQMetaData *signal( int index, bool super = FALSE ) const; + + TQStrList slotNames( bool super = FALSE ) const; + TQStrList signalNames( bool super = FALSE ) const; + + int slotOffset() const; + int signalOffset() const; + int propertyOffset() const; + + int numClassInfo( bool super = FALSE ) const; + const TQClassInfo *classInfo( int index, bool super = FALSE ) const; + const char *classInfo( const char* name, bool super = FALSE ) const; + +#ifndef QT_NO_PROPERTIES + const TQMetaProperty *property( int index, bool super = FALSE ) const; + int findProperty( const char *name, bool super = FALSE ) const; + int indexOfProperty( const TQMetaProperty*, bool super = FALSE ) const; + const TQMetaProperty* resolveProperty( const TQMetaProperty* ) const; + int resolveProperty( int ) const; + TQStrList propertyNames( bool super = FALSE ) const; + int numProperties( bool super = FALSE ) const; +#endif + + // static wrappers around constructors, necessary to work around a + // Windows-DLL limitation: objects can only be deleted within a + // DLL if they were actually created within that DLL. + static TQMetaObject *new_metaobject( const char *, TQMetaObject *, + const TQMetaData *const, int, + const TQMetaData *const, int, +#ifndef QT_NO_PROPERTIES + const TQMetaProperty *const prop_data, int n_props, + const TQMetaEnum *const enum_data, int n_enums, +#endif + const TQClassInfo *const class_info, int n_info ); +#ifndef QT_NO_PROPERTIES + static TQMetaObject *new_metaobject( const char *, TQMetaObject *, + const TQMetaData *const, int, + const TQMetaData *const, int, + const TQMetaProperty *const prop_data, int n_props, + const TQMetaEnum *const enum_data, int n_enums, + bool (*qt_static_property)(TQObject*, int, int, TQVariant*), + const TQClassInfo *const class_info, int n_info ); + TQStrList enumeratorNames( bool super = FALSE ) const; + int numEnumerators( bool super = FALSE ) const; + const TQMetaEnum *enumerator( const char* name, bool super = FALSE ) const; +#endif + + static TQMetaObject *metaObject( const char *class_name ); + static bool hasMetaObject( const char *class_name ); + +private: + TQMemberDict *init( const TQMetaData *, int ); + + const char *classname; // class name + const char *superclassname; // super class name + TQMetaObject *superclass; // super class meta object + TQMetaObjectPrivate *d; // private data for... + void *reserved; // ...binary compatibility + const TQMetaData *slotData; // slot meta data + TQMemberDict *slotDict; // slot dictionary + const TQMetaData *signalData; // signal meta data + TQMemberDict *signalDict; // signal dictionary + int signaloffset; + int slotoffset; +#ifndef QT_NO_PROPERTIES + int propertyoffset; +public: + bool qt_static_property( TQObject* o, int id, int f, TQVariant* v); +private: + friend class TQMetaProperty; +#endif + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMetaObject( const TQMetaObject & ); + TQMetaObject &operator=( const TQMetaObject & ); +#endif +}; + +inline int TQMetaObject::slotOffset() const +{ return slotoffset; } + +inline int TQMetaObject::signalOffset() const +{ return signaloffset; } + +#ifndef QT_NO_PROPERTIES +inline int TQMetaObject::propertyOffset() const +{ return propertyoffset; } +#endif + +typedef TQMetaObject *(*TQtStaticMetaObjectFunction)(); + +class Q_EXPORT TQMetaObjectCleanUp +{ +public: + TQMetaObjectCleanUp( const char *mo_name, TQtStaticMetaObjectFunction ); + TQMetaObjectCleanUp(); + ~TQMetaObjectCleanUp(); + + void setMetaObject( TQMetaObject *&mo ); + +private: + TQMetaObject **metaObject; +}; + +#endif // TQMETAOBJECT_H diff --git a/src/kernel/ntqmime.h b/src/kernel/ntqmime.h new file mode 100644 index 000000000..60fdbc247 --- /dev/null +++ b/src/kernel/ntqmime.h @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** Definition of mime classes +** +** Created : 981204 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMIME_H +#define TQMIME_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqmap.h" +#endif // QT_H + +#ifndef QT_NO_MIME + +class TQImageDrag; +class TQTextDrag; + +class Q_EXPORT TQMimeSource +{ + friend class TQClipboardData; + +public: + TQMimeSource(); + virtual ~TQMimeSource(); + virtual const char* format( int n = 0 ) const = 0; + virtual bool provides( const char* ) const; + virtual TQByteArray encodedData( const char* ) const = 0; + int serialNumber() const; + +private: + int ser_no; + enum { NoCache, Text, Graphics } cacheType; + union + { + struct + { + TQString *str; + TQCString *subtype; + } txt; + struct + { + TQImage *img; + TQPixmap *pix; + } gfx; + } cache; + void clearCache(); + + // friends for caching + friend class TQImageDrag; + friend class TQTextDrag; + +}; + +inline int TQMimeSource::serialNumber() const +{ return ser_no; } + +class TQStringList; +class TQMimeSourceFactoryData; + +class Q_EXPORT TQMimeSourceFactory { +public: + TQMimeSourceFactory(); + virtual ~TQMimeSourceFactory(); + + static TQMimeSourceFactory* defaultFactory(); + static void setDefaultFactory( TQMimeSourceFactory* ); + static TQMimeSourceFactory* takeDefaultFactory(); + static void addFactory( TQMimeSourceFactory *f ); + static void removeFactory( TQMimeSourceFactory *f ); + + virtual const TQMimeSource* data(const TQString& abs_name) const; + virtual TQString makeAbsolute(const TQString& abs_or_rel_name, const TQString& context) const; + const TQMimeSource* data(const TQString& abs_or_rel_name, const TQString& context) const; + + virtual void setText( const TQString& abs_name, const TQString& text ); + virtual void setImage( const TQString& abs_name, const TQImage& im ); + virtual void setPixmap( const TQString& abs_name, const TQPixmap& pm ); + virtual void setData( const TQString& abs_name, TQMimeSource* data ); + virtual void setFilePath( const TQStringList& ); + virtual TQStringList filePath() const; + void addFilePath( const TQString& ); + virtual void setExtensionType( const TQString& ext, const char* mimetype ); + +private: + TQMimeSource *dataInternal(const TQString& abs_name, const TQMap &extensions ) const; + TQMimeSourceFactoryData* d; +}; + +#if defined(Q_WS_WIN) + +#ifndef QT_H +#include "ntqptrlist.h" // down here for GCC 2.7.* compatibility +#endif // QT_H + +/* + Encapsulation of conversion between MIME and Windows CLIPFORMAT. + Not need on X11, as the underlying protocol uses the MIME standard + directly. +*/ + +class Q_EXPORT TQWindowsMime { +public: + TQWindowsMime(); + virtual ~TQWindowsMime(); + + static void initialize(); + + static TQPtrList all(); + static TQWindowsMime* convertor( const char* mime, int cf ); + static const char* cfToMime(int cf); + + static int registerMimeType(const char *mime); + + virtual const char* convertorName()=0; + virtual int countCf()=0; + virtual int cf(int index)=0; + virtual bool canConvert( const char* mime, int cf )=0; + virtual const char* mimeFor(int cf)=0; + virtual int cfFor(const char* )=0; + virtual TQByteArray convertToMime( TQByteArray data, const char* mime, int cf )=0; + virtual TQByteArray convertFromMime( TQByteArray data, const char* mime, int cf )=0; +}; + +#endif +#if defined(Q_WS_MAC) + +#ifndef QT_H +#include "ntqptrlist.h" // down here for GCC 2.7.* compatibility +#endif // QT_H + +/* + Encapsulation of conversion between MIME and Mac flavor. + Not need on X11, as the underlying protocol uses the MIME standard + directly. +*/ + +class Q_EXPORT TQMacMime { + char type; +public: + enum TQMacMimeType { MIME_DND=0x01, MIME_CLIP=0x02, MIME_QT_CONVERTOR=0x04, MIME_ALL=MIME_DND|MIME_CLIP }; + TQMacMime(char); + virtual ~TQMacMime(); + + static void initialize(); + + static TQPtrList all(TQMacMimeType); + static TQMacMime* convertor(TQMacMimeType, const char* mime, int flav); + static const char* flavorToMime(TQMacMimeType, int flav); + + virtual const char* convertorName()=0; + virtual int countFlavors()=0; + virtual int flavor(int index)=0; + virtual bool canConvert(const char* mime, int flav)=0; + virtual const char* mimeFor(int flav)=0; + virtual int flavorFor(const char*)=0; + virtual TQByteArray convertToMime(TQValueList data, const char* mime, int flav)=0; + virtual TQValueList convertFromMime(TQByteArray data, const char* mime, int flav)=0; +}; + +#endif // Q_WS_MAC + +#endif // QT_NO_MIME + +#endif // TQMIME_H diff --git a/src/kernel/ntqmngio.h b/src/kernel/ntqmngio.h new file mode 100644 index 000000000..76f5abf69 --- /dev/null +++ b/src/kernel/ntqmngio.h @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Definition of MNG TQImage IOHandler +** +** Created : 970521 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMNGIO_H +#define TQMNGIO_H + +#ifndef QT_H +#endif // QT_H + +#ifndef QT_NO_IMAGEIO_MNG + +void qInitMngIO(); + +#endif // QT_NO_IMAGEIO_MNG + +#endif // TQMNGIO_H diff --git a/src/kernel/ntqmovie.h b/src/kernel/ntqmovie.h new file mode 100644 index 000000000..9f5238fc7 --- /dev/null +++ b/src/kernel/ntqmovie.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Definition of movie classes +** +** Created : 970617 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMOVIE_H +#define TQMOVIE_H + +#ifndef QT_H +#include "ntqpixmap.h" // ### remove or keep for users' convenience? +#endif // QT_H + +#ifndef QT_NO_MOVIE + +class TQDataSource; +class TQObject; +class TQMoviePrivate; + +class Q_EXPORT TQMovie { +public: + TQMovie(); + TQMovie(int bufsize); + TQMovie(TQDataSource*, int bufsize=1024); + TQMovie(const TQString &fileName, int bufsize=1024); + TQMovie(TQByteArray data, int bufsize=1024); + TQMovie(const TQMovie&); + ~TQMovie(); + + TQMovie& operator=(const TQMovie&); + + int pushSpace() const; + void pushData(const uchar* data, int length); + + 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(TQObject* receiver, const char *member); + void disconnectResize(TQObject* receiver, const char *member=0); + + void connectUpdate(TQObject* receiver, const char *member); + void disconnectUpdate(TQObject* receiver, const char *member=0); + +#ifdef Q_WS_QWS + // Temporary hack + void setDisplayWidget(TQWidget * w); +#endif + + enum Status { SourceEmpty=-2, + UnrecognizedFormat=-1, + Paused=1, + EndOfFrame=2, + EndOfLoop=3, + EndOfMovie=4, + SpeedChanged=5 }; + void connectStatus(TQObject* receiver, const char *member); + void disconnectStatus(TQObject* receiver, const char *member=0); + +private: + TQMoviePrivate *d; +}; + +#endif // QT_NO_MOVIE + +#endif diff --git a/src/kernel/ntqnamespace.h b/src/kernel/ntqnamespace.h new file mode 100644 index 000000000..8e49c580c --- /dev/null +++ b/src/kernel/ntqnamespace.h @@ -0,0 +1,1030 @@ +/**************************************************************************** +** +** Definition of TQt namespace (as class for compiler compatibility) +** +** Created : 980927 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQNAMESPACE_H +#define TQNAMESPACE_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + + +class TQColor; +class TQCursor; + + +class Q_EXPORT TQt { +public: + QT_STATIC_CONST TQColor & color0; + QT_STATIC_CONST TQColor & color1; + QT_STATIC_CONST TQColor & black; + QT_STATIC_CONST TQColor & white; + QT_STATIC_CONST TQColor & darkGray; + QT_STATIC_CONST TQColor & gray; + QT_STATIC_CONST TQColor & lightGray; + QT_STATIC_CONST TQColor & red; + QT_STATIC_CONST TQColor & green; + QT_STATIC_CONST TQColor & blue; + QT_STATIC_CONST TQColor & cyan; + QT_STATIC_CONST TQColor & magenta; + QT_STATIC_CONST TQColor & yellow; + QT_STATIC_CONST TQColor & darkRed; + QT_STATIC_CONST TQColor & darkGreen; + QT_STATIC_CONST TQColor & darkBlue; + QT_STATIC_CONST TQColor & darkCyan; + QT_STATIC_CONST TQColor & darkMagenta; + QT_STATIC_CONST TQColor & darkYellow; + + // documented in qevent.cpp + enum ButtonState { // mouse/keyboard state values + NoButton = 0x0000, + LeftButton = 0x0001, + RightButton = 0x0002, + MidButton = 0x0004, + MouseButtonMask = 0x0007, + ShiftButton = 0x0100, + ControlButton = 0x0200, + AltButton = 0x0400, + MetaButton = 0x0800, + KeyButtonMask = 0x0f00, + Keypad = 0x4000 + }; + + // documented in qobject.cpp + // ideally would start at 1, as in TQSizePolicy, but that breaks other things + enum Orientation { + Horizontal = 0, + Vertical + }; + + // documented in qlistview.cpp + enum SortOrder { + Ascending, + Descending + }; + + // Text formatting flags for TQPainter::drawText and TQLabel + // the following four enums can be combined to one integer which + // is passed as textflag to drawText and qt_format_text. + + // documented in qpainter.cpp + enum AlignmentFlags { + AlignAuto = 0x0000, // text alignment + AlignLeft = 0x0001, + AlignRight = 0x0002, + AlignHCenter = 0x0004, + AlignJustify = 0x0008, + AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify, + AlignTop = 0x0010, + AlignBottom = 0x0020, + AlignVCenter = 0x0040, + AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter, + AlignCenter = AlignVCenter | AlignHCenter + }; + + // documented in qpainter.cpp + enum TextFlags { + SingleLine = 0x0080, // misc. flags + DontClip = 0x0100, + ExpandTabs = 0x0200, + ShowPrefix = 0x0400, + WordBreak = 0x0800, + BreakAnywhere = 0x1000, +#ifndef Q_QDOC + DontPrint = 0x2000, + Underline = 0x01000000, + Overline = 0x02000000, + StrikeOut = 0x04000000, + IncludeTrailingSpaces = 0x08000000, +#endif + NoAccel = 0x4000 + }; + + // Widget flags; documented in qwidget.cpp + typedef uint WState; + + // TQWidget state flags (internal, barely documented in qwidget.cpp) + enum WidgetState { + WState_Created = 0x00000001, + WState_Disabled = 0x00000002, + WState_Visible = 0x00000004, + WState_ForceHide = 0x00000008, + WState_OwnCursor = 0x00000010, + WState_MouseTracking = 0x00000020, + WState_CompressKeys = 0x00000040, + WState_BlockUpdates = 0x00000080, + WState_InPaintEvent = 0x00000100, + WState_Reparented = 0x00000200, + WState_ConfigPending = 0x00000400, + WState_Resized = 0x00000800, + WState_AutoMask = 0x00001000, + WState_Polished = 0x00002000, + WState_DND = 0x00004000, + WState_Reserved0 = 0x00008000, + WState_FullScreen = 0x00010000, + WState_OwnSizePolicy = 0x00020000, + WState_CreatedHidden = 0x00040000, + WState_Maximized = 0x00080000, + WState_Minimized = 0x00100000, + WState_ForceDisabled = 0x00200000, + WState_Exposed = 0x00400000, + WState_HasMouse = 0x00800000 + }; + + // NetWM flags; documented in qwidget.cpp + typedef uint NFlags; + + // documented in qwidget.cpp + enum NETWMFlags { +#if defined(Q_WS_X11) + WX11DisableMove = 0x00000001, + WX11DisableClose = 0x00000002, + WX11DisableResize = 0x00000004, + WX11DisableMinimize = 0x00000008, + WX11DisableMaximize = 0x00000010, + WX11DisableShade = 0x00000020 +#else + WX11DisableMove = 0x00000000, + WX11DisableClose = 0x00000000, + WX11DisableResize = 0x00000000, + WX11DisableMinimize = 0x00000000, + WX11DisableMaximize = 0x00000000, + WX11DisableShade = 0x00000000 +#endif + }; + + // Widget flags2; documented in qwidget.cpp + typedef uint WFlags; + + // documented in qwidget.cpp + enum WidgetFlags { + WType_TopLevel = 0x00000001, // widget type flags + WType_Dialog = 0x00000002, + WType_Popup = 0x00000004, + WType_Desktop = 0x00000008, + WType_Mask = 0x0000000f, + + WStyle_Customize = 0x00000010, // window style flags + WStyle_NormalBorder = 0x00000020, + WStyle_DialogBorder = 0x00000040, // MS-Windows only + WStyle_NoBorder = 0x00002000, + WStyle_Title = 0x00000080, + WStyle_SysMenu = 0x00000100, + WStyle_Minimize = 0x00000200, + WStyle_Maximize = 0x00000400, + WStyle_MinMax = WStyle_Minimize | WStyle_Maximize, + WStyle_Tool = 0x00000800, + WStyle_StaysOnTop = 0x00001000, + WStyle_ContextHelp = 0x00004000, + WStyle_Reserved = 0x00008000, + WStyle_Mask = 0x0000fff0, + + WDestructiveClose = 0x00010000, // misc flags + WPaintDesktop = 0x00020000, + WPaintUnclipped = 0x00040000, + WPaintClever = 0x00080000, + WResizeNoErase = 0x00100000, // OBSOLETE + WMouseNoMask = 0x00200000, + WStaticContents = 0x00400000, + WRepaintNoErase = 0x00800000, // OBSOLETE +#if defined(Q_WS_X11) + WX11BypassWM = 0x01000000, + WWinOwnDC = 0x00000000, + WMacNoSheet = 0x00000000, + WMacDrawer = 0x00000000, +#elif defined(Q_WS_MAC) + WX11BypassWM = 0x00000000, + WWinOwnDC = 0x00000000, + WMacNoSheet = 0x01000000, + WMacDrawer = 0x20000000, +#else + WX11BypassWM = 0x00000000, + WWinOwnDC = 0x01000000, + WMacNoSheet = 0x00000000, + WMacDrawer = 0x00000000, +#endif + WGroupLeader = 0x02000000, + WShowModal = 0x04000000, + WNoMousePropagation = 0x08000000, + WSubWindow = 0x10000000, +#if defined(Q_WS_X11) + WStyle_Splash = 0x20000000, +#else + WStyle_Splash = WStyle_NoBorder | WMacNoSheet | WStyle_Tool | WWinOwnDC, +#endif + WNoAutoErase = WRepaintNoErase | WResizeNoErase +#ifndef QT_NO_COMPAT + , + WNorthWestGravity = WStaticContents, + WType_Modal = WType_Dialog | WShowModal, + WStyle_Dialog = WType_Dialog, + WStyle_NoBorderEx = WStyle_NoBorder +#endif + }; + + enum WindowState { + WindowNoState = 0x00000000, + WindowMinimized = 0x00000001, + WindowMaximized = 0x00000002, + WindowFullScreen = 0x00000004, + WindowActive = 0x00000008 + }; + + + // Image conversion flags. The unusual ordering is caused by + // compatibility and default requirements. + // Documented in qimage.cpp + + enum ImageConversionFlags { + ColorMode_Mask = 0x00000003, + AutoColor = 0x00000000, + ColorOnly = 0x00000003, + MonoOnly = 0x00000002, + // Reserved = 0x00000001, + + AlphaDither_Mask = 0x0000000c, + ThresholdAlphaDither = 0x00000000, + OrderedAlphaDither = 0x00000004, + DiffuseAlphaDither = 0x00000008, + NoAlpha = 0x0000000c, // Not supported + + Dither_Mask = 0x00000030, + DiffuseDither = 0x00000000, + OrderedDither = 0x00000010, + ThresholdDither = 0x00000020, + // ReservedDither= 0x00000030, + + DitherMode_Mask = 0x000000c0, + AutoDither = 0x00000000, + PreferDither = 0x00000040, + AvoidDither = 0x00000080 + }; + + // documented in qpainter.cpp + enum BGMode { // background mode + TransparentMode, + OpaqueMode + }; + +#ifndef QT_NO_COMPAT + // documented in qpainter.cpp + enum PaintUnit { // paint unit + PixelUnit, + LoMetricUnit, // OBSOLETE + HiMetricUnit, // OBSOLETE + LoEnglishUnit, // OBSOLETE + HiEnglishUnit, // OBSOLETE + TwipsUnit // OBSOLETE + }; +#endif + + // documented in qstyle.cpp +#ifdef QT_NO_COMPAT + enum GUIStyle { + WindowsStyle = 1, // ### TQt 4.0: either remove the obsolete enums or clean up compat vs. + MotifStyle = 4, // ### QT_NO_COMPAT by reordering or combination into one enum. + GtkStyle = 6 // Gtk compability mode + }; +#else + enum GUIStyle { + MacStyle, // OBSOLETE + WindowsStyle, + Win3Style, // OBSOLETE + PMStyle, // OBSOLETE + MotifStyle, + GtkStyle = 6 // Gtk compability mode + }; +#endif + + // documented in qkeysequence.cpp + enum SequenceMatch { + NoMatch, + PartialMatch, + Identical + }; + + // documented in qevent.cpp + enum Modifier { // accelerator modifiers + META = 0x00100000, + SHIFT = 0x00200000, + CTRL = 0x00400000, + ALT = 0x00800000, + MODIFIER_MASK = 0x00f00000, + UNICODE_ACCEL = 0x10000000, + + ASCII_ACCEL = UNICODE_ACCEL // 1.x compat + }; + + // documented in qevent.cpp + enum Key { + Key_Escape = 0x1000, // misc keys + Key_Tab = 0x1001, + Key_Backtab = 0x1002, Key_BackTab = Key_Backtab, + Key_Backspace = 0x1003, Key_BackSpace = Key_Backspace, + Key_Return = 0x1004, + Key_Enter = 0x1005, + Key_Insert = 0x1006, + Key_Delete = 0x1007, + Key_Pause = 0x1008, + Key_Print = 0x1009, + Key_SysReq = 0x100a, + Key_Clear = 0x100b, + Key_Home = 0x1010, // cursor movement + Key_End = 0x1011, + Key_Left = 0x1012, + Key_Up = 0x1013, + Key_Right = 0x1014, + Key_Down = 0x1015, + Key_Prior = 0x1016, Key_PageUp = Key_Prior, + Key_Next = 0x1017, Key_PageDown = Key_Next, + Key_Shift = 0x1020, // modifiers + Key_Control = 0x1021, + Key_Meta = 0x1022, + Key_Alt = 0x1023, + Key_CapsLock = 0x1024, + Key_NumLock = 0x1025, + Key_ScrollLock = 0x1026, + Key_F1 = 0x1030, // function keys + Key_F2 = 0x1031, + Key_F3 = 0x1032, + Key_F4 = 0x1033, + Key_F5 = 0x1034, + Key_F6 = 0x1035, + Key_F7 = 0x1036, + Key_F8 = 0x1037, + Key_F9 = 0x1038, + Key_F10 = 0x1039, + Key_F11 = 0x103a, + Key_F12 = 0x103b, + Key_F13 = 0x103c, + Key_F14 = 0x103d, + Key_F15 = 0x103e, + Key_F16 = 0x103f, + Key_F17 = 0x1040, + Key_F18 = 0x1041, + Key_F19 = 0x1042, + Key_F20 = 0x1043, + Key_F21 = 0x1044, + Key_F22 = 0x1045, + Key_F23 = 0x1046, + Key_F24 = 0x1047, + Key_F25 = 0x1048, // F25 .. F35 only on X11 + Key_F26 = 0x1049, + Key_F27 = 0x104a, + Key_F28 = 0x104b, + Key_F29 = 0x104c, + Key_F30 = 0x104d, + Key_F31 = 0x104e, + Key_F32 = 0x104f, + Key_F33 = 0x1050, + Key_F34 = 0x1051, + Key_F35 = 0x1052, + Key_Super_L = 0x1053, // extra keys + Key_Super_R = 0x1054, + Key_Menu = 0x1055, + Key_Hyper_L = 0x1056, + Key_Hyper_R = 0x1057, + Key_Help = 0x1058, + Key_Direction_L = 0x1059, + Key_Direction_R = 0x1060, + + // International input method support (X keycode - 0xEE00, the + // definition follows TQt/Embedded 2.3.7) Only interesting if + // you are writing your own input method + + // International & multi-key character composition + Key_Multi_key = 0x1120, // Multi-key character compose + Key_Codeinput = 0x1137, + Key_SingleCandidate = 0x113c, + Key_MultipleCandidate = 0x113d, + Key_PreviousCandidate = 0x113e, + + // Misc Functions + Key_Mode_switch = 0x117e, // Character set switch + //Key_script_switch = 0x117e, // Alias for mode_switch + + // Japanese keyboard support + Key_Kanji = 0x1121, // Kanji, Kanji convert + Key_Muhenkan = 0x1122, // Cancel Conversion + //Key_Henkan_Mode = 0x1123, // Start/Stop Conversion + Key_Henkan = 0x1123, // Alias for Henkan_Mode + Key_Romaji = 0x1124, // to Romaji + Key_Hiragana = 0x1125, // to Hiragana + Key_Katakana = 0x1126, // to Katakana + Key_Hiragana_Katakana = 0x1127, // Hiragana/Katakana toggle + Key_Zenkaku = 0x1128, // to Zenkaku + Key_Hankaku = 0x1129, // to Hankaku + Key_Zenkaku_Hankaku = 0x112a, // Zenkaku/Hankaku toggle + Key_Touroku = 0x112b, // Add to Dictionary + Key_Massyo = 0x112c, // Delete from Dictionary + Key_Kana_Lock = 0x112d, // Kana Lock + Key_Kana_Shift = 0x112e, // Kana Shift + Key_Eisu_Shift = 0x112f, // Alphanumeric Shift + Key_Eisu_toggle = 0x1130, // Alphanumeric toggle + //Key_Kanji_Bangou = 0x1137, // Codeinput + //Key_Zen_Koho = 0x113d, // Multiple/All Candidate(s) + //Key_Mae_Koho = 0x113e, // Previous Candidate + + // Korean keyboard support + // + // In fact, many Korean users need only 2 keys, Key_Hangul and + // Key_Hangul_Hanja. But rest of the keys are good for future. + + Key_Hangul = 0x1131, // Hangul start/stop(toggle) + Key_Hangul_Start = 0x1132, // Hangul start + Key_Hangul_End = 0x1133, // Hangul end, English start + Key_Hangul_Hanja = 0x1134, // Start Hangul->Hanja Conversion + Key_Hangul_Jamo = 0x1135, // Hangul Jamo mode + Key_Hangul_Romaja = 0x1136, // Hangul Romaja mode + //Key_Hangul_Codeinput = 0x1137, // Hangul code input mode + Key_Hangul_Jeonja = 0x1138, // Jeonja mode + Key_Hangul_Banja = 0x1139, // Banja mode + Key_Hangul_PreHanja = 0x113a, // Pre Hanja conversion + Key_Hangul_PostHanja = 0x113b, // Post Hanja conversion + //Key_Hangul_SingleCandidate = 0x113c, // Single candidate + //Key_Hangul_MultipleCandidate = 0x113d, // Multiple candidate + //Key_Hangul_PreviousCandidate = 0x113e, // Previous candidate + Key_Hangul_Special = 0x113f, // Special symbols + //Key_Hangul_switch = 0x117e, // Alias for mode_switch + + // dead keys (X keycode - 0xED00 to avoid the conflict) + Key_Dead_Grave = 0x1250, + Key_Dead_Acute = 0x1251, + Key_Dead_Circumflex = 0x1252, + Key_Dead_Tilde = 0x1253, + Key_Dead_Macron = 0x1254, + Key_Dead_Breve = 0x1255, + Key_Dead_Abovedot = 0x1256, + Key_Dead_Diaeresis = 0x1257, + Key_Dead_Abovering = 0x1258, + Key_Dead_Doubleacute = 0x1259, + Key_Dead_Caron = 0x125a, + Key_Dead_Cedilla = 0x125b, + Key_Dead_Ogonek = 0x125c, + Key_Dead_Iota = 0x125d, + Key_Dead_Voiced_Sound = 0x125e, + Key_Dead_Semivoiced_Sound = 0x125f, + Key_Dead_Belowdot = 0x1260, + Key_Dead_Hook = 0x1261, + Key_Dead_Horn = 0x1262, + + Key_Space = 0x20, // 7 bit printable ASCII + Key_Any = Key_Space, + Key_Exclam = 0x21, + Key_QuoteDbl = 0x22, + Key_NumberSign = 0x23, + Key_Dollar = 0x24, + Key_Percent = 0x25, + Key_Ampersand = 0x26, + Key_Apostrophe = 0x27, + Key_ParenLeft = 0x28, + Key_ParenRight = 0x29, + Key_Asterisk = 0x2a, + Key_Plus = 0x2b, + Key_Comma = 0x2c, + Key_Minus = 0x2d, + Key_Period = 0x2e, + Key_Slash = 0x2f, + Key_0 = 0x30, + Key_1 = 0x31, + Key_2 = 0x32, + Key_3 = 0x33, + Key_4 = 0x34, + Key_5 = 0x35, + Key_6 = 0x36, + Key_7 = 0x37, + Key_8 = 0x38, + Key_9 = 0x39, + Key_Colon = 0x3a, + Key_Semicolon = 0x3b, + Key_Less = 0x3c, + Key_Equal = 0x3d, + Key_Greater = 0x3e, + Key_Question = 0x3f, + Key_At = 0x40, + Key_A = 0x41, + Key_B = 0x42, + Key_C = 0x43, + Key_D = 0x44, + Key_E = 0x45, + Key_F = 0x46, + Key_G = 0x47, + Key_H = 0x48, + Key_I = 0x49, + Key_J = 0x4a, + Key_K = 0x4b, + Key_L = 0x4c, + Key_M = 0x4d, + Key_N = 0x4e, + Key_O = 0x4f, + Key_P = 0x50, + Key_Q = 0x51, + Key_R = 0x52, + Key_S = 0x53, + Key_T = 0x54, + Key_U = 0x55, + Key_V = 0x56, + Key_W = 0x57, + Key_X = 0x58, + Key_Y = 0x59, + Key_Z = 0x5a, + Key_BracketLeft = 0x5b, + Key_Backslash = 0x5c, + Key_BracketRight = 0x5d, + Key_AsciiCircum = 0x5e, + Key_Underscore = 0x5f, + Key_QuoteLeft = 0x60, + Key_BraceLeft = 0x7b, + Key_Bar = 0x7c, + Key_BraceRight = 0x7d, + Key_AsciiTilde = 0x7e, + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + // + // This is mainly for compatibility - applications and input + // methods should not use the TQt keycodes between 128 and 255, + // but should rather use the TQKeyEvent::text(). See + // TQETWidget::translateKeyEventInternal() for more details. + + Key_nobreakspace = 0x0a0, + Key_exclamdown = 0x0a1, + Key_cent = 0x0a2, + Key_sterling = 0x0a3, + Key_currency = 0x0a4, + Key_yen = 0x0a5, + Key_brokenbar = 0x0a6, + Key_section = 0x0a7, + Key_diaeresis = 0x0a8, + Key_copyright = 0x0a9, + Key_ordfeminine = 0x0aa, + Key_guillemotleft = 0x0ab, // left angle quotation mark + Key_notsign = 0x0ac, + Key_hyphen = 0x0ad, + Key_registered = 0x0ae, + Key_macron = 0x0af, + Key_degree = 0x0b0, + Key_plusminus = 0x0b1, + Key_twosuperior = 0x0b2, + Key_threesuperior = 0x0b3, + Key_acute = 0x0b4, + Key_mu = 0x0b5, + Key_paragraph = 0x0b6, + Key_periodcentered = 0x0b7, + Key_cedilla = 0x0b8, + Key_onesuperior = 0x0b9, + Key_masculine = 0x0ba, + Key_guillemotright = 0x0bb, // right angle quotation mark + Key_onequarter = 0x0bc, + Key_onehalf = 0x0bd, + Key_threequarters = 0x0be, + Key_questiondown = 0x0bf, + Key_Agrave = 0x0c0, + Key_Aacute = 0x0c1, + Key_Acircumflex = 0x0c2, + Key_Atilde = 0x0c3, + Key_Adiaeresis = 0x0c4, + Key_Aring = 0x0c5, + Key_AE = 0x0c6, + Key_Ccedilla = 0x0c7, + Key_Egrave = 0x0c8, + Key_Eacute = 0x0c9, + Key_Ecircumflex = 0x0ca, + Key_Ediaeresis = 0x0cb, + Key_Igrave = 0x0cc, + Key_Iacute = 0x0cd, + Key_Icircumflex = 0x0ce, + Key_Idiaeresis = 0x0cf, + Key_ETH = 0x0d0, + Key_Ntilde = 0x0d1, + Key_Ograve = 0x0d2, + Key_Oacute = 0x0d3, + Key_Ocircumflex = 0x0d4, + Key_Otilde = 0x0d5, + Key_Odiaeresis = 0x0d6, + Key_multiply = 0x0d7, + Key_Ooblique = 0x0d8, + Key_Ugrave = 0x0d9, + Key_Uacute = 0x0da, + Key_Ucircumflex = 0x0db, + Key_Udiaeresis = 0x0dc, + Key_Yacute = 0x0dd, + Key_THORN = 0x0de, + Key_ssharp = 0x0df, + Key_agrave = 0x0e0, + Key_aacute = 0x0e1, + Key_acircumflex = 0x0e2, + Key_atilde = 0x0e3, + Key_adiaeresis = 0x0e4, + Key_aring = 0x0e5, + Key_ae = 0x0e6, + Key_ccedilla = 0x0e7, + Key_egrave = 0x0e8, + Key_eacute = 0x0e9, + Key_ecircumflex = 0x0ea, + Key_ediaeresis = 0x0eb, + Key_igrave = 0x0ec, + Key_iacute = 0x0ed, + Key_icircumflex = 0x0ee, + Key_idiaeresis = 0x0ef, + Key_eth = 0x0f0, + Key_ntilde = 0x0f1, + Key_ograve = 0x0f2, + Key_oacute = 0x0f3, + Key_ocircumflex = 0x0f4, + Key_otilde = 0x0f5, + Key_odiaeresis = 0x0f6, + Key_division = 0x0f7, + Key_oslash = 0x0f8, + Key_ugrave = 0x0f9, + Key_uacute = 0x0fa, + Key_ucircumflex = 0x0fb, + Key_udiaeresis = 0x0fc, + Key_yacute = 0x0fd, + Key_thorn = 0x0fe, + Key_ydiaeresis = 0x0ff, + + // multimedia/internet keys - ignored by default - see TQKeyEvent c'tor + + Key_Back = 0x1061, + Key_Forward = 0x1062, + Key_Stop = 0x1063, + Key_Refresh = 0x1064, + + Key_VolumeDown = 0x1070, + Key_VolumeMute = 0x1071, + Key_VolumeUp = 0x1072, + Key_BassBoost = 0x1073, + Key_BassUp = 0x1074, + Key_BassDown = 0x1075, + Key_TrebleUp = 0x1076, + Key_TrebleDown = 0x1077, + + Key_MediaPlay = 0x1080, + Key_MediaStop = 0x1081, + Key_MediaPrev = 0x1082, + Key_MediaNext = 0x1083, + Key_MediaRecord = 0x1084, + + Key_HomePage = 0x1090, + Key_Favorites = 0x1091, + Key_Search = 0x1092, + Key_Standby = 0x1093, + Key_OpenUrl = 0x1094, + + Key_LaunchMail = 0x10a0, + Key_LaunchMedia = 0x10a1, + Key_Launch0 = 0x10a2, + Key_Launch1 = 0x10a3, + Key_Launch2 = 0x10a4, + Key_Launch3 = 0x10a5, + Key_Launch4 = 0x10a6, + Key_Launch5 = 0x10a7, + Key_Launch6 = 0x10a8, + Key_Launch7 = 0x10a9, + Key_Launch8 = 0x10aa, + Key_Launch9 = 0x10ab, + Key_LaunchA = 0x10ac, + Key_LaunchB = 0x10ad, + Key_LaunchC = 0x10ae, + Key_LaunchD = 0x10af, + Key_LaunchE = 0x10b0, + Key_LaunchF = 0x10b1, + + Key_MediaLast = 0x1fff, + + Key_unknown = 0xffff + }; + + // documented in qcommonstyle.cpp + enum ArrowType { + UpArrow, + DownArrow, + LeftArrow, + RightArrow + }; + + // documented in qpainter.cpp + enum RasterOp { // raster op mode + CopyROP, + OrROP, + XorROP, + NotAndROP, EraseROP=NotAndROP, + NotCopyROP, + NotOrROP, + NotXorROP, + AndROP, NotEraseROP=AndROP, + NotROP, + ClearROP, + SetROP, + NopROP, + AndNotROP, + OrNotROP, + NandROP, + NorROP, LastROP=NorROP + }; + + // documented in qpainter.cpp + enum PenStyle { // pen style + NoPen, + SolidLine, + DashLine, + DotLine, + DashDotLine, + DashDotDotLine, + MPenStyle = 0x0f + }; + + // documented in qpainter.cpp + enum PenCapStyle { // line endcap style + FlatCap = 0x00, + SquareCap = 0x10, + RoundCap = 0x20, + MPenCapStyle = 0x30 + }; + + // documented in qpainter.cpp + enum PenJoinStyle { // line join style + MiterJoin = 0x00, + BevelJoin = 0x40, + RoundJoin = 0x80, + MPenJoinStyle = 0xc0 + }; + + // documented in qpainter.cpp + enum BrushStyle { // brush style + NoBrush, + SolidPattern, + Dense1Pattern, + Dense2Pattern, + Dense3Pattern, + Dense4Pattern, + Dense5Pattern, + Dense6Pattern, + Dense7Pattern, + HorPattern, + VerPattern, + CrossPattern, + BDiagPattern, + FDiagPattern, + DiagCrossPattern, + CustomPattern=24 + }; + + // documented in qapplication_mac.cpp + enum MacintoshVersion { + //Unknown + MV_Unknown = 0x0000, + + //Version numbers + MV_9 = 0x0001, + MV_10_DOT_0 = 0x0002, + MV_10_DOT_1 = 0x0003, + MV_10_DOT_2 = 0x0004, + MV_10_DOT_3 = 0x0005, + MV_10_DOT_4 = 0x0006, + + //Code names + MV_CHEETAH = MV_10_DOT_0, + MV_PUMA = MV_10_DOT_1, + MV_JAGUAR = MV_10_DOT_2, + MV_PANTHER = MV_10_DOT_3, + MV_TIGER = MV_10_DOT_4 + }; + + // documented in qapplication_win.cpp + enum WindowsVersion { + WV_32s = 0x0001, + WV_95 = 0x0002, + WV_98 = 0x0003, + WV_Me = 0x0004, + WV_DOS_based = 0x000f, + + WV_NT = 0x0010, + WV_2000 = 0x0020, + WV_XP = 0x0030, + WV_2003 = 0x0040, + WV_VISTA = 0x0080, + WV_NT_based = 0x00f0, + + WV_CE = 0x0100, + WV_CENET = 0x0200, + WV_CE_based = 0x0f00 + }; + + // documented in qstyle.cpp + enum UIEffect { + UI_General, + UI_AnimateMenu, + UI_FadeMenu, + UI_AnimateCombo, + UI_AnimateTooltip, + UI_FadeTooltip, + UI_AnimateToolBox + }; + + // documented in qcursor.cpp + enum CursorShape { + ArrowCursor, + UpArrowCursor, + CrossCursor, + WaitCursor, + IbeamCursor, + SizeVerCursor, + SizeHorCursor, + SizeBDiagCursor, + SizeFDiagCursor, + SizeAllCursor, + BlankCursor, + SplitVCursor, + SplitHCursor, + PointingHandCursor, + ForbiddenCursor, + WhatsThisCursor, + BusyCursor, + LastCursor = BusyCursor, + BitmapCursor = 24 + }; + + // Global cursors + + QT_STATIC_CONST TQCursor & arrowCursor; // standard arrow cursor + QT_STATIC_CONST TQCursor & upArrowCursor; // upwards arrow + QT_STATIC_CONST TQCursor & crossCursor; // crosshair + QT_STATIC_CONST TQCursor & waitCursor; // hourglass/watch + QT_STATIC_CONST TQCursor & ibeamCursor; // ibeam/text entry + QT_STATIC_CONST TQCursor & sizeVerCursor; // vertical resize + QT_STATIC_CONST TQCursor & sizeHorCursor; // horizontal resize + QT_STATIC_CONST TQCursor & sizeBDiagCursor; // diagonal resize (/) + QT_STATIC_CONST TQCursor & sizeFDiagCursor; // diagonal resize (\) + QT_STATIC_CONST TQCursor & sizeAllCursor; // all directions resize + QT_STATIC_CONST TQCursor & blankCursor; // blank/invisible cursor + QT_STATIC_CONST TQCursor & splitVCursor; // vertical bar with left-right + // arrows + QT_STATIC_CONST TQCursor & splitHCursor; // horizontal bar with up-down + // arrows + QT_STATIC_CONST TQCursor & pointingHandCursor; // pointing hand + QT_STATIC_CONST TQCursor & forbiddenCursor; // forbidden cursor (slashed circle) + QT_STATIC_CONST TQCursor & whatsThisCursor; // arrow with a question mark + QT_STATIC_CONST TQCursor & busyCursor; // arrow with hourglass + + + enum TextFormat { + PlainText, + RichText, + AutoText, + LogText + }; + + // Documented in qtextedit.cpp + enum AnchorAttribute { + AnchorName, + AnchorHref + }; + + // Documented in qmainwindow.cpp + enum Dock { + DockUnmanaged, + DockTornOff, + DockTop, + DockBottom, + DockRight, + DockLeft, + DockMinimized +#ifndef QT_NO_COMPAT + , + Unmanaged = DockUnmanaged, + TornOff = DockTornOff, + Top = DockTop, + Bottom = DockBottom, + Right = DockRight, + Left = DockLeft, + Minimized = DockMinimized +#endif + }; + // compatibility + typedef Dock ToolBarDock; + + // documented in qdatetime.cpp + enum DateFormat { + TextDate, // default TQt + ISODate, // ISO 8601 + LocalDate // locale dependent + }; + + // documented in qdatetime.cpp + enum TimeSpec { + LocalTime, + UTC + }; + + // documented in qwidget.cpp + 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; + + // Documented in qstring.cpp + enum StringComparisonMode { + CaseSensitive = 0x00001, // 0 0001 + BeginsWith = 0x00002, // 0 0010 + EndsWith = 0x00004, // 0 0100 + Contains = 0x00008, // 0 1000 + ExactMatch = 0x00010 // 1 0000 + }; + + // Documented in qtabwidget.cpp + enum Corner { + TopLeft = 0x00000, + TopRight = 0x00001, + BottomLeft = 0x00002, + BottomRight = 0x00003 + }; + + // "handle" type for system objects. Documented as \internal in + // qapplication.cpp +#if defined(Q_WS_MAC) + typedef void * HANDLE; +#elif defined(Q_WS_WIN) + typedef void *HANDLE; +#elif defined(Q_WS_X11) + typedef unsigned long HANDLE; +#elif defined(Q_WS_QWS) + typedef void * HANDLE; +#endif +}; + + +class Q_EXPORT TQInternal { +public: + enum PaintDeviceFlags { + UndefinedDevice = 0x00, + Widget = 0x01, + Pixmap = 0x02, + Printer = 0x03, + Picture = 0x04, + System = 0x05, + DeviceTypeMask = 0x0f, + ExternalDevice = 0x10, + // used to emulate some of the behaviour different between TQt2 and TQt3 (mainly for printing) + CompatibilityMode = 0x20 + }; +}; + +#endif // TQNAMESPACE_H diff --git a/src/kernel/ntqnetworkprotocol.h b/src/kernel/ntqnetworkprotocol.h new file mode 100644 index 000000000..28e431eb5 --- /dev/null +++ b/src/kernel/ntqnetworkprotocol.h @@ -0,0 +1,244 @@ +/**************************************************************************** +** +** Definition of TQNetworkProtocol class +** +** Created : 950429 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQNETWORKPROTOCOL_H +#define TQNETWORKPROTOCOL_H + +#ifndef QT_H +#include "ntqurlinfo.h" +#include "ntqstring.h" +#include "ntqdict.h" +#include "ntqobject.h" +#endif // QT_H + +#ifndef QT_NO_NETWORKPROTOCOL + +#if __GNUC__ - 0 > 3 +#pragma GCC system_header +#endif + +class TQNetworkProtocol; +class TQNetworkOperation; +class TQTimer; +class TQUrlOperator; +class TQNetworkProtocolPrivate; +template class TQValueList; + +class Q_EXPORT TQNetworkProtocolFactoryBase +{ +public: + virtual TQNetworkProtocol *createObject() = 0; + +}; + +template< class T > +class TQNetworkProtocolFactory : public TQNetworkProtocolFactoryBase +{ +public: + TQNetworkProtocol *createObject() { + return new T; + } + +}; + +typedef TQDict< TQNetworkProtocolFactoryBase > TQNetworkProtocolDict; + +class Q_EXPORT TQNetworkProtocol : public TQObject +{ + Q_OBJECT + +public: + enum State { + StWaiting = 0, + StInProgress, + StDone, + StFailed, + StStopped + }; + + enum Operation { + OpListChildren = 1, + OpMkDir = 2, + OpMkdir = OpMkDir, // ### remove in 4.0 + OpRemove = 4, + OpRename = 8, + OpGet = 32, + OpPut = 64 + }; + + enum ConnectionState { + ConHostFound, + ConConnected, + ConClosed + }; + + enum Error { + // no error + NoError = 0, + // general errors + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + // errors on connect + ErrLoginIncorrect, + ErrHostNotFound, + // protocol errors + ErrListChildren, + ErrListChlidren = ErrListChildren, // ### remove in 4.0 + ErrMkDir, + ErrMkdir = ErrMkDir, // ### remove in 4.0 + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; + + TQNetworkProtocol(); + virtual ~TQNetworkProtocol(); + + virtual void setUrl( TQUrlOperator *u ); + + virtual void setAutoDelete( bool b, int i = 10000 ); + bool autoDelete() const; + + static void registerNetworkProtocol( const TQString &protocol, + TQNetworkProtocolFactoryBase *protocolFactory ); + static TQNetworkProtocol *getNetworkProtocol( const TQString &protocol ); + static bool hasOnlyLocalFileSystem(); + + virtual int supportedOperations() const; + virtual void addOperation( TQNetworkOperation *op ); + + TQUrlOperator *url() const; + TQNetworkOperation *operationInProgress() const; + virtual void clearOperationQueue(); + virtual void stop(); + +signals: + void data( const TQByteArray &, TQNetworkOperation *res ); + void connectionStateChanged( int state, const TQString &data ); + void finished( TQNetworkOperation *res ); + void start( TQNetworkOperation *res ); + void newChildren( const TQValueList &, TQNetworkOperation *res ); + void newChild( const TQUrlInfo &, TQNetworkOperation *res ); + void createdDirectory( const TQUrlInfo &, TQNetworkOperation *res ); + void removed( TQNetworkOperation *res ); + void itemChanged( TQNetworkOperation *res ); + void dataTransferProgress( int bytesDone, int bytesTotal, TQNetworkOperation *res ); + +protected: + virtual void processOperation( TQNetworkOperation *op ); + virtual void operationListChildren( TQNetworkOperation *op ); + virtual void operationMkDir( TQNetworkOperation *op ); + virtual void operationRemove( TQNetworkOperation *op ); + virtual void operationRename( TQNetworkOperation *op ); + virtual void operationGet( TQNetworkOperation *op ); + virtual void operationPut( TQNetworkOperation *op ); + virtual void operationPutChunk( TQNetworkOperation *op ); + virtual bool checkConnection( TQNetworkOperation *op ); + +private: + TQNetworkProtocolPrivate *d; + +private slots: + void processNextOperation( TQNetworkOperation *old ); + void startOps(); + void emitNewChildren( const TQUrlInfo &i, TQNetworkOperation *op ); + + void removeMe(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQNetworkProtocol( const TQNetworkProtocol & ); + TQNetworkProtocol &operator=( const TQNetworkProtocol & ); +#endif +}; + +class TQNetworkOperationPrivate; + +class Q_EXPORT TQNetworkOperation : public TQObject +{ + Q_OBJECT + friend class TQUrlOperator; + +public: + TQNetworkOperation( TQNetworkProtocol::Operation operation, + const TQString &arg0, const TQString &arg1, + const TQString &arg2 ); + TQNetworkOperation( TQNetworkProtocol::Operation operation, + const TQByteArray &arg0, const TQByteArray &arg1, + const TQByteArray &arg2 ); + ~TQNetworkOperation(); + + void setState( TQNetworkProtocol::State state ); + void setProtocolDetail( const TQString &detail ); + void setErrorCode( int ec ); + void setArg( int num, const TQString &arg ); + void setRawArg( int num, const TQByteArray &arg ); + + TQNetworkProtocol::Operation operation() const; + TQNetworkProtocol::State state() const; + TQString arg( int num ) const; + TQByteArray rawArg( int num ) const; + TQString protocolDetail() const; + int errorCode() const; + + void free(); + +private slots: + void deleteMe(); + +private: + TQByteArray &raw( int num ) const; + TQNetworkOperationPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQNetworkOperation( const TQNetworkOperation & ); + TQNetworkOperation &operator=( const TQNetworkOperation & ); +#endif +}; + +#endif // QT_NO_NETWORKPROTOCOL + +#endif // TQNETWORKPROTOCOL_H diff --git a/src/kernel/ntqobject.h b/src/kernel/ntqobject.h new file mode 100644 index 000000000..804e6f1af --- /dev/null +++ b/src/kernel/ntqobject.h @@ -0,0 +1,265 @@ +/**************************************************************************** +** +** Definition of TQObject class +** +** Created : 930418 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQOBJECT_H +#define TQOBJECT_H + +#ifndef QT_H +#include "ntqobjectdefs.h" +#include "ntqwindowdefs.h" +#include "ntqstring.h" +#include "ntqevent.h" +#include "ntqnamespace.h" +#endif // QT_H + +#define QT_TR_NOOP(x) (x) +#define QT_TRANSLATE_NOOP(scope,x) (x) + +class TQMetaObject; +class TQVariant; +class TQMetaProperty; +class TQPostEventList; +class TQSenderObjectList; +class TQObjectPrivate; +#ifndef QT_NO_USERDATA +class TQObjectUserData; +#endif +struct TQUObject; + +class Q_EXPORT TQObject: public TQt +{ + Q_OBJECT + Q_PROPERTY( TQCString name READ name WRITE setName ) + +public: + TQObject( TQObject *parent=0, const char *name=0 ); + virtual ~TQObject(); + +#ifdef Q_QDOC + virtual const char *className() const; + static TQString tr( const char *, const char * ); + static TQString trUtf8( const char *, const char * ); + virtual TQMetaObject *metaObject() const; +#endif + + virtual bool event( TQEvent * ); + virtual bool eventFilter( TQObject *, TQEvent * ); + + bool isA( const char * ) const; + bool inherits( const char * ) const; + + const char *name() const; + const char *name( const char * defaultName ) const; + + virtual void setName( const char *name ); + bool isWidgetType() const { return isWidget; } + bool highPriority() const { return FALSE; } + + bool signalsBlocked() const { return blockSig; } + void blockSignals( bool b ); + + int startTimer( int interval ); + void killTimer( int id ); + void killTimers(); + + TQObject *child( const char *objName, const char *inheritsClass = 0, bool recursiveSearch = TRUE ); //### const in 4.0 + const TQObjectList *children() const { return childObjects; } + TQObjectList childrenListObject(); + const TQObjectList childrenListObject() const; + + static const TQObjectList *objectTrees(); + static const TQObjectList objectTreesListObject(); + + TQObjectList *queryList( const char *inheritsClass = 0, + const char *objName = 0, + bool regexpMatch = TRUE, + bool recursiveSearch = TRUE ) const; + + virtual void insertChild( TQObject * ); + virtual void removeChild( TQObject * ); + + void installEventFilter( const TQObject * ); + void removeEventFilter( const TQObject * ); + + static bool connect( const TQObject *sender, const char *signal, + const TQObject *receiver, const char *member ); + bool connect( const TQObject *sender, const char *signal, + const char *member ) const; + static bool disconnect( const TQObject *sender, const char *signal, + const TQObject *receiver, const char *member ); + bool disconnect( const char *signal=0, + const TQObject *receiver=0, const char *member=0 ); + bool disconnect( const TQObject *receiver, const char *member=0 ); + static void connectInternal( const TQObject *sender, int signal_index, + const TQObject *receiver, int membcode, int member_index ); + static bool disconnectInternal( const TQObject *sender, int signal_index, + const TQObject *receiver, int membcode, int member_index ); + + void dumpObjectTree(); + void dumpObjectInfo(); + +#ifndef QT_NO_PROPERTIES + virtual bool setProperty( const char *name, const TQVariant& value ); + virtual TQVariant property( const char *name ) const; +#endif // QT_NO_PROPERTIES +#ifdef QT_NO_TRANSLATION + static TQString tr( const char *sourceText, const char * = 0); +#ifndef QT_NO_TEXTCODEC + static TQString trUtf8( const char *sourceText, const char * = 0); +#endif +#endif //QT_NO_TRANSLATION + +#ifndef QT_NO_USERDATA + static uint registerUserData(); + void setUserData( uint id, TQObjectUserData* data); + TQObjectUserData* userData( uint id ) const; +#endif // QT_NO_USERDATA + +signals: + void destroyed(); + void destroyed( TQObject* obj ); + +public: + TQObject *parent() const { return parentObj; } + +public slots: + void deleteLater(); + +private slots: + void cleanupEventFilter( TQObject* ); + +protected: + bool activate_filters( TQEvent * ); + TQConnectionList *receivers( const char* signal ) const; + TQConnectionList *receivers( int signal ) const; + void activate_signal( int signal ); + void activate_signal( int signal, int ); + void activate_signal( int signal, double ); + void activate_signal( int signal, TQString ); + void activate_signal_bool( int signal, bool ); + void activate_signal( TQConnectionList *clist, TQUObject *o ); + + const TQObject *sender(); + + virtual void timerEvent( TQTimerEvent * ); + virtual void childEvent( TQChildEvent * ); + virtual void customEvent( TQCustomEvent * ); + + virtual void connectNotify( const char *signal ); + virtual void disconnectNotify( const char *signal ); + virtual bool checkConnectArgs( const char *signal, const TQObject *receiver, + const char *member ); + static TQCString normalizeSignalSlot( const char *signalSlot ); + +private: + uint isSignal : 1; + uint isWidget : 1; + uint pendTimer : 1; + uint blockSig : 1; + uint wasDeleted : 1; + uint isTree : 1; + + const char *objname; + TQObject *parentObj; + TQObjectList *childObjects; + TQSignalVec *connections; + TQSenderObjectList *senderObjects; + TQObjectList *eventFilters; + TQPostEventList *postedEvents; + TQObjectPrivate* d; + + static TQMetaObject* staticTQtMetaObject(); + + friend class TQApplication; + friend class TQBaseApplication; + friend class TQWidget; + friend class TQSignal; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQObject( const TQObject & ); + TQObject &operator=( const TQObject & ); +#endif +}; + + +#ifndef QT_NO_USERDATA +class Q_EXPORT TQObjectUserData { +public: + virtual ~TQObjectUserData(); +}; +#endif + + +inline bool TQObject::connect( const TQObject *sender, const char *signal, + const char *member ) const +{ + return connect( sender, signal, this, member ); +} + + +inline bool TQObject::disconnect( const char *signal, + const TQObject *receiver, const char *member ) +{ + return disconnect( this, signal, receiver, member ); +} + + +inline bool TQObject::disconnect( const TQObject *receiver, const char *member ) +{ + return disconnect( this, 0, receiver, member ); +} + + +#ifdef QT_NO_TRANSLATION +inline TQString TQObject::tr( const char *sourceText, const char * ) { + return TQString::fromLatin1( sourceText ); +} +#ifndef QT_NO_TEXTCODEC +inline TQString TQObject::trUtf8( const char *sourceText, const char * ) { + return TQString::fromUtf8( sourceText ); +} +#endif +#endif //QT_NO_TRANSLATION + + +#define Q_DEFINED_QOBJECT +#include "ntqwinexport.h" +#endif // TQOBJECT_H diff --git a/src/kernel/ntqobjectcleanuphandler.h b/src/kernel/ntqobjectcleanuphandler.h new file mode 100644 index 000000000..464fd7bf7 --- /dev/null +++ b/src/kernel/ntqobjectcleanuphandler.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Definition of ??? +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQOBJECTCLEANUPHANDLER_H +#define TQOBJECTCLEANUPHANDLER_H + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H + +class TQObjectList; + +class Q_EXPORT TQObjectCleanupHandler : public TQObject +{ + Q_OBJECT + +public: + TQObjectCleanupHandler(); + ~TQObjectCleanupHandler(); + + TQObject* add( TQObject* object ); + void remove( TQObject *object ); + bool isEmpty() const; + void clear(); + +private: + TQObjectList *cleanupObjects; + +private slots: + void objectDestroyed( TQObject * ); +}; + +#endif // TQOBJECTCLEANUPHANDLER_H diff --git a/src/kernel/ntqobjectdefs.h b/src/kernel/ntqobjectdefs.h new file mode 100644 index 000000000..3b4b71e1d --- /dev/null +++ b/src/kernel/ntqobjectdefs.h @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Macros and definitions related to TQObject +** +** Created : 930419 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQOBJECTDEFS_H +#define TQOBJECTDEFS_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + + +#ifndef QT_NO_TRANSLATION +# ifndef QT_NO_TEXTCODEC +// full set of tr functions +# define QT_TR_FUNCTIONS \ + static TQString tr( const char *, const char * = 0 ); \ + static TQString trUtf8( const char *, const char * = 0 ); +# else +// no TQTextCodec, no utf8 +# define QT_TR_FUNCTIONS \ + static TQString tr( const char *, const char * = 0 ); +# endif +#else +// inherit the ones from TQObject +# define QT_TR_FUNCTIONS +#endif + +#ifndef QT_NO_PROPERTIES +# define QT_PROP_FUNCTIONS \ + virtual bool qt_property( int id, int f, TQVariant* v); \ + static bool qt_static_property( TQObject* , int, int, TQVariant* ); +#else +# define QT_PROP_FUNCTIONS +#endif + +// The following macros are our "extensions" to C++ +// They are used, strictly speaking, only by the moc. +struct TQUObject; + +#ifdef QT_MOC_CPP +#define slots slots +#define signals signals +#define Q_CLASSINFO( name, value ) Q_CLASSINFO( name, value ) +#define Q_PROPERTY( text ) Q_PROPERTY( text ) +#define Q_OVERRIDE( text ) Q_OVERRIDE( text ) +#define Q_ENUMS( x ) Q_ENUMS( x ) +#define Q_SETS( x ) Q_SETS( x ) + /* tmake ignore Q_OBJECT */ +#define Q_OBJECT Q_OBJECT + /* tmake ignore Q_OBJECT */ +#define Q_OBJECT_FAKE Q_OBJECT_FAKE + +#else +#define slots // slots: in class +#define signals protected // signals: in class +#ifndef QT_NO_EMIT +#define emit // emit signal +#endif +#define Q_CLASSINFO( name, value ) // class info +#define Q_PROPERTY( text ) // property +#define Q_OVERRIDE( text ) // override property +#define Q_ENUMS( x ) +#define Q_SETS( x ) + +/* tmake ignore Q_OBJECT */ +#define Q_OBJECT \ +public: \ + virtual TQMetaObject *metaObject() const { \ + return staticMetaObject(); \ + } \ + virtual const char *className() const; \ + virtual void* qt_cast( const char* ); \ + virtual bool qt_invoke( int, TQUObject* ); \ + virtual bool qt_emit( int, TQUObject* ); \ + QT_PROP_FUNCTIONS \ + static TQMetaObject* staticMetaObject(); \ + TQObject* qObject() { return (TQObject*)this; } \ + QT_TR_FUNCTIONS \ +private: \ + static TQMetaObject *metaObj; + +/* tmake ignore Q_OBJECT */ +#define Q_OBJECT_FAKE Q_OBJECT + +#endif + +// macro for naming members +#ifdef METHOD +#undef METHOD +#endif +#ifdef SLOT +#undef SLOT +#endif +#ifdef SIGNAL +#undef SIGNAL +#endif + +#if defined(_OLD_CPP_) +#define METHOD(a) "0""a" +#define SLOT(a) "1""a" +#define SIGNAL(a) "2""a" +#else +#define METHOD(a) "0"#a +#define SLOT(a) "1"#a +#define SIGNAL(a) "2"#a +#endif + +#ifndef QT_CLEAN_NAMESPACE +#define METHOD_CODE 0 // member type codes +#define SLOT_CODE 1 +#define SIGNAL_CODE 2 +#endif + +#define TQMETHOD_CODE 0 // member type codes +#define TQSLOT_CODE 1 +#define TQSIGNAL_CODE 2 + +class TQObject; +class TQMetaObject; +class TQSignal; +class TQConnection; +class TQEvent; +struct TQMetaData; +class TQConnectionList; +class TQConnectionListIt; +class TQSignalVec; +class TQObjectList; +class TQObjectListIt; +class TQMemberDict; + +Q_EXPORT void *qt_find_obj_child( TQObject *, const char *, const char * ); +#define Q_CHILD(parent,type,name) \ + ((type*)qt_find_obj_child(parent,#type,name)) + +Q_EXPORT void *qt_inheritedBy( TQMetaObject *super, const TQObject *cls ); + +template +Q_INLINE_TEMPLATES T qt_cast(const TQObject *object) +{ return (T)qt_inheritedBy( ((T)0)->staticMetaObject(), object ); } +#endif // TQOBJECTDEFS_H diff --git a/src/kernel/ntqobjectdict.h b/src/kernel/ntqobjectdict.h new file mode 100644 index 000000000..b3fcd282e --- /dev/null +++ b/src/kernel/ntqobjectdict.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Definition of TQObjectDictionary +** +** Created : 940807 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQOBJECTDICT_H +#define TQOBJECTDICT_H + +#ifndef QT_H +#include "ntqmetaobject.h" +#include "ntqasciidict.h" +#endif // QT_H + + +// +// The object dictionary is a collection of TQMetaObjects +// + +class Q_EXPORT TQObjectDictionary : public TQAsciiDict +{ +public: + TQObjectDictionary(int size=17,bool cs=TRUE,bool ck=TRUE) + : TQAsciiDict(size,cs,ck) {} + TQObjectDictionary( const TQObjectDictionary &dict ) + : TQAsciiDict(dict) {} + ~TQObjectDictionary() { clear(); } + TQObjectDictionary &operator=(const TQObjectDictionary &dict) + { return (TQObjectDictionary&)TQAsciiDict::operator=(dict);} +}; + +#endif // TQOBJECTDICT_H diff --git a/src/kernel/ntqobjectlist.h b/src/kernel/ntqobjectlist.h new file mode 100644 index 000000000..c1d8f7982 --- /dev/null +++ b/src/kernel/ntqobjectlist.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Definition of TQObjectList +** +** Created : 940807 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQOBJECTLIST_H +#define TQOBJECTLIST_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqptrlist.h" +#endif // QT_H + + +#if defined(Q_TEMPLATEDLL) +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; +#endif + + +class Q_EXPORT TQObjectList : public TQPtrList +{ +public: + TQObjectList() : TQPtrList() {} + TQObjectList( const TQObjectList &list ) : TQPtrList(list) {} + ~TQObjectList() { clear(); } + TQObjectList &operator=(const TQObjectList &list) + { return (TQObjectList&)TQPtrList::operator=(list); } +}; + +class Q_EXPORT TQObjectListIterator : public TQPtrListIterator +{ +public: + TQObjectListIterator( const TQObjectList &l ) + : TQPtrListIterator( l ) { } + TQObjectListIterator &operator=( const TQObjectListIterator &i ) + { return (TQObjectListIterator&) + TQPtrListIterator::operator=( i ); } +}; + +#if (QT_VERSION-0 >= 0x040000) +#if defined(Q_CC_GNU) +#warning "remove the TQObjectListIt class" +#warning "remove the typedef too, maybe" +#endif +typedef TQObjectListIterator TQObjectListIt; +#else +class Q_EXPORT TQObjectListIt : public TQPtrListIterator +{ +public: + TQObjectListIt( const TQObjectList &l ) : TQPtrListIterator(l) {} + TQObjectListIt &operator=(const TQObjectListIt &i) + { return (TQObjectListIt&)TQPtrListIterator::operator=(i); } +}; +#endif + +#endif // TQOBJECTLIST_H diff --git a/src/kernel/ntqpaintdevice.h b/src/kernel/ntqpaintdevice.h new file mode 100644 index 000000000..771aff492 --- /dev/null +++ b/src/kernel/ntqpaintdevice.h @@ -0,0 +1,421 @@ +/**************************************************************************** +** +** Definition of TQPaintDevice class +** +** Created : 940721 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPAINTDEVICE_H +#define TQPAINTDEVICE_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqrect.h" +#endif // QT_H + +#if defined(Q_WS_QWS) +class TQWSDisplay; +class TQGfx; +#endif + +class TQIODevice; +class TQString; +class TQTextItem; + + +#if defined(Q_WS_X11) +struct TQPaintDeviceX11Data; +#endif + +union TQPDevCmdParam { + int ival; + int *ivec; + TQString *str; + const TQPoint *point; + const TQRect *rect; + const TQPointArray *ptarr; + const TQPixmap *pixmap; + const TQImage *image; + const TQColor *color; + const TQFont *font; + const TQPen *pen; + const TQBrush *brush; + const TQRegion *rgn; + const TQWMatrix *matrix; + const TQTextItem *textItem; + TQIODevice *device; +}; + + + +class Q_EXPORT TQPaintDevice // device for TQPainter +{ +public: + virtual ~TQPaintDevice(); + + int devType() const; + bool isExtDev() const; + bool paintingActive() const; + + virtual void setResolution( int ); + virtual int resolution() const; + + // Windows: get device context + // X-Windows: get drawable +#if defined(Q_WS_WIN) + virtual HDC handle() const; +#elif defined(Q_WS_X11) + virtual TQt::HANDLE handle() const; + virtual TQt::HANDLE x11RenderHandle() const; +#elif defined(Q_WS_MAC) + virtual TQt::HANDLE handle() const; +#elif defined(Q_WS_QWS) + virtual TQt::HANDLE handle() const; +#endif + +#if defined(Q_WS_X11) + 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(); + + // ### in 4.0, the above need to go away, the below needs to take a -1 default + // argument, signifying the default screen... + static int x11AppDepth( int screen ); + static int x11AppCells( int screen ); + static TQt::HANDLE x11AppRootWindow( int screen ); + static TQt::HANDLE x11AppColormap( int screen ); + static void *x11AppVisual( int screen ); + static bool x11AppDefaultColormap( int screen ); + static bool x11AppDefaultVisual( int screen ); + static int x11AppDpiX( int ); + static int x11AppDpiY( int ); + static void x11SetAppDpiX( int, int ); + static void x11SetAppDpiY( int, int ); +#endif + +#if defined(Q_WS_QWS) + static TQWSDisplay *qwsDisplay(); + virtual unsigned char * scanLine(int) const; + virtual int bytesPerLine() const; + virtual TQGfx * graphicsContext(bool clip_children=TRUE) const; +#endif + + enum PDevCmd { + PdcNOP = 0, // + PdcDrawPoint = 1, // point + PdcDrawFirst = PdcDrawPoint, + PdcMoveTo = 2, // point + PdcLineTo = 3, // point + PdcDrawLine = 4, // point,point + PdcDrawRect = 5, // rect + PdcDrawRoundRect = 6, // rect,ival,ival + PdcDrawEllipse = 7, // rect + PdcDrawArc = 8, // rect,ival,ival + PdcDrawPie = 9, // rect,ival,ival + PdcDrawChord = 10, // rect,ival,ival + PdcDrawLineSegments = 11, // ptarr + PdcDrawPolyline = 12, // ptarr + PdcDrawPolygon = 13, // ptarr,ival + PdcDrawCubicBezier = 14, // ptarr + PdcDrawText = 15, // point,str + PdcDrawTextFormatted = 16, // rect,ival,str + PdcDrawPixmap = 17, // rect,pixmap + PdcDrawImage = 18, // rect,image + PdcDrawText2 = 19, // point,str + PdcDrawText2Formatted = 20, // rect,ival,str + PdcDrawTextItem = 21, + PdcDrawLast = PdcDrawTextItem, + + // no painting commands below PdcDrawLast. + + PdcBegin = 30, // + PdcEnd = 31, // + PdcSave = 32, // + PdcRestore = 33, // + PdcSetdev = 34, // device - PRIVATE + PdcSetBkColor = 40, // color + PdcSetBkMode = 41, // ival + PdcSetROP = 42, // ival + PdcSetBrushOrigin = 43, // point + PdcSetFont = 45, // font + PdcSetPen = 46, // pen + PdcSetBrush = 47, // brush + PdcSetTabStops = 48, // ival + PdcSetTabArray = 49, // ival,ivec + PdcSetUnit = 50, // ival + PdcSetVXform = 51, // ival + PdcSetWindow = 52, // rect + PdcSetViewport = 53, // rect + PdcSetWXform = 54, // ival + PdcSetWMatrix = 55, // matrix,ival + PdcSaveWMatrix = 56, + PdcRestoreWMatrix = 57, + PdcSetClip = 60, // ival + PdcSetClipRegion = 61, // rgn + + PdcReservedStart = 0, // codes 0-199 are reserved + PdcReservedStop = 199 // for TQt + }; + +protected: + TQPaintDevice( uint devflags ); + +#if defined(Q_WS_WIN) + HDC hdc; // device context +#elif defined(Q_WS_X11) + TQt::HANDLE hd; // handle to drawable + TQt::HANDLE rendhd; // handle to RENDER pict + + void copyX11Data( const TQPaintDevice * ); + void cloneX11Data( const TQPaintDevice * ); + virtual void setX11Data( const TQPaintDeviceX11Data* ); + TQPaintDeviceX11Data* getX11Data( bool def=FALSE ) const; +#elif defined(Q_WS_MAC) +#if !defined( TQMAC_NO_QUARTZ ) + CGContextRef ctx; +#endif + void * hd; +#elif defined(Q_WS_QWS) + TQt::HANDLE hd; +#endif + + virtual bool cmd( int, TQPainter *, TQPDevCmdParam * ); + virtual int metric( int ) const; + virtual int fontMet( TQFont *, int, const char * = 0, int = 0 ) const; + virtual int fontInf( TQFont *, int ) const; + + ushort devFlags; // device flags + ushort painters; // refcount + + friend class TQPainter; + friend class TQPaintDeviceMetrics; +#if defined(Q_WS_MAC) +#ifndef TQMAC_NO_QUARTZ + virtual CGContextRef macCGContext(bool clipped=TRUE) const; +#endif + friend Q_EXPORT void unclippedScaledBitBlt( TQPaintDevice *, int, int, int, int, + const TQPaintDevice *, int, int, int, int, TQt::RasterOp, bool, bool ); +#else + friend Q_EXPORT void bitBlt( TQPaintDevice *, int, int, + const TQPaintDevice *, + int, int, int, int, TQt::RasterOp, bool ); +#endif +#if defined(Q_WS_X11) + friend void qt_init_internal( int *, char **, Display *, TQt::HANDLE, TQt::HANDLE ); + friend void qt_cleanup(); +#endif + +private: +#if defined(Q_WS_X11) + static Display *x_appdisplay; + static int x_appscreen; + + static int x_appdepth; + static int x_appcells; + static TQt::HANDLE x_approotwindow; + static TQt::HANDLE x_appcolormap; + static bool x_appdefcolormap; + static void *x_appvisual; + static bool x_appdefvisual; + + // ### in 4.0, remove the above, and replace with the below + static int *x_appdepth_arr; + static int *x_appcells_arr; + static TQt::HANDLE *x_approotwindow_arr; + static TQt::HANDLE *x_appcolormap_arr; + static bool *x_appdefcolormap_arr; + static void **x_appvisual_arr; + static bool *x_appdefvisual_arr; + + TQPaintDeviceX11Data* x11Data; +#endif + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPaintDevice( const TQPaintDevice & ); + TQPaintDevice &operator=( const TQPaintDevice & ); +#endif +}; + + +Q_EXPORT +void bitBlt( TQPaintDevice *dst, int dx, int dy, + const TQPaintDevice *src, int sx=0, int sy=0, int sw=-1, int sh=-1, + TQt::RasterOp = TQt::CopyROP, bool ignoreMask=FALSE ); + +Q_EXPORT +void bitBlt( TQPaintDevice *dst, int dx, int dy, + const TQImage *src, int sx=0, int sy=0, int sw=-1, int sh=-1, + int conversion_flags=0 ); + + +#if defined(Q_WS_X11) + +struct Q_EXPORT TQPaintDeviceX11Data : public TQShared { + Display* x_display; + int x_screen; + int x_depth; + int x_cells; + TQt::HANDLE x_colormap; + bool x_defcolormap; + void* x_visual; + bool x_defvisual; +}; + +#endif + +/***************************************************************************** + Inline functions + *****************************************************************************/ + +inline int TQPaintDevice::devType() const +{ return devFlags & TQInternal::DeviceTypeMask; } + +inline bool TQPaintDevice::isExtDev() const +{ return (devFlags & TQInternal::ExternalDevice) != 0; } + +inline bool TQPaintDevice::paintingActive() const +{ return painters != 0; } + +#if defined(Q_WS_X11) +inline Display *TQPaintDevice::x11Display() const +{ return x11Data ? x11Data->x_display : x_appdisplay; } + +inline int TQPaintDevice::x11Screen() const +{ return x11Data ? x11Data->x_screen : x_appscreen; } + +inline int TQPaintDevice::x11Depth() const +{ return x11Data ? x11Data->x_depth : x_appdepth; } + +inline int TQPaintDevice::x11Cells() const +{ return x11Data ? x11Data->x_cells : x_appcells; } + +inline TQt::HANDLE TQPaintDevice::x11Colormap() const +{ return x11Data ? x11Data->x_colormap : x_appcolormap; } + +inline bool TQPaintDevice::x11DefaultColormap() const +{ return x11Data ? x11Data->x_defcolormap : x_appdefcolormap; } + +inline void *TQPaintDevice::x11Visual() const +{ return x11Data ? x11Data->x_visual : x_appvisual; } + +inline bool TQPaintDevice::x11DefaultVisual() const +{ return x11Data ? x11Data->x_defvisual : x_appdefvisual; } + +inline Display *TQPaintDevice::x11AppDisplay() +{ return x_appdisplay; } + +inline int TQPaintDevice::x11AppScreen() +{ return x_appscreen; } + +inline int TQPaintDevice::x11AppDepth( int screen ) +{ return x_appdepth_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline int TQPaintDevice::x11AppCells( int screen ) +{ return x_appcells_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline TQt::HANDLE TQPaintDevice::x11AppRootWindow( int screen ) +{ return x_approotwindow_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline TQt::HANDLE TQPaintDevice::x11AppColormap( int screen ) +{ return x_appcolormap_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline bool TQPaintDevice::x11AppDefaultColormap( int screen ) +{ return x_appdefcolormap_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline void *TQPaintDevice::x11AppVisual( int screen ) +{ return x_appvisual_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline bool TQPaintDevice::x11AppDefaultVisual( int screen ) +{ return x_appdefvisual_arr[ screen == -1 ? x_appscreen : screen ]; } + +inline int TQPaintDevice::x11AppDepth() +{ return x_appdepth; } + +inline int TQPaintDevice::x11AppCells() +{ return x_appcells; } + +inline TQt::HANDLE TQPaintDevice::x11AppRootWindow() +{ return x_approotwindow; } + +inline TQt::HANDLE TQPaintDevice::x11AppColormap() +{ return x_appcolormap; } + +inline bool TQPaintDevice::x11AppDefaultColormap() +{ return x_appdefcolormap; } + +inline void *TQPaintDevice::x11AppVisual() +{ return x_appvisual; } + +inline bool TQPaintDevice::x11AppDefaultVisual() +{ return x_appdefvisual; } + +#endif // Q_WS_X11 + + +Q_EXPORT +inline void bitBlt( TQPaintDevice *dst, const TQPoint &dp, + const TQPaintDevice *src, const TQRect &sr =TQRect(0,0,-1,-1), + TQt::RasterOp rop=TQt::CopyROP, bool ignoreMask=FALSE ) +{ + bitBlt( dst, dp.x(), dp.y(), src, sr.x(), sr.y(), sr.width(), sr.height(), + rop, ignoreMask ); +} + + + + +#endif // TQPAINTDEVICE_H diff --git a/src/kernel/ntqpaintdevicedefs.h b/src/kernel/ntqpaintdevicedefs.h new file mode 100644 index 000000000..beb0c09db --- /dev/null +++ b/src/kernel/ntqpaintdevicedefs.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Definition of TQPaintDevice constants and flags +** +** Created : 940721 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPAINTDEVICEDEFS_H +#define TQPAINTDEVICEDEFS_H + +#error "this file is gone. the #defines it contained are in" +#error "ntq1xcompatibility.h; the functionality is in TQPaintDevice" +#error "and TQPaintDeviceMetrics." + +#endif // TQPAINTDEVICEDEFS_H diff --git a/src/kernel/ntqpaintdevicemetrics.h b/src/kernel/ntqpaintdevicemetrics.h new file mode 100644 index 000000000..e618a1d26 --- /dev/null +++ b/src/kernel/ntqpaintdevicemetrics.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Definition of TQPaintDeviceMetrics class +** +** Created : 941109 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPAINTDEVICEMETRICS_H +#define TQPAINTDEVICEMETRICS_H + +#ifndef QT_H +#include "ntqpaintdevice.h" +#endif // QT_H + + +class Q_EXPORT TQPaintDeviceMetrics // paint device metrics +{ +public: + TQPaintDeviceMetrics( const TQPaintDevice * ); + + enum { + PdmWidth = 1, + PdmHeight, + PdmWidthMM, + PdmHeightMM, + PdmNumColors, + PdmDepth, + PdmDpiX, + PdmDpiY, + PdmPhysicalDpiX, + PdmPhysicalDpiY + }; + + int width() const { return (int)pdev->metric(PdmWidth); } + int height() const { return (int)pdev->metric(PdmHeight); } + int widthMM() const { return (int)pdev->metric(PdmWidthMM); } + int heightMM() const { return (int)pdev->metric(PdmHeightMM); } + int logicalDpiX() const { return (int)pdev->metric(PdmDpiX); } + int logicalDpiY() const { return (int)pdev->metric(PdmDpiY); } + int physicalDpiX()const { return (int)pdev->metric(PdmPhysicalDpiX); } + int physicalDpiY()const { return (int)pdev->metric(PdmPhysicalDpiY); } + int numColors() const { return (int)pdev->metric(PdmNumColors); } + int depth() const { return (int)pdev->metric(PdmDepth); } + +private: + TQPaintDevice *pdev; +}; + + +#endif // TQPAINTDEVICEMETRICS_H diff --git a/src/kernel/ntqpainter.h b/src/kernel/ntqpainter.h new file mode 100644 index 000000000..bcccdb59e --- /dev/null +++ b/src/kernel/ntqpainter.h @@ -0,0 +1,721 @@ +/**************************************************************************** +** +** Definition of TQPainter class +** +** Created : 940112 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPAINTER_H +#define TQPAINTER_H + + +#ifndef QT_H +#include "ntqcolor.h" +#include "ntqfontmetrics.h" +#include "ntqfontinfo.h" +#include "ntqregion.h" +#include "ntqpen.h" +#include "ntqbrush.h" +#include "ntqpointarray.h" +#include "ntqwmatrix.h" +#endif // QT_H + +class TQGfx; +class TQTextCodec; +class TQTextParag; +class TQPaintDevice; +class TQTextItem; +#if defined( Q_WS_MAC ) +class TQMacSavedPortInfo; +#endif +class TQPainterPrivate; + +#if defined(Q_WS_QWS) +class TQScreen; +#endif + +class Q_EXPORT TQPainter : public TQt +{ +public: + enum CoordinateMode { CoordDevice, CoordPainter }; + + TQPainter(); + TQPainter( const TQPaintDevice *, bool unclipped = FALSE ); + TQPainter( const TQPaintDevice *, const TQWidget *, bool unclipped = FALSE ); + ~TQPainter(); + + bool begin( const TQPaintDevice *, bool unclipped = FALSE ); + bool begin( const TQPaintDevice *, const TQWidget *, bool unclipped = FALSE ); + bool end(); + TQPaintDevice *device() const; + +#ifdef Q_WS_QWS + TQGfx * internalGfx(); +#ifdef QT_QWS_EXPERIMENTAL_SCREENPAINTER + bool begin(TQScreen *screen); +#endif +#endif + + static void redirect( TQPaintDevice *pdev, TQPaintDevice *replacement ); + static TQPaintDevice *redirect( TQPaintDevice *pdev ); + + bool isActive() const; + + void flush( const TQRegion ®ion, CoordinateMode cm = CoordDevice ); + void flush(); + void save(); + void restore(); + + // Drawing tools + + 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 & ); + TQPoint pos() const; + + // Drawing attributes/modes + + 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 x, int y ); + void setBrushOrigin( const TQPoint & ); + + // Scaling and transformations + +// PaintUnit unit() const; // get set painter unit +// void setUnit( PaintUnit ); // NOT IMPLEMENTED!!! + + bool hasViewXForm() const; + bool hasWorldXForm() const; + +#ifndef QT_NO_TRANSFORMATIONS + void setViewXForm( bool ); // set xform on/off + TQRect window() const; // get window + void setWindow( const TQRect & ); // set window + void setWindow( int x, int y, int w, int h ); + TQRect viewport() const; // get viewport + void setViewport( const TQRect & ); // set viewport + void setViewport( int x, int y, int w, int h ); + + void setWorldXForm( bool ); // set world xform on/off + const TQWMatrix &worldMatrix() const; // get/set world xform matrix + void setWorldMatrix( const TQWMatrix &, bool combine=FALSE ); + + void saveWorldMatrix(); + void restoreWorldMatrix(); + + void scale( double sx, double sy ); + void shear( double sh, double sv ); + void rotate( double a ); +#endif + void translate( double dx, double dy ); + void resetXForm(); + double translationX() const; + double translationY() const; + + TQPoint xForm( const TQPoint & ) const; // map virtual -> device + TQRect xForm( const TQRect & ) const; + TQPointArray xForm( const TQPointArray & ) const; + TQPointArray xForm( const TQPointArray &, int index, int npoints ) const; + TQPoint xFormDev( const TQPoint & ) const; // map device -> virtual + TQRect xFormDev( const TQRect & ) const; + TQPointArray xFormDev( const TQPointArray & ) const; + TQPointArray xFormDev( const TQPointArray &, int index, int npoints ) const; + + // Clipping + + void setClipping( bool ); // set clipping on/off + bool hasClipping() const; + TQRegion clipRegion( CoordinateMode = CoordDevice ) const; + void setClipRect( const TQRect &, CoordinateMode = CoordDevice ); // set clip rectangle + void setClipRect( int x, int y, int w, int h, CoordinateMode = CoordDevice ); + void setClipRegion( const TQRegion &, CoordinateMode = CoordDevice );// set clip region + + // Graphics drawing functions + + void drawPoint( int x, int y ); + void drawPoint( const TQPoint & ); + void drawPoints( const TQPointArray& a, + int index=0, int npoints=-1 ); + void moveTo( int x, int y ); + void moveTo( const TQPoint & ); + void lineTo( int x, int y ); + void lineTo( const TQPoint & ); + void drawLine( int x1, int y1, int x2, int y2 ); + void drawLine( const TQPoint &, const TQPoint & ); + void drawRect( int x, int y, int w, int h ); + void drawRect( const TQRect & ); + void drawWinFocusRect( int x, int y, int w, int h ); + void drawWinFocusRect( int x, int y, int w, int h, + const TQColor &bgColor ); + void drawWinFocusRect( const TQRect & ); + void drawWinFocusRect( const TQRect &, + const TQColor &bgColor ); + void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 ); + void drawRoundRect( const TQRect &, int = 25, int = 25 ); + void drawEllipse( int x, int y, int w, int h ); + void drawEllipse( const TQRect & ); + void drawArc( int x, int y, int w, int h, int a, int alen ); + void drawArc( const TQRect &, int a, int alen ); + void drawPie( int x, int y, int w, int h, int a, int alen ); + void drawPie( const TQRect &, int a, int alen ); + void drawChord( int x, int y, int w, int h, int a, int alen ); + void drawChord( const TQRect &, int a, int alen ); + void drawLineSegments( const TQPointArray &, + int index=0, int nlines=-1 ); + void drawPolyline( const TQPointArray &, + int index=0, int npoints=-1 ); + void drawPolygon( const TQPointArray &, bool winding=FALSE, + int index=0, int npoints=-1 ); + void drawConvexPolygon( const TQPointArray &, + int index=0, int npoints=-1 ); +#ifndef QT_NO_BEZIER + void drawCubicBezier( const TQPointArray &, int index=0 ); +#endif + void drawPixmap( int x, int y, const TQPixmap &, + int sx=0, int sy=0, int sw=-1, int sh=-1 ); + void drawPixmap( const TQPoint &, const TQPixmap &, + const TQRect &sr ); + void drawPixmap( const TQPoint &, const TQPixmap & ); + void drawPixmap( const TQRect &, const TQPixmap & ); + void drawImage( int x, int y, const TQImage &, + int sx = 0, int sy = 0, int sw = -1, int sh = -1, + int conversionFlags = 0 ); + void drawImage( const TQPoint &, const TQImage &, + const TQRect &sr, int conversionFlags = 0 ); + void drawImage( const TQPoint &, const TQImage &, + int conversion_flags = 0 ); + void drawImage( const TQRect &, const TQImage & ); + void drawTiledPixmap( int x, int y, int w, int h, const TQPixmap &, + int sx=0, int sy=0 ); + void drawTiledPixmap( const TQRect &, const TQPixmap &, + const TQPoint & ); + void drawTiledPixmap( const TQRect &, const TQPixmap & ); +#ifndef QT_NO_PICTURE + void drawPicture( const TQPicture & ); + void drawPicture( int x, int y, const TQPicture & ); + void drawPicture( const TQPoint &, const TQPicture & ); +#endif + + void fillRect( int x, int y, int w, int h, const TQBrush & ); + void fillRect( const TQRect &, const TQBrush & ); + void eraseRect( int x, int y, int w, int h ); + void eraseRect( const TQRect & ); + + // Text drawing functions + + enum TextDirection { + Auto, + RTL, + LTR + }; + + void drawText( int x, int y, const TQString &, int len = -1, TextDirection dir = Auto ); + void drawText( const TQPoint &, const TQString &, int len = -1, TextDirection dir = Auto ); + + void drawText( int x, int y, const TQString &, int pos, int len, TextDirection dir = Auto ); + void drawText( const TQPoint &p, const TQString &, int pos, int len, TextDirection dir = Auto ); + + void drawText( int x, int y, int w, int h, int flags, + const TQString&, int len = -1, TQRect *br=0, + TQTextParag **intern=0 ); + void drawText( const TQRect &, int flags, + const TQString&, int len = -1, TQRect *br=0, + TQTextParag **intern=0 ); + + void drawTextItem( int x, int y, const TQTextItem &ti, int textflags = 0 ); + void drawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags = 0 ); + + TQRect boundingRect( int x, int y, int w, int h, int flags, + const TQString&, int len = -1, TQTextParag **intern=0 ); + TQRect boundingRect( const TQRect &, int flags, + const TQString&, int len = -1, TQTextParag **intern=0 ); + + int tabStops() const; + void setTabStops( int ); + int *tabArray() const; + void setTabArray( int * ); + + // Other functions + +#if defined(Q_WS_WIN) + HDC handle() const; +#elif defined(Q_WS_X11) || defined(Q_WS_MAC) + HANDLE handle() const; +#endif + + + static void initialize(); + static void cleanup(); + +private: + void init(); + void destroy(); + void updateFont(); + void updatePen(); + void updateBrush(); +#ifndef QT_NO_TRANSFORMATIONS + void updateXForm(); + void updateInvXForm(); +#endif + void map( int, int, int *rx, int *ry ) const; + void map( int, int, int, int, int *, int *, int *, int * ) const; + void mapInv( int, int, int *, int * ) const; + void mapInv( int, int, int, int, int *, int *, int *, int * ) const; + void drawPolyInternal( const TQPointArray &, bool close=TRUE ); + void drawWinFocusRect( int x, int y, int w, int h, bool xorPaint, + const TQColor &penColor ); + + enum { IsActive=0x01, ExtDev=0x02, IsStartingUp=0x04, NoCache=0x08, + VxF=0x10, WxF=0x20, ClipOn=0x40, SafePolygon=0x80, MonoDev=0x100, + DirtyFont=0x200, DirtyPen=0x400, DirtyBrush=0x800, + RGBColor=0x1000, FontMet=0x2000, FontInf=0x4000, CtorBegin=0x8000, + UsePrivateCx = 0x10000, VolatileDC = 0x20000, TQt2Compat = 0x40000 }; + uint flags; + bool testf( uint b ) const { return (flags&b)!=0; } + void setf( uint b ) { flags |= b; } + void setf( uint b, bool v ); + void clearf( uint b ) { flags &= (uint)(~b); } + void fix_neg_rect( int *x, int *y, int *w, int *h ); + + TQPainterPrivate *d; + TQPaintDevice *pdev; + TQColor bg_col; + uchar bg_mode; + uchar rop; + uchar pu; + TQPoint bro; + TQFont cfont; + TQFont *pfont; // font used for metrics (might be different for printers) + TQPen cpen; + TQBrush cbrush; + TQRegion crgn; + int tabstops; + int *tabarray; + int tabarraylen; + bool block_ext; // for temporary blocking of external devices + + // Transformations +#ifndef QT_NO_TRANSFORMATIONS + TQCOORD wx, wy, ww, wh; + TQCOORD vx, vy, vw, vh; + TQWMatrix wxmat; + + // Cached composition (and inverse) of transformations + TQWMatrix xmat; + TQWMatrix ixmat; + + + + double m11() const { return xmat.m11(); } + double m12() const { return xmat.m12(); } + double m21() const { return xmat.m21(); } + double m22() const { return xmat.m22(); } + double dx() const { return xmat.dx(); } + double dy() const { return xmat.dy(); } + double im11() const { return ixmat.m11(); } + double im12() const { return ixmat.m12(); } + double im21() const { return ixmat.m21(); } + double im22() const { return ixmat.m22(); } + double idx() const { return ixmat.dx(); } + double idy() const { return ixmat.dy(); } + + int txop; + bool txinv; + +#else + // even without transformations we still have translations + int xlatex; + int xlatey; +#endif + + void *penRef; // pen cache ref + void *brushRef; // brush cache ref + void *ps_stack; + void *wm_stack; + void killPStack(); + +protected: +#ifdef Q_OS_TEMP + TQPoint internalCurrentPos; + uint old_pix; // ### All win platforms in 4.0 +#endif +#if defined(Q_WS_WIN) + friend class TQFontEngineWin; + friend class TQFontEngineBox; + QT_WIN_PAINTER_MEMBERS +#elif defined(Q_WS_X11) + friend class TQFontEngineXLFD; + friend class TQFontEngineXft; + friend class TQFontEngineBox; + Display *dpy; // current display + int scrn; // current screen + TQt::HANDLE hd; // handle to drawable + TQt::HANDLE rendhd; // handle to Xft draw + GC gc; // graphics context (standard) + GC gc_brush; // graphics contect for brush + TQPoint curPt; // current point + uint clip_serial; // clipping serial number +#elif defined(Q_WS_MAC) + TQt::HANDLE hd; // handle to drawable + void initPaintDevice(bool force=FALSE, TQPoint *off=NULL, TQRegion *rgn=NULL); + friend const TQRegion &qt_mac_update_painter(TQPainter *, bool); + friend class TQFontEngineMac; + friend class TQMacPainter; +#elif defined(Q_WS_QWS) + friend class TQFontEngine; + TQGfx * gfx; + friend void qwsUpdateActivePainters(); +#endif + friend class TQFontMetrics; + friend class TQFontInfo; + friend class TQTextLayout; + friend void qt_format_text( const TQFont &, const TQRect &r, + int tf, const TQString& str, int len, TQRect *brect, + int tabstops, int* tabarray, int tabarraylen, + TQTextParag **internal, TQPainter* painter ); + friend void qt_draw_background( TQPainter *p, int x, int y, int w, int h ); + friend void qt_draw_transformed_rect( TQPainter *p, int x, int y, int w, int h, bool fill ); + friend class TQPrinter; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPainter( const TQPainter & ); + TQPainter &operator=( const TQPainter & ); +#endif + + enum TransformationCodes { + TxNone = 0, // transformation codes + TxTranslate = 1, // copy in qpainter_*.cpp + TxScale = 2, + TxRotShear = 3 + }; +}; + + +/***************************************************************************** + TQPainter member functions + *****************************************************************************/ + +inline TQPaintDevice *TQPainter::device() const +{ + return pdev; +} + +inline bool TQPainter::isActive() const +{ + return testf(IsActive); +} + +inline const TQFont &TQPainter::font() const +{ + return cfont; +} + +inline const TQPen &TQPainter::pen() const +{ + return cpen; +} + +inline const TQBrush &TQPainter::brush() const +{ + return cbrush; +} + +/* +inline PaintUnit TQPainter::unit() const +{ + return (PaintUnit)pu; +} +*/ + +inline const TQColor &TQPainter::backgroundColor() const +{ + return bg_col; +} + +inline TQt::BGMode TQPainter::backgroundMode() const +{ + return (BGMode)bg_mode; +} + +inline TQt::RasterOp TQPainter::rasterOp() const +{ + return (RasterOp)rop; +} + +inline const TQPoint &TQPainter::brushOrigin() const +{ + return bro; +} + +inline bool TQPainter::hasViewXForm() const +{ +#ifndef QT_NO_TRANSFORMATIONS + return testf(VxF); +#else + return xlatex || xlatey; +#endif +} + +inline bool TQPainter::hasWorldXForm() const +{ +#ifndef QT_NO_TRANSFORMATIONS + return testf(WxF); +#else + return xlatex || xlatey; +#endif +} + +inline double TQPainter::translationX() const +{ +#ifndef QT_NO_TRANSFORMATIONS + return worldMatrix().dx(); +#else + return xlatex; +#endif +} + +inline double TQPainter::translationY() const +{ +#ifndef QT_NO_TRANSFORMATIONS + return worldMatrix().dy(); +#else + return xlatey; +#endif +} + + +inline bool TQPainter::hasClipping() const +{ + return testf(ClipOn); +} + +inline int TQPainter::tabStops() const +{ + return tabstops; +} + +inline int *TQPainter::tabArray() const +{ + return tabarray; +} + +#if defined(Q_WS_WIN) +inline HDC TQPainter::handle() const +{ + return hdc; +} +#elif defined(Q_WS_X11) || defined(Q_WS_MAC) +inline TQt::HANDLE TQPainter::handle() const +{ + return hd; +} +#endif + +inline void TQPainter::setBrushOrigin( const TQPoint &p ) +{ + setBrushOrigin( p.x(), p.y() ); +} + +#ifndef QT_NO_TRANSFORMATIONS +inline void TQPainter::setWindow( const TQRect &r ) +{ + setWindow( r.x(), r.y(), r.width(), r.height() ); +} + +inline void TQPainter::setViewport( const TQRect &r ) +{ + setViewport( r.x(), r.y(), r.width(), r.height() ); +} +#endif + +inline void TQPainter::setClipRect( int x, int y, int w, int h, CoordinateMode m ) +{ + setClipRect( TQRect(x,y,w,h), m ); +} + +inline void TQPainter::drawPoint( const TQPoint &p ) +{ + drawPoint( p.x(), p.y() ); +} + +inline void TQPainter::moveTo( const TQPoint &p ) +{ + moveTo( p.x(), p.y() ); +} + +inline void TQPainter::lineTo( const TQPoint &p ) +{ + lineTo( p.x(), p.y() ); +} + +inline void TQPainter::drawLine( const TQPoint &p1, const TQPoint &p2 ) +{ + drawLine( p1.x(), p1.y(), p2.x(), p2.y() ); +} + +inline void TQPainter::drawRect( const TQRect &r ) +{ + drawRect( r.x(), r.y(), r.width(), r.height() ); +} + +inline void TQPainter::drawWinFocusRect( const TQRect &r ) +{ + drawWinFocusRect( r.x(), r.y(), r.width(), r.height() ); +} + +inline void TQPainter::drawWinFocusRect( const TQRect &r,const TQColor &penColor ) +{ + drawWinFocusRect( r.x(), r.y(), r.width(), r.height(), penColor ); +} + +inline void TQPainter::drawRoundRect( const TQRect &r, int xRnd, int yRnd ) +{ + drawRoundRect( r.x(), r.y(), r.width(), r.height(), xRnd, yRnd ); +} + +inline void TQPainter::drawEllipse( const TQRect &r ) +{ + drawEllipse( r.x(), r.y(), r.width(), r.height() ); +} + +inline void TQPainter::drawArc( const TQRect &r, int a, int alen ) +{ + drawArc( r.x(), r.y(), r.width(), r.height(), a, alen ); +} + +inline void TQPainter::drawPie( const TQRect &r, int a, int alen ) +{ + drawPie( r.x(), r.y(), r.width(), r.height(), a, alen ); +} + +inline void TQPainter::drawChord( const TQRect &r, int a, int alen ) +{ + drawChord( r.x(), r.y(), r.width(), r.height(), a, alen ); +} + +inline void TQPainter::drawPixmap( const TQPoint &p, const TQPixmap &pm, + const TQRect &sr ) +{ + drawPixmap( p.x(), p.y(), pm, sr.x(), sr.y(), sr.width(), sr.height() ); +} + +inline void TQPainter::drawImage( const TQPoint &p, const TQImage &pm, + const TQRect &sr, int conversionFlags ) +{ + drawImage( p.x(), p.y(), pm, + sr.x(), sr.y(), sr.width(), sr.height(), conversionFlags ); +} + +inline void TQPainter::drawTiledPixmap( const TQRect &r, const TQPixmap &pm, + const TQPoint &sp ) +{ + drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, sp.x(), sp.y() ); +} + +inline void TQPainter::drawTiledPixmap( const TQRect &r, const TQPixmap &pm ) +{ + drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, 0, 0 ); +} + +inline void TQPainter::fillRect( const TQRect &r, const TQBrush &brush ) +{ + fillRect( r.x(), r.y(), r.width(), r.height(), brush ); +} + +inline void TQPainter::eraseRect( int x, int y, int w, int h ) +{ + fillRect( x, y, w, h, backgroundColor() ); +} + +inline void TQPainter::eraseRect( const TQRect &r ) +{ + fillRect( r.x(), r.y(), r.width(), r.height(), backgroundColor() ); +} + +inline void TQPainter::drawText( const TQPoint &p, const TQString &s, int len, TextDirection dir ) +{ + drawText( p.x(), p.y(), s, 0, len, dir ); +} + +inline void TQPainter::drawText( const TQPoint &p, const TQString &s, int pos, int len, TextDirection dir ) +{ + drawText( p.x(), p.y(), s, pos, len, dir ); +} + +inline void TQPainter::drawText( int x, int y, int w, int h, int tf, + const TQString& str, int len, TQRect *br, TQTextParag **i ) +{ + TQRect r(x, y, w, h); + drawText( r, tf, str, len, br, i ); +} + +inline void TQPainter::drawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags ) +{ + drawTextItem( p.x(), p.y(), ti, textflags ); +} + +inline TQRect TQPainter::boundingRect( int x, int y, int w, int h, int tf, + const TQString& str, int len, TQTextParag **i ) +{ + TQRect r(x, y, w, h); + return boundingRect( r, tf, str, len, i ); +} + +#if defined(Q_WS_QWS) +inline TQGfx * TQPainter::internalGfx() +{ + return gfx; +} +#endif + +#endif // TQPAINTER_H diff --git a/src/kernel/ntqpalette.h b/src/kernel/ntqpalette.h new file mode 100644 index 000000000..b3b155f25 --- /dev/null +++ b/src/kernel/ntqpalette.h @@ -0,0 +1,189 @@ +/**************************************************************************** +** +** Definition of TQColorGroup and TQPalette classes +** +** Created : 950323 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPALETTE_H +#define TQPALETTE_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqcolor.h" +#include "ntqshared.h" +#include "ntqbrush.h" // TQColor->TQBrush conversion +#endif // QT_H + +#ifndef QT_NO_PALETTE + +class TQColorGroupPrivate; + +class Q_EXPORT TQColorGroup +{ +public: + TQColorGroup(); + TQColorGroup( const TQColor &foreground, const TQColor &button, + const TQColor &light, const TQColor &dark, const TQColor &mid, + const TQColor &text, const TQColor &base ); + TQColorGroup( const TQBrush &foreground, const TQBrush &button, + const TQBrush &light, const TQBrush &dark, const TQBrush &mid, + const TQBrush &text, const TQBrush &bright_text, + const TQBrush &base, const TQBrush &background); + TQColorGroup( const TQColorGroup & ); + + ~TQColorGroup(); + + TQColorGroup& operator =(const TQColorGroup&); + + // Do not change the order, the serialization format depends on it + 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 { return br[Foreground].color(); } + const TQColor &button() const { return br[Button].color(); } + const TQColor &light() const { return br[Light].color(); } + const TQColor &dark() const { return br[Dark].color(); } + const TQColor &mid() const { return br[Mid].color(); } + const TQColor &text() const { return br[Text].color(); } + const TQColor &base() const { return br[Base].color(); } + const TQColor &background() const { return br[Background].color(); } + + const TQColor &midlight() const { return br[Midlight].color(); } + const TQColor &brightText() const { return br[BrightText].color(); } + const TQColor &buttonText() const { return br[ButtonText].color(); } + const TQColor &shadow() const { return br[Shadow].color(); } + const TQColor &highlight() const { return br[Highlight].color(); } + const TQColor &highlightedText() const{return br[HighlightedText].color(); } + const TQColor &link() const { return br[Link].color(); } + const TQColor &linkVisited() const { return br[LinkVisited].color(); } + + bool operator==( const TQColorGroup &g ) const; + bool operator!=( const TQColorGroup &g ) const + { return !(operator==(g)); } + +private: + TQBrush *br; + TQColorGroupPrivate * d; + + friend class TQPalette; +}; + + +class Q_EXPORT TQPalette +{ +public: + TQPalette(); + TQPalette( const TQColor &button ); + TQPalette( const TQColor &button, const TQColor &background ); + TQPalette( const TQColorGroup &active, const TQColorGroup &disabled, + const TQColorGroup &inactive ); + TQPalette( const TQPalette & ); + ~TQPalette(); + TQPalette &operator=( const TQPalette & ); + + enum ColorGroup { Disabled, Active, Inactive, NColorGroups, Normal=Active }; + + 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 { return data->active; } + const TQColorGroup &disabled() const { return data->disabled; } + const TQColorGroup &inactive() const { return data->inactive; } +#ifndef QT_NO_COMPAT + const TQColorGroup &normal() const { return active(); } +#endif + + void setActive( const TQColorGroup & ); + void setDisabled( const TQColorGroup & ); + void setInactive( const TQColorGroup & ); +#ifndef QT_NO_COMPAT + void setNormal( const TQColorGroup & cg ) { setActive(cg); } +#endif + + bool operator==( const TQPalette &p ) const; + bool operator!=( const TQPalette &p ) const + { return !(operator==(p)); } + bool isCopyOf( const TQPalette & ); + + int serialNumber() const { return data->ser_no; } + + + static TQColorGroup::ColorRole foregroundRoleFromMode( TQt::BackgroundMode mode ); + static TQColorGroup::ColorRole backgroundRoleFromMode( TQt::BackgroundMode mode); + +private: + void detach(); + const TQBrush &directBrush( ColorGroup, TQColorGroup::ColorRole ) const; + void directSetBrush( ColorGroup, TQColorGroup::ColorRole, const TQBrush& ); + + struct TQPalData : public TQShared { + TQColorGroup disabled; + TQColorGroup active; + int ser_no; + TQColorGroup inactive; + } *data; +}; + + +/***************************************************************************** + TQColorGroup/TQPalette stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQColorGroup & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQColorGroup & ); + +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPalette & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPalette & ); +#endif // QT_NO_DATASTREAM + +#endif // QT_NO_PALETTE +#endif // TQPALETTE_H diff --git a/src/kernel/ntqpen.h b/src/kernel/ntqpen.h new file mode 100644 index 000000000..e92a7cc06 --- /dev/null +++ b/src/kernel/ntqpen.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Definition of TQPen class +** +** Created : 940112 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPEN_H +#define TQPEN_H + +#ifndef QT_H +#include "ntqcolor.h" +#include "ntqshared.h" +#endif // QT_H + + +class Q_EXPORT TQPen: public TQt +{ +public: + TQPen(); + TQPen( PenStyle ); + TQPen( const TQColor &color, uint width=0, PenStyle style=SolidLine ); + TQPen( const TQColor &cl, uint w, PenStyle s, PenCapStyle c, PenJoinStyle j); + TQPen( const TQPen & ); + ~TQPen(); + TQPen &operator=( const TQPen & ); + + PenStyle style() const { return data->style; } + void setStyle( PenStyle ); + uint width() const { return data->width; } + void setWidth( uint ); + const TQColor &color() const { return data->color; } + void setColor( const TQColor & ); + PenCapStyle capStyle() const; + void setCapStyle( PenCapStyle ); + PenJoinStyle joinStyle() const; + void setJoinStyle( PenJoinStyle ); + + bool operator==( const TQPen &p ) const; + bool operator!=( const TQPen &p ) const + { return !(operator==(p)); } + +private: + friend class TQPainter; +#ifdef Q_WS_WIN + friend class TQFontEngineWin; +#endif + + TQPen copy() const; + void detach(); + void init( const TQColor &, uint, uint ); + struct TQPenData : public TQShared { // pen data + PenStyle style; + uint width; + TQColor color; + Q_UINT16 linest; + } *data; +}; + + +/***************************************************************************** + TQPen stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPen & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPen & ); +#endif + +#endif // TQPEN_H diff --git a/src/kernel/ntqpicture.h b/src/kernel/ntqpicture.h new file mode 100644 index 000000000..9a76a7b5d --- /dev/null +++ b/src/kernel/ntqpicture.h @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Definition of TQPicture class +** +** Created : 940729 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPICTURE_H +#define TQPICTURE_H + +#ifndef QT_H +#include "ntqpaintdevice.h" +#include "ntqbuffer.h" +#endif // QT_H + +#ifndef QT_NO_PICTURE + +class Q_EXPORT TQPicture : public TQPaintDevice // picture class +{ +public: + TQPicture( int formatVersion = -1 ); + TQPicture( const TQPicture & ); + ~TQPicture(); + + bool isNull() const; + + uint size() const; + const char* data() const; + virtual void setData( const char* data, uint size ); + + bool play( TQPainter * ); + + bool load( TQIODevice *dev, const char *format = 0 ); + bool load( const TQString &fileName, const char *format = 0 ); + bool save( TQIODevice *dev, const char *format = 0 ); + bool save( const TQString &fileName, const char *format = 0 ); + + TQRect boundingRect() const; + void setBoundingRect( const TQRect &r ); + + TQPicture& operator= (const TQPicture&); + + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPicture & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPicture & ); + +protected: + bool cmd( int, TQPainter *, TQPDevCmdParam * ); + int metric( int ) const; + void detach(); + TQPicture copy() const; + +private: + bool exec( TQPainter *, TQDataStream &, int ); + + struct TQPicturePrivate : public TQShared { + bool cmd( int, TQPainter *, TQPDevCmdParam * ); + bool checkFormat(); + void resetFormat(); + + TQBuffer pictb; + int trecs; + bool formatOk; + int formatMajor; + int formatMinor; + TQRect brect; + } *d; +}; + + +inline bool TQPicture::isNull() const +{ + return d->pictb.buffer().isNull(); +} + +inline uint TQPicture::size() const +{ + return d->pictb.buffer().size(); +} + +inline const char* TQPicture::data() const +{ + return d->pictb.buffer().data(); +} + +/***************************************************************************** + TQPicture stream functions + *****************************************************************************/ + +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPicture & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPicture & ); + +#endif // QT_NO_PICTURE + +#endif // TQPICTURE_H diff --git a/src/kernel/ntqpixmap.h b/src/kernel/ntqpixmap.h new file mode 100644 index 000000000..abf203690 --- /dev/null +++ b/src/kernel/ntqpixmap.h @@ -0,0 +1,354 @@ +/**************************************************************************** +** +** Definition of TQPixmap class +** +** Created : 940501 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPIXMAP_H +#define TQPIXMAP_H + +#ifndef QT_H +#include "ntqpaintdevice.h" +#include "ntqcolor.h" // char*->TQColor conversion +#include "ntqstring.h" // char*->TQString conversion +#include "ntqnamespace.h" +#endif // QT_H + +class TQGfx; +class TQPixmapPrivate; + +#if defined(Q_WS_WIN) +// Internal pixmap memory optimization class for Windows 9x +class TQMultiCellPixmap; +#endif + + +class Q_EXPORT TQPixmap : public TQPaintDevice, public TQt +{ +public: + enum ColorMode { Auto, Color, Mono }; + enum Optimization { DefaultOptim, NoOptim, MemoryOptim=NoOptim, + NormalOptim, BestOptim }; + + TQPixmap(); + TQPixmap( const TQImage& image ); + TQPixmap( int w, int h, int depth = -1, Optimization = DefaultOptim ); + TQPixmap( const TQSize &, int depth = -1, Optimization = DefaultOptim ); +#ifndef QT_NO_IMAGEIO + TQPixmap( const TQString& fileName, const char *format=0, + ColorMode mode=Auto ); + TQPixmap( const TQString& fileName, const char *format, + int conversion_flags ); + TQPixmap( const char *xpm[] ); // ### in 4.0, 'const char * const xpm[]'? + TQPixmap( const TQByteArray &data ); +#endif + TQPixmap( const TQPixmap & ); + ~TQPixmap(); + + TQPixmap &operator=( const TQPixmap & ); + TQPixmap &operator=( const TQImage & ); + + bool isNull() const; + + int width() const { return data->w; } + int height() const { return data->h; } + TQSize size() const { return TQSize(data->w,data->h); } + TQRect rect() const { return TQRect(0,0,data->w,data->h); } + int depth() const { return data->d; } + static int defaultDepth(); + + void fill( const TQColor &fillColor = TQt::white ); + void fill( const TQWidget *, int xofs, int yofs ); + void fill( const TQWidget *, const TQPoint &ofs ); + void resize( int width, int height ); + void resize( const TQSize & ); + + const TQBitmap *mask() const; + void setMask( const TQBitmap & ); + bool selfMask() const; + bool hasAlpha() const; + bool hasAlphaChannel() const; +#ifndef QT_NO_IMAGE_HEURISTIC_MASK + TQBitmap createHeuristicMask( bool clipTight = TRUE ) const; +#endif +#ifndef QT_NO_MIME + static TQPixmap fromMimeSource( const TQString& abs_name ); +#endif + static TQPixmap grabWindow( WId, int x=0, int y=0, int w=-1, int h=-1 ); + static TQPixmap grabWidget( TQWidget * widget, + int x=0, int y=0, int w=-1, int h=-1 ); + +#ifndef QT_NO_PIXMAP_TRANSFORMATION + TQPixmap xForm( const TQWMatrix & ) const; + static TQWMatrix trueMatrix( const TQWMatrix &, int w, int h ); +#endif + + TQImage convertToImage() const; + bool convertFromImage( const TQImage &, ColorMode mode=Auto ); + bool convertFromImage( const TQImage &, int conversion_flags ); +#ifndef QT_NO_IMAGEIO + static const char* imageFormat( const TQString &fileName ); + bool load( const TQString& fileName, const char *format=0, + ColorMode mode=Auto ); + bool load( const TQString& fileName, const char *format, + int conversion_flags ); + bool loadFromData( const uchar *buf, uint len, + const char* format=0, + ColorMode mode=Auto ); + bool loadFromData( const uchar *buf, uint len, + const char* format, + int conversion_flags ); + bool loadFromData( const TQByteArray &data, + const char* format=0, + int conversion_flags=0 ); + bool save( const TQString& fileName, const char* format, int quality = -1 ) const; + bool save( TQIODevice* device, const char* format, int quality = -1 ) const; +#endif + +#if defined(Q_WS_WIN) + HBITMAP hbm() const; +#endif + + int serialNumber() const; + + Optimization optimization() const; + void setOptimization( Optimization ); + static Optimization defaultOptimization(); + static void setDefaultOptimization( Optimization ); + + virtual void detach(); + + bool isTQBitmap() const; + +#if defined(Q_WS_WIN) + // These functions are internal and used by Windows 9x only + bool isMultiCellPixmap() const; + HDC multiCellHandle() const; + HBITMAP multiCellBitmap() const; + int multiCellOffset() const; + int allocCell(); + void freeCell( bool = FALSE ); +#endif + +#if defined(Q_WS_QWS) + virtual TQGfx * graphicsContext(bool clip_children=TRUE) const; + virtual unsigned char * scanLine(int) const; + virtual int bytesPerLine() const; + TQRgb * clut() const; + int numCols() const; +#elif defined(Q_WS_X11) + static int x11SetDefaultScreen( int screen ); + void x11SetScreen( int screen ); +#endif + +#ifndef Q_QDOC + Q_DUMMY_COMPARISON_OPERATOR(TQPixmap) +#endif + +protected: + TQPixmap( int w, int h, const uchar *data, bool isXbitmap ); + int metric( int ) const; + +#if defined(Q_WS_WIN) + struct TQMCPI { // mem optim for win9x + TQMultiCellPixmap *mcp; + int offset; + }; +#endif + + struct TQPixmapData : public TQShared { // internal pixmap data + TQCOORD w, h; + short d; + uint uninit : 1; + uint bitmap : 1; + uint selfmask : 1; +#if defined(Q_WS_WIN) + uint mcp : 1; +#endif + int ser_no; + TQBitmap *mask; +#if defined(Q_WS_WIN) + TQPixmap *maskpm; + union { + HBITMAP hbm; // if mcp == FALSE + TQMCPI *mcpi; // if mcp == TRUE + } hbm_or_mcpi; + uchar *realAlphaBits; +#ifdef Q_OS_TEMP + uchar* ppvBits; // Pointer to DIBSection bits +#endif +#elif defined(Q_WS_X11) + void *ximage; + void *maskgc; + TQPixmap *alphapm; +#elif defined(Q_WS_MAC) + ColorTable *clut; + TQPixmap *alphapm; +#elif defined(Q_WS_QWS) + int id; // ### should use TQPaintDevice::hd, since it is there + TQRgb * clut; + int numcols; + int rw; + int rh; + bool hasAlpha; +#endif + Optimization optim; +#if defined(Q_WS_WIN) + HBITMAP old_hbm; +#endif + } *data; +private: +#ifndef QT_NO_IMAGEIO + bool doImageIO( TQImageIO* io, int quality ) const; +#endif + TQPixmap( int w, int h, int depth, bool, Optimization ); + void init( int, int, int, bool, Optimization ); + void deref(); + TQPixmap copy( bool ignoreMask = FALSE ) const; +#if defined(Q_WS_WIN) + void initAlphaPixmap( uchar *bytes, int length, struct tagBITMAPINFO *bmi ); + void convertToAlphaPixmap( bool initAlpha=TRUE ); + static void bitBltAlphaPixmap( TQPixmap *dst, int dx, int dy, + const TQPixmap *src, int sx, int sy, + int sw, int sh, bool useDstAlpha ); +#endif + static Optimization defOptim; + friend Q_EXPORT void bitBlt( TQPaintDevice *, int, int, + const TQPaintDevice *, + int, int, int, int, RasterOp, bool ); + friend Q_EXPORT void bitBlt( TQPaintDevice *, int, int, + const TQImage* src, + int, int, int, int, int conversion_flags ); + friend Q_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, + const TQPixmap *src, int sx, int sy, + int sw, int sh ); + +#if defined(Q_WS_MAC) + friend void unclippedScaledBitBlt(TQPaintDevice *, int, int, int, int, + const TQPaintDevice *, int, int, int, int, + TQt::RasterOp, bool, bool); +#endif + + friend class TQBitmap; + friend class TQPaintDevice; + friend class TQPainter; + friend class TQGLWidget; +}; + + +inline bool TQPixmap::isNull() const +{ + return data->w == 0; +} + +inline void TQPixmap::fill( const TQWidget *w, const TQPoint &ofs ) +{ + fill( w, ofs.x(), ofs.y() ); +} + +inline void TQPixmap::resize( const TQSize &s ) +{ + resize( s.width(), s.height() ); +} + +inline const TQBitmap *TQPixmap::mask() const +{ + return data->mask; +} + +inline bool TQPixmap::selfMask() const +{ + return data->selfmask; +} + +#if defined(Q_WS_WIN) +inline HBITMAP TQPixmap::hbm() const +{ + return data->mcp ? 0 : data->hbm_or_mcpi.hbm; +} +#endif + +inline int TQPixmap::serialNumber() const +{ + return data->ser_no; +} + +inline TQPixmap::Optimization TQPixmap::optimization() const +{ + return data->optim; +} + +inline bool TQPixmap::isTQBitmap() const +{ + return data->bitmap; +} + +#if defined(Q_WS_WIN) +inline bool TQPixmap::isMultiCellPixmap() const +{ + return data->mcp; +} +#endif + + +/***************************************************************************** + TQPixmap stream functions + *****************************************************************************/ + +#if !defined(QT_NO_DATASTREAM) && !defined(QT_NO_IMAGEIO) +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPixmap & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPixmap & ); +#endif + +/***************************************************************************** + TQPixmap (and TQImage) helper functions + *****************************************************************************/ + +#ifndef QT_NO_PIXMAP_TRANSFORMATION +# define QT_XFORM_TYPE_MSBFIRST 0 +# define QT_XFORM_TYPE_LSBFIRST 1 +# if defined(Q_WS_WIN) +# define QT_XFORM_TYPE_WINDOWSPIXMAP 2 +# endif +bool qt_xForm_helper( const TQWMatrix&, int, int, int, uchar*, int, int, int, uchar*, int, int, int ); +#endif + +Q_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, + const TQPixmap *src, int sx = 0, int sy = 0, + int sw = -1, int sh = -1 ); + +#endif // TQPIXMAP_H diff --git a/src/kernel/ntqpixmapcache.h b/src/kernel/ntqpixmapcache.h new file mode 100644 index 000000000..29bcb82e0 --- /dev/null +++ b/src/kernel/ntqpixmapcache.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Definition of TQPixmapCache class +** +** Created : 950501 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPIXMAPCACHE_H +#define TQPIXMAPCACHE_H + +#ifndef QT_H +#include "ntqpixmap.h" +#endif // QT_H + + +class Q_EXPORT TQPixmapCache // global pixmap cache +{ +public: + static int cacheLimit(); + static void setCacheLimit( int ); + static TQPixmap *find( const TQString &key ); + static bool find( const TQString &key, TQPixmap& ); + static bool insert( const TQString &key, TQPixmap * ); + static bool insert( const TQString &key, const TQPixmap& ); + static void remove( const TQString &key ); + static void clear(); +}; + + +#endif // TQPIXMAPCACHE_H diff --git a/src/kernel/ntqpngio.h b/src/kernel/ntqpngio.h new file mode 100644 index 000000000..ce41e7d55 --- /dev/null +++ b/src/kernel/ntqpngio.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Definition of PNG TQImage IOHandler +** +** Created : 970521 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPNGIO_H +#define TQPNGIO_H + +#ifndef QT_H +#include "ntqimage.h" +#endif // QT_H + +#ifndef QT_NO_IMAGEIO_PNG + +void qInitPngIO(); + +class TQIODevice; + +#ifndef Q_PNGEXPORT +#if !defined(QT_PLUGIN) +#define Q_PNGEXPORT Q_EXPORT +#else +#define Q_PNGEXPORT +#endif +#endif + +class Q_PNGEXPORT TQPNGImageWriter { +public: + TQPNGImageWriter(TQIODevice*); + ~TQPNGImageWriter(); + + enum DisposalMethod { Unspecified, NoDisposal, RestoreBackground, RestoreImage }; + void setDisposalMethod(DisposalMethod); + void setLooping(int loops=0); // 0 == infinity + void setFrameDelay(int msecs); + void setGamma(float); + + bool writeImage(const TQImage& img, int x, int y); + bool writeImage(const TQImage& img, int quality, int x, int y); + bool writeImage(const TQImage& img) + { return writeImage(img, 0, 0); } + bool writeImage(const TQImage& img, int quality) + { return writeImage(img, quality, 0, 0); } + + TQIODevice* device() { return dev; } + +private: + TQIODevice* dev; + int frames_written; + DisposalMethod disposal; + int looping; + int ms_delay; + float gamma; +}; + +class Q_PNGEXPORT TQPNGImagePacker : public TQPNGImageWriter { +public: + TQPNGImagePacker(TQIODevice*, int depth, int convflags); + + void setPixelAlignment(int x); + bool packImage(const TQImage& img); + +private: + TQImage previous; + int depth; + int convflags; + int alignx; +}; + +#endif // QT_NO_IMAGEIO_PNG + +#endif // TQPNGIO_H diff --git a/src/kernel/ntqpoint.h b/src/kernel/ntqpoint.h new file mode 100644 index 000000000..731683a4c --- /dev/null +++ b/src/kernel/ntqpoint.h @@ -0,0 +1,219 @@ +/**************************************************************************** +** +** Definition of TQPoint class +** +** Created : 931028 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPOINT_H +#define TQPOINT_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#endif // QT_H + + +class Q_EXPORT TQPoint +{ +public: + TQPoint(); + TQPoint( int xpos, int ypos ); + + bool isNull() const; + + int x() const; + int y() const; + void setX( int x ); + void setY( int y ); + + int manhattanLength() const; + + TQCOORD &rx(); + TQCOORD &ry(); + + TQPoint &operator+=( const TQPoint &p ); + TQPoint &operator-=( const TQPoint &p ); + TQPoint &operator*=( int c ); + TQPoint &operator*=( double c ); + TQPoint &operator/=( int c ); + TQPoint &operator/=( double c ); + + friend inline bool operator==( const TQPoint &, const TQPoint & ); + friend inline bool operator!=( const TQPoint &, const TQPoint & ); + friend inline const TQPoint operator+( const TQPoint &, const TQPoint & ); + friend inline const TQPoint operator-( const TQPoint &, const TQPoint & ); + friend inline const TQPoint operator*( const TQPoint &, int ); + friend inline const TQPoint operator*( int, const TQPoint & ); + friend inline const TQPoint operator*( const TQPoint &, double ); + friend inline const TQPoint operator*( double, const TQPoint & ); + friend inline const TQPoint operator-( const TQPoint & ); + friend inline const TQPoint operator/( const TQPoint &, int ); + friend inline const TQPoint operator/( const TQPoint &, double ); + +private: + static void warningDivByZero(); + +#if defined(Q_OS_MAC) + TQCOORD yp; + TQCOORD xp; +#else + TQCOORD xp; + TQCOORD yp; +#endif +}; + + +/***************************************************************************** + TQPoint stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPoint & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPoint & ); +#endif + +/***************************************************************************** + TQPoint inline functions + *****************************************************************************/ + +inline TQPoint::TQPoint() +{ xp=0; yp=0; } + +inline TQPoint::TQPoint( int xpos, int ypos ) +{ xp=(TQCOORD)xpos; yp=(TQCOORD)ypos; } + +inline bool TQPoint::isNull() const +{ return xp == 0 && yp == 0; } + +inline int TQPoint::x() const +{ return xp; } + +inline int TQPoint::y() const +{ return yp; } + +inline void TQPoint::setX( int x ) +{ xp = (TQCOORD)x; } + +inline void TQPoint::setY( int y ) +{ yp = (TQCOORD)y; } + +inline TQCOORD &TQPoint::rx() +{ return xp; } + +inline TQCOORD &TQPoint::ry() +{ return yp; } + +inline TQPoint &TQPoint::operator+=( const TQPoint &p ) +{ xp+=p.xp; yp+=p.yp; return *this; } + +inline TQPoint &TQPoint::operator-=( const TQPoint &p ) +{ xp-=p.xp; yp-=p.yp; return *this; } + +inline TQPoint &TQPoint::operator*=( int c ) +{ xp*=(TQCOORD)c; yp*=(TQCOORD)c; return *this; } + +inline TQPoint &TQPoint::operator*=( double c ) +{ xp=(TQCOORD)(xp*c); yp=(TQCOORD)(yp*c); return *this; } + +inline bool operator==( const TQPoint &p1, const TQPoint &p2 ) +{ return p1.xp == p2.xp && p1.yp == p2.yp; } + +inline bool operator!=( const TQPoint &p1, const TQPoint &p2 ) +{ return p1.xp != p2.xp || p1.yp != p2.yp; } + +inline const TQPoint operator+( const TQPoint &p1, const TQPoint &p2 ) +{ return TQPoint(p1.xp+p2.xp, p1.yp+p2.yp); } + +inline const TQPoint operator-( const TQPoint &p1, const TQPoint &p2 ) +{ return TQPoint(p1.xp-p2.xp, p1.yp-p2.yp); } + +inline const TQPoint operator*( const TQPoint &p, int c ) +{ return TQPoint(p.xp*c, p.yp*c); } + +inline const TQPoint operator*( int c, const TQPoint &p ) +{ return TQPoint(p.xp*c, p.yp*c); } + +inline const TQPoint operator*( const TQPoint &p, double c ) +{ return TQPoint((TQCOORD)(p.xp*c), (TQCOORD)(p.yp*c)); } + +inline const TQPoint operator*( double c, const TQPoint &p ) +{ return TQPoint((TQCOORD)(p.xp*c), (TQCOORD)(p.yp*c)); } + +inline const TQPoint operator-( const TQPoint &p ) +{ return TQPoint(-p.xp, -p.yp); } + +inline TQPoint &TQPoint::operator/=( int c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0 ) + warningDivByZero(); +#endif + xp/=(TQCOORD)c; + yp/=(TQCOORD)c; + return *this; +} + +inline TQPoint &TQPoint::operator/=( double c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0.0 ) + warningDivByZero(); +#endif + xp=(TQCOORD)(xp/c); + yp=(TQCOORD)(yp/c); + return *this; +} + +inline const TQPoint operator/( const TQPoint &p, int c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0 ) + TQPoint::warningDivByZero(); +#endif + return TQPoint(p.xp/c, p.yp/c); +} + +inline const TQPoint operator/( const TQPoint &p, double c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0.0 ) + TQPoint::warningDivByZero(); +#endif + return TQPoint((TQCOORD)(p.xp/c), (TQCOORD)(p.yp/c)); +} + +#define Q_DEFINED_QPOINT +#include "ntqwinexport.h" +#endif // TQPOINT_H diff --git a/src/kernel/ntqpointarray.h b/src/kernel/ntqpointarray.h new file mode 100644 index 000000000..a0aa8ea74 --- /dev/null +++ b/src/kernel/ntqpointarray.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Definition of TQPointArray class +** +** Created : 940213 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPOINTARRAY_H +#define TQPOINTARRAY_H + +#ifndef QT_H +#include "ntqmemarray.h" +#include "ntqpoint.h" +#endif // QT_H + + +#if defined(Q_TEMPLATEDLL) +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; +#endif + +class Q_EXPORT TQPointArray : public TQMemArray +{ +public: + TQPointArray() {} + ~TQPointArray() {} + TQPointArray( int size ) : TQMemArray( size ) {} + TQPointArray( const TQPointArray &a ) : TQMemArray( a ) {} + TQPointArray( const TQRect &r, bool closed=FALSE ); + TQPointArray( int nPoints, const TQCOORD *points ); + + TQPointArray &operator=( const TQPointArray &a ) + { return (TQPointArray&)assign( a ); } + + TQPointArray copy() const + { TQPointArray tmp; return *((TQPointArray*)&tmp.duplicate(*this)); } + + void translate( int dx, int dy ); + TQRect boundingRect() const; + + void point( uint i, int *x, int *y ) const; + TQPoint point( uint i ) const; + void setPoint( uint i, int x, int y ); + void setPoint( uint i, const TQPoint &p ); + bool setPoints( int nPoints, const TQCOORD *points ); + bool setPoints( int nPoints, int firstx, int firsty, ... ); + bool putPoints( int index, int nPoints, const TQCOORD *points ); + bool putPoints( int index, int nPoints, int firstx, int firsty, ... ); + bool putPoints( int index, int nPoints, + const TQPointArray & from, int fromIndex=0 ); + + void makeArc( int x, int y, int w, int h, int a1, int a2 ); + void makeEllipse( int x, int y, int w, int h ); + void makeArc( int x, int y, int w, int h, int a1, int a2, + const TQWMatrix& ); +#ifndef QT_NO_BEZIER + TQPointArray cubicBezier() const; +#endif + void* shortPoints( int index = 0, int nPoints = -1 ) const; + static void cleanBuffers(); + +protected: + static uint splen; + static void* sp; +}; + + +/***************************************************************************** + TQPointArray stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPointArray & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPointArray & ); +#endif + +/***************************************************************************** + Misc. TQPointArray functions + *****************************************************************************/ + +inline void TQPointArray::setPoint( uint i, const TQPoint &p ) +{ + setPoint( i, p.x(), p.y() ); +} + + +#endif // TQPOINTARRAY_H diff --git a/src/kernel/ntqpolygonscanner.h b/src/kernel/ntqpolygonscanner.h new file mode 100644 index 000000000..276f9afcb --- /dev/null +++ b/src/kernel/ntqpolygonscanner.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Definition of TQPolygonScanner class +** +** Created : 000120 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPOLYGONSCANNER_H +#define TQPOLYGONSCANNER_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +class TQPointArray; +class TQPoint; + +class Q_EXPORT TQPolygonScanner { +public: + // BIC: fix for 3.0 + void scan( const TQPointArray& pa, bool winding, int index=0, int npoints=-1 ); + void scan( const TQPointArray& pa, bool winding, int index, int npoints, bool stitchable ); + enum Edge { Left=1, Right=2, Top=4, Bottom=8 }; + void scan( const TQPointArray& pa, bool winding, int index, int npoints, Edge edges ); + virtual void processSpans( int n, TQPoint* point, int* width )=0; +}; + +#endif // TQPOLYGONSCANNER_H diff --git a/src/kernel/ntqprinter.h b/src/kernel/ntqprinter.h new file mode 100644 index 000000000..fa7b9caa8 --- /dev/null +++ b/src/kernel/ntqprinter.h @@ -0,0 +1,284 @@ +/********************************************************************** +** +** Definition of TQPrinter class +** +** Created : 940927 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPRINTER_H +#define TQPRINTER_H + +#ifndef QT_H +#include "ntqpaintdevice.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_PRINTER + +#if defined(B0) +#undef B0 // Terminal hang-up. We assume that you do not want that. +#endif + +class TQPrinterPrivate; + +class Q_EXPORT TQPrinter : public TQPaintDevice +{ +public: + enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution, Compatible }; + + TQPrinter( PrinterMode mode = ScreenResolution ); + ~TQPrinter(); + + 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 = Custom }; + + 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 ); +#ifdef Q_WS_WIN + void setWinPageSize( short winPageSize ); + short winPageSize() const; +#endif +#ifdef Q_WS_MAC + bool printSetup(); + bool pageSetup(); +#endif + 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 top, uint left, uint bottom, uint right ); + void margins( uint *top, uint *left, uint *bottom, uint *right ) const; + + int fromPage() const; + int toPage() const; + virtual void setFromTo( int fromPage, int toPage ); + int minPage() const; + int maxPage() const; + virtual void setMinMax( int minPage, int maxPage ); + 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 range ); + + bool newPage(); + bool abort(); + bool aborted() const; + + bool setup( TQWidget *parent = 0 ); + + PaperSource paperSource() const; + virtual void setPaperSource( PaperSource ); + + void setOptionEnabled( PrinterOption, bool enable ); + bool isOptionEnabled( PrinterOption ); + +protected: + bool cmd( int, TQPainter *, TQPDevCmdParam * ); + int metric( int ) const; + +#if defined(Q_WS_WIN) + virtual void setActive(); + virtual void setIdle(); +#endif + +private: +#if defined(Q_WS_X11) || defined(Q_WS_QWS) + TQPaintDevice *pdrv; + int pid; +#endif +#if defined(Q_WS_MAC) + friend class TQPrinterPrivate; + PMPageFormat pformat; + PMPrintSettings psettings; + PMPrintSession psession; + bool prepare(PMPrintSettings *); + bool prepare(PMPageFormat *); + void interpret(PMPrintSettings *); + void interpret(PMPageFormat *); +#endif +#if defined(Q_WS_WIN) + void readPdlg( void* ); + void readPdlgA( void* ); + void writeDevmode( TQt::HANDLE ); + void writeDevmodeA( TQt::HANDLE ); + void reinit(); + + bool viewOffsetDone; + TQPainter* painter; + TQt::HANDLE hdevmode; + TQt::HANDLE hdevnames; +#endif + + int state; + TQString printer_name; + TQString option_string; + TQString output_filename; + bool output_file; + TQString print_prog; + TQString doc_name; + TQString creator_name; + + PageSize page_size; + PaperSource paper_source; + PageOrder page_order; + ColorMode color_mode; + Orientation orient; + uint to_edge : 1; + uint appcolcopies : 1; + uint usercolcopies : 1; + uint res_set : 1; + short from_pg, to_pg; + short min_pg, max_pg; + short ncopies; + int res; + TQPrinterPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPrinter( const TQPrinter & ); + TQPrinter &operator=( const TQPrinter & ); +#endif +}; + + +inline TQString TQPrinter::printerName() const +{ return printer_name; } + +inline bool TQPrinter::outputToFile() const +{ return output_file; } + +inline TQString TQPrinter::outputFileName() const +{ return output_filename; } + +inline TQString TQPrinter::printProgram() const +{ return print_prog; } + +inline TQString TQPrinter::docName() const +{ return doc_name; } + +inline TQString TQPrinter::creator() const +{ return creator_name; } + +inline TQPrinter::PageSize TQPrinter::pageSize() const +{ return page_size; } + +inline TQPrinter::Orientation TQPrinter::orientation() const +{ return orient; } + +inline int TQPrinter::fromPage() const +{ return from_pg; } + +inline int TQPrinter::toPage() const +{ return to_pg; } + +inline int TQPrinter::minPage() const +{ return min_pg; } + +inline int TQPrinter::maxPage() const +{ return max_pg; } + +inline int TQPrinter::numCopies() const +{ return ncopies; } + +inline bool TQPrinter::collateCopiesEnabled() const +{ return appcolcopies; } + +inline void TQPrinter::setCollateCopiesEnabled(bool v) +{ appcolcopies = v; } + +inline bool TQPrinter::collateCopies() const +{ return usercolcopies; } + + +#endif // QT_NO_PRINTER + +#endif // TQPRINTER_H diff --git a/src/kernel/ntqprocess.h b/src/kernel/ntqprocess.h new file mode 100644 index 000000000..e9a77e3ed --- /dev/null +++ b/src/kernel/ntqprocess.h @@ -0,0 +1,178 @@ +/**************************************************************************** +** +** Implementation of TQProcess class +** +** Created : 20000905 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPROCESS_H +#define TQPROCESS_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqstringlist.h" +#include "ntqdir.h" +#endif // QT_H + +#ifndef QT_NO_PROCESS + +class TQProcessPrivate; +class TQMembuf; + + +class Q_EXPORT TQProcess : public TQObject +{ + Q_OBJECT +public: + TQProcess( TQObject *parent=0, const char *name=0 ); + TQProcess( const TQString& arg0, TQObject *parent=0, const char *name=0 ); + TQProcess( const TQStringList& args, TQObject *parent=0, const char *name=0 ); + ~TQProcess(); + + // set and get the arguments and working directory + TQStringList arguments() const; + void clearArguments(); + virtual void setArguments( const TQStringList& args ); + virtual void addArgument( const TQString& arg ); +#ifndef QT_NO_DIR + TQDir workingDirectory() const; + virtual void setWorkingDirectory( const TQDir& dir ); +#endif + + // set and get the comms wanted + enum Communication { Stdin=0x01, Stdout=0x02, Stderr=0x04, DupStderr=0x08 }; + void setCommunication( int c ); + int communication() const; + + // start the execution + virtual bool start( TQStringList *env=0 ); + virtual bool launch( const TQString& buf, TQStringList *env=0 ); + virtual bool launch( const TQByteArray& buf, TQStringList *env=0 ); + + // intquire the status + bool isRunning() const; + bool normalExit() const; + int exitStatus() const; + + // reading + virtual TQByteArray readStdout(); + virtual TQByteArray readStderr(); + bool canReadLineStdout() const; + bool canReadLineStderr() const; + virtual TQString readLineStdout(); + virtual TQString readLineStderr(); + + // get platform dependent process information +#if defined(Q_OS_WIN32) + typedef void* PID; +#else + typedef Q_LONG PID; +#endif + PID processIdentifier(); + + void flushStdin(); + +signals: + void readyReadStdout(); + void readyReadStderr(); + void processExited(); + void wroteToStdin(); + void launchFinished(); + +public slots: + // end the execution + void tryTerminate() const; + void kill() const; + + // input + virtual void writeToStdin( const TQByteArray& buf ); + virtual void writeToStdin( const TQString& buf ); + virtual void closeStdin(); + +protected: // ### or private? + void connectNotify( const char * signal ); + void disconnectNotify( const char * signal ); +private: + void setIoRedirection( bool value ); + void setNotifyOnExit( bool value ); + void setWroteStdinConnected( bool value ); + + void init(); + void reset(); +#if defined(Q_OS_WIN32) + uint readStddev( HANDLE dev, char *buf, uint bytes ); +#endif + TQMembuf* membufStdout(); + TQMembuf* membufStderr(); + +private slots: + void socketRead( int fd ); + void socketWrite( int fd ); + void timeout(); + void closeStdinLaunch(); + +private: + TQProcessPrivate *d; +#ifndef QT_NO_DIR + TQDir workingDir; +#endif + TQStringList _arguments; + + int exitStat; // exit status + bool exitNormal; // normal exit? + bool ioRedirection; // automatically set be (dis)connectNotify + bool notifyOnExit; // automatically set be (dis)connectNotify + bool wroteToStdinConnected; // automatically set be (dis)connectNotify + + bool readStdoutCalled; + bool readStderrCalled; + int comms; + + friend class TQProcessPrivate; +#if defined(Q_OS_UNIX) + friend class TQProcessManager; + friend class TQProc; +#endif + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQProcess( const TQProcess & ); + TQProcess &operator=( const TQProcess & ); +#endif +}; + +#endif // QT_NO_PROCESS + +#endif // TQPROCESS_H diff --git a/src/kernel/ntqrect.h b/src/kernel/ntqrect.h new file mode 100644 index 000000000..426c17560 --- /dev/null +++ b/src/kernel/ntqrect.h @@ -0,0 +1,276 @@ +/**************************************************************************** +** +** Definition of TQRect class +** +** Created : 931028 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQRECT_H +#define TQRECT_H + +#ifndef QT_H +#include "ntqsize.h" +#endif // QT_H + +#if defined(topLeft) +#error "Macro definition of topLeft conflicts with TQRect" +// don't just silently undo people's defines: #undef topLeft +#endif + +class Q_EXPORT TQRect // rectangle class +{ +public: + TQRect() { x1 = y1 = 0; x2 = y2 = -1; } + TQRect( const TQPoint &topleft, const TQPoint &bottomright ); + TQRect( const TQPoint &topleft, const TQSize &size ); + TQRect( int left, int top, int width, int height ); + + 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 pos ); + void setTop( int pos ); + void setRight( int pos ); + void setBottom( int pos ); + void setX( int x ); + void setY( int y ); + + void setTopLeft( const TQPoint &p ); + void setBottomRight( const TQPoint &p ); + void setTopRight( const TQPoint &p ); + void setBottomLeft( const TQPoint &p ); + + TQPoint topLeft() const; + TQPoint bottomRight() const; + TQPoint topRight() const; + TQPoint bottomLeft() const; + TQPoint center() const; + + void rect( int *x, int *y, int *w, int *h ) const; + void coords( int *x1, int *y1, int *x2, int *y2 ) const; + + void moveLeft( int pos ); + void moveTop( int pos ); + void moveRight( int pos ); + void moveBottom( int pos ); + void moveTopLeft( const TQPoint &p ); + void moveBottomRight( const TQPoint &p ); + void moveTopRight( const TQPoint &p ); + void moveBottomLeft( const TQPoint &p ); + void moveCenter( const TQPoint &p ); + void moveBy( int dx, int dy ); + + void setRect( int x, int y, int w, int h ); + void setCoords( int x1, int y1, int x2, int y2 ); + void addCoords( int x1, int y1, int x2, int y2 ); + + TQSize size() const; + int width() const; + int height() const; + void setWidth( int w ); + void setHeight( int h ); + void setSize( const TQSize &s ); + + TQRect operator|(const TQRect &r) const; + TQRect operator&(const TQRect &r) const; + TQRect& operator|=(const TQRect &r); + TQRect& operator&=(const TQRect &r); + + bool contains( const TQPoint &p, bool proper=FALSE ) const; + bool contains( int x, int y ) const; // inline methods, _don't_ merge these + bool contains( int x, int y, bool proper ) const; + bool contains( const TQRect &r, bool proper=FALSE ) const; + TQRect unite( const TQRect &r ) const; + TQRect intersect( const TQRect &r ) const; + bool intersects( const TQRect &r ) const; + + friend Q_EXPORT bool operator==( const TQRect &, const TQRect & ); + friend Q_EXPORT bool operator!=( const TQRect &, const TQRect & ); + +private: +#if defined(Q_WS_X11) || defined(Q_OS_TEMP) + friend void qt_setCoords( TQRect *r, int xp1, int yp1, int xp2, int yp2 ); +#endif +#if defined(Q_OS_MAC) + TQCOORD y1; + TQCOORD x1; + TQCOORD y2; + TQCOORD x2; +#else + TQCOORD x1; + TQCOORD y1; + TQCOORD x2; + TQCOORD y2; +#endif +}; + +Q_EXPORT bool operator==( const TQRect &, const TQRect & ); +Q_EXPORT bool operator!=( const TQRect &, const TQRect & ); + + +/***************************************************************************** + TQRect stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQRect & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQRect & ); +#endif + +/***************************************************************************** + TQRect inline member functions + *****************************************************************************/ + +inline TQRect::TQRect( int left, int top, int width, int height ) +{ + x1 = (TQCOORD)left; + y1 = (TQCOORD)top; + x2 = (TQCOORD)(left+width-1); + y2 = (TQCOORD)(top+height-1); +} + +inline bool TQRect::isNull() const +{ return x2 == x1-1 && y2 == y1-1; } + +inline bool TQRect::isEmpty() const +{ return x1 > x2 || y1 > y2; } + +inline bool TQRect::isValid() const +{ return x1 <= x2 && y1 <= y2; } + +inline int TQRect::left() const +{ return x1; } + +inline int TQRect::top() const +{ return y1; } + +inline int TQRect::right() const +{ return x2; } + +inline int TQRect::bottom() const +{ return y2; } + +inline TQCOORD &TQRect::rLeft() +{ return x1; } + +inline TQCOORD & TQRect::rTop() +{ return y1; } + +inline TQCOORD & TQRect::rRight() +{ return x2; } + +inline TQCOORD & TQRect::rBottom() +{ return y2; } + +inline int TQRect::x() const +{ return x1; } + +inline int TQRect::y() const +{ return y1; } + +inline void TQRect::setLeft( int pos ) +{ x1 = (TQCOORD)pos; } + +inline void TQRect::setTop( int pos ) +{ y1 = (TQCOORD)pos; } + +inline void TQRect::setRight( int pos ) +{ x2 = (TQCOORD)pos; } + +inline void TQRect::setBottom( int pos ) +{ y2 = (TQCOORD)pos; } + +inline void TQRect::setX( int x ) +{ x1 = (TQCOORD)x; } + +inline void TQRect::setY( int y ) +{ y1 = (TQCOORD)y; } + +inline TQPoint TQRect::topLeft() const +{ return TQPoint(x1, y1); } + +inline TQPoint TQRect::bottomRight() const +{ return TQPoint(x2, y2); } + +inline TQPoint TQRect::topRight() const +{ return TQPoint(x2, y1); } + +inline TQPoint TQRect::bottomLeft() const +{ return TQPoint(x1, y2); } + +inline TQPoint TQRect::center() const +{ return TQPoint((x1+x2)/2, (y1+y2)/2); } + +inline int TQRect::width() const +{ return x2 - x1 + 1; } + +inline int TQRect::height() const +{ return y2 - y1 + 1; } + +inline TQSize TQRect::size() const +{ return TQSize(x2-x1+1, y2-y1+1); } + +inline bool TQRect::contains( int x, int y, bool proper ) const +{ + if ( proper ) + return x > x1 && x < x2 && + y > y1 && y < y2; + else + return x >= x1 && x <= x2 && + y >= y1 && y <= y2; +} + +inline bool TQRect::contains( int x, int y ) const +{ + return x >= x1 && x <= x2 && + y >= y1 && y <= y2; +} +#define Q_DEFINED_QRECT +#include "ntqwinexport.h" +#endif // TQRECT_H diff --git a/src/kernel/ntqregion.h b/src/kernel/ntqregion.h new file mode 100644 index 000000000..798b33cde --- /dev/null +++ b/src/kernel/ntqregion.h @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Definition of TQRegion class +** +** Created : 940514 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQREGION_H +#define TQREGION_H + +#ifndef QT_H +#include "ntqshared.h" +#include "ntqrect.h" +#endif // QT_H + +#ifdef Q_WS_X11 +struct TQRegionPrivate; +#endif + +class Q_EXPORT TQRegion +{ +public: + enum RegionType { Rectangle, Ellipse }; + + TQRegion(); + TQRegion( int x, int y, int w, int h, RegionType = Rectangle ); + TQRegion( const TQRect &, RegionType = Rectangle ); + TQRegion( const TQPointArray &, bool winding=FALSE ); + TQRegion( const TQRegion & ); + TQRegion( const TQBitmap & ); + ~TQRegion(); + TQRegion &operator=( const TQRegion & ); + + bool isNull() const; + bool isEmpty() const; + + bool contains( const TQPoint &p ) const; + bool contains( const TQRect &r ) const; + + void translate( int dx, int dy ); + + 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 & ); + + bool operator==( const TQRegion & ) const; + bool operator!=( const TQRegion &r ) const + { return !(operator==(r)); } + +#if defined(Q_WS_WIN) + HRGN handle() const { return data->rgn; } +#elif defined(Q_WS_X11) + Region handle() const { if(!data->rgn) updateX11Region(); return data->rgn; } +#elif defined(Q_WS_MAC) + RgnHandle handle(bool require_rgn=FALSE) const; +#elif defined(Q_WS_QWS) + // TQGfx_QWS needs this for region drawing + void * handle() const { return data->rgn; } +#endif + +#ifndef QT_NO_DATASTREAM + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQRegion & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQRegion & ); +#endif +private: + TQRegion( bool ); + TQRegion copy() const; + void detach(); +#if defined(Q_WS_WIN) + TQRegion winCombine( const TQRegion &, int ) const; +#endif +#if defined(Q_WS_X11) + void updateX11Region() const; + void *clipRectangles( int &num ) const; + friend void *qt_getClipRects( const TQRegion &, int & ); +#endif + void exec( const TQByteArray &, int ver = 0 ); + struct TQRegionData : public TQShared { +#if defined(Q_WS_WIN) + HRGN rgn; +#elif defined(Q_WS_X11) + Region rgn; + void *xrectangles; + TQRegionPrivate *region; +#elif defined(Q_WS_MAC) + uint is_rect:1; + TQRect rect; + RgnHandle rgn; +#elif defined(Q_WS_QWS) + void * rgn; +#endif + bool is_null; + } *data; +#if defined(Q_WS_MAC) + friend struct qt_mac_rgn_data_cache; + friend TQRegionData *qt_mac_get_rgn_data(); + friend void qt_mac_free_rgn_data(TQRegionData *); + void rectifyRegion(); +#elif defined(Q_WS_WIN) + friend class TQETWidget; +#endif + +}; + + +#define TQRGN_SETRECT 1 // region stream commands +#define TQRGN_SETELLIPSE 2 // (these are internal) +#define TQRGN_SETPTARRAY_ALT 3 +#define TQRGN_SETPTARRAY_WIND 4 +#define TQRGN_TRANSLATE 5 +#define TQRGN_OR 6 +#define TQRGN_AND 7 +#define TQRGN_SUB 8 +#define TQRGN_XOR 9 +#define TQRGN_RECTS 10 + + +/***************************************************************************** + TQRegion stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQRegion & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQRegion & ); +#endif + + +#endif // TQREGION_H diff --git a/src/kernel/ntqsession.h b/src/kernel/ntqsession.h new file mode 100644 index 000000000..36fd657b8 --- /dev/null +++ b/src/kernel/ntqsession.h @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Definition of TQSession class +** +** Created : 990510 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSESSION_H +#define TQSESSION_H + +#ifndef QT_H +#endif // QT_H + +#endif diff --git a/src/kernel/ntqsessionmanager.h b/src/kernel/ntqsessionmanager.h new file mode 100644 index 000000000..6a435c3a1 --- /dev/null +++ b/src/kernel/ntqsessionmanager.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Definition of TQSessionManager class +** +** Created : 990510 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSESSIONMANAGER_H +#define TQSESSIONMANAGER_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqwindowdefs.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#endif // QT_H +#ifndef QT_NO_SESSIONMANAGER + +class TQSessionManagerData; + +class Q_EXPORT TQSessionManager : public TQObject +{ + Q_OBJECT + TQSessionManager( TQApplication *app, TQString &id, TQString &key ); + ~TQSessionManager(); +public: + TQString sessionId() const; + TQString sessionKey() const; +#if defined(Q_WS_X11) || defined(Q_WS_MAC) + void* handle() const; +#endif + + 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& name, const TQString& value ); + void setManagerProperty( const TQString& name, const TQStringList& value ); + + bool isPhase2() const; + void requestPhase2(); + +private: + friend class TQApplication; + friend class TQBaseApplication; + TQSessionManagerData* d; +}; + +#endif // QT_NO_SESSIONMANAGER +#endif // TQSESSIONMANAGER_H diff --git a/src/kernel/ntqsignal.h b/src/kernel/ntqsignal.h new file mode 100644 index 000000000..0664fe5d2 --- /dev/null +++ b/src/kernel/ntqsignal.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Definition of TQSignal class +** +** Created : 941201 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIGNAL_H +#define TQSIGNAL_H + +#ifndef QT_H +#include "ntqvariant.h" +#include "ntqobject.h" +#endif // QT_H + + +class Q_EXPORT TQSignal : public TQObject +{ + Q_OBJECT + +public: + TQSignal( TQObject *parent=0, const char *name=0 ); + ~TQSignal(); + + bool connect( const TQObject *receiver, const char *member ); + bool disconnect( const TQObject *receiver, const char *member=0 ); + + void activate(); + +#ifndef QT_NO_COMPAT + bool isBlocked() const { return TQObject::signalsBlocked(); } + void block( bool b ) { TQObject::blockSignals( b ); } +#ifndef QT_NO_VARIANT + void setParameter( int value ); + int parameter() const; +#endif +#endif + +#ifndef QT_NO_VARIANT + void setValue( const TQVariant &value ); + TQVariant value() const; +#endif +signals: +#ifndef QT_NO_VARIANT + void signal( const TQVariant& ); +#endif + void intSignal( int ); + +private: +#ifndef QT_NO_VARIANT + TQVariant val; +#endif +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSignal( const TQSignal & ); + TQSignal &operator=( const TQSignal & ); +#endif +}; + + +#endif // TQSIGNAL_H diff --git a/src/kernel/ntqsignalmapper.h b/src/kernel/ntqsignalmapper.h new file mode 100644 index 000000000..2b560a7cd --- /dev/null +++ b/src/kernel/ntqsignalmapper.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Definition of TQSignalMapper class +** +** Created : 980503 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIGNALMAPPER_H +#define TQSIGNALMAPPER_H + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H +#ifndef QT_NO_SIGNALMAPPER +class TQSignalMapperData; +struct TQSignalMapperRec; + + +class Q_EXPORT TQSignalMapper : public TQObject { + Q_OBJECT +public: + TQSignalMapper( TQObject* parent, const char* name=0 ); + ~TQSignalMapper(); + + virtual void setMapping( const TQObject* sender, int identifier ); + virtual void setMapping( const TQObject* sender, const TQString &identifier ); + void removeMappings( const TQObject* sender ); + +signals: + void mapped(int); + void mapped(const TQString &); + +public slots: + void map(); + +private: + TQSignalMapperData* d; + TQSignalMapperRec* getRec( const TQObject* ); + +private slots: + void removeMapping(); +}; + +#endif // QT_NO_SIGNALMAPPER +#endif // TQSIGNALMAPPER_H diff --git a/src/kernel/ntqsignalslotimp.h b/src/kernel/ntqsignalslotimp.h new file mode 100644 index 000000000..e1c3bf0f5 --- /dev/null +++ b/src/kernel/ntqsignalslotimp.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Definition of signal/slot collections etc. +** +** Created : 980821 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIGNALSLOTIMP_H +#define TQSIGNALSLOTIMP_H + +#ifndef QT_H +#include "ntqconnection.h" +#include "ntqptrlist.h" +#include "ntqptrvector.h" +#endif // QT_H + +class Q_EXPORT TQConnectionList : public TQPtrList +{ +public: + TQConnectionList() : TQPtrList() {} + TQConnectionList( const TQConnectionList &list ) : TQPtrList(list) {} + ~TQConnectionList() { clear(); } + TQConnectionList &operator=(const TQConnectionList &list) + { return (TQConnectionList&)TQPtrList::operator=(list); } +}; + +class Q_EXPORT TQConnectionListIt : public TQPtrListIterator +{ +public: + TQConnectionListIt( const TQConnectionList &l ) : TQPtrListIterator(l) {} + TQConnectionListIt &operator=(const TQConnectionListIt &i) + { return (TQConnectionListIt&)TQPtrListIterator::operator=(i); } +}; + +#if defined(Q_TEMPLATEDLL) && defined(Q_CC_INTEL) +// MOC_SKIP_BEGIN +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +#define Q_EXPORTED_QPTRVECTORCONNECTTIONLIST_TEMPLATES +// MOC_SKIP_END +#endif + +class Q_EXPORT TQSignalVec : public TQPtrVector +{ +public: + TQSignalVec(int size=17 ) + : TQPtrVector(size) {} + TQSignalVec( const TQSignalVec &dict ) + : TQPtrVector(dict) {} + ~TQSignalVec() { clear(); } + TQSignalVec &operator=(const TQSignalVec &dict) + { return (TQSignalVec&)TQPtrVector::operator=(dict); } + TQConnectionList* at( uint index ) const { + return index >= size()? 0 : TQPtrVector::at(index); + } + bool insert( uint index, const TQConnectionList* d ) { + if (index >= size() ) + resize( 2*index + 1); + return TQPtrVector::insert(index, d); + } +}; + +#define Q_DEFINED_QCONNECTION_LIST +#include "ntqwinexport.h" +#endif // TQSIGNALSLOTIMP_H diff --git a/src/kernel/ntqsimplerichtext.h b/src/kernel/ntqsimplerichtext.h new file mode 100644 index 000000000..e8b479a8d --- /dev/null +++ b/src/kernel/ntqsimplerichtext.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Definition of the TQSimpleRichText class +** +** Created : 990101 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIMPLERICHTEXT_H +#define TQSIMPLERICHTEXT_H + +#ifndef QT_H +#include "ntqnamespace.h" +#include "ntqstring.h" +#include "ntqregion.h" +#endif // QT_H + +#ifndef QT_NO_RICHTEXT + +class TQPainter; +class TQWidget; +class TQStyleSheet; +class TQBrush; +class TQMimeSourceFactory; +class TQSimpleRichTextData; + +class Q_EXPORT TQSimpleRichText +{ +public: + TQSimpleRichText( const TQString& text, const TQFont& fnt, + const TQString& context = TQString::null, const TQStyleSheet* sheet = 0); + TQSimpleRichText( const TQString& text, const TQFont& fnt, + const TQString& context, const TQStyleSheet* sheet, + const TQMimeSourceFactory* factory, int pageBreak = -1, + const TQColor& linkColor = TQt::blue, bool linkUnderline = TRUE ); + ~TQSimpleRichText(); + + void setWidth( int ); + void setWidth( TQPainter*, int ); + void setDefaultFont( const TQFont &f ); + int width() const; + int widthUsed() const; + int height() const; + void adjustSize(); + + void draw( TQPainter* p, int x, int y, const TQRect& clipRect, + const TQColorGroup& cg, const TQBrush* paper = 0) const; + + // obsolete + void draw( TQPainter* p, int x, int y, const TQRegion& clipRegion, + const TQColorGroup& cg, const TQBrush* paper = 0) const { + draw( p, x, y, clipRegion.boundingRect(), cg, paper ); + } + + TQString context() const; + TQString anchorAt( const TQPoint& pos ) const; + + bool inText( const TQPoint& pos ) const; + +private: + TQSimpleRichTextData* d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSimpleRichText( const TQSimpleRichText & ); + TQSimpleRichText &operator=( const TQSimpleRichText & ); +#endif +}; + +#endif // QT_NO_RICHTEXT + +#endif // TQSIMPLERICHTEXT_H diff --git a/src/kernel/ntqsize.h b/src/kernel/ntqsize.h new file mode 100644 index 000000000..01905dfd3 --- /dev/null +++ b/src/kernel/ntqsize.h @@ -0,0 +1,237 @@ +/**************************************************************************** +** +** Definition of TQSize class +** +** Created : 931028 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIZE_H +#define TQSIZE_H + +#ifndef QT_H +#include "ntqpoint.h" // ### change to ntqwindowdefs.h? +#endif // QT_H + +class Q_EXPORT TQSize +// ### Make TQSize inherit TQt in TQt 4.0 +{ +public: + // ### Move this enum to ntqnamespace.h in TQt 4.0 + enum ScaleMode { + ScaleFree, + ScaleMin, + ScaleMax + }; + + TQSize(); + TQSize( int w, int h ); + + bool isNull() const; + bool isEmpty() const; + bool isValid() const; + + int width() const; + int height() const; + void setWidth( int w ); + void setHeight( int h ); + void transpose(); + + void scale( int w, int h, ScaleMode mode ); + void scale( const TQSize &s, ScaleMode mode ); + + 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 c ); + TQSize &operator*=( double c ); + TQSize &operator/=( int c ); + TQSize &operator/=( double c ); + + friend inline bool operator==( const TQSize &, const TQSize & ); + friend inline bool operator!=( const TQSize &, const TQSize & ); + friend inline const TQSize operator+( const TQSize &, const TQSize & ); + friend inline const TQSize operator-( const TQSize &, const TQSize & ); + friend inline const TQSize operator*( const TQSize &, int ); + friend inline const TQSize operator*( int, const TQSize & ); + friend inline const TQSize operator*( const TQSize &, double ); + friend inline const TQSize operator*( double, const TQSize & ); + friend inline const TQSize operator/( const TQSize &, int ); + friend inline const TQSize operator/( const TQSize &, double ); + +private: + static void warningDivByZero(); + + TQCOORD wd; + TQCOORD ht; +}; + + +/***************************************************************************** + TQSize stream functions + *****************************************************************************/ + +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQSize & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQSize & ); + + +/***************************************************************************** + TQSize inline functions + *****************************************************************************/ + +inline TQSize::TQSize() +{ wd = ht = -1; } + +inline TQSize::TQSize( int w, int h ) +{ wd=(TQCOORD)w; ht=(TQCOORD)h; } + +inline bool TQSize::isNull() const +{ return wd==0 && ht==0; } + +inline bool TQSize::isEmpty() const +{ return wd<1 || ht<1; } + +inline bool TQSize::isValid() const +{ return wd>=0 && ht>=0; } + +inline int TQSize::width() const +{ return wd; } + +inline int TQSize::height() const +{ return ht; } + +inline void TQSize::setWidth( int w ) +{ wd=(TQCOORD)w; } + +inline void TQSize::setHeight( int h ) +{ ht=(TQCOORD)h; } + +inline TQCOORD &TQSize::rwidth() +{ return wd; } + +inline TQCOORD &TQSize::rheight() +{ return ht; } + +inline TQSize &TQSize::operator+=( const TQSize &s ) +{ wd+=s.wd; ht+=s.ht; return *this; } + +inline TQSize &TQSize::operator-=( const TQSize &s ) +{ wd-=s.wd; ht-=s.ht; return *this; } + +inline TQSize &TQSize::operator*=( int c ) +{ wd*=(TQCOORD)c; ht*=(TQCOORD)c; return *this; } + +inline TQSize &TQSize::operator*=( double c ) +{ wd=(TQCOORD)(wd*c); ht=(TQCOORD)(ht*c); return *this; } + +inline bool operator==( const TQSize &s1, const TQSize &s2 ) +{ return s1.wd == s2.wd && s1.ht == s2.ht; } + +inline bool operator!=( const TQSize &s1, const TQSize &s2 ) +{ return s1.wd != s2.wd || s1.ht != s2.ht; } + +inline const TQSize operator+( const TQSize & s1, const TQSize & s2 ) +{ return TQSize(s1.wd+s2.wd, s1.ht+s2.ht); } + +inline const TQSize operator-( const TQSize &s1, const TQSize &s2 ) +{ return TQSize(s1.wd-s2.wd, s1.ht-s2.ht); } + +inline const TQSize operator*( const TQSize &s, int c ) +{ return TQSize(s.wd*c, s.ht*c); } + +inline const TQSize operator*( int c, const TQSize &s ) +{ return TQSize(s.wd*c, s.ht*c); } + +inline const TQSize operator*( const TQSize &s, double c ) +{ return TQSize((TQCOORD)(s.wd*c), (TQCOORD)(s.ht*c)); } + +inline const TQSize operator*( double c, const TQSize &s ) +{ return TQSize((TQCOORD)(s.wd*c), (TQCOORD)(s.ht*c)); } + +inline TQSize &TQSize::operator/=( int c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0 ) + warningDivByZero(); +#endif + wd/=(TQCOORD)c; ht/=(TQCOORD)c; + return *this; +} + +inline TQSize &TQSize::operator/=( double c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0.0 ) + warningDivByZero(); +#endif + wd=(TQCOORD)(wd/c); ht=(TQCOORD)(ht/c); + return *this; +} + +inline const TQSize operator/( const TQSize &s, int c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0 ) + TQSize::warningDivByZero(); +#endif + return TQSize(s.wd/c, s.ht/c); +} + +inline const TQSize operator/( const TQSize &s, double c ) +{ +#if defined(QT_CHECK_MATH) + if ( c == 0.0 ) + TQSize::warningDivByZero(); +#endif + return TQSize((TQCOORD)(s.wd/c), (TQCOORD)(s.ht/c)); +} + +inline TQSize TQSize::expandedTo( const TQSize & otherSize ) const +{ + return TQSize( TQMAX(wd,otherSize.wd), TQMAX(ht,otherSize.ht) ); +} + +inline TQSize TQSize::boundedTo( const TQSize & otherSize ) const +{ + return TQSize( TQMIN(wd,otherSize.wd), TQMIN(ht,otherSize.ht) ); +} + + +#endif // TQSIZE_H diff --git a/src/kernel/ntqsizegrip.h b/src/kernel/ntqsizegrip.h new file mode 100644 index 000000000..20fab72e0 --- /dev/null +++ b/src/kernel/ntqsizegrip.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Definition of TQSizeGrip class +** +** Created : 980316 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIZEGRIP_H +#define TQSIZEGRIP_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_SIZEGRIP + +class Q_EXPORT TQSizeGrip: public TQWidget +{ + Q_OBJECT +public: + TQSizeGrip( TQWidget* parent, const char* name=0 ); + ~TQSizeGrip(); + + TQSize sizeHint() const; + +protected: + void paintEvent( TQPaintEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + + bool eventFilter( TQObject *, TQEvent * ); + +private: + TQPoint p; + TQSize s; + int d; + TQWidget *tlw; +}; + +#endif //QT_NO_SIZEGRIP +#endif diff --git a/src/kernel/ntqsizepolicy.h b/src/kernel/ntqsizepolicy.h new file mode 100644 index 000000000..85b087a53 --- /dev/null +++ b/src/kernel/ntqsizepolicy.h @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Definition of the TQSizePolicy class +** +** Created : 980929 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSIZEPOLICY_H +#define TQSIZEPOLICY_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +// Documentation is in qabstractlayout.cpp. + +class Q_EXPORT TQSizePolicy +{ +private: + enum SizePolicy_Internal { HSize = 6, HMask = 0x3f, VMask = HMask << HSize, + MayGrow = 1, ExpMask = 2, MayShrink = 4 }; +public: + enum SizeType { Fixed = 0, + Minimum = MayGrow, + Maximum = MayShrink, + Preferred = MayGrow | MayShrink, + MinimumExpanding = MayGrow | ExpMask, + Expanding = MayGrow | MayShrink | ExpMask, + Ignored = ExpMask /* magic value */ }; + + enum ExpandData { NoDirection = 0, + Horizontally = 1, + Vertically = 2, +#ifndef QT_NO_COMPAT + Horizontal = Horizontally, + Vertical = Vertically, +#endif + BothDirections = Horizontally | Vertically }; + + TQSizePolicy() : data( 0 ) { } + + TQSizePolicy( SizeType hor, SizeType ver, bool hfw = FALSE ) + : data( hor | (ver<> HSize ); } + + bool mayShrinkHorizontally() const { return horData() & MayShrink || horData() == Ignored; } + bool mayShrinkVertically() const { return verData() & MayShrink || verData() == Ignored; } + bool mayGrowHorizontally() const { return horData() & MayGrow || horData() == Ignored; } + bool mayGrowVertically() const { return verData() & MayGrow || verData() == Ignored; } + + ExpandData expanding() const + { + return (ExpandData)( (int)(verData() & ExpMask ? Vertically : 0) | + (int)(horData() & ExpMask ? Horizontally : 0) ); + } + + void setHorData( SizeType d ) { data = (Q_UINT32)(data & ~HMask) | d; } + void setVerData( SizeType d ) { data = (Q_UINT32)(data & ~(HMask << HSize)) | + (d << HSize); } + + void setHeightForWidth( bool b ) { data = b ? (Q_UINT32)( data | ( 1 << 2*HSize ) ) + : (Q_UINT32)( data & ~( 1 << 2*HSize ) ); } + bool hasHeightForWidth() const { return data & ( 1 << 2*HSize ); } + + bool operator==( const TQSizePolicy& s ) const { return data == s.data; } + bool operator!=( const TQSizePolicy& s ) const { return data != s.data; } + + + uint horStretch() const { return data >> 24; } + uint verStretch() const { return (data >> 16) & 0xff; } + void setHorStretch( uchar sf ) { data = (data&0x00ffffff) | (uint(sf)<<24); } + void setVerStretch( uchar sf ) { data = (data&0xff00ffff) | (uint(sf)<<16); } + inline void transpose(); + +private: + TQSizePolicy( int i ) : data( (Q_UINT32)i ) { } + + Q_UINT32 data; +}; + +inline TQSizePolicy::TQSizePolicy( SizeType hor, SizeType ver, uchar hors, uchar vers, bool hfw ) + : data( hor | (ver< class TQMap; +class TQStyleSheetItemData; + +class Q_EXPORT TQStyleSheetItem : public TQt +{ +public: + TQStyleSheetItem( TQStyleSheet* parent, const TQString& name ); + TQStyleSheetItem( const TQStyleSheetItem & ); + ~TQStyleSheetItem(); + + TQStyleSheetItem& operator=( const TQStyleSheetItem& other ); + + TQString name() const; + + TQStyleSheet* styleSheet(); + const TQStyleSheet* styleSheet() const; + + enum AdditionalStyleValues { Undefined = - 1}; + + enum DisplayMode { + DisplayBlock, + DisplayInline, + DisplayListItem, + DisplayNone +#ifndef Q_QDOC + , DisplayModeUndefined = -1 +#endif + }; + + DisplayMode displayMode() const; + void setDisplayMode(DisplayMode m); + + int alignment() const; + void setAlignment( int f); + + enum VerticalAlignment { + VAlignBaseline, + VAlignSub, + VAlignSuper + }; + + VerticalAlignment verticalAlignment() const; + void setVerticalAlignment( VerticalAlignment valign ); + + int fontWeight() const; + void setFontWeight(int w); + + int logicalFontSize() const; + void setLogicalFontSize(int s); + + int logicalFontSizeStep() const; + void setLogicalFontSizeStep( int s ); + + int fontSize() const; + void setFontSize(int s); + + TQString fontFamily() const; + void setFontFamily( const TQString& ); + + int numberOfColumns() const; + void setNumberOfColumns(int ncols); + + 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 anc); + + enum WhiteSpaceMode { + WhiteSpaceNormal, + WhiteSpacePre, + WhiteSpaceNoWrap +#ifndef Q_QDOC + , WhiteSpaceModeUndefined = -1 +#endif + }; + WhiteSpaceMode whiteSpaceMode() const; + void setWhiteSpaceMode(WhiteSpaceMode m); + + enum Margin { + MarginLeft, + MarginRight, + MarginTop, + MarginBottom, + MarginFirstLine, + MarginAll, + MarginVertical, + MarginHorizontal +#ifndef Q_QDOC + , MarginUndefined = -1 +#endif + }; + + int margin( Margin m) const; + void setMargin( Margin, int); + + enum ListStyle { + ListDisc, + ListCircle, + ListSquare, + ListDecimal, + ListLowerAlpha, + ListUpperAlpha +#ifndef Q_QDOC + , ListStyleUndefined = -1 +#endif + }; + + 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 ls ); + int lineSpacing() const; + +private: + void init(); + TQStyleSheetItemData* d; +}; + + +#if defined(Q_TEMPLATEDLL) +// MOC_SKIP_BEGIN +Q_TEMPLATE_EXTERN template class Q_EXPORT TQDict; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList< TQPtrVector >; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +// MOC_SKIP_END +#endif + +#ifndef QT_NO_TEXTCUSTOMITEM +class TQTextCustomItem; +#endif + +class Q_EXPORT TQStyleSheet : public TQObject +{ + Q_OBJECT +public: + TQStyleSheet( TQObject *parent=0, const char *name=0 ); + virtual ~TQStyleSheet(); + + static TQStyleSheet* defaultSheet(); + static void setDefaultSheet( TQStyleSheet* ); + + + TQStyleSheetItem* item( const TQString& name); + const TQStyleSheetItem* item( const TQString& name) const; + + void insert( TQStyleSheetItem* item); + +#ifndef QT_NO_TEXTCUSTOMITEM + virtual TQTextCustomItem* tag( const TQString& name, + const TQMap &attr, + const TQString& context, + const TQMimeSourceFactory& factory, + bool emptyTag, TQTextDocument *doc ) const; +#endif + static TQString escape( const TQString& ); + static TQString convertFromPlainText( const TQString&, + TQStyleSheetItem::WhiteSpaceMode mode = TQStyleSheetItem::WhiteSpacePre ); + static bool mightBeRichText( const TQString& ); + + virtual void scaleFont( TQFont& font, int logicalSize ) const; + + virtual void error( const TQString& ) const; + +private: + void init(); + TQDict styles; + TQStyleSheetItem* nullstyle; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQStyleSheet( const TQStyleSheet & ); + TQStyleSheet &operator=( const TQStyleSheet & ); +#endif +}; + +#endif // QT_NO_RICHTEXT + +#endif // TQSTYLESHEET_H diff --git a/src/kernel/ntqt.h b/src/kernel/ntqt.h new file mode 100644 index 000000000..6a2a54289 --- /dev/null +++ b/src/kernel/ntqt.h @@ -0,0 +1,375 @@ +/**************************************************************************** +** +** TQt GUI Toolkit +** +** This header file efficiently includes all TQt GUI Toolkit functionality. +** +** Generated : Mon Oct 13 13:07:29 CEST 2003 + +** +** Copyright (C) 1995-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the TQt GUI Toolkit. +** +*****************************************************************************/ + +#ifndef QT_H +#define QT_H +#include "ntqglobal.h" +#include "ntqfeatures.h" +#include "ntqshared.h" +#include "ntqptrcollection.h" +#include "ntqglist.h" +#include "ntqobjectdefs.h" +#include "ntqnamespace.h" +#include "ntqgarray.h" +#include "ntqmemarray.h" +#include "ntqcstring.h" +#include "ntqstring.h" +#include "ntqptrlist.h" +#include "ntqiodevice.h" +#include "ntqkeysequence.h" +#include "ntqwindowdefs.h" +#include "ntqgdict.h" +#include "ntqfont.h" +#include "ntqdatastream.h" +#include "ntqpair.h" +#include "ntqpoint.h" +#include +#include "ntqtextstream.h" +#include "ntqfontinfo.h" +#include "ntqsizepolicy.h" +#include "ntqtl.h" +#include "ntqsize.h" +#include "ntqrect.h" +#include "ntqbitarray.h" +#include "ntqregion.h" +#include "ntqsql.h" +#include "ntqstrlist.h" +#include "ntqvaluelist.h" +#include "ntqmap.h" +#include "ntqdatetime.h" +#include "ntqmime.h" +#include "ntqasciidict.h" +#include "ntqpaintdevice.h" +#include "ntqfontmetrics.h" +#include "ntqdict.h" +#include "ntqevent.h" +#include "ntqhostaddress.h" +#include "ntqstringlist.h" +#include "ntqcolor.h" +#include +#include "ntqobject.h" +#include +#include "ntqbrush.h" +#include "ntqpalette.h" +#include "ntqwidget.h" +#include "ntqjpunicode.h" +#include "ntqtextcodec.h" +#include "ntqstyle.h" +#include "ntqframe.h" +#include "ntqfile.h" +#include "ntqfileinfo.h" +#include "ntqurlinfo.h" +#include "ntqwidgetlist.h" +#include +#include "ntqgroupbox.h" +#include "ntqdialog.h" +#include +#include "ntqdockwindow.h" +#include "ntqcommonstyle.h" +#include "ntqnetworkprotocol.h" +#include +#include +#include "ntqgcache.h" +#include "ntqpixmap.h" +#include +#include +#include +#include +#include "ntqgplugin.h" +#include +#include "ntqrangecontrol.h" +#include "ntqbuttongroup.h" +#include +#include "ntqgvector.h" +#include "ntqhbox.h" +#include +#include "ntqiconset.h" +#include +#include "ntqsocketnotifier.h" +#include +#include +#include +#include "ntqbuffer.h" +#include "ntqimage.h" +#include +#include "ntqlineedit.h" +#include +#include "ntqintdict.h" +#include "ntqmotifstyle.h" +#include "ntqpicture.h" +#include +#include +#include +#include +#include "ntqlabel.h" +#include "ntqlayout.h" +#include +#include +#include +#include "ntqscrollbar.h" +#include "ntqscrollview.h" +#include "ntqdir.h" +#include "ntqwindowsstyle.h" +#include "ntqconnection.h" +#include "ntqbitmap.h" +#include "ntqvariant.h" +#include "ntqsignal.h" +#include +#include "ntqmetaobject.h" +#include "ntqheader.h" +#include +#include +#include +#include "ntqptrvector.h" +#include "ntqmutex.h" +#include "ntqbutton.h" +#include +#include +#include "ntqguardedptr.h" +#include +#include "ntqsqlfield.h" +#include +#include +#include +#include +#include "ntqpointarray.h" +#include "ntqmenudata.h" +#include +#include "ntqpen.h" +#include "ntqdragobject.h" +#include +#include +#include +#include +#include +#include +#include +#include "ntqpopupmenu.h" +#include +#include +#include +#include "ntqprogressbar.h" +#include "ntqsemimodal.h" +#include +#include "ntqptrdict.h" +#include +#include +#include +#include "ntqstylesheet.h" +#include +#include +#include +#include +#include "ntqregexp.h" +#include +#include +#include +#include +#include "ntqsemaphore.h" +#include +#include "ntqsocketdevice.h" +#include +#include +#include +#include +#include "ntqtimer.h" +#include +#include +#include +#include "ntqwmatrix.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ntqsqlerror.h" +#include "ntqeditorfactory.h" +#include "ntqsqlquery.h" +#include "ntqsqlrecord.h" +#include +#include "ntqsqlindex.h" +#include "ntqsqlcursor.h" +#include +#include +#include "ntqtable.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "ntqtranslator.h" +#include +#include +#include +#include +#include "ntqtextedit.h" +#include +#include +#include +#include "ntqsqleditorfactory.h" +#include +#include +#include +#include +#include +#include +#include "ntqtoolbar.h" +#include +#include "ntqwaitcondition.h" +#include +#include +#include +#include +#include +#include +#include "ntqdesktopwidget.h" +#include +#include "ntqurl.h" +#include "ntqurloperator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined( QT_MOC_CPP ) || defined( QT_H_CPP ) || defined( Q_OS_MACX ) +#include +#include +#include "private/qgfxdriverinterface_p.h" +#include "private/qcom_p.h" +#include "private/qimageformatinterface_p.h" +#include "private/qisciicodec_p.h" +#include "private/qkbddriverinterface_p.h" +#include "private/qlayoutengine_p.h" +#include "private/qcomlibrary_p.h" +#include "private/qmousedriverinterface_p.h" +#include "private/qeffects_p.h" +#include "private/qgpluginmanager_p.h" +#include "private/qinternal_p.h" +#include "private/qsqldriverinterface_p.h" +#include "private/qsqlmanager_p.h" +#include "private/qlock_p.h" +#include "private/qcomponentfactory_p.h" +#include "private/qstyleinterface_p.h" +#include "private/qrichtext_p.h" +#include "private/qsvgdevice_p.h" +#include "private/qfontcodecs_p.h" +#include "private/qtextcodecinterface_p.h" +#include "private/qpsprinter_p.h" +#include "private/qtitlebar_p.h" +#include "private/qucom_p.h" +#include "private/qucomextra_p.h" +#include "private/qpluginmanager_p.h" +#include "private/qdir_p.h" +#include "private/qsettings_p.h" +#include "private/qsqlextension_p.h" +#include "private/qdialogbuttons_p.h" +#include "private/qwidgetinterface_p.h" +#include "private/qwidgetresizehandler_p.h" +#include "private/qlibrary_p.h" +#endif // Private headers + + +#ifdef Q_WS_X11 +#include "private/qtkdeintegration_x11_p.h" +#endif + +#ifdef Q_WS_MAC +#include +#include +#endif // Q_WS_MAC + +#ifdef Q_WS_WIN +#include +#endif + +#ifdef Q_WS_QWS +#include +#include "qfontmanager_qws.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "qmemorymanager_qws.h" +#include +#include +#ifndef Q_OS_MAC +# include +#endif +#include "qgfx_qws.h" +#include +#include "qwsdisplay_qws.h" +#include "qwssocket_qws.h" +#include "qwsdecoration_qws.h" +#include "qwsutils_qws.h" +#include +#include "qwsmanager_qws.h" +#include "qwsdefaultdecoration_qws.h" +#include +#include "qwscommand_qws.h" +#include +#include +#include +#include +#include "qwsproperty_qws.h" +#include +#include "qwsevent_qws.h" +#include +#include +#endif // Q_WS_QWS + + +#ifdef Q_WS_WCE +#include +#endif // Q_WS_WCE + +#endif // QT_H diff --git a/src/kernel/ntqthread.h b/src/kernel/ntqthread.h new file mode 100644 index 000000000..56480a3fb --- /dev/null +++ b/src/kernel/ntqthread.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Definition of TQThread class +** +** Created : 931107 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTHREAD_H +#define TQTHREAD_H + +#if defined(QT_THREAD_SUPPORT) + +#ifndef QT_H +#include "ntqwindowdefs.h" +#ifndef QT_NO_COMPAT +#include "ntqmutex.h" +#include "ntqsemaphore.h" +#include "ntqwaitcondition.h" +#endif // QT_NO_COMPAT +#endif // QT_H + +#include + +class TQThreadInstance; + +class Q_EXPORT TQThread : public TQt +{ +public: + static TQt::HANDLE currentThread(); + +#ifndef QT_NO_COMPAT + static void postEvent( TQObject *,TQEvent * ); +#endif + + static void initialize(); + static void cleanup(); + + static void exit(); + +#ifdef Q_QDOC + TQThread( unsigned int stackSize = 0 ); +#else + TQThread( unsigned int stackSize ); + TQThread(); +#endif + + virtual ~TQThread(); + + // default argument causes thread to block indefinately + bool wait( unsigned long time = ULONG_MAX ); + + enum Priority { + IdlePriority, + + LowestPriority, + LowPriority, + NormalPriority, + HighPriority, + HighestPriority, + + TimeCriticalPriority, + + InheritPriority + }; + +#ifdef Q_QDOC + void start( Priority = InheritPriority ); +#else + void start( Priority ); + void start(); +#endif + + void terminate(); + + bool finished() const; + bool running() const; + +protected: + virtual void run() = 0; + + static void sleep( unsigned long ); + static void msleep( unsigned long ); + static void usleep( unsigned long ); + +private: + TQThreadInstance * d; + friend class TQThreadInstance; + +#if defined(Q_DISABLE_COPY) + TQThread( const TQThread & ); + TQThread &operator=( const TQThread & ); +#endif // Q_DISABLE_COPY +}; + +#endif // QT_THREAD_SUPPORT + +#endif // TQTHREAD_H diff --git a/src/kernel/ntqtimer.h b/src/kernel/ntqtimer.h new file mode 100644 index 000000000..103c65ab9 --- /dev/null +++ b/src/kernel/ntqtimer.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Definition of TQTimer class +** +** Created : 931111 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTIMER_H +#define TQTIMER_H + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H + + +class Q_EXPORT TQTimer : public TQObject +{ + Q_OBJECT +public: + TQTimer( TQObject *parent=0, const char *name=0 ); + ~TQTimer(); + + bool isActive() const; + + int start( int msec, bool sshot = FALSE ); + void changeInterval( int msec ); + void stop(); + + static void singleShot( int msec, TQObject *receiver, const char *member ); + + int timerId() const { return id; } + +signals: + void timeout(); + +protected: + bool event( TQEvent * ); + +private: + int id; + uint single : 1; + uint nulltimer : 1; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTimer( const TQTimer & ); + TQTimer &operator=( const TQTimer & ); +#endif +}; + + +inline bool TQTimer::isActive() const +{ + return id >= 0; +} + + +#endif // TQTIMER_H diff --git a/src/kernel/ntqtranslator.h b/src/kernel/ntqtranslator.h new file mode 100644 index 000000000..eccc8e4c1 --- /dev/null +++ b/src/kernel/ntqtranslator.h @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Definition of the translator class +** +** Created : 980906 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + + +#ifndef TQTRANSLATOR_H +#define TQTRANSLATOR_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqvaluelist.h" +#endif // QT_H + +#ifndef QT_NO_TRANSLATION + +class TQTranslatorPrivate; + +class Q_EXPORT TQTranslatorMessage +{ +public: + TQTranslatorMessage(); + TQTranslatorMessage( const char * context, + const char * sourceText, + const char * comment, + const TQString& translation = TQString::null ); + TQTranslatorMessage( TQDataStream & ); + TQTranslatorMessage( const TQTranslatorMessage & m ); + + TQTranslatorMessage & operator=( const TQTranslatorMessage & m ); + + uint hash() const { return h; } + const char *context() const { return cx; } + const char *sourceText() const { return st; } + const char *comment() const { return cm; } + + void setTranslation( const TQString & translation ) { tn = translation; } + TQString translation() const { return tn; } + + enum Prefix { NoPrefix, Hash, HashContext, HashContextSourceText, + HashContextSourceTextComment }; + void write( TQDataStream & s, bool strip = FALSE, + Prefix prefix = HashContextSourceTextComment ) const; + Prefix commonPrefix( const TQTranslatorMessage& ) const; + + bool operator==( const TQTranslatorMessage& m ) const; + bool operator!=( const TQTranslatorMessage& m ) const + { return !operator==( m ); } + bool operator<( const TQTranslatorMessage& m ) const; + bool operator<=( const TQTranslatorMessage& m ) const + { return !m.operator<( *this ); } + bool operator>( const TQTranslatorMessage& m ) const + { return m.operator<( *this ); } + bool operator>=( const TQTranslatorMessage& m ) const + { return !operator<( m ); } + +private: + uint h; + TQCString cx; + TQCString st; + TQCString cm; + TQString tn; + + enum Tag { Tag_End = 1, Tag_SourceText16, Tag_Translation, Tag_Context16, + Tag_Hash, Tag_SourceText, Tag_Context, Tag_Comment, + Tag_Obsolete1 }; +}; + + +class Q_EXPORT TQTranslator: public TQObject +{ + Q_OBJECT +public: + TQTranslator( TQObject * parent = 0, const char * name = 0 ); + ~TQTranslator(); + +#ifndef QT_NO_COMPAT + TQString find( const char *context, const char *sourceText, const char * comment = 0 ) const { + return findMessage( context, sourceText, comment ).translation(); + } +#endif + virtual TQTranslatorMessage findMessage( const char *, const char *, + const char * = 0 ) const; + + bool load( const TQString & filename, + const TQString & directory = TQString::null, + const TQString & search_delimiters = TQString::null, + const TQString & suffix = TQString::null ); + bool load( const uchar *data, int len ) { + clear(); + return do_load( data, len ); + } + + void clear(); + +#ifndef QT_NO_TRANSLATION_BUILDER + enum SaveMode { Everything, Stripped }; + + bool save( const TQString & filename, SaveMode mode = Everything ); + + void insert( const TQTranslatorMessage& ); + void insert( const char *context, const char *sourceText, const TQString &translation ) { + insert( TQTranslatorMessage(context, sourceText, "", translation) ); + } + void remove( const TQTranslatorMessage& ); + void remove( const char *context, const char *sourceText ) { + remove( TQTranslatorMessage(context, sourceText, "") ); + } + bool contains( const char *, const char *, const char * comment = 0 ) const; + + void squeeze( SaveMode = Everything ); + void unsqueeze(); + + TQValueList messages() const; +#endif + + bool isEmpty() const; + +private: +#if defined(Q_DISABLE_COPY) + TQTranslator( const TQTranslator & ); + TQTranslator &operator=( const TQTranslator & ); +#endif + + bool do_load( const uchar *data, int len ); + + TQTranslatorPrivate * d; +}; + +#endif // QT_NO_TRANSLATION + +#endif diff --git a/src/kernel/ntqurl.h b/src/kernel/ntqurl.h new file mode 100644 index 000000000..5069849fe --- /dev/null +++ b/src/kernel/ntqurl.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Definition of TQUrl class +** +** Created : 950429 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQURL_H +#define TQURL_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_URL + +class TQUrlPrivate; + +class Q_EXPORT TQUrl +{ +public: + TQUrl(); + TQUrl( const TQString& url ); + TQUrl( const TQUrl& url ); + TQUrl( const TQUrl& url, const TQString& relUrl, bool checkSlash = FALSE ); + virtual ~TQUrl(); + + TQString protocol() const; + virtual void setProtocol( const TQString& protocol ); + + TQString user() const; + virtual void setUser( const TQString& user ); + bool hasUser() const; + + TQString password() const; + virtual void setPassword( const TQString& pass ); + bool hasPassword() const; + + TQString host() const; + virtual void setHost( const TQString& user ); + bool hasHost() const; + + int port() const; + virtual void setPort( int port ); + bool hasPort() const; + + TQString path( bool correct = TRUE ) const; + virtual void setPath( const TQString& path ); + bool hasPath() const; + + virtual void setEncodedPathAndQuery( const TQString& enc ); + TQString encodedPathAndQuery(); + + virtual void setQuery( const TQString& txt ); + TQString query() const; + + TQString ref() const; + virtual void setRef( const TQString& txt ); + bool hasRef() const; + + bool isValid() const; + bool isLocalFile() const; + + virtual void addPath( const TQString& path ); + virtual void setFileName( const TQString& txt ); + + TQString fileName() const; + TQString dirPath() const; + + TQUrl& operator=( const TQUrl& url ); + TQUrl& operator=( const TQString& url ); + + bool operator==( const TQUrl& url ) const; + bool operator==( const TQString& url ) const; + + static void decode( TQString& url ); + static void encode( TQString& url ); + + operator TQString() const; + virtual TQString toString( bool encodedPath = FALSE, bool forcePrependProtocol = TRUE ) const; + + virtual bool cdUp(); + + static bool isRelativeUrl( const TQString &url ); + +protected: + virtual void reset(); + virtual bool parse( const TQString& url ); + +private: + TQUrlPrivate *d; + +}; + +#endif //QT_NO_URL + +#endif diff --git a/src/kernel/ntqurlinfo.h b/src/kernel/ntqurlinfo.h new file mode 100644 index 000000000..18ef71c57 --- /dev/null +++ b/src/kernel/ntqurlinfo.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Definition of TQUrlInfo class +** +** Created : 950429 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQURLINFO_H +#define TQURLINFO_H + +#ifndef QT_H +#include "ntqdatetime.h" +#include "ntqstring.h" +#if defined(QT_ABI_QT4) +#include "ntqiodevice.h" +#endif +#endif // QT_H + +class TQUrlOperator; +class TQUrl; +class TQUrlInfoPrivate; + +class Q_EXPORT TQUrlInfo +{ +public: + enum PermissionSpec { + ReadOwner = 00400, WriteOwner = 00200, ExeOwner = 00100, + ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010, + ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 }; + + TQUrlInfo(); + TQUrlInfo( const TQUrlOperator &path, const TQString &file ); + TQUrlInfo( const TQUrlInfo &ui ); +#if (QT_VERSION-0 >= 0x040000) +#error "TQUrlInfo::TQUrlInfo() should accept TQIODevice::Offset instead of uint" +#elif defined(QT_ABI_QT4) + TQUrlInfo( const TQString &name, int permissions, const TQString &owner, + const TQString &group, TQIODevice::Offset size, const TQDateTime &lastModified, + const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable ); + TQUrlInfo( const TQUrl &url, int permissions, const TQString &owner, + const TQString &group, TQIODevice::Offset size, const TQDateTime &lastModified, + const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable ); +#else + TQUrlInfo( const TQString &name, int permissions, const TQString &owner, + const TQString &group, uint size, const TQDateTime &lastModified, + const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable ); + TQUrlInfo( const TQUrl &url, int permissions, const TQString &owner, + const TQString &group, uint size, const TQDateTime &lastModified, + const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable ); +#endif + TQUrlInfo &operator=( const TQUrlInfo &ui ); + virtual ~TQUrlInfo(); + + virtual void setName( const TQString &name ); + virtual void setDir( bool b ); + virtual void setFile( bool b ); + virtual void setSymLink( bool b ); + virtual void setOwner( const TQString &s ); + virtual void setGroup( const TQString &s ); +#if (QT_VERSION-0 >= 0x040000) +#error "TQUrlInfo::setSize() should accept TQIODevice::Offset instead of uint" +#elif defined(QT_ABI_QT4) + virtual void setSize( TQIODevice::Offset size ); +#else + virtual void setSize( uint size ); +#endif + virtual void setWritable( bool b ); + virtual void setReadable( bool b ); + virtual void setPermissions( int p ); + virtual void setLastModified( const TQDateTime &dt ); + + bool isValid() const; + + TQString name() const; + int permissions() const; + TQString owner() const; + TQString group() const; +#if (QT_VERSION-0 >= 0x040000) +#error "TQUrlInfo::size() should return TQIODevice::Offset instead of uint" +#elif defined(QT_ABI_QT4) + TQIODevice::Offset size() const; +#else + uint size() const; +#endif + 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 &i1, const TQUrlInfo &i2, + int sortBy ); + static bool lessThan( const TQUrlInfo &i1, const TQUrlInfo &i2, + int sortBy ); + static bool equal( const TQUrlInfo &i1, const TQUrlInfo &i2, + int sortBy ); + + bool operator==( const TQUrlInfo &i ) const; +private: + TQUrlInfoPrivate *d; + +}; + +#endif diff --git a/src/kernel/ntqurloperator.h b/src/kernel/ntqurloperator.h new file mode 100644 index 000000000..654cc313f --- /dev/null +++ b/src/kernel/ntqurloperator.h @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Definition of TQUrlOperator class +** +** Created : 950429 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQURLOPERATOR_H +#define TQURLOPERATOR_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqurl.h" +#include "ntqptrlist.h" +#include "ntqnetworkprotocol.h" +#include "ntqstringlist.h" // TQString->TQStringList conversion +#endif // QT_H + +#ifndef QT_NO_NETWORKPROTOCOL + +class TQUrlInfo; +class TQUrlOperatorPrivate; + +class Q_EXPORT TQUrlOperator : public TQObject, public TQUrl +{ + friend class TQNetworkProtocol; + + Q_OBJECT + +public: + TQUrlOperator(); + TQUrlOperator( const TQString &urL ); + TQUrlOperator( const TQUrlOperator& url ); + TQUrlOperator( const TQUrlOperator& url, const TQString& relUrl, bool checkSlash = FALSE ); + virtual ~TQUrlOperator(); + + virtual void setPath( const TQString& path ); + virtual bool cdUp(); + + virtual const TQNetworkOperation *listChildren(); + virtual const TQNetworkOperation *mkdir( const TQString &dirname ); + virtual const TQNetworkOperation *remove( const TQString &filename ); + virtual const TQNetworkOperation *rename( const TQString &oldname, const TQString &newname ); + virtual const TQNetworkOperation *get( const TQString &location = TQString::null ); + virtual const TQNetworkOperation *put( const TQByteArray &data, const TQString &location = TQString::null ); + virtual TQPtrList copy( const TQString &from, const TQString &to, bool move = FALSE, bool toPath = TRUE ); + virtual void copy( const TQStringList &files, const TQString &dest, bool move = FALSE ); + virtual bool isDir( bool *ok = 0 ); + + virtual void setNameFilter( const TQString &nameFilter ); + TQString nameFilter() const; + + virtual TQUrlInfo info( const TQString &entry ) const; + + TQUrlOperator& operator=( const TQUrlOperator &url ); + TQUrlOperator& operator=( const TQString &url ); + + virtual void stop(); + +signals: + void newChildren( const TQValueList &, TQNetworkOperation *res ); + void finished( TQNetworkOperation *res ); + void start( TQNetworkOperation *res ); + void createdDirectory( const TQUrlInfo &, TQNetworkOperation *res ); + void removed( TQNetworkOperation *res ); + void itemChanged( TQNetworkOperation *res ); + void data( const TQByteArray &, TQNetworkOperation *res ); + void dataTransferProgress( int bytesDone, int bytesTotal, TQNetworkOperation *res ); + void startedNextCopy( const TQPtrList &lst ); + void connectionStateChanged( int state, const TQString &data ); + +protected: + void reset(); + bool parse( const TQString& url ); + virtual bool checkValid(); + virtual void clearEntries(); + void getNetworkProtocol(); + void deleteNetworkProtocol(); + +private slots: + const TQNetworkOperation *startOperation( TQNetworkOperation *op ); + void copyGotData( const TQByteArray &data, TQNetworkOperation *op ); + void continueCopy( TQNetworkOperation *op ); + void finishedCopy(); + void addEntry( const TQValueList &i ); + void slotItemChanged( TQNetworkOperation *op ); + +private: + void deleteOperation( TQNetworkOperation *op ); + + TQUrlOperatorPrivate *d; +}; + +#endif // QT_NO_NETWORKPROTOCOL + +#endif // TQURLOPERATOR_H diff --git a/src/kernel/ntqvariant.h b/src/kernel/ntqvariant.h new file mode 100644 index 000000000..e7a09f5c1 --- /dev/null +++ b/src/kernel/ntqvariant.h @@ -0,0 +1,396 @@ +/**************************************************************************** +** +** Definition of TQVariant class +** +** Created : 990414 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVARIANT_H +#define TQVARIANT_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_VARIANT +class TQString; +class TQCString; +class TQFont; +class TQPixmap; +class TQBrush; +class TQRect; +class TQPoint; +class TQImage; +class TQSize; +class TQColor; +class TQPalette; +class TQColorGroup; +class TQIconSet; +class TQDataStream; +class TQPointArray; +class TQRegion; +class TQBitmap; +class TQCursor; +class TQStringList; +class TQSizePolicy; +class TQDate; +class TQTime; +class TQDateTime; +class TQBitArray; +class TQKeySequence; +class TQPen; +// Some headers rejected after TQVariant declaration for GCC 2.7.* compatibility +class TQVariant; +#ifndef QT_NO_TEMPLATE_VARIANT +template class TQValueList; +template class TQValueListConstIterator; +template class TQValueListNode; +template class TQMap; +template class TQMapConstIterator; +#endif + +class Q_EXPORT TQVariant +{ +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(); + TQVariant( const TQVariant& ); +#ifndef QT_NO_DATASTREAM + TQVariant( TQDataStream& s ); +#endif + TQVariant( const TQString& ); + TQVariant( const TQCString& ); + TQVariant( const char* ); +#ifndef QT_NO_STRINGLIST + TQVariant( const TQStringList& ); +#endif + 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& ); +#ifndef QT_NO_ACCEL + TQVariant( const TQKeySequence& ); +#endif + TQVariant( const TQPen& ); +#ifndef QT_NO_TEMPLATE_VARIANT + TQVariant( const TQValueList& ); + TQVariant( const TQMap& ); +#endif + TQVariant( int ); + TQVariant( uint ); + TQVariant( Q_LLONG ); + TQVariant( Q_ULLONG ); + // ### Problems on some compilers ? + TQVariant( bool, int ); + TQVariant( double ); + TQVariant( TQSizePolicy ); + + TQVariant& operator= ( const TQVariant& ); + bool operator==( const TQVariant& ) const; + bool operator!=( const TQVariant& ) const; + + 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; +#ifndef QT_NO_STRINGLIST + const TQStringList toStringList() const; +#endif + 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; +#ifndef QT_NO_ACCEL + const TQKeySequence toKeySequence() const; +#endif + const TQPen toPen() const; + int toInt( bool * ok=0 ) const; + uint toUInt( bool * ok=0 ) const; + Q_LLONG toLongLong( bool * ok=0 ) const; + Q_ULLONG toULongLong( bool * ok=0 ) const; + bool toBool() const; + double toDouble( bool * ok=0 ) const; +#ifndef QT_NO_TEMPLATE_VARIANT + const TQValueList toList() const; + const TQMap toMap() const; +#endif + TQSizePolicy toSizePolicy() const; + +#ifndef QT_NO_TEMPLATE_VARIANT + TQValueListConstIterator stringListBegin() const; + TQValueListConstIterator stringListEnd() const; + TQValueListConstIterator listBegin() const; + TQValueListConstIterator listEnd() const; + TQMapConstIterator mapBegin() const; + TQMapConstIterator mapEnd() const; + TQMapConstIterator mapFind( const TQString& ) const; +#endif + TQString& asString(); + TQCString& asCString(); +#ifndef QT_NO_STRINGLIST + TQStringList& asStringList(); +#endif + 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(); +#ifndef QT_NO_ACCEL + TQKeySequence& asKeySequence(); +#endif + TQPen& asPen(); + int& asInt(); + uint& asUInt(); + Q_LLONG& asLongLong(); + Q_ULLONG& asULongLong(); + bool& asBool(); + double& asDouble(); +#ifndef QT_NO_TEMPLATE_VARIANT + TQValueList& asList(); + TQMap& asMap(); +#endif + TQSizePolicy& asSizePolicy(); + +#ifndef QT_NO_DATASTREAM + void load( TQDataStream& ); + void save( TQDataStream& ) const; +#endif + static const char* typeToName( Type typ ); + static Type nameToType( const char* name ); + +private: + void detach(); + + class Private : public TQShared + { + public: + Private(); + Private( Private* ); + ~Private(); + + void clear(); + + Type typ; + union + { + uint u; + int i; + Q_LLONG ll; + Q_ULLONG ull; + bool b; + double d; + void *ptr; + } value; + uint is_null : 1; // ## 4.0 merge with typ + }; + + Private* d; + +public: + void* rawAccess( void* ptr = 0, Type typ = Invalid, bool deepCopy = FALSE ); +}; + +// down here for GCC 2.7.* compatibility +#ifndef QT_H +#include "ntqvaluelist.h" +#include "ntqstringlist.h" +#include "ntqmap.h" +#endif // QT_H + +inline TQVariant::Type TQVariant::type() const +{ + return d->typ; +} + +inline bool TQVariant::isValid() const +{ + return (d->typ != Invalid); +} + +#ifndef QT_NO_TEMPLATE_VARIANT +inline TQValueListConstIterator TQVariant::stringListBegin() const +{ + if ( d->typ != StringList ) + return TQValueListConstIterator(); + return ((const TQStringList*)d->value.ptr)->begin(); +} + +inline TQValueListConstIterator TQVariant::stringListEnd() const +{ + if ( d->typ != StringList ) + return TQValueListConstIterator(); + return ((const TQStringList*)d->value.ptr)->end(); +} + +inline TQValueListConstIterator TQVariant::listBegin() const +{ + if ( d->typ != List ) + return TQValueListConstIterator(); + return ((const TQValueList*)d->value.ptr)->begin(); +} + +inline TQValueListConstIterator TQVariant::listEnd() const +{ + if ( d->typ != List ) + return TQValueListConstIterator(); + return ((const TQValueList*)d->value.ptr)->end(); +} + +inline TQMapConstIterator TQVariant::mapBegin() const +{ + if ( d->typ != Map ) + return TQMapConstIterator(); + return ((const TQMap*)d->value.ptr)->begin(); +} + +inline TQMapConstIterator TQVariant::mapEnd() const +{ + if ( d->typ != Map ) + return TQMapConstIterator(); + return ((const TQMap*)d->value.ptr)->end(); +} + +inline TQMapConstIterator TQVariant::mapFind( const TQString& key ) const +{ + if ( d->typ != Map ) + return TQMapConstIterator(); + return ((const TQMap*)d->value.ptr)->find( key ); +} +#endif + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream& operator>> ( TQDataStream& s, TQVariant& p ); +Q_EXPORT TQDataStream& operator<< ( TQDataStream& s, const TQVariant& p ); +Q_EXPORT TQDataStream& operator>> ( TQDataStream& s, TQVariant::Type& p ); +Q_EXPORT TQDataStream& operator<< ( TQDataStream& s, const TQVariant::Type p ); +#endif + +#endif //QT_NO_VARIANT +#endif // TQVARIANT_H diff --git a/src/kernel/ntqvfbhdr.h b/src/kernel/ntqvfbhdr.h new file mode 100644 index 000000000..300ace8bb --- /dev/null +++ b/src/kernel/ntqvfbhdr.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** TQt/Embedded virtual framebuffer +** +** Created : 20000605 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVFBHDR_H +#define TQVFBHDR_H + +#ifndef QT_H +#include "ntqcolor.h" +#include "ntqrect.h" +#endif // QT_H + +#define QT_VFB_MOUSE_PIPE "/tmp/.qtvfb_mouse-%1" +#define QT_VFB_KEYBOARD_PIPE "/tmp/.qtvfb_keyboard-%1" + +struct TQVFbHeader +{ + int width; + int height; + int depth; + int linestep; + int dataoffset; + TQRect update; + bool dirty; + int numcols; + TQRgb clut[256]; +}; + +struct TQVFbKeyData +{ + unsigned int unicode; + unsigned int modifiers; + bool press; + bool repeat; +}; + +#endif diff --git a/src/kernel/ntqwidget.h b/src/kernel/ntqwidget.h new file mode 100644 index 000000000..383ffc8e0 --- /dev/null +++ b/src/kernel/ntqwidget.h @@ -0,0 +1,1094 @@ +/**************************************************************************** +** +** Definition of TQWidget class +** +** Created : 931029 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWIDGET_H +#define TQWIDGET_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqobject.h" +#include "ntqpaintdevice.h" +#include "ntqpalette.h" +#include "ntqfont.h" +#include "ntqfontmetrics.h" +#include "ntqfontinfo.h" +#include "ntqsizepolicy.h" +#endif // QT_H + +#if defined(Q_WS_X11) && !defined(QT_NO_IM) +class TQInputContext; +#endif + +class TQLayout; +struct TQWExtra; +struct TQTLWExtra; +class TQFocusData; +class TQCursor; +class TQWSRegionManager; +class TQStyle; + +class Q_EXPORT TQWidget : public TQObject, public TQPaintDevice +{ + Q_OBJECT + Q_ENUMS( BackgroundMode FocusPolicy BackgroundOrigin ) + Q_PROPERTY( bool isTopLevel READ isTopLevel ) + Q_PROPERTY( bool isDialog READ isDialog ) + Q_PROPERTY( bool isModal READ isModal ) + Q_PROPERTY( bool isPopup READ isPopup ) + Q_PROPERTY( bool isDesktop READ isDesktop ) + Q_PROPERTY( bool enabled READ isEnabled WRITE setEnabled ) + Q_PROPERTY( TQRect geometry READ geometry WRITE setGeometry ) + Q_PROPERTY( TQRect frameGeometry READ frameGeometry ) + Q_PROPERTY( int x READ x ) + Q_PROPERTY( int y READ y ) + Q_PROPERTY( TQPoint pos READ pos WRITE move DESIGNABLE false STORED false ) + Q_PROPERTY( TQSize frameSize READ frameSize ) + Q_PROPERTY( TQSize size READ size WRITE resize DESIGNABLE false STORED false ) + Q_PROPERTY( int width READ width ) + Q_PROPERTY( int height READ height ) + Q_PROPERTY( TQRect rect READ rect ) + Q_PROPERTY( TQRect childrenRect READ childrenRect ) + Q_PROPERTY( TQRegion childrenRegion READ childrenRegion ) + Q_PROPERTY( TQSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy ) + Q_PROPERTY( TQSize minimumSize READ minimumSize WRITE setMinimumSize ) + Q_PROPERTY( TQSize maximumSize READ maximumSize WRITE setMaximumSize ) + Q_PROPERTY( int minimumWidth READ minimumWidth WRITE setMinimumWidth STORED false DESIGNABLE false ) + Q_PROPERTY( int minimumHeight READ minimumHeight WRITE setMinimumHeight STORED false DESIGNABLE false ) + Q_PROPERTY( int maximumWidth READ maximumWidth WRITE setMaximumWidth STORED false DESIGNABLE false ) + Q_PROPERTY( int maximumHeight READ maximumHeight WRITE setMaximumHeight STORED false DESIGNABLE false ) + Q_PROPERTY( TQSize sizeIncrement READ sizeIncrement WRITE setSizeIncrement ) + Q_PROPERTY( TQSize baseSize READ baseSize WRITE setBaseSize ) + Q_PROPERTY( BackgroundMode backgroundMode READ backgroundMode WRITE setBackgroundMode DESIGNABLE false ) + Q_PROPERTY( TQColor paletteForegroundColor READ paletteForegroundColor WRITE setPaletteForegroundColor RESET unsetPalette ) + Q_PROPERTY( TQColor paletteBackgroundColor READ paletteBackgroundColor WRITE setPaletteBackgroundColor RESET unsetPalette ) + Q_PROPERTY( TQPixmap paletteBackgroundPixmap READ paletteBackgroundPixmap WRITE setPaletteBackgroundPixmap RESET unsetPalette ) + Q_PROPERTY( TQBrush backgroundBrush READ backgroundBrush ) + Q_PROPERTY( TQColorGroup colorGroup READ colorGroup ) + Q_PROPERTY( TQPalette palette READ palette WRITE setPalette RESET unsetPalette STORED ownPalette ) + Q_PROPERTY( BackgroundOrigin backgroundOrigin READ backgroundOrigin WRITE setBackgroundOrigin ) + Q_PROPERTY( bool ownPalette READ ownPalette ) + Q_PROPERTY( TQFont font READ font WRITE setFont RESET unsetFont STORED ownFont ) + Q_PROPERTY( bool ownFont READ ownFont ) +#ifndef QT_NO_CURSOR + Q_PROPERTY( TQCursor cursor READ cursor WRITE setCursor RESET unsetCursor STORED ownCursor ) + Q_PROPERTY( bool ownCursor READ ownCursor ) +#endif +#ifndef QT_NO_WIDGET_TOPEXTRA + Q_PROPERTY( TQString caption READ caption WRITE setCaption ) + Q_PROPERTY( TQPixmap icon READ icon WRITE setIcon ) + Q_PROPERTY( TQString iconText READ iconText WRITE setIconText ) +#endif + Q_PROPERTY( bool mouseTracking READ hasMouseTracking WRITE setMouseTracking ) + Q_PROPERTY( bool underMouse READ hasMouse ) + Q_PROPERTY( bool isActiveWindow READ isActiveWindow ) + Q_PROPERTY( bool focusEnabled READ isFocusEnabled ) + Q_PROPERTY( FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy ) + Q_PROPERTY( bool focus READ hasFocus ) + Q_PROPERTY( bool updatesEnabled READ isUpdatesEnabled WRITE setUpdatesEnabled DESIGNABLE false ) + Q_PROPERTY( bool visible READ isVisible ) + Q_PROPERTY( TQRect visibleRect READ visibleRect ) // obsolete + Q_PROPERTY( bool hidden READ isHidden WRITE setHidden DESIGNABLE false SCRIPTABLE false ) + Q_PROPERTY( bool shown READ isShown WRITE setShown DESIGNABLE false SCRIPTABLE false ) + Q_PROPERTY( bool minimized READ isMinimized ) + Q_PROPERTY( bool maximized READ isMaximized ) + Q_PROPERTY( bool fullScreen READ isFullScreen ) + Q_PROPERTY( TQSize sizeHint READ sizeHint ) + Q_PROPERTY( TQSize minimumSizeHint READ minimumSizeHint ) + Q_PROPERTY( TQRect microFocusHint READ microFocusHint ) + Q_PROPERTY( bool acceptDrops READ acceptDrops WRITE setAcceptDrops ) + Q_PROPERTY( bool autoMask READ autoMask WRITE setAutoMask DESIGNABLE false SCRIPTABLE false ) + Q_PROPERTY( bool customWhatsThis READ customWhatsThis ) + Q_PROPERTY( bool inputMethodEnabled READ isInputMethodEnabled WRITE setInputMethodEnabled DESIGNABLE false SCRIPTABLE false ) + Q_PROPERTY( double windowOpacity READ windowOpacity WRITE setWindowOpacity DESIGNABLE false ) + +public: + Q_EXPLICIT TQWidget( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + ~TQWidget(); + + WId winId() const; + void setName( const char *name ); +#ifndef QT_NO_STYLE + // GUI style setting + + TQStyle &style() const; + void setStyle( TQStyle * ); + TQStyle* setStyle( const TQString& ); +#endif + // Widget types and states + + 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; + +public slots: + virtual void setEnabled( bool ); + void setDisabled( bool ); + + // Widget coordinates + +public: + TQRect frameGeometry() const; + const TQRect &geometry() const; + int x() const; + int y() const; + TQPoint pos() const; + TQSize frameSize() const; + TQSize size() const; + int width() const; + int height() const; + TQRect rect() const; + TQRect childrenRect() const; + TQRegion childrenRegion() const; + + TQSize minimumSize() const; + TQSize maximumSize() const; + int minimumWidth() const; + int minimumHeight() const; + int maximumWidth() const; + int maximumHeight() const; + void setMinimumSize( const TQSize & ); + virtual void setMinimumSize( int minw, int minh ); + void setMaximumSize( const TQSize & ); + virtual void setMaximumSize( int maxw, int maxh ); + void setMinimumWidth( int minw ); + void setMinimumHeight( int minh ); + void setMaximumWidth( int maxw ); + void setMaximumHeight( int maxh ); + + TQSize sizeIncrement() const; + void setSizeIncrement( const TQSize & ); + virtual void setSizeIncrement( int w, int h ); + TQSize baseSize() const; + void setBaseSize( const TQSize & ); + void setBaseSize( int basew, int baseh ); + + void setFixedSize( const TQSize & ); + void setFixedSize( int w, int h ); + void setFixedWidth( int w ); + void setFixedHeight( int h ); + + // Widget coordinate mapping + + 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; + + // Widget attribute functions + + BackgroundMode backgroundMode() const; + virtual void setBackgroundMode( BackgroundMode ); + void setBackgroundMode( BackgroundMode, BackgroundMode ); + + const TQColor & foregroundColor() const; + + const TQColor & eraseColor() const; + virtual void setEraseColor( const TQColor & ); + + const TQPixmap * erasePixmap() const; + virtual void setErasePixmap( const TQPixmap & ); + +#ifndef QT_NO_PALETTE + const TQColorGroup & colorGroup() const; + const TQPalette & palette() const; + bool ownPalette() const; + virtual void setPalette( const TQPalette & ); + void unsetPalette(); +#endif + + 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; + + TQFont font() const; + bool ownFont() const; + virtual void setFont( const TQFont & ); + void unsetFont(); + TQFontMetrics fontMetrics() const; + TQFontInfo fontInfo() const; + +#ifndef QT_NO_CURSOR + const TQCursor &cursor() const; + bool ownCursor() const; + virtual void setCursor( const TQCursor & ); + virtual void unsetCursor(); +#endif +#ifndef QT_NO_WIDGET_TOPEXTRA + TQString caption() const; + const TQPixmap *icon() const; + TQString iconText() const; +#endif + bool hasMouseTracking() const; + bool hasMouse() const; + + virtual void setMask( const TQBitmap & ); + virtual void setMask( const TQRegion & ); + void clearMask(); + + const TQColor & backgroundColor() const; // obsolete, use eraseColor() + virtual void setBackgroundColor( const TQColor & ); // obsolete, use setEraseColor() + const TQPixmap * backgroundPixmap() const; // obsolete, use erasePixmap() + virtual void setBackgroundPixmap( const TQPixmap & ); // obsolete, use setErasePixmap() + +public slots: +#ifndef QT_NO_WIDGET_TOPEXTRA + virtual void setCaption( const TQString &); + virtual void setIcon( const TQPixmap & ); + virtual void setIconText( const TQString &); +#endif + virtual void setMouseTracking( bool enable ); + + // Keyboard input focus functions + + virtual void setFocus(); + void clearFocus(); + +public: + enum FocusPolicy { + NoFocus = 0, + TabFocus = 0x1, + ClickFocus = 0x2, + StrongFocus = TabFocus | ClickFocus | 0x8, + WheelFocus = StrongFocus | 0x4 + }; + + bool isActiveWindow() const; + virtual void setActiveWindow(); + bool isFocusEnabled() const; + + FocusPolicy focusPolicy() const; + virtual void setFocusPolicy( FocusPolicy ); + bool hasFocus() const; + static void setTabOrder( TQWidget *, TQWidget * ); + virtual void setFocusProxy( TQWidget * ); + TQWidget * focusProxy() const; + + void setInputMethodEnabled( bool b ); + bool isInputMethodEnabled() const; + // Grab functions + + void grabMouse(); +#ifndef QT_NO_CURSOR + void grabMouse( const TQCursor & ); +#endif + void releaseMouse(); + void grabKeyboard(); + void releaseKeyboard(); + static TQWidget * mouseGrabber(); + static TQWidget * keyboardGrabber(); + + // Update/refresh functions + + bool isUpdatesEnabled() const; + +#if 0 //def Q_WS_QWS + void repaintUnclipped( const TQRegion &, bool erase = TRUE ); +#endif +public slots: + virtual void setUpdatesEnabled( bool enable ); + void update(); + void update( int x, int y, int w, int h ); + void update( const TQRect& ); + void repaint(); + void repaint( bool erase ); + void repaint( int x, int y, int w, int h, bool erase=TRUE ); + void repaint( const TQRect &, bool erase = TRUE ); + void repaint( const TQRegion &, bool erase = TRUE ); + + // Widget management functions + + virtual void show(); + virtual void hide(); + void setShown( bool show ); + void setHidden( bool hide ); +#ifndef QT_NO_COMPAT + void iconify() { showMinimized(); } +#endif + virtual void showMinimized(); + virtual void showMaximized(); + void showFullScreen(); + virtual void showNormal(); + virtual void polish(); + void constPolish() const; + bool close(); + + void raise(); + void lower(); + void stackUnder( TQWidget* ); + virtual void move( int x, int y ); + void move( const TQPoint & ); + virtual void resize( int w, int h ); + void resize( const TQSize & ); + virtual void setGeometry( int x, int y, int w, int h ); + virtual void setGeometry( const TQRect & ); // ### make non virtual in TQt 4? + +public: + virtual bool close( bool alsoDelete ); + bool isVisible() const; + bool isVisibleTo(TQWidget*) const; + bool isVisibleToTLW() const; // obsolete + TQRect visibleRect() const; // obsolete + bool isHidden() const; + bool isShown() const; + bool isMinimized() const; + bool isMaximized() const; + bool isFullScreen() const; + + uint windowState() const; + void setWindowState(uint windowState); + + virtual TQSize sizeHint() const; + virtual TQSize minimumSizeHint() const; + virtual TQSizePolicy sizePolicy() const; + virtual void setSizePolicy( TQSizePolicy ); + void setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw = FALSE ); + virtual int heightForWidth(int) const; + + TQRegion clipRegion() const; + +// ### move together with other slots in TQt 4.0 +public slots: + virtual void adjustSize(); + +public: +#ifndef QT_NO_LAYOUT + TQLayout * layout() const { return lay_out; } +#endif + void updateGeometry(); + virtual void reparent( TQWidget *parent, WFlags, const TQPoint &, + bool showIt=FALSE ); + void reparent( TQWidget *parent, const TQPoint &, + bool showIt=FALSE ); +#ifndef QT_NO_COMPAT + void recreate( TQWidget *parent, WFlags f, const TQPoint & p, + bool showIt=FALSE ) { reparent(parent,f,p,showIt); } +#endif + + void erase(); + void erase( int x, int y, int w, int h ); + void erase( const TQRect & ); + void erase( const TQRegion & ); + void scroll( int dx, int dy ); + void scroll( int dx, int dy, const TQRect& ); + + void drawText( int x, int y, const TQString &); + void drawText( const TQPoint &, const TQString &); + + // Misc. functions + + TQWidget * focusWidget() const; + TQRect microFocusHint() const; + + // drag and drop + + bool acceptDrops() const; + virtual void setAcceptDrops( bool on ); + + // transparency and pseudo transparency + + virtual void setAutoMask(bool); + bool autoMask() const; + + enum BackgroundOrigin { WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin }; + + virtual void setBackgroundOrigin( BackgroundOrigin ); + BackgroundOrigin backgroundOrigin() const; + TQPoint backgroundOffset() const; + + // whats this help + virtual bool customWhatsThis() const; + + TQWidget * parentWidget( bool sameWindow = FALSE ) const; + WState testWState( WState s ) const; + WFlags testWFlags( WFlags f ) const; + NFlags testNFlags( NFlags f ) const; + static TQWidget * find( WId ); + static TQWidgetMapper *wmapper(); + + TQWidget *childAt( int x, int y, bool includeThis = FALSE ) const; + TQWidget *childAt( const TQPoint &, bool includeThis = FALSE ) const; + +#if defined(Q_WS_QWS) + virtual TQGfx * graphicsContext(bool clip_children=TRUE) const; +#endif +#if defined(Q_WS_MAC) + TQRegion clippedRegion(bool do_children=TRUE); + uint clippedSerial(bool do_children=TRUE); +#ifndef TQMAC_NO_QUARTZ + CGContextRef macCGContext(bool clipped=TRUE) const; +#endif +#endif +#if defined(Q_WS_X11) + enum X11WindowType { + X11WindowTypeSelect, + X11WindowTypeCombo, + X11WindowTypeDND, + X11WindowTypeTooltip, + X11WindowTypeMenu, // torn-off + X11WindowTypeDropdown, + X11WindowTypePopup + }; + void x11SetWindowType( X11WindowType type = X11WindowTypeSelect ); + void x11SetWindowTransient( TQWidget* parent ); +#endif + void setWindowOpacity(double level); + double windowOpacity() const; + +protected: + // Event handlers + bool event( TQEvent * ); + virtual void mousePressEvent( TQMouseEvent * ); + virtual void mouseReleaseEvent( TQMouseEvent * ); + virtual void mouseDoubleClickEvent( TQMouseEvent * ); + virtual void mouseMoveEvent( TQMouseEvent * ); +#ifndef QT_NO_WHEELEVENT + virtual void wheelEvent( TQWheelEvent * ); +#endif + 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 * ); + +#ifndef QT_NO_DRAGANDDROP + virtual void dragEnterEvent( TQDragEnterEvent * ); + virtual void dragMoveEvent( TQDragMoveEvent * ); + virtual void dragLeaveEvent( TQDragLeaveEvent * ); + virtual void dropEvent( TQDropEvent * ); +#endif + + virtual void showEvent( TQShowEvent * ); + virtual void hideEvent( TQHideEvent * ); + +#if defined(Q_WS_MAC) + virtual bool macEvent( MSG * ); +#endif +#if defined(Q_WS_WIN) + virtual bool winEvent( MSG * ); +#endif +#if defined(Q_WS_X11) + virtual bool x11Event( XEvent * ); +#endif +#if defined(Q_WS_QWS) + virtual bool qwsEvent( TQWSEvent * ); + virtual unsigned char *scanLine( int ) const; + virtual int bytesPerLine() const; +#endif + + virtual void updateMask(); + + // Misc. protected functions + +#ifndef QT_NO_STYLE + virtual void styleChange( TQStyle& ); +#endif + virtual void enabledChange( bool oldEnabled ); +#ifndef QT_NO_PALETTE + virtual void paletteChange( const TQPalette & ); +#endif + virtual void fontChange( const TQFont & ); + virtual void windowActivationChange( bool oldActive ); + + int metric( int ) const; + +#if defined(Q_WS_X11) +#if !defined(QT_NO_IM_EXTENSIONS) + virtual TQWidget *icHolderWidget(); +#else + TQWidget *icHolderWidget(); +#endif + TQInputContext *getInputContext(); + void changeInputContext( const TQString & ); + void sendMouseEventToInputContext( int x, TQEvent::Type type, + TQt::ButtonState button, + TQt::ButtonState state ); +#endif + void resetInputContext(); + + virtual void create( WId = 0, bool initializeWindow = TRUE, + bool destroyOldWindow = TRUE ); + virtual void destroy( bool destroyWindow = TRUE, + bool destroySubWindows = TRUE ); + uint getWState() const; + virtual void setWState( uint ); + void clearWState( uint n ); + WFlags getWFlags() const; + virtual void setWFlags( WFlags ); + void clearWFlags( WFlags n ); + NFlags getNFlags() const; + virtual void setNFlags( NFlags ); + void clearNFlags( NFlags n ); + + virtual bool focusNextPrevChild( bool next ); + + TQWExtra *extraData(); + TQTLWExtra *topData(); + TQFocusData *focusData(); + + virtual void setKeyCompression(bool); + virtual void setMicroFocusHint(int x, int y, int w, int h, bool text=TRUE, TQFont *f = 0); + +#if defined(Q_WS_MAC) + void dirtyClippedRegion(bool); + bool isClippedRegionDirty(); + virtual void setRegionDirty(bool); + virtual void macWidgetChangedWindow(); +#endif + +private slots: + void focusProxyDestroyed(); +#if defined(Q_WS_X11) + void destroyInputContext(); +#endif + +private: + void setFontSys( TQFont *f = 0 ); +#if defined(Q_WS_X11) + void createInputContext(); + void focusInputContext(); + void unfocusInputContext(); + void checkChildrenDnd(); + +#ifndef QT_NO_XSYNC + void createSyncCounter(); + void destroySyncCounter(); + void incrementSyncCounter(); + void handleSyncRequest( void* ev ); +#endif + +#elif defined(Q_WS_MAC) + uint own_id : 1, macDropEnabled : 1; + EventHandlerRef window_event; + //mac event functions + void propagateUpdates(bool update_rgn=TRUE); + void update( const TQRegion& ); + //friends, way too many - fix this immediately! + friend void qt_clean_root_win(); + friend bool qt_recreate_root_win(); + friend TQPoint posInWindow(TQWidget *); + friend bool qt_mac_update_sizer(TQWidget *, int); + friend TQWidget *qt_recursive_match(TQWidget *widg, int x, int y); + friend bool qt_paint_children(TQWidget *,TQRegion &, uchar ops); + friend TQMAC_PASCAL OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); + friend void qt_event_request_updates(TQWidget *, const TQRegion &, bool subtract); + friend bool qt_window_rgn(WId, short, RgnHandle, bool); + friend class TQDragManager; +#endif + +#ifndef QT_NO_LAYOUT + void setLayout( TQLayout *l ); +#endif + void setWinId( WId ); + void showWindow(); + void hideWindow(); + void showChildren( bool spontaneous ); + void hideChildren( bool spontaneous ); + void reparentSys( TQWidget *parent, WFlags, const TQPoint &, bool showIt); + void createTLExtra(); + void createExtra(); + void deleteExtra(); + void createSysExtra(); + void deleteSysExtra(); + void createTLSysExtra(); + void deleteTLSysExtra(); + void deactivateWidgetCleanup(); + void internalSetGeometry( int, int, int, int, bool ); + void reparentFocusWidgets( TQWidget * ); + TQFocusData *focusData( bool create ); + void setBackgroundFromMode(); + void setBackgroundColorDirect( const TQColor & ); + void setBackgroundPixmapDirect( const TQPixmap & ); + void setBackgroundModeDirect( BackgroundMode ); + void setBackgroundEmpty(); + void updateFrameStrut() const; +#if defined(Q_WS_X11) + void setBackgroundX11Relative(); +#endif + + WId winid; + uint widget_state; + uint widget_flags; + uint netwm_flags; + uint reserved_1; + uint reserved_2; + uint reserved_3; + uint reserved_4; + uint focus_policy : 4; + uint own_font :1; + uint own_palette :1; + uint sizehint_forced :1; + uint is_closing :1; + uint in_show : 1; + uint in_show_maximized : 1; + uint fstrut_dirty : 1; + uint im_enabled : 1; + TQRect crect; + TQColor bg_col; +#ifndef QT_NO_PALETTE + TQPalette pal; +#endif + TQFont fnt; +#ifndef QT_NO_LAYOUT + TQLayout *lay_out; +#endif +#if defined(Q_WS_X11) && !defined(QT_NO_IM) && !defined(QT_NO_IM_EXTENSIONS) + TQInputContext *ic; // Input Context +#endif + TQWExtra *extra; +#if defined(Q_WS_QWS) + TQRegion req_region; // Requested region + mutable TQRegion paintable_region; // Paintable region + mutable bool paintable_region_dirty;// needs to be recalculated + mutable TQRegion alloc_region; // Allocated region + mutable bool alloc_region_dirty; // needs to be recalculated + mutable int overlapping_children; // Handle overlapping children + + int alloc_region_index; + int alloc_region_revision; + + void updateOverlappingChildren() const; + void setChildrenAllocatedDirty(); + void setChildrenAllocatedDirty( const TQRegion &r, const TQWidget *dirty=0 ); + bool isAllocatedRegionDirty() const; + void updateRequestedRegion( const TQPoint &gpos ); + TQRegion requestedRegion() const; + TQRegion allocatedRegion() const; + TQRegion paintableRegion() const; + + void updateGraphicsContext( TQGfx *qgfx_qws, bool clip_children ) const; +#ifndef QT_NO_CURSOR + void updateCursor( const TQRegion &r ) const; +#endif + + // used to accumulate dirty region when children moved/resized. + TQRegion dirtyChildren; + bool isSettingGeometry; + friend class TQWSManager; +#endif + static int instanceCounter; // Current number of widget instances + static int maxInstances; // Maximum number of widget instances + + static void createMapper(); + static void destroyMapper(); + static TQWidgetList *wList(); + static TQWidgetList *tlwList(); + static TQWidgetMapper *mapper; + friend class TQApplication; + friend class TQBaseApplication; + friend class TQPainter; + friend class TQFontMetrics; + friend class TQFontInfo; + friend class TQETWidget; + friend class TQLayout; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQWidget( const TQWidget & ); + TQWidget &operator=( const TQWidget & ); +#endif + +public: // obsolete functions to dissappear or to become inline in 3.0 +#ifndef QT_NO_PALETTE + void setPalette( const TQPalette &p, bool ) { setPalette( p ); } +#endif + void setFont( const TQFont &f, bool ) { setFont( f ); } +}; + + +inline TQt::WState TQWidget::testWState( WState s ) const +{ return (widget_state & s); } + +inline TQt::WFlags TQWidget::testWFlags( WFlags f ) const +{ return (widget_flags & f); } + +inline TQt::NFlags TQWidget::testNFlags( NFlags f ) const +{ return (netwm_flags & f); } + +inline WId TQWidget::winId() const +{ return winid; } + +inline bool TQWidget::isTopLevel() const +{ return testWFlags(WType_TopLevel); } + +inline bool TQWidget::isDialog() const +{ return testWFlags(WType_Dialog); } + +inline bool TQWidget::isPopup() const +{ return testWFlags(WType_Popup); } + +inline bool TQWidget::isDesktop() const +{ return testWFlags(WType_Desktop); } + +inline bool TQWidget::isEnabled() const +{ return !testWState(WState_Disabled); } + +inline bool TQWidget::isModal() const +{ return testWFlags(WShowModal); } + +inline bool TQWidget::isEnabledToTLW() const +{ return isEnabled(); } + +inline const TQRect &TQWidget::geometry() const +{ return crect; } + +inline TQSize TQWidget::size() const +{ return crect.size(); } + +inline int TQWidget::width() const +{ return crect.width(); } + +inline int TQWidget::height() const +{ return crect.height(); } + +inline TQRect TQWidget::rect() const +{ return TQRect(0,0,crect.width(),crect.height()); } + +inline int TQWidget::minimumWidth() const +{ return minimumSize().width(); } + +inline int TQWidget::minimumHeight() const +{ return minimumSize().height(); } + +inline int TQWidget::maximumWidth() const +{ return maximumSize().width(); } + +inline int TQWidget::maximumHeight() const +{ return maximumSize().height(); } + +inline void TQWidget::setMinimumSize( const TQSize &s ) +{ setMinimumSize(s.width(),s.height()); } + +inline void TQWidget::setMaximumSize( const TQSize &s ) +{ setMaximumSize(s.width(),s.height()); } + +inline void TQWidget::setSizeIncrement( const TQSize &s ) +{ setSizeIncrement(s.width(),s.height()); } + +inline void TQWidget::setBaseSize( const TQSize &s ) +{ setBaseSize(s.width(),s.height()); } + +inline const TQColor &TQWidget::eraseColor() const +{ return bg_col; } + +#ifndef QT_NO_PALETTE +inline const TQPalette &TQWidget::palette() const +{ return pal; } +#endif + +inline TQFont TQWidget::font() const +{ return fnt; } + +inline TQFontMetrics TQWidget::fontMetrics() const +{ return TQFontMetrics(font()); } + +inline TQFontInfo TQWidget::fontInfo() const +{ return TQFontInfo(font()); } + +inline bool TQWidget::hasMouseTracking() const +{ return testWState(WState_MouseTracking); } + +inline bool TQWidget::hasMouse() const +{ return testWState(WState_HasMouse); } + +inline bool TQWidget::isFocusEnabled() const +{ return (FocusPolicy)focus_policy != NoFocus; } + +inline TQWidget::FocusPolicy TQWidget::focusPolicy() const +{ return (FocusPolicy)focus_policy; } + +inline bool TQWidget::isUpdatesEnabled() const +{ return !testWState(WState_BlockUpdates); } + +inline void TQWidget::update( const TQRect &r ) +{ update( r.x(), r.y(), r.width(), r.height() ); } + +inline void TQWidget::repaint() +{ repaint( TRUE ); } + +inline void TQWidget::repaint( const TQRect &r, bool erase ) +{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); } + +inline void TQWidget::erase() +{ erase( 0, 0, crect.width(), crect.height() ); } + +inline void TQWidget::erase( const TQRect &r ) +{ erase( r.x(), r.y(), r.width(), r.height() ); } + +inline bool TQWidget::close() +{ return close( FALSE ); } + +inline bool TQWidget::isVisible() const +{ return testWState(WState_Visible); } + +inline bool TQWidget::isVisibleToTLW() const // obsolete +{ return isVisible(); } + +inline bool TQWidget::isHidden() const +{ return testWState(WState_ForceHide); } + +inline bool TQWidget::isShown() const +{ return !testWState(WState_ForceHide); } + +inline void TQWidget::move( const TQPoint &p ) +{ move( p.x(), p.y() ); } + +inline void TQWidget::resize( const TQSize &s ) +{ resize( s.width(), s.height()); } + +inline void TQWidget::setGeometry( const TQRect &r ) +{ setGeometry( r.left(), r.top(), r.width(), r.height() ); } + +inline void TQWidget::drawText( const TQPoint &p, const TQString &s ) +{ drawText( p.x(), p.y(), s ); } + +inline TQWidget *TQWidget::parentWidget( bool sameWindow ) const +{ + if ( sameWindow ) + return isTopLevel() ? 0 : (TQWidget *)TQObject::parent(); + return (TQWidget *)TQObject::parent(); +} + +inline TQWidgetMapper *TQWidget::wmapper() +{ return mapper; } + +inline uint TQWidget::getWState() const +{ return widget_state; } + +inline void TQWidget::setWState( uint f ) +{ widget_state |= f; } + +inline void TQWidget::clearWState( uint f ) +{ widget_state &= ~f; } + +inline TQt::WFlags TQWidget::getWFlags() const +{ return widget_flags; } + +inline TQt::NFlags TQWidget::getNFlags() const +{ return netwm_flags; } + +inline void TQWidget::setWFlags( WFlags f ) +{ widget_flags |= f; } + +inline void TQWidget::setNFlags( NFlags f ) +{ netwm_flags |= f; } + +inline void TQWidget::clearWFlags( WFlags f ) +{ widget_flags &= ~f; } + +inline void TQWidget::clearNFlags( NFlags f ) +{ netwm_flags &= ~f; } + +inline void TQWidget::constPolish() const +{ + if ( !testWState(WState_Polished) ) { + TQWidget* that = (TQWidget*) this; + that->polish(); + that->setWState(WState_Polished); // be on the safe side... + } +} +#ifndef QT_NO_CURSOR +inline bool TQWidget::ownCursor() const +{ + return testWState( WState_OwnCursor ); +} +#endif +inline bool TQWidget::ownFont() const +{ + return own_font; +} +#ifndef QT_NO_PALETTE +inline bool TQWidget::ownPalette() const +{ + return own_palette; +} +#endif + +inline void TQWidget::setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw ) +{ + setSizePolicy( TQSizePolicy( hor, ver, hfw) ); +} + +inline bool TQWidget::isInputMethodEnabled() const +{ + return (bool)im_enabled; +} + +// Extra TQWidget data +// - to minimize memory usage for members that are seldom used. +// - top-level widgets have extra extra data to reduce cost further + +class TQFocusData; +class TQWSManager; +#if defined(Q_WS_WIN) +class TQOleDropTarget; +#endif +#if defined(Q_WS_MAC) +class TQMacDndExtra; +#endif + +struct Q_EXPORT TQTLWExtra { +#ifndef QT_NO_WIDGET_TOPEXTRA + TQString caption; // widget caption + TQString iconText; // widget icon text + TQPixmap *icon; // widget icon +#endif + TQFocusData *focusData; // focus data (for TLW) + short incw, inch; // size increments + // frame strut + ulong fleft, fright, ftop, fbottom; + uint unused : 8; // not used at this point... +#if defined( Q_WS_WIN ) || defined( Q_WS_MAC ) + uint opacity : 8; // Stores opacity level on Windows/Mac OS X. +#endif + uint savedFlags; // Save widgetflags while showing fullscreen + short basew, baseh; // base sizes +#if defined(Q_WS_X11) + WId parentWinId; // parent window Id (valid after reparenting) + uint embedded : 1; // window is embedded in another TQt application + uint spont_unmapped: 1; // window was spontaneously unmapped + uint reserved: 1; // reserved + uint dnd : 1; // DND properties installed + uint uspos : 1; // User defined position + uint ussize : 1; // User defined size +#if defined(QT_NO_IM_EXTENSIONS) + void *xic; // Input Context +#endif +#ifndef QT_NO_XSYNC + ulong syncCounter; + uint syncRequestValue[2]; +#endif +#endif +#if defined(Q_WS_MAC) + WindowGroupRef group; + uint is_moved: 1; + uint resizer : 4; +#endif +#if defined(Q_WS_QWS) && !defined ( QT_NO_QWS_MANAGER ) + TQRegion decor_allocated_region; // decoration allocated region + TQWSManager *qwsManager; +#endif +#if defined(Q_WS_WIN) + HICON winIcon; // internal Windows icon +#endif + TQRect normalGeometry; // used by showMin/maximized/FullScreen +#ifdef Q_WS_WIN + uint style, exstyle; +#endif +}; + + +#define TQWIDGETSIZE_MAX 32767 + +// dear user: you can see this struct, but it is internal. do not touch. + +struct Q_EXPORT TQWExtra { + Q_INT16 minw, minh; // minimum size + Q_INT16 maxw, maxh; // maximum size + TQPixmap *bg_pix; // background pixmap + TQWidget *focus_proxy; +#ifndef QT_NO_CURSOR + TQCursor *curs; +#endif + TQTLWExtra *topextra; // only useful for TLWs +#if defined(Q_WS_WIN) + TQOleDropTarget *dropTarget; // drop target +#endif +#if defined(Q_WS_X11) + WId xDndProxy; // XDND forwarding to embedded windows +#endif +#if defined(Q_WS_MAC) + TQRegion clip_saved, clip_sibs, clip_children; + TQMacDndExtra *macDndExtra; + TQRegion dirty_area; + uint clip_dirty : 1, clip_serial : 15; + uint child_dirty : 1, child_serial : 15; +#ifndef TQMAC_NO_QUARTZ + uint ctx_children_clipped:1; +#endif // TQMAC_NO_QUARTZ + uint has_dirty_area:1; +#endif // Q_WS_MAC + uint bg_origin : 2; +#if defined(Q_WS_X11) + uint children_use_dnd : 1; + uint compress_events : 1; +#endif +#if defined(Q_WS_QWS) || defined(Q_WS_MAC) + TQRegion mask; // widget mask +#endif + char bg_mode; // background mode + char bg_mode_visual; // visual background mode +#ifndef QT_NO_STYLE + TQStyle* style; +#endif + TQRect micro_focus_hint; // micro focus hint + TQSizePolicy size_policy; +}; + +#define Q_DEFINED_QWIDGET +#include "ntqwinexport.h" + +#endif // TQWIDGET_H diff --git a/src/kernel/ntqwidgetintdict.h b/src/kernel/ntqwidgetintdict.h new file mode 100644 index 000000000..512f7830e --- /dev/null +++ b/src/kernel/ntqwidgetintdict.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Definition of TQWidgetIntDict +** +** Created : 950116 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWIDGETINTDICT_H +#define TQWIDGETINTDICT_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqintdict.h" +#endif // QT_H + + +#if defined(Q_TEMPLATEDLL) +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDict; +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDictIterator; +#endif + + +class Q_EXPORT TQWidgetIntDict : public TQIntDict +{ +public: + TQWidgetIntDict(int size=17) : TQIntDict(size) {} + TQWidgetIntDict( const TQWidgetIntDict &dict ) : TQIntDict(dict) {} + ~TQWidgetIntDict() { clear(); } + TQWidgetIntDict &operator=(const TQWidgetIntDict &dict) + { return (TQWidgetIntDict&)TQIntDict::operator=(dict); } +}; + +class Q_EXPORT TQWidgetIntDictIt : public TQIntDictIterator +{ +public: + TQWidgetIntDictIt( const TQWidgetIntDict &d ) : TQIntDictIterator(d) {} + TQWidgetIntDictIt &operator=(const TQWidgetIntDictIt &i) + { return (TQWidgetIntDictIt&)TQIntDictIterator::operator=(i); } +}; + + +#endif diff --git a/src/kernel/ntqwidgetlist.h b/src/kernel/ntqwidgetlist.h new file mode 100644 index 000000000..03e40b7cf --- /dev/null +++ b/src/kernel/ntqwidgetlist.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Definition of TQWidgetList +** +** Created : 950116 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWIDGETLIST_H +#define TQWIDGETLIST_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqptrlist.h" +#endif // QT_H + +class Q_EXPORT TQWidgetList : public TQPtrList +{ +public: + TQWidgetList() : TQPtrList() {} + TQWidgetList( const TQWidgetList &list ) : TQPtrList(list) {} + ~TQWidgetList() { clear(); } + TQWidgetList &operator=(const TQWidgetList &list) + { return (TQWidgetList&)TQPtrList::operator=(list); } +}; + +class Q_EXPORT TQWidgetListIt : public TQPtrListIterator +{ +public: + TQWidgetListIt( const TQWidgetList &l ) : TQPtrListIterator(l) {} + TQWidgetListIt &operator=(const TQWidgetListIt &i) + { return (TQWidgetListIt&)TQPtrListIterator::operator=(i); } +}; + +#endif // TQWIDGETLIST_H diff --git a/src/kernel/ntqwindowdefs.h b/src/kernel/ntqwindowdefs.h new file mode 100644 index 000000000..bbc317570 --- /dev/null +++ b/src/kernel/ntqwindowdefs.h @@ -0,0 +1,197 @@ +/**************************************************************************** +** +** Definition of general window system dependent functions, types and +** constants +** +** Created : 931029 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWINDOWDEFS_H +#define TQWINDOWDEFS_H + +#ifndef QT_H +#include "ntqobjectdefs.h" +#include "ntqstring.h" +#include "ntqnamespace.h" +#endif // QT_H + +// Class forward definitions + +class TQPaintDevice; +class TQPaintDeviceMetrics; +class TQWidget; +class TQWidgetMapper; +class TQDialog; +class TQColor; +class TQColorGroup; +class TQPalette; +class TQCursor; +class TQPoint; +class TQSize; +class TQRect; +class TQPointArray; +class TQPainter; +class TQRegion; +class TQFont; +class TQFontMetrics; +class TQFontInfo; +class TQPen; +class TQBrush; +class TQWMatrix; +class TQPixmap; +class TQBitmap; +class TQMovie; +class TQImage; +class TQImageIO; +class TQPicture; +class TQPrinter; +class TQAccel; +class TQTimer; +class TQTime; +class TQClipboard; + + +// Widget list (defined in ntqwidgetlist.h) + +class TQWidgetList; +class TQWidgetListIt; + + +// Window system dependent definitions + +#if defined(Q_WS_MAC) +#if QT_MACOSX_VERSION < 0x1020 +typedef struct OpaqueEventLoopTimerRef* EventLoopTimerRef; +typedef struct OpaqueMenuHandle *MenuRef; +#else +typedef struct __EventLoopTimer* EventLoopTimerRef; +typedef struct OpaqueMenuRef* MenuRef; +#endif + +#ifndef Q_WS_MACX +typedef struct CGContext *CGContextRef; +#endif +typedef struct OpaqueWindowGroupRef *WindowGroupRef; +typedef struct OpaqueGrafPtr *CGrafPtr; +typedef struct OpaquePMPrintSession *PMPrintSession; +typedef struct OpaquePMPrintSettings *PMPrintSettings; +typedef struct OpaquePMPageFormat *PMPageFormat; +typedef struct Point Point; +typedef struct OpaqueEventHandlerRef* EventHandlerRef; +typedef struct OpaqueEventHandlerCallRef* EventHandlerCallRef; +typedef struct OpaqueEventRef* EventRef; +typedef long int OSStatus; +typedef struct OpaqueScrapRef *ScrapRef; +typedef struct OpaqueRgnHandle *RgnHandle; +typedef struct OpaqueWindowPtr *WindowPtr; +typedef WindowPtr WindowRef; +typedef struct OpaqueGrafPtr *GWorldPtr; +typedef GWorldPtr GrafPtr; +typedef struct GDevice **GDHandle; +typedef struct ColorTable ColorTable; +typedef struct BitMap BitMap; +typedef struct EventRecord EventRecord; +typedef void * MSG; +typedef int WId; +typedef struct AEDesc AppleEvent; + +#endif // Q_WS_MAC + +#if defined(Q_WS_WIN) +#include "qwindowdefs_win.h" +#endif // Q_WS_WIN + + +#if defined(Q_OS_TEMP) +#include "qwinfunctions_wce.h" +#endif // Q_OS_TEMP + +#if defined(Q_WS_X11) + +typedef struct _XDisplay Display; +typedef union _XEvent XEvent; +typedef struct _XGC *GC; +typedef struct _XRegion *Region; +typedef unsigned long WId; + +Q_EXPORT Display *qt_xdisplay(); +Q_EXPORT int qt_xscreen(); +Q_EXPORT WId qt_xrootwin(); // ### REMOVE 4.0 +Q_EXPORT WId qt_xrootwin( int scrn ); // ### 4.0 add default arg of -1 +Q_EXPORT GC qt_xget_readonly_gc( int scrn, bool monochrome ); +Q_EXPORT GC qt_xget_temp_gc( int scrn, bool monochrome ); + +Q_EXPORT const char *qAppClass(); // get application class + +#endif // Q_WS_X11 + +#if defined(Q_WS_QWS) + +typedef unsigned long WId; +struct TQWSEvent; +class TQGfx; + +#endif // Q_WS_QWS + +class TQApplication; + +#if defined(NEEDS_QMAIN) +#define main qMain +#endif + +// Global platform-independent types and functions + +typedef Q_INT32 TQCOORD; // coordinate type +const TQCOORD TQCOORD_MAX = 2147483647; +const TQCOORD TQCOORD_MIN = -TQCOORD_MAX - 1; + +typedef unsigned int TQRgb; // RGB triplet + +Q_EXPORT const char *qAppName(); // get application name + +// Misc functions + +typedef void (*TQtCleanUpFunction)(); +Q_EXPORT void qAddPostRoutine( TQtCleanUpFunction ); +Q_EXPORT void qRemovePostRoutine( TQtCleanUpFunction ); + +#if !defined(QT_CLEAN_NAMESPACE) +// source compatibility with TQt 2.x +typedef TQtCleanUpFunction Q_CleanUpFunction; +#endif + + +#endif // TQWINDOWDEFS_H diff --git a/src/kernel/ntqwmatrix.h b/src/kernel/ntqwmatrix.h new file mode 100644 index 000000000..bb3042f3d --- /dev/null +++ b/src/kernel/ntqwmatrix.h @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Definition of TQWMatrix class +** +** Created : 941020 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWMATRIX_H +#define TQWMATRIX_H + +#ifndef QT_H +#include "ntqwindowdefs.h" +#include "ntqpointarray.h" +#include "ntqrect.h" +#include "ntqregion.h" +#endif // QT_H + +#ifndef QT_NO_WMATRIX + + +class Q_EXPORT TQWMatrix // 2D transform matrix +{ +public: + TQWMatrix(); + TQWMatrix( double m11, double m12, double m21, double m22, + double dx, double dy ); + + void setMatrix( double m11, double m12, double m21, double m22, + double dx, double dy ); + + double m11() const { return _m11; } + double m12() const { return _m12; } + double m21() const { return _m21; } + double m22() const { return _m22; } + double dx() const { return _dx; } + double dy() const { return _dy; } + + void map( int x, int y, int *tx, int *ty ) const; + void map( double x, double y, double *tx, double *ty ) const; + TQRect mapRect( const TQRect & ) const; + + TQPoint map( const TQPoint &p ) const { return operator *( p ); } + TQRect map( const TQRect &r ) const { return mapRect ( r ); } + TQPointArray map( const TQPointArray &a ) const { return operator * ( a ); } + TQRegion map( const TQRegion &r ) const { return operator *( r ); } + TQRegion mapToRegion( const TQRect &r ) const { return operator *( r ); } + TQPointArray mapToPolygon( const TQRect &r ) const; + + void reset(); + bool isIdentity() const; + + TQWMatrix &translate( double dx, double dy ); + TQWMatrix &scale( double sx, double sy ); + TQWMatrix &shear( double sh, double sv ); + TQWMatrix &rotate( double a ); + + bool isInvertible() const { return (_m11*_m22 - _m12*_m21) != 0; } + double det() const { return _m11*_m22 - _m12*_m21; } + + TQWMatrix invert( bool * = 0 ) const; + + bool operator==( const TQWMatrix & ) const; + bool operator!=( const TQWMatrix & ) const; + TQWMatrix &operator*=( const TQWMatrix & ); + + /* we use matrix multiplication semantics here */ + TQPoint operator * (const TQPoint & ) const; + TQRegion operator * (const TQRect & ) const; + TQRegion operator * (const TQRegion & ) const; + TQPointArray operator * ( const TQPointArray &a ) const; + + enum TransformationMode { + Points, Areas + }; + static void setTransformationMode( TQWMatrix::TransformationMode m ); + static TransformationMode transformationMode(); +private: + double _m11, _m12; + double _m21, _m22; + double _dx, _dy; +}; + +Q_EXPORT TQWMatrix operator*( const TQWMatrix &, const TQWMatrix & ); + + +/***************************************************************************** + TQWMatrix stream functions + *****************************************************************************/ + +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQWMatrix & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQWMatrix & ); + + +#endif // QT_NO_WMATRIX + +#endif // TQWMATRIX_H diff --git a/src/kernel/q1xcompatibility.h b/src/kernel/q1xcompatibility.h deleted file mode 100644 index 8ace504b5..000000000 --- a/src/kernel/q1xcompatibility.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Various macros etc. to ease porting from TQt 1.x to 2.0. THIS FILE -** WILL CHANGE OR DISAPPEAR IN THE NEXT VERSION OF TQt. -** -** Created : 980824 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef Q1XCOMPATIBILITY_H -#define Q1XCOMPATIBILITY_H - -#error "Compatibility with TQt 1.x is no longer guaranteed. Please" -#error "update your code (for example using qt20fix script). We" -#error "apologize for any inconvenience." - -#endif // Q1XCOMPATIBILITY_H diff --git a/src/kernel/qabstractlayout.cpp b/src/kernel/qabstractlayout.cpp index 2292a4e7c..bf1851991 100644 --- a/src/kernel/qabstractlayout.cpp +++ b/src/kernel/qabstractlayout.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qlayout.h" +#include "ntqlayout.h" #ifndef QT_NO_LAYOUT -#include "qapplication.h" +#include "ntqapplication.h" #include "qlayoutengine_p.h" -#include "qmenubar.h" -#include "qtoolbar.h" +#include "ntqmenubar.h" +#include "ntqtoolbar.h" static int menuBarHeightForWidth( TQMenuBar *menubar, int w ) { diff --git a/src/kernel/qabstractlayout.h b/src/kernel/qabstractlayout.h deleted file mode 100644 index b42133628..000000000 --- a/src/kernel/qabstractlayout.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Definition of layout classes -** -** Created : 960416 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQABSTRACTLAYOUT_H -#define TQABSTRACTLAYOUT_H - -/* - This header is provided for source compatibility only. -*/ - -#ifndef QT_H -#ifndef QT_NO_COMPAT -#include "qlayout.h" -#endif -#endif // QT_H - -#endif diff --git a/src/kernel/qaccel.cpp b/src/kernel/qaccel.cpp index 8bedd90cf..019dd8369 100644 --- a/src/kernel/qaccel.cpp +++ b/src/kernel/qaccel.cpp @@ -38,21 +38,21 @@ ** **********************************************************************/ -#include "qaccel.h" +#include "ntqaccel.h" #ifndef QT_NO_ACCEL -#include "qsignal.h" -#include "qapplication.h" -#include "qwidget.h" -#include "qptrlist.h" -#include "qwhatsthis.h" -#include "qguardedptr.h" -#include "qstatusbar.h" -#include "qdockwindow.h" -#include "qsignalslotimp.h" +#include "ntqsignal.h" +#include "ntqapplication.h" +#include "ntqwidget.h" +#include "ntqptrlist.h" +#include "ntqwhatsthis.h" +#include "ntqguardedptr.h" +#include "ntqstatusbar.h" +#include "ntqdockwindow.h" +#include "ntqsignalslotimp.h" /*! - \class TQAccel qaccel.h + \class TQAccel ntqaccel.h \brief The TQAccel class handles keyboard accelerator and shortcut keys. \ingroup misc @@ -85,7 +85,7 @@ combined with modifiers (\c SHIFT, \c CTRL, \c ALT or \c UNICODE_ACCEL). For example, \c{CTRL + Key_P} could be a shortcut for printing a document. The key codes are listed in \c - qnamespace.h. As an alternative, use \c UNICODE_ACCEL with the + ntqnamespace.h. As an alternative, use \c UNICODE_ACCEL with the unicode code point of the character. For example, \c{UNICODE_ACCEL + 'A'} gives the same accelerator as \c Key_A. diff --git a/src/kernel/qaccel.h b/src/kernel/qaccel.h deleted file mode 100644 index 79bafe636..000000000 --- a/src/kernel/qaccel.h +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Definition of TQAccel class -** -** Created : 950419 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQACCEL_H -#define TQACCEL_H - -#ifndef QT_H -#include "qobject.h" -#include "qkeysequence.h" -#endif // QT_H - -#ifndef QT_NO_ACCEL - -class TQAccelPrivate; - -class Q_EXPORT TQAccel : public TQObject // accelerator class -{ - Q_OBJECT -public: - TQAccel( TQWidget *parent, const char *name=0 ); - TQAccel( TQWidget* watch, TQObject *parent, const char *name=0 ); - ~TQAccel(); - - bool isEnabled() const; - void setEnabled( bool ); - - uint count() const; - - int insertItem( const TQKeySequence& key, int id=-1); - void removeItem( int id ); - void clear(); - - TQKeySequence key( int id ); - int findKey( const TQKeySequence& key ) const; - - bool isItemEnabled( int id ) const; - void setItemEnabled( int id, bool enable ); - - bool connectItem( int id, const TQObject *receiver, const char* member ); - bool disconnectItem( int id, const TQObject *receiver, const char* member ); - - void repairEventFilter(); - - void setWhatsThis( int id, const TQString& ); - TQString whatsThis( int id ) const; - void setIgnoreWhatsThis( bool ); - bool ignoreWhatsThis() const; - - static TQKeySequence shortcutKey( const TQString & ); - static TQString keyToString(TQKeySequence k ); - static TQKeySequence stringToKey( const TQString & ); - -signals: - void activated( int id ); - void activatedAmbiguously( int id ); - -protected: - bool eventFilter( TQObject *, TQEvent * ); - -private: - TQAccelPrivate * d; - -private: -#if defined(Q_DISABLE_COPY) - TQAccel( const TQAccel & ); - TQAccel &operator=( const TQAccel & ); -#endif - friend class TQAccelPrivate; - friend class TQAccelManager; -}; - -#endif // QT_NO_ACCEL -#endif // TQACCEL_H diff --git a/src/kernel/qaccessible.cpp b/src/kernel/qaccessible.cpp index 346838785..e89cf2c04 100644 --- a/src/kernel/qaccessible.cpp +++ b/src/kernel/qaccessible.cpp @@ -36,18 +36,18 @@ ** **********************************************************************/ -#include "qaccessible.h" +#include "ntqaccessible.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qptrdict.h" -#include "qmetaobject.h" +#include "ntqptrdict.h" +#include "ntqmetaobject.h" #include -#include "qapplication.h" +#include "ntqapplication.h" #include /*! - \class TQAccessible qaccessible.h + \class TQAccessible ntqaccessible.h \brief The TQAccessible class provides enums and static functions relating to accessibility. @@ -422,7 +422,7 @@ bool TQAccessible::isActive() } /*! - \class TQAccessibleInterface qaccessible.h + \class TQAccessibleInterface ntqaccessible.h \brief The TQAccessibleInterface class defines an interface that exposes information about accessible objects. \ingroup misc @@ -633,7 +633,7 @@ bool TQAccessible::isActive() /*! - \class TQAccessibleObject qaccessible.h + \class TQAccessibleObject ntqaccessible.h \brief The TQAccessibleObject class implements parts of the TQAccessibleInterface for TQObjects. diff --git a/src/kernel/qaccessible.h b/src/kernel/qaccessible.h deleted file mode 100644 index 7109367f9..000000000 --- a/src/kernel/qaccessible.h +++ /dev/null @@ -1,295 +0,0 @@ -/**************************************************************************** -** -** Definition of TQAccessible and TQAccessibleObject classes -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQACCESSIBLE_H -#define TQACCESSIBLE_H - -#ifndef QT_H -#include "qobject.h" -#include -#include "qrect.h" -#include "qguardedptr.h" -#include "qmemarray.h" -#endif // QT_H - -#if defined(QT_ACCESSIBILITY_SUPPORT) - -struct TQAccessibleInterface; - -class Q_EXPORT TQAccessible -{ -private: -#ifdef Q_WS_MAC - static TQMAC_PASCAL OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); - static TQObject *queryAccessibleObject(TQAccessibleInterface *); -#endif -public: - enum Event { - SoundPlayed = 0x0001, - Alert = 0x0002, - ForegroundChanged = 0x0003, - MenuStart = 0x0004, - MenuEnd = 0x0005, - PopupMenuStart = 0x0006, - PopupMenuEnd = 0x0007, - ContextHelpStart = 0x000C, - ContextHelpEnd = 0x000D, - DragDropStart = 0x000E, - DragDropEnd = 0x000F, - DialogStart = 0x0010, - DialogEnd = 0x0011, - ScrollingStart = 0x0012, - ScrollingEnd = 0x0013, - - MenuCommand = 0x0018, - - ObjectCreated = 0x8000, - ObjectDestroyed = 0x8001, - ObjectShow = 0x8002, - ObjectHide = 0x8003, - ObjectReorder = 0x8004, - Focus = 0x8005, - Selection = 0x8006, - SelectionAdd = 0x8007, - SelectionRemove = 0x8008, - SelectionWithin = 0x8009, - StateChanged = 0x800A, - LocationChanged = 0x800B, - NameChanged = 0x800C, - DescriptionChanged = 0x800D, - ValueChanged = 0x800E, - ParentChanged = 0x800F, - HelpChanged = 0x80A0, - DefaultActionChanged= 0x80B0, - AcceleratorChanged = 0x80C0 - }; - - enum State { - Normal = 0x00000000, - Unavailable = 0x00000001, - Selected = 0x00000002, - Focused = 0x00000004, - Pressed = 0x00000008, - Checked = 0x00000010, - Mixed = 0x00000020, - ReadOnly = 0x00000040, - HotTracked = 0x00000080, - Default = 0x00000100, - Expanded = 0x00000200, - Collapsed = 0x00000400, - Busy = 0x00000800, - Floating = 0x00001000, - Marqueed = 0x00002000, - Animated = 0x00004000, - Invisible = 0x00008000, - Offscreen = 0x00010000, - Sizeable = 0x00020000, - Moveable = 0x00040000, - SelfVoicing = 0x00080000, - Focusable = 0x00100000, - Selectable = 0x00200000, - Linked = 0x00400000, - Traversed = 0x00800000, - MultiSelectable = 0x01000000, - ExtSelectable = 0x02000000, - AlertLow = 0x04000000, - AlertMedium = 0x08000000, - AlertHigh = 0x10000000, - Protected = 0x20000000, - Valid = 0x3fffffff - }; - - enum Role { - NoRole = 0x00000000, - TitleBar = 0x00000001, - MenuBar = 0x00000002, - ScrollBar = 0x00000003, - Grip = 0x00000004, - Sound = 0x00000005, - Cursor = 0x00000006, - Caret = 0x00000007, - AlertMessage = 0x00000008, - Window = 0x00000009, - Client = 0x0000000A, - PopupMenu = 0x0000000B, - MenuItem = 0x0000000C, - ToolTip = 0x0000000D, - Application = 0x0000000E, - Document = 0x0000000F, - Pane = 0x00000010, - Chart = 0x00000011, - Dialog = 0x00000012, - Border = 0x00000013, - Grouping = 0x00000014, - Separator = 0x00000015, - ToolBar = 0x00000016, - StatusBar = 0x00000017, - Table = 0x00000018, - ColumnHeader = 0x00000019, - RowHeader = 0x0000001A, - Column = 0x0000001B, - Row = 0x0000001C, - Cell = 0x0000001D, - Link = 0x0000001E, - HelpBalloon = 0x0000001F, - Character = 0x00000020, - List = 0x00000021, - ListItem = 0x00000022, - Outline = 0x00000023, - OutlineItem = 0x00000024, - PageTab = 0x00000025, - PropertyPage = 0x00000026, - Indicator = 0x00000027, - Graphic = 0x00000028, - StaticText = 0x00000029, - EditableText = 0x0000002A, // Editable, selectable, etc. - PushButton = 0x0000002B, - CheckBox = 0x0000002C, - RadioButton = 0x0000002D, - ComboBox = 0x0000002E, - DropLest = 0x0000002F, - ProgressBar = 0x00000030, - Dial = 0x00000031, - HotkeyField = 0x00000032, - Slider = 0x00000033, - SpinBox = 0x00000034, - Diagram = 0x00000035, - Animation = 0x00000036, - Equation = 0x00000037, - ButtonDropDown = 0x00000038, - ButtonMenu = 0x00000039, - ButtonDropGrid = 0x0000003A, - Whitespace = 0x0000003B, - PageTabList = 0x0000003C, - Clock = 0x0000003D - }; - - enum NavDirection { - NavUp = 0x00000001, - NavDown = 0x00000002, - NavLeft = 0x00000003, - NavRight = 0x00000004, - NavNext = 0x00000005, - NavPrevious = 0x00000006, - NavFirstChild = 0x00000007, - NavLastChild = 0x00000008, - NavFocusChild = 0x00000009 - }; - - enum Text { - Name = 0, - Description, - Value, - Help, - Accelerator, - DefaultAction - }; - - static TQRESULT queryAccessibleInterface( TQObject *, TQAccessibleInterface ** ); - static void updateAccessibility( TQObject *, int who, Event reason ); - static bool isActive(); - - static void initialize(); - static void cleanup(); -}; - -// {EC86CB9C-5DA0-4c43-A739-13EBDF1C6B14} -#define IID_QAccessible TQUuid( 0xec86cb9c, 0x5da0, 0x4c43, 0xa7, 0x39, 0x13, 0xeb, 0xdf, 0x1c, 0x6b, 0x14 ) - -struct Q_EXPORT TQAccessibleInterface : public TQAccessible, public TQUnknownInterface -{ - // check for valid pointers - virtual bool isValid() const = 0; - - // hierarchy - virtual int childCount() const = 0; - virtual TQRESULT queryChild( int control, TQAccessibleInterface** ) const = 0; - virtual TQRESULT queryParent( TQAccessibleInterface** ) const = 0; - - // navigation - virtual int controlAt( int x, int y ) const = 0; - virtual TQRect rect( int control ) const = 0; - virtual int navigate( NavDirection direction, int startControl ) const = 0; - - // properties and state - virtual TQString text( Text t, int control ) const = 0; - virtual void setText( Text t, int control, const TQString &text ) = 0; - virtual Role role( int control ) const = 0; - virtual State state( int control ) const = 0; - virtual TQMemArray selection() const = 0; - - // methods - virtual bool doDefaultAction( int control ) = 0; - virtual bool setFocus( int control ) = 0; - virtual bool setSelected( int control, bool on, bool extend ) = 0; - virtual void clearSelection() = 0; -}; - -// {49F4C6A7-412F-41DE-9E24-648843421FD3} -#ifndef IID_QAccessibleFactory -#define IID_QAccessibleFactory TQUuid( 0x49f4c6a7, 0x412f, 0x41de, 0x9e, 0x24, 0x64, 0x88, 0x43, 0x42, 0x1f, 0xd3 ) -#endif - -struct Q_EXPORT TQAccessibleFactoryInterface : public TQAccessible, public TQFeatureListInterface -{ - virtual TQRESULT createAccessibleInterface( const TQString &, TQObject *, TQAccessibleInterface** ) = 0; -}; - -class Q_EXPORT TQAccessibleObject : public TQObject, public TQAccessibleInterface -{ -public: - TQAccessibleObject( TQObject *object ); - virtual ~TQAccessibleObject(); - - TQRESULT queryInterface( const TQUuid &, TQUnknownInterface** ); - Q_REFCOUNT - - bool isValid() const; - -protected: - TQObject *object() const; - -private: - TQGuardedPtr object_; -}; - -#define Q_DEFINED_QACCESSIBLE_OBJECT -#include "qwinexport.h" -#endif //QT_ACCESSIBILITY_SUPPORT - -#endif //TQACCESSIBLE_H diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index ffb147ab5..6eb69ff45 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -38,36 +38,36 @@ ** **********************************************************************/ -#include "qobjectlist.h" -#include "qapplication.h" -#include "qeventloop.h" +#include "ntqobjectlist.h" +#include "ntqapplication.h" +#include "ntqeventloop.h" #include "qeventloop_p.h" -#include "qwidget.h" -#include "qwidgetlist.h" -#include "qwidgetintdict.h" -#include "qptrdict.h" -#include "qcleanuphandler.h" - -#include "qtranslator.h" -#include "qtextcodec.h" -#include "qsessionmanager.h" -#include "qdragobject.h" -#include "qclipboard.h" -#include "qcursor.h" -#include "qstyle.h" -#include "qstylefactory.h" -#include "qfile.h" -#include "qmessagebox.h" -#include "qdir.h" -#include "qfileinfo.h" +#include "ntqwidget.h" +#include "ntqwidgetlist.h" +#include "ntqwidgetintdict.h" +#include "ntqptrdict.h" +#include "ntqcleanuphandler.h" + +#include "ntqtranslator.h" +#include "ntqtextcodec.h" +#include "ntqsessionmanager.h" +#include "ntqdragobject.h" +#include "ntqclipboard.h" +#include "ntqcursor.h" +#include "ntqstyle.h" +#include "ntqstylefactory.h" +#include "ntqfile.h" +#include "ntqmessagebox.h" +#include "ntqdir.h" +#include "ntqfileinfo.h" #ifdef Q_WS_WIN #include "qinputcontext_p.h" #endif #include "qfontdata_p.h" #if defined(QT_THREAD_SUPPORT) -# include "qmutex.h" -# include "qthread.h" +# include "ntqmutex.h" +# include "ntqthread.h" #endif // QT_THREAD_SUPPORT #include @@ -77,7 +77,7 @@ #endif /*! - \class TQApplication qapplication.h + \class TQApplication ntqapplication.h \brief The TQApplication class manages the GUI application's control flow and main settings. @@ -282,9 +282,9 @@ TQApplication. This can be useful if you wish to share code between a non-GUI server and a GUI client. - \headerfile qnamespace.h - \headerfile qwindowdefs.h - \headerfile qglobal.h + \headerfile ntqnamespace.h + \headerfile ntqwindowdefs.h + \headerfile ntqglobal.h */ /*! \enum TQt::HANDLE @@ -1167,8 +1167,8 @@ TQApplication::~TQApplication() \code // showargs.cpp - displays program arguments in a list box - #include - #include + #include + #include int main( int argc, char **argv ) { @@ -2079,7 +2079,7 @@ TQWidgetList *TQApplication::topLevelWidgets() delete list; // delete the list, not the widgets \endcode - The TQWidgetList class is defined in the \c qwidgetlist.h header + The TQWidgetList class is defined in the \c ntqwidgetlist.h header file. \warning Delete the list as soon as you have finished using it. @@ -4122,7 +4122,7 @@ bool TQApplication::reverseLayout() /*! - \class TQSessionManager qsessionmanager.h + \class TQSessionManager ntqsessionmanager.h \brief The TQSessionManager class provides access to the session manager. \ingroup application diff --git a/src/kernel/qapplication.h b/src/kernel/qapplication.h deleted file mode 100644 index 6e62b4576..000000000 --- a/src/kernel/qapplication.h +++ /dev/null @@ -1,555 +0,0 @@ -/**************************************************************************** -** -** Definition of TQApplication class -** -** Created : 931107 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQAPPLICATION_H -#define TQAPPLICATION_H - -#ifndef QT_H -#include "qdesktopwidget.h" -#include "qasciidict.h" -#include "qpalette.h" -#include "qtranslator.h" -#include "qstrlist.h" -#include "qstringlist.h" -#endif // QT_H - -class TQSessionManager; -class TQStyle; -class TQTranslator; -class TQEventLoop; -#if defined(Q_WS_X11) -class TQIMEvent; -#endif -#if defined(Q_WS_QWS) -class TQWSDecoration; -#endif - -#ifdef QT_THREAD_SUPPORT -class TQMutex; -#endif // QT_THREAD_SUPPORT - - -class TQApplication; -extern Q_EXPORT TQApplication *qApp; // global application object - - -class Q_EXPORT TQApplication : public TQObject -{ - Q_OBJECT -public: - TQApplication( int &argc, char **argv ); - TQApplication( int &argc, char **argv, bool GUIenabled ); - enum Type { Tty, GuiClient, GuiServer }; - TQApplication( int &argc, char **argv, Type ); -#if defined(Q_WS_X11) - TQApplication( Display* dpy, HANDLE visual = 0, HANDLE cmap = 0 ); - TQApplication( Display *dpy, int argc, char **argv, - HANDLE visual = 0, HANDLE cmap= 0 ); -#endif - virtual ~TQApplication(); - - int argc() const; - char **argv() const; - - Type type() const; - -#ifndef QT_NO_STYLE - static TQStyle &style(); - static void setStyle( TQStyle* ); - static TQStyle* setStyle( const TQString& ); -#endif -#ifndef Q_QDOC - enum ColorMode { NormalColors, CustomColors }; - static ColorMode colorMode(); - static void setColorMode( TQApplication::ColorMode ); -#endif - - enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 }; - static int colorSpec(); - static void setColorSpec( int ); -#ifndef QT_NO_CURSOR - static TQCursor *overrideCursor(); - static void setOverrideCursor( const TQCursor &, bool replace=FALSE ); - static void restoreOverrideCursor(); -#endif - static bool hasGlobalMouseTracking(); - static void setGlobalMouseTracking( bool enable ); -#ifndef QT_NO_PALETTE - static TQPalette palette( const TQWidget* = 0 ); - static void setPalette( const TQPalette &, bool informWidgets=FALSE, - const char* className = 0 ); -#endif - static TQFont font( const TQWidget* = 0 ); - static void setFont( const TQFont &, bool informWidgets=FALSE, - const char* className = 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(); -#ifndef QT_NO_CLIPBOARD - static TQClipboard *clipboard(); -#endif - TQWidget *focusWidget() const; - TQWidget *activeWindow() const; - - static TQWidget *widgetAt( int x, int y, bool child=FALSE ); - static TQWidget *widgetAt( const TQPoint &, bool child=FALSE ); - - static TQEventLoop *eventLoop(); - - int exec(); - void processEvents(); - void processEvents( int maxtime ); - void processOneEvent(); - bool hasPendingEvents(); - int enter_loop(); - void exit_loop(); - int loopLevel() const; - static void exit( int retcode=0 ); - - static bool sendEvent( TQObject *receiver, TQEvent *event ); - static void postEvent( TQObject *receiver, TQEvent *event ); - static void sendPostedEvents( TQObject *receiver, int event_type ); - static void sendPostedEvents(); - - static void removePostedEvents( TQObject *receiver ); - - virtual bool notify( TQObject *, TQEvent * ); - - static bool startingUp(); - static bool closingDown(); - - static void flushX(); - static void flush(); - static void syncX(); - - static void beep(); - -#ifndef QT_NO_TRANSLATION -# ifndef QT_NO_TEXTCODEC - void setDefaultCodec( TQTextCodec * ); - TQTextCodec* defaultCodec() const; -# endif - void installTranslator( TQTranslator * ); - void removeTranslator( TQTranslator * ); -#endif - enum Encoding { DefaultCodec, UnicodeUTF8 }; - TQString translate( const char * context, - const char * key, - const char * comment = 0, - Encoding encoding = DefaultCodec ) const; -#ifndef QT_NO_DIR - TQString applicationDirPath(); - TQString applicationFilePath(); -#endif -#ifndef QT_NO_PALETTE - // obsolete functions - static void setWinStyleHighlightColor( const TQColor &c ) { - TQPalette p( palette() ); - p.setColor( TQColorGroup::Highlight, c ); - setPalette( p, TRUE); - } - static const TQColor &winStyleHighlightColor() { - return palette().active().highlight(); - } -#endif - static void setDesktopSettingsAware( bool ); - static bool desktopSettingsAware(); - - static void setCursorFlashTime( int ); - static int cursorFlashTime(); - - static void setDoubleClickInterval( int ); - static int doubleClickInterval(); -#ifndef QT_NO_WHEELEVENT - static void setWheelScrollLines( int ); - static int wheelScrollLines(); -#endif - static void setGlobalStrut( const TQSize & ); - static TQSize globalStrut(); - -#ifndef QT_NO_COMPONENT - static void setLibraryPaths( const TQStringList & ); - static TQStringList libraryPaths(); - static void addLibraryPath( const TQString & ); - static void removeLibraryPath( const TQString & ); -#endif // QT_NO_COMPONENT - static void setStartDragTime( int ms ); - static int startDragTime(); - static void setStartDragDistance( int l ); - static int startDragDistance(); - - static void setReverseLayout( bool b ); - static bool reverseLayout(); - - static int horizontalAlignment( int align ); - - static bool isEffectEnabled( TQt::UIEffect ); - static void setEffectEnabled( TQt::UIEffect, bool enable = TRUE ); - -#if defined(Q_WS_MAC) - virtual bool macEventFilter( EventHandlerCallRef, EventRef ); -#endif -#if defined(Q_WS_WIN) - virtual bool winEventFilter( MSG * ); -#endif -#if defined(Q_WS_X11) - virtual bool x11EventFilter( XEvent * ); - virtual int x11ClientMessage( TQWidget*, XEvent*, bool passive_only); - int x11ProcessEvent( XEvent* ); -#endif -#if defined(Q_WS_QWS) - virtual bool qwsEventFilter( TQWSEvent * ); - int qwsProcessEvent( TQWSEvent* ); - void qwsSetCustomColors( TQRgb *colortable, int start, int numColors ); -/*! - \internal - Returns true if the process is GUI server -*/ - bool qwsIsGUIServer(); -#ifndef QT_NO_QWS_MANAGER - static TQWSDecoration &qwsDecoration(); - static void qwsSetDecoration( TQWSDecoration *); -#endif -#endif - -#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) - static WindowsVersion winVersion(); -#elif defined(Q_OS_MAC) - static MacintoshVersion macVersion(); -#endif -#if defined(Q_WS_WIN) - void winFocus( TQWidget *, bool ); - static void winMouseButtonUp(); -#endif - -#ifndef QT_NO_SESSIONMANAGER - // session management - bool isSessionRestored() const; - TQString sessionId() const; - TQString sessionKey() const; - virtual void commitData( TQSessionManager& sm ); - virtual void saveState( TQSessionManager& sm ); -#endif -#if defined(Q_WS_X11) -#if !defined(QT_NO_IM_EXTENSIONS) - virtual TQWidget *locateICHolderWidget( TQWidget *w ); - virtual TQWidgetList *icHolderWidgets(); - static void create_im(); - static void close_im(); -#else - TQWidget *locateICHolderWidget( TQWidget *w ); - TQWidgetList *icHolderWidgets(); - static void create_xim(); - static void close_xim(); -#endif - static TQString defaultInputMethod(); - void changeAllInputContext( const TQString & ); - static bool x11_apply_settings(); -#endif - void wakeUpGuiThread(); -#if defined(QT_THREAD_SUPPORT) - void lock(); - void unlock(bool wakeUpGui = TRUE); - bool locked(); - bool tryLock(); -#endif - -signals: - void lastWindowClosed(); - void aboutToQuit(); - void guiThreadAwake(); - -public slots: - void quit(); - void closeAllWindows(); - void aboutTQt(); - -#if defined(Q_WS_QWS) -protected: - void setArgs(int, char **); -#endif - -protected: - bool event(TQEvent *); - -private: - void construct( int &argc, char **argv, Type ); - void initialize( int, char ** ); - void init_precmdline(); - void process_cmdline( int* argcptr, char ** argv ); - bool internalNotify( TQObject *, TQEvent * ); -#if defined(Q_WS_QWS) - static TQWidget *findChildWidget( const TQWidget *p, const TQPoint &pos ); - static TQWidget *findWidget( const TQObjectList&, const TQPoint &, bool rec ); -#endif - -#if defined(Q_WS_MAC) - bool do_mouse_down(Point *, bool *); - static TQMAC_PASCAL OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); - static TQMAC_PASCAL OSStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long); - static TQMAC_PASCAL void qt_context_timer_callbk(EventLoopTimerRef, void *); - static TQMAC_PASCAL void qt_select_timer_callbk(EventLoopTimerRef, void *); - static bool qt_mac_apply_settings(); - friend class TQMacInputMethod; - friend TQMAC_PASCAL OSStatus qt_window_event(EventHandlerCallRef, EventRef, void *); - friend void qt_mac_update_os_settings(); - friend bool qt_set_socket_handler( int, int, TQObject *, bool); - friend void qt_mac_destroy_widget(TQWidget *); - friend void qt_init(int *, char **, TQApplication::Type); -#endif - -#if defined(Q_WS_X11) -private slots: - void postIMEvent( TQObject *receiver, TQIMEvent *event ); -#endif - -private: -#ifdef QT_THREAD_SUPPORT - static TQMutex *qt_mutex; -#endif // QT_THREAD_SUPPORT - - int app_argc; - char **app_argv; - bool quit_now; - int quit_code; - static TQStyle *app_style; - static int app_cspec; -#ifndef QT_NO_PALETTE - static TQPalette *app_pal; -#endif - static TQFont *app_font; -#ifndef QT_NO_CURSOR - static TQCursor *app_cursor; -#endif - static TQEventLoop* eventloop; - static int app_tracking; - static bool is_app_running; - static bool is_app_closing; - static bool app_exit_loop; - static int loop_level; - static TQWidget *main_widget; - static TQWidget *focus_widget; - static TQWidget *active_window; - static bool obey_desktop_settings; - static int cursor_flash_time; - static int mouse_double_click_time; - static int wheel_scroll_lines; - static int composedUnicode; // Value, meta-composed character - - static bool animate_ui; - static bool animate_menu; - static bool animate_tooltip; - static bool animate_combo; - static bool fade_menu; - static bool fade_tooltip; - static bool animate_toolbox; - static bool widgetCount; // Coupled with -widgetcount switch - static bool metaComposeUnicode; - - TQValueList *translators; -#ifndef QT_NO_SESSIONMANAGER - TQSessionManager *session_manager; - TQString session_id; - static TQString* session_key; - bool is_session_restored; -#endif -#if defined(Q_WS_X11) -#if !defined (QT_NO_STYLE) - static void x11_initialize_style(); -#endif - static TQString defaultIM; // default input method's name in this application. -#endif - - static TQSize app_strut; -#ifndef QT_NO_COMPONENT - static TQStringList *app_libpaths; -#endif - static TQAsciiDict *app_palettes; - static TQAsciiDict *app_fonts; - - static TQWidgetList *popupWidgets; - bool inPopupMode() const; - void closePopup( TQWidget *popup ); - void openPopup( TQWidget *popup ); - void setActiveWindow( TQWidget* act ); - - static bool sendSpontaneousEvent( TQObject *receiver, TQEvent *event ); - static void removePostedEvent( TQEvent * ); - static void removePostedEvents( TQObject *receiver, int event_type ); - - friend class TQWidget; - friend class TQETWidget; - friend class TQDialog; - friend class TQAccelManager; - friend class TQEvent; - friend class TQTranslator; - friend class TQEventLoop; - friend Q_EXPORT void qt_ucm_initialize( TQApplication * ); -#if defined(Q_WS_WIN) - friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* ); -#endif -#if defined(Q_WS_QWS) - friend class TQInputContext; -#endif -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQApplication( const TQApplication & ); - TQApplication &operator=( const TQApplication & ); -#endif -}; - -inline int TQApplication::argc() const -{ - return app_argc; -} - -inline char **TQApplication::argv() const -{ - return app_argv; -} - -#if defined(Q_WS_QWS) -inline void TQApplication::setArgs(int c, char **v) -{ - app_argc = c; - app_argv = v; -} -#endif - -#ifndef QT_NO_CURSOR -inline TQCursor *TQApplication::overrideCursor() -{ - return app_cursor; -} -#endif -inline bool TQApplication::hasGlobalMouseTracking() -{ - return app_tracking > 0; -} - -inline TQWidget *TQApplication::mainWidget() const -{ - return main_widget; -} - -inline TQWidget *TQApplication::focusWidget() const -{ - return focus_widget; -} - -inline TQWidget *TQApplication::activeWindow() const -{ - return active_window; -} - -inline TQWidget *TQApplication::widgetAt( const TQPoint &p, bool child ) -{ - return widgetAt( p.x(), p.y(), child ); -} - -inline bool TQApplication::inPopupMode() const -{ - return popupWidgets != 0; -} -#ifndef QT_NO_SESSIONMANAGER -inline bool TQApplication::isSessionRestored() const -{ - return is_session_restored; -} - -inline TQString TQApplication::sessionId() const -{ - return session_id; -} - -inline TQString TQApplication::sessionKey() const -{ - return session_key ? *session_key : TQString::null; -} -#endif -inline TQSize TQApplication::globalStrut() -{ - return app_strut; -} - -inline bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event ) -{ if ( event ) event->spont = FALSE; return qApp ? qApp->notify( receiver, event ) : FALSE; } - -inline bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event ) -{ if ( event ) event->spont = TRUE; return qApp ? qApp->notify( receiver, event ) : FALSE; } - -#ifdef QT_NO_TRANSLATION -// Simple versions -inline TQString TQApplication::translate( const char *, const char *sourceText, - const char *, Encoding encoding ) const -{ -#ifndef QT_NO_TEXTCODEC - if ( encoding == UnicodeUTF8 ) - return TQString::fromUtf8( sourceText ); - else -#endif - return TQString::fromLatin1( sourceText ); -} -#endif - -inline int TQApplication::horizontalAlignment( int align ) -{ - align &= AlignHorizontal_Mask; - if ( align == AlignAuto ) { - if ( reverseLayout() ) - align = AlignRight; - else - align = AlignLeft; - } - return align; -} - -#endif // TQAPPLICATION_H - diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index 7f0d4d3d4..1c285c44c 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -64,45 +64,45 @@ # undef truncate #endif -#include "qapplication.h" +#include "ntqapplication.h" #include "qapplication_p.h" #include "qcolor_p.h" -#include "qcursor.h" -#include "qwidget.h" +#include "ntqcursor.h" +#include "ntqwidget.h" #include "qwidget_p.h" -#include "qobjectlist.h" -#include "qwidgetlist.h" -#include "qwidgetintdict.h" -#include "qbitarray.h" -#include "qpainter.h" -#include "qpixmapcache.h" -#include "qdatetime.h" -#include "qtextcodec.h" -#include "qdatastream.h" -#include "qbuffer.h" -#include "qsocketnotifier.h" -#include "qsessionmanager.h" -#include "qvaluelist.h" -#include "qdict.h" -#include "qguardedptr.h" -#include "qclipboard.h" -#include "qwhatsthis.h" // ######## dependency -#include "qsettings.h" -#include "qstylefactory.h" -#include "qfileinfo.h" +#include "ntqobjectlist.h" +#include "ntqwidgetlist.h" +#include "ntqwidgetintdict.h" +#include "ntqbitarray.h" +#include "ntqpainter.h" +#include "ntqpixmapcache.h" +#include "ntqdatetime.h" +#include "ntqtextcodec.h" +#include "ntqdatastream.h" +#include "ntqbuffer.h" +#include "ntqsocketnotifier.h" +#include "ntqsessionmanager.h" +#include "ntqvaluelist.h" +#include "ntqdict.h" +#include "ntqguardedptr.h" +#include "ntqclipboard.h" +#include "ntqwhatsthis.h" // ######## dependency +#include "ntqsettings.h" +#include "ntqstylefactory.h" +#include "ntqfileinfo.h" // Input method stuff - UNFINISHED #ifndef QT_NO_IM -#include "qinputcontext.h" +#include "ntqinputcontext.h" #endif // QT_NO_IM #include "qinternal_p.h" // shared double buffer cleanup #if defined(QT_THREAD_SUPPORT) -# include "qthread.h" +# include "ntqthread.h" #endif #if defined(QT_DEBUG) && defined(Q_OS_LINUX) -# include "qfile.h" +# include "ntqfile.h" #endif #include "qt_x11_p.h" @@ -1636,7 +1636,7 @@ static Visual *find_truecolor_visual( Display *dpy, int scr, int *depth, int *nc #include // ### This should be static but it isn't because of the friend declaration -// ### in qpaintdevice.h which then should have a static too but can't have +// ### in ntqpaintdevice.h which then should have a static too but can't have // ### it because "storage class specifiers invalid in friend function // ### declarations" :-) Ideas anyone? void qt_init_internal( int *argcptr, char **argv, diff --git a/src/kernel/qasyncimageio.cpp b/src/kernel/qasyncimageio.cpp index c8e8d6ef5..41164a4c6 100644 --- a/src/kernel/qasyncimageio.cpp +++ b/src/kernel/qasyncimageio.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qasyncimageio.h" +#include "ntqasyncimageio.h" #ifndef QT_NO_ASYNC_IMAGE_IO -#include "qptrlist.h" -#include "qgif.h" +#include "ntqptrlist.h" +#include "ntqgif.h" #include extern void qt_init_image_handlers(); @@ -52,7 +52,7 @@ extern void qt_init_image_plugins(); #define Q_TRANSPARENT 0x00ffffff /*! - \class TQImageConsumer qasyncimageio.h + \class TQImageConsumer ntqasyncimageio.h \brief The TQImageConsumer class is an abstraction used by TQImageDecoder. \ingroup images @@ -154,7 +154,7 @@ extern void qt_init_image_plugins(); /*! - \class TQImageDecoder qasyncimageio.h + \class TQImageDecoder ntqasyncimageio.h \brief The TQImageDecoder class is an incremental image decoder for all supported image formats. \ingroup images @@ -178,7 +178,7 @@ extern void qt_init_image_plugins(); \legalese TQt supports GIF reading if it is configured that way during - installation (see qgif.h). If it is, we are required to state that + installation (see ntqgif.h). If it is, we are required to state that "The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated." @@ -199,7 +199,7 @@ static const int max_header = 32; -// See qgif.h for important information regarding this option +// See ntqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 class TQGIFFormat : public TQImageFormat { public: @@ -299,7 +299,7 @@ public: { if ( !factories ) { factories = new TQPtrList; -// See qgif.h for important information regarding this option +// See ntqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 gif_decoder_factory = new TQGIFFormatType; #endif @@ -310,7 +310,7 @@ public: static TQPtrList * factories; -// See qgif.h for important information regarding this option +// See ntqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 static TQGIFFormatType * gif_decoder_factory; #endif @@ -320,7 +320,7 @@ public: }; TQPtrList * TQImageDecoderPrivate::factories = 0; -// See qgif.h for important information regarding this option +// See ntqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 TQGIFFormatType * TQImageDecoderPrivate::gif_decoder_factory = 0; #endif @@ -330,7 +330,7 @@ void TQImageDecoderPrivate::cleanup() { delete factories; factories = 0; -// See qgif.h for important information regarding this option +// See ntqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 delete gif_decoder_factory; gif_decoder_factory = 0; @@ -531,7 +531,7 @@ void TQImageDecoder::unregisterDecoderFactory(TQImageFormatType* f) } /*! - \class TQImageFormat qasyncimageio.h + \class TQImageFormat ntqasyncimageio.h \brief The TQImageFormat class is an incremental image decoder for a specific image format. \ingroup images @@ -583,7 +583,7 @@ TQImageFormat::~TQImageFormat() */ /*! - \class TQImageFormatType qasyncimageio.h + \class TQImageFormatType ntqasyncimageio.h \brief The TQImageFormatType class is a factory that makes TQImageFormat objects. \ingroup images @@ -659,11 +659,11 @@ bool qt_builtin_gif_reader() #endif } -// See qgif.h for important information regarding this option +// See ntqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 /* -- NOTDOC - \class TQGIFFormat qasyncimageio.h + \class TQGIFFormat ntqasyncimageio.h \brief Incremental image decoder for GIF image format. \ingroup images @@ -702,7 +702,7 @@ TQGIFFormat::~TQGIFFormat() /* -- NOTDOC - \class TQGIFFormatType qasyncimageio.h + \class TQGIFFormatType ntqasyncimageio.h \brief Incremental image decoder for GIF image format. \ingroup images diff --git a/src/kernel/qasyncimageio.h b/src/kernel/qasyncimageio.h deleted file mode 100644 index 9767b3d94..000000000 --- a/src/kernel/qasyncimageio.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Definition of asynchronous image/movie loading classes -** -** Created : 970617 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQASYNCIMAGEIO_H -#define TQASYNCIMAGEIO_H - -#ifndef QT_H -#include "qimage.h" -#endif // QT_H - -#ifndef QT_NO_ASYNC_IMAGE_IO - -#if __GNUC__ - 0 > 3 -#pragma GCC system_header -#endif - -class Q_EXPORT TQImageConsumer { -public: - virtual void end()=0; - - // Change transfer type 1. - virtual void changed( const TQRect& ) = 0; - virtual void frameDone() = 0; - - // Change transfer type 2. - virtual void frameDone( const TQPoint&, const TQRect& ) = 0; - - virtual void setLooping( int ) = 0; - virtual void setFramePeriod( int ) = 0; - virtual void setSize( int, int ) = 0; -}; - -class Q_EXPORT TQImageFormat { -public: - virtual ~TQImageFormat(); - virtual int decode( TQImage& img, TQImageConsumer* consumer, - const uchar* buffer, int length ) = 0; -}; - -class Q_EXPORT TQImageFormatType { -public: - virtual ~TQImageFormatType(); - virtual TQImageFormat* decoderFor( const uchar* buffer, int length ) = 0; - virtual const char* formatName() const = 0; -protected: - TQImageFormatType(); -}; - -class TQImageDecoderPrivate; -class Q_EXPORT TQImageDecoder { -public: - TQImageDecoder( TQImageConsumer* c ); - ~TQImageDecoder(); - - const TQImage& image() { return img; } - int decode( const uchar* buffer, int length ); - - static const char* formatName( const uchar* buffer, int length ); - static TQImageFormatType* format( const char* name ); // direct use - no decode() - - static TQStrList inputFormats(); - static void registerDecoderFactory( TQImageFormatType* ); - static void unregisterDecoderFactory( TQImageFormatType* ); - -private: - TQImageFormat* actual_decoder; - TQImageConsumer* consumer; - TQImage img; - TQImageDecoderPrivate *d; -}; - -#endif // QT_NO_ASYNC_IMAGE_IO - -#endif // TQASYNCIMAGEIO_H diff --git a/src/kernel/qasyncio.cpp b/src/kernel/qasyncio.cpp index 643e35656..84912e1ff 100644 --- a/src/kernel/qasyncio.cpp +++ b/src/kernel/qasyncio.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qasyncio.h" -#include "qiodevice.h" +#include "ntqasyncio.h" +#include "ntqiodevice.h" #include #ifndef QT_NO_ASYNC_IO /*! - \class TQAsyncIO qasyncio.h + \class TQAsyncIO ntqasyncio.h \obsolete \brief The TQAsyncIO class encapsulates I/O asynchronicity. @@ -86,7 +86,7 @@ void TQAsyncIO::ready() /*! - \class TQDataSink qasyncio.h + \class TQDataSink ntqasyncio.h \obsolete \brief The TQDataSink class is an asynchronous consumer of data. @@ -132,7 +132,7 @@ void TQDataSink::maybeReady() /*! - \class TQDataSource qasyncio.h + \class TQDataSource ntqasyncio.h \obsolete \brief The TQDataSource class is an asynchronous producer of data. @@ -209,7 +209,7 @@ void TQDataSource::rewind() } /*! - \class TQIODeviceSource qasyncio.h + \class TQIODeviceSource ntqasyncio.h \obsolete \brief The TQIODeviceSource class is a TQDataSource that draws data from a TQIODevice. @@ -297,7 +297,7 @@ void TQIODeviceSource::rewind() /*! - \class TQDataPump qasyncio.h + \class TQDataPump ntqasyncio.h \obsolete \brief The TQDataPump class moves data from a TQDataSource to a TQDataSink during event processing. diff --git a/src/kernel/qasyncio.h b/src/kernel/qasyncio.h deleted file mode 100644 index 8f1319d96..000000000 --- a/src/kernel/qasyncio.h +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Definition of asynchronous I/O classes -** -** Created : 970617 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQASYNCIO_H -#define TQASYNCIO_H - -#ifndef QT_H -#include "qobject.h" -#include "qsignal.h" -#include "qtimer.h" -#endif // QT_H - -#ifndef QT_NO_ASYNC_IO - -class TQIODevice; - -class Q_EXPORT TQAsyncIO { -public: - virtual ~TQAsyncIO(); - void connect(TQObject*, const char *member); - -protected: - void ready(); - -private: - TQSignal signal; -}; - -class Q_EXPORT TQDataSink : public TQAsyncIO { -public: - // Call this to know how much I can take. - virtual int readyToReceive()=0; - virtual void receive(const uchar*, int count)=0; - virtual void eof()=0; - void maybeReady(); -}; - -class Q_EXPORT TQDataSource : public TQAsyncIO { -public: - virtual int readyToSend()=0; // returns -1 when never any more ready - virtual void sendTo(TQDataSink*, int count)=0; - void maybeReady(); - - virtual bool rewindable() const; - virtual void enableRewind(bool); - virtual void rewind(); -}; - -class Q_EXPORT TQIODeviceSource : public TQDataSource { - const int buf_size; - uchar *buffer; - TQIODevice* iod; - bool rew; - -public: - TQIODeviceSource(TQIODevice*, int bufsize=4096); - ~TQIODeviceSource(); - - int readyToSend(); - void sendTo(TQDataSink* sink, int n); - bool rewindable() const; - void enableRewind(bool on); - void rewind(); -}; - -class Q_EXPORT TQDataPump : public TQObject { - Q_OBJECT - int interval; - TQTimer timer; - TQDataSource* source; - TQDataSink* sink; - -public: - TQDataPump(TQDataSource*, TQDataSink*); - -private slots: - void kickStart(); - void tryToPump(); -}; - -#endif // QT_NO_ASYNC_IO - -#endif diff --git a/src/kernel/qbitmap.cpp b/src/kernel/qbitmap.cpp index 9e1ea6fbe..1e341e545 100644 --- a/src/kernel/qbitmap.cpp +++ b/src/kernel/qbitmap.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qbitmap.h" -#include "qimage.h" +#include "ntqbitmap.h" +#include "ntqimage.h" /*! - \class TQBitmap qbitmap.h + \class TQBitmap ntqbitmap.h \brief The TQBitmap class provides monochrome (1-bit depth) pixmaps. \ingroup graphics diff --git a/src/kernel/qbitmap.h b/src/kernel/qbitmap.h deleted file mode 100644 index 3612989fe..000000000 --- a/src/kernel/qbitmap.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Definition of TQBitmap class -** -** Created : 941020 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQBITMAP_H -#define TQBITMAP_H - -#ifndef QT_H -#include "qpixmap.h" -#endif // QT_H - - -class Q_EXPORT TQBitmap : public TQPixmap -{ -public: - TQBitmap(); - TQBitmap( int w, int h, bool clear = FALSE, - TQPixmap::Optimization = TQPixmap::DefaultOptim ); - TQBitmap( const TQSize &, bool clear = FALSE, - TQPixmap::Optimization = TQPixmap::DefaultOptim ); - TQBitmap( int w, int h, const uchar *bits, bool isXbitmap=FALSE ); - TQBitmap( const TQSize &, const uchar *bits, bool isXbitmap=FALSE ); - TQBitmap( const TQBitmap & ); -#ifndef QT_NO_IMAGEIO - TQBitmap( const TQString &fileName, const char *format=0 ); -#endif - TQBitmap &operator=( const TQBitmap & ); - TQBitmap &operator=( const TQPixmap & ); - TQBitmap &operator=( const TQImage & ); - -#ifndef QT_NO_PIXMAP_TRANSFORMATION - TQBitmap xForm( const TQWMatrix & ) const; -#endif -}; - - -#endif // TQBITMAP_H diff --git a/src/kernel/qbrush.h b/src/kernel/qbrush.h deleted file mode 100644 index c401a212c..000000000 --- a/src/kernel/qbrush.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Definition of TQBrush class -** -** Created : 940112 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQBRUSH_H -#define TQBRUSH_H - -#ifndef QT_H -#include "qcolor.h" -#include "qshared.h" -#endif // QT_H - - -class Q_EXPORT TQBrush: public TQt -{ -friend class TQPainter; -public: - TQBrush(); - TQBrush( BrushStyle ); - TQBrush( const TQColor &, BrushStyle=SolidPattern ); - TQBrush( const TQColor &, const TQPixmap & ); - TQBrush( const TQBrush & ); - ~TQBrush(); - TQBrush &operator=( const TQBrush & ); - - BrushStyle style() const { return data->style; } - void setStyle( BrushStyle ); - const TQColor &color()const { return data->color; } - void setColor( const TQColor & ); - TQPixmap *pixmap() const { return data->pixmap; } - void setPixmap( const TQPixmap & ); - - bool operator==( const TQBrush &p ) const; - bool operator!=( const TQBrush &b ) const - { return !(operator==(b)); } - -private: - TQBrush copy() const; - void detach(); - void init( const TQColor &, BrushStyle ); - struct TQBrushData : public TQShared { // brush data - BrushStyle style; - TQColor color; - TQPixmap *pixmap; - } *data; -}; - - -/***************************************************************************** - TQBrush stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQBrush & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQBrush & ); -#endif - -#endif // TQBRUSH_H diff --git a/src/kernel/qclipboard.cpp b/src/kernel/qclipboard.cpp index 2fdffc826..32da6a764 100644 --- a/src/kernel/qclipboard.cpp +++ b/src/kernel/qclipboard.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qclipboard.h" +#include "ntqclipboard.h" #ifndef QT_NO_CLIPBOARD -#include "qapplication.h" +#include "ntqapplication.h" #include "qapplication_p.h" -#include "qdragobject.h" -#include "qpixmap.h" +#include "ntqdragobject.h" +#include "ntqpixmap.h" /*! - \class TQClipboard qclipboard.h + \class TQClipboard ntqclipboard.h \brief The TQClipboard class provides access to the window system clipboard. \ingroup io diff --git a/src/kernel/qclipboard.h b/src/kernel/qclipboard.h deleted file mode 100644 index e84aa37c4..000000000 --- a/src/kernel/qclipboard.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Definition of TQClipboard class -** -** Created : 960430 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCLIPBOARD_H -#define TQCLIPBOARD_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qobject.h" -#endif // QT_H - -#ifndef QT_NO_CLIPBOARD - -class TQMimeSource; - -class Q_EXPORT TQClipboard : public TQObject -{ - Q_OBJECT -private: - TQClipboard( TQObject *parent=0, const char *name=0 ); - ~TQClipboard(); - -public: - enum Mode { Clipboard, Selection }; - - void clear( Mode mode ); // ### default arg = Clipboard in 4.0 - void clear(); // ### remove 4.0 - - bool supportsSelection() const; - bool ownsSelection() const; - bool ownsClipboard() const; - - void setSelectionMode(bool enable); // ### remove 4.0 - bool selectionModeEnabled() const; // ### remove 4.0 - - // ### default arg mode = Clipboard in 4.0 for all of these - TQString text( Mode mode ) const; - TQString text( TQCString& subtype, Mode mode ) const; - void setText( const TQString &, Mode mode ); - -#ifndef QT_NO_MIMECLIPBOARD - TQMimeSource *data( Mode mode ) const; - void setData( TQMimeSource*, Mode mode ); - - TQImage image( Mode mode ) const; - TQPixmap pixmap( Mode mode ) const; - void setImage( const TQImage &, Mode mode ); - void setPixmap( const TQPixmap &, Mode mode ); -#endif - - // ### remove all of these in 4.0 - TQString text() const; - TQString text(TQCString& subtype) const; - void setText( const TQString &); - -#ifndef QT_NO_MIMECLIPBOARD - TQMimeSource *data() const; - void setData( TQMimeSource* ); - - TQImage image() const; - TQPixmap pixmap() const; - void setImage( const TQImage & ); - void setPixmap( const TQPixmap & ); -#endif - -signals: - void selectionChanged(); - void dataChanged(); - -private slots: - void ownerDestroyed(); - -protected: - void connectNotify( const char * ); - bool event( TQEvent * ); - - friend class TQApplication; - friend class TQBaseApplication; - friend class TQDragManager; - friend class TQMimeSource; - -private: -#if defined(Q_WS_MAC) - void loadScrap(bool convert); - void saveScrap(); -#endif - - // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQClipboard( const TQClipboard & ); - TQClipboard &operator=( const TQClipboard & ); -#endif -}; - -#endif // QT_NO_CLIPBOARD - -#endif // TQCLIPBOARD_H diff --git a/src/kernel/qclipboard_x11.cpp b/src/kernel/qclipboard_x11.cpp index 0c780a89d..379e8249a 100644 --- a/src/kernel/qclipboard_x11.cpp +++ b/src/kernel/qclipboard_x11.cpp @@ -60,19 +60,19 @@ # undef open #endif -#include "qclipboard.h" +#include "ntqclipboard.h" #ifndef QT_NO_CLIPBOARD -#include "qapplication.h" -#include "qeventloop.h" -#include "qbitmap.h" -#include "qdatetime.h" -#include "qdragobject.h" -#include "qbuffer.h" -#include "qtextcodec.h" -#include "qvaluelist.h" -#include "qmap.h" +#include "ntqapplication.h" +#include "ntqeventloop.h" +#include "ntqbitmap.h" +#include "ntqdatetime.h" +#include "ntqdragobject.h" +#include "ntqbuffer.h" +#include "ntqtextcodec.h" +#include "ntqvaluelist.h" +#include "ntqmap.h" #include "qt_x11_p.h" #include "qapplication_p.h" diff --git a/src/kernel/qcolor.cpp b/src/kernel/qcolor.cpp index 4806191e3..832e5b7f7 100644 --- a/src/kernel/qcolor.cpp +++ b/src/kernel/qcolor.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qcolor.h" -#include "qnamespace.h" -#include "qdatastream.h" +#include "ntqcolor.h" +#include "ntqnamespace.h" +#include "ntqdatastream.h" #include /*! - \class TQColor qcolor.h + \class TQColor ntqcolor.h \brief The TQColor class provides colors based on RGB or HSV values. \ingroup images diff --git a/src/kernel/qcolor.h b/src/kernel/qcolor.h deleted file mode 100644 index 125a257d7..000000000 --- a/src/kernel/qcolor.h +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** -** -** Definition of TQColor class -** -** Created : 940112 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCOLOR_H -#define TQCOLOR_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qstringlist.h" -#endif // QT_H - -const TQRgb RGB_MASK = 0x00ffffff; // masks RGB values - -Q_EXPORT inline int qRed( TQRgb rgb ) // get red part of RGB -{ return (int)((rgb >> 16) & 0xff); } - -Q_EXPORT inline int qGreen( TQRgb rgb ) // get green part of RGB -{ return (int)((rgb >> 8) & 0xff); } - -Q_EXPORT inline int qBlue( TQRgb rgb ) // get blue part of RGB -{ return (int)(rgb & 0xff); } - -Q_EXPORT inline int qAlpha( TQRgb rgb ) // get alpha part of RGBA -{ return (int)((rgb >> 24) & 0xff); } - -Q_EXPORT inline TQRgb qRgb( int r, int g, int b )// set RGB value -{ return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); } - -Q_EXPORT inline TQRgb qRgba( int r, int g, int b, int a )// set RGBA value -{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); } - -Q_EXPORT inline int qGray( int r, int g, int b )// convert R,G,B to gray 0..255 -{ return (r*11+g*16+b*5)/32; } - -Q_EXPORT inline int qGray( TQRgb rgb ) // convert RGB to gray 0..255 -{ return qGray( qRed(rgb), qGreen(rgb), qBlue(rgb) ); } - - -class Q_EXPORT TQColor -{ -public: - enum Spec { Rgb, Hsv }; - - TQColor(); - TQColor( int r, int g, int b ); - TQColor( int x, int y, int z, Spec ); - TQColor( TQRgb rgb, uint pixel=0xffffffff); - TQColor( const TQString& name ); - TQColor( const char *name ); - TQColor( const TQColor & ); - TQColor &operator=( const TQColor & ); - - bool isValid() const; - bool isDirty() const; - TQString name() const; - void setNamedColor( const TQString& name ); - - TQRgb rgb() const; - void setRgb( int r, int g, int b ); - void setRgb( TQRgb rgb ); - void getRgb( int *r, int *g, int *b ) const { rgb( r, g, b ); } - void rgb( int *r, int *g, int *b ) const; // obsolete - - int red() const; - int green() const; - int blue() const; - - void setHsv( int h, int s, int v ); - void getHsv( int *h, int *s, int *v ) const { hsv( h, s, v ); } - void hsv( int *h, int *s, int *v ) const; // obsolete - void getHsv( int &h, int &s, int &v ) const { hsv( &h, &s, &v ); } // obsolete - - TQColor light( int f = 150 ) const; - TQColor dark( int f = 200 ) const; - - bool operator==( const TQColor &c ) const; - bool operator!=( const TQColor &c ) const; - - uint alloc(); - uint pixel() const; - -#if defined(Q_WS_X11) - // ### in 4.0, make this take a default argument of -1 for default screen? - uint alloc( int screen ); - uint pixel( int screen ) const; -#endif - - static int maxColors(); - static int numBitPlanes(); - - static int enterAllocContext(); - static void leaveAllocContext(); - static int currentAllocContext(); - static void destroyAllocContext( int ); - -#if defined(Q_WS_WIN) - static const TQRgb* palette( int* numEntries = 0 ); - static int setPaletteEntries( const TQRgb* entries, int numEntries, - int base = -1 ); - static HPALETTE hPal() { return hpal; } - static uint realizePal( TQWidget * ); -#endif - - static void initialize(); - static void cleanup(); -#ifndef QT_NO_STRINGLIST - static TQStringList colorNames(); -#endif - enum { Dirt = 0x44495254, Invalid = 0x49000000 }; - -private: - void setSystemNamedColor( const TQString& name ); - void setPixel( uint pixel ); - static void initGlobalColors(); - static uint argbToPix32(TQRgb); - static TQColor* globalColors(); - static bool color_init; - static bool globals_init; -#if defined(Q_WS_WIN) - static HPALETTE hpal; -#endif - static enum ColorModel { d8, d32 } colormodel; - union { - TQRgb argb; - struct D8 { - TQRgb argb; - uchar pix; - uchar invalid; - uchar dirty; - uchar direct; - } d8; - struct D32 { - TQRgb argb; - uint pix; - bool invalid() const { return argb == TQColor::Invalid && pix == TQColor::Dirt; } - bool probablyDirty() const { return pix == TQColor::Dirt; } - } d32; - } d; -}; - - -inline TQColor::TQColor() -{ d.d32.argb = Invalid; d.d32.pix = Dirt; } - -inline TQColor::TQColor( int r, int g, int b ) -{ - d.d32.argb = Invalid; - d.d32.pix = Dirt; - setRgb( r, g, b ); -} - -inline TQRgb TQColor::rgb() const -{ return d.argb; } - -inline int TQColor::red() const -{ return qRed(d.argb); } - -inline int TQColor::green() const -{ return qGreen(d.argb); } - -inline int TQColor::blue() const -{ return qBlue(d.argb); } - -inline bool TQColor::isValid() const -{ - if ( colormodel == d8 ) - return !d.d8.invalid; - else - return !d.d32.invalid(); -} - -inline bool TQColor::operator==( const TQColor &c ) const -{ - return d.argb == c.d.argb && isValid() == c.isValid(); -} - -inline bool TQColor::operator!=( const TQColor &c ) const -{ - return !operator==(c); -} - - -/***************************************************************************** - TQColor stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQColor & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQColor & ); -#endif - -#endif // TQCOLOR_H diff --git a/src/kernel/qcolor_p.cpp b/src/kernel/qcolor_p.cpp index 273909741..680737ffc 100644 --- a/src/kernel/qcolor_p.cpp +++ b/src/kernel/qcolor_p.cpp @@ -39,13 +39,13 @@ ** **********************************************************************/ -#include "qglobal.h" +#include "ntqglobal.h" #if defined(Q_CC_BOR) // needed for qsort() because of a std namespace problem on Borland #include "qplatformdefs.h" #endif -#include "qcolor.h" +#include "ntqcolor.h" #ifndef QT_NO_COLORNAMES diff --git a/src/kernel/qcolor_x11.cpp b/src/kernel/qcolor_x11.cpp index 8bd1eb48e..38080b42a 100644 --- a/src/kernel/qcolor_x11.cpp +++ b/src/kernel/qcolor_x11.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qcolor.h" +#include "ntqcolor.h" #include "qcolor_p.h" #include "string.h" -#include "qpaintdevice.h" -#include "qapplication.h" +#include "ntqpaintdevice.h" +#include "ntqapplication.h" #include "qapplication_p.h" #include "qt_x11_p.h" @@ -58,7 +58,7 @@ this TQt application. *****************************************************************************/ -#include "qintdict.h" +#include "ntqintdict.h" struct TQColorData { uint pix; // allocated pixel value diff --git a/src/kernel/qconnection.cpp b/src/kernel/qconnection.cpp index ac8e93efa..b30a76413 100644 --- a/src/kernel/qconnection.cpp +++ b/src/kernel/qconnection.cpp @@ -38,9 +38,9 @@ ** **********************************************************************/ -#include "qconnection.h" +#include "ntqconnection.h" -/*! \class TQConnection qconnection.h +/*! \class TQConnection ntqconnection.h \brief The TQConnection class is an internal class, used in the signal/slot mechanism. \internal diff --git a/src/kernel/qconnection.h b/src/kernel/qconnection.h deleted file mode 100644 index 7ad0cb6b0..000000000 --- a/src/kernel/qconnection.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Definition of TQConnection class -** -** Created : 930417 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCONNECTION_H -#define TQCONNECTION_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - -class Q_EXPORT TQConnection -{ -public: - TQConnection( const TQObject *, int, const char *memberName, int memberType ); - ~TQConnection() {} - - bool isConnected() const { return obj != 0; } - - TQObject *object() const { return obj; } // get object/member pointer - int member() const { return mbr; } - const char *memberName() const { return mbr_name; } - int memberType() const { return mbr_type; } - int numArgs() const { return nargs; } - -private: - TQObject *obj; // object connected to - int mbr; // member connected to - const char *mbr_name; - int mbr_type; - int nargs; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQConnection( const TQConnection & ); - TQConnection &operator=( const TQConnection & ); -#endif -}; - -#define Q_DEFINED_QCONNECTION -#include "qwinexport.h" -#endif // TQCONNECTION_H diff --git a/src/kernel/qcursor.cpp b/src/kernel/qcursor.cpp index 112e70c72..12e7cc780 100644 --- a/src/kernel/qcursor.cpp +++ b/src/kernel/qcursor.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qcursor.h" +#include "ntqcursor.h" #ifndef QT_NO_CURSOR -#include "qbitmap.h" -#include "qimage.h" -#include "qdatastream.h" +#include "ntqbitmap.h" +#include "ntqimage.h" +#include "ntqdatastream.h" /*! - \class TQCursor qcursor.h + \class TQCursor ntqcursor.h \brief The TQCursor class provides a mouse cursor with an arbitrary shape. diff --git a/src/kernel/qcursor.h b/src/kernel/qcursor.h deleted file mode 100644 index 4bd4f8904..000000000 --- a/src/kernel/qcursor.h +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Definition of TQCursor class -** -** Created : 940219 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCURSOR_H -#define TQCURSOR_H - -#ifndef QT_H -#include "qpoint.h" -#include "qshared.h" -#endif // QT_H - -/* - ### The fake cursor has to go first with old qdoc. -*/ -#ifdef QT_NO_CURSOR - -class Q_EXPORT TQCursor : public TQt -{ -public: - static TQPoint pos(); - static void setPos( int x, int y ); - static void setPos( const TQPoint & ); -private: - TQCursor(); -}; - -#endif // QT_NO_CURSOR - -#ifndef QT_NO_CURSOR - -struct TQCursorData; - - -class Q_EXPORT TQCursor : public TQt -{ -public: - TQCursor(); // create default arrow cursor - TQCursor( int shape ); - TQCursor( const TQBitmap &bitmap, const TQBitmap &mask, - int hotX=-1, int hotY=-1 ); - TQCursor( const TQPixmap &pixmap, - int hotX=-1, int hotY=-1 ); - TQCursor( const TQCursor & ); - ~TQCursor(); - TQCursor &operator=( const TQCursor & ); - - int shape() const; - void setShape( int ); - - const TQBitmap *bitmap() const; - const TQBitmap *mask() const; - TQPoint hotSpot() const; - -#if defined(Q_WS_WIN) - HCURSOR handle() const; - TQCursor( HCURSOR ); -#elif defined(Q_WS_X11) - HANDLE handle() const; - TQCursor( HANDLE ); -#elif defined(Q_WS_MAC) - HANDLE handle() const; -#elif defined(Q_WS_QWS) - HANDLE handle() const; -#endif - - static TQPoint pos(); - static void setPos( int x, int y ); - static void setPos( const TQPoint & ); - - static void initialize(); - static void cleanup(); - -#if defined(Q_WS_X11) - static int x11Screen(); -#endif -private: - void setBitmap( const TQBitmap &bitmap, const TQBitmap &mask, - int hotX, int hotY ); - void update() const; - TQCursorData *data; - TQCursor *find_cur(int); -#if defined(Q_WS_MAC) - friend void qt_mac_set_cursor(const TQCursor *c, const Point *p); -#endif -}; - - -#if !defined(QT_CLEAN_NAMESPACE) -// CursorShape is defined in X11/X.h -#ifdef CursorShape -#define X_CursorShape CursorShape -#undef CursorShape -#endif -typedef TQt::CursorShape TQCursorShape; -#ifdef X_CursorShape -#define CursorShape X_CursorShape -#endif -#endif - - -/***************************************************************************** - TQCursor stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQCursor & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQCursor & ); -#endif -#endif // QT_NO_CURSOR - - -inline void TQCursor::setPos( const TQPoint &p ) -{ - setPos( p.x(), p.y() ); -} - -#endif // TQCURSOR_H diff --git a/src/kernel/qcursor_x11.cpp b/src/kernel/qcursor_x11.cpp index 2eccebbc4..b880988fb 100644 --- a/src/kernel/qcursor_x11.cpp +++ b/src/kernel/qcursor_x11.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qcursor.h" -#include "qbitmap.h" -#include "qimage.h" -#include "qapplication.h" -#include "qdatastream.h" -#include "qnamespace.h" +#include "ntqcursor.h" +#include "ntqbitmap.h" +#include "ntqimage.h" +#include "ntqapplication.h" +#include "ntqdatastream.h" +#include "ntqnamespace.h" #include "qt_x11_p.h" #include diff --git a/src/kernel/qdesktopwidget.h b/src/kernel/qdesktopwidget.h deleted file mode 100644 index 71fc28834..000000000 --- a/src/kernel/qdesktopwidget.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDesktopWidget class. -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDESKTOPWIDGET_H -#define TQDESKTOPWIDGET_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -class TQApplication; -class TQDesktopWidgetPrivate; /* Don't touch! */ - -class Q_EXPORT TQDesktopWidget : public TQWidget -{ - Q_OBJECT -public: - TQDesktopWidget(); - ~TQDesktopWidget(); - - bool isVirtualDesktop() const; - - int numScreens() const; - int primaryScreen() const; - - int screenNumber( TQWidget *widget = 0 ) const; // ### 4.0: const TQWidget* - int screenNumber( const TQPoint & ) const; - - TQWidget *screen( int screen = -1 ); - - const TQRect& screenGeometry( int screen = -1 ) const; - const TQRect& screenGeometry( TQWidget *widget ) const - { return screenGeometry( screenNumber( widget ) ); } - const TQRect& screenGeometry( const TQPoint &point ) const - { return screenGeometry( screenNumber( point ) ); } - - const TQRect& availableGeometry( int screen = -1 ) const; - const TQRect& availableGeometry( TQWidget *widget ) const - { return availableGeometry( screenNumber( widget ) ); } - const TQRect& availableGeometry( const TQPoint &point ) const - { return availableGeometry( screenNumber( point ) ); } - - void insertChild( TQObject * ); - - inline void emitResizedSignal(int value) { emit resized(value); } - -signals: - void resized( int ); - void workAreaResized( int ); - -protected: - void resizeEvent( TQResizeEvent *e ); - -private: - TQDesktopWidgetPrivate *d; - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDesktopWidget( const TQDesktopWidget & ); - TQDesktopWidget &operator=( const TQDesktopWidget & ); -#endif - - friend class TQApplication; -#ifdef Q_WS_QWS - friend class TQWSDisplay; -#endif -}; - -#endif //TQDESKTOPWIDGET_H diff --git a/src/kernel/qdesktopwidget_x11.cpp b/src/kernel/qdesktopwidget_x11.cpp index c4a9fc477..d8c10605b 100644 --- a/src/kernel/qdesktopwidget_x11.cpp +++ b/src/kernel/qdesktopwidget_x11.cpp @@ -36,9 +36,9 @@ ** **********************************************************************/ -#include "qdesktopwidget.h" -#include "qapplication.h" -#include "qobjectlist.h" +#include "ntqdesktopwidget.h" +#include "ntqapplication.h" +#include "ntqobjectlist.h" #include "qt_x11_p.h" #include diff --git a/src/kernel/qdnd_x11.cpp b/src/kernel/qdnd_x11.cpp index 759d960d4..8c64ce107 100644 --- a/src/kernel/qdnd_x11.cpp +++ b/src/kernel/qdnd_x11.cpp @@ -40,20 +40,20 @@ #include "qplatformdefs.h" -#include "qapplication.h" +#include "ntqapplication.h" #ifndef QT_NO_DRAGANDDROP -#include "qwidget.h" -#include "qintdict.h" -#include "qdatetime.h" -#include "qdict.h" -#include "qguardedptr.h" -#include "qdragobject.h" -#include "qobjectlist.h" -#include "qcursor.h" -#include "qbitmap.h" -#include "qpainter.h" +#include "ntqwidget.h" +#include "ntqintdict.h" +#include "ntqdatetime.h" +#include "ntqdict.h" +#include "ntqguardedptr.h" +#include "ntqdragobject.h" +#include "ntqobjectlist.h" +#include "ntqcursor.h" +#include "ntqbitmap.h" +#include "ntqpainter.h" #include "qt_x11_p.h" @@ -1484,7 +1484,7 @@ bool qt_xdnd_handle_badwindow() /*! - \class TQDragMoveEvent qevent.h + \class TQDragMoveEvent ntqevent.h \ingroup events \ingroup draganddrop \brief The TQDragMoveEvent class provides an event which is sent while a drag and drop is in progress. @@ -1658,7 +1658,7 @@ bool qt_dnd_enable( TQWidget* w, bool on ) /*! - \class TQDropEvent qevent.h + \class TQDropEvent ntqevent.h \ingroup events \ingroup draganddrop diff --git a/src/kernel/qdragobject.cpp b/src/kernel/qdragobject.cpp index bf838cc85..96653b1c2 100644 --- a/src/kernel/qdragobject.cpp +++ b/src/kernel/qdragobject.cpp @@ -45,15 +45,15 @@ #ifndef QT_NO_MIME -#include "qdragobject.h" -#include "qtextcodec.h" -#include "qapplication.h" -#include "qpoint.h" -#include "qwidget.h" -#include "qbuffer.h" -#include "qgif.h" -#include "qregexp.h" -#include "qdir.h" +#include "ntqdragobject.h" +#include "ntqtextcodec.h" +#include "ntqapplication.h" +#include "ntqpoint.h" +#include "ntqwidget.h" +#include "ntqbuffer.h" +#include "ntqgif.h" +#include "ntqregexp.h" +#include "ntqdir.h" #include // both a struct for storing stuff in and a wrapper to avoid polluting @@ -569,7 +569,7 @@ TQWidget * TQDragObject::source() /*! - \class TQDragObject qdragobject.h + \class TQDragObject ntqdragobject.h \brief The TQDragObject class encapsulates MIME-based data transfer. @@ -578,7 +578,7 @@ TQWidget * TQDragObject::source() TQDragObject is the base class for all data that needs to be transferred between and within applications, both for drag and - drop and for the \link qclipboard.html clipboard\endlink. + drop and for the \link ntqclipboard.html clipboard\endlink. See the \link dnd.html Drag-and-drop documentation\endlink for an overview of how to provide drag and drop in your application. @@ -674,7 +674,7 @@ void TQTextDrag::setSubtype( const TQCString & st) } /*! - \class TQTextDrag qdragobject.h + \class TQTextDrag ntqdragobject.h \brief The TQTextDrag class is a drag and drop object for transferring plain and Unicode text. @@ -989,7 +989,7 @@ public: /*! - \class TQImageDrag qdragobject.h + \class TQImageDrag ntqdragobject.h \brief The TQImageDrag class provides a drag and drop object for transferring images. @@ -1210,7 +1210,7 @@ bool TQImageDrag::decode( const TQMimeSource* e, TQPixmap& pm ) /*! - \class TQStoredDrag qdragobject.h + \class TQStoredDrag ntqdragobject.h \brief The TQStoredDrag class provides a simple stored-value drag object for arbitrary MIME data. \ingroup draganddrop @@ -1286,7 +1286,7 @@ TQByteArray TQStoredDrag::encodedData(const char* m) const /*! - \class TQUriDrag qdragobject.h + \class TQUriDrag ntqdragobject.h \brief The TQUriDrag class provides a drag object for a list of URI references. \ingroup draganddrop @@ -1703,7 +1703,7 @@ TQWidget* TQDropEvent::source() const #endif /*! - \class TQColorDrag qdragobject.h + \class TQColorDrag ntqdragobject.h \brief The TQColorDrag class provides a drag and drop object for transferring colors. diff --git a/src/kernel/qdragobject.h b/src/kernel/qdragobject.h deleted file mode 100644 index a392245b8..000000000 --- a/src/kernel/qdragobject.h +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDragObject -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDRAGOBJECT_H -#define TQDRAGOBJECT_H - -class TQWidget; -class TQTextDragPrivate; -class TQDragObjectData; -class TQStoredDragData; -class TQImageDragData; - -#ifndef QT_H -#include "qobject.h" -#include "qimage.h" -#include "qstrlist.h" -#include "qcolor.h" -#endif // QT_H - -#ifndef QT_NO_MIME - -class Q_EXPORT TQDragObject: public TQObject, public TQMimeSource { - Q_OBJECT -public: - TQDragObject( TQWidget * dragSource = 0, const char * name = 0 ); - virtual ~TQDragObject(); - -#ifndef QT_NO_DRAGANDDROP - bool drag(); - bool dragMove(); - void dragCopy(); - void dragLink(); - - virtual void setPixmap(TQPixmap); - virtual void setPixmap(TQPixmap, const TQPoint& hotspot); - TQPixmap pixmap() const; - TQPoint pixmapHotSpot() const; -#endif - - TQWidget * source(); - static TQWidget * target(); - - static void setTarget(TQWidget*); - -#ifndef QT_NO_DRAGANDDROP - enum DragMode { DragDefault, DragCopy, DragMove, DragLink, DragCopyOrMove }; - -protected: - virtual bool drag(DragMode); -#endif - -private: - TQDragObjectData * d; -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDragObject( const TQDragObject & ); - TQDragObject &operator=( const TQDragObject & ); -#endif -}; - -class Q_EXPORT TQStoredDrag: public TQDragObject { - Q_OBJECT - TQStoredDragData * d; - -public: - TQStoredDrag( const char * mimeType, - TQWidget * dragSource = 0, const char * name = 0 ); - ~TQStoredDrag(); - - virtual void setEncodedData( const TQByteArray & ); - - const char * format(int i) const; - virtual TQByteArray encodedData(const char*) const; - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQStoredDrag( const TQStoredDrag & ); - TQStoredDrag &operator=( const TQStoredDrag & ); -#endif -}; - -class Q_EXPORT TQTextDrag: public TQDragObject { - Q_OBJECT - TQTextDragPrivate* d; -public: - TQTextDrag( const TQString &, - TQWidget * dragSource = 0, const char * name = 0 ); - TQTextDrag( TQWidget * dragSource = 0, const char * name = 0 ); - ~TQTextDrag(); - - virtual void setText( const TQString &); - virtual void setSubtype( const TQCString &); - - const char * format(int i) const; - virtual TQByteArray encodedData(const char*) const; - - static bool canDecode( const TQMimeSource* e ); - static bool decode( const TQMimeSource* e, TQString& s ); - static bool decode( const TQMimeSource* e, TQString& s, TQCString& subtype ); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQTextDrag( const TQTextDrag & ); - TQTextDrag &operator=( const TQTextDrag & ); -#endif -}; - -class Q_EXPORT TQImageDrag: public TQDragObject { - Q_OBJECT - TQImage img; - TQStrList ofmts; - TQImageDragData* d; - -public: - TQImageDrag( TQImage image, TQWidget * dragSource = 0, const char * name = 0 ); - TQImageDrag( TQWidget * dragSource = 0, const char * name = 0 ); - ~TQImageDrag(); - - virtual void setImage( TQImage image ); - - const char * format(int i) const; - virtual TQByteArray encodedData(const char*) const; - - static bool canDecode( const TQMimeSource* e ); - static bool decode( const TQMimeSource* e, TQImage& i ); - static bool decode( const TQMimeSource* e, TQPixmap& i ); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQImageDrag( const TQImageDrag & ); - TQImageDrag &operator=( const TQImageDrag & ); -#endif -}; - - -class Q_EXPORT TQUriDrag: public TQStoredDrag { - Q_OBJECT - -public: - TQUriDrag( TQStrList uris, TQWidget * dragSource = 0, const char * name = 0 ); - TQUriDrag( TQWidget * dragSource = 0, const char * name = 0 ); - ~TQUriDrag(); - - void setFilenames( const TQStringList & fnames ) { setFileNames( fnames ); } - void setFileNames( const TQStringList & fnames ); - void setUnicodeUris( const TQStringList & uuris ); - virtual void setUris( TQStrList uris ); - - 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* e ); - static bool decode( const TQMimeSource* e, TQStrList& i ); - static bool decodeToUnicodeUris( const TQMimeSource* e, TQStringList& i ); - static bool decodeLocalFiles( const TQMimeSource* e, TQStringList& i ); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQUriDrag( const TQUriDrag & ); - TQUriDrag &operator=( const TQUriDrag & ); -#endif -}; - -class Q_EXPORT TQColorDrag : public TQStoredDrag -{ - Q_OBJECT - TQColor color; - -public: - TQColorDrag( const TQColor &col, TQWidget *dragsource = 0, const char *name = 0 ); - TQColorDrag( TQWidget * dragSource = 0, const char * name = 0 ); - void setColor( const TQColor &col ); - - static bool canDecode( TQMimeSource * ); - static bool decode( TQMimeSource *, TQColor &col ); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQColorDrag( const TQColorDrag & ); - TQColorDrag &operator=( const TQColorDrag & ); -#endif -}; - -#ifndef QT_NO_COMPAT -typedef TQUriDrag TQUrlDrag; -#endif - -#ifndef QT_NO_DRAGANDDROP - -// TQDragManager is not part of the public API. It is defined in a -// header file simply so different .cpp files can implement different -// member functions. -// - -class Q_EXPORT TQDragManager: public TQObject { - Q_OBJECT - -private: - TQDragManager(); - ~TQDragManager(); - // only friend classes can use TQDragManager. - friend class TQDragObject; - friend class TQDragMoveEvent; - friend class TQDropEvent; - friend class TQApplication; - - bool eventFilter( TQObject *, TQEvent * ); - void timerEvent( TQTimerEvent* ); - - bool drag( TQDragObject *, TQDragObject::DragMode ); - - void cancel( bool deleteSource = TRUE ); - void move( const TQPoint & ); - void drop(); - void updatePixmap(); - void updatePixmap( const TQPoint& cursorPos ); - -private: - TQDragObject * object; - bool updateMode( ButtonState newstate ); - void updateCursor(); -#if defined(Q_WS_X11) - void createCursors(); -#endif - - TQWidget * dragSource; - TQWidget * dropWidget; - bool beingCancelled; - bool restoreCursor; - bool willDrop; - - TQPixmap *pm_cursor; - int n_cursor; -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDragManager( const TQDragManager & ); - TQDragManager &operator=( const TQDragManager & ); -#endif -}; - -#endif - -#endif // QT_NO_MIME - -#endif // TQDRAGOBJECT_H diff --git a/src/kernel/qdrawutil.cpp b/src/kernel/qdrawutil.cpp index fa271c978..d9505797b 100644 --- a/src/kernel/qdrawutil.cpp +++ b/src/kernel/qdrawutil.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qdrawutil.h" +#include "ntqdrawutil.h" #ifndef QT_NO_DRAWUTIL -#include "qbitmap.h" -#include "qpixmapcache.h" -#include "qapplication.h" -#include "qpainter.h" +#include "ntqbitmap.h" +#include "ntqpixmapcache.h" +#include "ntqapplication.h" +#include "ntqpainter.h" /*! \relates TQPainter - \c{#include } + \c{#include } Draws a horizontal (\a y1 == \a y2) or vertical (\a x1 == \a x2) shaded line using the painter \a p. @@ -166,7 +166,7 @@ void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, /*! \relates TQPainter - \c{#include } + \c{#include } Draws the shaded rectangle specified by (\a x, \a y, \a w, \a h) using the painter \a p. @@ -272,7 +272,7 @@ void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, /*! \relates TQPainter - \c{#include } + \c{#include } Draws the shaded panel specified by (\a x, \a y, \a w, \a h) using the painter \a p. @@ -427,7 +427,7 @@ static void qDrawWinShades( TQPainter *p, /*! \relates TQPainter - \c{#include } + \c{#include } Draws the Windows-style button specified by (\a x, \a y, \a w, \a h) using the painter \a p. @@ -466,7 +466,7 @@ void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, /*! \relates TQPainter - \c{#include } + \c{#include } Draws the Windows-style panel specified by (\a x, \a y, \a w, \a h) using the painter \a p. @@ -508,7 +508,7 @@ void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, /*! \relates TQPainter - \c{#include } + \c{#include } Draws the plain rectangle specified by (\a x, \a y, \a w, \a h) using the painter \a p. diff --git a/src/kernel/qdrawutil.h b/src/kernel/qdrawutil.h deleted file mode 100644 index f75cab52c..000000000 --- a/src/kernel/qdrawutil.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Definition of draw utilities -** -** Created : 950920 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDRAWUTIL_H -#define TQDRAWUTIL_H - -#ifndef QT_H -#include "qnamespace.h" -#include "qstring.h" // char*->TQString conversion -#endif // QT_H - -class TQPainter; -class TQColorGroup; -class TQPoint; -class TQBrush; -class TQRect; -class TQPixmap; - -#ifndef QT_NO_DRAWUTIL -// -// Standard shade drawing -// - -Q_EXPORT void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, - const TQColorGroup &g, bool sunken = TRUE, - int lineWidth = 1, int midLineWidth = 0 ); - -Q_EXPORT void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, - const TQColorGroup &g, bool sunken = TRUE, - int lineWidth = 1, int midLineWidth = 0 ); - -Q_EXPORT void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, int midLineWidth = 0, - const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawShadeRect( TQPainter *p, const TQRect &r, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, int midLineWidth = 0, - const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawShadePanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawShadePanel( TQPainter *p, const TQRect &r, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken = FALSE, - const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawWinButton( TQPainter *p, const TQRect &r, - const TQColorGroup &g, bool sunken = FALSE, - const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken=FALSE, - const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawWinPanel( TQPainter *p, const TQRect &r, - const TQColorGroup &, bool sunken=FALSE, - const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawPlainRect( TQPainter *p, int x, int y, int w, int h, const TQColor &, - int lineWidth = 1, const TQBrush *fill = 0 ); - -Q_EXPORT void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &, - int lineWidth = 1, const TQBrush *fill = 0 ); - - -// -// Other obsolete drawing functions. -// Use TQStyle::itemRect(), TQStyle::drawItem() and TQStyle::drawArrow() instead. -// -Q_EXPORT TQRect qItemRect( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, - int flags, bool enabled, - const TQPixmap *pixmap, const TQString& text, int len=-1 ); - -Q_EXPORT void qDrawItem( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, - int flags, const TQColorGroup &g, bool enabled, - const TQPixmap *pixmap, const TQString& text, - int len=-1, const TQColor* penColor = 0 ); - -Q_EXPORT void qDrawArrow( TQPainter *p, TQt::ArrowType type, TQt::GUIStyle style, bool down, - int x, int y, int w, int h, - const TQColorGroup &g, bool enabled ); - -#endif // QT_NO_DRAWUTIL -#endif // TQDRAWUTIL_H diff --git a/src/kernel/qdropsite.cpp b/src/kernel/qdropsite.cpp index 412720416..07dd965dc 100644 --- a/src/kernel/qdropsite.cpp +++ b/src/kernel/qdropsite.cpp @@ -36,16 +36,16 @@ ** **********************************************************************/ -#include "qdropsite.h" +#include "ntqdropsite.h" #ifndef QT_NO_DRAGANDDROP -#include "qwidget.h" +#include "ntqwidget.h" // NOT REVISED /*! - \class TQDropSite qdropsite.h + \class TQDropSite ntqdropsite.h \brief The TQDropSite class provides nothing and does nothing. \obsolete diff --git a/src/kernel/qdropsite.h b/src/kernel/qdropsite.h deleted file mode 100644 index 0099bb2a2..000000000 --- a/src/kernel/qdropsite.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Definitation of Drag and Drop support -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDROPSITE_H -#define TQDROPSITE_H - -#ifndef QT_H -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H -#endif - - -class TQWidget; - - -class Q_EXPORT TQDropSite { -public: - TQDropSite( TQWidget* parent ); - virtual ~TQDropSite(); -}; - - -#endif // TQDROPSITE_H diff --git a/src/kernel/qevent.cpp b/src/kernel/qevent.cpp index 75bcb2244..9c9aace01 100644 --- a/src/kernel/qevent.cpp +++ b/src/kernel/qevent.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qevent.h" -#include "qcursor.h" -#include "qapplication.h" +#include "ntqevent.h" +#include "ntqcursor.h" +#include "ntqapplication.h" /*! - \class TQEvent qevent.h + \class TQEvent ntqevent.h \brief The TQEvent class is the base class of all event classes. Event objects contain event parameters. @@ -210,7 +210,7 @@ /*! - \class TQTimerEvent qevent.h + \class TQTimerEvent ntqevent.h \brief The TQTimerEvent class contains parameters that describe a timer event. @@ -245,7 +245,7 @@ /*! - \class TQMouseEvent qevent.h + \class TQMouseEvent ntqevent.h \ingroup events \brief The TQMouseEvent class contains parameters that describe a mouse event. @@ -480,7 +480,7 @@ TQt::ButtonState TQMouseEvent::stateAfter() const /*! - \class TQWheelEvent qevent.h + \class TQWheelEvent ntqevent.h \brief The TQWheelEvent class contains parameters that describe a wheel event. \ingroup events @@ -680,7 +680,7 @@ TQWheelEvent::TQWheelEvent( const TQPoint &pos, int delta, int state, Orientatio */ /*! - \class TQKeyEvent qevent.h + \class TQKeyEvent ntqevent.h \brief The TQKeyEvent class contains describes a key event. \ingroup events @@ -1152,7 +1152,7 @@ TQt::ButtonState TQKeyEvent::stateAfter() const /*! - \class TQFocusEvent qevent.h + \class TQFocusEvent ntqevent.h \brief The TQFocusEvent class contains event parameters for widget focus events. @@ -1256,7 +1256,7 @@ void TQFocusEvent::resetReason() /*! - \class TQPaintEvent qevent.h + \class TQPaintEvent ntqevent.h \brief The TQPaintEvent class contains event parameters for paint events. \ingroup events @@ -1328,7 +1328,7 @@ void TQFocusEvent::resetReason() */ /*! - \class TQMoveEvent qevent.h + \class TQMoveEvent ntqevent.h \brief The TQMoveEvent class contains event parameters for move events. \ingroup events @@ -1363,7 +1363,7 @@ void TQFocusEvent::resetReason() /*! - \class TQResizeEvent qevent.h + \class TQResizeEvent ntqevent.h \brief The TQResizeEvent class contains event parameters for resize events. \ingroup events @@ -1397,7 +1397,7 @@ void TQFocusEvent::resetReason() /*! - \class TQCloseEvent qevent.h + \class TQCloseEvent ntqevent.h \brief The TQCloseEvent class contains parameters that describe a close event. \ingroup events @@ -1499,7 +1499,7 @@ void TQFocusEvent::resetReason() */ /*! - \class TQIconDragEvent qevent.h + \class TQIconDragEvent ntqevent.h \brief The TQIconDragEvent class signals that a main icon drag has begun. \ingroup events @@ -1554,7 +1554,7 @@ void TQFocusEvent::resetReason() */ /*! - \class TQContextMenuEvent qevent.h + \class TQContextMenuEvent ntqevent.h \brief The TQContextMenuEvent class contains parameters that describe a context menu event. \ingroup events @@ -1766,7 +1766,7 @@ TQContextMenuEvent::TQContextMenuEvent( Reason reason, const TQPoint &pos, int s /*! - \class TQIMEvent qevent.h + \class TQIMEvent ntqevent.h \brief The TQIMEvent class provides parameters for input method events. \ingroup events @@ -1905,7 +1905,7 @@ TQContextMenuEvent::TQContextMenuEvent( Reason reason, const TQPoint &pos, int s */ /*! - \class TQTabletEvent qevent.h + \class TQTabletEvent ntqevent.h \brief The TQTabletEvent class contains parameters that describe a Tablet event. @@ -2148,7 +2148,7 @@ TQTabletEvent::TQTabletEvent( Type t, const TQPoint &pos, const TQPoint &globalP */ /*! - \class TQChildEvent qevent.h + \class TQChildEvent ntqevent.h \brief The TQChildEvent class contains event parameters for child object events. @@ -2202,7 +2202,7 @@ TQTabletEvent::TQTabletEvent( Type t, const TQPoint &pos, const TQPoint &globalP /*! - \class TQCustomEvent qevent.h + \class TQCustomEvent ntqevent.h \brief The TQCustomEvent class provides support for custom events. \ingroup events @@ -2455,7 +2455,7 @@ TQCustomEvent::TQCustomEvent( int type ) /*! - \class TQDragEnterEvent qevent.h + \class TQDragEnterEvent ntqevent.h \brief The TQDragEnterEvent class provides an event which is sent to the widget when a drag and drop first drags onto the widget. \ingroup events @@ -2479,7 +2479,7 @@ TQCustomEvent::TQCustomEvent( int type ) */ /*! - \class TQDragLeaveEvent qevent.h + \class TQDragLeaveEvent ntqevent.h \brief The TQDragLeaveEvent class provides an event which is sent to the widget when a drag and drop leaves the widget. \ingroup events @@ -2502,7 +2502,7 @@ TQCustomEvent::TQCustomEvent( int type ) */ /*! - \class TQHideEvent qevent.h + \class TQHideEvent ntqevent.h \brief The TQHideEvent class provides an event which is sent after a widget is hidden. \ingroup events @@ -2527,7 +2527,7 @@ TQCustomEvent::TQCustomEvent( int type ) */ /*! - \class TQShowEvent qevent.h + \class TQShowEvent ntqevent.h \brief The TQShowEvent class provides an event which is sent when a widget is shown. \ingroup events diff --git a/src/kernel/qevent.h b/src/kernel/qevent.h deleted file mode 100644 index 8f444f8f0..000000000 --- a/src/kernel/qevent.h +++ /dev/null @@ -1,617 +0,0 @@ -/**************************************************************************** -** -** Definition of event classes -** -** Created : 931029 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQEVENT_H -#define TQEVENT_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qregion.h" -#include "qnamespace.h" -#include "qmime.h" -#include "qpair.h" -#endif // QT_H - -class Q_EXPORT TQEvent: public TQt // event base class -{ -public: - enum Type { - - /* - If you get a strange compiler error on the line with None, - it's probably because you're also including X11 headers, - which #define the symbol None. Put the X11 includes after - the TQt includes to solve this problem. - */ - - None = 0, // invalid event - - - Timer = 1, // timer event - MouseButtonPress = 2, // mouse button pressed - MouseButtonRelease = 3, // mouse button released - MouseButtonDblClick = 4, // mouse button double click - MouseMove = 5, // mouse move - KeyPress = 6, // key pressed - KeyRelease = 7, // key released - FocusIn = 8, // keyboard focus received - FocusOut = 9, // keyboard focus lost - Enter = 10, // mouse enters widget - Leave = 11, // mouse leaves widget - Paint = 12, // paint widget - Move = 13, // move widget - Resize = 14, // resize widget - Create = 15, // after object creation - Destroy = 16, // during object destruction - Show = 17, // widget is shown - Hide = 18, // widget is hidden - Close = 19, // request to close widget - Quit = 20, // request to quit application - Reparent = 21, // widget has been reparented - ShowMinimized = 22, // widget is shown minimized - ShowNormal = 23, // widget is shown normal - WindowActivate = 24, // window was activated - WindowDeactivate = 25, // window was deactivated - ShowToParent = 26, // widget is shown to parent - HideToParent = 27, // widget is hidden to parent - ShowMaximized = 28, // widget is shown maximized - ShowFullScreen = 29, // widget is shown full-screen - Accel = 30, // accelerator event - Wheel = 31, // wheel event - AccelAvailable = 32, // accelerator available event - CaptionChange = 33, // caption changed - IconChange = 34, // icon changed - ParentFontChange = 35, // parent font changed - ApplicationFontChange = 36, // application font changed - ParentPaletteChange = 37, // parent palette changed - ApplicationPaletteChange = 38, // application palette changed - PaletteChange = 39, // widget palette changed - Clipboard = 40, // internal clipboard event - Speech = 42, // reserved for speech input - SockAct = 50, // socket activation - AccelOverride = 51, // accelerator override event - DeferredDelete = 52, // deferred delete event - DragEnter = 60, // drag moves into widget - DragMove = 61, // drag moves in widget - DragLeave = 62, // drag leaves or is cancelled - Drop = 63, // actual drop - DragResponse = 64, // drag accepted/rejected - ChildInserted = 70, // new child widget - ChildRemoved = 71, // deleted child widget - LayoutHint = 72, // child min/max size changed - ShowWindowRequest = 73, // widget's window should be mapped - WindowBlocked = 74, // window is about to be blocked modally - WindowUnblocked = 75, // windows modal blocking has ended - ActivateControl = 80, // ActiveX activation - DeactivateControl = 81, // ActiveX deactivation - ContextMenu = 82, // context popup menu - IMStart = 83, // input method composition start - IMCompose = 84, // input method composition - IMEnd = 85, // input method composition end - Accessibility = 86, // accessibility information is requested - TabletMove = 87, // Wacom tablet event - LocaleChange = 88, // the system locale changed - LanguageChange = 89, // the application language changed - LayoutDirectionChange = 90, // the layout direction changed - Style = 91, // internal style event - TabletPress = 92, // tablet press - TabletRelease = 93, // tablet release - OkRequest = 94, // CE (Ok) button pressed - HelpRequest = 95, // CE (?) button pressed - WindowStateChange = 96, // window state has changed - IconDrag = 97, // proxy icon dragged - User = 1000, // first user event id - MaxUser = 65535 // last user event id - }; - - - TQEvent( Type type ) : t(type), posted(FALSE), spont(FALSE) {} - virtual ~TQEvent(); - Type type() const { return t; } - bool spontaneous() const { return spont; } -protected: - Type t; -private: - uint posted : 1; - uint spont : 1; - - - friend class TQApplication; - friend class TQAccelManager; - friend class TQBaseApplication; - friend class TQETWidget; -}; - - -class Q_EXPORT TQTimerEvent : public TQEvent -{ -public: - TQTimerEvent( int timerId ) - : TQEvent(Timer), id(timerId) {} - int timerId() const { return id; } -protected: - int id; -}; - - -class Q_EXPORT TQMouseEvent : public TQEvent -{ -public: - TQMouseEvent( Type type, const TQPoint &pos, int button, int state ); - - TQMouseEvent( Type type, const TQPoint &pos, const TQPoint&globalPos, - int button, int state ) - : TQEvent(type), p(pos), g(globalPos), b((ushort)button),s((ushort)state),accpt(TRUE) {}; - - const TQPoint &pos() const { return p; } - const TQPoint &globalPos() const { return g; } - int x() const { return p.x(); } - int y() const { return p.y(); } - int globalX() const { return g.x(); } - int globalY() const { return g.y(); } - ButtonState button() const { return (ButtonState) b; } - ButtonState state() const { return (ButtonState) s; } - ButtonState stateAfter() const; - bool isAccepted() const { return accpt; } - void accept() { accpt = TRUE; } - void ignore() { accpt = FALSE; } -protected: - TQPoint p; - TQPoint g; - ushort b; - ushort s; - uint accpt:1; -}; - - -#ifndef QT_NO_WHEELEVENT -class Q_EXPORT TQWheelEvent : public TQEvent -{ -public: - TQWheelEvent( const TQPoint &pos, int delta, int state, Orientation orient = Vertical ); - TQWheelEvent( const TQPoint &pos, const TQPoint& globalPos, int delta, int state, Orientation orient = Vertical ) - : TQEvent(Wheel), p(pos), g(globalPos), d(delta), s((ushort)state), - accpt(TRUE), o(orient) {} - int delta() const { return d; } - const TQPoint &pos() const { return p; } - const TQPoint &globalPos() const { return g; } - int x() const { return p.x(); } - int y() const { return p.y(); } - int globalX() const { return g.x(); } - int globalY() const { return g.y(); } - ButtonState state() const { return ButtonState(s); } - Orientation orientation() const { return o; } - bool isAccepted() const { return accpt; } - void accept() { accpt = TRUE; } - void ignore() { accpt = FALSE; } -protected: - TQPoint p; - TQPoint g; - int d; - ushort s; - bool accpt; - Orientation o; -}; -#endif - -class Q_EXPORT TQTabletEvent : public TQEvent -{ -public: - enum TabletDevice { NoDevice = -1, Puck, Stylus, Eraser }; - TQTabletEvent( Type t, const TQPoint &pos, const TQPoint &globalPos, int device, - int pressure, int xTilt, int yTilt, const TQPair &uId ); - TQTabletEvent( const TQPoint &pos, const TQPoint &globalPos, int device, - int pressure, int xTilt, int yTilt, const TQPair &uId ) - : TQEvent( TabletMove ), mPos( pos ), mGPos( globalPos ), mDev( device ), - mPress( pressure ), mXT( xTilt ), mYT( yTilt ), mType( uId.first ), - mPhy( uId.second ), mbAcc(TRUE) - {} - int pressure() const { return mPress; } - int xTilt() const { return mXT; } - int yTilt() const { return mYT; } - const TQPoint &pos() const { return mPos; } - const TQPoint &globalPos() const { return mGPos; } - int x() const { return mPos.x(); } - int y() const { return mPos.y(); } - int globalX() const { return mGPos.x(); } - int globalY() const { return mGPos.y(); } - TabletDevice device() const { return TabletDevice(mDev); } - int isAccepted() const { return mbAcc; } - void accept() { mbAcc = TRUE; } - void ignore() { mbAcc = FALSE; } - TQPair uniqueId() { return TQPair( mType, mPhy); } -protected: - TQPoint mPos; - TQPoint mGPos; - int mDev, - mPress, - mXT, - mYT, - mType, - mPhy; - bool mbAcc; - -}; - -class Q_EXPORT TQKeyEvent : public TQEvent -{ -public: - TQKeyEvent( Type type, int key, int ascii, int state, - const TQString& text=TQString::null, bool autorep=FALSE, ushort count=1 ) - : TQEvent(type), txt(text), k((ushort)key), s((ushort)state), - a((uchar)ascii), accpt(TRUE), autor(autorep), c(count) - { - if ( key >= Key_Back && key <= Key_MediaLast ) - accpt = FALSE; - } - int key() const { return k; } - int ascii() const { return a; } - ButtonState state() const { return ButtonState(s); } - ButtonState stateAfter() const; - bool isAccepted() const { return accpt; } - TQString text() const { return txt; } - bool isAutoRepeat() const { return autor; } - int count() const { return int(c); } - void accept() { accpt = TRUE; } - void ignore() { accpt = FALSE; } - -protected: - TQString txt; - ushort k, s; - uchar a; - uint accpt:1; - uint autor:1; - ushort c; -}; - - -class Q_EXPORT TQFocusEvent : public TQEvent -{ -public: - - TQFocusEvent( Type type ) - : TQEvent(type) {} - - bool gotFocus() const { return type() == FocusIn; } - bool lostFocus() const { return type() == FocusOut; } - - enum Reason { Mouse, Tab, Backtab, ActiveWindow, Popup, Shortcut, Other }; - static Reason reason(); - static void setReason( Reason reason ); - static void resetReason(); - -private: - static Reason m_reason; - static Reason prev_reason; -}; - - -class Q_EXPORT TQPaintEvent : public TQEvent -{ -public: - TQPaintEvent( const TQRegion& paintRegion, bool erased = TRUE) - : TQEvent(Paint), - rec(paintRegion.boundingRect()), - reg(paintRegion), - erase(erased){} - TQPaintEvent( const TQRect &paintRect, bool erased = TRUE ) - : TQEvent(Paint), - rec(paintRect), - reg(paintRect), - erase(erased){} - TQPaintEvent( const TQRegion &paintRegion, const TQRect &paintRect, bool erased = TRUE ) - : TQEvent(Paint), - rec(paintRect), - reg(paintRegion), - erase(erased){} - - const TQRect &rect() const { return rec; } - const TQRegion ®ion() const { return reg; } - bool erased() const { return erase; } -protected: - friend class TQApplication; - friend class TQBaseApplication; - TQRect rec; - TQRegion reg; - bool erase; -}; - - -class Q_EXPORT TQMoveEvent : public TQEvent -{ -public: - TQMoveEvent( const TQPoint &pos, const TQPoint &oldPos ) - : TQEvent(Move), p(pos), oldp(oldPos) {} - const TQPoint &pos() const { return p; } - const TQPoint &oldPos()const { return oldp;} -protected: - TQPoint p, oldp; - friend class TQApplication; - friend class TQBaseApplication; -}; - - -class Q_EXPORT TQResizeEvent : public TQEvent -{ -public: - TQResizeEvent( const TQSize &size, const TQSize &oldSize ) - : TQEvent(Resize), s(size), olds(oldSize) {} - const TQSize &size() const { return s; } - const TQSize &oldSize()const { return olds;} -protected: - TQSize s, olds; - friend class TQApplication; - friend class TQBaseApplication; -}; - - -class Q_EXPORT TQCloseEvent : public TQEvent -{ -public: - TQCloseEvent() - : TQEvent(Close), accpt(FALSE) {} - bool isAccepted() const { return accpt; } - void accept() { accpt = TRUE; } - void ignore() { accpt = FALSE; } -protected: - bool accpt; -}; - - -class Q_EXPORT TQIconDragEvent : public TQEvent -{ -public: - TQIconDragEvent() - : TQEvent(IconDrag), accpt(FALSE) {} - - bool isAccepted() const { return accpt; } - void accept() { accpt = TRUE; } - void ignore() { accpt = FALSE; } -protected: - bool accpt; -}; - -class Q_EXPORT TQShowEvent : public TQEvent -{ -public: - TQShowEvent() - : TQEvent(Show) {} -}; - - -class Q_EXPORT TQHideEvent : public TQEvent -{ -public: - TQHideEvent() - : TQEvent(Hide) {} -}; - -class Q_EXPORT TQContextMenuEvent : public TQEvent -{ -public: - enum Reason { Mouse, Keyboard, Other }; - TQContextMenuEvent( Reason reason, const TQPoint &pos, const TQPoint &globalPos, int state ) - : TQEvent( ContextMenu ), p( pos ), gp( globalPos ), accpt( TRUE ), consum( TRUE ), - reas( reason ), s((ushort)state) {} - TQContextMenuEvent( Reason reason, const TQPoint &pos, int state ); - - int x() const { return p.x(); } - int y() const { return p.y(); } - int globalX() const { return gp.x(); } - int globalY() const { return gp.y(); } - - const TQPoint& pos() const { return p; } - const TQPoint& globalPos() const { return gp; } - - ButtonState state() const { return (ButtonState) s; } - bool isAccepted() const { return accpt; } - bool isConsumed() const { return consum; } - void consume() { accpt = FALSE; consum = TRUE; } - void accept() { accpt = TRUE; consum = TRUE; } - void ignore() { accpt = FALSE; consum = FALSE; } - - Reason reason() const { return Reason( reas ); } - -protected: - TQPoint p; - TQPoint gp; - bool accpt; - bool consum; - uint reas:8; - ushort s; -}; - - -class Q_EXPORT TQIMEvent : public TQEvent -{ -public: - TQIMEvent( Type type, const TQString &text, int cursorPosition ) - : TQEvent(type), txt(text), cpos(cursorPosition), a(TRUE) {} - const TQString &text() const { return txt; } - int cursorPos() const { return cpos; } - bool isAccepted() const { return a; } - void accept() { a = TRUE; } - void ignore() { a = FALSE; } - int selectionLength() const; - -private: - TQString txt; - int cpos; - bool a; -}; - -class Q_EXPORT TQIMComposeEvent : public TQIMEvent -{ -public: - TQIMComposeEvent( Type type, const TQString &text, int cursorPosition, - int selLength ) - : TQIMEvent( type, text, cursorPosition ), selLen( selLength ) { } - -private: - int selLen; - - friend class TQIMEvent; -}; - -inline int TQIMEvent::selectionLength() const -{ - if ( type() != IMCompose ) return 0; - TQIMComposeEvent *that = (TQIMComposeEvent *) this; - return that->selLen; -} - - -#ifndef QT_NO_DRAGANDDROP - -// This class is rather closed at the moment. If you need to create your -// own DND event objects, write to qt-bugs@trolltech.com and we'll try to -// find a way to extend it so it covers your needs. - -class Q_EXPORT TQDropEvent : public TQEvent, public TQMimeSource -{ -public: - TQDropEvent( const TQPoint& pos, Type typ=Drop ) - : TQEvent(typ), p(pos), - act(0), accpt(0), accptact(0), resv(0), - d(0) - {} - const TQPoint &pos() const { return p; } - bool isAccepted() const { return accpt || accptact; } - void accept(bool y=TRUE) { accpt = y; } - void ignore() { accpt = FALSE; } - - bool isActionAccepted() const { return accptact; } - void acceptAction(bool y=TRUE) { accptact = y; } - enum Action { Copy, Link, Move, Private, UserAction=100 }; - void setAction( Action a ) { act = (uint)a; } - Action action() const { return Action(act); } - - TQWidget* source() const; - const char* format( int n = 0 ) const; - TQByteArray encodedData( const char* ) const; - bool provides( const char* ) const; - - TQByteArray data(const char* f) const { return encodedData(f); } - - void setPoint( const TQPoint& np ) { p = np; } - -protected: - TQPoint p; - uint act:8; - uint accpt:1; - uint accptact:1; - uint resv:5; - void * d; -}; - - - -class Q_EXPORT TQDragMoveEvent : public TQDropEvent -{ -public: - TQDragMoveEvent( const TQPoint& pos, Type typ=DragMove ) - : TQDropEvent(pos,typ), - rect( pos, TQSize( 1, 1 ) ) {} - TQRect answerRect() const { return rect; } - void accept( bool y=TRUE ) { TQDropEvent::accept(y); } - void accept( const TQRect & r) { accpt = TRUE; rect = r; } - void ignore( const TQRect & r) { accpt =FALSE; rect = r; } - void ignore() { TQDropEvent::ignore(); } - -protected: - TQRect rect; -}; - - -class Q_EXPORT TQDragEnterEvent : public TQDragMoveEvent -{ -public: - TQDragEnterEvent( const TQPoint& pos ) : - TQDragMoveEvent(pos, DragEnter) { } -}; - - -/* An internal class */ -class Q_EXPORT TQDragResponseEvent : public TQEvent -{ -public: - TQDragResponseEvent( bool accepted ) - : TQEvent(DragResponse), a(accepted) {} - bool dragAccepted() const { return a; } -protected: - bool a; -}; - - -class Q_EXPORT TQDragLeaveEvent : public TQEvent -{ -public: - TQDragLeaveEvent() - : TQEvent(DragLeave) {} -}; - -#endif // QT_NO_DRAGANDDROP - -class Q_EXPORT TQChildEvent : public TQEvent -{ -public: - TQChildEvent( Type type, TQObject *child ) - : TQEvent(type), c(child) {} - TQObject *child() const { return c; } - bool inserted() const { return t == ChildInserted; } - bool removed() const { return t == ChildRemoved; } -protected: - TQObject *c; -}; - - -class Q_EXPORT TQCustomEvent : public TQEvent -{ -public: - TQCustomEvent( int type ); - TQCustomEvent( Type type, void *data ) - : TQEvent(type), d(data) {}; - void *data() const { return d; } - void setData( void* data ) { d = data; } -private: - void *d; -}; - -#endif // TQEVENT_H diff --git a/src/kernel/qeventloop.cpp b/src/kernel/qeventloop.cpp index 3ad30a41e..f09d3e9a8 100644 --- a/src/kernel/qeventloop.cpp +++ b/src/kernel/qeventloop.cpp @@ -37,9 +37,9 @@ **********************************************************************/ #include "qeventloop_p.h" // includes qplatformdefs.h -#include "qeventloop.h" -#include "qapplication.h" -#include "qdatetime.h" +#include "ntqeventloop.h" +#include "ntqapplication.h" +#include "ntqdatetime.h" /*! \class TQEventLoop diff --git a/src/kernel/qeventloop.h b/src/kernel/qeventloop.h deleted file mode 100644 index eae247846..000000000 --- a/src/kernel/qeventloop.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Declaration of TQEventLoop class -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQEVENTLOOP_H -#define TQEVENTLOOP_H - -#ifndef QT_H -#include "qobject.h" -#include "qsocketnotifier.h" -#endif // QT_H - -class TQEventLoopPrivate; -class TQSocketNotifier; -class TQTimer; -#ifdef Q_WS_MAC -struct timeval; //stdc struct -struct TimerInfo; //internal structure (qeventloop_mac.cpp) -#endif - -#if defined(QT_THREAD_SUPPORT) -class TQMutex; -#endif // QT_THREAD_SUPPORT - - -class Q_EXPORT TQEventLoop : public TQObject -{ - Q_OBJECT - -public: - TQEventLoop( TQObject *parent = 0, const char *name = 0 ); - ~TQEventLoop(); - - enum ProcessEvents { - AllEvents = 0x00, - ExcludeUserInput = 0x01, - ExcludeSocketNotifiers = 0x02, - WaitForMore = 0x04 - }; - typedef uint ProcessEventsFlags; - - void processEvents( ProcessEventsFlags flags, int maxtime ); - virtual bool processEvents( ProcessEventsFlags flags ); - - virtual bool hasPendingEvents() const; - - virtual void registerSocketNotifier( TQSocketNotifier * ); - virtual void unregisterSocketNotifier( TQSocketNotifier * ); - void setSocketNotifierPending( TQSocketNotifier * ); - int activateSocketNotifiers(); - - int activateTimers(); - int timeToWait() const; - - virtual int exec(); - virtual void exit( int retcode = 0 ); - - virtual int enterLoop(); - virtual void exitLoop(); - virtual int loopLevel() const; - - virtual void wakeUp(); - -signals: - void awake(); - void aboutToBlock(); - -private: -#if defined(Q_WS_MAC) - friend TQMAC_PASCAL void qt_mac_select_timer_callbk(EventLoopTimerRef, void *); - int macHandleSelect(timeval *); - void macHandleTimer(TimerInfo *); -#endif // Q_WS_MAC - - // internal initialization/cleanup - implemented in various platform specific files - void init(); - void cleanup(); - virtual void appStartingUp(); - virtual void appClosingDown(); - - // data for the default implementation - other implementations should not - // use/need this data - TQEventLoopPrivate *d; - - friend class TQApplication; -}; - -#endif // TQEVENTLOOP_H diff --git a/src/kernel/qeventloop_p.h b/src/kernel/qeventloop_p.h index 3894517b9..7eb32a5d8 100644 --- a/src/kernel/qeventloop_p.h +++ b/src/kernel/qeventloop_p.h @@ -58,7 +58,7 @@ # undef raise #endif -#include "qwindowdefs.h" +#include "ntqwindowdefs.h" class TQSocketNotifier; #ifdef Q_OS_MAC @@ -66,7 +66,7 @@ class TQMacSockNotPrivate; #endif #if defined(Q_OS_UNIX) || defined (Q_WS_WIN) -#include "qptrlist.h" +#include "ntqptrlist.h" #endif // Q_OS_UNIX || Q_WS_WIN #if defined(Q_OS_UNIX) diff --git a/src/kernel/qeventloop_unix.cpp b/src/kernel/qeventloop_unix.cpp index d1aee1f62..b131a701f 100644 --- a/src/kernel/qeventloop_unix.cpp +++ b/src/kernel/qeventloop_unix.cpp @@ -37,9 +37,9 @@ **********************************************************************/ #include "qeventloop_p.h" // includes qplatformdefs.h -#include "qeventloop.h" -#include "qapplication.h" -#include "qbitarray.h" +#include "ntqeventloop.h" +#include "ntqapplication.h" +#include "ntqbitarray.h" #include #include diff --git a/src/kernel/qeventloop_x11.cpp b/src/kernel/qeventloop_x11.cpp index 26716b179..ae2183a0e 100644 --- a/src/kernel/qeventloop_x11.cpp +++ b/src/kernel/qeventloop_x11.cpp @@ -37,14 +37,14 @@ **********************************************************************/ #include "qeventloop_p.h" // includes qplatformdefs.h -#include "qeventloop.h" -#include "qapplication.h" -#include "qbitarray.h" +#include "ntqeventloop.h" +#include "ntqapplication.h" +#include "ntqbitarray.h" #include "qcolor_p.h" #include "qt_x11_p.h" #if defined(QT_THREAD_SUPPORT) -# include "qmutex.h" +# include "ntqmutex.h" #endif // QT_THREAD_SUPPORT #include diff --git a/src/kernel/qfocusdata.cpp b/src/kernel/qfocusdata.cpp index 838a2ab15..0f06da4e3 100644 --- a/src/kernel/qfocusdata.cpp +++ b/src/kernel/qfocusdata.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qfocusdata.h" +#include "ntqfocusdata.h" /*! - \class TQFocusData qfocusdata.h + \class TQFocusData ntqfocusdata.h \brief The TQFocusData class maintains the list of widgets in the focus chain. diff --git a/src/kernel/qfocusdata.h b/src/kernel/qfocusdata.h deleted file mode 100644 index f3e69a3de..000000000 --- a/src/kernel/qfocusdata.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Definition of internal TQFocusData class -** -** Created : 980405 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFOCUSDATA_H -#define TQFOCUSDATA_H - -#ifndef QT_H -#include "qwidgetlist.h" -#endif // QT_H - - -class Q_EXPORT TQFocusData { -public: - TQWidget* focusWidget() const { return it.current(); } - - TQWidget* home(); - TQWidget* next(); - TQWidget* prev(); - TQWidget* first() const; - TQWidget* last() const; - int count() const { return focusWidgets.count(); } - -private: - friend class TQWidget; - - TQFocusData() - : it(focusWidgets) {} - TQWidgetList focusWidgets; - TQWidgetListIt it; -}; - - -#endif // TQFOCUSDATA_H diff --git a/src/kernel/qfont.cpp b/src/kernel/qfont.cpp index 5fd1a8755..6e78fa43a 100644 --- a/src/kernel/qfont.cpp +++ b/src/kernel/qfont.cpp @@ -40,19 +40,19 @@ #define QT_FATAL_ASSERT -#include "qfont.h" -#include "qfontdatabase.h" -#include "qfontmetrics.h" -#include "qfontinfo.h" -#include "qpainter.h" -#include "qdict.h" -#include "qcache.h" -#include "qdatastream.h" -#include "qapplication.h" -#include "qcleanuphandler.h" -#include "qstringlist.h" +#include "ntqfont.h" +#include "ntqfontdatabase.h" +#include "ntqfontmetrics.h" +#include "ntqfontinfo.h" +#include "ntqpainter.h" +#include "ntqdict.h" +#include "ntqcache.h" +#include "ntqdatastream.h" +#include "ntqapplication.h" +#include "ntqcleanuphandler.h" +#include "ntqstringlist.h" #ifdef Q_WS_MAC -#include "qpaintdevicemetrics.h" +#include "ntqpaintdevicemetrics.h" #endif #include @@ -237,7 +237,7 @@ TQFontEngineData::~TQFontEngineData() /*! - \class TQFont qfont.h + \class TQFont ntqfont.h \brief The TQFont class specifies a font used for drawing text. \ingroup graphics @@ -1808,7 +1808,7 @@ TQDataStream &operator>>( TQDataStream &s, TQFont &font ) *****************************************************************************/ /*! - \class TQFontMetrics qfontmetrics.h + \class TQFontMetrics ntqfontmetrics.h \brief The TQFontMetrics class provides font metrics information. \ingroup graphics @@ -2443,7 +2443,7 @@ TQRect TQFontMetrics::boundingRect( TQChar ch ) const If several of the horizontal or several of the vertical alignment flags are set, the resulting alignment is undefined. - These flags are defined in \c qnamespace.h. + These flags are defined in \c ntqnamespace.h. If \c ExpandTabs is set in \a flgs, then: if \a tabarray is non-null, it specifies a 0-terminated sequence of pixel-positions @@ -2505,7 +2505,7 @@ TQRect TQFontMetrics::boundingRect( int x, int y, int w, int h, int flgs, \i \c WordBreak breaks the text to fit the rectangle. \endlist - These flags are defined in \c qnamespace.h. + These flags are defined in \c ntqnamespace.h. If \c ExpandTabs is set in \a flgs, then: if \a tabarray is non-null, it specifies a 0-terminated sequence of pixel-positions @@ -2591,7 +2591,7 @@ int TQFontMetrics::lineWidth() const *****************************************************************************/ /*! - \class TQFontInfo qfontinfo.h + \class TQFontInfo ntqfontinfo.h \brief The TQFontInfo class provides general information about fonts. diff --git a/src/kernel/qfont.h b/src/kernel/qfont.h deleted file mode 100644 index ddb763da6..000000000 --- a/src/kernel/qfont.h +++ /dev/null @@ -1,372 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFont class -** -** Created : 940514 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFONT_H -#define TQFONT_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qstring.h" -#endif // QT_H - - -class TQFontPrivate; /* don't touch */ -class TQStringList; -class TQTextFormatCollection; - -class Q_EXPORT TQFont -{ -public: - enum StyleHint { - Helvetica, SansSerif = Helvetica, - Times, Serif = Times, - Courier, TypeWriter = Courier, - OldEnglish, Decorative = OldEnglish, - System, - AnyStyle - }; - - enum StyleStrategy { - PreferDefault = 0x0001, - PreferBitmap = 0x0002, - PreferDevice = 0x0004, - PreferOutline = 0x0008, - ForceOutline = 0x0010, - PreferMatch = 0x0020, - PreferQuality = 0x0040, - PreferAntialias = 0x0080, - NoAntialias = 0x0100, - OpenGLCompatible = 0x0200 - }; - - enum Weight { - Light = 25, - Normal = 50, - DemiBold = 63, - Bold = 75, - Black = 87 - }; - - enum Stretch { - UltraCondensed = 50, - ExtraCondensed = 62, - Condensed = 75, - SemiCondensed = 87, - Unstretched = 100, - SemiExpanded = 112, - Expanded = 125, - ExtraExpanded = 150, - UltraExpanded = 200 - }; - - // default font - TQFont(); - // specific font -#ifdef Q_QDOC - TQFont( const TQString &family, int pointSize = 12, int weight = Normal, - bool italic = FALSE ); -#else - TQFont( const TQString &family, int pointSize = -1, int weight = -1, - bool italic = FALSE ); -#endif - // copy constructor - TQFont( const TQFont & ); - - ~TQFont(); - - TQString family() const; - void setFamily( const TQString &); - - int pointSize() const; - float pointSizeFloat() const; - void setPointSize( int ); - void setPointSizeFloat( float ); - - int pixelSize() const; - void setPixelSize( int ); - void setPixelSizeFloat( float ); - - 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 s ); - - int stretch() const; - void setStretch( int ); - - // is raw mode still needed? - bool rawMode() const; - void setRawMode( bool ); - - // dupicated from TQFontInfo - bool exactMatch() const; - - TQFont &operator=( const TQFont & ); - bool operator==( const TQFont & ) const; - bool operator!=( const TQFont & ) const; - bool isCopyOf( const TQFont & ) const; - - -#ifdef Q_WS_WIN - HFONT handle() const; -#else // !Q_WS_WIN - TQt::HANDLE handle() const; -#endif // Q_WS_WIN - - - // needed for X11 - void setRawName( const TQString & ); - TQString rawName() const; - - TQString key() const; - - TQString toString() const; - bool fromString(const TQString &); - -#ifndef QT_NO_STRINGLIST - 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 &); -#endif //QT_NO_STRINGLIST - static void initialize(); - static void cleanup(); -#ifndef Q_WS_QWS - static void cacheStatistics(); -#endif - -#if defined(Q_WS_QWS) - void qwsRenderToDisk(bool all=TRUE); -#endif - - - // a copy of this lives in qunicodetables.cpp, as we can't include - // qfont.h it in tools/. Do not modify without changing the script - // enum in qunicodetable_p.h aswell. - enum Script { - // European Alphabetic Scripts - Latin, - Greek, - Cyrillic, - Armenian, - Georgian, - Runic, - Ogham, - SpacingModifiers, - CombiningMarks, - - // Middle Eastern Scripts - Hebrew, - Arabic, - Syriac, - Thaana, - - // South and Southeast Asian Scripts - Devanagari, - Bengali, - Gurmukhi, - Gujarati, - Oriya, - Tamil, - Telugu, - Kannada, - Malayalam, - Sinhala, - Thai, - Lao, - Tibetan, - Myanmar, - Khmer, - - // East Asian Scripts - Han, - Hiragana, - Katakana, - Hangul, - Bopomofo, - Yi, - - // Additional Scripts - Ethiopic, - Cherokee, - CanadianAboriginal, - Mongolian, - - // Symbols - CurrencySymbols, - LetterlikeSymbols, - NumberForms, - MathematicalOperators, - TechnicalSymbols, - GeometricSymbols, - MiscellaneousSymbols, - EnclosedAndSquare, - Braille, - - Unicode, - - // some scripts added in Unicode 3.2 - Tagalog, - Hanunoo, - Buhid, - Tagbanwa, - - KatakanaHalfWidth, - - // from Unicode 4.0 - Limbu, - TaiLe, - - // End -#if !defined(Q_QDOC) - NScripts, - UnknownScript = NScripts, - - NoScript, - - // ---------------------------------------- - // Dear User, you can see values > NScript, - // but they are internal - do not touch. - - Han_Japanese, - Han_SimplifiedChinese, - Han_TraditionalChinese, - Han_Korean, - - LastPrivateScript -#endif - }; - - TQString defaultFamily() const; - TQString lastResortFamily() const; - TQString lastResortFont() const; - -#ifndef QT_NO_COMPAT - - static TQFont defaultFont(); - static void setDefaultFont( const TQFont & ); - -#endif // QT_NO_COMPAT - - TQFont resolve( const TQFont & ) const; - -protected: - // why protected? - bool dirty() const; - int deciPointSize() const; - -private: - TQFont( TQFontPrivate *, TQPaintDevice *pd ); - - void detach(); - -#if defined(Q_WS_MAC) - void macSetFont(TQPaintDevice *); -#elif defined(Q_WS_X11) - void x11SetScreen( int screen = -1 ); - int x11Screen() const; -#endif - - friend class TQFontMetrics; - friend class TQFontInfo; - friend class TQPainter; - friend class TQPSPrinterFont; - friend class TQApplication; - friend class TQWidget; - friend class TQTextFormatCollection; - friend class TQTextLayout; - friend class TQTextItem; - friend class TQGLContext; -#if defined(Q_WS_X11) && !defined(QT_NO_XFTFREETYPE) - friend TQt::HANDLE qt_xft_handle(const TQFont &font); -#endif -#ifndef QT_NO_DATASTREAM - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQFont & ); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQFont & ); -#endif - - TQFontPrivate *d; -}; - - -inline bool TQFont::bold() const -{ return weight() > Normal; } - - -inline void TQFont::setBold( bool enable ) -{ setWeight( enable ? Bold : Normal ); } - - - - -/***************************************************************************** - TQFont stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQFont & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQFont & ); -#endif - - -#endif // TQFONT_H diff --git a/src/kernel/qfont_x11.cpp b/src/kernel/qfont_x11.cpp index 5d9debaf1..82120732e 100644 --- a/src/kernel/qfont_x11.cpp +++ b/src/kernel/qfont_x11.cpp @@ -44,15 +44,15 @@ #include "qplatformdefs.h" -#include "qfont.h" -#include "qapplication.h" -#include "qcleanuphandler.h" -#include "qfontinfo.h" -#include "qfontdatabase.h" -#include "qfontmetrics.h" -#include "qpaintdevice.h" -#include "qpaintdevicemetrics.h" -#include "qtextcodec.h" +#include "ntqfont.h" +#include "ntqapplication.h" +#include "ntqcleanuphandler.h" +#include "ntqfontinfo.h" +#include "ntqfontdatabase.h" +#include "ntqfontmetrics.h" +#include "ntqpaintdevice.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqtextcodec.h" #include #include diff --git a/src/kernel/qfontdata_p.h b/src/kernel/qfontdata_p.h index eb83ffb3c..fc0734489 100644 --- a/src/kernel/qfontdata_p.h +++ b/src/kernel/qfontdata_p.h @@ -53,9 +53,9 @@ // // -#include "qobject.h" -#include "qfont.h" -#include "qpaintdevicemetrics.h" +#include "ntqobject.h" +#include "ntqfont.h" +#include "ntqpaintdevicemetrics.h" // forwards class TQFontEngine; diff --git a/src/kernel/qfontdatabase.cpp b/src/kernel/qfontdatabase.cpp index 6e2d3ebfd..96cc1118b 100644 --- a/src/kernel/qfontdatabase.cpp +++ b/src/kernel/qfontdatabase.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qfontdatabase.h" +#include "ntqfontdatabase.h" #ifndef QT_NO_FONTDATABASE -#include -#include +#include +#include #include #include "qfontengine_p.h" -#include +#include #ifdef Q_WS_X11 #include @@ -1293,7 +1293,7 @@ TQString TQFontDatabase::styleString( const TQFont &f ) /*! - \class TQFontDatabase qfontdatabase.h + \class TQFontDatabase ntqfontdatabase.h \brief The TQFontDatabase class provides information about the fonts available in the underlying window system. \ingroup environment @@ -1332,8 +1332,8 @@ TQString TQFontDatabase::styleString( const TQFont &f ) Example: \code -#include -#include +#include +#include #include int main( int argc, char **argv ) diff --git a/src/kernel/qfontdatabase.h b/src/kernel/qfontdatabase.h deleted file mode 100644 index 04d44f92a..000000000 --- a/src/kernel/qfontdatabase.h +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQFontDatabase class -** -** Created : 981126 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFONTDATABASE_H -#define TQFONTDATABASE_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qstring.h" -#include "qstringlist.h" -#include "qfont.h" -#include "qvaluelist.h" -#endif // QT_H - - -#ifndef QT_NO_FONTDATABASE - -class TQFontStylePrivate; /* Don't touch! */ -struct TQtFontStyle; -struct TQtFontFamily; -struct TQtFontFoundry; -struct TQFontDef; -class TQFontEngine; -#ifdef Q_WS_QWS -class TQDiskFont; -#endif - -class TQFontDatabasePrivate; - -class Q_EXPORT TQFontDatabase -{ -public: - static TQValueList standardSizes(); - - TQFontDatabase(); - - 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); - -#ifdef Q_WS_QWS - static void qwsAddDiskFont( TQDiskFont *qdf ); -#endif - - // For source compatibility with < 3.0 -#ifndef QT_NO_COMPAT - - TQStringList families(bool) const; - TQStringList styles( const TQString &, const TQString & ) const; - TQValueList pointSizes( const TQString &, const TQString &, const TQString & ); - TQValueList smoothSizes( const TQString &, const TQString &, const TQString & ); - - TQFont font( const TQString &, const TQString &, int, const TQString &); - - bool isBitmapScalable( const TQString &, const TQString &, const TQString & ) const; - bool isSmoothlyScalable( const TQString &, const TQString &, const TQString & ) const; - bool isScalable( const TQString &, const TQString &, const TQString & ) const; - bool isFixedPitch( const TQString &, const TQString &, const TQString & ) const; - - bool italic( const TQString &, const TQString &, const TQString & ) const; - bool bold( const TQString &, const TQString &, const TQString & ) const; - int weight( const TQString &, const TQString &, const TQString & ) const; - -#endif // QT_NO_COMPAT - -private: -#if defined(Q_WS_X11) || defined(Q_WS_WIN) - static TQFontEngine *findFont( TQFont::Script script, const TQFontPrivate *fp, - const TQFontDef &request, int force_encoding_id = -1 ); -#endif // Q_WS_X11 - - static void createDatabase(); - - static void parseFontName(const TQString &name, TQString &foundry, TQString &family); - - friend struct TQFontDef; - friend class TQFontPrivate; - friend class TQFontDialog; - friend class TQFontEngineLatinXLFD; - - TQFontDatabasePrivate *d; -}; - - -#ifndef QT_NO_COMPAT - -inline TQStringList TQFontDatabase::families( bool ) const -{ - return families(); -} - -inline TQStringList TQFontDatabase::styles( const TQString &family, - const TQString & ) const -{ - return styles(family); -} - -inline TQValueList TQFontDatabase::pointSizes( const TQString &family, - const TQString &style , - const TQString & ) -{ - return pointSizes(family, style); -} - -inline TQValueList TQFontDatabase::smoothSizes( const TQString &family, - const TQString &style, - const TQString & ) -{ - return smoothSizes(family, style); -} - -inline TQFont TQFontDatabase::font( const TQString &familyName, - const TQString &style, - int pointSize, - const TQString &) -{ - return font(familyName, style, pointSize); -} - -inline bool TQFontDatabase::isBitmapScalable( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return isBitmapScalable(family, style); -} - -inline bool TQFontDatabase::isSmoothlyScalable( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return isSmoothlyScalable(family, style); -} - -inline bool TQFontDatabase::isScalable( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return isScalable(family, style); -} - -inline bool TQFontDatabase::isFixedPitch( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return isFixedPitch(family, style); -} - -inline bool TQFontDatabase::italic( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return italic(family, style); -} - -inline bool TQFontDatabase::bold( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return bold(family, style); -} - -inline int TQFontDatabase::weight( const TQString &family, - const TQString &style, - const TQString & ) const -{ - return weight(family, style); -} - -#endif // QT_NO_COMPAT - -#endif // QT_NO_FONTDATABASE - -#endif // TQFONTDATABASE_H diff --git a/src/kernel/qfontdatabase_x11.cpp b/src/kernel/qfontdatabase_x11.cpp index 77a7ad17f..9231bf50d 100644 --- a/src/kernel/qfontdatabase_x11.cpp +++ b/src/kernel/qfontdatabase_x11.cpp @@ -40,8 +40,8 @@ #include -#include -#include +#include +#include #include "qt_x11_p.h" diff --git a/src/kernel/qfontengine_p.h b/src/kernel/qfontengine_p.h index 7c0fc0219..bd3d33a3f 100644 --- a/src/kernel/qfontengine_p.h +++ b/src/kernel/qfontengine_p.h @@ -38,12 +38,12 @@ #define TQFONTENGINE_P_H #ifndef QT_H -#include "qglobal.h" +#include "ntqglobal.h" #endif // QT_H #ifdef Q_WS_WIN #include "qt_windows.h" -#include "qptrdict.h" +#include "ntqptrdict.h" #endif #include "qtextengine_p.h" @@ -529,8 +529,8 @@ private: #elif defined( Q_WS_MAC ) #include "qt_mac.h" -#include -#include +#include +#include class TQFontEngineMac : public TQFontEngine { diff --git a/src/kernel/qfontengine_x11.cpp b/src/kernel/qfontengine_x11.cpp index 5693e238d..290e3519d 100644 --- a/src/kernel/qfontengine_x11.cpp +++ b/src/kernel/qfontengine_x11.cpp @@ -40,20 +40,20 @@ // #define FONTENGINE_DEBUG -#include -#include -#include +#include +#include +#include -#include "qbitmap.h" -#include "qfontdatabase.h" -#include "qpaintdevice.h" -#include "qpaintdevicemetrics.h" -#include "qpainter.h" -#include "qimage.h" +#include "ntqbitmap.h" +#include "ntqfontdatabase.h" +#include "ntqpaintdevice.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqpainter.h" +#include "ntqimage.h" #include "qt_x11_p.h" -#include "qfont.h" +#include "ntqfont.h" #include "qtextengine_p.h" #include diff --git a/src/kernel/qfontinfo.h b/src/kernel/qfontinfo.h deleted file mode 100644 index bc29d280b..000000000 --- a/src/kernel/qfontinfo.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFontInfo class -** -** Created : 950131 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFONTINFO_H -#define TQFONTINFO_H - -#ifndef QT_H -#include "qfont.h" -#endif // QT_H - - -class Q_EXPORT TQFontInfo -{ -public: - TQFontInfo( const TQFont & ); - TQFontInfo( const TQFont &, TQFont::Script ); - TQFontInfo( const TQFontInfo & ); - ~TQFontInfo(); - - TQFontInfo &operator=( 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; - - -private: - TQFontInfo( const TQPainter * ); - - TQFontPrivate *d; - TQPainter *painter; - int fscript; - - friend class TQWidget; - friend class TQPainter; -}; - - -inline bool TQFontInfo::bold() const -{ return weight() > TQFont::Normal; } - - -#endif // TQFONTINFO_H diff --git a/src/kernel/qfontmetrics.h b/src/kernel/qfontmetrics.h deleted file mode 100644 index 7e1f46f10..000000000 --- a/src/kernel/qfontmetrics.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFontMetrics class -** -** Created : 940514 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFONTMETRICS_H -#define TQFONTMETRICS_H - -#ifndef QT_H -#include "qfont.h" -#include "qrect.h" -#endif // QT_H - -#ifdef Q_WS_QWS -class TQFontEngine; -#endif - -class TQTextCodec; -class TQTextParag; - -class Q_EXPORT TQFontMetrics -{ -public: - TQFontMetrics( const TQFont & ); - TQFontMetrics( const TQFont &, TQFont::Script ); - TQFontMetrics( const TQFontMetrics & ); - ~TQFontMetrics(); - - TQFontMetrics &operator=( 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 len = -1 ) const; - - int width( TQChar ) const; -#ifndef QT_NO_COMPAT - int width( char c ) const { return width( (TQChar) c ); } -#endif - - int charWidth( const TQString &str, int pos ) const; - TQRect boundingRect( const TQString &, int len = -1 ) const; - TQRect boundingRect( TQChar ) const; - TQRect boundingRect( int x, int y, int w, int h, int flags, - const TQString& str, int len=-1, int tabstops=0, - int *tabarray=0, TQTextParag **intern=0 ) const; - TQSize size( int flags, - const TQString& str, int len=-1, int tabstops=0, - int *tabarray=0, TQTextParag **intern=0 ) const; - - int underlinePos() const; - int overlinePos() const; - int strikeOutPos() const; - int lineWidth() const; - -private: - TQFontMetrics( const TQPainter * ); - - friend class TQWidget; - friend class TQPainter; - friend class TQTextFormat; -#if defined( Q_WS_MAC ) - friend class TQFontPrivate; -#endif - - TQFontPrivate *d; - TQPainter *painter; - int fscript; -}; - - -#endif // TQFONTMETRICS_H diff --git a/src/kernel/qgif.h b/src/kernel/qgif.h deleted file mode 100644 index be5a3de72..000000000 --- a/src/kernel/qgif.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** To enable built-in reading of GIF images in TQt, change the definition -** below to "#define QT_BUILTIN_GIF_READER 1". -** -** To disable built-in reading of GIF images in TQt, change the definition -** below to "#define QT_BUILTIN_GIF_READER 0". -** -** WARNING: -** A separate license from Unisys may be required to use the gif -** reader. See http://www.unisys.com/about__unisys/lzw/ -** for information from Unisys -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGIF_H -#define TQGIF_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#ifndef QT_BUILTIN_GIF_READER -#define QT_BUILTIN_GIF_READER 0 -#endif - -bool qt_builtin_gif_reader(); - -#endif // TQGIF_H diff --git a/src/kernel/qgplugin.cpp b/src/kernel/qgplugin.cpp index e95257634..a8733b07b 100644 --- a/src/kernel/qgplugin.cpp +++ b/src/kernel/qgplugin.cpp @@ -36,7 +36,7 @@ ** **********************************************************************/ -#include "qgplugin.h" +#include "ntqgplugin.h" #ifndef QT_NO_COMPONENT diff --git a/src/kernel/qgplugin.h b/src/kernel/qgplugin.h deleted file mode 100644 index 354122bca..000000000 --- a/src/kernel/qgplugin.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** ... -** -** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGPLUGIN_H -#define TQGPLUGIN_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the TQt API. It exists for the convenience -// of a number of TQt sources files. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// -// - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - -#ifndef QT_NO_COMPONENT - -#ifndef Q_EXTERN_C -#ifdef __cplusplus -#define Q_EXTERN_C extern "C" -#else -#define Q_EXTERN_C extern -#endif -#endif - -#ifndef Q_EXPORT_PLUGIN -#if defined(QT_THREAD_SUPPORT) -#define QT_THREADED_BUILD 1 -#define Q_PLUGIN_FLAGS_STRING "11" -#else -#define QT_THREADED_BUILD 0 -#define Q_PLUGIN_FLAGS_STRING "01" -#endif - -// this is duplicated at Q_UCM_VERIFICATION_DATA in qcom_p.h -// NOTE: if you change pattern, you MUST change the pattern in -// qcomlibrary.cpp as well. changing the pattern will break all -// backwards compatibility as well (no old plugins will be loaded). -#ifndef Q_PLUGIN_VERIFICATION_DATA -# define Q_PLUGIN_VERIFICATION_DATA \ - static const char *qt_ucm_verification_data = \ - "pattern=""QT_UCM_VERIFICATION_DATA""\n" \ - "version="QT_VERSION_STR"\n" \ - "flags="Q_PLUGIN_FLAGS_STRING"\n" \ - "buildkey="QT_BUILD_KEY"\0"; -#endif // Q_PLUGIN_VERIFICATION_DATA - -#define Q_PLUGIN_INSTANTIATE( IMPLEMENTATION ) \ - { \ - IMPLEMENTATION *i = new IMPLEMENTATION; \ - return i->iface(); \ - } - -#if defined(Q_WS_WIN) && defined(Q_CC_BOR) -# define Q_STDCALL __stdcall -#else -# define Q_STDCALL -#endif - -#define Q_EXPORT_PLUGIN(PLUGIN) \ - Q_PLUGIN_VERIFICATION_DATA \ - Q_EXTERN_C Q_EXPORT \ - const char * Q_STDCALL qt_ucm_query_verification_data() \ - { return qt_ucm_verification_data; } \ - Q_EXTERN_C Q_EXPORT TQUnknownInterface* Q_STDCALL ucm_instantiate() \ - Q_PLUGIN_INSTANTIATE( PLUGIN ) -#endif - -struct TQUnknownInterface; - -class Q_EXPORT TQGPlugin : public TQObject -{ - Q_OBJECT -public: - TQGPlugin( TQUnknownInterface *i ); - ~TQGPlugin(); - - TQUnknownInterface* iface(); - void setIface( TQUnknownInterface *iface ); - -private: - TQGPlugin(); - TQUnknownInterface* _iface; -}; - -#endif // QT_NO_COMPONENT - -#endif // TQGPLUGIN_H diff --git a/src/kernel/qguardedptr.cpp b/src/kernel/qguardedptr.cpp index 079904197..e631b1988 100644 --- a/src/kernel/qguardedptr.cpp +++ b/src/kernel/qguardedptr.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qguardedptr.h" +#include "ntqguardedptr.h" /*! - \class TQGuardedPtr qguardedptr.h + \class TQGuardedPtr ntqguardedptr.h \brief The TQGuardedPtr class is a template class that provides guarded pointers to TQObjects. \ingroup objectmodel diff --git a/src/kernel/qguardedptr.h b/src/kernel/qguardedptr.h deleted file mode 100644 index f08c086f3..000000000 --- a/src/kernel/qguardedptr.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGuardedPtr class -** -** Created : 990929 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGUARDEDPTR_H -#define TQGUARDEDPTR_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - -// ### 4.0: rename to something without Private in it. Not really internal. -class Q_EXPORT TQGuardedPtrPrivate : public TQObject, public TQShared -{ - Q_OBJECT -public: - TQGuardedPtrPrivate( TQObject* ); - ~TQGuardedPtrPrivate(); - - TQObject* object() const; - void reconnect( TQObject* ); - -private slots: - void objectDestroyed(); - -private: - TQObject* obj; -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQGuardedPtrPrivate( const TQGuardedPtrPrivate & ); - TQGuardedPtrPrivate &operator=( const TQGuardedPtrPrivate & ); -#endif -}; - -template -class TQGuardedPtr -{ -public: - TQGuardedPtr() : priv( new TQGuardedPtrPrivate( 0 ) ) {} - - TQGuardedPtr( T* o) { - priv = new TQGuardedPtrPrivate( (TQObject*)o ); - } - - TQGuardedPtr(const TQGuardedPtr &p) { - priv = p.priv; - ref(); - } - - ~TQGuardedPtr() { deref(); } - - TQGuardedPtr &operator=(const TQGuardedPtr &p) { - if ( priv != p.priv ) { - deref(); - priv = p.priv; - ref(); - } - return *this; - } - - TQGuardedPtr &operator=(T* o) { - if ( priv && priv->count == 1 ) { - priv->reconnect( (TQObject*)o ); - } else { - deref(); - priv = new TQGuardedPtrPrivate( (TQObject*)o ); - } - return *this; - } - - bool operator==( const TQGuardedPtr &p ) const { - return (T*)(*this) == (T*) p; - } - - bool operator!= ( const TQGuardedPtr& p ) const { - return !( *this == p ); - } - - bool isNull() const { return !priv || !priv->object(); } - - T* operator->() const { return (T*)(priv?priv->object():0); } - - T& operator*() const { return *((T*)(priv?priv->object():0)); } - - operator T*() const { return (T*)(priv?priv->object():0); } - -private: - - void ref() { if (priv) priv->ref(); } - - void deref() { - if ( priv && priv->deref() ) - delete priv; - } - - TQGuardedPtrPrivate* priv; -}; - - - - -inline TQObject* TQGuardedPtrPrivate::object() const -{ - return obj; -} - -#define Q_DEFINED_QGUARDEDPTR -#include "qwinexport.h" -#endif diff --git a/src/kernel/qiconset.cpp b/src/kernel/qiconset.cpp index da672b037..2ba52a7b8 100644 --- a/src/kernel/qiconset.cpp +++ b/src/kernel/qiconset.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qiconset.h" +#include "ntqiconset.h" #ifndef QT_NO_ICONSET -#include "qapplication.h" -#include "qbitmap.h" -#include "qcleanuphandler.h" -#include "qimage.h" -#include "qpainter.h" +#include "ntqapplication.h" +#include "ntqbitmap.h" +#include "ntqcleanuphandler.h" +#include "ntqimage.h" +#include "ntqpainter.h" enum { NumSizes = 2, NumModes = 3, NumStates = 2 }; diff --git a/src/kernel/qiconset.h b/src/kernel/qiconset.h deleted file mode 100644 index 0aa01e95d..000000000 --- a/src/kernel/qiconset.h +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Definition of TQIconSet class -** -** Created : 980318 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQICONSET_H -#define TQICONSET_H - -#ifndef QT_H -#include "qobject.h" -#include "qpixmap.h" -#endif // QT_H - -#ifndef QT_NO_ICONSET - -class TQIconFactory; -class TQIconSetPrivate; - -// ### Remove all 'virtual' functions in TQIconSet (but not TQIconFactory) in TQt 4.0 -class Q_EXPORT TQIconSet -{ -public: - // the implementation makes assumptions about the value of these - enum Size { Automatic, Small, Large }; - enum Mode { Normal, Disabled, Active }; - enum State { On, Off }; - - TQIconSet(); - TQIconSet( const TQPixmap& pixmap, Size size = Automatic ); - TQIconSet( const TQPixmap& smallPix, const TQPixmap& largePix ); - TQIconSet( const TQIconSet& other ); - virtual ~TQIconSet(); - - void reset( const TQPixmap& pixmap, Size size ); - - virtual void setPixmap( const TQPixmap& pixmap, Size size, - Mode mode = Normal, State state = Off ); - virtual void setPixmap( const TQString& fileName, Size size, - Mode mode = Normal, State state = Off ); - TQPixmap pixmap( Size size, Mode mode, State state = Off ) const; - TQPixmap pixmap( Size size, bool enabled, State state = Off ) const; - TQPixmap pixmap() const; - bool isGenerated( Size size, Mode mode, State state = Off ) const; - void clearGenerated(); - void installIconFactory( TQIconFactory *factory ); - - bool isNull() const; - - void detach(); - - TQIconSet& operator=( const TQIconSet& other ); - - // static functions - static void setIconSize( Size which, const TQSize& size ); - static const TQSize& iconSize( Size which ); - -#ifndef Q_QDOC - Q_DUMMY_COMPARISON_OPERATOR(TQIconSet) -#endif - -private: - void normalize( Size& which, const TQSize& pixSize ); - TQPixmap *createScaled( Size size, const TQPixmap *suppliedPix ) const; - TQPixmap *createDisabled( Size size, State state ) const; - - TQIconSetPrivate *d; -}; - -class Q_EXPORT TQIconFactory : private TQShared -{ -public: - TQIconFactory(); - virtual ~TQIconFactory(); - - virtual TQPixmap *createPixmap( const TQIconSet& iconSet, TQIconSet::Size size, - TQIconSet::Mode mode, TQIconSet::State state ); - void setAutoDelete( bool autoDelete ) { autoDel = autoDelete; } - bool autoDelete() const { return autoDel; } - - static TQIconFactory *defaultFactory(); - static void installDefaultFactory( TQIconFactory *factory ); - -private: -#if defined(Q_DISABLE_COPY) - TQIconFactory( const TQIconFactory & ); - TQIconFactory &operator=( const TQIconFactory & ); -#endif - - friend class TQIconSet; - friend class TQIconSetPrivate; - - uint autoDel : 1; - uint unused : 31; -}; - -#endif // QT_NO_ICONSET -#endif diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp index edc77a851..56bd482e0 100644 --- a/src/kernel/qimage.cpp +++ b/src/kernel/qimage.cpp @@ -38,24 +38,24 @@ ** **********************************************************************/ -#include "qimage.h" -#include "qregexp.h" -#include "qfile.h" -#include "qdatastream.h" -#include "qtextstream.h" -#include "qbuffer.h" -#include "qptrlist.h" -#include "qasyncimageio.h" -#include "qpngio.h" -#include "qmngio.h" -#include "qjpegio.h" -#include "qmap.h" +#include "ntqimage.h" +#include "ntqregexp.h" +#include "ntqfile.h" +#include "ntqdatastream.h" +#include "ntqtextstream.h" +#include "ntqbuffer.h" +#include "ntqptrlist.h" +#include "ntqasyncimageio.h" +#include "ntqpngio.h" +#include "ntqmngio.h" +#include "ntqjpegio.h" +#include "ntqmap.h" #include #include "qimageformatinterface_p.h" -#include "qwmatrix.h" -#include "qapplication.h" -#include "qmime.h" -#include "qdragobject.h" +#include "ntqwmatrix.h" +#include "ntqapplication.h" +#include "ntqmime.h" +#include "ntqdragobject.h" #include #include @@ -100,7 +100,7 @@ An entry in the color table is an RGB triplet encoded as a \c uint. Use the \link ::qRed() qRed()\endlink, \link ::qGreen() qGreen()\endlink and \link ::qBlue() qBlue()\endlink functions (\c - qcolor.h) to access the components, and \link ::qRgb() + ntqcolor.h) to access the components, and \link ::qRgb() qRgb\endlink to make an RGB triplet (see the TQColor class documentation). @@ -890,7 +890,7 @@ TQImage TQImage::copy(int x, int y, int w, int h, int conversion_flags) const A color value is an RGB triplet. Use the \link ::qRed() qRed()\endlink, \link ::qGreen() qGreen()\endlink and \link - ::qBlue() qBlue()\endlink functions (defined in \c qcolor.h) to + ::qBlue() qBlue()\endlink functions (defined in \c ntqcolor.h) to get the color value components. \sa setColor() numColors() TQColor @@ -902,7 +902,7 @@ TQImage TQImage::copy(int x, int y, int w, int h, int conversion_flags) const Sets a color in the color table at index \a i to \a c. A color value is an RGB triplet. Use the \link ::qRgb() - qRgb()\endlink function (defined in \c qcolor.h) to make RGB + qRgb()\endlink function (defined in \c ntqcolor.h) to make RGB triplets. \sa color() setNumColors() numColors() @@ -922,7 +922,7 @@ TQImage TQImage::copy(int x, int y, int w, int h, int conversion_flags) const directly, because the pixel format depends on the byte order on the underlying platform. Hint: use \link ::qRed() qRed()\endlink, \link ::qGreen() qGreen()\endlink and \link ::qBlue() - qBlue()\endlink, etc. (qcolor.h) to access the pixels. + qBlue()\endlink, etc. (ntqcolor.h) to access the pixels. \warning If you are accessing 16-bpp image data, you must handle endianness yourself. (TQt/Embedded only) @@ -2373,7 +2373,7 @@ TQImage TQImage::convertBitOrder( Endian bitOrder ) const return image; } -// ### Candidate (renamed) for qcolor.h +// ### Candidate (renamed) for ntqcolor.h static bool isGray(TQRgb c) { @@ -3716,7 +3716,7 @@ static void swapPixel01( TQImage *image ) // 1-bpp: swap 0 and 1 pixels *****************************************************************************/ /*! - \class TQImageIO qimage.h + \class TQImageIO ntqimage.h \brief The TQImageIO class contains parameters for loading and saving images. @@ -3954,7 +3954,7 @@ static TQImageHandler *get_image_handler( const char *format ) /*! Defines an image I/O handler for the image format called \a - format, which is recognized using the \link qregexp.html#details + format, which is recognized using the \link ntqregexp.html#details regular expression\endlink \a header, read using \a readImage and written using \a writeImage. diff --git a/src/kernel/qimage.h b/src/kernel/qimage.h deleted file mode 100644 index 057bfb8ca..000000000 --- a/src/kernel/qimage.h +++ /dev/null @@ -1,425 +0,0 @@ -/**************************************************************************** -** -** Definition of TQImage and TQImageIO classes -** -** Created : 950207 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQIMAGE_H -#define TQIMAGE_H - -#ifndef QT_H -#include "qpixmap.h" -#include "qstrlist.h" -#include "qstringlist.h" -#endif // QT_H - -class TQImageDataMisc; // internal -#ifndef QT_NO_IMAGE_TEXT -class Q_EXPORT TQImageTextKeyLang { -public: - TQImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { } - TQImageTextKeyLang() { } - - TQCString key; - TQCString lang; - - bool operator< (const TQImageTextKeyLang& other) const - { return (key < other.key) || ((key==other.key) && (lang < other.lang)); } - bool operator== (const TQImageTextKeyLang& other) const - { return (key==other.key) && (lang==other.lang); } -}; -#endif //QT_NO_IMAGE_TEXT - - -class Q_EXPORT TQImage -{ -public: - enum Endian { IgnoreEndian, BigEndian, LittleEndian }; - - TQImage(); - TQImage( int width, int height, int depth, int numColors=0, - Endian bitOrder=IgnoreEndian ); - TQImage( const TQSize&, int depth, int numColors=0, - Endian bitOrder=IgnoreEndian ); -#ifndef QT_NO_IMAGEIO - TQImage( const TQString &fileName, const char* format=0 ); - TQImage( const char * const xpm[] ); - TQImage( const TQByteArray &data ); -#endif - TQImage( uchar* data, int w, int h, int depth, - TQRgb* colortable, int numColors, - Endian bitOrder ); -#ifdef Q_WS_QWS - TQImage( uchar* data, int w, int h, int depth, int pbl, - TQRgb* colortable, int numColors, - Endian bitOrder ); -#endif - TQImage( const TQImage & ); - ~TQImage(); - - TQImage &operator=( const TQImage & ); - TQImage &operator=( const TQPixmap & ); - bool operator==( const TQImage & ) const; - bool operator!=( const TQImage & ) const; - void detach(); - TQImage copy() const; - TQImage copy(int x, int y, int w, int h, int conversion_flags=0) const; - TQImage copy(const TQRect&) const; -#ifndef QT_NO_MIME - static TQImage fromMimeSource( const TQString& abs_name ); -#endif - bool isNull() const { return data->bits == 0; } - - int width() const { return data->w; } - int height() const { return data->h; } - TQSize size() const { return TQSize(data->w,data->h); } - TQRect rect() const { return TQRect(0,0,data->w,data->h); } - int depth() const { return data->d; } - int numColors() const { return data->ncols; } - Endian bitOrder() const { return (Endian) data->bitordr; } - - TQRgb color( int i ) const; - void setColor( int i, TQRgb c ); - void setNumColors( int ); - - bool hasAlphaBuffer() const; - void setAlphaBuffer( bool ); - - bool allGray() const; - bool isGrayscale() const; - - uchar *bits() const; - uchar *scanLine( int ) const; - uchar **jumpTable() const; - TQRgb *colorTable() const; - int numBytes() const; - int bytesPerLine() const; - -#ifdef Q_WS_QWS - TQGfx * graphicsContext(); -#endif - - bool create( int width, int height, int depth, int numColors=0, - Endian bitOrder=IgnoreEndian ); - bool create( const TQSize&, int depth, int numColors=0, - Endian bitOrder=IgnoreEndian ); - void reset(); - - void fill( uint pixel ); - void invertPixels( bool invertAlpha = TRUE ); - - TQImage convertDepth( int ) const; -#ifndef QT_NO_IMAGE_TRUECOLOR - TQImage convertDepthWithPalette( int, TQRgb* p, int pc, int cf=0 ) const; -#endif - TQImage convertDepth( int, int conversion_flags ) const; - TQImage convertBitOrder( Endian ) const; - - enum ScaleMode { - ScaleFree, - ScaleMin, - ScaleMax - }; -#ifndef QT_NO_IMAGE_SMOOTHSCALE - TQImage smoothScale( int w, int h, ScaleMode mode=ScaleFree ) const; - TQImage smoothScale( const TQSize& s, ScaleMode mode=ScaleFree ) const; -#endif -#ifndef QT_NO_IMAGE_TRANSFORMATION - TQImage scale( int w, int h, ScaleMode mode=ScaleFree ) const; - TQImage scale( const TQSize& s, ScaleMode mode=ScaleFree ) const; - TQImage scaleWidth( int w ) const; - TQImage scaleHeight( int h ) const; - TQImage xForm( const TQWMatrix &matrix ) const; -#endif - -#ifndef QT_NO_IMAGE_DITHER_TO_1 - TQImage createAlphaMask( int conversion_flags=0 ) const; -#endif -#ifndef QT_NO_IMAGE_HEURISTIC_MASK - TQImage createHeuristicMask( bool clipTight=TRUE ) const; -#endif -#ifndef QT_NO_IMAGE_MIRROR - TQImage mirror() const; - TQImage mirror(bool horizontally, bool vertically) const; -#endif - TQImage swapRGB() const; - - static Endian systemBitOrder(); - static Endian systemByteOrder(); - -#ifndef QT_NO_IMAGEIO - static const char* imageFormat( const TQString &fileName ); - static TQStrList inputFormats(); - static TQStrList outputFormats(); -#ifndef QT_NO_STRINGLIST - static TQStringList inputFormatList(); - static TQStringList outputFormatList(); -#endif - bool load( const TQString &fileName, const char* format=0 ); - bool loadFromData( const uchar *buf, uint len, - const char *format=0 ); - bool loadFromData( TQByteArray data, const char* format=0 ); - bool save( const TQString &fileName, const char* format, - int quality=-1 ) const; - bool save( TQIODevice * device, const char* format, - int quality=-1 ) const; -#endif //QT_NO_IMAGEIO - - bool valid( int x, int y ) const; - int pixelIndex( int x, int y ) const; - TQRgb pixel( int x, int y ) const; - void setPixel( int x, int y, uint index_or_rgb ); - - // Auxiliary data - int dotsPerMeterX() const; - int dotsPerMeterY() const; - void setDotsPerMeterX(int); - void setDotsPerMeterY(int); - TQPoint offset() const; - void setOffset(const TQPoint&); -#ifndef QT_NO_IMAGE_TEXT - TQValueList textList() const; - TQStringList textLanguages() const; - TQStringList textKeys() const; - TQString text(const char* key, const char* lang=0) const; - TQString text(const TQImageTextKeyLang&) const; - void setText(const char* key, const char* lang, const TQString&); -#endif -private: - void init(); - void reinit(); - void freeBits(); - static void warningIndexRange( const char *, int ); - - struct TQImageData : public TQShared { // internal image data - int w; // image width - int h; // image height - int d; // image depth - int ncols; // number of colors - int nbytes; // number of bytes data - int bitordr; // bit order (1 bit depth) - TQRgb *ctbl; // color table - uchar **bits; // image data - bool alpha; // alpha buffer - int dpmx; // dots per meter X (or 0) - int dpmy; // dots per meter Y (or 0) - TQPoint offset; // offset in pixels -#ifndef QT_NO_IMAGE_TEXT - TQImageDataMisc* misc; // less common stuff -#endif - bool ctbl_mine; // this allocated ctbl - } *data; -#ifndef QT_NO_IMAGE_TEXT - TQImageDataMisc& misc() const; -#endif -#ifndef QT_NO_IMAGEIO - bool doImageIO( TQImageIO* io, int quality ) const; -#endif - friend Q_EXPORT void bitBlt( TQImage* dst, int dx, int dy, - const TQImage* src, int sx, int sy, - int sw, int sh, int conversion_flags ); -}; - - -// TQImage stream functions - -#if !defined(QT_NO_DATASTREAM) && !defined(QT_NO_IMAGEIO) -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQImage & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQImage & ); -#endif - -#ifndef QT_NO_IMAGEIO -class TQIODevice; -typedef void (*image_io_handler)( TQImageIO * ); // image IO handler - - -struct TQImageIOData; - - -class Q_EXPORT TQImageIO -{ -public: - TQImageIO(); - TQImageIO( TQIODevice *ioDevice, const char *format ); - TQImageIO( const TQString &fileName, const char* format ); - ~TQImageIO(); - - - const TQImage &image() const { return im; } - int status() const { return iostat; } - const char *format() const { return frmt; } - TQIODevice *ioDevice() const { return iodev; } - TQString fileName() const { return fname; } - int quality() const; - TQString description() const { return descr; } - 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 &fileName ); - static const char *imageFormat( TQIODevice * ); - static TQStrList inputFormats(); - static TQStrList outputFormats(); - - static void defineIOHandler( const char *format, - const char *header, - const char *flags, - image_io_handler read_image, - image_io_handler write_image ); - -private: - void init(); - - TQImage im; // image - int iostat; // IO status - TQCString frmt; // image format - TQIODevice *iodev; // IO device - TQString fname; // file name - char *params; // image parameters //### change to TQImageIOData *d in 3.0 - TQString descr; // image description - TQImageIOData *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQImageIO( const TQImageIO & ); - TQImageIO &operator=( const TQImageIO & ); -#endif -}; - -#endif //QT_NO_IMAGEIO - -Q_EXPORT void bitBlt( TQImage* dst, int dx, int dy, const TQImage* src, - int sx=0, int sy=0, int sw=-1, int sh=-1, - int conversion_flags=0 ); - - -/***************************************************************************** - TQImage member functions - *****************************************************************************/ - -inline bool TQImage::hasAlphaBuffer() const -{ - return data->alpha; -} - -inline uchar *TQImage::bits() const -{ - return data->bits ? data->bits[0] : 0; -} - -inline uchar **TQImage::jumpTable() const -{ - return data->bits; -} - -inline TQRgb *TQImage::colorTable() const -{ - return data->ctbl; -} - -inline int TQImage::numBytes() const -{ - return data->nbytes; -} - -inline int TQImage::bytesPerLine() const -{ - return data->h ? data->nbytes/data->h : 0; -} - -inline TQImage TQImage::copy(const TQRect& r) const -{ - return copy(r.x(), r.y(), r.width(), r.height()); -} - -inline TQRgb TQImage::color( int i ) const -{ -#if defined(QT_CHECK_RANGE) - if ( i >= data->ncols ) - warningIndexRange( "color", i ); -#endif - return data->ctbl ? data->ctbl[i] : (TQRgb)-1; -} - -inline void TQImage::setColor( int i, TQRgb c ) -{ -#if defined(QT_CHECK_RANGE) - if ( i >= data->ncols ) - warningIndexRange( "setColor", i ); -#endif - if ( data->ctbl ) - data->ctbl[i] = c; -} - -inline uchar *TQImage::scanLine( int i ) const -{ -#if defined(QT_CHECK_RANGE) - if ( i >= data->h ) - warningIndexRange( "scanLine", i ); -#endif - return data->bits ? data->bits[i] : 0; -} - -inline int TQImage::dotsPerMeterX() const -{ - return data->dpmx; -} - -inline int TQImage::dotsPerMeterY() const -{ - return data->dpmy; -} - -inline TQPoint TQImage::offset() const -{ - return data->offset; -} - - -#endif // TQIMAGE_H diff --git a/src/kernel/qimageformatplugin.cpp b/src/kernel/qimageformatplugin.cpp index 78ca5cdac..101f09bc0 100644 --- a/src/kernel/qimageformatplugin.cpp +++ b/src/kernel/qimageformatplugin.cpp @@ -36,13 +36,13 @@ ** **********************************************************************/ -#include "qimageformatplugin.h" +#include "ntqimageformatplugin.h" #ifndef QT_NO_IMAGEFORMATPLUGIN #include "qimageformatinterface_p.h" -#include "qimage.h" +#include "ntqimage.h" /*! - \class TQImageFormatPlugin qimageformatplugin.h + \class TQImageFormatPlugin ntqimageformatplugin.h \brief The TQImageFormatPlugin class provides an abstract base for custom image format plugins. \ingroup plugins diff --git a/src/kernel/qimageformatplugin.h b/src/kernel/qimageformatplugin.h deleted file mode 100644 index ac973210e..000000000 --- a/src/kernel/qimageformatplugin.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Definition of ??? -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQIMAGEFORMATPLUGIN_H -#define TQIMAGEFORMATPLUGIN_H - -#ifndef QT_H -#include "qgplugin.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_IMAGEFORMATPLUGIN -class TQImageFormat; -class TQImageFormatPluginPrivate; - -class Q_EXPORT TQImageFormatPlugin : public TQGPlugin -{ - Q_OBJECT -public: - TQImageFormatPlugin(); - ~TQImageFormatPlugin(); - - virtual TQStringList keys() const = 0; - virtual bool loadImage( const TQString &format, const TQString &filename, TQImage *image ); - virtual bool saveImage( const TQString &format, const TQString &filename, const TQImage &image ); - virtual bool installIOHandler( const TQString &format ) = 0; - -private: - TQImageFormatPluginPrivate *d; -}; -#endif // QT_NO_IMAGEFORMATPLUGIN -#endif // TQIMAGEFORMATPLUGIN_H diff --git a/src/kernel/qinputcontext.cpp b/src/kernel/qinputcontext.cpp index 557ef38e4..a5884db93 100644 --- a/src/kernel/qinputcontext.cpp +++ b/src/kernel/qinputcontext.cpp @@ -35,15 +35,15 @@ //#define QT_NO_IM_PREEDIT_RELOCATION -#include "qinputcontext.h" +#include "ntqinputcontext.h" #ifndef QT_NO_IM #include "qplatformdefs.h" -#include "qapplication.h" -#include "qwidget.h" -#include "qpopupmenu.h" +#include "ntqapplication.h" +#include "ntqwidget.h" +#include "ntqpopupmenu.h" #include #include @@ -93,7 +93,7 @@ public: // UPDATED COMMENT REQUIRED -- 2004-07-08 YamaKen /*! - \class TQInputContext qinputcontext.h + \class TQInputContext ntqinputcontext.h \brief The TQInputContext class abstracts the input method dependent data and composing state. \ingroup i18n diff --git a/src/kernel/qinputcontext.h b/src/kernel/qinputcontext.h deleted file mode 100644 index e06624e17..000000000 --- a/src/kernel/qinputcontext.h +++ /dev/null @@ -1,143 +0,0 @@ -/**************************************************************************** -** $Id: qinputcontext.h,v 1.8 2004/06/22 06:47:30 daisuke Exp $ -** -** Definition of TQInputContext -** -** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.TQPL included in the packaging of this file. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition -** licenses may use this file in accordance with the TQt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about TQt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for TQPL licensing information. -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef TQINPUTCONTEXT_H -#define TQINPUTCONTEXT_H - -#ifndef QT_NO_IM - -#ifndef QT_H -#include "qobject.h" -#include "qglobal.h" -#include "qevent.h" -#include "qstring.h" -#if (QT_VERSION-0 >= 0x040000) -#include "qlist.h" -#include "qaction.h" -#else -#include "qptrlist.h" -#endif -#endif - -class TQWidget; -class TQFont; -class TQPopupMenu; -class TQInputContextPrivate; - - -struct TQInputContextMenu { - enum Action { - NoSeparator, - InsertSeparator - }; -#if !(QT_VERSION-0 >= 0x040000) - TQString title; - TQPopupMenu *popup; -#endif -}; - - -class TQInputContext : public TQObject -{ - Q_OBJECT -public: - TQInputContext( TQObject *parent = 0 ); - virtual ~TQInputContext(); - - virtual TQString identifierName(); - virtual TQString language(); - -#if defined(Q_WS_X11) - virtual bool x11FilterEvent( TQWidget *keywidget, XEvent *event ); -#endif // Q_WS_X11 - virtual bool filterEvent( const TQEvent *event ); - virtual void reset(); - - virtual void setFocus(); - virtual void unsetFocus(); - virtual void setMicroFocus( int x, int y, int w, int h, TQFont *f = 0 ); - virtual void mouseHandler( int x, TQEvent::Type type, - TQt::ButtonState button, TQt::ButtonState state ); - virtual TQFont font() const; - virtual bool isComposing() const; - virtual bool isPreeditRelocationEnabled(); - -#if (QT_VERSION-0 >= 0x040000) - virtual TQList actions(); - void addActionsTo( TQMenu *menu, TQInputContextMenu::Action action = TQInputContextMenu::InsertSeparator ); -#else - virtual TQPtrList *menus(); - void addMenusTo( TQPopupMenu *popup, TQInputContextMenu::Action action = TQInputContextMenu::InsertSeparator ); -#endif - -#if defined(Q_WS_X11) - // these functions are not recommended for ordinary use - virtual TQWidget *focusWidget() const; - virtual TQWidget *holderWidget() const; - - // these functions must not be used by ordinary input method - virtual void setFocusWidget( TQWidget *w ); - virtual void setHolderWidget( TQWidget *w ); - virtual void releaseComposingWidget( TQWidget *w ); -#endif - -signals: - void deletionRequested(); - void imEventGenerated( TQObject *receiver, TQIMEvent *e ); - -protected: - virtual void sendIMEvent( TQEvent::Type type, - const TQString &text = TQString::null, - int cursorPosition = -1, int selLength = 0 ); - -private: - void sendIMEventInternal( TQEvent::Type type, - const TQString &text = TQString::null, - int cursorPosition = -1, int selLength = 0 ); - - TQInputContextPrivate *d; - - friend class TQWidget; - friend class TQInputContextFactory; - -private: // Disabled copy constructor and operator= - TQInputContext( const TQInputContext & ); - TQInputContext &operator=( const TQInputContext & ); - -}; - -#endif //Q_NO_IM - -#endif // TQINPUTCONTEXT_H diff --git a/src/kernel/qinputcontext_p.h b/src/kernel/qinputcontext_p.h index 85ce98162..0a7d193d3 100644 --- a/src/kernel/qinputcontext_p.h +++ b/src/kernel/qinputcontext_p.h @@ -52,7 +52,7 @@ // // -#include "qglobal.h" +#include "ntqglobal.h" class TQKeyEvent; class TQWidget; @@ -61,8 +61,8 @@ class TQString; #ifdef Q_WS_X11 -#include "qarray.h" -#include "qwindowdefs.h" +#include "ntqarray.h" +#include "ntqwindowdefs.h" #include "qt_x11_p.h" #endif diff --git a/src/kernel/qinputcontext_x11.cpp b/src/kernel/qinputcontext_x11.cpp index b7865ece3..44ebf0f7f 100644 --- a/src/kernel/qinputcontext_x11.cpp +++ b/src/kernel/qinputcontext_x11.cpp @@ -36,14 +36,14 @@ ** **********************************************************************/ -#include "qinputcontext.h" +#include "ntqinputcontext.h" #ifndef QT_NO_IM #include "qplatformdefs.h" -#include "qapplication.h" -#include "qwidget.h" +#include "ntqapplication.h" +#include "ntqwidget.h" #include "qt_x11_p.h" diff --git a/src/kernel/qinternal.cpp b/src/kernel/qinternal.cpp index 1f779a04e..2a58f01d3 100644 --- a/src/kernel/qinternal.cpp +++ b/src/kernel/qinternal.cpp @@ -39,10 +39,10 @@ **********************************************************************/ #include "private/qinternal_p.h" -#include "qwidget.h" -#include "qpixmap.h" -#include "qpainter.h" -#include "qcleanuphandler.h" +#include "ntqwidget.h" +#include "ntqpixmap.h" +#include "ntqpainter.h" +#include "ntqcleanuphandler.h" // Modern systems (year 2011) have very large screens in excess of 1000 pixels wide // Some may even have screens in excess of 4000 pixels wide(!) diff --git a/src/kernel/qinternal_p.h b/src/kernel/qinternal_p.h index 7e3c8774b..875263dd9 100644 --- a/src/kernel/qinternal_p.h +++ b/src/kernel/qinternal_p.h @@ -53,11 +53,11 @@ // // #ifndef QT_H -#include "qnamespace.h" -#include "qrect.h" -#include "qptrlist.h" -#include "qcstring.h" -#include "qiodevice.h" +#include "ntqnamespace.h" +#include "ntqrect.h" +#include "ntqptrlist.h" +#include "ntqcstring.h" +#include "ntqiodevice.h" #endif // QT_H class TQWidget; diff --git a/src/kernel/qjpegio.cpp b/src/kernel/qjpegio.cpp index 43a747924..de1832b26 100644 --- a/src/kernel/qjpegio.cpp +++ b/src/kernel/qjpegio.cpp @@ -42,12 +42,12 @@ #define QT_CLEAN_NAMESPACE #endif -#include "qimage.h" +#include "ntqimage.h" #ifndef QT_NO_IMAGEIO_JPEG -#include "qiodevice.h" -#include "qjpegio.h" +#include "ntqiodevice.h" +#include "ntqjpegio.h" #include // jpeglib needs this to be pre-included #include diff --git a/src/kernel/qjpegio.h b/src/kernel/qjpegio.h deleted file mode 100644 index 9610bafe8..000000000 --- a/src/kernel/qjpegio.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Definition of JPEG TQImage IOHandler -** -** Created : 970621 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQJPEGIO_H -#define TQJPEGIO_H - -#include "qglobal.h" - -#ifndef QT_NO_IMAGEIO_JPEG - -void qInitJpegIO(); - -#endif // QT_NO_IMAGEIO_JPEG - -#endif // TQJPEGIO_H diff --git a/src/kernel/qkeycode.h b/src/kernel/qkeycode.h deleted file mode 100644 index dff86f893..000000000 --- a/src/kernel/qkeycode.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Definition of keyboard codes -** -** Created : 931030 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQKEYCODE_H -#define TQKEYCODE_H - -#ifndef QT_H -#include "qnamespace.h" -#endif // QT_H - -// all key codes are now in the TQt namespace class - -#endif // TQKEYCODE_H diff --git a/src/kernel/qkeysequence.cpp b/src/kernel/qkeysequence.cpp index 68f6faeb1..727b443bf 100644 --- a/src/kernel/qkeysequence.cpp +++ b/src/kernel/qkeysequence.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qkeysequence.h" +#include "ntqkeysequence.h" #ifndef QT_NO_ACCEL -#include "qaccel.h" -#include "qshared.h" -#include "qvaluelist.h" +#include "ntqaccel.h" +#include "ntqshared.h" +#include "ntqvaluelist.h" #ifndef QT_NO_REGEXP -# include "qregexp.h" +# include "ntqregexp.h" #endif #ifdef Q_WS_MAC @@ -57,7 +57,7 @@ #endif /*! - \class TQKeySequence qkeysequence.h + \class TQKeySequence ntqkeysequence.h \brief The TQKeySequence class encapsulates a key sequence as used by accelerators. @@ -67,7 +67,7 @@ optionally combined with modifiers, e.g. \c SHIFT, \c CTRL, \c ALT, \c META, or \c UNICODE_ACCEL. For example, \c{CTRL + Key_P} might be a sequence used as a shortcut for printing a document. - The key codes are listed in \c{qnamespace.h}. As an alternative, + The key codes are listed in \c{ntqnamespace.h}. As an alternative, use \c UNICODE_ACCEL with the unicode code point of the character. For example, \c{UNICODE_ACCEL + 'A'} gives the same key sequence as \c Key_A. @@ -241,7 +241,7 @@ TQKeySequence::TQKeySequence( const TQString& key ) /*! Constructs a key sequence that has a single \a key. - The key codes are listed in \c{qnamespace.h} and can be + The key codes are listed in \c{ntqnamespace.h} and can be combined with modifiers, e.g. with \c SHIFT, \c CTRL, \c ALT, \c META or \c UNICODE_ACCEL. */ @@ -256,7 +256,7 @@ TQKeySequence::TQKeySequence( int key ) Constructs a key sequence with up to 4 keys \a k1, \a k2, \a k3 and \a k4. - The key codes are listed in \c{qnamespace.h} and can be + The key codes are listed in \c{ntqnamespace.h} and can be combined with modifiers, e.g. with \c SHIFT, \c CTRL, \c ALT, \c META or \c UNICODE_ACCEL. */ diff --git a/src/kernel/qkeysequence.h b/src/kernel/qkeysequence.h deleted file mode 100644 index 3a845efff..000000000 --- a/src/kernel/qkeysequence.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Definition of TQKeySequence class -** -** Created : 0108007 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQKEYSETQUENCE_H -#define TQKEYSETQUENCE_H - -#ifndef QT_H -#ifndef QT_H -#include "qnamespace.h" -#include "qstring.h" -#endif // QT_H -#endif - -#ifndef QT_NO_ACCEL - -/***************************************************************************** - TQKeySequence stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -class TQKeySequence; -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQKeySequence & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQKeySequence & ); -#endif - -class TQKeySequencePrivate; - -class Q_EXPORT TQKeySequence : public TQt -{ -public: - TQKeySequence(); - TQKeySequence( const TQString& key ); - TQKeySequence( int key ); - TQKeySequence( int k1, int k2, int k3 = 0, int k4 = 0 ); - TQKeySequence( const TQKeySequence & ); - ~TQKeySequence(); - - uint count() const; - bool isEmpty() const; - TQt::SequenceMatch matches( const TQKeySequence & ) const; - - operator TQString() const; - operator int () const; - int operator[]( uint ) const; - TQKeySequence &operator=( const TQKeySequence & ); - bool operator==( const TQKeySequence& ) const; - bool operator!= ( const TQKeySequence& ) const; - -private: - static int decodeString( const TQString & ); - static TQString encodeString( int ); - int assign( TQString ); - void setKey( int key, int index ); - - TQKeySequencePrivate* d; - - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQKeySequence & ); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQKeySequence & ); - friend class TQAccelManager; -}; - -#else - -class Q_EXPORT TQKeySequence : public TQt -{ -public: - TQKeySequence() {} - TQKeySequence( int ) {} -}; - -#endif //QT_NO_ACCEL - -#endif diff --git a/src/kernel/qlayout.cpp b/src/kernel/qlayout.cpp index 9f0792908..df9229ed8 100644 --- a/src/kernel/qlayout.cpp +++ b/src/kernel/qlayout.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qlayout.h" +#include "ntqlayout.h" #ifndef QT_NO_LAYOUT -#include "qapplication.h" -#include "qwidget.h" -#include "qptrlist.h" -#include "qsizepolicy.h" +#include "ntqapplication.h" +#include "ntqwidget.h" +#include "ntqptrlist.h" +#include "ntqsizepolicy.h" #include "qlayoutengine_p.h" diff --git a/src/kernel/qlayout.h b/src/kernel/qlayout.h deleted file mode 100644 index 798c9c867..000000000 --- a/src/kernel/qlayout.h +++ /dev/null @@ -1,473 +0,0 @@ -/**************************************************************************** -** -** Definition of layout classes -** -** Created : 960416 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLAYOUT_H -#define TQLAYOUT_H - -#ifndef QT_H -#include "qobject.h" -#include "qsizepolicy.h" -#include "qwidget.h" -#endif // QT_H - -#include - -#ifndef QT_NO_LAYOUT - -#if 0 -Q_OBJECT -#endif - -static const int TQLAYOUTSIZE_MAX = INT_MAX/256/16; - -class TQGridLayoutBox; -class TQGridLayoutData; -class TQLayout; -class TQLayoutItem; -struct TQLayoutData; -class TQMenuBar; -class TQSpacerItem; -class TQWidget; - -class Q_EXPORT TQGLayoutIterator : public TQShared -{ -public: - virtual ~TQGLayoutIterator(); - virtual TQLayoutItem *next() = 0; - virtual TQLayoutItem *current() = 0; - virtual TQLayoutItem *takeCurrent() = 0; -}; - -class Q_EXPORT TQLayoutIterator -{ -public: - TQLayoutIterator( TQGLayoutIterator *i ) : it( i ) { } - TQLayoutIterator( const TQLayoutIterator &i ) : it( i.it ) { - if ( it ) - it->ref(); - } - ~TQLayoutIterator() { if ( it && it->deref() ) delete it; } - TQLayoutIterator &operator=( const TQLayoutIterator &i ) { - if ( i.it ) - i.it->ref(); - if ( it && it->deref() ) - delete it; - it = i.it; - return *this; - } - TQLayoutItem *operator++() { return it ? it->next() : 0; } - TQLayoutItem *current() { return it ? it->current() : 0; } - TQLayoutItem *takeCurrent() { return it ? it->takeCurrent() : 0; } - void deleteCurrent(); - -private: - TQGLayoutIterator *it; -}; - -class Q_EXPORT TQLayoutItem -{ -public: - TQLayoutItem( int alignment = 0 ) : align( alignment ) { } - virtual ~TQLayoutItem(); - 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; - // ### add minimumHeightForWidth( int ) in TQt 4.0 - virtual void invalidate(); - - virtual TQWidget *widget(); - virtual TQLayoutIterator iterator(); - virtual TQLayout *layout(); - virtual TQSpacerItem *spacerItem(); - - int alignment() const { return align; } - virtual void setAlignment( int a ); - -protected: - int align; -}; - -class Q_EXPORT TQSpacerItem : public TQLayoutItem -{ -public: - TQSpacerItem( int w, int h, - TQSizePolicy::SizeType hData = TQSizePolicy::Minimum, - TQSizePolicy::SizeType vData = TQSizePolicy::Minimum ) - : width( w ), height( h ), sizeP( hData, vData ) { } - void changeSize( int w, int h, - TQSizePolicy::SizeType hData = TQSizePolicy::Minimum, - TQSizePolicy::SizeType vData = 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(); - -private: - int width; - int height; - TQSizePolicy sizeP; - TQRect rect; -}; - -class Q_EXPORT TQWidgetItem : public TQLayoutItem -{ -public: - TQWidgetItem( TQWidget *w ) : wid( w ) { } - 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; - -private: - TQWidget *wid; -}; - -class Q_EXPORT TQLayout : public TQObject, public TQLayoutItem -{ - Q_OBJECT - Q_ENUMS( ResizeMode ) - Q_PROPERTY( int margin READ margin WRITE setMargin ) - Q_PROPERTY( int spacing READ spacing WRITE setSpacing ) - Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode ) - -public: - // ### TQt 4.0: put 'Auto' first in enum - enum ResizeMode { FreeResize, Minimum, Fixed, Auto }; - - TQLayout( TQWidget *parent, int margin = 0, int spacing = -1, - const char *name = 0 ); - TQLayout( TQLayout *parentLayout, int spacing = -1, const char *name = 0 ); - TQLayout( int spacing = -1, const char *name = 0 ); - ~TQLayout(); - - int margin() const { return outsideBorder; } - int spacing() const { return insideSpacing; } - - virtual void setMargin( int ); - virtual void setSpacing( int ); - - int defaultBorder() const { return insideSpacing; } - void freeze( int w, int h ); - void freeze() { setResizeMode( Fixed ); } - - void setResizeMode( ResizeMode ); - ResizeMode resizeMode() const; - -#ifndef QT_NO_MENUBAR - virtual void setMenuBar( TQMenuBar *w ); - TQMenuBar *menuBar() const { return menubar; } -#endif - - TQWidget *mainWidget(); - bool isTopLevel() const { return topLevel; } - - virtual void setAutoAdd( bool ); - bool autoAdd() const { return autoNewChild; } - - void invalidate(); - TQRect geometry() const; - bool activate(); - - void add( TQWidget *w ) { addItem( new TQWidgetItem(w) ); } - virtual void addItem( TQLayoutItem * ) = 0; - - void remove( TQWidget *w ); - void removeItem( TQLayoutItem * ); - - TQSizePolicy::ExpandData expanding() const; - TQSize minimumSize() const; - TQSize maximumSize() const; - void setGeometry( const TQRect& ) = 0; - TQLayoutIterator iterator() = 0; - bool isEmpty() const; - - int totalHeightForWidth( int w ) const; - TQSize totalMinimumSize() const; - TQSize totalMaximumSize() const; - TQSize totalSizeHint() const; - TQLayout *layout(); - - bool supportsMargin() const { return marginImpl; } - - void setEnabled( bool ); - bool isEnabled() const; - -protected: - bool eventFilter( TQObject *, TQEvent * ); - void childEvent( TQChildEvent *e ); - void addChildLayout( TQLayout *l ); - void deleteAllItems(); - - void setSupportsMargin( bool ); - TQRect alignmentRect( const TQRect& ) const; - -private: - void setWidgetLayout( TQWidget *, TQLayout * ); - void init(); - int insideSpacing; - int outsideBorder; - uint topLevel : 1; - uint enabled : 1; - uint autoNewChild : 1; - uint frozen : 1; - uint activated : 1; - uint marginImpl : 1; - uint autoMinimum : 1; - uint autoResizeMode : 1; - TQRect rect; - TQLayoutData *extraData; -#ifndef QT_NO_MENUBAR - TQMenuBar *menubar; -#endif - -private: -#if defined(Q_DISABLE_COPY) - TQLayout( const TQLayout & ); - TQLayout &operator=( const TQLayout & ); -#endif - - static void propagateSpacing( TQLayout *layout ); -}; - -inline void TQLayoutIterator::deleteCurrent() -{ - delete takeCurrent(); -} - -class Q_EXPORT TQGridLayout : public TQLayout -{ - Q_OBJECT -public: - TQGridLayout( TQWidget *parent, int nRows = 1, int nCols = 1, int border = 0, - int spacing = -1, const char *name = 0 ); - TQGridLayout( int nRows = 1, int nCols = 1, int spacing = -1, - const char *name = 0 ); - TQGridLayout( TQLayout *parentLayout, int nRows = 1, int nCols = 1, - int spacing = -1, const char *name = 0 ); - ~TQGridLayout(); - - TQSize sizeHint() const; - TQSize minimumSize() const; - TQSize maximumSize() const; - - // ### remove 'virtual' in 4.0 (or add 'virtual' to set{Row,Col}Spacing()) - virtual void setRowStretch( int row, int stretch ); - virtual void setColStretch( int col, int stretch ); - int rowStretch( int row ) const; - int colStretch( int col ) const; - - void setRowSpacing( int row, int minSize ); - void setColSpacing( int col, int minSize ); - int rowSpacing( int row ) const; - int colSpacing( int col ) const; - - int numRows() const; - int numCols() const; - TQRect cellGeometry( int row, int col ) const; - - bool hasHeightForWidth() const; - int heightForWidth( int ) const; - int minimumHeightForWidth( int ) const; - - TQSizePolicy::ExpandData expanding() const; - void invalidate(); - - void addItem( TQLayoutItem * ); - void addItem( TQLayoutItem *item, int row, int col ); - void addMultiCell( TQLayoutItem *, int fromRow, int toRow, - int fromCol, int toCol, int align = 0 ); - - void addWidget( TQWidget *, int row, int col, int align = 0 ); - void addMultiCellWidget( TQWidget *, int fromRow, int toRow, - int fromCol, int toCol, int align = 0 ); - void addLayout( TQLayout *layout, int row, int col); - void addMultiCellLayout( TQLayout *layout, int fromRow, int toRow, - int fromCol, int toCol, int align = 0 ); - void addRowSpacing( int row, int minsize ); - void addColSpacing( int col, int minsize ); - - void expand( int rows, int cols ); - - enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }; - void setOrigin( Corner ); - Corner origin() const; - TQLayoutIterator iterator(); - void setGeometry( const TQRect& ); - -protected: - bool findWidget( TQWidget* w, int *r, int *c ); - void add( TQLayoutItem*, int row, int col ); - -private: -#if defined(Q_DISABLE_COPY) - TQGridLayout( const TQGridLayout & ); - TQGridLayout &operator=( const TQGridLayout & ); -#endif - - void init( int rows, int cols ); - TQGridLayoutData *data; -}; - -class TQBoxLayoutData; -class TQDockWindow; - -class Q_EXPORT TQBoxLayout : public TQLayout -{ - Q_OBJECT -public: - enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, - Down = TopToBottom, Up = BottomToTop }; - - TQBoxLayout( TQWidget *parent, Direction, int border = 0, int spacing = -1, - const char *name = 0 ); - TQBoxLayout( TQLayout *parentLayout, Direction, int spacing = -1, - const char *name = 0 ); - TQBoxLayout( Direction, int spacing = -1, const char *name = 0 ); - ~TQBoxLayout(); - - void addItem( TQLayoutItem * ); - - Direction direction() const { return dir; } - void setDirection( Direction ); - - void addSpacing( int size ); - void addStretch( int stretch = 0 ); - void addWidget( TQWidget *, int stretch = 0, int alignment = 0 ); - void addLayout( TQLayout *layout, int stretch = 0 ); - void addStrut( int ); - - void insertSpacing( int index, int size ); - void insertStretch( int index, int stretch = 0 ); - void insertWidget( int index, TQWidget *widget, int stretch = 0, - int alignment = 0 ); - void insertLayout( int index, TQLayout *layout, int stretch = 0 ); - - bool setStretchFactor( TQWidget*, int stretch ); - bool setStretchFactor( TQLayout *l, int stretch ); - - 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& ); - - int findWidget( TQWidget* w ); - -protected: - void insertItem( int index, TQLayoutItem * ); - -private: - friend class TQDockWindow; -#if defined(Q_DISABLE_COPY) - TQBoxLayout( const TQBoxLayout & ); - TQBoxLayout &operator=( const TQBoxLayout & ); -#endif - - void setupGeom(); - void calcHfw( int ); - TQBoxLayoutData *data; - Direction dir; - TQBoxLayout *createTmpCopy(); -}; - -class Q_EXPORT TQHBoxLayout : public TQBoxLayout -{ - Q_OBJECT -public: - TQHBoxLayout( TQWidget *parent, int border = 0, - int spacing = -1, const char *name = 0 ); - TQHBoxLayout( TQLayout *parentLayout, - int spacing = -1, const char *name = 0 ); - TQHBoxLayout( int spacing = -1, const char *name = 0 ); - - ~TQHBoxLayout(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQHBoxLayout( const TQHBoxLayout & ); - TQHBoxLayout &operator=( const TQHBoxLayout & ); -#endif -}; - -class Q_EXPORT TQVBoxLayout : public TQBoxLayout -{ - Q_OBJECT -public: - TQVBoxLayout( TQWidget *parent, int border = 0, - int spacing = -1, const char *name = 0 ); - TQVBoxLayout( TQLayout *parentLayout, - int spacing = -1, const char *name = 0 ); - TQVBoxLayout( int spacing = -1, const char *name = 0 ); - - ~TQVBoxLayout(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQVBoxLayout( const TQVBoxLayout & ); - TQVBoxLayout &operator=( const TQVBoxLayout & ); -#endif -}; - -#endif // QT_NO_LAYOUT -#endif // TQLAYOUT_H diff --git a/src/kernel/qlayoutengine.cpp b/src/kernel/qlayoutengine.cpp index f4c45846d..558d42671 100644 --- a/src/kernel/qlayoutengine.cpp +++ b/src/kernel/qlayoutengine.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qlayout.h" +#include "ntqlayout.h" #include "private/qlayoutengine_p.h" #ifndef QT_NO_LAYOUT diff --git a/src/kernel/qlayoutengine_p.h b/src/kernel/qlayoutengine_p.h index 4231a9c85..2e49891aa 100644 --- a/src/kernel/qlayoutengine_p.h +++ b/src/kernel/qlayoutengine_p.h @@ -42,7 +42,7 @@ #define TQLAYOUTENGINE_P_H #ifndef TQLAYOUT_H - #error "Need to include qlayout.h before including qlayoutengine_p.h" + #error "Need to include ntqlayout.h before including qlayoutengine_p.h" #endif // @@ -60,7 +60,7 @@ #ifndef QT_H -#include "qabstractlayout.h" +#include "ntqabstractlayout.h" #endif // QT_H #ifndef QT_NO_LAYOUT diff --git a/src/kernel/qlocalfs.cpp b/src/kernel/qlocalfs.cpp index 6c4949369..a3e141ba3 100644 --- a/src/kernel/qlocalfs.cpp +++ b/src/kernel/qlocalfs.cpp @@ -38,22 +38,22 @@ ** **********************************************************************/ -#include "qlocalfs.h" +#include "ntqlocalfs.h" #ifndef QT_NO_NETWORKPROTOCOL -#include "qfileinfo.h" -#include "qfile.h" -#include "qurlinfo.h" -#include "qapplication.h" -#include "qurloperator.h" -#include "qguardedptr.h" +#include "ntqfileinfo.h" +#include "ntqfile.h" +#include "ntqurlinfo.h" +#include "ntqapplication.h" +#include "ntqurloperator.h" +#include "ntqguardedptr.h" //#define TQLOCALFS_DEBUG /*! - \class TQLocalFs qlocalfs.h + \class TQLocalFs ntqlocalfs.h \brief The TQLocalFs class is an implementation of a TQNetworkProtocol that works on the local file system. \if defined(commercial) diff --git a/src/kernel/qlocalfs.h b/src/kernel/qlocalfs.h deleted file mode 100644 index 56c0ece3e..000000000 --- a/src/kernel/qlocalfs.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Definition of TQLocalFs class -** -** Created : 950429 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLOCALFS_H -#define TQLOCALFS_H - -#ifndef QT_H -#include "qnetworkprotocol.h" -#include "qdir.h" -#endif // QT_H - -#ifndef QT_NO_NETWORKPROTOCOL - -class Q_EXPORT TQLocalFs : public TQNetworkProtocol -{ - Q_OBJECT - -public: - TQLocalFs(); - virtual int supportedOperations() const; - -protected: - virtual void operationListChildren( TQNetworkOperation *op ); - virtual void operationMkDir( TQNetworkOperation *op ); - virtual void operationRemove( TQNetworkOperation *op ); - virtual void operationRename( TQNetworkOperation *op ); - virtual void operationGet( TQNetworkOperation *op ); - virtual void operationPut( TQNetworkOperation *op ); - -private: - int calcBlockSize( int totalSize ) const; - TQDir dir; - -}; - -#endif // QT_NO_NETWORKPROTOCOL - -#endif // TQLOCALFS_H diff --git a/src/kernel/qlock_p.h b/src/kernel/qlock_p.h index 5550b94c0..5fb1526ca 100644 --- a/src/kernel/qlock_p.h +++ b/src/kernel/qlock_p.h @@ -52,7 +52,7 @@ // #ifndef QT_H -#include "qstring.h" +#include "ntqstring.h" #endif // QT_H class TQLockData; diff --git a/src/kernel/qmetaobject.cpp b/src/kernel/qmetaobject.cpp index a2fc39b27..d9e6a152c 100644 --- a/src/kernel/qmetaobject.cpp +++ b/src/kernel/qmetaobject.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qmetaobject.h" -#include "qasciidict.h" +#include "ntqmetaobject.h" +#include "ntqasciidict.h" #ifdef QT_THREAD_SUPPORT #include #endif // QT_THREAD_SUPPORT /*! - \class TQMetaData qmetaobject.h + \class TQMetaData ntqmetaobject.h \reentrant \brief The TQMetaData class provides information about a member function that is known to the meta object system. @@ -64,7 +64,7 @@ */ /*! - \class TQClassInfo qmetaobject.h + \class TQClassInfo ntqmetaobject.h \brief The TQClassInfo class provides a struct that stores some basic information about a single class. @@ -81,7 +81,7 @@ /*! - \class TQMetaObject qmetaobject.h + \class TQMetaObject ntqmetaobject.h \brief The TQMetaObject class contains meta information about TQt objects. \ingroup objectmodel @@ -845,7 +845,7 @@ bool TQMetaObject::qt_static_property( TQObject* o, int id, int f, TQVariant* v) /*! - \class TQMetaProperty qmetaobject.h + \class TQMetaProperty ntqmetaobject.h \brief The TQMetaProperty class stores meta data about a property. diff --git a/src/kernel/qmetaobject.h b/src/kernel/qmetaobject.h deleted file mode 100644 index d2ce0ccc7..000000000 --- a/src/kernel/qmetaobject.h +++ /dev/null @@ -1,286 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMetaObject class -** -** Created : 930419 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMETAOBJECT_H -#define TQMETAOBJECT_H - -#ifndef QT_H -#include "qconnection.h" -#include "qstrlist.h" -#endif // QT_H - -#ifndef Q_MOC_OUTPUT_REVISION -#define Q_MOC_OUTPUT_REVISION 26 -#endif - -class TQObject; -struct TQUMethod; -class TQMetaObjectPrivate; - -struct TQMetaData // - member function meta data -{ // for signal and slots - const char *name; // - member name - const TQUMethod* method; // - detailed method description - enum Access { Private, Protected, Public }; - Access access; // - access permission -}; - -#ifndef QT_NO_PROPERTIES -struct TQMetaEnum // enumerator meta data -{ // for properties - const char *name; // - enumerator name - uint count; // - number of values - struct Item // - a name/value pair - { - const char *key; - int value; - }; - const Item *items; // - the name/value pairs - bool set; // whether enum has to be treated as a set -}; -#endif - -#ifndef QT_NO_PROPERTIES - -class Q_EXPORT TQMetaProperty // property meta data -{ -public: - const char* type() const { return t; } // type of the property - const char* name() const { return n; } // name of the property - - bool writable() const; - bool isValid() const; - - bool isSetType() const; - bool isEnumType() const; - TQStrList enumKeys() const; // enumeration names - - int keyToValue( const char* key ) const; // enum and set conversion functions - const char* valueToKey( int value ) const; - int keysToValue( const TQStrList& keys ) const; - TQStrList valueToKeys( int value ) const; - - bool designable( TQObject* = 0 ) const; - bool scriptable( TQObject* = 0 ) const; - bool stored( TQObject* = 0 ) const; - - bool reset( TQObject* ) const; - - const char* t; // internal - const char* n; // internal - - enum Flags { - Invalid = 0x00000000, - Readable = 0x00000001, - Writable = 0x00000002, - EnumOrSet = 0x00000004, - UnresolvedEnum = 0x00000008, - StdSet = 0x00000100, - Override = 0x00000200 - }; - - uint flags; // internal - bool testFlags( uint f ) const; // internal - bool stdSet() const; // internal - int id() const; // internal - - TQMetaObject** meta; // internal - - const TQMetaEnum* enumData; // internal - int _id; // internal - void clear(); // internal -}; - -inline bool TQMetaProperty::testFlags( uint f ) const -{ return (flags & (uint)f) != (uint)0; } - -#endif // QT_NO_PROPERTIES - -struct TQClassInfo // class info meta data -{ - const char* name; // - name of the info - const char* value; // - value of the info -}; - -class Q_EXPORT TQMetaObject // meta object class -{ -public: - TQMetaObject( const char * const class_name, TQMetaObject *superclass, - const TQMetaData * const slot_data, int n_slots, - const TQMetaData * const signal_data, int n_signals, -#ifndef QT_NO_PROPERTIES - const TQMetaProperty *const prop_data, int n_props, - const TQMetaEnum *const enum_data, int n_enums, -#endif - const TQClassInfo *const class_info, int n_info ); - -#ifndef QT_NO_PROPERTIES - TQMetaObject( const char * const class_name, TQMetaObject *superclass, - const TQMetaData * const slot_data, int n_slots, - const TQMetaData * const signal_data, int n_signals, - const TQMetaProperty *const prop_data, int n_props, - const TQMetaEnum *const enum_data, int n_enums, - bool (*qt_static_property)(TQObject*, int, int, TQVariant*), - const TQClassInfo *const class_info, int n_info ); -#endif - - - virtual ~TQMetaObject(); - - const char *className() const { return classname; } - const char *superClassName() const { return superclassname; } - - TQMetaObject *superClass() const { return superclass; } - - bool inherits( const char* clname ) const; - - int numSlots( bool super = FALSE ) const; - int numSignals( bool super = FALSE ) const; - - int findSlot( const char *, bool super = FALSE ) const; - int findSignal( const char *, bool super = FALSE ) const; - - const TQMetaData *slot( int index, bool super = FALSE ) const; - const TQMetaData *signal( int index, bool super = FALSE ) const; - - TQStrList slotNames( bool super = FALSE ) const; - TQStrList signalNames( bool super = FALSE ) const; - - int slotOffset() const; - int signalOffset() const; - int propertyOffset() const; - - int numClassInfo( bool super = FALSE ) const; - const TQClassInfo *classInfo( int index, bool super = FALSE ) const; - const char *classInfo( const char* name, bool super = FALSE ) const; - -#ifndef QT_NO_PROPERTIES - const TQMetaProperty *property( int index, bool super = FALSE ) const; - int findProperty( const char *name, bool super = FALSE ) const; - int indexOfProperty( const TQMetaProperty*, bool super = FALSE ) const; - const TQMetaProperty* resolveProperty( const TQMetaProperty* ) const; - int resolveProperty( int ) const; - TQStrList propertyNames( bool super = FALSE ) const; - int numProperties( bool super = FALSE ) const; -#endif - - // static wrappers around constructors, necessary to work around a - // Windows-DLL limitation: objects can only be deleted within a - // DLL if they were actually created within that DLL. - static TQMetaObject *new_metaobject( const char *, TQMetaObject *, - const TQMetaData *const, int, - const TQMetaData *const, int, -#ifndef QT_NO_PROPERTIES - const TQMetaProperty *const prop_data, int n_props, - const TQMetaEnum *const enum_data, int n_enums, -#endif - const TQClassInfo *const class_info, int n_info ); -#ifndef QT_NO_PROPERTIES - static TQMetaObject *new_metaobject( const char *, TQMetaObject *, - const TQMetaData *const, int, - const TQMetaData *const, int, - const TQMetaProperty *const prop_data, int n_props, - const TQMetaEnum *const enum_data, int n_enums, - bool (*qt_static_property)(TQObject*, int, int, TQVariant*), - const TQClassInfo *const class_info, int n_info ); - TQStrList enumeratorNames( bool super = FALSE ) const; - int numEnumerators( bool super = FALSE ) const; - const TQMetaEnum *enumerator( const char* name, bool super = FALSE ) const; -#endif - - static TQMetaObject *metaObject( const char *class_name ); - static bool hasMetaObject( const char *class_name ); - -private: - TQMemberDict *init( const TQMetaData *, int ); - - const char *classname; // class name - const char *superclassname; // super class name - TQMetaObject *superclass; // super class meta object - TQMetaObjectPrivate *d; // private data for... - void *reserved; // ...binary compatibility - const TQMetaData *slotData; // slot meta data - TQMemberDict *slotDict; // slot dictionary - const TQMetaData *signalData; // signal meta data - TQMemberDict *signalDict; // signal dictionary - int signaloffset; - int slotoffset; -#ifndef QT_NO_PROPERTIES - int propertyoffset; -public: - bool qt_static_property( TQObject* o, int id, int f, TQVariant* v); -private: - friend class TQMetaProperty; -#endif - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMetaObject( const TQMetaObject & ); - TQMetaObject &operator=( const TQMetaObject & ); -#endif -}; - -inline int TQMetaObject::slotOffset() const -{ return slotoffset; } - -inline int TQMetaObject::signalOffset() const -{ return signaloffset; } - -#ifndef QT_NO_PROPERTIES -inline int TQMetaObject::propertyOffset() const -{ return propertyoffset; } -#endif - -typedef TQMetaObject *(*TQtStaticMetaObjectFunction)(); - -class Q_EXPORT TQMetaObjectCleanUp -{ -public: - TQMetaObjectCleanUp( const char *mo_name, TQtStaticMetaObjectFunction ); - TQMetaObjectCleanUp(); - ~TQMetaObjectCleanUp(); - - void setMetaObject( TQMetaObject *&mo ); - -private: - TQMetaObject **metaObject; -}; - -#endif // TQMETAOBJECT_H diff --git a/src/kernel/qmime.cpp b/src/kernel/qmime.cpp index b783bac98..34d4b2152 100644 --- a/src/kernel/qmime.cpp +++ b/src/kernel/qmime.cpp @@ -36,21 +36,21 @@ ** **********************************************************************/ -#include "qmime.h" +#include "ntqmime.h" #ifndef QT_NO_MIME -#include "qmap.h" -#include "qstringlist.h" -#include "qfileinfo.h" -#include "qdir.h" -#include "qdragobject.h" -#include "qcleanuphandler.h" -#include "qapplication.h" // ### for now -#include "qclipboard.h" // ### for now +#include "ntqmap.h" +#include "ntqstringlist.h" +#include "ntqfileinfo.h" +#include "ntqdir.h" +#include "ntqdragobject.h" +#include "ntqcleanuphandler.h" +#include "ntqapplication.h" // ### for now +#include "ntqclipboard.h" // ### for now /*! - \class TQMimeSource qmime.h + \class TQMimeSource ntqmime.h \brief The TQMimeSource class is an abstraction of objects which provide formatted data of a certain MIME type. \ingroup io @@ -180,7 +180,7 @@ public: /*! - \class TQMimeSourceFactory qmime.h + \class TQMimeSourceFactory ntqmime.h \brief The TQMimeSourceFactory class is an extensible provider of mime-typed data. \ingroup io diff --git a/src/kernel/qmime.h b/src/kernel/qmime.h deleted file mode 100644 index 0ea9b8d1b..000000000 --- a/src/kernel/qmime.h +++ /dev/null @@ -1,200 +0,0 @@ -/**************************************************************************** -** -** Definition of mime classes -** -** Created : 981204 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMIME_H -#define TQMIME_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qmap.h" -#endif // QT_H - -#ifndef QT_NO_MIME - -class TQImageDrag; -class TQTextDrag; - -class Q_EXPORT TQMimeSource -{ - friend class TQClipboardData; - -public: - TQMimeSource(); - virtual ~TQMimeSource(); - virtual const char* format( int n = 0 ) const = 0; - virtual bool provides( const char* ) const; - virtual TQByteArray encodedData( const char* ) const = 0; - int serialNumber() const; - -private: - int ser_no; - enum { NoCache, Text, Graphics } cacheType; - union - { - struct - { - TQString *str; - TQCString *subtype; - } txt; - struct - { - TQImage *img; - TQPixmap *pix; - } gfx; - } cache; - void clearCache(); - - // friends for caching - friend class TQImageDrag; - friend class TQTextDrag; - -}; - -inline int TQMimeSource::serialNumber() const -{ return ser_no; } - -class TQStringList; -class TQMimeSourceFactoryData; - -class Q_EXPORT TQMimeSourceFactory { -public: - TQMimeSourceFactory(); - virtual ~TQMimeSourceFactory(); - - static TQMimeSourceFactory* defaultFactory(); - static void setDefaultFactory( TQMimeSourceFactory* ); - static TQMimeSourceFactory* takeDefaultFactory(); - static void addFactory( TQMimeSourceFactory *f ); - static void removeFactory( TQMimeSourceFactory *f ); - - virtual const TQMimeSource* data(const TQString& abs_name) const; - virtual TQString makeAbsolute(const TQString& abs_or_rel_name, const TQString& context) const; - const TQMimeSource* data(const TQString& abs_or_rel_name, const TQString& context) const; - - virtual void setText( const TQString& abs_name, const TQString& text ); - virtual void setImage( const TQString& abs_name, const TQImage& im ); - virtual void setPixmap( const TQString& abs_name, const TQPixmap& pm ); - virtual void setData( const TQString& abs_name, TQMimeSource* data ); - virtual void setFilePath( const TQStringList& ); - virtual TQStringList filePath() const; - void addFilePath( const TQString& ); - virtual void setExtensionType( const TQString& ext, const char* mimetype ); - -private: - TQMimeSource *dataInternal(const TQString& abs_name, const TQMap &extensions ) const; - TQMimeSourceFactoryData* d; -}; - -#if defined(Q_WS_WIN) - -#ifndef QT_H -#include "qptrlist.h" // down here for GCC 2.7.* compatibility -#endif // QT_H - -/* - Encapsulation of conversion between MIME and Windows CLIPFORMAT. - Not need on X11, as the underlying protocol uses the MIME standard - directly. -*/ - -class Q_EXPORT TQWindowsMime { -public: - TQWindowsMime(); - virtual ~TQWindowsMime(); - - static void initialize(); - - static TQPtrList all(); - static TQWindowsMime* convertor( const char* mime, int cf ); - static const char* cfToMime(int cf); - - static int registerMimeType(const char *mime); - - virtual const char* convertorName()=0; - virtual int countCf()=0; - virtual int cf(int index)=0; - virtual bool canConvert( const char* mime, int cf )=0; - virtual const char* mimeFor(int cf)=0; - virtual int cfFor(const char* )=0; - virtual TQByteArray convertToMime( TQByteArray data, const char* mime, int cf )=0; - virtual TQByteArray convertFromMime( TQByteArray data, const char* mime, int cf )=0; -}; - -#endif -#if defined(Q_WS_MAC) - -#ifndef QT_H -#include "qptrlist.h" // down here for GCC 2.7.* compatibility -#endif // QT_H - -/* - Encapsulation of conversion between MIME and Mac flavor. - Not need on X11, as the underlying protocol uses the MIME standard - directly. -*/ - -class Q_EXPORT TQMacMime { - char type; -public: - enum TQMacMimeType { MIME_DND=0x01, MIME_CLIP=0x02, MIME_QT_CONVERTOR=0x04, MIME_ALL=MIME_DND|MIME_CLIP }; - TQMacMime(char); - virtual ~TQMacMime(); - - static void initialize(); - - static TQPtrList all(TQMacMimeType); - static TQMacMime* convertor(TQMacMimeType, const char* mime, int flav); - static const char* flavorToMime(TQMacMimeType, int flav); - - virtual const char* convertorName()=0; - virtual int countFlavors()=0; - virtual int flavor(int index)=0; - virtual bool canConvert(const char* mime, int flav)=0; - virtual const char* mimeFor(int flav)=0; - virtual int flavorFor(const char*)=0; - virtual TQByteArray convertToMime(TQValueList data, const char* mime, int flav)=0; - virtual TQValueList convertFromMime(TQByteArray data, const char* mime, int flav)=0; -}; - -#endif // Q_WS_MAC - -#endif // QT_NO_MIME - -#endif // TQMIME_H diff --git a/src/kernel/qmngio.cpp b/src/kernel/qmngio.cpp index 809291842..0bd83131a 100644 --- a/src/kernel/qmngio.cpp +++ b/src/kernel/qmngio.cpp @@ -42,14 +42,14 @@ #define QT_CLEAN_NAMESPACE #endif -#include "qdatetime.h" +#include "ntqdatetime.h" #ifndef QT_NO_IMAGEIO_MNG -#include "qimage.h" -#include "qasyncimageio.h" -#include "qiodevice.h" -#include "qmngio.h" +#include "ntqimage.h" +#include "ntqasyncimageio.h" +#include "ntqiodevice.h" +#include "ntqmngio.h" // Define XMD_H prohibits the included headers of libmng.h to typedef INT32. // This is needed for Borland with STL support, since in that case, INT32 is @@ -209,7 +209,7 @@ class TQMNGFormatType : public TQImageFormatType /* - \class TQMNGFormat qmngio.h + \class TQMNGFormat ntqmngio.h \brief Incremental image decoder for MNG image format. \ingroup images @@ -241,7 +241,7 @@ TODO: decide on this point. gIFg gives disposal types, so it can be done. */ /* - \class TQMNGFormatType qasyncimageio.h + \class TQMNGFormatType ntqasyncimageio.h \brief Incremental image decoder for MNG image format. \ingroup images diff --git a/src/kernel/qmngio.h b/src/kernel/qmngio.h deleted file mode 100644 index 76f5abf69..000000000 --- a/src/kernel/qmngio.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Definition of MNG TQImage IOHandler -** -** Created : 970521 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMNGIO_H -#define TQMNGIO_H - -#ifndef QT_H -#endif // QT_H - -#ifndef QT_NO_IMAGEIO_MNG - -void qInitMngIO(); - -#endif // QT_NO_IMAGEIO_MNG - -#endif // TQMNGIO_H diff --git a/src/kernel/qmotifdnd_x11.cpp b/src/kernel/qmotifdnd_x11.cpp index ddb7bb17b..0085b8956 100644 --- a/src/kernel/qmotifdnd_x11.cpp +++ b/src/kernel/qmotifdnd_x11.cpp @@ -68,11 +68,11 @@ in doc/dnd.doc, where the documentation system can see it. */ #include "qplatformdefs.h" -#include "qapplication.h" +#include "ntqapplication.h" #ifndef QT_NO_DRAGANDDROP -#include "qwidget.h" +#include "ntqwidget.h" #include "qt_x11_p.h" #include diff --git a/src/kernel/qmovie.cpp b/src/kernel/qmovie.cpp index 2f2d9148a..431660674 100644 --- a/src/kernel/qmovie.cpp +++ b/src/kernel/qmovie.cpp @@ -40,15 +40,15 @@ // #define QT_SAVE_MOVIE_HACK -#include "qtimer.h" -#include "qpainter.h" -#include "qptrlist.h" -#include "qbitmap.h" -#include "qmovie.h" -#include "qfile.h" -#include "qbuffer.h" -#include "qobject.h" -#include "qpixmapcache.h" +#include "ntqtimer.h" +#include "ntqpainter.h" +#include "ntqptrlist.h" +#include "ntqbitmap.h" +#include "ntqmovie.h" +#include "ntqfile.h" +#include "ntqbuffer.h" +#include "ntqobject.h" +#include "ntqpixmapcache.h" #ifndef QT_NO_MOVIE @@ -56,13 +56,13 @@ #include "qgfx_qws.h" #endif -#include "qasyncio.h" -#include "qasyncimageio.h" +#include "ntqasyncio.h" +#include "ntqasyncimageio.h" #include /*! - \class TQMovie qmovie.h + \class TQMovie ntqmovie.h \brief The TQMovie class provides incremental loading of animations or images, signalling as it progresses. \ingroup images @@ -94,7 +94,7 @@ The supported formats are MNG (if TQt is configured with MNG support enabled) and GIF (if TQt is configured with GIF support - enabled, see qgif.h). + enabled, see ntqgif.h). If TQt is configured to support GIF reading, we are required to state that "The Graphics Interchange Format(c) is the Copyright diff --git a/src/kernel/qmovie.h b/src/kernel/qmovie.h deleted file mode 100644 index db75ac331..000000000 --- a/src/kernel/qmovie.h +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Definition of movie classes -** -** Created : 970617 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMOVIE_H -#define TQMOVIE_H - -#ifndef QT_H -#include "qpixmap.h" // ### remove or keep for users' convenience? -#endif // QT_H - -#ifndef QT_NO_MOVIE - -class TQDataSource; -class TQObject; -class TQMoviePrivate; - -class Q_EXPORT TQMovie { -public: - TQMovie(); - TQMovie(int bufsize); - TQMovie(TQDataSource*, int bufsize=1024); - TQMovie(const TQString &fileName, int bufsize=1024); - TQMovie(TQByteArray data, int bufsize=1024); - TQMovie(const TQMovie&); - ~TQMovie(); - - TQMovie& operator=(const TQMovie&); - - int pushSpace() const; - void pushData(const uchar* data, int length); - - 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(TQObject* receiver, const char *member); - void disconnectResize(TQObject* receiver, const char *member=0); - - void connectUpdate(TQObject* receiver, const char *member); - void disconnectUpdate(TQObject* receiver, const char *member=0); - -#ifdef Q_WS_QWS - // Temporary hack - void setDisplayWidget(TQWidget * w); -#endif - - enum Status { SourceEmpty=-2, - UnrecognizedFormat=-1, - Paused=1, - EndOfFrame=2, - EndOfLoop=3, - EndOfMovie=4, - SpeedChanged=5 }; - void connectStatus(TQObject* receiver, const char *member); - void disconnectStatus(TQObject* receiver, const char *member=0); - -private: - TQMoviePrivate *d; -}; - -#endif // QT_NO_MOVIE - -#endif diff --git a/src/kernel/qnamespace.h b/src/kernel/qnamespace.h deleted file mode 100644 index 85a327f3e..000000000 --- a/src/kernel/qnamespace.h +++ /dev/null @@ -1,1030 +0,0 @@ -/**************************************************************************** -** -** Definition of TQt namespace (as class for compiler compatibility) -** -** Created : 980927 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQNAMESPACE_H -#define TQNAMESPACE_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - - -class TQColor; -class TQCursor; - - -class Q_EXPORT TQt { -public: - QT_STATIC_CONST TQColor & color0; - QT_STATIC_CONST TQColor & color1; - QT_STATIC_CONST TQColor & black; - QT_STATIC_CONST TQColor & white; - QT_STATIC_CONST TQColor & darkGray; - QT_STATIC_CONST TQColor & gray; - QT_STATIC_CONST TQColor & lightGray; - QT_STATIC_CONST TQColor & red; - QT_STATIC_CONST TQColor & green; - QT_STATIC_CONST TQColor & blue; - QT_STATIC_CONST TQColor & cyan; - QT_STATIC_CONST TQColor & magenta; - QT_STATIC_CONST TQColor & yellow; - QT_STATIC_CONST TQColor & darkRed; - QT_STATIC_CONST TQColor & darkGreen; - QT_STATIC_CONST TQColor & darkBlue; - QT_STATIC_CONST TQColor & darkCyan; - QT_STATIC_CONST TQColor & darkMagenta; - QT_STATIC_CONST TQColor & darkYellow; - - // documented in qevent.cpp - enum ButtonState { // mouse/keyboard state values - NoButton = 0x0000, - LeftButton = 0x0001, - RightButton = 0x0002, - MidButton = 0x0004, - MouseButtonMask = 0x0007, - ShiftButton = 0x0100, - ControlButton = 0x0200, - AltButton = 0x0400, - MetaButton = 0x0800, - KeyButtonMask = 0x0f00, - Keypad = 0x4000 - }; - - // documented in qobject.cpp - // ideally would start at 1, as in TQSizePolicy, but that breaks other things - enum Orientation { - Horizontal = 0, - Vertical - }; - - // documented in qlistview.cpp - enum SortOrder { - Ascending, - Descending - }; - - // Text formatting flags for TQPainter::drawText and TQLabel - // the following four enums can be combined to one integer which - // is passed as textflag to drawText and qt_format_text. - - // documented in qpainter.cpp - enum AlignmentFlags { - AlignAuto = 0x0000, // text alignment - AlignLeft = 0x0001, - AlignRight = 0x0002, - AlignHCenter = 0x0004, - AlignJustify = 0x0008, - AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify, - AlignTop = 0x0010, - AlignBottom = 0x0020, - AlignVCenter = 0x0040, - AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter, - AlignCenter = AlignVCenter | AlignHCenter - }; - - // documented in qpainter.cpp - enum TextFlags { - SingleLine = 0x0080, // misc. flags - DontClip = 0x0100, - ExpandTabs = 0x0200, - ShowPrefix = 0x0400, - WordBreak = 0x0800, - BreakAnywhere = 0x1000, -#ifndef Q_QDOC - DontPrint = 0x2000, - Underline = 0x01000000, - Overline = 0x02000000, - StrikeOut = 0x04000000, - IncludeTrailingSpaces = 0x08000000, -#endif - NoAccel = 0x4000 - }; - - // Widget flags; documented in qwidget.cpp - typedef uint WState; - - // TQWidget state flags (internal, barely documented in qwidget.cpp) - enum WidgetState { - WState_Created = 0x00000001, - WState_Disabled = 0x00000002, - WState_Visible = 0x00000004, - WState_ForceHide = 0x00000008, - WState_OwnCursor = 0x00000010, - WState_MouseTracking = 0x00000020, - WState_CompressKeys = 0x00000040, - WState_BlockUpdates = 0x00000080, - WState_InPaintEvent = 0x00000100, - WState_Reparented = 0x00000200, - WState_ConfigPending = 0x00000400, - WState_Resized = 0x00000800, - WState_AutoMask = 0x00001000, - WState_Polished = 0x00002000, - WState_DND = 0x00004000, - WState_Reserved0 = 0x00008000, - WState_FullScreen = 0x00010000, - WState_OwnSizePolicy = 0x00020000, - WState_CreatedHidden = 0x00040000, - WState_Maximized = 0x00080000, - WState_Minimized = 0x00100000, - WState_ForceDisabled = 0x00200000, - WState_Exposed = 0x00400000, - WState_HasMouse = 0x00800000 - }; - - // NetWM flags; documented in qwidget.cpp - typedef uint NFlags; - - // documented in qwidget.cpp - enum NETWMFlags { -#if defined(Q_WS_X11) - WX11DisableMove = 0x00000001, - WX11DisableClose = 0x00000002, - WX11DisableResize = 0x00000004, - WX11DisableMinimize = 0x00000008, - WX11DisableMaximize = 0x00000010, - WX11DisableShade = 0x00000020 -#else - WX11DisableMove = 0x00000000, - WX11DisableClose = 0x00000000, - WX11DisableResize = 0x00000000, - WX11DisableMinimize = 0x00000000, - WX11DisableMaximize = 0x00000000, - WX11DisableShade = 0x00000000 -#endif - }; - - // Widget flags2; documented in qwidget.cpp - typedef uint WFlags; - - // documented in qwidget.cpp - enum WidgetFlags { - WType_TopLevel = 0x00000001, // widget type flags - WType_Dialog = 0x00000002, - WType_Popup = 0x00000004, - WType_Desktop = 0x00000008, - WType_Mask = 0x0000000f, - - WStyle_Customize = 0x00000010, // window style flags - WStyle_NormalBorder = 0x00000020, - WStyle_DialogBorder = 0x00000040, // MS-Windows only - WStyle_NoBorder = 0x00002000, - WStyle_Title = 0x00000080, - WStyle_SysMenu = 0x00000100, - WStyle_Minimize = 0x00000200, - WStyle_Maximize = 0x00000400, - WStyle_MinMax = WStyle_Minimize | WStyle_Maximize, - WStyle_Tool = 0x00000800, - WStyle_StaysOnTop = 0x00001000, - WStyle_ContextHelp = 0x00004000, - WStyle_Reserved = 0x00008000, - WStyle_Mask = 0x0000fff0, - - WDestructiveClose = 0x00010000, // misc flags - WPaintDesktop = 0x00020000, - WPaintUnclipped = 0x00040000, - WPaintClever = 0x00080000, - WResizeNoErase = 0x00100000, // OBSOLETE - WMouseNoMask = 0x00200000, - WStaticContents = 0x00400000, - WRepaintNoErase = 0x00800000, // OBSOLETE -#if defined(Q_WS_X11) - WX11BypassWM = 0x01000000, - WWinOwnDC = 0x00000000, - WMacNoSheet = 0x00000000, - WMacDrawer = 0x00000000, -#elif defined(Q_WS_MAC) - WX11BypassWM = 0x00000000, - WWinOwnDC = 0x00000000, - WMacNoSheet = 0x01000000, - WMacDrawer = 0x20000000, -#else - WX11BypassWM = 0x00000000, - WWinOwnDC = 0x01000000, - WMacNoSheet = 0x00000000, - WMacDrawer = 0x00000000, -#endif - WGroupLeader = 0x02000000, - WShowModal = 0x04000000, - WNoMousePropagation = 0x08000000, - WSubWindow = 0x10000000, -#if defined(Q_WS_X11) - WStyle_Splash = 0x20000000, -#else - WStyle_Splash = WStyle_NoBorder | WMacNoSheet | WStyle_Tool | WWinOwnDC, -#endif - WNoAutoErase = WRepaintNoErase | WResizeNoErase -#ifndef QT_NO_COMPAT - , - WNorthWestGravity = WStaticContents, - WType_Modal = WType_Dialog | WShowModal, - WStyle_Dialog = WType_Dialog, - WStyle_NoBorderEx = WStyle_NoBorder -#endif - }; - - enum WindowState { - WindowNoState = 0x00000000, - WindowMinimized = 0x00000001, - WindowMaximized = 0x00000002, - WindowFullScreen = 0x00000004, - WindowActive = 0x00000008 - }; - - - // Image conversion flags. The unusual ordering is caused by - // compatibility and default requirements. - // Documented in qimage.cpp - - enum ImageConversionFlags { - ColorMode_Mask = 0x00000003, - AutoColor = 0x00000000, - ColorOnly = 0x00000003, - MonoOnly = 0x00000002, - // Reserved = 0x00000001, - - AlphaDither_Mask = 0x0000000c, - ThresholdAlphaDither = 0x00000000, - OrderedAlphaDither = 0x00000004, - DiffuseAlphaDither = 0x00000008, - NoAlpha = 0x0000000c, // Not supported - - Dither_Mask = 0x00000030, - DiffuseDither = 0x00000000, - OrderedDither = 0x00000010, - ThresholdDither = 0x00000020, - // ReservedDither= 0x00000030, - - DitherMode_Mask = 0x000000c0, - AutoDither = 0x00000000, - PreferDither = 0x00000040, - AvoidDither = 0x00000080 - }; - - // documented in qpainter.cpp - enum BGMode { // background mode - TransparentMode, - OpaqueMode - }; - -#ifndef QT_NO_COMPAT - // documented in qpainter.cpp - enum PaintUnit { // paint unit - PixelUnit, - LoMetricUnit, // OBSOLETE - HiMetricUnit, // OBSOLETE - LoEnglishUnit, // OBSOLETE - HiEnglishUnit, // OBSOLETE - TwipsUnit // OBSOLETE - }; -#endif - - // documented in qstyle.cpp -#ifdef QT_NO_COMPAT - enum GUIStyle { - WindowsStyle = 1, // ### TQt 4.0: either remove the obsolete enums or clean up compat vs. - MotifStyle = 4, // ### QT_NO_COMPAT by reordering or combination into one enum. - GtkStyle = 6 // Gtk compability mode - }; -#else - enum GUIStyle { - MacStyle, // OBSOLETE - WindowsStyle, - Win3Style, // OBSOLETE - PMStyle, // OBSOLETE - MotifStyle, - GtkStyle = 6 // Gtk compability mode - }; -#endif - - // documented in qkeysequence.cpp - enum SequenceMatch { - NoMatch, - PartialMatch, - Identical - }; - - // documented in qevent.cpp - enum Modifier { // accelerator modifiers - META = 0x00100000, - SHIFT = 0x00200000, - CTRL = 0x00400000, - ALT = 0x00800000, - MODIFIER_MASK = 0x00f00000, - UNICODE_ACCEL = 0x10000000, - - ASCII_ACCEL = UNICODE_ACCEL // 1.x compat - }; - - // documented in qevent.cpp - enum Key { - Key_Escape = 0x1000, // misc keys - Key_Tab = 0x1001, - Key_Backtab = 0x1002, Key_BackTab = Key_Backtab, - Key_Backspace = 0x1003, Key_BackSpace = Key_Backspace, - Key_Return = 0x1004, - Key_Enter = 0x1005, - Key_Insert = 0x1006, - Key_Delete = 0x1007, - Key_Pause = 0x1008, - Key_Print = 0x1009, - Key_SysReq = 0x100a, - Key_Clear = 0x100b, - Key_Home = 0x1010, // cursor movement - Key_End = 0x1011, - Key_Left = 0x1012, - Key_Up = 0x1013, - Key_Right = 0x1014, - Key_Down = 0x1015, - Key_Prior = 0x1016, Key_PageUp = Key_Prior, - Key_Next = 0x1017, Key_PageDown = Key_Next, - Key_Shift = 0x1020, // modifiers - Key_Control = 0x1021, - Key_Meta = 0x1022, - Key_Alt = 0x1023, - Key_CapsLock = 0x1024, - Key_NumLock = 0x1025, - Key_ScrollLock = 0x1026, - Key_F1 = 0x1030, // function keys - Key_F2 = 0x1031, - Key_F3 = 0x1032, - Key_F4 = 0x1033, - Key_F5 = 0x1034, - Key_F6 = 0x1035, - Key_F7 = 0x1036, - Key_F8 = 0x1037, - Key_F9 = 0x1038, - Key_F10 = 0x1039, - Key_F11 = 0x103a, - Key_F12 = 0x103b, - Key_F13 = 0x103c, - Key_F14 = 0x103d, - Key_F15 = 0x103e, - Key_F16 = 0x103f, - Key_F17 = 0x1040, - Key_F18 = 0x1041, - Key_F19 = 0x1042, - Key_F20 = 0x1043, - Key_F21 = 0x1044, - Key_F22 = 0x1045, - Key_F23 = 0x1046, - Key_F24 = 0x1047, - Key_F25 = 0x1048, // F25 .. F35 only on X11 - Key_F26 = 0x1049, - Key_F27 = 0x104a, - Key_F28 = 0x104b, - Key_F29 = 0x104c, - Key_F30 = 0x104d, - Key_F31 = 0x104e, - Key_F32 = 0x104f, - Key_F33 = 0x1050, - Key_F34 = 0x1051, - Key_F35 = 0x1052, - Key_Super_L = 0x1053, // extra keys - Key_Super_R = 0x1054, - Key_Menu = 0x1055, - Key_Hyper_L = 0x1056, - Key_Hyper_R = 0x1057, - Key_Help = 0x1058, - Key_Direction_L = 0x1059, - Key_Direction_R = 0x1060, - - // International input method support (X keycode - 0xEE00, the - // definition follows TQt/Embedded 2.3.7) Only interesting if - // you are writing your own input method - - // International & multi-key character composition - Key_Multi_key = 0x1120, // Multi-key character compose - Key_Codeinput = 0x1137, - Key_SingleCandidate = 0x113c, - Key_MultipleCandidate = 0x113d, - Key_PreviousCandidate = 0x113e, - - // Misc Functions - Key_Mode_switch = 0x117e, // Character set switch - //Key_script_switch = 0x117e, // Alias for mode_switch - - // Japanese keyboard support - Key_Kanji = 0x1121, // Kanji, Kanji convert - Key_Muhenkan = 0x1122, // Cancel Conversion - //Key_Henkan_Mode = 0x1123, // Start/Stop Conversion - Key_Henkan = 0x1123, // Alias for Henkan_Mode - Key_Romaji = 0x1124, // to Romaji - Key_Hiragana = 0x1125, // to Hiragana - Key_Katakana = 0x1126, // to Katakana - Key_Hiragana_Katakana = 0x1127, // Hiragana/Katakana toggle - Key_Zenkaku = 0x1128, // to Zenkaku - Key_Hankaku = 0x1129, // to Hankaku - Key_Zenkaku_Hankaku = 0x112a, // Zenkaku/Hankaku toggle - Key_Touroku = 0x112b, // Add to Dictionary - Key_Massyo = 0x112c, // Delete from Dictionary - Key_Kana_Lock = 0x112d, // Kana Lock - Key_Kana_Shift = 0x112e, // Kana Shift - Key_Eisu_Shift = 0x112f, // Alphanumeric Shift - Key_Eisu_toggle = 0x1130, // Alphanumeric toggle - //Key_Kanji_Bangou = 0x1137, // Codeinput - //Key_Zen_Koho = 0x113d, // Multiple/All Candidate(s) - //Key_Mae_Koho = 0x113e, // Previous Candidate - - // Korean keyboard support - // - // In fact, many Korean users need only 2 keys, Key_Hangul and - // Key_Hangul_Hanja. But rest of the keys are good for future. - - Key_Hangul = 0x1131, // Hangul start/stop(toggle) - Key_Hangul_Start = 0x1132, // Hangul start - Key_Hangul_End = 0x1133, // Hangul end, English start - Key_Hangul_Hanja = 0x1134, // Start Hangul->Hanja Conversion - Key_Hangul_Jamo = 0x1135, // Hangul Jamo mode - Key_Hangul_Romaja = 0x1136, // Hangul Romaja mode - //Key_Hangul_Codeinput = 0x1137, // Hangul code input mode - Key_Hangul_Jeonja = 0x1138, // Jeonja mode - Key_Hangul_Banja = 0x1139, // Banja mode - Key_Hangul_PreHanja = 0x113a, // Pre Hanja conversion - Key_Hangul_PostHanja = 0x113b, // Post Hanja conversion - //Key_Hangul_SingleCandidate = 0x113c, // Single candidate - //Key_Hangul_MultipleCandidate = 0x113d, // Multiple candidate - //Key_Hangul_PreviousCandidate = 0x113e, // Previous candidate - Key_Hangul_Special = 0x113f, // Special symbols - //Key_Hangul_switch = 0x117e, // Alias for mode_switch - - // dead keys (X keycode - 0xED00 to avoid the conflict) - Key_Dead_Grave = 0x1250, - Key_Dead_Acute = 0x1251, - Key_Dead_Circumflex = 0x1252, - Key_Dead_Tilde = 0x1253, - Key_Dead_Macron = 0x1254, - Key_Dead_Breve = 0x1255, - Key_Dead_Abovedot = 0x1256, - Key_Dead_Diaeresis = 0x1257, - Key_Dead_Abovering = 0x1258, - Key_Dead_Doubleacute = 0x1259, - Key_Dead_Caron = 0x125a, - Key_Dead_Cedilla = 0x125b, - Key_Dead_Ogonek = 0x125c, - Key_Dead_Iota = 0x125d, - Key_Dead_Voiced_Sound = 0x125e, - Key_Dead_Semivoiced_Sound = 0x125f, - Key_Dead_Belowdot = 0x1260, - Key_Dead_Hook = 0x1261, - Key_Dead_Horn = 0x1262, - - Key_Space = 0x20, // 7 bit printable ASCII - Key_Any = Key_Space, - Key_Exclam = 0x21, - Key_QuoteDbl = 0x22, - Key_NumberSign = 0x23, - Key_Dollar = 0x24, - Key_Percent = 0x25, - Key_Ampersand = 0x26, - Key_Apostrophe = 0x27, - Key_ParenLeft = 0x28, - Key_ParenRight = 0x29, - Key_Asterisk = 0x2a, - Key_Plus = 0x2b, - Key_Comma = 0x2c, - Key_Minus = 0x2d, - Key_Period = 0x2e, - Key_Slash = 0x2f, - Key_0 = 0x30, - Key_1 = 0x31, - Key_2 = 0x32, - Key_3 = 0x33, - Key_4 = 0x34, - Key_5 = 0x35, - Key_6 = 0x36, - Key_7 = 0x37, - Key_8 = 0x38, - Key_9 = 0x39, - Key_Colon = 0x3a, - Key_Semicolon = 0x3b, - Key_Less = 0x3c, - Key_Equal = 0x3d, - Key_Greater = 0x3e, - Key_Question = 0x3f, - Key_At = 0x40, - Key_A = 0x41, - Key_B = 0x42, - Key_C = 0x43, - Key_D = 0x44, - Key_E = 0x45, - Key_F = 0x46, - Key_G = 0x47, - Key_H = 0x48, - Key_I = 0x49, - Key_J = 0x4a, - Key_K = 0x4b, - Key_L = 0x4c, - Key_M = 0x4d, - Key_N = 0x4e, - Key_O = 0x4f, - Key_P = 0x50, - Key_Q = 0x51, - Key_R = 0x52, - Key_S = 0x53, - Key_T = 0x54, - Key_U = 0x55, - Key_V = 0x56, - Key_W = 0x57, - Key_X = 0x58, - Key_Y = 0x59, - Key_Z = 0x5a, - Key_BracketLeft = 0x5b, - Key_Backslash = 0x5c, - Key_BracketRight = 0x5d, - Key_AsciiCircum = 0x5e, - Key_Underscore = 0x5f, - Key_QuoteLeft = 0x60, - Key_BraceLeft = 0x7b, - Key_Bar = 0x7c, - Key_BraceRight = 0x7d, - Key_AsciiTilde = 0x7e, - - // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 - // - // This is mainly for compatibility - applications and input - // methods should not use the TQt keycodes between 128 and 255, - // but should rather use the TQKeyEvent::text(). See - // TQETWidget::translateKeyEventInternal() for more details. - - Key_nobreakspace = 0x0a0, - Key_exclamdown = 0x0a1, - Key_cent = 0x0a2, - Key_sterling = 0x0a3, - Key_currency = 0x0a4, - Key_yen = 0x0a5, - Key_brokenbar = 0x0a6, - Key_section = 0x0a7, - Key_diaeresis = 0x0a8, - Key_copyright = 0x0a9, - Key_ordfeminine = 0x0aa, - Key_guillemotleft = 0x0ab, // left angle quotation mark - Key_notsign = 0x0ac, - Key_hyphen = 0x0ad, - Key_registered = 0x0ae, - Key_macron = 0x0af, - Key_degree = 0x0b0, - Key_plusminus = 0x0b1, - Key_twosuperior = 0x0b2, - Key_threesuperior = 0x0b3, - Key_acute = 0x0b4, - Key_mu = 0x0b5, - Key_paragraph = 0x0b6, - Key_periodcentered = 0x0b7, - Key_cedilla = 0x0b8, - Key_onesuperior = 0x0b9, - Key_masculine = 0x0ba, - Key_guillemotright = 0x0bb, // right angle quotation mark - Key_onequarter = 0x0bc, - Key_onehalf = 0x0bd, - Key_threequarters = 0x0be, - Key_questiondown = 0x0bf, - Key_Agrave = 0x0c0, - Key_Aacute = 0x0c1, - Key_Acircumflex = 0x0c2, - Key_Atilde = 0x0c3, - Key_Adiaeresis = 0x0c4, - Key_Aring = 0x0c5, - Key_AE = 0x0c6, - Key_Ccedilla = 0x0c7, - Key_Egrave = 0x0c8, - Key_Eacute = 0x0c9, - Key_Ecircumflex = 0x0ca, - Key_Ediaeresis = 0x0cb, - Key_Igrave = 0x0cc, - Key_Iacute = 0x0cd, - Key_Icircumflex = 0x0ce, - Key_Idiaeresis = 0x0cf, - Key_ETH = 0x0d0, - Key_Ntilde = 0x0d1, - Key_Ograve = 0x0d2, - Key_Oacute = 0x0d3, - Key_Ocircumflex = 0x0d4, - Key_Otilde = 0x0d5, - Key_Odiaeresis = 0x0d6, - Key_multiply = 0x0d7, - Key_Ooblique = 0x0d8, - Key_Ugrave = 0x0d9, - Key_Uacute = 0x0da, - Key_Ucircumflex = 0x0db, - Key_Udiaeresis = 0x0dc, - Key_Yacute = 0x0dd, - Key_THORN = 0x0de, - Key_ssharp = 0x0df, - Key_agrave = 0x0e0, - Key_aacute = 0x0e1, - Key_acircumflex = 0x0e2, - Key_atilde = 0x0e3, - Key_adiaeresis = 0x0e4, - Key_aring = 0x0e5, - Key_ae = 0x0e6, - Key_ccedilla = 0x0e7, - Key_egrave = 0x0e8, - Key_eacute = 0x0e9, - Key_ecircumflex = 0x0ea, - Key_ediaeresis = 0x0eb, - Key_igrave = 0x0ec, - Key_iacute = 0x0ed, - Key_icircumflex = 0x0ee, - Key_idiaeresis = 0x0ef, - Key_eth = 0x0f0, - Key_ntilde = 0x0f1, - Key_ograve = 0x0f2, - Key_oacute = 0x0f3, - Key_ocircumflex = 0x0f4, - Key_otilde = 0x0f5, - Key_odiaeresis = 0x0f6, - Key_division = 0x0f7, - Key_oslash = 0x0f8, - Key_ugrave = 0x0f9, - Key_uacute = 0x0fa, - Key_ucircumflex = 0x0fb, - Key_udiaeresis = 0x0fc, - Key_yacute = 0x0fd, - Key_thorn = 0x0fe, - Key_ydiaeresis = 0x0ff, - - // multimedia/internet keys - ignored by default - see TQKeyEvent c'tor - - Key_Back = 0x1061, - Key_Forward = 0x1062, - Key_Stop = 0x1063, - Key_Refresh = 0x1064, - - Key_VolumeDown = 0x1070, - Key_VolumeMute = 0x1071, - Key_VolumeUp = 0x1072, - Key_BassBoost = 0x1073, - Key_BassUp = 0x1074, - Key_BassDown = 0x1075, - Key_TrebleUp = 0x1076, - Key_TrebleDown = 0x1077, - - Key_MediaPlay = 0x1080, - Key_MediaStop = 0x1081, - Key_MediaPrev = 0x1082, - Key_MediaNext = 0x1083, - Key_MediaRecord = 0x1084, - - Key_HomePage = 0x1090, - Key_Favorites = 0x1091, - Key_Search = 0x1092, - Key_Standby = 0x1093, - Key_OpenUrl = 0x1094, - - Key_LaunchMail = 0x10a0, - Key_LaunchMedia = 0x10a1, - Key_Launch0 = 0x10a2, - Key_Launch1 = 0x10a3, - Key_Launch2 = 0x10a4, - Key_Launch3 = 0x10a5, - Key_Launch4 = 0x10a6, - Key_Launch5 = 0x10a7, - Key_Launch6 = 0x10a8, - Key_Launch7 = 0x10a9, - Key_Launch8 = 0x10aa, - Key_Launch9 = 0x10ab, - Key_LaunchA = 0x10ac, - Key_LaunchB = 0x10ad, - Key_LaunchC = 0x10ae, - Key_LaunchD = 0x10af, - Key_LaunchE = 0x10b0, - Key_LaunchF = 0x10b1, - - Key_MediaLast = 0x1fff, - - Key_unknown = 0xffff - }; - - // documented in qcommonstyle.cpp - enum ArrowType { - UpArrow, - DownArrow, - LeftArrow, - RightArrow - }; - - // documented in qpainter.cpp - enum RasterOp { // raster op mode - CopyROP, - OrROP, - XorROP, - NotAndROP, EraseROP=NotAndROP, - NotCopyROP, - NotOrROP, - NotXorROP, - AndROP, NotEraseROP=AndROP, - NotROP, - ClearROP, - SetROP, - NopROP, - AndNotROP, - OrNotROP, - NandROP, - NorROP, LastROP=NorROP - }; - - // documented in qpainter.cpp - enum PenStyle { // pen style - NoPen, - SolidLine, - DashLine, - DotLine, - DashDotLine, - DashDotDotLine, - MPenStyle = 0x0f - }; - - // documented in qpainter.cpp - enum PenCapStyle { // line endcap style - FlatCap = 0x00, - SquareCap = 0x10, - RoundCap = 0x20, - MPenCapStyle = 0x30 - }; - - // documented in qpainter.cpp - enum PenJoinStyle { // line join style - MiterJoin = 0x00, - BevelJoin = 0x40, - RoundJoin = 0x80, - MPenJoinStyle = 0xc0 - }; - - // documented in qpainter.cpp - enum BrushStyle { // brush style - NoBrush, - SolidPattern, - Dense1Pattern, - Dense2Pattern, - Dense3Pattern, - Dense4Pattern, - Dense5Pattern, - Dense6Pattern, - Dense7Pattern, - HorPattern, - VerPattern, - CrossPattern, - BDiagPattern, - FDiagPattern, - DiagCrossPattern, - CustomPattern=24 - }; - - // documented in qapplication_mac.cpp - enum MacintoshVersion { - //Unknown - MV_Unknown = 0x0000, - - //Version numbers - MV_9 = 0x0001, - MV_10_DOT_0 = 0x0002, - MV_10_DOT_1 = 0x0003, - MV_10_DOT_2 = 0x0004, - MV_10_DOT_3 = 0x0005, - MV_10_DOT_4 = 0x0006, - - //Code names - MV_CHEETAH = MV_10_DOT_0, - MV_PUMA = MV_10_DOT_1, - MV_JAGUAR = MV_10_DOT_2, - MV_PANTHER = MV_10_DOT_3, - MV_TIGER = MV_10_DOT_4 - }; - - // documented in qapplication_win.cpp - enum WindowsVersion { - WV_32s = 0x0001, - WV_95 = 0x0002, - WV_98 = 0x0003, - WV_Me = 0x0004, - WV_DOS_based = 0x000f, - - WV_NT = 0x0010, - WV_2000 = 0x0020, - WV_XP = 0x0030, - WV_2003 = 0x0040, - WV_VISTA = 0x0080, - WV_NT_based = 0x00f0, - - WV_CE = 0x0100, - WV_CENET = 0x0200, - WV_CE_based = 0x0f00 - }; - - // documented in qstyle.cpp - enum UIEffect { - UI_General, - UI_AnimateMenu, - UI_FadeMenu, - UI_AnimateCombo, - UI_AnimateTooltip, - UI_FadeTooltip, - UI_AnimateToolBox - }; - - // documented in qcursor.cpp - enum CursorShape { - ArrowCursor, - UpArrowCursor, - CrossCursor, - WaitCursor, - IbeamCursor, - SizeVerCursor, - SizeHorCursor, - SizeBDiagCursor, - SizeFDiagCursor, - SizeAllCursor, - BlankCursor, - SplitVCursor, - SplitHCursor, - PointingHandCursor, - ForbiddenCursor, - WhatsThisCursor, - BusyCursor, - LastCursor = BusyCursor, - BitmapCursor = 24 - }; - - // Global cursors - - QT_STATIC_CONST TQCursor & arrowCursor; // standard arrow cursor - QT_STATIC_CONST TQCursor & upArrowCursor; // upwards arrow - QT_STATIC_CONST TQCursor & crossCursor; // crosshair - QT_STATIC_CONST TQCursor & waitCursor; // hourglass/watch - QT_STATIC_CONST TQCursor & ibeamCursor; // ibeam/text entry - QT_STATIC_CONST TQCursor & sizeVerCursor; // vertical resize - QT_STATIC_CONST TQCursor & sizeHorCursor; // horizontal resize - QT_STATIC_CONST TQCursor & sizeBDiagCursor; // diagonal resize (/) - QT_STATIC_CONST TQCursor & sizeFDiagCursor; // diagonal resize (\) - QT_STATIC_CONST TQCursor & sizeAllCursor; // all directions resize - QT_STATIC_CONST TQCursor & blankCursor; // blank/invisible cursor - QT_STATIC_CONST TQCursor & splitVCursor; // vertical bar with left-right - // arrows - QT_STATIC_CONST TQCursor & splitHCursor; // horizontal bar with up-down - // arrows - QT_STATIC_CONST TQCursor & pointingHandCursor; // pointing hand - QT_STATIC_CONST TQCursor & forbiddenCursor; // forbidden cursor (slashed circle) - QT_STATIC_CONST TQCursor & whatsThisCursor; // arrow with a question mark - QT_STATIC_CONST TQCursor & busyCursor; // arrow with hourglass - - - enum TextFormat { - PlainText, - RichText, - AutoText, - LogText - }; - - // Documented in qtextedit.cpp - enum AnchorAttribute { - AnchorName, - AnchorHref - }; - - // Documented in qmainwindow.cpp - enum Dock { - DockUnmanaged, - DockTornOff, - DockTop, - DockBottom, - DockRight, - DockLeft, - DockMinimized -#ifndef QT_NO_COMPAT - , - Unmanaged = DockUnmanaged, - TornOff = DockTornOff, - Top = DockTop, - Bottom = DockBottom, - Right = DockRight, - Left = DockLeft, - Minimized = DockMinimized -#endif - }; - // compatibility - typedef Dock ToolBarDock; - - // documented in qdatetime.cpp - enum DateFormat { - TextDate, // default TQt - ISODate, // ISO 8601 - LocalDate // locale dependent - }; - - // documented in qdatetime.cpp - enum TimeSpec { - LocalTime, - UTC - }; - - // documented in qwidget.cpp - 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; - - // Documented in qstring.cpp - enum StringComparisonMode { - CaseSensitive = 0x00001, // 0 0001 - BeginsWith = 0x00002, // 0 0010 - EndsWith = 0x00004, // 0 0100 - Contains = 0x00008, // 0 1000 - ExactMatch = 0x00010 // 1 0000 - }; - - // Documented in qtabwidget.cpp - enum Corner { - TopLeft = 0x00000, - TopRight = 0x00001, - BottomLeft = 0x00002, - BottomRight = 0x00003 - }; - - // "handle" type for system objects. Documented as \internal in - // qapplication.cpp -#if defined(Q_WS_MAC) - typedef void * HANDLE; -#elif defined(Q_WS_WIN) - typedef void *HANDLE; -#elif defined(Q_WS_X11) - typedef unsigned long HANDLE; -#elif defined(Q_WS_QWS) - typedef void * HANDLE; -#endif -}; - - -class Q_EXPORT TQInternal { -public: - enum PaintDeviceFlags { - UndefinedDevice = 0x00, - Widget = 0x01, - Pixmap = 0x02, - Printer = 0x03, - Picture = 0x04, - System = 0x05, - DeviceTypeMask = 0x0f, - ExternalDevice = 0x10, - // used to emulate some of the behaviour different between TQt2 and TQt3 (mainly for printing) - CompatibilityMode = 0x20 - }; -}; - -#endif // TQNAMESPACE_H diff --git a/src/kernel/qnetworkprotocol.cpp b/src/kernel/qnetworkprotocol.cpp index 6861a26d0..c53649119 100644 --- a/src/kernel/qnetworkprotocol.cpp +++ b/src/kernel/qnetworkprotocol.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qnetworkprotocol.h" +#include "ntqnetworkprotocol.h" #ifndef QT_NO_NETWORKPROTOCOL -#include "qlocalfs.h" -#include "qurloperator.h" -#include "qtimer.h" -#include "qmap.h" -#include "qptrqueue.h" +#include "ntqlocalfs.h" +#include "ntqurloperator.h" +#include "ntqtimer.h" +#include "ntqmap.h" +#include "ntqptrqueue.h" //#define TQNETWORKPROTOCOL_DEBUG #define NETWORK_OP_DELAY 1000 @@ -99,7 +99,7 @@ public: }; /*! - \class TQNetworkProtocol qnetworkprotocol.h + \class TQNetworkProtocol ntqnetworkprotocol.h \brief The TQNetworkProtocol class provides a common API for network protocols. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/kernel/qnetworkprotocol.h b/src/kernel/qnetworkprotocol.h deleted file mode 100644 index 1d5635545..000000000 --- a/src/kernel/qnetworkprotocol.h +++ /dev/null @@ -1,244 +0,0 @@ -/**************************************************************************** -** -** Definition of TQNetworkProtocol class -** -** Created : 950429 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQNETWORKPROTOCOL_H -#define TQNETWORKPROTOCOL_H - -#ifndef QT_H -#include "qurlinfo.h" -#include "qstring.h" -#include "qdict.h" -#include "qobject.h" -#endif // QT_H - -#ifndef QT_NO_NETWORKPROTOCOL - -#if __GNUC__ - 0 > 3 -#pragma GCC system_header -#endif - -class TQNetworkProtocol; -class TQNetworkOperation; -class TQTimer; -class TQUrlOperator; -class TQNetworkProtocolPrivate; -template class TQValueList; - -class Q_EXPORT TQNetworkProtocolFactoryBase -{ -public: - virtual TQNetworkProtocol *createObject() = 0; - -}; - -template< class T > -class TQNetworkProtocolFactory : public TQNetworkProtocolFactoryBase -{ -public: - TQNetworkProtocol *createObject() { - return new T; - } - -}; - -typedef TQDict< TQNetworkProtocolFactoryBase > TQNetworkProtocolDict; - -class Q_EXPORT TQNetworkProtocol : public TQObject -{ - Q_OBJECT - -public: - enum State { - StWaiting = 0, - StInProgress, - StDone, - StFailed, - StStopped - }; - - enum Operation { - OpListChildren = 1, - OpMkDir = 2, - OpMkdir = OpMkDir, // ### remove in 4.0 - OpRemove = 4, - OpRename = 8, - OpGet = 32, - OpPut = 64 - }; - - enum ConnectionState { - ConHostFound, - ConConnected, - ConClosed - }; - - enum Error { - // no error - NoError = 0, - // general errors - ErrValid, - ErrUnknownProtocol, - ErrUnsupported, - ErrParse, - // errors on connect - ErrLoginIncorrect, - ErrHostNotFound, - // protocol errors - ErrListChildren, - ErrListChlidren = ErrListChildren, // ### remove in 4.0 - ErrMkDir, - ErrMkdir = ErrMkDir, // ### remove in 4.0 - ErrRemove, - ErrRename, - ErrGet, - ErrPut, - ErrFileNotExisting, - ErrPermissionDenied - }; - - TQNetworkProtocol(); - virtual ~TQNetworkProtocol(); - - virtual void setUrl( TQUrlOperator *u ); - - virtual void setAutoDelete( bool b, int i = 10000 ); - bool autoDelete() const; - - static void registerNetworkProtocol( const TQString &protocol, - TQNetworkProtocolFactoryBase *protocolFactory ); - static TQNetworkProtocol *getNetworkProtocol( const TQString &protocol ); - static bool hasOnlyLocalFileSystem(); - - virtual int supportedOperations() const; - virtual void addOperation( TQNetworkOperation *op ); - - TQUrlOperator *url() const; - TQNetworkOperation *operationInProgress() const; - virtual void clearOperationQueue(); - virtual void stop(); - -signals: - void data( const TQByteArray &, TQNetworkOperation *res ); - void connectionStateChanged( int state, const TQString &data ); - void finished( TQNetworkOperation *res ); - void start( TQNetworkOperation *res ); - void newChildren( const TQValueList &, TQNetworkOperation *res ); - void newChild( const TQUrlInfo &, TQNetworkOperation *res ); - void createdDirectory( const TQUrlInfo &, TQNetworkOperation *res ); - void removed( TQNetworkOperation *res ); - void itemChanged( TQNetworkOperation *res ); - void dataTransferProgress( int bytesDone, int bytesTotal, TQNetworkOperation *res ); - -protected: - virtual void processOperation( TQNetworkOperation *op ); - virtual void operationListChildren( TQNetworkOperation *op ); - virtual void operationMkDir( TQNetworkOperation *op ); - virtual void operationRemove( TQNetworkOperation *op ); - virtual void operationRename( TQNetworkOperation *op ); - virtual void operationGet( TQNetworkOperation *op ); - virtual void operationPut( TQNetworkOperation *op ); - virtual void operationPutChunk( TQNetworkOperation *op ); - virtual bool checkConnection( TQNetworkOperation *op ); - -private: - TQNetworkProtocolPrivate *d; - -private slots: - void processNextOperation( TQNetworkOperation *old ); - void startOps(); - void emitNewChildren( const TQUrlInfo &i, TQNetworkOperation *op ); - - void removeMe(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQNetworkProtocol( const TQNetworkProtocol & ); - TQNetworkProtocol &operator=( const TQNetworkProtocol & ); -#endif -}; - -class TQNetworkOperationPrivate; - -class Q_EXPORT TQNetworkOperation : public TQObject -{ - Q_OBJECT - friend class TQUrlOperator; - -public: - TQNetworkOperation( TQNetworkProtocol::Operation operation, - const TQString &arg0, const TQString &arg1, - const TQString &arg2 ); - TQNetworkOperation( TQNetworkProtocol::Operation operation, - const TQByteArray &arg0, const TQByteArray &arg1, - const TQByteArray &arg2 ); - ~TQNetworkOperation(); - - void setState( TQNetworkProtocol::State state ); - void setProtocolDetail( const TQString &detail ); - void setErrorCode( int ec ); - void setArg( int num, const TQString &arg ); - void setRawArg( int num, const TQByteArray &arg ); - - TQNetworkProtocol::Operation operation() const; - TQNetworkProtocol::State state() const; - TQString arg( int num ) const; - TQByteArray rawArg( int num ) const; - TQString protocolDetail() const; - int errorCode() const; - - void free(); - -private slots: - void deleteMe(); - -private: - TQByteArray &raw( int num ) const; - TQNetworkOperationPrivate *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQNetworkOperation( const TQNetworkOperation & ); - TQNetworkOperation &operator=( const TQNetworkOperation & ); -#endif -}; - -#endif // QT_NO_NETWORKPROTOCOL - -#endif // TQNETWORKPROTOCOL_H diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp index 7cc01174e..619308be3 100644 --- a/src/kernel/qobject.cpp +++ b/src/kernel/qobject.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qvariant.h" -#include "qapplication.h" -#include "qobject.h" -#include "qobjectlist.h" -#include "qsignalslotimp.h" -#include "qregexp.h" -#include "qmetaobject.h" +#include "ntqvariant.h" +#include "ntqapplication.h" +#include "ntqobject.h" +#include "ntqobjectlist.h" +#include "ntqsignalslotimp.h" +#include "ntqregexp.h" +#include "ntqmetaobject.h" #include #include "qucomextra_p.h" -#include "qptrvector.h" +#include "ntqptrvector.h" #ifdef QT_THREAD_SUPPORT -#include +#include #include #endif @@ -76,7 +76,7 @@ public: }; /*! - \class TQt qnamespace.h + \class TQt ntqnamespace.h \brief The TQt class is a namespace for miscellaneous identifiers that need to be global-like. @@ -106,7 +106,7 @@ public: /*! - \class TQObject qobject.h + \class TQObject ntqobject.h \brief The TQObject class is the base class of all TQt objects. \ingroup objectmodel @@ -1105,7 +1105,7 @@ static void objSearch( TQObjectList *result, Returns a list of child objects, or 0 if this object has no children. - The TQObjectList class is defined in the \c qobjectlist.h header + The TQObjectList class is defined in the \c ntqobjectlist.h header file. The first child added is the \link TQPtrList::first() first\endlink @@ -1127,7 +1127,7 @@ static void objSearch( TQObjectList *result, Returns a pointer to the list of all object trees (their root objects), or 0 if there are no objects. - The TQObjectList class is defined in the \c qobjectlist.h header + The TQObjectList class is defined in the \c ntqobjectlist.h header file. The most recent root object created is the \link TQPtrList::first() @@ -1181,7 +1181,7 @@ const TQObjectList *TQObject::objectTrees() delete l; // delete the list, not the objects \endcode - The TQObjectList class is defined in the \c qobjectlist.h header + The TQObjectList class is defined in the \c ntqobjectlist.h header file. \warning Delete the list as soon you have finished using it. The diff --git a/src/kernel/qobject.h b/src/kernel/qobject.h deleted file mode 100644 index 4d19f91ad..000000000 --- a/src/kernel/qobject.h +++ /dev/null @@ -1,265 +0,0 @@ -/**************************************************************************** -** -** Definition of TQObject class -** -** Created : 930418 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQOBJECT_H -#define TQOBJECT_H - -#ifndef QT_H -#include "qobjectdefs.h" -#include "qwindowdefs.h" -#include "qstring.h" -#include "qevent.h" -#include "qnamespace.h" -#endif // QT_H - -#define QT_TR_NOOP(x) (x) -#define QT_TRANSLATE_NOOP(scope,x) (x) - -class TQMetaObject; -class TQVariant; -class TQMetaProperty; -class TQPostEventList; -class TQSenderObjectList; -class TQObjectPrivate; -#ifndef QT_NO_USERDATA -class TQObjectUserData; -#endif -struct TQUObject; - -class Q_EXPORT TQObject: public TQt -{ - Q_OBJECT - Q_PROPERTY( TQCString name READ name WRITE setName ) - -public: - TQObject( TQObject *parent=0, const char *name=0 ); - virtual ~TQObject(); - -#ifdef Q_QDOC - virtual const char *className() const; - static TQString tr( const char *, const char * ); - static TQString trUtf8( const char *, const char * ); - virtual TQMetaObject *metaObject() const; -#endif - - virtual bool event( TQEvent * ); - virtual bool eventFilter( TQObject *, TQEvent * ); - - bool isA( const char * ) const; - bool inherits( const char * ) const; - - const char *name() const; - const char *name( const char * defaultName ) const; - - virtual void setName( const char *name ); - bool isWidgetType() const { return isWidget; } - bool highPriority() const { return FALSE; } - - bool signalsBlocked() const { return blockSig; } - void blockSignals( bool b ); - - int startTimer( int interval ); - void killTimer( int id ); - void killTimers(); - - TQObject *child( const char *objName, const char *inheritsClass = 0, bool recursiveSearch = TRUE ); //### const in 4.0 - const TQObjectList *children() const { return childObjects; } - TQObjectList childrenListObject(); - const TQObjectList childrenListObject() const; - - static const TQObjectList *objectTrees(); - static const TQObjectList objectTreesListObject(); - - TQObjectList *queryList( const char *inheritsClass = 0, - const char *objName = 0, - bool regexpMatch = TRUE, - bool recursiveSearch = TRUE ) const; - - virtual void insertChild( TQObject * ); - virtual void removeChild( TQObject * ); - - void installEventFilter( const TQObject * ); - void removeEventFilter( const TQObject * ); - - static bool connect( const TQObject *sender, const char *signal, - const TQObject *receiver, const char *member ); - bool connect( const TQObject *sender, const char *signal, - const char *member ) const; - static bool disconnect( const TQObject *sender, const char *signal, - const TQObject *receiver, const char *member ); - bool disconnect( const char *signal=0, - const TQObject *receiver=0, const char *member=0 ); - bool disconnect( const TQObject *receiver, const char *member=0 ); - static void connectInternal( const TQObject *sender, int signal_index, - const TQObject *receiver, int membcode, int member_index ); - static bool disconnectInternal( const TQObject *sender, int signal_index, - const TQObject *receiver, int membcode, int member_index ); - - void dumpObjectTree(); - void dumpObjectInfo(); - -#ifndef QT_NO_PROPERTIES - virtual bool setProperty( const char *name, const TQVariant& value ); - virtual TQVariant property( const char *name ) const; -#endif // QT_NO_PROPERTIES -#ifdef QT_NO_TRANSLATION - static TQString tr( const char *sourceText, const char * = 0); -#ifndef QT_NO_TEXTCODEC - static TQString trUtf8( const char *sourceText, const char * = 0); -#endif -#endif //QT_NO_TRANSLATION - -#ifndef QT_NO_USERDATA - static uint registerUserData(); - void setUserData( uint id, TQObjectUserData* data); - TQObjectUserData* userData( uint id ) const; -#endif // QT_NO_USERDATA - -signals: - void destroyed(); - void destroyed( TQObject* obj ); - -public: - TQObject *parent() const { return parentObj; } - -public slots: - void deleteLater(); - -private slots: - void cleanupEventFilter( TQObject* ); - -protected: - bool activate_filters( TQEvent * ); - TQConnectionList *receivers( const char* signal ) const; - TQConnectionList *receivers( int signal ) const; - void activate_signal( int signal ); - void activate_signal( int signal, int ); - void activate_signal( int signal, double ); - void activate_signal( int signal, TQString ); - void activate_signal_bool( int signal, bool ); - void activate_signal( TQConnectionList *clist, TQUObject *o ); - - const TQObject *sender(); - - virtual void timerEvent( TQTimerEvent * ); - virtual void childEvent( TQChildEvent * ); - virtual void customEvent( TQCustomEvent * ); - - virtual void connectNotify( const char *signal ); - virtual void disconnectNotify( const char *signal ); - virtual bool checkConnectArgs( const char *signal, const TQObject *receiver, - const char *member ); - static TQCString normalizeSignalSlot( const char *signalSlot ); - -private: - uint isSignal : 1; - uint isWidget : 1; - uint pendTimer : 1; - uint blockSig : 1; - uint wasDeleted : 1; - uint isTree : 1; - - const char *objname; - TQObject *parentObj; - TQObjectList *childObjects; - TQSignalVec *connections; - TQSenderObjectList *senderObjects; - TQObjectList *eventFilters; - TQPostEventList *postedEvents; - TQObjectPrivate* d; - - static TQMetaObject* staticTQtMetaObject(); - - friend class TQApplication; - friend class TQBaseApplication; - friend class TQWidget; - friend class TQSignal; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQObject( const TQObject & ); - TQObject &operator=( const TQObject & ); -#endif -}; - - -#ifndef QT_NO_USERDATA -class Q_EXPORT TQObjectUserData { -public: - virtual ~TQObjectUserData(); -}; -#endif - - -inline bool TQObject::connect( const TQObject *sender, const char *signal, - const char *member ) const -{ - return connect( sender, signal, this, member ); -} - - -inline bool TQObject::disconnect( const char *signal, - const TQObject *receiver, const char *member ) -{ - return disconnect( this, signal, receiver, member ); -} - - -inline bool TQObject::disconnect( const TQObject *receiver, const char *member ) -{ - return disconnect( this, 0, receiver, member ); -} - - -#ifdef QT_NO_TRANSLATION -inline TQString TQObject::tr( const char *sourceText, const char * ) { - return TQString::fromLatin1( sourceText ); -} -#ifndef QT_NO_TEXTCODEC -inline TQString TQObject::trUtf8( const char *sourceText, const char * ) { - return TQString::fromUtf8( sourceText ); -} -#endif -#endif //QT_NO_TRANSLATION - - -#define Q_DEFINED_QOBJECT -#include "qwinexport.h" -#endif // TQOBJECT_H diff --git a/src/kernel/qobjectcleanuphandler.cpp b/src/kernel/qobjectcleanuphandler.cpp index 7e12e7cb4..f9f5d3e2f 100644 --- a/src/kernel/qobjectcleanuphandler.cpp +++ b/src/kernel/qobjectcleanuphandler.cpp @@ -36,11 +36,11 @@ ** **********************************************************************/ -#include "qobjectcleanuphandler.h" -#include "qobjectlist.h" +#include "ntqobjectcleanuphandler.h" +#include "ntqobjectlist.h" /*! - \class TQObjectCleanupHandler qobjectcleanuphandler.h + \class TQObjectCleanupHandler ntqobjectcleanuphandler.h \brief The TQObjectCleanupHandler class watches the lifetime of multiple TQObjects. \ingroup objectmodel diff --git a/src/kernel/qobjectcleanuphandler.h b/src/kernel/qobjectcleanuphandler.h deleted file mode 100644 index 24ffc139c..000000000 --- a/src/kernel/qobjectcleanuphandler.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Definition of ??? -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQOBJECTCLEANUPHANDLER_H -#define TQOBJECTCLEANUPHANDLER_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - -class TQObjectList; - -class Q_EXPORT TQObjectCleanupHandler : public TQObject -{ - Q_OBJECT - -public: - TQObjectCleanupHandler(); - ~TQObjectCleanupHandler(); - - TQObject* add( TQObject* object ); - void remove( TQObject *object ); - bool isEmpty() const; - void clear(); - -private: - TQObjectList *cleanupObjects; - -private slots: - void objectDestroyed( TQObject * ); -}; - -#endif // TQOBJECTCLEANUPHANDLER_H diff --git a/src/kernel/qobjectdefs.h b/src/kernel/qobjectdefs.h deleted file mode 100644 index 8402afe50..000000000 --- a/src/kernel/qobjectdefs.h +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** -** -** Macros and definitions related to TQObject -** -** Created : 930419 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQOBJECTDEFS_H -#define TQOBJECTDEFS_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - - -#ifndef QT_NO_TRANSLATION -# ifndef QT_NO_TEXTCODEC -// full set of tr functions -# define QT_TR_FUNCTIONS \ - static TQString tr( const char *, const char * = 0 ); \ - static TQString trUtf8( const char *, const char * = 0 ); -# else -// no TQTextCodec, no utf8 -# define QT_TR_FUNCTIONS \ - static TQString tr( const char *, const char * = 0 ); -# endif -#else -// inherit the ones from TQObject -# define QT_TR_FUNCTIONS -#endif - -#ifndef QT_NO_PROPERTIES -# define QT_PROP_FUNCTIONS \ - virtual bool qt_property( int id, int f, TQVariant* v); \ - static bool qt_static_property( TQObject* , int, int, TQVariant* ); -#else -# define QT_PROP_FUNCTIONS -#endif - -// The following macros are our "extensions" to C++ -// They are used, strictly speaking, only by the moc. -struct TQUObject; - -#ifdef QT_MOC_CPP -#define slots slots -#define signals signals -#define Q_CLASSINFO( name, value ) Q_CLASSINFO( name, value ) -#define Q_PROPERTY( text ) Q_PROPERTY( text ) -#define Q_OVERRIDE( text ) Q_OVERRIDE( text ) -#define Q_ENUMS( x ) Q_ENUMS( x ) -#define Q_SETS( x ) Q_SETS( x ) - /* tmake ignore Q_OBJECT */ -#define Q_OBJECT Q_OBJECT - /* tmake ignore Q_OBJECT */ -#define Q_OBJECT_FAKE Q_OBJECT_FAKE - -#else -#define slots // slots: in class -#define signals protected // signals: in class -#ifndef QT_NO_EMIT -#define emit // emit signal -#endif -#define Q_CLASSINFO( name, value ) // class info -#define Q_PROPERTY( text ) // property -#define Q_OVERRIDE( text ) // override property -#define Q_ENUMS( x ) -#define Q_SETS( x ) - -/* tmake ignore Q_OBJECT */ -#define Q_OBJECT \ -public: \ - virtual TQMetaObject *metaObject() const { \ - return staticMetaObject(); \ - } \ - virtual const char *className() const; \ - virtual void* qt_cast( const char* ); \ - virtual bool qt_invoke( int, TQUObject* ); \ - virtual bool qt_emit( int, TQUObject* ); \ - QT_PROP_FUNCTIONS \ - static TQMetaObject* staticMetaObject(); \ - TQObject* qObject() { return (TQObject*)this; } \ - QT_TR_FUNCTIONS \ -private: \ - static TQMetaObject *metaObj; - -/* tmake ignore Q_OBJECT */ -#define Q_OBJECT_FAKE Q_OBJECT - -#endif - -// macro for naming members -#ifdef METHOD -#undef METHOD -#endif -#ifdef SLOT -#undef SLOT -#endif -#ifdef SIGNAL -#undef SIGNAL -#endif - -#if defined(_OLD_CPP_) -#define METHOD(a) "0""a" -#define SLOT(a) "1""a" -#define SIGNAL(a) "2""a" -#else -#define METHOD(a) "0"#a -#define SLOT(a) "1"#a -#define SIGNAL(a) "2"#a -#endif - -#ifndef QT_CLEAN_NAMESPACE -#define METHOD_CODE 0 // member type codes -#define SLOT_CODE 1 -#define SIGNAL_CODE 2 -#endif - -#define TQMETHOD_CODE 0 // member type codes -#define TQSLOT_CODE 1 -#define TQSIGNAL_CODE 2 - -class TQObject; -class TQMetaObject; -class TQSignal; -class TQConnection; -class TQEvent; -struct TQMetaData; -class TQConnectionList; -class TQConnectionListIt; -class TQSignalVec; -class TQObjectList; -class TQObjectListIt; -class TQMemberDict; - -Q_EXPORT void *qt_find_obj_child( TQObject *, const char *, const char * ); -#define Q_CHILD(parent,type,name) \ - ((type*)qt_find_obj_child(parent,#type,name)) - -Q_EXPORT void *qt_inheritedBy( TQMetaObject *super, const TQObject *cls ); - -template -Q_INLINE_TEMPLATES T qt_cast(const TQObject *object) -{ return (T)qt_inheritedBy( ((T)0)->staticMetaObject(), object ); } -#endif // TQOBJECTDEFS_H diff --git a/src/kernel/qobjectdict.h b/src/kernel/qobjectdict.h deleted file mode 100644 index f8642d8d4..000000000 --- a/src/kernel/qobjectdict.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Definition of TQObjectDictionary -** -** Created : 940807 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQOBJECTDICT_H -#define TQOBJECTDICT_H - -#ifndef QT_H -#include "qmetaobject.h" -#include "qasciidict.h" -#endif // QT_H - - -// -// The object dictionary is a collection of TQMetaObjects -// - -class Q_EXPORT TQObjectDictionary : public TQAsciiDict -{ -public: - TQObjectDictionary(int size=17,bool cs=TRUE,bool ck=TRUE) - : TQAsciiDict(size,cs,ck) {} - TQObjectDictionary( const TQObjectDictionary &dict ) - : TQAsciiDict(dict) {} - ~TQObjectDictionary() { clear(); } - TQObjectDictionary &operator=(const TQObjectDictionary &dict) - { return (TQObjectDictionary&)TQAsciiDict::operator=(dict);} -}; - -#endif // TQOBJECTDICT_H diff --git a/src/kernel/qobjectlist.h b/src/kernel/qobjectlist.h deleted file mode 100644 index 0bc59711d..000000000 --- a/src/kernel/qobjectlist.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Definition of TQObjectList -** -** Created : 940807 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQOBJECTLIST_H -#define TQOBJECTLIST_H - -#ifndef QT_H -#include "qobject.h" -#include "qptrlist.h" -#endif // QT_H - - -#if defined(Q_TEMPLATEDLL) -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -#endif - - -class Q_EXPORT TQObjectList : public TQPtrList -{ -public: - TQObjectList() : TQPtrList() {} - TQObjectList( const TQObjectList &list ) : TQPtrList(list) {} - ~TQObjectList() { clear(); } - TQObjectList &operator=(const TQObjectList &list) - { return (TQObjectList&)TQPtrList::operator=(list); } -}; - -class Q_EXPORT TQObjectListIterator : public TQPtrListIterator -{ -public: - TQObjectListIterator( const TQObjectList &l ) - : TQPtrListIterator( l ) { } - TQObjectListIterator &operator=( const TQObjectListIterator &i ) - { return (TQObjectListIterator&) - TQPtrListIterator::operator=( i ); } -}; - -#if (QT_VERSION-0 >= 0x040000) -#if defined(Q_CC_GNU) -#warning "remove the TQObjectListIt class" -#warning "remove the typedef too, maybe" -#endif -typedef TQObjectListIterator TQObjectListIt; -#else -class Q_EXPORT TQObjectListIt : public TQPtrListIterator -{ -public: - TQObjectListIt( const TQObjectList &l ) : TQPtrListIterator(l) {} - TQObjectListIt &operator=(const TQObjectListIt &i) - { return (TQObjectListIt&)TQPtrListIterator::operator=(i); } -}; -#endif - -#endif // TQOBJECTLIST_H diff --git a/src/kernel/qpaintdevice.h b/src/kernel/qpaintdevice.h deleted file mode 100644 index 84384f19c..000000000 --- a/src/kernel/qpaintdevice.h +++ /dev/null @@ -1,421 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPaintDevice class -** -** Created : 940721 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPAINTDEVICE_H -#define TQPAINTDEVICE_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qrect.h" -#endif // QT_H - -#if defined(Q_WS_QWS) -class TQWSDisplay; -class TQGfx; -#endif - -class TQIODevice; -class TQString; -class TQTextItem; - - -#if defined(Q_WS_X11) -struct TQPaintDeviceX11Data; -#endif - -union TQPDevCmdParam { - int ival; - int *ivec; - TQString *str; - const TQPoint *point; - const TQRect *rect; - const TQPointArray *ptarr; - const TQPixmap *pixmap; - const TQImage *image; - const TQColor *color; - const TQFont *font; - const TQPen *pen; - const TQBrush *brush; - const TQRegion *rgn; - const TQWMatrix *matrix; - const TQTextItem *textItem; - TQIODevice *device; -}; - - - -class Q_EXPORT TQPaintDevice // device for TQPainter -{ -public: - virtual ~TQPaintDevice(); - - int devType() const; - bool isExtDev() const; - bool paintingActive() const; - - virtual void setResolution( int ); - virtual int resolution() const; - - // Windows: get device context - // X-Windows: get drawable -#if defined(Q_WS_WIN) - virtual HDC handle() const; -#elif defined(Q_WS_X11) - virtual TQt::HANDLE handle() const; - virtual TQt::HANDLE x11RenderHandle() const; -#elif defined(Q_WS_MAC) - virtual TQt::HANDLE handle() const; -#elif defined(Q_WS_QWS) - virtual TQt::HANDLE handle() const; -#endif - -#if defined(Q_WS_X11) - 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(); - - // ### in 4.0, the above need to go away, the below needs to take a -1 default - // argument, signifying the default screen... - static int x11AppDepth( int screen ); - static int x11AppCells( int screen ); - static TQt::HANDLE x11AppRootWindow( int screen ); - static TQt::HANDLE x11AppColormap( int screen ); - static void *x11AppVisual( int screen ); - static bool x11AppDefaultColormap( int screen ); - static bool x11AppDefaultVisual( int screen ); - static int x11AppDpiX( int ); - static int x11AppDpiY( int ); - static void x11SetAppDpiX( int, int ); - static void x11SetAppDpiY( int, int ); -#endif - -#if defined(Q_WS_QWS) - static TQWSDisplay *qwsDisplay(); - virtual unsigned char * scanLine(int) const; - virtual int bytesPerLine() const; - virtual TQGfx * graphicsContext(bool clip_children=TRUE) const; -#endif - - enum PDevCmd { - PdcNOP = 0, // - PdcDrawPoint = 1, // point - PdcDrawFirst = PdcDrawPoint, - PdcMoveTo = 2, // point - PdcLineTo = 3, // point - PdcDrawLine = 4, // point,point - PdcDrawRect = 5, // rect - PdcDrawRoundRect = 6, // rect,ival,ival - PdcDrawEllipse = 7, // rect - PdcDrawArc = 8, // rect,ival,ival - PdcDrawPie = 9, // rect,ival,ival - PdcDrawChord = 10, // rect,ival,ival - PdcDrawLineSegments = 11, // ptarr - PdcDrawPolyline = 12, // ptarr - PdcDrawPolygon = 13, // ptarr,ival - PdcDrawCubicBezier = 14, // ptarr - PdcDrawText = 15, // point,str - PdcDrawTextFormatted = 16, // rect,ival,str - PdcDrawPixmap = 17, // rect,pixmap - PdcDrawImage = 18, // rect,image - PdcDrawText2 = 19, // point,str - PdcDrawText2Formatted = 20, // rect,ival,str - PdcDrawTextItem = 21, - PdcDrawLast = PdcDrawTextItem, - - // no painting commands below PdcDrawLast. - - PdcBegin = 30, // - PdcEnd = 31, // - PdcSave = 32, // - PdcRestore = 33, // - PdcSetdev = 34, // device - PRIVATE - PdcSetBkColor = 40, // color - PdcSetBkMode = 41, // ival - PdcSetROP = 42, // ival - PdcSetBrushOrigin = 43, // point - PdcSetFont = 45, // font - PdcSetPen = 46, // pen - PdcSetBrush = 47, // brush - PdcSetTabStops = 48, // ival - PdcSetTabArray = 49, // ival,ivec - PdcSetUnit = 50, // ival - PdcSetVXform = 51, // ival - PdcSetWindow = 52, // rect - PdcSetViewport = 53, // rect - PdcSetWXform = 54, // ival - PdcSetWMatrix = 55, // matrix,ival - PdcSaveWMatrix = 56, - PdcRestoreWMatrix = 57, - PdcSetClip = 60, // ival - PdcSetClipRegion = 61, // rgn - - PdcReservedStart = 0, // codes 0-199 are reserved - PdcReservedStop = 199 // for TQt - }; - -protected: - TQPaintDevice( uint devflags ); - -#if defined(Q_WS_WIN) - HDC hdc; // device context -#elif defined(Q_WS_X11) - TQt::HANDLE hd; // handle to drawable - TQt::HANDLE rendhd; // handle to RENDER pict - - void copyX11Data( const TQPaintDevice * ); - void cloneX11Data( const TQPaintDevice * ); - virtual void setX11Data( const TQPaintDeviceX11Data* ); - TQPaintDeviceX11Data* getX11Data( bool def=FALSE ) const; -#elif defined(Q_WS_MAC) -#if !defined( TQMAC_NO_QUARTZ ) - CGContextRef ctx; -#endif - void * hd; -#elif defined(Q_WS_QWS) - TQt::HANDLE hd; -#endif - - virtual bool cmd( int, TQPainter *, TQPDevCmdParam * ); - virtual int metric( int ) const; - virtual int fontMet( TQFont *, int, const char * = 0, int = 0 ) const; - virtual int fontInf( TQFont *, int ) const; - - ushort devFlags; // device flags - ushort painters; // refcount - - friend class TQPainter; - friend class TQPaintDeviceMetrics; -#if defined(Q_WS_MAC) -#ifndef TQMAC_NO_QUARTZ - virtual CGContextRef macCGContext(bool clipped=TRUE) const; -#endif - friend Q_EXPORT void unclippedScaledBitBlt( TQPaintDevice *, int, int, int, int, - const TQPaintDevice *, int, int, int, int, TQt::RasterOp, bool, bool ); -#else - friend Q_EXPORT void bitBlt( TQPaintDevice *, int, int, - const TQPaintDevice *, - int, int, int, int, TQt::RasterOp, bool ); -#endif -#if defined(Q_WS_X11) - friend void qt_init_internal( int *, char **, Display *, TQt::HANDLE, TQt::HANDLE ); - friend void qt_cleanup(); -#endif - -private: -#if defined(Q_WS_X11) - static Display *x_appdisplay; - static int x_appscreen; - - static int x_appdepth; - static int x_appcells; - static TQt::HANDLE x_approotwindow; - static TQt::HANDLE x_appcolormap; - static bool x_appdefcolormap; - static void *x_appvisual; - static bool x_appdefvisual; - - // ### in 4.0, remove the above, and replace with the below - static int *x_appdepth_arr; - static int *x_appcells_arr; - static TQt::HANDLE *x_approotwindow_arr; - static TQt::HANDLE *x_appcolormap_arr; - static bool *x_appdefcolormap_arr; - static void **x_appvisual_arr; - static bool *x_appdefvisual_arr; - - TQPaintDeviceX11Data* x11Data; -#endif - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPaintDevice( const TQPaintDevice & ); - TQPaintDevice &operator=( const TQPaintDevice & ); -#endif -}; - - -Q_EXPORT -void bitBlt( TQPaintDevice *dst, int dx, int dy, - const TQPaintDevice *src, int sx=0, int sy=0, int sw=-1, int sh=-1, - TQt::RasterOp = TQt::CopyROP, bool ignoreMask=FALSE ); - -Q_EXPORT -void bitBlt( TQPaintDevice *dst, int dx, int dy, - const TQImage *src, int sx=0, int sy=0, int sw=-1, int sh=-1, - int conversion_flags=0 ); - - -#if defined(Q_WS_X11) - -struct Q_EXPORT TQPaintDeviceX11Data : public TQShared { - Display* x_display; - int x_screen; - int x_depth; - int x_cells; - TQt::HANDLE x_colormap; - bool x_defcolormap; - void* x_visual; - bool x_defvisual; -}; - -#endif - -/***************************************************************************** - Inline functions - *****************************************************************************/ - -inline int TQPaintDevice::devType() const -{ return devFlags & TQInternal::DeviceTypeMask; } - -inline bool TQPaintDevice::isExtDev() const -{ return (devFlags & TQInternal::ExternalDevice) != 0; } - -inline bool TQPaintDevice::paintingActive() const -{ return painters != 0; } - -#if defined(Q_WS_X11) -inline Display *TQPaintDevice::x11Display() const -{ return x11Data ? x11Data->x_display : x_appdisplay; } - -inline int TQPaintDevice::x11Screen() const -{ return x11Data ? x11Data->x_screen : x_appscreen; } - -inline int TQPaintDevice::x11Depth() const -{ return x11Data ? x11Data->x_depth : x_appdepth; } - -inline int TQPaintDevice::x11Cells() const -{ return x11Data ? x11Data->x_cells : x_appcells; } - -inline TQt::HANDLE TQPaintDevice::x11Colormap() const -{ return x11Data ? x11Data->x_colormap : x_appcolormap; } - -inline bool TQPaintDevice::x11DefaultColormap() const -{ return x11Data ? x11Data->x_defcolormap : x_appdefcolormap; } - -inline void *TQPaintDevice::x11Visual() const -{ return x11Data ? x11Data->x_visual : x_appvisual; } - -inline bool TQPaintDevice::x11DefaultVisual() const -{ return x11Data ? x11Data->x_defvisual : x_appdefvisual; } - -inline Display *TQPaintDevice::x11AppDisplay() -{ return x_appdisplay; } - -inline int TQPaintDevice::x11AppScreen() -{ return x_appscreen; } - -inline int TQPaintDevice::x11AppDepth( int screen ) -{ return x_appdepth_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline int TQPaintDevice::x11AppCells( int screen ) -{ return x_appcells_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline TQt::HANDLE TQPaintDevice::x11AppRootWindow( int screen ) -{ return x_approotwindow_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline TQt::HANDLE TQPaintDevice::x11AppColormap( int screen ) -{ return x_appcolormap_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline bool TQPaintDevice::x11AppDefaultColormap( int screen ) -{ return x_appdefcolormap_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline void *TQPaintDevice::x11AppVisual( int screen ) -{ return x_appvisual_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline bool TQPaintDevice::x11AppDefaultVisual( int screen ) -{ return x_appdefvisual_arr[ screen == -1 ? x_appscreen : screen ]; } - -inline int TQPaintDevice::x11AppDepth() -{ return x_appdepth; } - -inline int TQPaintDevice::x11AppCells() -{ return x_appcells; } - -inline TQt::HANDLE TQPaintDevice::x11AppRootWindow() -{ return x_approotwindow; } - -inline TQt::HANDLE TQPaintDevice::x11AppColormap() -{ return x_appcolormap; } - -inline bool TQPaintDevice::x11AppDefaultColormap() -{ return x_appdefcolormap; } - -inline void *TQPaintDevice::x11AppVisual() -{ return x_appvisual; } - -inline bool TQPaintDevice::x11AppDefaultVisual() -{ return x_appdefvisual; } - -#endif // Q_WS_X11 - - -Q_EXPORT -inline void bitBlt( TQPaintDevice *dst, const TQPoint &dp, - const TQPaintDevice *src, const TQRect &sr =TQRect(0,0,-1,-1), - TQt::RasterOp rop=TQt::CopyROP, bool ignoreMask=FALSE ) -{ - bitBlt( dst, dp.x(), dp.y(), src, sr.x(), sr.y(), sr.width(), sr.height(), - rop, ignoreMask ); -} - - - - -#endif // TQPAINTDEVICE_H diff --git a/src/kernel/qpaintdevice_x11.cpp b/src/kernel/qpaintdevice_x11.cpp index 2bc747c32..aefd8971a 100644 --- a/src/kernel/qpaintdevice_x11.cpp +++ b/src/kernel/qpaintdevice_x11.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qpaintdevice.h" -#include "qpaintdevicemetrics.h" -#include "qpainter.h" -#include "qwidget.h" -#include "qbitmap.h" -#include "qapplication.h" +#include "ntqpaintdevice.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqpainter.h" +#include "ntqwidget.h" +#include "ntqbitmap.h" +#include "ntqapplication.h" #include "qt_x11_p.h" /*! - \class TQPaintDevice qpaintdevice.h + \class TQPaintDevice ntqpaintdevice.h \brief The TQPaintDevice class is the base class of objects that can be painted. @@ -270,8 +270,8 @@ TQPaintDeviceX11Data* TQPaintDevice::getX11Data( bool def ) const Returns the window system handle of the paint device, for low-level access. Using this function is not portable. - The HANDLE type varies with platform; see \c qpaintdevice.h and - \c qwindowdefs.h for details. + The HANDLE type varies with platform; see \c ntqpaintdevice.h and + \c ntqwindowdefs.h for details. \sa x11Display() */ diff --git a/src/kernel/qpaintdevicedefs.h b/src/kernel/qpaintdevicedefs.h deleted file mode 100644 index 165439f8c..000000000 --- a/src/kernel/qpaintdevicedefs.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPaintDevice constants and flags -** -** Created : 940721 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPAINTDEVICEDEFS_H -#define TQPAINTDEVICEDEFS_H - -#error "this file is gone. the #defines it contained are in" -#error "q1xcompatibility.h; the functionality is in TQPaintDevice" -#error "and TQPaintDeviceMetrics." - -#endif // TQPAINTDEVICEDEFS_H diff --git a/src/kernel/qpaintdevicemetrics.cpp b/src/kernel/qpaintdevicemetrics.cpp index c6f0e4d53..046533fbe 100644 --- a/src/kernel/qpaintdevicemetrics.cpp +++ b/src/kernel/qpaintdevicemetrics.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qpaintdevicemetrics.h" +#include "ntqpaintdevicemetrics.h" /*! - \class TQPaintDeviceMetrics qpaintdevicemetrics.h + \class TQPaintDeviceMetrics ntqpaintdevicemetrics.h \brief The TQPaintDeviceMetrics class provides information about a paint device. diff --git a/src/kernel/qpaintdevicemetrics.h b/src/kernel/qpaintdevicemetrics.h deleted file mode 100644 index 50856f244..000000000 --- a/src/kernel/qpaintdevicemetrics.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPaintDeviceMetrics class -** -** Created : 941109 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPAINTDEVICEMETRICS_H -#define TQPAINTDEVICEMETRICS_H - -#ifndef QT_H -#include "qpaintdevice.h" -#endif // QT_H - - -class Q_EXPORT TQPaintDeviceMetrics // paint device metrics -{ -public: - TQPaintDeviceMetrics( const TQPaintDevice * ); - - enum { - PdmWidth = 1, - PdmHeight, - PdmWidthMM, - PdmHeightMM, - PdmNumColors, - PdmDepth, - PdmDpiX, - PdmDpiY, - PdmPhysicalDpiX, - PdmPhysicalDpiY - }; - - int width() const { return (int)pdev->metric(PdmWidth); } - int height() const { return (int)pdev->metric(PdmHeight); } - int widthMM() const { return (int)pdev->metric(PdmWidthMM); } - int heightMM() const { return (int)pdev->metric(PdmHeightMM); } - int logicalDpiX() const { return (int)pdev->metric(PdmDpiX); } - int logicalDpiY() const { return (int)pdev->metric(PdmDpiY); } - int physicalDpiX()const { return (int)pdev->metric(PdmPhysicalDpiX); } - int physicalDpiY()const { return (int)pdev->metric(PdmPhysicalDpiY); } - int numColors() const { return (int)pdev->metric(PdmNumColors); } - int depth() const { return (int)pdev->metric(PdmDepth); } - -private: - TQPaintDevice *pdev; -}; - - -#endif // TQPAINTDEVICEMETRICS_H diff --git a/src/kernel/qpainter.cpp b/src/kernel/qpainter.cpp index 2d99ef754..d0d069702 100644 --- a/src/kernel/qpainter.cpp +++ b/src/kernel/qpainter.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qpainter.h" +#include "ntqpainter.h" #include "qpainter_p.h" -#include "qbitmap.h" -#include "qptrstack.h" -#include "qptrdict.h" -#include "qdatastream.h" -#include "qwidget.h" -#include "qimage.h" -#include "qpaintdevicemetrics.h" -#include "qapplication.h" +#include "ntqbitmap.h" +#include "ntqptrstack.h" +#include "ntqptrdict.h" +#include "ntqdatastream.h" +#include "ntqwidget.h" +#include "ntqimage.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqapplication.h" #include "qrichtext_p.h" -#include "qregexp.h" -#include "qcleanuphandler.h" +#include "ntqregexp.h" +#include "ntqcleanuphandler.h" #ifdef Q_WS_QWS #include "qgfx_qws.h" #endif @@ -69,7 +69,7 @@ typedef TQPtrStack TQWMatrixStack; #endif /*! - \class TQPainter qpainter.h + \class TQPainter ntqpainter.h \brief The TQPainter class does low-level painting e.g. on widgets. \ingroup graphics @@ -235,7 +235,7 @@ typedef TQPtrStack TQWMatrixStack; platforms may behave incorrectly with coordinates as small as +/-4000. - \headerfile qdrawutil.h + \headerfile ntqdrawutil.h \sa TQPaintDevice TQWidget TQPixmap TQPrinter TQPicture \link simple-application.html Application Walkthrough \endlink @@ -3139,7 +3139,7 @@ TQRect TQPainter::boundingRect( const TQRect &r, int flags, *****************************************************************************/ /*! - \class TQPen qpen.h + \class TQPen ntqpen.h \brief The TQPen class defines how a TQPainter should draw lines and outlines of shapes. @@ -3568,7 +3568,7 @@ TQDataStream &operator>>( TQDataStream &s, TQPen &p ) *****************************************************************************/ /*! - \class TQBrush qbrush.h + \class TQBrush ntqbrush.h \brief The TQBrush class defines the fill pattern of shapes drawn by a TQPainter. diff --git a/src/kernel/qpainter.h b/src/kernel/qpainter.h deleted file mode 100644 index e81cc1731..000000000 --- a/src/kernel/qpainter.h +++ /dev/null @@ -1,721 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPainter class -** -** Created : 940112 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPAINTER_H -#define TQPAINTER_H - - -#ifndef QT_H -#include "qcolor.h" -#include "qfontmetrics.h" -#include "qfontinfo.h" -#include "qregion.h" -#include "qpen.h" -#include "qbrush.h" -#include "qpointarray.h" -#include "qwmatrix.h" -#endif // QT_H - -class TQGfx; -class TQTextCodec; -class TQTextParag; -class TQPaintDevice; -class TQTextItem; -#if defined( Q_WS_MAC ) -class TQMacSavedPortInfo; -#endif -class TQPainterPrivate; - -#if defined(Q_WS_QWS) -class TQScreen; -#endif - -class Q_EXPORT TQPainter : public TQt -{ -public: - enum CoordinateMode { CoordDevice, CoordPainter }; - - TQPainter(); - TQPainter( const TQPaintDevice *, bool unclipped = FALSE ); - TQPainter( const TQPaintDevice *, const TQWidget *, bool unclipped = FALSE ); - ~TQPainter(); - - bool begin( const TQPaintDevice *, bool unclipped = FALSE ); - bool begin( const TQPaintDevice *, const TQWidget *, bool unclipped = FALSE ); - bool end(); - TQPaintDevice *device() const; - -#ifdef Q_WS_QWS - TQGfx * internalGfx(); -#ifdef QT_QWS_EXPERIMENTAL_SCREENPAINTER - bool begin(TQScreen *screen); -#endif -#endif - - static void redirect( TQPaintDevice *pdev, TQPaintDevice *replacement ); - static TQPaintDevice *redirect( TQPaintDevice *pdev ); - - bool isActive() const; - - void flush( const TQRegion ®ion, CoordinateMode cm = CoordDevice ); - void flush(); - void save(); - void restore(); - - // Drawing tools - - 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 & ); - TQPoint pos() const; - - // Drawing attributes/modes - - 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 x, int y ); - void setBrushOrigin( const TQPoint & ); - - // Scaling and transformations - -// PaintUnit unit() const; // get set painter unit -// void setUnit( PaintUnit ); // NOT IMPLEMENTED!!! - - bool hasViewXForm() const; - bool hasWorldXForm() const; - -#ifndef QT_NO_TRANSFORMATIONS - void setViewXForm( bool ); // set xform on/off - TQRect window() const; // get window - void setWindow( const TQRect & ); // set window - void setWindow( int x, int y, int w, int h ); - TQRect viewport() const; // get viewport - void setViewport( const TQRect & ); // set viewport - void setViewport( int x, int y, int w, int h ); - - void setWorldXForm( bool ); // set world xform on/off - const TQWMatrix &worldMatrix() const; // get/set world xform matrix - void setWorldMatrix( const TQWMatrix &, bool combine=FALSE ); - - void saveWorldMatrix(); - void restoreWorldMatrix(); - - void scale( double sx, double sy ); - void shear( double sh, double sv ); - void rotate( double a ); -#endif - void translate( double dx, double dy ); - void resetXForm(); - double translationX() const; - double translationY() const; - - TQPoint xForm( const TQPoint & ) const; // map virtual -> device - TQRect xForm( const TQRect & ) const; - TQPointArray xForm( const TQPointArray & ) const; - TQPointArray xForm( const TQPointArray &, int index, int npoints ) const; - TQPoint xFormDev( const TQPoint & ) const; // map device -> virtual - TQRect xFormDev( const TQRect & ) const; - TQPointArray xFormDev( const TQPointArray & ) const; - TQPointArray xFormDev( const TQPointArray &, int index, int npoints ) const; - - // Clipping - - void setClipping( bool ); // set clipping on/off - bool hasClipping() const; - TQRegion clipRegion( CoordinateMode = CoordDevice ) const; - void setClipRect( const TQRect &, CoordinateMode = CoordDevice ); // set clip rectangle - void setClipRect( int x, int y, int w, int h, CoordinateMode = CoordDevice ); - void setClipRegion( const TQRegion &, CoordinateMode = CoordDevice );// set clip region - - // Graphics drawing functions - - void drawPoint( int x, int y ); - void drawPoint( const TQPoint & ); - void drawPoints( const TQPointArray& a, - int index=0, int npoints=-1 ); - void moveTo( int x, int y ); - void moveTo( const TQPoint & ); - void lineTo( int x, int y ); - void lineTo( const TQPoint & ); - void drawLine( int x1, int y1, int x2, int y2 ); - void drawLine( const TQPoint &, const TQPoint & ); - void drawRect( int x, int y, int w, int h ); - void drawRect( const TQRect & ); - void drawWinFocusRect( int x, int y, int w, int h ); - void drawWinFocusRect( int x, int y, int w, int h, - const TQColor &bgColor ); - void drawWinFocusRect( const TQRect & ); - void drawWinFocusRect( const TQRect &, - const TQColor &bgColor ); - void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 ); - void drawRoundRect( const TQRect &, int = 25, int = 25 ); - void drawEllipse( int x, int y, int w, int h ); - void drawEllipse( const TQRect & ); - void drawArc( int x, int y, int w, int h, int a, int alen ); - void drawArc( const TQRect &, int a, int alen ); - void drawPie( int x, int y, int w, int h, int a, int alen ); - void drawPie( const TQRect &, int a, int alen ); - void drawChord( int x, int y, int w, int h, int a, int alen ); - void drawChord( const TQRect &, int a, int alen ); - void drawLineSegments( const TQPointArray &, - int index=0, int nlines=-1 ); - void drawPolyline( const TQPointArray &, - int index=0, int npoints=-1 ); - void drawPolygon( const TQPointArray &, bool winding=FALSE, - int index=0, int npoints=-1 ); - void drawConvexPolygon( const TQPointArray &, - int index=0, int npoints=-1 ); -#ifndef QT_NO_BEZIER - void drawCubicBezier( const TQPointArray &, int index=0 ); -#endif - void drawPixmap( int x, int y, const TQPixmap &, - int sx=0, int sy=0, int sw=-1, int sh=-1 ); - void drawPixmap( const TQPoint &, const TQPixmap &, - const TQRect &sr ); - void drawPixmap( const TQPoint &, const TQPixmap & ); - void drawPixmap( const TQRect &, const TQPixmap & ); - void drawImage( int x, int y, const TQImage &, - int sx = 0, int sy = 0, int sw = -1, int sh = -1, - int conversionFlags = 0 ); - void drawImage( const TQPoint &, const TQImage &, - const TQRect &sr, int conversionFlags = 0 ); - void drawImage( const TQPoint &, const TQImage &, - int conversion_flags = 0 ); - void drawImage( const TQRect &, const TQImage & ); - void drawTiledPixmap( int x, int y, int w, int h, const TQPixmap &, - int sx=0, int sy=0 ); - void drawTiledPixmap( const TQRect &, const TQPixmap &, - const TQPoint & ); - void drawTiledPixmap( const TQRect &, const TQPixmap & ); -#ifndef QT_NO_PICTURE - void drawPicture( const TQPicture & ); - void drawPicture( int x, int y, const TQPicture & ); - void drawPicture( const TQPoint &, const TQPicture & ); -#endif - - void fillRect( int x, int y, int w, int h, const TQBrush & ); - void fillRect( const TQRect &, const TQBrush & ); - void eraseRect( int x, int y, int w, int h ); - void eraseRect( const TQRect & ); - - // Text drawing functions - - enum TextDirection { - Auto, - RTL, - LTR - }; - - void drawText( int x, int y, const TQString &, int len = -1, TextDirection dir = Auto ); - void drawText( const TQPoint &, const TQString &, int len = -1, TextDirection dir = Auto ); - - void drawText( int x, int y, const TQString &, int pos, int len, TextDirection dir = Auto ); - void drawText( const TQPoint &p, const TQString &, int pos, int len, TextDirection dir = Auto ); - - void drawText( int x, int y, int w, int h, int flags, - const TQString&, int len = -1, TQRect *br=0, - TQTextParag **intern=0 ); - void drawText( const TQRect &, int flags, - const TQString&, int len = -1, TQRect *br=0, - TQTextParag **intern=0 ); - - void drawTextItem( int x, int y, const TQTextItem &ti, int textflags = 0 ); - void drawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags = 0 ); - - TQRect boundingRect( int x, int y, int w, int h, int flags, - const TQString&, int len = -1, TQTextParag **intern=0 ); - TQRect boundingRect( const TQRect &, int flags, - const TQString&, int len = -1, TQTextParag **intern=0 ); - - int tabStops() const; - void setTabStops( int ); - int *tabArray() const; - void setTabArray( int * ); - - // Other functions - -#if defined(Q_WS_WIN) - HDC handle() const; -#elif defined(Q_WS_X11) || defined(Q_WS_MAC) - HANDLE handle() const; -#endif - - - static void initialize(); - static void cleanup(); - -private: - void init(); - void destroy(); - void updateFont(); - void updatePen(); - void updateBrush(); -#ifndef QT_NO_TRANSFORMATIONS - void updateXForm(); - void updateInvXForm(); -#endif - void map( int, int, int *rx, int *ry ) const; - void map( int, int, int, int, int *, int *, int *, int * ) const; - void mapInv( int, int, int *, int * ) const; - void mapInv( int, int, int, int, int *, int *, int *, int * ) const; - void drawPolyInternal( const TQPointArray &, bool close=TRUE ); - void drawWinFocusRect( int x, int y, int w, int h, bool xorPaint, - const TQColor &penColor ); - - enum { IsActive=0x01, ExtDev=0x02, IsStartingUp=0x04, NoCache=0x08, - VxF=0x10, WxF=0x20, ClipOn=0x40, SafePolygon=0x80, MonoDev=0x100, - DirtyFont=0x200, DirtyPen=0x400, DirtyBrush=0x800, - RGBColor=0x1000, FontMet=0x2000, FontInf=0x4000, CtorBegin=0x8000, - UsePrivateCx = 0x10000, VolatileDC = 0x20000, TQt2Compat = 0x40000 }; - uint flags; - bool testf( uint b ) const { return (flags&b)!=0; } - void setf( uint b ) { flags |= b; } - void setf( uint b, bool v ); - void clearf( uint b ) { flags &= (uint)(~b); } - void fix_neg_rect( int *x, int *y, int *w, int *h ); - - TQPainterPrivate *d; - TQPaintDevice *pdev; - TQColor bg_col; - uchar bg_mode; - uchar rop; - uchar pu; - TQPoint bro; - TQFont cfont; - TQFont *pfont; // font used for metrics (might be different for printers) - TQPen cpen; - TQBrush cbrush; - TQRegion crgn; - int tabstops; - int *tabarray; - int tabarraylen; - bool block_ext; // for temporary blocking of external devices - - // Transformations -#ifndef QT_NO_TRANSFORMATIONS - TQCOORD wx, wy, ww, wh; - TQCOORD vx, vy, vw, vh; - TQWMatrix wxmat; - - // Cached composition (and inverse) of transformations - TQWMatrix xmat; - TQWMatrix ixmat; - - - - double m11() const { return xmat.m11(); } - double m12() const { return xmat.m12(); } - double m21() const { return xmat.m21(); } - double m22() const { return xmat.m22(); } - double dx() const { return xmat.dx(); } - double dy() const { return xmat.dy(); } - double im11() const { return ixmat.m11(); } - double im12() const { return ixmat.m12(); } - double im21() const { return ixmat.m21(); } - double im22() const { return ixmat.m22(); } - double idx() const { return ixmat.dx(); } - double idy() const { return ixmat.dy(); } - - int txop; - bool txinv; - -#else - // even without transformations we still have translations - int xlatex; - int xlatey; -#endif - - void *penRef; // pen cache ref - void *brushRef; // brush cache ref - void *ps_stack; - void *wm_stack; - void killPStack(); - -protected: -#ifdef Q_OS_TEMP - TQPoint internalCurrentPos; - uint old_pix; // ### All win platforms in 4.0 -#endif -#if defined(Q_WS_WIN) - friend class TQFontEngineWin; - friend class TQFontEngineBox; - QT_WIN_PAINTER_MEMBERS -#elif defined(Q_WS_X11) - friend class TQFontEngineXLFD; - friend class TQFontEngineXft; - friend class TQFontEngineBox; - Display *dpy; // current display - int scrn; // current screen - TQt::HANDLE hd; // handle to drawable - TQt::HANDLE rendhd; // handle to Xft draw - GC gc; // graphics context (standard) - GC gc_brush; // graphics contect for brush - TQPoint curPt; // current point - uint clip_serial; // clipping serial number -#elif defined(Q_WS_MAC) - TQt::HANDLE hd; // handle to drawable - void initPaintDevice(bool force=FALSE, TQPoint *off=NULL, TQRegion *rgn=NULL); - friend const TQRegion &qt_mac_update_painter(TQPainter *, bool); - friend class TQFontEngineMac; - friend class TQMacPainter; -#elif defined(Q_WS_QWS) - friend class TQFontEngine; - TQGfx * gfx; - friend void qwsUpdateActivePainters(); -#endif - friend class TQFontMetrics; - friend class TQFontInfo; - friend class TQTextLayout; - friend void qt_format_text( const TQFont &, const TQRect &r, - int tf, const TQString& str, int len, TQRect *brect, - int tabstops, int* tabarray, int tabarraylen, - TQTextParag **internal, TQPainter* painter ); - friend void qt_draw_background( TQPainter *p, int x, int y, int w, int h ); - friend void qt_draw_transformed_rect( TQPainter *p, int x, int y, int w, int h, bool fill ); - friend class TQPrinter; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPainter( const TQPainter & ); - TQPainter &operator=( const TQPainter & ); -#endif - - enum TransformationCodes { - TxNone = 0, // transformation codes - TxTranslate = 1, // copy in qpainter_*.cpp - TxScale = 2, - TxRotShear = 3 - }; -}; - - -/***************************************************************************** - TQPainter member functions - *****************************************************************************/ - -inline TQPaintDevice *TQPainter::device() const -{ - return pdev; -} - -inline bool TQPainter::isActive() const -{ - return testf(IsActive); -} - -inline const TQFont &TQPainter::font() const -{ - return cfont; -} - -inline const TQPen &TQPainter::pen() const -{ - return cpen; -} - -inline const TQBrush &TQPainter::brush() const -{ - return cbrush; -} - -/* -inline PaintUnit TQPainter::unit() const -{ - return (PaintUnit)pu; -} -*/ - -inline const TQColor &TQPainter::backgroundColor() const -{ - return bg_col; -} - -inline TQt::BGMode TQPainter::backgroundMode() const -{ - return (BGMode)bg_mode; -} - -inline TQt::RasterOp TQPainter::rasterOp() const -{ - return (RasterOp)rop; -} - -inline const TQPoint &TQPainter::brushOrigin() const -{ - return bro; -} - -inline bool TQPainter::hasViewXForm() const -{ -#ifndef QT_NO_TRANSFORMATIONS - return testf(VxF); -#else - return xlatex || xlatey; -#endif -} - -inline bool TQPainter::hasWorldXForm() const -{ -#ifndef QT_NO_TRANSFORMATIONS - return testf(WxF); -#else - return xlatex || xlatey; -#endif -} - -inline double TQPainter::translationX() const -{ -#ifndef QT_NO_TRANSFORMATIONS - return worldMatrix().dx(); -#else - return xlatex; -#endif -} - -inline double TQPainter::translationY() const -{ -#ifndef QT_NO_TRANSFORMATIONS - return worldMatrix().dy(); -#else - return xlatey; -#endif -} - - -inline bool TQPainter::hasClipping() const -{ - return testf(ClipOn); -} - -inline int TQPainter::tabStops() const -{ - return tabstops; -} - -inline int *TQPainter::tabArray() const -{ - return tabarray; -} - -#if defined(Q_WS_WIN) -inline HDC TQPainter::handle() const -{ - return hdc; -} -#elif defined(Q_WS_X11) || defined(Q_WS_MAC) -inline TQt::HANDLE TQPainter::handle() const -{ - return hd; -} -#endif - -inline void TQPainter::setBrushOrigin( const TQPoint &p ) -{ - setBrushOrigin( p.x(), p.y() ); -} - -#ifndef QT_NO_TRANSFORMATIONS -inline void TQPainter::setWindow( const TQRect &r ) -{ - setWindow( r.x(), r.y(), r.width(), r.height() ); -} - -inline void TQPainter::setViewport( const TQRect &r ) -{ - setViewport( r.x(), r.y(), r.width(), r.height() ); -} -#endif - -inline void TQPainter::setClipRect( int x, int y, int w, int h, CoordinateMode m ) -{ - setClipRect( TQRect(x,y,w,h), m ); -} - -inline void TQPainter::drawPoint( const TQPoint &p ) -{ - drawPoint( p.x(), p.y() ); -} - -inline void TQPainter::moveTo( const TQPoint &p ) -{ - moveTo( p.x(), p.y() ); -} - -inline void TQPainter::lineTo( const TQPoint &p ) -{ - lineTo( p.x(), p.y() ); -} - -inline void TQPainter::drawLine( const TQPoint &p1, const TQPoint &p2 ) -{ - drawLine( p1.x(), p1.y(), p2.x(), p2.y() ); -} - -inline void TQPainter::drawRect( const TQRect &r ) -{ - drawRect( r.x(), r.y(), r.width(), r.height() ); -} - -inline void TQPainter::drawWinFocusRect( const TQRect &r ) -{ - drawWinFocusRect( r.x(), r.y(), r.width(), r.height() ); -} - -inline void TQPainter::drawWinFocusRect( const TQRect &r,const TQColor &penColor ) -{ - drawWinFocusRect( r.x(), r.y(), r.width(), r.height(), penColor ); -} - -inline void TQPainter::drawRoundRect( const TQRect &r, int xRnd, int yRnd ) -{ - drawRoundRect( r.x(), r.y(), r.width(), r.height(), xRnd, yRnd ); -} - -inline void TQPainter::drawEllipse( const TQRect &r ) -{ - drawEllipse( r.x(), r.y(), r.width(), r.height() ); -} - -inline void TQPainter::drawArc( const TQRect &r, int a, int alen ) -{ - drawArc( r.x(), r.y(), r.width(), r.height(), a, alen ); -} - -inline void TQPainter::drawPie( const TQRect &r, int a, int alen ) -{ - drawPie( r.x(), r.y(), r.width(), r.height(), a, alen ); -} - -inline void TQPainter::drawChord( const TQRect &r, int a, int alen ) -{ - drawChord( r.x(), r.y(), r.width(), r.height(), a, alen ); -} - -inline void TQPainter::drawPixmap( const TQPoint &p, const TQPixmap &pm, - const TQRect &sr ) -{ - drawPixmap( p.x(), p.y(), pm, sr.x(), sr.y(), sr.width(), sr.height() ); -} - -inline void TQPainter::drawImage( const TQPoint &p, const TQImage &pm, - const TQRect &sr, int conversionFlags ) -{ - drawImage( p.x(), p.y(), pm, - sr.x(), sr.y(), sr.width(), sr.height(), conversionFlags ); -} - -inline void TQPainter::drawTiledPixmap( const TQRect &r, const TQPixmap &pm, - const TQPoint &sp ) -{ - drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, sp.x(), sp.y() ); -} - -inline void TQPainter::drawTiledPixmap( const TQRect &r, const TQPixmap &pm ) -{ - drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, 0, 0 ); -} - -inline void TQPainter::fillRect( const TQRect &r, const TQBrush &brush ) -{ - fillRect( r.x(), r.y(), r.width(), r.height(), brush ); -} - -inline void TQPainter::eraseRect( int x, int y, int w, int h ) -{ - fillRect( x, y, w, h, backgroundColor() ); -} - -inline void TQPainter::eraseRect( const TQRect &r ) -{ - fillRect( r.x(), r.y(), r.width(), r.height(), backgroundColor() ); -} - -inline void TQPainter::drawText( const TQPoint &p, const TQString &s, int len, TextDirection dir ) -{ - drawText( p.x(), p.y(), s, 0, len, dir ); -} - -inline void TQPainter::drawText( const TQPoint &p, const TQString &s, int pos, int len, TextDirection dir ) -{ - drawText( p.x(), p.y(), s, pos, len, dir ); -} - -inline void TQPainter::drawText( int x, int y, int w, int h, int tf, - const TQString& str, int len, TQRect *br, TQTextParag **i ) -{ - TQRect r(x, y, w, h); - drawText( r, tf, str, len, br, i ); -} - -inline void TQPainter::drawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags ) -{ - drawTextItem( p.x(), p.y(), ti, textflags ); -} - -inline TQRect TQPainter::boundingRect( int x, int y, int w, int h, int tf, - const TQString& str, int len, TQTextParag **i ) -{ - TQRect r(x, y, w, h); - return boundingRect( r, tf, str, len, i ); -} - -#if defined(Q_WS_QWS) -inline TQGfx * TQPainter::internalGfx() -{ - return gfx; -} -#endif - -#endif // TQPAINTER_H diff --git a/src/kernel/qpainter_x11.cpp b/src/kernel/qpainter_x11.cpp index d2127be2f..6214dc3b4 100644 --- a/src/kernel/qpainter_x11.cpp +++ b/src/kernel/qpainter_x11.cpp @@ -40,13 +40,13 @@ #include "qplatformdefs.h" -#include "qfont.h" -#include "qpainter.h" -#include "qwidget.h" -#include "qbitmap.h" -#include "qpixmapcache.h" -#include "qtextcodec.h" -#include "qpaintdevicemetrics.h" +#include "ntqfont.h" +#include "ntqpainter.h" +#include "ntqwidget.h" +#include "ntqbitmap.h" +#include "ntqpixmapcache.h" +#include "ntqtextcodec.h" +#include "ntqpaintdevicemetrics.h" #include "qt_x11_p.h" @@ -137,7 +137,7 @@ static const TQt::HANDLE rendhd = 0; #endif // hack, so we don't have to make TQRegion::clipRectangles() public or include -// X11 headers in qregion.h +// X11 headers in ntqregion.h inline void *qt_getClipRects( const TQRegion &r, int &num ) { return r.clipRectangles( num ); @@ -435,8 +435,8 @@ static void init_gc_cache() // #define GC_CACHE_STAT #if defined(GC_CACHE_STAT) -#include "qtextstream.h" -#include "qbuffer.h" +#include "ntqtextstream.h" +#include "ntqbuffer.h" static int g_numhits = 0; static int g_numcreates = 0; diff --git a/src/kernel/qpalette.cpp b/src/kernel/qpalette.cpp index 9d23df6cd..3821306c0 100644 --- a/src/kernel/qpalette.cpp +++ b/src/kernel/qpalette.cpp @@ -38,18 +38,18 @@ ** **********************************************************************/ -#include "qpalette.h" +#include "ntqpalette.h" #ifndef QT_NO_PALETTE -#include "qdatastream.h" -#include "qcleanuphandler.h" +#include "ntqdatastream.h" +#include "ntqcleanuphandler.h" /***************************************************************************** TQColorGroup member functions *****************************************************************************/ /*! - \class TQColorGroup qpalette.h + \class TQColorGroup ntqpalette.h \brief The TQColorGroup class contains a group of widget colors. \ingroup appearance @@ -513,7 +513,7 @@ bool TQColorGroup::operator==( const TQColorGroup &g ) const *****************************************************************************/ /*! - \class TQPalette qpalette.h + \class TQPalette ntqpalette.h \brief The TQPalette class contains color groups for each widget state. diff --git a/src/kernel/qpalette.h b/src/kernel/qpalette.h deleted file mode 100644 index 2d3360546..000000000 --- a/src/kernel/qpalette.h +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** -** -** Definition of TQColorGroup and TQPalette classes -** -** Created : 950323 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPALETTE_H -#define TQPALETTE_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qcolor.h" -#include "qshared.h" -#include "qbrush.h" // TQColor->TQBrush conversion -#endif // QT_H - -#ifndef QT_NO_PALETTE - -class TQColorGroupPrivate; - -class Q_EXPORT TQColorGroup -{ -public: - TQColorGroup(); - TQColorGroup( const TQColor &foreground, const TQColor &button, - const TQColor &light, const TQColor &dark, const TQColor &mid, - const TQColor &text, const TQColor &base ); - TQColorGroup( const TQBrush &foreground, const TQBrush &button, - const TQBrush &light, const TQBrush &dark, const TQBrush &mid, - const TQBrush &text, const TQBrush &bright_text, - const TQBrush &base, const TQBrush &background); - TQColorGroup( const TQColorGroup & ); - - ~TQColorGroup(); - - TQColorGroup& operator =(const TQColorGroup&); - - // Do not change the order, the serialization format depends on it - 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 { return br[Foreground].color(); } - const TQColor &button() const { return br[Button].color(); } - const TQColor &light() const { return br[Light].color(); } - const TQColor &dark() const { return br[Dark].color(); } - const TQColor &mid() const { return br[Mid].color(); } - const TQColor &text() const { return br[Text].color(); } - const TQColor &base() const { return br[Base].color(); } - const TQColor &background() const { return br[Background].color(); } - - const TQColor &midlight() const { return br[Midlight].color(); } - const TQColor &brightText() const { return br[BrightText].color(); } - const TQColor &buttonText() const { return br[ButtonText].color(); } - const TQColor &shadow() const { return br[Shadow].color(); } - const TQColor &highlight() const { return br[Highlight].color(); } - const TQColor &highlightedText() const{return br[HighlightedText].color(); } - const TQColor &link() const { return br[Link].color(); } - const TQColor &linkVisited() const { return br[LinkVisited].color(); } - - bool operator==( const TQColorGroup &g ) const; - bool operator!=( const TQColorGroup &g ) const - { return !(operator==(g)); } - -private: - TQBrush *br; - TQColorGroupPrivate * d; - - friend class TQPalette; -}; - - -class Q_EXPORT TQPalette -{ -public: - TQPalette(); - TQPalette( const TQColor &button ); - TQPalette( const TQColor &button, const TQColor &background ); - TQPalette( const TQColorGroup &active, const TQColorGroup &disabled, - const TQColorGroup &inactive ); - TQPalette( const TQPalette & ); - ~TQPalette(); - TQPalette &operator=( const TQPalette & ); - - enum ColorGroup { Disabled, Active, Inactive, NColorGroups, Normal=Active }; - - 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 { return data->active; } - const TQColorGroup &disabled() const { return data->disabled; } - const TQColorGroup &inactive() const { return data->inactive; } -#ifndef QT_NO_COMPAT - const TQColorGroup &normal() const { return active(); } -#endif - - void setActive( const TQColorGroup & ); - void setDisabled( const TQColorGroup & ); - void setInactive( const TQColorGroup & ); -#ifndef QT_NO_COMPAT - void setNormal( const TQColorGroup & cg ) { setActive(cg); } -#endif - - bool operator==( const TQPalette &p ) const; - bool operator!=( const TQPalette &p ) const - { return !(operator==(p)); } - bool isCopyOf( const TQPalette & ); - - int serialNumber() const { return data->ser_no; } - - - static TQColorGroup::ColorRole foregroundRoleFromMode( TQt::BackgroundMode mode ); - static TQColorGroup::ColorRole backgroundRoleFromMode( TQt::BackgroundMode mode); - -private: - void detach(); - const TQBrush &directBrush( ColorGroup, TQColorGroup::ColorRole ) const; - void directSetBrush( ColorGroup, TQColorGroup::ColorRole, const TQBrush& ); - - struct TQPalData : public TQShared { - TQColorGroup disabled; - TQColorGroup active; - int ser_no; - TQColorGroup inactive; - } *data; -}; - - -/***************************************************************************** - TQColorGroup/TQPalette stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQColorGroup & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQColorGroup & ); - -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPalette & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPalette & ); -#endif // QT_NO_DATASTREAM - -#endif // QT_NO_PALETTE -#endif // TQPALETTE_H diff --git a/src/kernel/qpen.h b/src/kernel/qpen.h deleted file mode 100644 index 93d98d200..000000000 --- a/src/kernel/qpen.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPen class -** -** Created : 940112 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPEN_H -#define TQPEN_H - -#ifndef QT_H -#include "qcolor.h" -#include "qshared.h" -#endif // QT_H - - -class Q_EXPORT TQPen: public TQt -{ -public: - TQPen(); - TQPen( PenStyle ); - TQPen( const TQColor &color, uint width=0, PenStyle style=SolidLine ); - TQPen( const TQColor &cl, uint w, PenStyle s, PenCapStyle c, PenJoinStyle j); - TQPen( const TQPen & ); - ~TQPen(); - TQPen &operator=( const TQPen & ); - - PenStyle style() const { return data->style; } - void setStyle( PenStyle ); - uint width() const { return data->width; } - void setWidth( uint ); - const TQColor &color() const { return data->color; } - void setColor( const TQColor & ); - PenCapStyle capStyle() const; - void setCapStyle( PenCapStyle ); - PenJoinStyle joinStyle() const; - void setJoinStyle( PenJoinStyle ); - - bool operator==( const TQPen &p ) const; - bool operator!=( const TQPen &p ) const - { return !(operator==(p)); } - -private: - friend class TQPainter; -#ifdef Q_WS_WIN - friend class TQFontEngineWin; -#endif - - TQPen copy() const; - void detach(); - void init( const TQColor &, uint, uint ); - struct TQPenData : public TQShared { // pen data - PenStyle style; - uint width; - TQColor color; - Q_UINT16 linest; - } *data; -}; - - -/***************************************************************************** - TQPen stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPen & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPen & ); -#endif - -#endif // TQPEN_H diff --git a/src/kernel/qpicture.cpp b/src/kernel/qpicture.cpp index 8d02588bc..aeb0f56e0 100644 --- a/src/kernel/qpicture.cpp +++ b/src/kernel/qpicture.cpp @@ -38,23 +38,23 @@ ** **********************************************************************/ -#include "qpicture.h" +#include "ntqpicture.h" #ifndef QT_NO_PICTURE -#include "qpainter.h" -#include "qpixmap.h" -#include "qimage.h" -#include "qfile.h" -#include "qdatastream.h" -#include "qpaintdevicemetrics.h" +#include "ntqpainter.h" +#include "ntqpixmap.h" +#include "ntqimage.h" +#include "ntqfile.h" +#include "ntqdatastream.h" +#include "ntqpaintdevicemetrics.h" #ifndef QT_NO_SVG #include "private/qsvgdevice_p.h" #endif /*! - \class TQPicture qpicture.h + \class TQPicture ntqpicture.h \brief The TQPicture class is a paint device that records and replays TQPainter commands. diff --git a/src/kernel/qpicture.h b/src/kernel/qpicture.h deleted file mode 100644 index 7322bb936..000000000 --- a/src/kernel/qpicture.h +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPicture class -** -** Created : 940729 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPICTURE_H -#define TQPICTURE_H - -#ifndef QT_H -#include "qpaintdevice.h" -#include "qbuffer.h" -#endif // QT_H - -#ifndef QT_NO_PICTURE - -class Q_EXPORT TQPicture : public TQPaintDevice // picture class -{ -public: - TQPicture( int formatVersion = -1 ); - TQPicture( const TQPicture & ); - ~TQPicture(); - - bool isNull() const; - - uint size() const; - const char* data() const; - virtual void setData( const char* data, uint size ); - - bool play( TQPainter * ); - - bool load( TQIODevice *dev, const char *format = 0 ); - bool load( const TQString &fileName, const char *format = 0 ); - bool save( TQIODevice *dev, const char *format = 0 ); - bool save( const TQString &fileName, const char *format = 0 ); - - TQRect boundingRect() const; - void setBoundingRect( const TQRect &r ); - - TQPicture& operator= (const TQPicture&); - - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPicture & ); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPicture & ); - -protected: - bool cmd( int, TQPainter *, TQPDevCmdParam * ); - int metric( int ) const; - void detach(); - TQPicture copy() const; - -private: - bool exec( TQPainter *, TQDataStream &, int ); - - struct TQPicturePrivate : public TQShared { - bool cmd( int, TQPainter *, TQPDevCmdParam * ); - bool checkFormat(); - void resetFormat(); - - TQBuffer pictb; - int trecs; - bool formatOk; - int formatMajor; - int formatMinor; - TQRect brect; - } *d; -}; - - -inline bool TQPicture::isNull() const -{ - return d->pictb.buffer().isNull(); -} - -inline uint TQPicture::size() const -{ - return d->pictb.buffer().size(); -} - -inline const char* TQPicture::data() const -{ - return d->pictb.buffer().data(); -} - -/***************************************************************************** - TQPicture stream functions - *****************************************************************************/ - -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPicture & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPicture & ); - -#endif // QT_NO_PICTURE - -#endif // TQPICTURE_H diff --git a/src/kernel/qpixmap.cpp b/src/kernel/qpixmap.cpp index 7d2580081..ca1490a5a 100644 --- a/src/kernel/qpixmap.cpp +++ b/src/kernel/qpixmap.cpp @@ -38,23 +38,23 @@ ** **********************************************************************/ -#include "qpixmap.h" - -#include "qbitmap.h" -#include "qimage.h" -#include "qwidget.h" -#include "qpainter.h" -#include "qdatastream.h" -#include "qbuffer.h" -#include "qobjectlist.h" -#include "qapplication.h" +#include "ntqpixmap.h" + +#include "ntqbitmap.h" +#include "ntqimage.h" +#include "ntqwidget.h" +#include "ntqpainter.h" +#include "ntqdatastream.h" +#include "ntqbuffer.h" +#include "ntqobjectlist.h" +#include "ntqapplication.h" #include -#include "qmime.h" -#include "qdragobject.h" -#include "qfile.h" +#include "ntqmime.h" +#include "ntqdragobject.h" +#include "ntqfile.h" /*! - \class TQPixmap qpixmap.h + \class TQPixmap ntqpixmap.h \brief The TQPixmap class is an off-screen, pixel-based paint device. \ingroup graphics diff --git a/src/kernel/qpixmap.h b/src/kernel/qpixmap.h deleted file mode 100644 index 89496e7a3..000000000 --- a/src/kernel/qpixmap.h +++ /dev/null @@ -1,354 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPixmap class -** -** Created : 940501 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPIXMAP_H -#define TQPIXMAP_H - -#ifndef QT_H -#include "qpaintdevice.h" -#include "qcolor.h" // char*->TQColor conversion -#include "qstring.h" // char*->TQString conversion -#include "qnamespace.h" -#endif // QT_H - -class TQGfx; -class TQPixmapPrivate; - -#if defined(Q_WS_WIN) -// Internal pixmap memory optimization class for Windows 9x -class TQMultiCellPixmap; -#endif - - -class Q_EXPORT TQPixmap : public TQPaintDevice, public TQt -{ -public: - enum ColorMode { Auto, Color, Mono }; - enum Optimization { DefaultOptim, NoOptim, MemoryOptim=NoOptim, - NormalOptim, BestOptim }; - - TQPixmap(); - TQPixmap( const TQImage& image ); - TQPixmap( int w, int h, int depth = -1, Optimization = DefaultOptim ); - TQPixmap( const TQSize &, int depth = -1, Optimization = DefaultOptim ); -#ifndef QT_NO_IMAGEIO - TQPixmap( const TQString& fileName, const char *format=0, - ColorMode mode=Auto ); - TQPixmap( const TQString& fileName, const char *format, - int conversion_flags ); - TQPixmap( const char *xpm[] ); // ### in 4.0, 'const char * const xpm[]'? - TQPixmap( const TQByteArray &data ); -#endif - TQPixmap( const TQPixmap & ); - ~TQPixmap(); - - TQPixmap &operator=( const TQPixmap & ); - TQPixmap &operator=( const TQImage & ); - - bool isNull() const; - - int width() const { return data->w; } - int height() const { return data->h; } - TQSize size() const { return TQSize(data->w,data->h); } - TQRect rect() const { return TQRect(0,0,data->w,data->h); } - int depth() const { return data->d; } - static int defaultDepth(); - - void fill( const TQColor &fillColor = TQt::white ); - void fill( const TQWidget *, int xofs, int yofs ); - void fill( const TQWidget *, const TQPoint &ofs ); - void resize( int width, int height ); - void resize( const TQSize & ); - - const TQBitmap *mask() const; - void setMask( const TQBitmap & ); - bool selfMask() const; - bool hasAlpha() const; - bool hasAlphaChannel() const; -#ifndef QT_NO_IMAGE_HEURISTIC_MASK - TQBitmap createHeuristicMask( bool clipTight = TRUE ) const; -#endif -#ifndef QT_NO_MIME - static TQPixmap fromMimeSource( const TQString& abs_name ); -#endif - static TQPixmap grabWindow( WId, int x=0, int y=0, int w=-1, int h=-1 ); - static TQPixmap grabWidget( TQWidget * widget, - int x=0, int y=0, int w=-1, int h=-1 ); - -#ifndef QT_NO_PIXMAP_TRANSFORMATION - TQPixmap xForm( const TQWMatrix & ) const; - static TQWMatrix trueMatrix( const TQWMatrix &, int w, int h ); -#endif - - TQImage convertToImage() const; - bool convertFromImage( const TQImage &, ColorMode mode=Auto ); - bool convertFromImage( const TQImage &, int conversion_flags ); -#ifndef QT_NO_IMAGEIO - static const char* imageFormat( const TQString &fileName ); - bool load( const TQString& fileName, const char *format=0, - ColorMode mode=Auto ); - bool load( const TQString& fileName, const char *format, - int conversion_flags ); - bool loadFromData( const uchar *buf, uint len, - const char* format=0, - ColorMode mode=Auto ); - bool loadFromData( const uchar *buf, uint len, - const char* format, - int conversion_flags ); - bool loadFromData( const TQByteArray &data, - const char* format=0, - int conversion_flags=0 ); - bool save( const TQString& fileName, const char* format, int quality = -1 ) const; - bool save( TQIODevice* device, const char* format, int quality = -1 ) const; -#endif - -#if defined(Q_WS_WIN) - HBITMAP hbm() const; -#endif - - int serialNumber() const; - - Optimization optimization() const; - void setOptimization( Optimization ); - static Optimization defaultOptimization(); - static void setDefaultOptimization( Optimization ); - - virtual void detach(); - - bool isTQBitmap() const; - -#if defined(Q_WS_WIN) - // These functions are internal and used by Windows 9x only - bool isMultiCellPixmap() const; - HDC multiCellHandle() const; - HBITMAP multiCellBitmap() const; - int multiCellOffset() const; - int allocCell(); - void freeCell( bool = FALSE ); -#endif - -#if defined(Q_WS_QWS) - virtual TQGfx * graphicsContext(bool clip_children=TRUE) const; - virtual unsigned char * scanLine(int) const; - virtual int bytesPerLine() const; - TQRgb * clut() const; - int numCols() const; -#elif defined(Q_WS_X11) - static int x11SetDefaultScreen( int screen ); - void x11SetScreen( int screen ); -#endif - -#ifndef Q_QDOC - Q_DUMMY_COMPARISON_OPERATOR(TQPixmap) -#endif - -protected: - TQPixmap( int w, int h, const uchar *data, bool isXbitmap ); - int metric( int ) const; - -#if defined(Q_WS_WIN) - struct TQMCPI { // mem optim for win9x - TQMultiCellPixmap *mcp; - int offset; - }; -#endif - - struct TQPixmapData : public TQShared { // internal pixmap data - TQCOORD w, h; - short d; - uint uninit : 1; - uint bitmap : 1; - uint selfmask : 1; -#if defined(Q_WS_WIN) - uint mcp : 1; -#endif - int ser_no; - TQBitmap *mask; -#if defined(Q_WS_WIN) - TQPixmap *maskpm; - union { - HBITMAP hbm; // if mcp == FALSE - TQMCPI *mcpi; // if mcp == TRUE - } hbm_or_mcpi; - uchar *realAlphaBits; -#ifdef Q_OS_TEMP - uchar* ppvBits; // Pointer to DIBSection bits -#endif -#elif defined(Q_WS_X11) - void *ximage; - void *maskgc; - TQPixmap *alphapm; -#elif defined(Q_WS_MAC) - ColorTable *clut; - TQPixmap *alphapm; -#elif defined(Q_WS_QWS) - int id; // ### should use TQPaintDevice::hd, since it is there - TQRgb * clut; - int numcols; - int rw; - int rh; - bool hasAlpha; -#endif - Optimization optim; -#if defined(Q_WS_WIN) - HBITMAP old_hbm; -#endif - } *data; -private: -#ifndef QT_NO_IMAGEIO - bool doImageIO( TQImageIO* io, int quality ) const; -#endif - TQPixmap( int w, int h, int depth, bool, Optimization ); - void init( int, int, int, bool, Optimization ); - void deref(); - TQPixmap copy( bool ignoreMask = FALSE ) const; -#if defined(Q_WS_WIN) - void initAlphaPixmap( uchar *bytes, int length, struct tagBITMAPINFO *bmi ); - void convertToAlphaPixmap( bool initAlpha=TRUE ); - static void bitBltAlphaPixmap( TQPixmap *dst, int dx, int dy, - const TQPixmap *src, int sx, int sy, - int sw, int sh, bool useDstAlpha ); -#endif - static Optimization defOptim; - friend Q_EXPORT void bitBlt( TQPaintDevice *, int, int, - const TQPaintDevice *, - int, int, int, int, RasterOp, bool ); - friend Q_EXPORT void bitBlt( TQPaintDevice *, int, int, - const TQImage* src, - int, int, int, int, int conversion_flags ); - friend Q_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, - const TQPixmap *src, int sx, int sy, - int sw, int sh ); - -#if defined(Q_WS_MAC) - friend void unclippedScaledBitBlt(TQPaintDevice *, int, int, int, int, - const TQPaintDevice *, int, int, int, int, - TQt::RasterOp, bool, bool); -#endif - - friend class TQBitmap; - friend class TQPaintDevice; - friend class TQPainter; - friend class TQGLWidget; -}; - - -inline bool TQPixmap::isNull() const -{ - return data->w == 0; -} - -inline void TQPixmap::fill( const TQWidget *w, const TQPoint &ofs ) -{ - fill( w, ofs.x(), ofs.y() ); -} - -inline void TQPixmap::resize( const TQSize &s ) -{ - resize( s.width(), s.height() ); -} - -inline const TQBitmap *TQPixmap::mask() const -{ - return data->mask; -} - -inline bool TQPixmap::selfMask() const -{ - return data->selfmask; -} - -#if defined(Q_WS_WIN) -inline HBITMAP TQPixmap::hbm() const -{ - return data->mcp ? 0 : data->hbm_or_mcpi.hbm; -} -#endif - -inline int TQPixmap::serialNumber() const -{ - return data->ser_no; -} - -inline TQPixmap::Optimization TQPixmap::optimization() const -{ - return data->optim; -} - -inline bool TQPixmap::isTQBitmap() const -{ - return data->bitmap; -} - -#if defined(Q_WS_WIN) -inline bool TQPixmap::isMultiCellPixmap() const -{ - return data->mcp; -} -#endif - - -/***************************************************************************** - TQPixmap stream functions - *****************************************************************************/ - -#if !defined(QT_NO_DATASTREAM) && !defined(QT_NO_IMAGEIO) -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPixmap & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPixmap & ); -#endif - -/***************************************************************************** - TQPixmap (and TQImage) helper functions - *****************************************************************************/ - -#ifndef QT_NO_PIXMAP_TRANSFORMATION -# define QT_XFORM_TYPE_MSBFIRST 0 -# define QT_XFORM_TYPE_LSBFIRST 1 -# if defined(Q_WS_WIN) -# define QT_XFORM_TYPE_WINDOWSPIXMAP 2 -# endif -bool qt_xForm_helper( const TQWMatrix&, int, int, int, uchar*, int, int, int, uchar*, int, int, int ); -#endif - -Q_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, - const TQPixmap *src, int sx = 0, int sy = 0, - int sw = -1, int sh = -1 ); - -#endif // TQPIXMAP_H diff --git a/src/kernel/qpixmap_x11.cpp b/src/kernel/qpixmap_x11.cpp index 8bbc20e8a..4040b055a 100644 --- a/src/kernel/qpixmap_x11.cpp +++ b/src/kernel/qpixmap_x11.cpp @@ -67,11 +67,11 @@ #undef QT_MITSHM_XFORM #endif -#include "qbitmap.h" -#include "qpaintdevicemetrics.h" -#include "qimage.h" -#include "qwmatrix.h" -#include "qapplication.h" +#include "ntqbitmap.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqimage.h" +#include "ntqwmatrix.h" +#include "ntqapplication.h" #include "qt_x11_p.h" #include diff --git a/src/kernel/qpixmapcache.cpp b/src/kernel/qpixmapcache.cpp index 14616e045..f29e0402c 100644 --- a/src/kernel/qpixmapcache.cpp +++ b/src/kernel/qpixmapcache.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qpixmapcache.h" -#include "qcache.h" -#include "qobject.h" -#include "qcleanuphandler.h" +#include "ntqpixmapcache.h" +#include "ntqcache.h" +#include "ntqobject.h" +#include "ntqcleanuphandler.h" // REVISED: paul /*! - \class TQPixmapCache qpixmapcache.h + \class TQPixmapCache ntqpixmapcache.h \brief The TQPixmapCache class provides an application-global cache for pixmaps. diff --git a/src/kernel/qpixmapcache.h b/src/kernel/qpixmapcache.h deleted file mode 100644 index 47e729cf4..000000000 --- a/src/kernel/qpixmapcache.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPixmapCache class -** -** Created : 950501 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPIXMAPCACHE_H -#define TQPIXMAPCACHE_H - -#ifndef QT_H -#include "qpixmap.h" -#endif // QT_H - - -class Q_EXPORT TQPixmapCache // global pixmap cache -{ -public: - static int cacheLimit(); - static void setCacheLimit( int ); - static TQPixmap *find( const TQString &key ); - static bool find( const TQString &key, TQPixmap& ); - static bool insert( const TQString &key, TQPixmap * ); - static bool insert( const TQString &key, const TQPixmap& ); - static void remove( const TQString &key ); - static void clear(); -}; - - -#endif // TQPIXMAPCACHE_H diff --git a/src/kernel/qpngio.cpp b/src/kernel/qpngio.cpp index bbb4037bd..eee32c438 100644 --- a/src/kernel/qpngio.cpp +++ b/src/kernel/qpngio.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qpngio.h" +#include "ntqpngio.h" #ifndef QT_NO_IMAGEIO_PNG -#include "qasyncimageio.h" -#include "qiodevice.h" +#include "ntqasyncimageio.h" +#include "ntqiodevice.h" #include #if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) @@ -764,7 +764,7 @@ void write_png_image(TQImageIO* iio) } /*! - \class TQPNGImagePacker qpngio.h + \class TQPNGImagePacker ntqpngio.h \brief The TQPNGImagePacker class creates well-compressed PNG animations. \ingroup images @@ -979,7 +979,7 @@ class TQPNGFormatType : public TQImageFormatType /* - \class TQPNGFormat qpngio.h + \class TQPNGFormat ntqpngio.h \brief The TQPNGFormat class provides an incremental image decoder for PNG image format. @@ -1012,7 +1012,7 @@ class TQPNGFormatType : public TQImageFormatType */ /* - \class TQPNGFormatType qasyncimageio.h + \class TQPNGFormatType ntqasyncimageio.h \brief The TQPNGFormatType class provides an incremental image decoder for PNG image format. diff --git a/src/kernel/qpngio.h b/src/kernel/qpngio.h deleted file mode 100644 index 1a9d5c291..000000000 --- a/src/kernel/qpngio.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Definition of PNG TQImage IOHandler -** -** Created : 970521 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPNGIO_H -#define TQPNGIO_H - -#ifndef QT_H -#include "qimage.h" -#endif // QT_H - -#ifndef QT_NO_IMAGEIO_PNG - -void qInitPngIO(); - -class TQIODevice; - -#ifndef Q_PNGEXPORT -#if !defined(QT_PLUGIN) -#define Q_PNGEXPORT Q_EXPORT -#else -#define Q_PNGEXPORT -#endif -#endif - -class Q_PNGEXPORT TQPNGImageWriter { -public: - TQPNGImageWriter(TQIODevice*); - ~TQPNGImageWriter(); - - enum DisposalMethod { Unspecified, NoDisposal, RestoreBackground, RestoreImage }; - void setDisposalMethod(DisposalMethod); - void setLooping(int loops=0); // 0 == infinity - void setFrameDelay(int msecs); - void setGamma(float); - - bool writeImage(const TQImage& img, int x, int y); - bool writeImage(const TQImage& img, int quality, int x, int y); - bool writeImage(const TQImage& img) - { return writeImage(img, 0, 0); } - bool writeImage(const TQImage& img, int quality) - { return writeImage(img, quality, 0, 0); } - - TQIODevice* device() { return dev; } - -private: - TQIODevice* dev; - int frames_written; - DisposalMethod disposal; - int looping; - int ms_delay; - float gamma; -}; - -class Q_PNGEXPORT TQPNGImagePacker : public TQPNGImageWriter { -public: - TQPNGImagePacker(TQIODevice*, int depth, int convflags); - - void setPixelAlignment(int x); - bool packImage(const TQImage& img); - -private: - TQImage previous; - int depth; - int convflags; - int alignx; -}; - -#endif // QT_NO_IMAGEIO_PNG - -#endif // TQPNGIO_H diff --git a/src/kernel/qpoint.cpp b/src/kernel/qpoint.cpp index 6e8359cf8..35fd3bc34 100644 --- a/src/kernel/qpoint.cpp +++ b/src/kernel/qpoint.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qpoint.h" -#include "qdatastream.h" +#include "ntqpoint.h" +#include "ntqdatastream.h" /*! - \class TQPoint qpoint.h + \class TQPoint ntqpoint.h \brief The TQPoint class defines a point in the plane. \ingroup images diff --git a/src/kernel/qpoint.h b/src/kernel/qpoint.h deleted file mode 100644 index cab2ee797..000000000 --- a/src/kernel/qpoint.h +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPoint class -** -** Created : 931028 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPOINT_H -#define TQPOINT_H - -#ifndef QT_H -#include "qwindowdefs.h" -#endif // QT_H - - -class Q_EXPORT TQPoint -{ -public: - TQPoint(); - TQPoint( int xpos, int ypos ); - - bool isNull() const; - - int x() const; - int y() const; - void setX( int x ); - void setY( int y ); - - int manhattanLength() const; - - TQCOORD &rx(); - TQCOORD &ry(); - - TQPoint &operator+=( const TQPoint &p ); - TQPoint &operator-=( const TQPoint &p ); - TQPoint &operator*=( int c ); - TQPoint &operator*=( double c ); - TQPoint &operator/=( int c ); - TQPoint &operator/=( double c ); - - friend inline bool operator==( const TQPoint &, const TQPoint & ); - friend inline bool operator!=( const TQPoint &, const TQPoint & ); - friend inline const TQPoint operator+( const TQPoint &, const TQPoint & ); - friend inline const TQPoint operator-( const TQPoint &, const TQPoint & ); - friend inline const TQPoint operator*( const TQPoint &, int ); - friend inline const TQPoint operator*( int, const TQPoint & ); - friend inline const TQPoint operator*( const TQPoint &, double ); - friend inline const TQPoint operator*( double, const TQPoint & ); - friend inline const TQPoint operator-( const TQPoint & ); - friend inline const TQPoint operator/( const TQPoint &, int ); - friend inline const TQPoint operator/( const TQPoint &, double ); - -private: - static void warningDivByZero(); - -#if defined(Q_OS_MAC) - TQCOORD yp; - TQCOORD xp; -#else - TQCOORD xp; - TQCOORD yp; -#endif -}; - - -/***************************************************************************** - TQPoint stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPoint & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPoint & ); -#endif - -/***************************************************************************** - TQPoint inline functions - *****************************************************************************/ - -inline TQPoint::TQPoint() -{ xp=0; yp=0; } - -inline TQPoint::TQPoint( int xpos, int ypos ) -{ xp=(TQCOORD)xpos; yp=(TQCOORD)ypos; } - -inline bool TQPoint::isNull() const -{ return xp == 0 && yp == 0; } - -inline int TQPoint::x() const -{ return xp; } - -inline int TQPoint::y() const -{ return yp; } - -inline void TQPoint::setX( int x ) -{ xp = (TQCOORD)x; } - -inline void TQPoint::setY( int y ) -{ yp = (TQCOORD)y; } - -inline TQCOORD &TQPoint::rx() -{ return xp; } - -inline TQCOORD &TQPoint::ry() -{ return yp; } - -inline TQPoint &TQPoint::operator+=( const TQPoint &p ) -{ xp+=p.xp; yp+=p.yp; return *this; } - -inline TQPoint &TQPoint::operator-=( const TQPoint &p ) -{ xp-=p.xp; yp-=p.yp; return *this; } - -inline TQPoint &TQPoint::operator*=( int c ) -{ xp*=(TQCOORD)c; yp*=(TQCOORD)c; return *this; } - -inline TQPoint &TQPoint::operator*=( double c ) -{ xp=(TQCOORD)(xp*c); yp=(TQCOORD)(yp*c); return *this; } - -inline bool operator==( const TQPoint &p1, const TQPoint &p2 ) -{ return p1.xp == p2.xp && p1.yp == p2.yp; } - -inline bool operator!=( const TQPoint &p1, const TQPoint &p2 ) -{ return p1.xp != p2.xp || p1.yp != p2.yp; } - -inline const TQPoint operator+( const TQPoint &p1, const TQPoint &p2 ) -{ return TQPoint(p1.xp+p2.xp, p1.yp+p2.yp); } - -inline const TQPoint operator-( const TQPoint &p1, const TQPoint &p2 ) -{ return TQPoint(p1.xp-p2.xp, p1.yp-p2.yp); } - -inline const TQPoint operator*( const TQPoint &p, int c ) -{ return TQPoint(p.xp*c, p.yp*c); } - -inline const TQPoint operator*( int c, const TQPoint &p ) -{ return TQPoint(p.xp*c, p.yp*c); } - -inline const TQPoint operator*( const TQPoint &p, double c ) -{ return TQPoint((TQCOORD)(p.xp*c), (TQCOORD)(p.yp*c)); } - -inline const TQPoint operator*( double c, const TQPoint &p ) -{ return TQPoint((TQCOORD)(p.xp*c), (TQCOORD)(p.yp*c)); } - -inline const TQPoint operator-( const TQPoint &p ) -{ return TQPoint(-p.xp, -p.yp); } - -inline TQPoint &TQPoint::operator/=( int c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0 ) - warningDivByZero(); -#endif - xp/=(TQCOORD)c; - yp/=(TQCOORD)c; - return *this; -} - -inline TQPoint &TQPoint::operator/=( double c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0.0 ) - warningDivByZero(); -#endif - xp=(TQCOORD)(xp/c); - yp=(TQCOORD)(yp/c); - return *this; -} - -inline const TQPoint operator/( const TQPoint &p, int c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0 ) - TQPoint::warningDivByZero(); -#endif - return TQPoint(p.xp/c, p.yp/c); -} - -inline const TQPoint operator/( const TQPoint &p, double c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0.0 ) - TQPoint::warningDivByZero(); -#endif - return TQPoint((TQCOORD)(p.xp/c), (TQCOORD)(p.yp/c)); -} - -#define Q_DEFINED_QPOINT -#include "qwinexport.h" -#endif // TQPOINT_H diff --git a/src/kernel/qpointarray.cpp b/src/kernel/qpointarray.cpp index 9df82efa0..3258a4415 100644 --- a/src/kernel/qpointarray.cpp +++ b/src/kernel/qpointarray.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qpointarray.h" -#include "qrect.h" -#include "qdatastream.h" -#include "qwmatrix.h" +#include "ntqpointarray.h" +#include "ntqrect.h" +#include "ntqdatastream.h" +#include "ntqwmatrix.h" #include const double Q_PI = 3.14159265358979323846; // pi // one more useful comment /*! - \class TQPointArray qpointarray.h + \class TQPointArray ntqpointarray.h \brief The TQPointArray class provides an array of points. \ingroup images diff --git a/src/kernel/qpointarray.h b/src/kernel/qpointarray.h deleted file mode 100644 index a78023b80..000000000 --- a/src/kernel/qpointarray.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPointArray class -** -** Created : 940213 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPOINTARRAY_H -#define TQPOINTARRAY_H - -#ifndef QT_H -#include "qmemarray.h" -#include "qpoint.h" -#endif // QT_H - - -#if defined(Q_TEMPLATEDLL) -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; -#endif - -class Q_EXPORT TQPointArray : public TQMemArray -{ -public: - TQPointArray() {} - ~TQPointArray() {} - TQPointArray( int size ) : TQMemArray( size ) {} - TQPointArray( const TQPointArray &a ) : TQMemArray( a ) {} - TQPointArray( const TQRect &r, bool closed=FALSE ); - TQPointArray( int nPoints, const TQCOORD *points ); - - TQPointArray &operator=( const TQPointArray &a ) - { return (TQPointArray&)assign( a ); } - - TQPointArray copy() const - { TQPointArray tmp; return *((TQPointArray*)&tmp.duplicate(*this)); } - - void translate( int dx, int dy ); - TQRect boundingRect() const; - - void point( uint i, int *x, int *y ) const; - TQPoint point( uint i ) const; - void setPoint( uint i, int x, int y ); - void setPoint( uint i, const TQPoint &p ); - bool setPoints( int nPoints, const TQCOORD *points ); - bool setPoints( int nPoints, int firstx, int firsty, ... ); - bool putPoints( int index, int nPoints, const TQCOORD *points ); - bool putPoints( int index, int nPoints, int firstx, int firsty, ... ); - bool putPoints( int index, int nPoints, - const TQPointArray & from, int fromIndex=0 ); - - void makeArc( int x, int y, int w, int h, int a1, int a2 ); - void makeEllipse( int x, int y, int w, int h ); - void makeArc( int x, int y, int w, int h, int a1, int a2, - const TQWMatrix& ); -#ifndef QT_NO_BEZIER - TQPointArray cubicBezier() const; -#endif - void* shortPoints( int index = 0, int nPoints = -1 ) const; - static void cleanBuffers(); - -protected: - static uint splen; - static void* sp; -}; - - -/***************************************************************************** - TQPointArray stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPointArray & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQPointArray & ); -#endif - -/***************************************************************************** - Misc. TQPointArray functions - *****************************************************************************/ - -inline void TQPointArray::setPoint( uint i, const TQPoint &p ) -{ - setPoint( i, p.x(), p.y() ); -} - - -#endif // TQPOINTARRAY_H diff --git a/src/kernel/qpolygonscanner.cpp b/src/kernel/qpolygonscanner.cpp index ace53d29d..92f36f3e6 100644 --- a/src/kernel/qpolygonscanner.cpp +++ b/src/kernel/qpolygonscanner.cpp @@ -38,8 +38,8 @@ ** **********************************************************************/ -#include "qpolygonscanner.h" -#include "qpointarray.h" +#include "ntqpolygonscanner.h" +#include "ntqpointarray.h" #include diff --git a/src/kernel/qpolygonscanner.h b/src/kernel/qpolygonscanner.h deleted file mode 100644 index be6369891..000000000 --- a/src/kernel/qpolygonscanner.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPolygonScanner class -** -** Created : 000120 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPOLYGONSCANNER_H -#define TQPOLYGONSCANNER_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -class TQPointArray; -class TQPoint; - -class Q_EXPORT TQPolygonScanner { -public: - // BIC: fix for 3.0 - void scan( const TQPointArray& pa, bool winding, int index=0, int npoints=-1 ); - void scan( const TQPointArray& pa, bool winding, int index, int npoints, bool stitchable ); - enum Edge { Left=1, Right=2, Top=4, Bottom=8 }; - void scan( const TQPointArray& pa, bool winding, int index, int npoints, Edge edges ); - virtual void processSpans( int n, TQPoint* point, int* width )=0; -}; - -#endif // TQPOLYGONSCANNER_H diff --git a/src/kernel/qprinter.cpp b/src/kernel/qprinter.cpp index a4d64a0d6..3dd79b99c 100644 --- a/src/kernel/qprinter.cpp +++ b/src/kernel/qprinter.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qprinter.h" +#include "ntqprinter.h" #include "qprinter_p.h" #ifndef QT_NO_PRINTER /*! - \class TQPrinter qprinter.h + \class TQPrinter ntqprinter.h \brief The TQPrinter class is a paint device that paints on a printer. \ingroup images diff --git a/src/kernel/qprinter.h b/src/kernel/qprinter.h deleted file mode 100644 index b08b97cb5..000000000 --- a/src/kernel/qprinter.h +++ /dev/null @@ -1,284 +0,0 @@ -/********************************************************************** -** -** Definition of TQPrinter class -** -** Created : 940927 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPRINTER_H -#define TQPRINTER_H - -#ifndef QT_H -#include "qpaintdevice.h" -#include "qstring.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_PRINTER - -#if defined(B0) -#undef B0 // Terminal hang-up. We assume that you do not want that. -#endif - -class TQPrinterPrivate; - -class Q_EXPORT TQPrinter : public TQPaintDevice -{ -public: - enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution, Compatible }; - - TQPrinter( PrinterMode mode = ScreenResolution ); - ~TQPrinter(); - - 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 = Custom }; - - 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 ); -#ifdef Q_WS_WIN - void setWinPageSize( short winPageSize ); - short winPageSize() const; -#endif -#ifdef Q_WS_MAC - bool printSetup(); - bool pageSetup(); -#endif - 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 top, uint left, uint bottom, uint right ); - void margins( uint *top, uint *left, uint *bottom, uint *right ) const; - - int fromPage() const; - int toPage() const; - virtual void setFromTo( int fromPage, int toPage ); - int minPage() const; - int maxPage() const; - virtual void setMinMax( int minPage, int maxPage ); - 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 range ); - - bool newPage(); - bool abort(); - bool aborted() const; - - bool setup( TQWidget *parent = 0 ); - - PaperSource paperSource() const; - virtual void setPaperSource( PaperSource ); - - void setOptionEnabled( PrinterOption, bool enable ); - bool isOptionEnabled( PrinterOption ); - -protected: - bool cmd( int, TQPainter *, TQPDevCmdParam * ); - int metric( int ) const; - -#if defined(Q_WS_WIN) - virtual void setActive(); - virtual void setIdle(); -#endif - -private: -#if defined(Q_WS_X11) || defined(Q_WS_QWS) - TQPaintDevice *pdrv; - int pid; -#endif -#if defined(Q_WS_MAC) - friend class TQPrinterPrivate; - PMPageFormat pformat; - PMPrintSettings psettings; - PMPrintSession psession; - bool prepare(PMPrintSettings *); - bool prepare(PMPageFormat *); - void interpret(PMPrintSettings *); - void interpret(PMPageFormat *); -#endif -#if defined(Q_WS_WIN) - void readPdlg( void* ); - void readPdlgA( void* ); - void writeDevmode( TQt::HANDLE ); - void writeDevmodeA( TQt::HANDLE ); - void reinit(); - - bool viewOffsetDone; - TQPainter* painter; - TQt::HANDLE hdevmode; - TQt::HANDLE hdevnames; -#endif - - int state; - TQString printer_name; - TQString option_string; - TQString output_filename; - bool output_file; - TQString print_prog; - TQString doc_name; - TQString creator_name; - - PageSize page_size; - PaperSource paper_source; - PageOrder page_order; - ColorMode color_mode; - Orientation orient; - uint to_edge : 1; - uint appcolcopies : 1; - uint usercolcopies : 1; - uint res_set : 1; - short from_pg, to_pg; - short min_pg, max_pg; - short ncopies; - int res; - TQPrinterPrivate *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPrinter( const TQPrinter & ); - TQPrinter &operator=( const TQPrinter & ); -#endif -}; - - -inline TQString TQPrinter::printerName() const -{ return printer_name; } - -inline bool TQPrinter::outputToFile() const -{ return output_file; } - -inline TQString TQPrinter::outputFileName() const -{ return output_filename; } - -inline TQString TQPrinter::printProgram() const -{ return print_prog; } - -inline TQString TQPrinter::docName() const -{ return doc_name; } - -inline TQString TQPrinter::creator() const -{ return creator_name; } - -inline TQPrinter::PageSize TQPrinter::pageSize() const -{ return page_size; } - -inline TQPrinter::Orientation TQPrinter::orientation() const -{ return orient; } - -inline int TQPrinter::fromPage() const -{ return from_pg; } - -inline int TQPrinter::toPage() const -{ return to_pg; } - -inline int TQPrinter::minPage() const -{ return min_pg; } - -inline int TQPrinter::maxPage() const -{ return max_pg; } - -inline int TQPrinter::numCopies() const -{ return ncopies; } - -inline bool TQPrinter::collateCopiesEnabled() const -{ return appcolcopies; } - -inline void TQPrinter::setCollateCopiesEnabled(bool v) -{ appcolcopies = v; } - -inline bool TQPrinter::collateCopies() const -{ return usercolcopies; } - - -#endif // QT_NO_PRINTER - -#endif // TQPRINTER_H diff --git a/src/kernel/qprinter_p.h b/src/kernel/qprinter_p.h index 42caeade0..17d528985 100644 --- a/src/kernel/qprinter_p.h +++ b/src/kernel/qprinter_p.h @@ -43,9 +43,9 @@ #ifndef QT_NO_PRINTER #ifndef QT_H -#include -#include -#include +#include +#include +#include #endif // QT_H class TQPrinterPrivate diff --git a/src/kernel/qprinter_unix.cpp b/src/kernel/qprinter_unix.cpp index 9c24c8fce..bbe30a850 100644 --- a/src/kernel/qprinter_unix.cpp +++ b/src/kernel/qprinter_unix.cpp @@ -47,14 +47,14 @@ static inline int qt_open(const char *pathname, int flags, mode_t mode) # undef open #endif -#include "qprinter.h" +#include "ntqprinter.h" #ifndef QT_NO_PRINTER -#include "qpaintdevicemetrics.h" +#include "ntqpaintdevicemetrics.h" #include "qpsprinter_p.h" -#include "qprintdialog.h" -#include "qapplication.h" +#include "ntqprintdialog.h" +#include "ntqapplication.h" #include "qprinter_p.h" #include // For ::sleep() diff --git a/src/kernel/qprocess.cpp b/src/kernel/qprocess.cpp index 59dc27abe..64262960a 100644 --- a/src/kernel/qprocess.cpp +++ b/src/kernel/qprocess.cpp @@ -41,11 +41,11 @@ #include #include -#include "qprocess.h" +#include "ntqprocess.h" #ifndef QT_NO_PROCESS -#include "qapplication.h" +#include "ntqapplication.h" #include "private/qinternal_p.h" @@ -53,7 +53,7 @@ /*! - \class TQProcess qprocess.h + \class TQProcess ntqprocess.h \brief The TQProcess class is used to start external programs and to communicate with them. diff --git a/src/kernel/qprocess.h b/src/kernel/qprocess.h deleted file mode 100644 index 9a710df76..000000000 --- a/src/kernel/qprocess.h +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQProcess class -** -** Created : 20000905 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPROCESS_H -#define TQPROCESS_H - -#ifndef QT_H -#include "qobject.h" -#include "qstringlist.h" -#include "qdir.h" -#endif // QT_H - -#ifndef QT_NO_PROCESS - -class TQProcessPrivate; -class TQMembuf; - - -class Q_EXPORT TQProcess : public TQObject -{ - Q_OBJECT -public: - TQProcess( TQObject *parent=0, const char *name=0 ); - TQProcess( const TQString& arg0, TQObject *parent=0, const char *name=0 ); - TQProcess( const TQStringList& args, TQObject *parent=0, const char *name=0 ); - ~TQProcess(); - - // set and get the arguments and working directory - TQStringList arguments() const; - void clearArguments(); - virtual void setArguments( const TQStringList& args ); - virtual void addArgument( const TQString& arg ); -#ifndef QT_NO_DIR - TQDir workingDirectory() const; - virtual void setWorkingDirectory( const TQDir& dir ); -#endif - - // set and get the comms wanted - enum Communication { Stdin=0x01, Stdout=0x02, Stderr=0x04, DupStderr=0x08 }; - void setCommunication( int c ); - int communication() const; - - // start the execution - virtual bool start( TQStringList *env=0 ); - virtual bool launch( const TQString& buf, TQStringList *env=0 ); - virtual bool launch( const TQByteArray& buf, TQStringList *env=0 ); - - // intquire the status - bool isRunning() const; - bool normalExit() const; - int exitStatus() const; - - // reading - virtual TQByteArray readStdout(); - virtual TQByteArray readStderr(); - bool canReadLineStdout() const; - bool canReadLineStderr() const; - virtual TQString readLineStdout(); - virtual TQString readLineStderr(); - - // get platform dependent process information -#if defined(Q_OS_WIN32) - typedef void* PID; -#else - typedef Q_LONG PID; -#endif - PID processIdentifier(); - - void flushStdin(); - -signals: - void readyReadStdout(); - void readyReadStderr(); - void processExited(); - void wroteToStdin(); - void launchFinished(); - -public slots: - // end the execution - void tryTerminate() const; - void kill() const; - - // input - virtual void writeToStdin( const TQByteArray& buf ); - virtual void writeToStdin( const TQString& buf ); - virtual void closeStdin(); - -protected: // ### or private? - void connectNotify( const char * signal ); - void disconnectNotify( const char * signal ); -private: - void setIoRedirection( bool value ); - void setNotifyOnExit( bool value ); - void setWroteStdinConnected( bool value ); - - void init(); - void reset(); -#if defined(Q_OS_WIN32) - uint readStddev( HANDLE dev, char *buf, uint bytes ); -#endif - TQMembuf* membufStdout(); - TQMembuf* membufStderr(); - -private slots: - void socketRead( int fd ); - void socketWrite( int fd ); - void timeout(); - void closeStdinLaunch(); - -private: - TQProcessPrivate *d; -#ifndef QT_NO_DIR - TQDir workingDir; -#endif - TQStringList _arguments; - - int exitStat; // exit status - bool exitNormal; // normal exit? - bool ioRedirection; // automatically set be (dis)connectNotify - bool notifyOnExit; // automatically set be (dis)connectNotify - bool wroteToStdinConnected; // automatically set be (dis)connectNotify - - bool readStdoutCalled; - bool readStderrCalled; - int comms; - - friend class TQProcessPrivate; -#if defined(Q_OS_UNIX) - friend class TQProcessManager; - friend class TQProc; -#endif - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQProcess( const TQProcess & ); - TQProcess &operator=( const TQProcess & ); -#endif -}; - -#endif // QT_NO_PROCESS - -#endif // TQPROCESS_H diff --git a/src/kernel/qprocess_unix.cpp b/src/kernel/qprocess_unix.cpp index 57bb56f5d..1c2e0b9f5 100644 --- a/src/kernel/qprocess_unix.cpp +++ b/src/kernel/qprocess_unix.cpp @@ -45,17 +45,17 @@ #undef connect #endif -#include "qprocess.h" +#include "ntqprocess.h" #ifndef QT_NO_PROCESS -#include "qapplication.h" -#include "qptrqueue.h" -#include "qptrlist.h" -#include "qsocketnotifier.h" -#include "qtimer.h" -#include "qcleanuphandler.h" -#include "qregexp.h" +#include "ntqapplication.h" +#include "ntqptrqueue.h" +#include "ntqptrlist.h" +#include "ntqsocketnotifier.h" +#include "ntqtimer.h" +#include "ntqcleanuphandler.h" +#include "ntqregexp.h" #include "private/qinternal_p.h" #include diff --git a/src/kernel/qpsprinter.cpp b/src/kernel/qpsprinter.cpp index 0fc94ad24..f52b43710 100644 --- a/src/kernel/qpsprinter.cpp +++ b/src/kernel/qpsprinter.cpp @@ -56,23 +56,23 @@ #undef Q_PRINTER_USE_TYPE42 -#include "qpainter.h" -#include "qapplication.h" -#include "qpaintdevicemetrics.h" -#include "qimage.h" -#include "qdatetime.h" -#include "qstring.h" -#include "qdict.h" -#include "qmemarray.h" -#include "qfile.h" -#include "qbuffer.h" -#include "qintdict.h" -#include "qtextcodec.h" -#include "qsettings.h" -#include "qmap.h" -#include "qfontdatabase.h" -#include "qregexp.h" -#include "qbitmap.h" +#include "ntqpainter.h" +#include "ntqapplication.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqimage.h" +#include "ntqdatetime.h" +#include "ntqstring.h" +#include "ntqdict.h" +#include "ntqmemarray.h" +#include "ntqfile.h" +#include "ntqbuffer.h" +#include "ntqintdict.h" +#include "ntqtextcodec.h" +#include "ntqsettings.h" +#include "ntqmap.h" +#include "ntqfontdatabase.h" +#include "ntqregexp.h" +#include "ntqbitmap.h" #include #if defined(Q_OS_WIN32) @@ -5355,7 +5355,7 @@ static void emitBits( char *out, int & byte, int & bit, //#define DEBUG_COMPRESS #ifdef DEBUG_COMPRESS -#include +#include #endif static TQByteArray compress( const TQImage & image, bool gray ) { diff --git a/src/kernel/qpsprinter_p.h b/src/kernel/qpsprinter_p.h index e560b95fa..070f43207 100644 --- a/src/kernel/qpsprinter_p.h +++ b/src/kernel/qpsprinter_p.h @@ -58,8 +58,8 @@ #ifndef QT_H -#include "qprinter.h" -#include "qtextstream.h" +#include "ntqprinter.h" +#include "ntqtextstream.h" #endif // QT_H #ifndef QT_NO_PRINTER diff --git a/src/kernel/qrect.cpp b/src/kernel/qrect.cpp index 17197aa33..3a8bd2fb6 100644 --- a/src/kernel/qrect.cpp +++ b/src/kernel/qrect.cpp @@ -39,8 +39,8 @@ **********************************************************************/ #define TQRECT_C -#include "qrect.h" -#include "qdatastream.h" +#include "ntqrect.h" +#include "ntqdatastream.h" /*! \class TQRect @@ -54,7 +54,7 @@ a bottom-right corner, but it is normally expressed as an upper-left corner and a size. - The coordinate type is TQCOORD (defined in \c qwindowdefs.h as \c + The coordinate type is TQCOORD (defined in \c ntqwindowdefs.h as \c int). The minimum value of TQCOORD is TQCOORD_MIN (-2147483648) and the maximum value is TQCOORD_MAX (2147483647). diff --git a/src/kernel/qrect.h b/src/kernel/qrect.h deleted file mode 100644 index b1ab9090e..000000000 --- a/src/kernel/qrect.h +++ /dev/null @@ -1,276 +0,0 @@ -/**************************************************************************** -** -** Definition of TQRect class -** -** Created : 931028 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQRECT_H -#define TQRECT_H - -#ifndef QT_H -#include "qsize.h" -#endif // QT_H - -#if defined(topLeft) -#error "Macro definition of topLeft conflicts with TQRect" -// don't just silently undo people's defines: #undef topLeft -#endif - -class Q_EXPORT TQRect // rectangle class -{ -public: - TQRect() { x1 = y1 = 0; x2 = y2 = -1; } - TQRect( const TQPoint &topleft, const TQPoint &bottomright ); - TQRect( const TQPoint &topleft, const TQSize &size ); - TQRect( int left, int top, int width, int height ); - - 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 pos ); - void setTop( int pos ); - void setRight( int pos ); - void setBottom( int pos ); - void setX( int x ); - void setY( int y ); - - void setTopLeft( const TQPoint &p ); - void setBottomRight( const TQPoint &p ); - void setTopRight( const TQPoint &p ); - void setBottomLeft( const TQPoint &p ); - - TQPoint topLeft() const; - TQPoint bottomRight() const; - TQPoint topRight() const; - TQPoint bottomLeft() const; - TQPoint center() const; - - void rect( int *x, int *y, int *w, int *h ) const; - void coords( int *x1, int *y1, int *x2, int *y2 ) const; - - void moveLeft( int pos ); - void moveTop( int pos ); - void moveRight( int pos ); - void moveBottom( int pos ); - void moveTopLeft( const TQPoint &p ); - void moveBottomRight( const TQPoint &p ); - void moveTopRight( const TQPoint &p ); - void moveBottomLeft( const TQPoint &p ); - void moveCenter( const TQPoint &p ); - void moveBy( int dx, int dy ); - - void setRect( int x, int y, int w, int h ); - void setCoords( int x1, int y1, int x2, int y2 ); - void addCoords( int x1, int y1, int x2, int y2 ); - - TQSize size() const; - int width() const; - int height() const; - void setWidth( int w ); - void setHeight( int h ); - void setSize( const TQSize &s ); - - TQRect operator|(const TQRect &r) const; - TQRect operator&(const TQRect &r) const; - TQRect& operator|=(const TQRect &r); - TQRect& operator&=(const TQRect &r); - - bool contains( const TQPoint &p, bool proper=FALSE ) const; - bool contains( int x, int y ) const; // inline methods, _don't_ merge these - bool contains( int x, int y, bool proper ) const; - bool contains( const TQRect &r, bool proper=FALSE ) const; - TQRect unite( const TQRect &r ) const; - TQRect intersect( const TQRect &r ) const; - bool intersects( const TQRect &r ) const; - - friend Q_EXPORT bool operator==( const TQRect &, const TQRect & ); - friend Q_EXPORT bool operator!=( const TQRect &, const TQRect & ); - -private: -#if defined(Q_WS_X11) || defined(Q_OS_TEMP) - friend void qt_setCoords( TQRect *r, int xp1, int yp1, int xp2, int yp2 ); -#endif -#if defined(Q_OS_MAC) - TQCOORD y1; - TQCOORD x1; - TQCOORD y2; - TQCOORD x2; -#else - TQCOORD x1; - TQCOORD y1; - TQCOORD x2; - TQCOORD y2; -#endif -}; - -Q_EXPORT bool operator==( const TQRect &, const TQRect & ); -Q_EXPORT bool operator!=( const TQRect &, const TQRect & ); - - -/***************************************************************************** - TQRect stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQRect & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQRect & ); -#endif - -/***************************************************************************** - TQRect inline member functions - *****************************************************************************/ - -inline TQRect::TQRect( int left, int top, int width, int height ) -{ - x1 = (TQCOORD)left; - y1 = (TQCOORD)top; - x2 = (TQCOORD)(left+width-1); - y2 = (TQCOORD)(top+height-1); -} - -inline bool TQRect::isNull() const -{ return x2 == x1-1 && y2 == y1-1; } - -inline bool TQRect::isEmpty() const -{ return x1 > x2 || y1 > y2; } - -inline bool TQRect::isValid() const -{ return x1 <= x2 && y1 <= y2; } - -inline int TQRect::left() const -{ return x1; } - -inline int TQRect::top() const -{ return y1; } - -inline int TQRect::right() const -{ return x2; } - -inline int TQRect::bottom() const -{ return y2; } - -inline TQCOORD &TQRect::rLeft() -{ return x1; } - -inline TQCOORD & TQRect::rTop() -{ return y1; } - -inline TQCOORD & TQRect::rRight() -{ return x2; } - -inline TQCOORD & TQRect::rBottom() -{ return y2; } - -inline int TQRect::x() const -{ return x1; } - -inline int TQRect::y() const -{ return y1; } - -inline void TQRect::setLeft( int pos ) -{ x1 = (TQCOORD)pos; } - -inline void TQRect::setTop( int pos ) -{ y1 = (TQCOORD)pos; } - -inline void TQRect::setRight( int pos ) -{ x2 = (TQCOORD)pos; } - -inline void TQRect::setBottom( int pos ) -{ y2 = (TQCOORD)pos; } - -inline void TQRect::setX( int x ) -{ x1 = (TQCOORD)x; } - -inline void TQRect::setY( int y ) -{ y1 = (TQCOORD)y; } - -inline TQPoint TQRect::topLeft() const -{ return TQPoint(x1, y1); } - -inline TQPoint TQRect::bottomRight() const -{ return TQPoint(x2, y2); } - -inline TQPoint TQRect::topRight() const -{ return TQPoint(x2, y1); } - -inline TQPoint TQRect::bottomLeft() const -{ return TQPoint(x1, y2); } - -inline TQPoint TQRect::center() const -{ return TQPoint((x1+x2)/2, (y1+y2)/2); } - -inline int TQRect::width() const -{ return x2 - x1 + 1; } - -inline int TQRect::height() const -{ return y2 - y1 + 1; } - -inline TQSize TQRect::size() const -{ return TQSize(x2-x1+1, y2-y1+1); } - -inline bool TQRect::contains( int x, int y, bool proper ) const -{ - if ( proper ) - return x > x1 && x < x2 && - y > y1 && y < y2; - else - return x >= x1 && x <= x2 && - y >= y1 && y <= y2; -} - -inline bool TQRect::contains( int x, int y ) const -{ - return x >= x1 && x <= x2 && - y >= y1 && y <= y2; -} -#define Q_DEFINED_QRECT -#include "qwinexport.h" -#endif // TQRECT_H diff --git a/src/kernel/qregion.cpp b/src/kernel/qregion.cpp index af15d565f..6537b74ce 100644 --- a/src/kernel/qregion.cpp +++ b/src/kernel/qregion.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qregion.h" -#include "qpointarray.h" -#include "qbuffer.h" -#include "qdatastream.h" +#include "ntqregion.h" +#include "ntqpointarray.h" +#include "ntqbuffer.h" +#include "ntqdatastream.h" // BEING REVISED: paul /*! - \class TQRegion qregion.h + \class TQRegion ntqregion.h \brief The TQRegion class specifies a clip region for a painter. \ingroup images diff --git a/src/kernel/qregion.h b/src/kernel/qregion.h deleted file mode 100644 index 9b6557cbe..000000000 --- a/src/kernel/qregion.h +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** -** -** Definition of TQRegion class -** -** Created : 940514 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQREGION_H -#define TQREGION_H - -#ifndef QT_H -#include "qshared.h" -#include "qrect.h" -#endif // QT_H - -#ifdef Q_WS_X11 -struct TQRegionPrivate; -#endif - -class Q_EXPORT TQRegion -{ -public: - enum RegionType { Rectangle, Ellipse }; - - TQRegion(); - TQRegion( int x, int y, int w, int h, RegionType = Rectangle ); - TQRegion( const TQRect &, RegionType = Rectangle ); - TQRegion( const TQPointArray &, bool winding=FALSE ); - TQRegion( const TQRegion & ); - TQRegion( const TQBitmap & ); - ~TQRegion(); - TQRegion &operator=( const TQRegion & ); - - bool isNull() const; - bool isEmpty() const; - - bool contains( const TQPoint &p ) const; - bool contains( const TQRect &r ) const; - - void translate( int dx, int dy ); - - 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 & ); - - bool operator==( const TQRegion & ) const; - bool operator!=( const TQRegion &r ) const - { return !(operator==(r)); } - -#if defined(Q_WS_WIN) - HRGN handle() const { return data->rgn; } -#elif defined(Q_WS_X11) - Region handle() const { if(!data->rgn) updateX11Region(); return data->rgn; } -#elif defined(Q_WS_MAC) - RgnHandle handle(bool require_rgn=FALSE) const; -#elif defined(Q_WS_QWS) - // TQGfx_QWS needs this for region drawing - void * handle() const { return data->rgn; } -#endif - -#ifndef QT_NO_DATASTREAM - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQRegion & ); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQRegion & ); -#endif -private: - TQRegion( bool ); - TQRegion copy() const; - void detach(); -#if defined(Q_WS_WIN) - TQRegion winCombine( const TQRegion &, int ) const; -#endif -#if defined(Q_WS_X11) - void updateX11Region() const; - void *clipRectangles( int &num ) const; - friend void *qt_getClipRects( const TQRegion &, int & ); -#endif - void exec( const TQByteArray &, int ver = 0 ); - struct TQRegionData : public TQShared { -#if defined(Q_WS_WIN) - HRGN rgn; -#elif defined(Q_WS_X11) - Region rgn; - void *xrectangles; - TQRegionPrivate *region; -#elif defined(Q_WS_MAC) - uint is_rect:1; - TQRect rect; - RgnHandle rgn; -#elif defined(Q_WS_QWS) - void * rgn; -#endif - bool is_null; - } *data; -#if defined(Q_WS_MAC) - friend struct qt_mac_rgn_data_cache; - friend TQRegionData *qt_mac_get_rgn_data(); - friend void qt_mac_free_rgn_data(TQRegionData *); - void rectifyRegion(); -#elif defined(Q_WS_WIN) - friend class TQETWidget; -#endif - -}; - - -#define TQRGN_SETRECT 1 // region stream commands -#define TQRGN_SETELLIPSE 2 // (these are internal) -#define TQRGN_SETPTARRAY_ALT 3 -#define TQRGN_SETPTARRAY_WIND 4 -#define TQRGN_TRANSLATE 5 -#define TQRGN_OR 6 -#define TQRGN_AND 7 -#define TQRGN_SUB 8 -#define TQRGN_XOR 9 -#define TQRGN_RECTS 10 - - -/***************************************************************************** - TQRegion stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQRegion & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQRegion & ); -#endif - - -#endif // TQREGION_H diff --git a/src/kernel/qregion_x11.cpp b/src/kernel/qregion_x11.cpp index 78155fecc..2094a00c7 100644 --- a/src/kernel/qregion_x11.cpp +++ b/src/kernel/qregion_x11.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qregion.h" -#include "qpointarray.h" -#include "qbuffer.h" -#include "qimage.h" -#include "qbitmap.h" +#include "ntqregion.h" +#include "ntqpointarray.h" +#include "ntqbuffer.h" +#include "ntqimage.h" +#include "ntqbitmap.h" #include "qt_x11_p.h" #include diff --git a/src/kernel/qrichtext.cpp b/src/kernel/qrichtext.cpp index e572fb8f8..783b89188 100644 --- a/src/kernel/qrichtext.cpp +++ b/src/kernel/qrichtext.cpp @@ -43,25 +43,25 @@ #ifndef QT_NO_RICHTEXT -#include "qstringlist.h" -#include "qfont.h" -#include "qtextstream.h" -#include "qfile.h" -#include "qapplication.h" -#include "qmap.h" -#include "qfileinfo.h" -#include "qstylesheet.h" -#include "qmime.h" -#include "qimage.h" -#include "qdragobject.h" -#include "qpaintdevicemetrics.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qcursor.h" -#include "qptrstack.h" -#include "qptrdict.h" -#include "qstyle.h" -#include "qcleanuphandler.h" +#include "ntqstringlist.h" +#include "ntqfont.h" +#include "ntqtextstream.h" +#include "ntqfile.h" +#include "ntqapplication.h" +#include "ntqmap.h" +#include "ntqfileinfo.h" +#include "ntqstylesheet.h" +#include "ntqmime.h" +#include "ntqimage.h" +#include "ntqdragobject.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqcursor.h" +#include "ntqptrstack.h" +#include "ntqptrdict.h" +#include "ntqstyle.h" +#include "ntqcleanuphandler.h" #include "qtextengine_p.h" #include @@ -6694,8 +6694,8 @@ void TQTextImage::adjustToPainter( TQPainter* p ) } #if !defined(Q_WS_X11) -#include -#include +#include +#include static TQPixmap *qrt_selection = 0; static TQSingleCleanupHandler qrt_cleanup_pixmap; static void qrt_createSelectionPixmap( const TQColorGroup &cg ) diff --git a/src/kernel/qrichtext_p.h b/src/kernel/qrichtext_p.h index 2d7844382..7c5453b55 100644 --- a/src/kernel/qrichtext_p.h +++ b/src/kernel/qrichtext_p.h @@ -54,27 +54,27 @@ // #ifndef QT_H -#include "qstring.h" -#include "qptrlist.h" -#include "qrect.h" -#include "qfontmetrics.h" -#include "qintdict.h" -#include "qmap.h" -#include "qstringlist.h" -#include "qfont.h" -#include "qcolor.h" -#include "qsize.h" -#include "qvaluelist.h" -#include "qvaluestack.h" -#include "qobject.h" -#include "qdict.h" -#include "qpixmap.h" -#include "qstylesheet.h" -#include "qptrvector.h" -#include "qpainter.h" -#include "qlayout.h" -#include "qobject.h" -#include "qapplication.h" +#include "ntqstring.h" +#include "ntqptrlist.h" +#include "ntqrect.h" +#include "ntqfontmetrics.h" +#include "ntqintdict.h" +#include "ntqmap.h" +#include "ntqstringlist.h" +#include "ntqfont.h" +#include "ntqcolor.h" +#include "ntqsize.h" +#include "ntqvaluelist.h" +#include "ntqvaluestack.h" +#include "ntqobject.h" +#include "ntqdict.h" +#include "ntqpixmap.h" +#include "ntqstylesheet.h" +#include "ntqptrvector.h" +#include "ntqpainter.h" +#include "ntqlayout.h" +#include "ntqobject.h" +#include "ntqapplication.h" #endif // QT_H #ifndef QT_NO_RICHTEXT diff --git a/src/kernel/qscriptengine.cpp b/src/kernel/qscriptengine.cpp index 6967f4847..ab6bd2f36 100644 --- a/src/kernel/qscriptengine.cpp +++ b/src/kernel/qscriptengine.cpp @@ -36,9 +36,9 @@ #include "qscriptengine_p.h" -#include "qstring.h" -#include "qrect.h" -#include "qfont.h" +#include "ntqstring.h" +#include "ntqrect.h" +#include "ntqfont.h" #include #include "qtextengine_p.h" #include "qfontengine_p.h" diff --git a/src/kernel/qscriptengine_x11.cpp b/src/kernel/qscriptengine_x11.cpp index 5bbbfdc3b..06523b700 100644 --- a/src/kernel/qscriptengine_x11.cpp +++ b/src/kernel/qscriptengine_x11.cpp @@ -1899,8 +1899,8 @@ static void indic_attributes(int script, const TQString &text, int from, int len // // -------------------------------------------------------------------------------------------------------------------------------------------- -#include -#include +#include +#include static void thaiWordBreaks(const TQChar *string, const int len, TQCharAttributes *attributes) diff --git a/src/kernel/qsession.h b/src/kernel/qsession.h deleted file mode 100644 index 36fd657b8..000000000 --- a/src/kernel/qsession.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSession class -** -** Created : 990510 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSESSION_H -#define TQSESSION_H - -#ifndef QT_H -#endif // QT_H - -#endif diff --git a/src/kernel/qsessionmanager.h b/src/kernel/qsessionmanager.h deleted file mode 100644 index 865a13262..000000000 --- a/src/kernel/qsessionmanager.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSessionManager class -** -** Created : 990510 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSESSIONMANAGER_H -#define TQSESSIONMANAGER_H - -#ifndef QT_H -#include "qobject.h" -#include "qwindowdefs.h" -#include "qstring.h" -#include "qstringlist.h" -#endif // QT_H -#ifndef QT_NO_SESSIONMANAGER - -class TQSessionManagerData; - -class Q_EXPORT TQSessionManager : public TQObject -{ - Q_OBJECT - TQSessionManager( TQApplication *app, TQString &id, TQString &key ); - ~TQSessionManager(); -public: - TQString sessionId() const; - TQString sessionKey() const; -#if defined(Q_WS_X11) || defined(Q_WS_MAC) - void* handle() const; -#endif - - 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& name, const TQString& value ); - void setManagerProperty( const TQString& name, const TQStringList& value ); - - bool isPhase2() const; - void requestPhase2(); - -private: - friend class TQApplication; - friend class TQBaseApplication; - TQSessionManagerData* d; -}; - -#endif // QT_NO_SESSIONMANAGER -#endif // TQSESSIONMANAGER_H diff --git a/src/kernel/qsharedmemory_p.h b/src/kernel/qsharedmemory_p.h index 00f190a2b..30cd171ee 100644 --- a/src/kernel/qsharedmemory_p.h +++ b/src/kernel/qsharedmemory_p.h @@ -52,7 +52,7 @@ // #ifndef QT_H -#include "qstring.h" +#include "ntqstring.h" #endif // QT_H #if !defined (QT_QWS_NO_SHM) diff --git a/src/kernel/qsignal.cpp b/src/kernel/qsignal.cpp index 5e6f2a48d..acc74829f 100644 --- a/src/kernel/qsignal.cpp +++ b/src/kernel/qsignal.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qsignal.h" -#include "qmetaobject.h" -#include "qguardedptr.h" +#include "ntqsignal.h" +#include "ntqmetaobject.h" +#include "ntqguardedptr.h" /*! - \class TQSignal qsignal.h + \class TQSignal ntqsignal.h \brief The TQSignal class can be used to send signals for classes that don't inherit TQObject. @@ -67,7 +67,7 @@ Example: \code - #include + #include class MyClass { diff --git a/src/kernel/qsignal.h b/src/kernel/qsignal.h deleted file mode 100644 index d5b4cd7e7..000000000 --- a/src/kernel/qsignal.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSignal class -** -** Created : 941201 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIGNAL_H -#define TQSIGNAL_H - -#ifndef QT_H -#include "qvariant.h" -#include "qobject.h" -#endif // QT_H - - -class Q_EXPORT TQSignal : public TQObject -{ - Q_OBJECT - -public: - TQSignal( TQObject *parent=0, const char *name=0 ); - ~TQSignal(); - - bool connect( const TQObject *receiver, const char *member ); - bool disconnect( const TQObject *receiver, const char *member=0 ); - - void activate(); - -#ifndef QT_NO_COMPAT - bool isBlocked() const { return TQObject::signalsBlocked(); } - void block( bool b ) { TQObject::blockSignals( b ); } -#ifndef QT_NO_VARIANT - void setParameter( int value ); - int parameter() const; -#endif -#endif - -#ifndef QT_NO_VARIANT - void setValue( const TQVariant &value ); - TQVariant value() const; -#endif -signals: -#ifndef QT_NO_VARIANT - void signal( const TQVariant& ); -#endif - void intSignal( int ); - -private: -#ifndef QT_NO_VARIANT - TQVariant val; -#endif -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSignal( const TQSignal & ); - TQSignal &operator=( const TQSignal & ); -#endif -}; - - -#endif // TQSIGNAL_H diff --git a/src/kernel/qsignalmapper.cpp b/src/kernel/qsignalmapper.cpp index fda65b054..0e23de826 100644 --- a/src/kernel/qsignalmapper.cpp +++ b/src/kernel/qsignalmapper.cpp @@ -38,9 +38,9 @@ ** **********************************************************************/ -#include "qsignalmapper.h" +#include "ntqsignalmapper.h" #ifndef QT_NO_SIGNALMAPPER -#include "qptrdict.h" +#include "ntqptrdict.h" struct TQSignalMapperRec { TQSignalMapperRec() @@ -67,7 +67,7 @@ public: }; /*! - \class TQSignalMapper qsignalmapper.h + \class TQSignalMapper ntqsignalmapper.h \brief The TQSignalMapper class bundles signals from identifiable senders. \ingroup io diff --git a/src/kernel/qsignalmapper.h b/src/kernel/qsignalmapper.h deleted file mode 100644 index 1ad42890b..000000000 --- a/src/kernel/qsignalmapper.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSignalMapper class -** -** Created : 980503 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIGNALMAPPER_H -#define TQSIGNALMAPPER_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H -#ifndef QT_NO_SIGNALMAPPER -class TQSignalMapperData; -struct TQSignalMapperRec; - - -class Q_EXPORT TQSignalMapper : public TQObject { - Q_OBJECT -public: - TQSignalMapper( TQObject* parent, const char* name=0 ); - ~TQSignalMapper(); - - virtual void setMapping( const TQObject* sender, int identifier ); - virtual void setMapping( const TQObject* sender, const TQString &identifier ); - void removeMappings( const TQObject* sender ); - -signals: - void mapped(int); - void mapped(const TQString &); - -public slots: - void map(); - -private: - TQSignalMapperData* d; - TQSignalMapperRec* getRec( const TQObject* ); - -private slots: - void removeMapping(); -}; - -#endif // QT_NO_SIGNALMAPPER -#endif // TQSIGNALMAPPER_H diff --git a/src/kernel/qsignalslotimp.h b/src/kernel/qsignalslotimp.h deleted file mode 100644 index 7e8cf1d44..000000000 --- a/src/kernel/qsignalslotimp.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Definition of signal/slot collections etc. -** -** Created : 980821 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIGNALSLOTIMP_H -#define TQSIGNALSLOTIMP_H - -#ifndef QT_H -#include "qconnection.h" -#include "qptrlist.h" -#include "qptrvector.h" -#endif // QT_H - -class Q_EXPORT TQConnectionList : public TQPtrList -{ -public: - TQConnectionList() : TQPtrList() {} - TQConnectionList( const TQConnectionList &list ) : TQPtrList(list) {} - ~TQConnectionList() { clear(); } - TQConnectionList &operator=(const TQConnectionList &list) - { return (TQConnectionList&)TQPtrList::operator=(list); } -}; - -class Q_EXPORT TQConnectionListIt : public TQPtrListIterator -{ -public: - TQConnectionListIt( const TQConnectionList &l ) : TQPtrListIterator(l) {} - TQConnectionListIt &operator=(const TQConnectionListIt &i) - { return (TQConnectionListIt&)TQPtrListIterator::operator=(i); } -}; - -#if defined(Q_TEMPLATEDLL) && defined(Q_CC_INTEL) -// MOC_SKIP_BEGIN -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -#define Q_EXPORTED_QPTRVECTORCONNECTTIONLIST_TEMPLATES -// MOC_SKIP_END -#endif - -class Q_EXPORT TQSignalVec : public TQPtrVector -{ -public: - TQSignalVec(int size=17 ) - : TQPtrVector(size) {} - TQSignalVec( const TQSignalVec &dict ) - : TQPtrVector(dict) {} - ~TQSignalVec() { clear(); } - TQSignalVec &operator=(const TQSignalVec &dict) - { return (TQSignalVec&)TQPtrVector::operator=(dict); } - TQConnectionList* at( uint index ) const { - return index >= size()? 0 : TQPtrVector::at(index); - } - bool insert( uint index, const TQConnectionList* d ) { - if (index >= size() ) - resize( 2*index + 1); - return TQPtrVector::insert(index, d); - } -}; - -#define Q_DEFINED_QCONNECTION_LIST -#include "qwinexport.h" -#endif // TQSIGNALSLOTIMP_H diff --git a/src/kernel/qsimplerichtext.cpp b/src/kernel/qsimplerichtext.cpp index b21efba04..20bea6af4 100644 --- a/src/kernel/qsimplerichtext.cpp +++ b/src/kernel/qsimplerichtext.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qsimplerichtext.h" +#include "ntqsimplerichtext.h" #ifndef QT_NO_RICHTEXT #include "qrichtext_p.h" -#include "qapplication.h" +#include "ntqapplication.h" class TQSimpleRichTextData { @@ -76,7 +76,7 @@ void TQSimpleRichTextData::adjustSize(TQPainter *p) { } /*! - \class TQSimpleRichText qsimplerichtext.h + \class TQSimpleRichText ntqsimplerichtext.h \brief The TQSimpleRichText class provides a small displayable piece of rich text. \ingroup text diff --git a/src/kernel/qsimplerichtext.h b/src/kernel/qsimplerichtext.h deleted file mode 100644 index 8860f114b..000000000 --- a/src/kernel/qsimplerichtext.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQSimpleRichText class -** -** Created : 990101 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIMPLERICHTEXT_H -#define TQSIMPLERICHTEXT_H - -#ifndef QT_H -#include "qnamespace.h" -#include "qstring.h" -#include "qregion.h" -#endif // QT_H - -#ifndef QT_NO_RICHTEXT - -class TQPainter; -class TQWidget; -class TQStyleSheet; -class TQBrush; -class TQMimeSourceFactory; -class TQSimpleRichTextData; - -class Q_EXPORT TQSimpleRichText -{ -public: - TQSimpleRichText( const TQString& text, const TQFont& fnt, - const TQString& context = TQString::null, const TQStyleSheet* sheet = 0); - TQSimpleRichText( const TQString& text, const TQFont& fnt, - const TQString& context, const TQStyleSheet* sheet, - const TQMimeSourceFactory* factory, int pageBreak = -1, - const TQColor& linkColor = TQt::blue, bool linkUnderline = TRUE ); - ~TQSimpleRichText(); - - void setWidth( int ); - void setWidth( TQPainter*, int ); - void setDefaultFont( const TQFont &f ); - int width() const; - int widthUsed() const; - int height() const; - void adjustSize(); - - void draw( TQPainter* p, int x, int y, const TQRect& clipRect, - const TQColorGroup& cg, const TQBrush* paper = 0) const; - - // obsolete - void draw( TQPainter* p, int x, int y, const TQRegion& clipRegion, - const TQColorGroup& cg, const TQBrush* paper = 0) const { - draw( p, x, y, clipRegion.boundingRect(), cg, paper ); - } - - TQString context() const; - TQString anchorAt( const TQPoint& pos ) const; - - bool inText( const TQPoint& pos ) const; - -private: - TQSimpleRichTextData* d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSimpleRichText( const TQSimpleRichText & ); - TQSimpleRichText &operator=( const TQSimpleRichText & ); -#endif -}; - -#endif // QT_NO_RICHTEXT - -#endif // TQSIMPLERICHTEXT_H diff --git a/src/kernel/qsize.cpp b/src/kernel/qsize.cpp index c2b8d9b94..4cd0735c3 100644 --- a/src/kernel/qsize.cpp +++ b/src/kernel/qsize.cpp @@ -38,8 +38,8 @@ ** **********************************************************************/ -#include "qsize.h" -#include "qdatastream.h" +#include "ntqsize.h" +#include "ntqdatastream.h" /*! @@ -51,7 +51,7 @@ A size is specified by a width and a height. - The coordinate type is TQCOORD (defined in \c as \c int). + The coordinate type is TQCOORD (defined in \c as \c int). The minimum value of TQCOORD is TQCOORD_MIN (-2147483648) and the maximum value is TQCOORD_MAX (2147483647). diff --git a/src/kernel/qsize.h b/src/kernel/qsize.h deleted file mode 100644 index a8b6fabe5..000000000 --- a/src/kernel/qsize.h +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSize class -** -** Created : 931028 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIZE_H -#define TQSIZE_H - -#ifndef QT_H -#include "qpoint.h" // ### change to qwindowdefs.h? -#endif // QT_H - -class Q_EXPORT TQSize -// ### Make TQSize inherit TQt in TQt 4.0 -{ -public: - // ### Move this enum to qnamespace.h in TQt 4.0 - enum ScaleMode { - ScaleFree, - ScaleMin, - ScaleMax - }; - - TQSize(); - TQSize( int w, int h ); - - bool isNull() const; - bool isEmpty() const; - bool isValid() const; - - int width() const; - int height() const; - void setWidth( int w ); - void setHeight( int h ); - void transpose(); - - void scale( int w, int h, ScaleMode mode ); - void scale( const TQSize &s, ScaleMode mode ); - - 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 c ); - TQSize &operator*=( double c ); - TQSize &operator/=( int c ); - TQSize &operator/=( double c ); - - friend inline bool operator==( const TQSize &, const TQSize & ); - friend inline bool operator!=( const TQSize &, const TQSize & ); - friend inline const TQSize operator+( const TQSize &, const TQSize & ); - friend inline const TQSize operator-( const TQSize &, const TQSize & ); - friend inline const TQSize operator*( const TQSize &, int ); - friend inline const TQSize operator*( int, const TQSize & ); - friend inline const TQSize operator*( const TQSize &, double ); - friend inline const TQSize operator*( double, const TQSize & ); - friend inline const TQSize operator/( const TQSize &, int ); - friend inline const TQSize operator/( const TQSize &, double ); - -private: - static void warningDivByZero(); - - TQCOORD wd; - TQCOORD ht; -}; - - -/***************************************************************************** - TQSize stream functions - *****************************************************************************/ - -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQSize & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQSize & ); - - -/***************************************************************************** - TQSize inline functions - *****************************************************************************/ - -inline TQSize::TQSize() -{ wd = ht = -1; } - -inline TQSize::TQSize( int w, int h ) -{ wd=(TQCOORD)w; ht=(TQCOORD)h; } - -inline bool TQSize::isNull() const -{ return wd==0 && ht==0; } - -inline bool TQSize::isEmpty() const -{ return wd<1 || ht<1; } - -inline bool TQSize::isValid() const -{ return wd>=0 && ht>=0; } - -inline int TQSize::width() const -{ return wd; } - -inline int TQSize::height() const -{ return ht; } - -inline void TQSize::setWidth( int w ) -{ wd=(TQCOORD)w; } - -inline void TQSize::setHeight( int h ) -{ ht=(TQCOORD)h; } - -inline TQCOORD &TQSize::rwidth() -{ return wd; } - -inline TQCOORD &TQSize::rheight() -{ return ht; } - -inline TQSize &TQSize::operator+=( const TQSize &s ) -{ wd+=s.wd; ht+=s.ht; return *this; } - -inline TQSize &TQSize::operator-=( const TQSize &s ) -{ wd-=s.wd; ht-=s.ht; return *this; } - -inline TQSize &TQSize::operator*=( int c ) -{ wd*=(TQCOORD)c; ht*=(TQCOORD)c; return *this; } - -inline TQSize &TQSize::operator*=( double c ) -{ wd=(TQCOORD)(wd*c); ht=(TQCOORD)(ht*c); return *this; } - -inline bool operator==( const TQSize &s1, const TQSize &s2 ) -{ return s1.wd == s2.wd && s1.ht == s2.ht; } - -inline bool operator!=( const TQSize &s1, const TQSize &s2 ) -{ return s1.wd != s2.wd || s1.ht != s2.ht; } - -inline const TQSize operator+( const TQSize & s1, const TQSize & s2 ) -{ return TQSize(s1.wd+s2.wd, s1.ht+s2.ht); } - -inline const TQSize operator-( const TQSize &s1, const TQSize &s2 ) -{ return TQSize(s1.wd-s2.wd, s1.ht-s2.ht); } - -inline const TQSize operator*( const TQSize &s, int c ) -{ return TQSize(s.wd*c, s.ht*c); } - -inline const TQSize operator*( int c, const TQSize &s ) -{ return TQSize(s.wd*c, s.ht*c); } - -inline const TQSize operator*( const TQSize &s, double c ) -{ return TQSize((TQCOORD)(s.wd*c), (TQCOORD)(s.ht*c)); } - -inline const TQSize operator*( double c, const TQSize &s ) -{ return TQSize((TQCOORD)(s.wd*c), (TQCOORD)(s.ht*c)); } - -inline TQSize &TQSize::operator/=( int c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0 ) - warningDivByZero(); -#endif - wd/=(TQCOORD)c; ht/=(TQCOORD)c; - return *this; -} - -inline TQSize &TQSize::operator/=( double c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0.0 ) - warningDivByZero(); -#endif - wd=(TQCOORD)(wd/c); ht=(TQCOORD)(ht/c); - return *this; -} - -inline const TQSize operator/( const TQSize &s, int c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0 ) - TQSize::warningDivByZero(); -#endif - return TQSize(s.wd/c, s.ht/c); -} - -inline const TQSize operator/( const TQSize &s, double c ) -{ -#if defined(QT_CHECK_MATH) - if ( c == 0.0 ) - TQSize::warningDivByZero(); -#endif - return TQSize((TQCOORD)(s.wd/c), (TQCOORD)(s.ht/c)); -} - -inline TQSize TQSize::expandedTo( const TQSize & otherSize ) const -{ - return TQSize( TQMAX(wd,otherSize.wd), TQMAX(ht,otherSize.ht) ); -} - -inline TQSize TQSize::boundedTo( const TQSize & otherSize ) const -{ - return TQSize( TQMIN(wd,otherSize.wd), TQMIN(ht,otherSize.ht) ); -} - - -#endif // TQSIZE_H diff --git a/src/kernel/qsizegrip.cpp b/src/kernel/qsizegrip.cpp index c0de2643c..decff43a7 100644 --- a/src/kernel/qsizegrip.cpp +++ b/src/kernel/qsizegrip.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qsizegrip.h" +#include "ntqsizegrip.h" #ifndef QT_NO_SIZEGRIP -#include "qpainter.h" -#include "qapplication.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqapplication.h" +#include "ntqstyle.h" #if defined(Q_WS_X11) #include "qt_x11_p.h" extern Atom qt_sizegrip; // defined in qapplication_x11.cpp #elif defined (Q_WS_WIN ) -#include "qobjectlist.h" +#include "ntqobjectlist.h" #include "qt_windows.h" #elif defined(Q_WS_MAC) bool qt_mac_update_sizer(TQWidget *, int); //qwidget_mac.cpp @@ -79,7 +79,7 @@ static TQWidget* qt_sizegrip_workspace( TQWidget* w ) /*! - \class TQSizeGrip qsizegrip.h + \class TQSizeGrip ntqsizegrip.h \brief The TQSizeGrip class provides a corner-grip for resizing a top-level window. diff --git a/src/kernel/qsizegrip.h b/src/kernel/qsizegrip.h deleted file mode 100644 index 2b8b6eca2..000000000 --- a/src/kernel/qsizegrip.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSizeGrip class -** -** Created : 980316 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIZEGRIP_H -#define TQSIZEGRIP_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_SIZEGRIP - -class Q_EXPORT TQSizeGrip: public TQWidget -{ - Q_OBJECT -public: - TQSizeGrip( TQWidget* parent, const char* name=0 ); - ~TQSizeGrip(); - - TQSize sizeHint() const; - -protected: - void paintEvent( TQPaintEvent * ); - void mousePressEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); - - bool eventFilter( TQObject *, TQEvent * ); - -private: - TQPoint p; - TQSize s; - int d; - TQWidget *tlw; -}; - -#endif //QT_NO_SIZEGRIP -#endif diff --git a/src/kernel/qsizepolicy.h b/src/kernel/qsizepolicy.h deleted file mode 100644 index 87099c32d..000000000 --- a/src/kernel/qsizepolicy.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQSizePolicy class -** -** Created : 980929 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSIZEPOLICY_H -#define TQSIZEPOLICY_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -// Documentation is in qabstractlayout.cpp. - -class Q_EXPORT TQSizePolicy -{ -private: - enum SizePolicy_Internal { HSize = 6, HMask = 0x3f, VMask = HMask << HSize, - MayGrow = 1, ExpMask = 2, MayShrink = 4 }; -public: - enum SizeType { Fixed = 0, - Minimum = MayGrow, - Maximum = MayShrink, - Preferred = MayGrow | MayShrink, - MinimumExpanding = MayGrow | ExpMask, - Expanding = MayGrow | MayShrink | ExpMask, - Ignored = ExpMask /* magic value */ }; - - enum ExpandData { NoDirection = 0, - Horizontally = 1, - Vertically = 2, -#ifndef QT_NO_COMPAT - Horizontal = Horizontally, - Vertical = Vertically, -#endif - BothDirections = Horizontally | Vertically }; - - TQSizePolicy() : data( 0 ) { } - - TQSizePolicy( SizeType hor, SizeType ver, bool hfw = FALSE ) - : data( hor | (ver<> HSize ); } - - bool mayShrinkHorizontally() const { return horData() & MayShrink || horData() == Ignored; } - bool mayShrinkVertically() const { return verData() & MayShrink || verData() == Ignored; } - bool mayGrowHorizontally() const { return horData() & MayGrow || horData() == Ignored; } - bool mayGrowVertically() const { return verData() & MayGrow || verData() == Ignored; } - - ExpandData expanding() const - { - return (ExpandData)( (int)(verData() & ExpMask ? Vertically : 0) | - (int)(horData() & ExpMask ? Horizontally : 0) ); - } - - void setHorData( SizeType d ) { data = (Q_UINT32)(data & ~HMask) | d; } - void setVerData( SizeType d ) { data = (Q_UINT32)(data & ~(HMask << HSize)) | - (d << HSize); } - - void setHeightForWidth( bool b ) { data = b ? (Q_UINT32)( data | ( 1 << 2*HSize ) ) - : (Q_UINT32)( data & ~( 1 << 2*HSize ) ); } - bool hasHeightForWidth() const { return data & ( 1 << 2*HSize ); } - - bool operator==( const TQSizePolicy& s ) const { return data == s.data; } - bool operator!=( const TQSizePolicy& s ) const { return data != s.data; } - - - uint horStretch() const { return data >> 24; } - uint verStretch() const { return (data >> 16) & 0xff; } - void setHorStretch( uchar sf ) { data = (data&0x00ffffff) | (uint(sf)<<24); } - void setVerStretch( uchar sf ) { data = (data&0xff00ffff) | (uint(sf)<<16); } - inline void transpose(); - -private: - TQSizePolicy( int i ) : data( (Q_UINT32)i ) { } - - Q_UINT32 data; -}; - -inline TQSizePolicy::TQSizePolicy( SizeType hor, SizeType ver, uchar hors, uchar vers, bool hfw ) - : data( hor | (ver< *servers=0; @@ -98,7 +98,7 @@ public: }; /*! - \class TQSound qsound.h + \class TQSound ntqsound.h \brief The TQSound class provides access to the platform audio facilities. \ingroup multimedia diff --git a/src/kernel/qsound.h b/src/kernel/qsound.h deleted file mode 100644 index 52bf794a9..000000000 --- a/src/kernel/qsound.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSound class and TQAuServer internal class -** -** Created : 000117 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ -#ifndef TQSOUND_H -#define TQSOUND_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - -#ifndef QT_NO_SOUND - -class TQSoundData; - -class Q_EXPORT TQSound : public TQObject { - Q_OBJECT -public: - static bool isAvailable(); - static void play(const TQString& filename); - - TQSound(const TQString& filename, TQObject* parent=0, const char* name=0); - ~TQSound(); - - /* Coming soon... - ? - TQSound(int hertz, Type type=Mono); - int play(const ushort* data, int samples); - bool full(); - signal void notFull(); - ? - */ - -#ifndef QT_NO_COMPAT - static bool available() { return isAvailable(); } -#endif - - int loops() const; - int loopsRemaining() const; - void setLoops(int); - TQString fileName() const; - - bool isFinished() const; - -public slots: - void play(); - void stop(); - -private: - TQSoundData* d; - friend class TQAuServer; -}; - - -/* - TQAuServer is an INTERNAL class. If you wish to provide support for - additional audio servers, you can make a subclass of TQAuServer to do - so, HOWEVER, your class may need to be re-engineered to some degree - with each new TQt release, including minor releases. - - TQAuBucket is whatever you want. -*/ - -class TQAuBucket { -public: - virtual ~TQAuBucket(); -}; - -class Q_EXPORT TQAuServer : public TQObject { - Q_OBJECT - -public: - TQAuServer(TQObject* parent, const char* name); - ~TQAuServer(); - - virtual void init(TQSound*); - virtual void play(const TQString& filename); - virtual void play(TQSound*)=0; - virtual void stop(TQSound*)=0; - virtual bool okay()=0; - -protected: - void setBucket(TQSound*, TQAuBucket*); - TQAuBucket* bucket(TQSound*); - int decLoop(TQSound*); -}; - -#endif // QT_NO_SOUND - -#endif diff --git a/src/kernel/qsound_x11.cpp b/src/kernel/qsound_x11.cpp index 26c5afb73..59f6d0a0e 100644 --- a/src/kernel/qsound_x11.cpp +++ b/src/kernel/qsound_x11.cpp @@ -40,13 +40,13 @@ #define QT_CLEAN_NAMESPACE -#include "qsound.h" +#include "ntqsound.h" #ifndef QT_NO_SOUND -#include "qptrdict.h" -#include "qsocketnotifier.h" -#include "qapplication.h" +#include "ntqptrdict.h" +#include "ntqsocketnotifier.h" +#include "ntqapplication.h" #ifdef QT_NAS_SUPPORT diff --git a/src/kernel/qstyle.cpp b/src/kernel/qstyle.cpp index 9222e3735..25c9b1801 100644 --- a/src/kernel/qstyle.cpp +++ b/src/kernel/qstyle.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qstyle.h" +#include "ntqstyle.h" #ifndef QT_NO_STYLE -#include "qapplication.h" -#include "qpainter.h" -#include "qbitmap.h" -#include "qpixmapcache.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqbitmap.h" +#include "ntqpixmapcache.h" #include @@ -57,7 +57,7 @@ public: }; /*! - \class TQStyleOption qstyle.h + \class TQStyleOption ntqstyle.h \brief The TQStyleOption class specifies optional parameters for TQStyle functions. \ingroup appearance @@ -307,7 +307,7 @@ public: */ /*! - \class TQStyle qstyle.h + \class TQStyle ntqstyle.h \brief The TQStyle class specifies the look and feel of a GUI. \ingroup appearance diff --git a/src/kernel/qstyle.h b/src/kernel/qstyle.h deleted file mode 100644 index fec9522a9..000000000 --- a/src/kernel/qstyle.h +++ /dev/null @@ -1,758 +0,0 @@ -/**************************************************************************** -** -** Definition of TQStyle class -** -** Created : 980616 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ -#ifndef TQSTYLE_H -#define TQSTYLE_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - - -#ifndef QT_NO_STYLE - -class TQPopupMenu; -class TQStylePrivate; -class TQMenuItem; -class TQTab; -class TQListViewItem; -class TQCheckListItem; - -class TQStyleOption { -public: - enum StyleOptionDefault { Default }; - - TQStyleOption(StyleOptionDefault=Default) : def(TRUE) {} - - // Note: we don't use default arguments since that is unnecessary - // initialization. - TQStyleOption(int in1) : - def(FALSE), i1(in1) {} - TQStyleOption(int in1, int in2) : - def(FALSE), i1(in1), i2(in2) {} - TQStyleOption(int in1, int in2, int in3, int in4) : - def(FALSE), i1(in1), i2(in2), i3(in3), i4(in4) {} - TQStyleOption(TQMenuItem* m) : def(FALSE), mi(m) {} - TQStyleOption(TQMenuItem* m, int in1) : def(FALSE), mi(m), i1(in1) {} - TQStyleOption(TQMenuItem* m, int in1, int in2) : def(FALSE), mi(m), i1(in1), i2(in2) {} - TQStyleOption(const TQColor& c) : def(FALSE), cl(&c) {} - TQStyleOption(TQTab* t) : def(FALSE), tb(t) {} - TQStyleOption(TQListViewItem* i) : def(FALSE), li(i) {} - TQStyleOption(TQCheckListItem* i) : def(FALSE), cli(i) {} - TQStyleOption(TQt::ArrowType a) : def(FALSE), i1((int)a) {} - TQStyleOption(const TQRect& r) : def(FALSE), i1(r.x()), i2(r.y()), i3(r.width()),i4(r.height()){} - TQStyleOption(TQWidget *w) : def(FALSE), p1((void*)w) {} - - bool isDefault() const { return def; } - - int day() const { return i1; } - - int lineWidth() const { return i1; } - int midLineWidth() const { return i2; } - int frameShape() const { return i3; } - int frameShadow() const { return i4; } - - int headerSection() const { return i1; } - TQMenuItem* menuItem() const { return mi; } - int maxIconWidth() const { return i1; } - int tabWidth() const { return i2; } - - const TQColor& color() const { return *cl; } - - TQTab* tab() const { return tb; } - - TQCheckListItem* checkListItem() const { return cli; } - TQListViewItem* listViewItem() const { return li; } - - TQt::ArrowType arrowType() const { return (TQt::ArrowType)i1; } - TQRect rect() const { return TQRect( i1, i2, i3, i4 ); } - TQWidget* widget() const { return (TQWidget*)p1; } - -private: - // NOTE: none of these components have constructors. - bool def; - bool b1,b2,b3; // reserved - TQMenuItem* mi; - TQTab* tb; - TQListViewItem* li; - const TQColor* cl; - int i1, i2, i3, i4; - int i5, i6; // reserved - TQCheckListItem* cli; - void *p1, *p2, *p3, *p4; // reserved - // (padded to 64 bytes on some architectures) -}; - -class TQStyleHintReturn; // not defined yet - -class Q_EXPORT TQStyle: public TQObject -{ - Q_OBJECT - -public: - TQStyle(); - virtual ~TQStyle(); - - // New TQStyle API - most of these should probably be pure virtual - - virtual void polish( TQWidget * ); - virtual void unPolish( TQWidget * ); - - virtual void polish( TQApplication * ); - virtual void unPolish( TQApplication * ); - - virtual void polish( TQPalette & ); - - virtual void polishPopupMenu( TQPopupMenu* ) = 0; - - virtual TQRect itemRect( TQPainter *p, const TQRect &r, - int flags, bool enabled, - const TQPixmap *pixmap, - const TQString &text, int len = -1 ) const; - - virtual void drawItem( TQPainter *p, const TQRect &r, - int flags, const TQColorGroup &g, bool enabled, - const TQPixmap *pixmap, const TQString &text, - int len = -1, const TQColor *penColor = 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_HeaderSectionMenu, - - // do not add any values below/greater this - PE_CustomBase = 0xf000000 - }; - - enum StyleFlags { - Style_Default = 0x00000000, - Style_Enabled = 0x00000001, - Style_Raised = 0x00000002, - Style_Sunken = 0x00000004, - Style_Off = 0x00000008, - Style_NoChange = 0x00000010, - Style_On = 0x00000020, - Style_Down = 0x00000040, - Style_Horizontal = 0x00000080, - Style_HasFocus = 0x00000100, - Style_Top = 0x00000200, - Style_Bottom = 0x00000400, - Style_FocusAtBorder = 0x00000800, - Style_AutoRaise = 0x00001000, - Style_MouseOver = 0x00002000, - Style_Up = 0x00004000, - Style_Selected = 0x00008000, - Style_Active = 0x00010000, - Style_ButtonDefault = 0x00020000 - }; - typedef uint SFlags; - - virtual void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) 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, - - // do not add any values below/greater than this - CE_CustomBase = 0xf0000000 - }; - - virtual void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const = 0; - virtual void drawControlMask( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQStyleOption& = TQStyleOption::Default ) 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, - - // do not add any values below/greater than this - SR_CustomBase = 0xf0000000 - }; - - virtual TQRect subRect( SubRect r, const TQWidget *widget ) const = 0; - - - enum ComplexControl{ - CC_SpinWidget, - CC_ComboBox, - CC_ScrollBar, - CC_Slider, - CC_ToolButton, - CC_TitleBar, - CC_ListView, - - // do not add any values below/greater than this - CC_CustomBase = 0xf0000000 - }; - - enum SubControl { - SC_None = 0x00000000, - - SC_ScrollBarAddLine = 0x00000001, - SC_ScrollBarSubLine = 0x00000002, - SC_ScrollBarAddPage = 0x00000004, - SC_ScrollBarSubPage = 0x00000008, - SC_ScrollBarFirst = 0x00000010, - SC_ScrollBarLast = 0x00000020, - SC_ScrollBarSlider = 0x00000040, - SC_ScrollBarGroove = 0x00000080, - - SC_SpinWidgetUp = 0x00000001, - SC_SpinWidgetDown = 0x00000002, - SC_SpinWidgetFrame = 0x00000004, - SC_SpinWidgetEditField = 0x00000008, - SC_SpinWidgetButtonField = 0x00000010, - - SC_ComboBoxFrame = 0x00000001, - SC_ComboBoxEditField = 0x00000002, - SC_ComboBoxArrow = 0x00000004, - SC_ComboBoxListBoxPopup = 0x00000008, - - SC_SliderGroove = 0x00000001, - SC_SliderHandle = 0x00000002, - SC_SliderTickmarks = 0x00000004, - - SC_ToolButton = 0x00000001, - SC_ToolButtonMenu = 0x00000002, - - SC_TitleBarLabel = 0x00000001, - SC_TitleBarSysMenu = 0x00000002, - SC_TitleBarMinButton = 0x00000004, - SC_TitleBarMaxButton = 0x00000008, - SC_TitleBarCloseButton = 0x00000010, - SC_TitleBarNormalButton = 0x00000020, - SC_TitleBarShadeButton = 0x00000040, - SC_TitleBarUnshadeButton = 0x00000080, - - SC_ListView = 0x00000001, - SC_ListViewBranch = 0x00000002, - SC_ListViewExpand = 0x00000004, - - SC_All = 0xffffffff - }; - typedef uint SCFlags; - - - virtual void drawComplexControl( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, -#ifdef Q_QDOC - SCFlags sub = SC_All, -#else - SCFlags sub = (uint)SC_All, -#endif - SCFlags subActive = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const = 0; - virtual void drawComplexControlMask( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQStyleOption& = TQStyleOption::Default ) const = 0; - - virtual TQRect querySubControlMetrics( ComplexControl control, - const TQWidget *widget, - SubControl sc, - const TQStyleOption& = TQStyleOption::Default ) const = 0; - virtual SubControl querySubControl( ComplexControl control, - const TQWidget *widget, - const TQPoint &pos, - const TQStyleOption& = TQStyleOption::Default ) 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, // total slider thickness - PM_SliderControlThickness, // thickness of the business part - PM_SliderLength, // total length of slider - PM_SliderTickmarkOffset, // - PM_SliderSpaceAvailable, // available space for slider to move - - 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, - - // do not add any values below/greater than this - PM_CustomBase = 0xf0000000 - }; - - virtual int pixelMetric( PixelMetric metric, - const TQWidget *widget = 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, - - // do not add any values below/greater than this - CT_CustomBase = 0xf0000000 - }; - - virtual TQSize sizeFromContents( ContentsType contents, - const TQWidget *widget, - const TQSize &contentsSize, - const TQStyleOption& = TQStyleOption::Default ) const = 0; - - enum StyleHint { - // ... - // the general hints - // ... - // disabled text should be etched, ala Windows - SH_EtchDisabledText, - - // the GUI style enum, argh! - SH_GUIStyle, - - // ... - // widget specific hints - // ... - SH_ScrollBar_BackgroundMode, - SH_ScrollBar_MiddleClickAbsolutePosition, - SH_ScrollBar_ScrollWhenPointerLeavesControl, - - // TQEvent::Type - which mouse event to select a tab - SH_TabBar_SelectMouseType, - - SH_TabBar_Alignment, - - SH_Header_ArrowAlignment, - - // bool - sliders snap to values while moving, ala Windows - SH_Slider_SnapToValue, - - // bool - key presses handled in a sloppy manner - ie. left on a vertical - // slider subtracts a line - SH_Slider_SloppyKeyEvents, - - // bool - center button on progress dialogs, ala Motif, else right aligned - // perhaps this should be a TQt::Alignment value - SH_ProgressDialog_CenterCancelButton, - - // TQt::AlignmentFlags - text label alignment in progress dialogs - // Center on windows, Auto|VCenter otherwize - SH_ProgressDialog_TextLabelAlignment, - - // bool - right align buttons on print dialog, ala Windows - SH_PrintDialog_RightAlignButtons, - - // bool - 1 or 2 pixel space between the menubar and the dockarea, ala Windows - // this *REALLY* needs a better name - SH_MainWindow_SpaceBelowMenuBar, - - // bool - select the text in the line edit about the listbox when selecting - // an item from the listbox, or when the line edit receives focus, ala Windows - SH_FontDialog_SelectAssociatedText, - - // bool - allows disabled menu items to be active - SH_PopupMenu_AllowActiveAndDisabled, - - // bool - pressing space activates item, ala Motif - SH_PopupMenu_SpaceActivatesItem, - - // int - number of milliseconds to wait before opening a submenu - // 256 on windows, 96 on motif - SH_PopupMenu_SubMenuPopupDelay, - - // bool - should scrollviews draw their frame only around contents (ala Motif), - // or around contents, scrollbars and corner widgets (ala Windows) ? - SH_ScrollView_FrameOnlyAroundContents, - - // bool - menubars items are navigatable by pressing alt, followed by using - // the arrow keys to select the desired item - SH_MenuBar_AltKeyNavigation, - - // bool - mouse tracking in combobox dropdown lists - SH_ComboBox_ListMouseTracking, - - // bool - mouse tracking in popupmenus - SH_PopupMenu_MouseTracking, - - // bool - mouse tracking in menubars - SH_MenuBar_MouseTracking, - - // bool - gray out selected items when loosing focus - SH_ItemView_ChangeHighlightOnFocus, - - // bool - supports shared activation among modeless widgets - SH_Widget_ShareActivation, - - // bool - workspace should just maximize the client area - SH_Workspace_FillSpaceOnMaximize, - - // bool - supports popup menu comboboxes - SH_ComboBox_Popup, - - // bool - titlebar has no border - SH_TitleBar_NoBorder, - - // bool - stop scrollbar at mouse - SH_ScrollBar_StopMouseOverSlider, - - //bool - blink cursort with selected text - SH_BlinkCursorWhenTextSelected, - - //bool - richtext selections extend the full width of the docuemnt - SH_RichText_FullWidthSelection, - - //bool - popupmenu supports scrolling instead of multicolumn mode - SH_PopupMenu_Scrollable, - - // TQt::AlignmentFlags - text label vertical alignment in groupboxes - // Center on windows, Auto|VCenter otherwize - SH_GroupBox_TextLabelVerticalAlignment, - - // TQt::TQRgb - text label color in groupboxes - SH_GroupBox_TextLabelColor, - - // bool - popupmenu supports sloppy submenus - SH_PopupMenu_SloppySubMenus, - - // TQt::TQRgb - table grid color - SH_Table_GridLineColor, - - // TQChar - Unicode character for password char - SH_LineEdit_PasswordCharacter, - - // TQDialogButtons::Button - default button - SH_DialogButtons_DefaultButton, - - // TQToolBox - Boldness of the selected page title - SH_ToolBox_SelectedPageTitleBold, - - //bool - if a tabbar prefers not to have scroller arrows - SH_TabBar_PreferNoArrows, - - //bool - if left button should cause an absolute position - SH_ScrollBar_LeftClickAbsolutePosition, - - // TQEvent::Type - which mouse event to select a list view expansion - SH_ListViewExpand_SelectMouseType, - - //bool - if underline for accelerators - SH_UnderlineAccelerator, - - // bool - TQToolButton - if tool buttons should use a 3D frame - // when the mouse is over the button - SH_ToolButton_Uses3D, - - // do not add any values below/greater than this - SH_CustomBase = 0xf0000000 - }; - - virtual int styleHint( StyleHint stylehint, - const TQWidget *widget = 0, - const TQStyleOption& = TQStyleOption::Default, - TQStyleHintReturn* returnData = 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, - - // do not add any values below/greater than this - SP_CustomBase = 0xf0000000 - }; - - virtual TQPixmap stylePixmap( StylePixmap stylepixmap, - const TQWidget *widget = 0, - const TQStyleOption& = TQStyleOption::Default ) const = 0; - - - static TQRect visualRect( const TQRect &logical, const TQWidget *w ); - - static TQRect visualRect( const TQRect &logical, const TQRect &bounding ); - - - - - // Old 2.x TQStyle API - -#ifndef QT_NO_COMPAT - int defaultFrameWidth() const - { - return pixelMetric( PM_DefaultFrameWidth ); - } - void tabbarMetrics( const TQWidget* t, - int& hf, int& vf, int& ov ) const - { - hf = pixelMetric( PM_TabBarTabHSpace, t ); - vf = pixelMetric( PM_TabBarTabVSpace, t ); - ov = pixelMetric( PM_TabBarBaseOverlap, t ); - } - TQSize scrollBarExtent() const - { - return TQSize(pixelMetric(PM_ScrollBarExtent), - pixelMetric(PM_ScrollBarExtent)); - } -#endif - - -private: - TQStylePrivate * d; - -#if defined(Q_DISABLE_COPY) - TQStyle( const TQStyle & ); - TQStyle& operator=( const TQStyle & ); -#endif -}; - -#endif // QT_NO_STYLE -#endif // TQSTYLE_H diff --git a/src/kernel/qstylesheet.cpp b/src/kernel/qstylesheet.cpp index 333f1059c..e74a9be16 100644 --- a/src/kernel/qstylesheet.cpp +++ b/src/kernel/qstylesheet.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qstylesheet.h" +#include "ntqstylesheet.h" #ifndef QT_NO_RICHTEXT #include "private/qrichtext_p.h" -#include "qlayout.h" -#include "qpainter.h" -#include "qcleanuphandler.h" +#include "ntqlayout.h" +#include "ntqpainter.h" +#include "ntqcleanuphandler.h" #include @@ -78,7 +78,7 @@ public: }; /*! - \class TQStyleSheetItem qstylesheet.h + \class TQStyleSheetItem ntqstylesheet.h \brief The TQStyleSheetItem class provides an encapsulation of a set of text styles. \ingroup text @@ -855,7 +855,7 @@ int TQStyleSheetItem::lineSpacing() const /*! - \class TQStyleSheet qstylesheet.h + \class TQStyleSheet ntqstylesheet.h \ingroup text \brief The TQStyleSheet class is a collection of styles for rich text rendering and a generator of tags. diff --git a/src/kernel/qstylesheet.h b/src/kernel/qstylesheet.h deleted file mode 100644 index 4b7e31043..000000000 --- a/src/kernel/qstylesheet.h +++ /dev/null @@ -1,253 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQStyleSheet class -** -** Created : 990101 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTYLESHEET_H -#define TQSTYLESHEET_H - -#ifndef QT_H -#include "qstring.h" -#include "qvaluelist.h" -#include "qptrvector.h" -#include "qdict.h" -#include "qobject.h" -#endif // QT_H - -#ifndef QT_NO_RICHTEXT - -class TQStyleSheet; -class TQTextDocument; -template class TQMap; -class TQStyleSheetItemData; - -class Q_EXPORT TQStyleSheetItem : public TQt -{ -public: - TQStyleSheetItem( TQStyleSheet* parent, const TQString& name ); - TQStyleSheetItem( const TQStyleSheetItem & ); - ~TQStyleSheetItem(); - - TQStyleSheetItem& operator=( const TQStyleSheetItem& other ); - - TQString name() const; - - TQStyleSheet* styleSheet(); - const TQStyleSheet* styleSheet() const; - - enum AdditionalStyleValues { Undefined = - 1}; - - enum DisplayMode { - DisplayBlock, - DisplayInline, - DisplayListItem, - DisplayNone -#ifndef Q_QDOC - , DisplayModeUndefined = -1 -#endif - }; - - DisplayMode displayMode() const; - void setDisplayMode(DisplayMode m); - - int alignment() const; - void setAlignment( int f); - - enum VerticalAlignment { - VAlignBaseline, - VAlignSub, - VAlignSuper - }; - - VerticalAlignment verticalAlignment() const; - void setVerticalAlignment( VerticalAlignment valign ); - - int fontWeight() const; - void setFontWeight(int w); - - int logicalFontSize() const; - void setLogicalFontSize(int s); - - int logicalFontSizeStep() const; - void setLogicalFontSizeStep( int s ); - - int fontSize() const; - void setFontSize(int s); - - TQString fontFamily() const; - void setFontFamily( const TQString& ); - - int numberOfColumns() const; - void setNumberOfColumns(int ncols); - - 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 anc); - - enum WhiteSpaceMode { - WhiteSpaceNormal, - WhiteSpacePre, - WhiteSpaceNoWrap -#ifndef Q_QDOC - , WhiteSpaceModeUndefined = -1 -#endif - }; - WhiteSpaceMode whiteSpaceMode() const; - void setWhiteSpaceMode(WhiteSpaceMode m); - - enum Margin { - MarginLeft, - MarginRight, - MarginTop, - MarginBottom, - MarginFirstLine, - MarginAll, - MarginVertical, - MarginHorizontal -#ifndef Q_QDOC - , MarginUndefined = -1 -#endif - }; - - int margin( Margin m) const; - void setMargin( Margin, int); - - enum ListStyle { - ListDisc, - ListCircle, - ListSquare, - ListDecimal, - ListLowerAlpha, - ListUpperAlpha -#ifndef Q_QDOC - , ListStyleUndefined = -1 -#endif - }; - - 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 ls ); - int lineSpacing() const; - -private: - void init(); - TQStyleSheetItemData* d; -}; - - -#if defined(Q_TEMPLATEDLL) -// MOC_SKIP_BEGIN -Q_TEMPLATE_EXTERN template class Q_EXPORT TQDict; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList< TQPtrVector >; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -// MOC_SKIP_END -#endif - -#ifndef QT_NO_TEXTCUSTOMITEM -class TQTextCustomItem; -#endif - -class Q_EXPORT TQStyleSheet : public TQObject -{ - Q_OBJECT -public: - TQStyleSheet( TQObject *parent=0, const char *name=0 ); - virtual ~TQStyleSheet(); - - static TQStyleSheet* defaultSheet(); - static void setDefaultSheet( TQStyleSheet* ); - - - TQStyleSheetItem* item( const TQString& name); - const TQStyleSheetItem* item( const TQString& name) const; - - void insert( TQStyleSheetItem* item); - -#ifndef QT_NO_TEXTCUSTOMITEM - virtual TQTextCustomItem* tag( const TQString& name, - const TQMap &attr, - const TQString& context, - const TQMimeSourceFactory& factory, - bool emptyTag, TQTextDocument *doc ) const; -#endif - static TQString escape( const TQString& ); - static TQString convertFromPlainText( const TQString&, - TQStyleSheetItem::WhiteSpaceMode mode = TQStyleSheetItem::WhiteSpacePre ); - static bool mightBeRichText( const TQString& ); - - virtual void scaleFont( TQFont& font, int logicalSize ) const; - - virtual void error( const TQString& ) const; - -private: - void init(); - TQDict styles; - TQStyleSheetItem* nullstyle; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQStyleSheet( const TQStyleSheet & ); - TQStyleSheet &operator=( const TQStyleSheet & ); -#endif -}; - -#endif // QT_NO_RICHTEXT - -#endif // TQSTYLESHEET_H diff --git a/src/kernel/qt.h b/src/kernel/qt.h deleted file mode 100644 index 01d43d298..000000000 --- a/src/kernel/qt.h +++ /dev/null @@ -1,375 +0,0 @@ -/**************************************************************************** -** -** TQt GUI Toolkit -** -** This header file efficiently includes all TQt GUI Toolkit functionality. -** -** Generated : Mon Oct 13 13:07:29 CEST 2003 - -** -** Copyright (C) 1995-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt GUI Toolkit. -** -*****************************************************************************/ - -#ifndef QT_H -#define QT_H -#include "qglobal.h" -#include "qfeatures.h" -#include "qshared.h" -#include "qptrcollection.h" -#include "qglist.h" -#include "qobjectdefs.h" -#include "qnamespace.h" -#include "qgarray.h" -#include "qmemarray.h" -#include "qcstring.h" -#include "qstring.h" -#include "qptrlist.h" -#include "qiodevice.h" -#include "qkeysequence.h" -#include "qwindowdefs.h" -#include "qgdict.h" -#include "qfont.h" -#include "qdatastream.h" -#include "qpair.h" -#include "qpoint.h" -#include -#include "qtextstream.h" -#include "qfontinfo.h" -#include "qsizepolicy.h" -#include "qtl.h" -#include "qsize.h" -#include "qrect.h" -#include "qbitarray.h" -#include "qregion.h" -#include "qsql.h" -#include "qstrlist.h" -#include "qvaluelist.h" -#include "qmap.h" -#include "qdatetime.h" -#include "qmime.h" -#include "qasciidict.h" -#include "qpaintdevice.h" -#include "qfontmetrics.h" -#include "qdict.h" -#include "qevent.h" -#include "qhostaddress.h" -#include "qstringlist.h" -#include "qcolor.h" -#include -#include "qobject.h" -#include -#include "qbrush.h" -#include "qpalette.h" -#include "qwidget.h" -#include "qjpunicode.h" -#include "qtextcodec.h" -#include "qstyle.h" -#include "qframe.h" -#include "qfile.h" -#include "qfileinfo.h" -#include "qurlinfo.h" -#include "qwidgetlist.h" -#include -#include "qgroupbox.h" -#include "qdialog.h" -#include -#include "qdockwindow.h" -#include "qcommonstyle.h" -#include "qnetworkprotocol.h" -#include -#include -#include "qgcache.h" -#include "qpixmap.h" -#include -#include -#include -#include -#include "qgplugin.h" -#include -#include "qrangecontrol.h" -#include "qbuttongroup.h" -#include -#include "qgvector.h" -#include "qhbox.h" -#include -#include "qiconset.h" -#include -#include "qsocketnotifier.h" -#include -#include -#include -#include "qbuffer.h" -#include "qimage.h" -#include -#include "qlineedit.h" -#include -#include "qintdict.h" -#include "qmotifstyle.h" -#include "qpicture.h" -#include -#include -#include -#include -#include "qlabel.h" -#include "qlayout.h" -#include -#include -#include -#include "qscrollbar.h" -#include "qscrollview.h" -#include "qdir.h" -#include "qwindowsstyle.h" -#include "qconnection.h" -#include "qbitmap.h" -#include "qvariant.h" -#include "qsignal.h" -#include -#include "qmetaobject.h" -#include "qheader.h" -#include -#include -#include -#include "qptrvector.h" -#include "qmutex.h" -#include "qbutton.h" -#include -#include -#include "qguardedptr.h" -#include -#include "qsqlfield.h" -#include -#include -#include -#include -#include "qpointarray.h" -#include "qmenudata.h" -#include -#include "qpen.h" -#include "qdragobject.h" -#include -#include -#include -#include -#include -#include -#include -#include "qpopupmenu.h" -#include -#include -#include -#include "qprogressbar.h" -#include "qsemimodal.h" -#include -#include "qptrdict.h" -#include -#include -#include -#include "qstylesheet.h" -#include -#include -#include -#include -#include "qregexp.h" -#include -#include -#include -#include -#include "qsemaphore.h" -#include -#include "qsocketdevice.h" -#include -#include -#include -#include -#include "qtimer.h" -#include -#include -#include -#include "qwmatrix.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "qsqlerror.h" -#include "qeditorfactory.h" -#include "qsqlquery.h" -#include "qsqlrecord.h" -#include -#include "qsqlindex.h" -#include "qsqlcursor.h" -#include -#include -#include "qtable.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "qtranslator.h" -#include -#include -#include -#include -#include "qtextedit.h" -#include -#include -#include -#include "qsqleditorfactory.h" -#include -#include -#include -#include -#include -#include -#include "qtoolbar.h" -#include -#include "qwaitcondition.h" -#include -#include -#include -#include -#include -#include -#include "qdesktopwidget.h" -#include -#include "qurl.h" -#include "qurloperator.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined( QT_MOC_CPP ) || defined( QT_H_CPP ) || defined( Q_OS_MACX ) -#include -#include -#include "private/qgfxdriverinterface_p.h" -#include "private/qcom_p.h" -#include "private/qimageformatinterface_p.h" -#include "private/qisciicodec_p.h" -#include "private/qkbddriverinterface_p.h" -#include "private/qlayoutengine_p.h" -#include "private/qcomlibrary_p.h" -#include "private/qmousedriverinterface_p.h" -#include "private/qeffects_p.h" -#include "private/qgpluginmanager_p.h" -#include "private/qinternal_p.h" -#include "private/qsqldriverinterface_p.h" -#include "private/qsqlmanager_p.h" -#include "private/qlock_p.h" -#include "private/qcomponentfactory_p.h" -#include "private/qstyleinterface_p.h" -#include "private/qrichtext_p.h" -#include "private/qsvgdevice_p.h" -#include "private/qfontcodecs_p.h" -#include "private/qtextcodecinterface_p.h" -#include "private/qpsprinter_p.h" -#include "private/qtitlebar_p.h" -#include "private/qucom_p.h" -#include "private/qucomextra_p.h" -#include "private/qpluginmanager_p.h" -#include "private/qdir_p.h" -#include "private/qsettings_p.h" -#include "private/qsqlextension_p.h" -#include "private/qdialogbuttons_p.h" -#include "private/qwidgetinterface_p.h" -#include "private/qwidgetresizehandler_p.h" -#include "private/qlibrary_p.h" -#endif // Private headers - - -#ifdef Q_WS_X11 -#include "private/qtkdeintegration_x11_p.h" -#endif - -#ifdef Q_WS_MAC -#include -#include -#endif // Q_WS_MAC - -#ifdef Q_WS_WIN -#include -#endif - -#ifdef Q_WS_QWS -#include -#include "qfontmanager_qws.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "qmemorymanager_qws.h" -#include -#include -#ifndef Q_OS_MAC -# include -#endif -#include "qgfx_qws.h" -#include -#include "qwsdisplay_qws.h" -#include "qwssocket_qws.h" -#include "qwsdecoration_qws.h" -#include "qwsutils_qws.h" -#include -#include "qwsmanager_qws.h" -#include "qwsdefaultdecoration_qws.h" -#include -#include "qwscommand_qws.h" -#include -#include -#include -#include -#include "qwsproperty_qws.h" -#include -#include "qwsevent_qws.h" -#include -#include -#endif // Q_WS_QWS - - -#ifdef Q_WS_WCE -#include -#endif // Q_WS_WCE - -#endif // QT_H diff --git a/src/kernel/qt_gfx.pri b/src/kernel/qt_gfx.pri index e27523c12..9c5b4c234 100644 --- a/src/kernel/qt_gfx.pri +++ b/src/kernel/qt_gfx.pri @@ -1,7 +1,7 @@ # Qt graphics #mng support -HEADERS += $$KERNEL_H/qmngio.h +HEADERS += $$KERNEL_H/ntqmngio.h SOURCES += $$KERNEL_CPP/qmngio.cpp mng { system-mng { @@ -39,7 +39,7 @@ mng { else:DEFINES += QT_NO_IMAGEIO_MNG #jpeg support.. -HEADERS += $$KERNEL_H/qjpegio.h +HEADERS += $$KERNEL_H/ntqjpegio.h SOURCES += $$KERNEL_CPP/qjpegio.cpp jpeg { system-jpeg { @@ -98,7 +98,7 @@ jpeg { else:DEFINES += QT_NO_IMAGEIO_JPEG #png support -HEADERS+=$$KERNEL_H/qpngio.h +HEADERS+=$$KERNEL_H/ntqpngio.h SOURCES+=$$KERNEL_CPP/qpngio.cpp png { system-png { diff --git a/src/kernel/qt_kernel.pri b/src/kernel/qt_kernel.pri index 5a89e08fb..0c3b867c7 100644 --- a/src/kernel/qt_kernel.pri +++ b/src/kernel/qt_kernel.pri @@ -2,104 +2,104 @@ kernel { KERNEL_P = kernel - HEADERS += $$KERNEL_H/qabstractlayout.h \ - $$KERNEL_H/qaccel.h \ + HEADERS += $$KERNEL_H/ntqabstractlayout.h \ + $$KERNEL_H/ntqaccel.h \ $$KERNEL_P/qucomextra_p.h \ - $$KERNEL_H/qapplication.h \ + $$KERNEL_H/ntqapplication.h \ $$KERNEL_P/qapplication_p.h \ - $$KERNEL_H/qasyncimageio.h \ - $$KERNEL_H/qasyncio.h \ - $$KERNEL_H/qbitmap.h \ - $$KERNEL_H/qbrush.h \ - $$KERNEL_H/qclipboard.h \ - $$KERNEL_H/qcolor.h \ + $$KERNEL_H/ntqasyncimageio.h \ + $$KERNEL_H/ntqasyncio.h \ + $$KERNEL_H/ntqbitmap.h \ + $$KERNEL_H/ntqbrush.h \ + $$KERNEL_H/ntqclipboard.h \ + $$KERNEL_H/ntqcolor.h \ $$KERNEL_P/qcolor_p.h \ - $$KERNEL_H/qconnection.h \ - $$KERNEL_H/qcursor.h \ - $$KERNEL_H/qdesktopwidget.h \ - $$KERNEL_H/qdragobject.h \ - $$KERNEL_H/qdrawutil.h \ - $$KERNEL_H/qdropsite.h \ - $$KERNEL_H/qevent.h \ - $$KERNEL_H/qeventloop.h\ + $$KERNEL_H/ntqconnection.h \ + $$KERNEL_H/ntqcursor.h \ + $$KERNEL_H/ntqdesktopwidget.h \ + $$KERNEL_H/ntqdragobject.h \ + $$KERNEL_H/ntqdrawutil.h \ + $$KERNEL_H/ntqdropsite.h \ + $$KERNEL_H/ntqevent.h \ + $$KERNEL_H/ntqeventloop.h\ $$KERNEL_P/qeventloop_p.h \ - $$KERNEL_H/qfocusdata.h \ - $$KERNEL_H/qfont.h \ + $$KERNEL_H/ntqfocusdata.h \ + $$KERNEL_H/ntqfont.h \ $$KERNEL_P/qfontdata_p.h \ - $$KERNEL_H/qfontinfo.h \ - $$KERNEL_H/qfontmetrics.h \ - $$KERNEL_H/qguardedptr.h \ - $$KERNEL_H/qgif.h \ - $$KERNEL_H/qiconset.h \ - $$KERNEL_H/qimage.h \ + $$KERNEL_H/ntqfontinfo.h \ + $$KERNEL_H/ntqfontmetrics.h \ + $$KERNEL_H/ntqguardedptr.h \ + $$KERNEL_H/ntqgif.h \ + $$KERNEL_H/ntqiconset.h \ + $$KERNEL_H/ntqimage.h \ $$KERNEL_P/qimageformatinterface_p.h \ - $$KERNEL_H/qimageformatplugin.h \ - $$KERNEL_H/qkeycode.h \ - $$KERNEL_H/qkeysequence.h \ - $$KERNEL_H/qlayout.h \ + $$KERNEL_H/ntqimageformatplugin.h \ + $$KERNEL_H/ntqkeycode.h \ + $$KERNEL_H/ntqkeysequence.h \ + $$KERNEL_H/ntqlayout.h \ $$KERNEL_P/qlayoutengine_p.h \ - $$KERNEL_H/qtranslator.h \ - $$KERNEL_H/qmetaobject.h \ - $$KERNEL_H/qmime.h \ - $$KERNEL_H/qmovie.h \ - $$KERNEL_H/qnamespace.h \ - $$KERNEL_H/qnetworkprotocol.h \ - $$KERNEL_H/qobject.h \ - $$KERNEL_H/qobjectcleanuphandler.h \ - $$KERNEL_H/qobjectdefs.h \ - $$KERNEL_H/qobjectdict.h \ - $$KERNEL_H/qobjectlist.h \ - $$KERNEL_H/qpaintdevice.h \ - $$KERNEL_H/qpaintdevicedefs.h \ - $$KERNEL_H/qpainter.h \ + $$KERNEL_H/ntqtranslator.h \ + $$KERNEL_H/ntqmetaobject.h \ + $$KERNEL_H/ntqmime.h \ + $$KERNEL_H/ntqmovie.h \ + $$KERNEL_H/ntqnamespace.h \ + $$KERNEL_H/ntqnetworkprotocol.h \ + $$KERNEL_H/ntqobject.h \ + $$KERNEL_H/ntqobjectcleanuphandler.h \ + $$KERNEL_H/ntqobjectdefs.h \ + $$KERNEL_H/ntqobjectdict.h \ + $$KERNEL_H/ntqobjectlist.h \ + $$KERNEL_H/ntqpaintdevice.h \ + $$KERNEL_H/ntqpaintdevicedefs.h \ + $$KERNEL_H/ntqpainter.h \ $$KERNEL_P/qpainter_p.h \ - $$KERNEL_H/qpalette.h \ - $$KERNEL_H/qpaintdevicemetrics.h \ - $$KERNEL_H/qpen.h \ - $$KERNEL_H/qpicture.h \ - $$KERNEL_H/qpixmap.h \ - $$KERNEL_H/qpixmapcache.h \ - $$KERNEL_H/qpointarray.h \ - $$KERNEL_H/qpoint.h \ - $$KERNEL_H/qpolygonscanner.h \ - $$KERNEL_H/qprinter.h \ - $$KERNEL_H/qprocess.h \ - $$KERNEL_H/qrect.h \ - $$KERNEL_H/qregion.h \ - $$KERNEL_H/qsessionmanager.h \ - $$KERNEL_H/qsignal.h \ - $$KERNEL_H/qsignalmapper.h \ - $$KERNEL_H/qsignalslotimp.h \ - $$KERNEL_H/qsize.h \ - $$KERNEL_H/qsizegrip.h \ - $$KERNEL_H/qsizepolicy.h \ - $$KERNEL_H/qsocketnotifier.h \ - $$KERNEL_H/qsound.h \ - $$KERNEL_H/qstyle.h \ - $$KERNEL_H/qstylesheet.h \ - $$KERNEL_H/qthread.h \ - $$KERNEL_H/qtimer.h \ - $$KERNEL_H/qurl.h \ - $$KERNEL_H/qlocalfs.h \ - $$KERNEL_H/qurloperator.h \ - $$KERNEL_H/qurlinfo.h \ - $$KERNEL_H/qwidget.h \ - $$KERNEL_H/qwidgetintdict.h \ - $$KERNEL_H/qwidgetlist.h \ - $$KERNEL_H/qwindowdefs.h \ - $$KERNEL_H/qwmatrix.h \ - $$KERNEL_H/qvariant.h \ + $$KERNEL_H/ntqpalette.h \ + $$KERNEL_H/ntqpaintdevicemetrics.h \ + $$KERNEL_H/ntqpen.h \ + $$KERNEL_H/ntqpicture.h \ + $$KERNEL_H/ntqpixmap.h \ + $$KERNEL_H/ntqpixmapcache.h \ + $$KERNEL_H/ntqpointarray.h \ + $$KERNEL_H/ntqpoint.h \ + $$KERNEL_H/ntqpolygonscanner.h \ + $$KERNEL_H/ntqprinter.h \ + $$KERNEL_H/ntqprocess.h \ + $$KERNEL_H/ntqrect.h \ + $$KERNEL_H/ntqregion.h \ + $$KERNEL_H/ntqsessionmanager.h \ + $$KERNEL_H/ntqsignal.h \ + $$KERNEL_H/ntqsignalmapper.h \ + $$KERNEL_H/ntqsignalslotimp.h \ + $$KERNEL_H/ntqsize.h \ + $$KERNEL_H/ntqsizegrip.h \ + $$KERNEL_H/ntqsizepolicy.h \ + $$KERNEL_H/ntqsocketnotifier.h \ + $$KERNEL_H/ntqsound.h \ + $$KERNEL_H/ntqstyle.h \ + $$KERNEL_H/ntqstylesheet.h \ + $$KERNEL_H/ntqthread.h \ + $$KERNEL_H/ntqtimer.h \ + $$KERNEL_H/ntqurl.h \ + $$KERNEL_H/ntqlocalfs.h \ + $$KERNEL_H/ntqurloperator.h \ + $$KERNEL_H/ntqurlinfo.h \ + $$KERNEL_H/ntqwidget.h \ + $$KERNEL_H/ntqwidgetintdict.h \ + $$KERNEL_H/ntqwidgetlist.h \ + $$KERNEL_H/ntqwindowdefs.h \ + $$KERNEL_H/ntqwmatrix.h \ + $$KERNEL_H/ntqvariant.h \ $$KERNEL_P/qrichtext_p.h \ $$KERNEL_P/qinternal_p.h \ - $$KERNEL_H/qgplugin.h \ - $$KERNEL_H/qsimplerichtext.h \ + $$KERNEL_H/ntqgplugin.h \ + $$KERNEL_H/ntqsimplerichtext.h \ $$KERNEL_CPP/qscriptengine_p.h \ $$KERNEL_CPP/qtextengine_p.h \ $$KERNEL_CPP/qfontengine_p.h \ $$KERNEL_CPP/qtextlayout_p.h unix:x11 { - HEADERS += $$KERNEL_H/qinputcontext.h + HEADERS += $$KERNEL_H/ntqinputcontext.h } else { HEADERS += $$KERNEL_P/qinputcontext_p.h } @@ -252,13 +252,13 @@ kernel { $$KERNEL_CPP/qtextengine.cpp unix:HEADERS += $$KERNEL_P/qpsprinter_p.h \ - $$KERNEL_H/qfontdatabase.h + $$KERNEL_H/ntqfontdatabase.h embedded:SOURCES += $$KERNEL_CPP/qsharedmemory_p.cpp \ $$KERNEL_CPP/qfontengine_qws.cpp accessibility { - HEADERS += $$KERNEL_H/qaccessible.h + HEADERS += $$KERNEL_H/ntqaccessible.h SOURCES += $$KERNEL_CPP/qaccessible.cpp !embedded:!x11:mac:SOURCES += $$KERNEL_CPP/qaccessible_mac.cpp diff --git a/src/kernel/qt_pch.h b/src/kernel/qt_pch.h index 566a49087..e80d7bd6f 100644 --- a/src/kernel/qt_pch.h +++ b/src/kernel/qt_pch.h @@ -21,25 +21,25 @@ # undef _GLIBCPP_FULLY_COMPLIANT_HEADERS // Makes qlocale.cpp compile # endif # endif -#include // I must be first! +#include // I must be first! #include // All moc genereated code has this include -#include -#include -#include -#include -#include -#include -#include // All moc genereated code has this include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // All moc genereated code has this include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/kernel/qt_x11_p.h b/src/kernel/qt_x11_p.h index 4eb8b9a64..af13262f2 100644 --- a/src/kernel/qt_x11_p.h +++ b/src/kernel/qt_x11_p.h @@ -54,7 +54,7 @@ #ifndef QT_H -#include "qwindowdefs.h" +#include "ntqwindowdefs.h" #endif // QT_H // the following is necessary to work around breakage in many versions diff --git a/src/kernel/qtextengine.cpp b/src/kernel/qtextengine.cpp index 0d7c57560..c299e61a0 100644 --- a/src/kernel/qtextengine.cpp +++ b/src/kernel/qtextengine.cpp @@ -39,10 +39,10 @@ #include "qtextengine_p.h" #include "qscriptengine_p.h" -#include +#include #include "qfontdata_p.h" #include "qfontengine_p.h" -#include +#include #include #include diff --git a/src/kernel/qtextengine_p.h b/src/kernel/qtextengine_p.h index 4858672c5..d9619e290 100644 --- a/src/kernel/qtextengine_p.h +++ b/src/kernel/qtextengine_p.h @@ -38,9 +38,9 @@ #define TQTEXTENGINE_P_H #ifndef QT_H -#include "qglobal.h" -#include "qstring.h" -#include "qnamespace.h" +#include "ntqglobal.h" +#include "ntqstring.h" +#include "ntqnamespace.h" #include #endif // QT_H diff --git a/src/kernel/qtextlayout.cpp b/src/kernel/qtextlayout.cpp index 76f2420f5..edbd910ed 100644 --- a/src/kernel/qtextlayout.cpp +++ b/src/kernel/qtextlayout.cpp @@ -39,9 +39,9 @@ #include "qtextlayout_p.h" #include "qtextengine_p.h" -#include -#include -#include +#include +#include +#include TQRect TQTextItem::rect() const diff --git a/src/kernel/qtextlayout_p.h b/src/kernel/qtextlayout_p.h index 275288580..b4763c8e5 100644 --- a/src/kernel/qtextlayout_p.h +++ b/src/kernel/qtextlayout_p.h @@ -38,9 +38,9 @@ #define TQTEXTLAYOUT_P_H #ifndef QT_H -#include "qstring.h" -#include "qnamespace.h" -#include "qrect.h" +#include "ntqstring.h" +#include "ntqnamespace.h" +#include "ntqrect.h" #endif // QT_H class TQTextEngine; diff --git a/src/kernel/qthread.cpp b/src/kernel/qthread.cpp index 75291ff41..24239dbd9 100644 --- a/src/kernel/qthread.cpp +++ b/src/kernel/qthread.cpp @@ -40,11 +40,11 @@ #include "qplatformdefs.h" -#include "qthread.h" +#include "ntqthread.h" #include #ifndef QT_H -# include "qapplication.h" +# include "ntqapplication.h" #endif // QT_H #if QT_VERSION >= 0x040000 @@ -53,7 +53,7 @@ /*! - \class TQThread qthread.h + \class TQThread ntqthread.h \threadsafe \brief The TQThread class provides platform-independent threads. diff --git a/src/kernel/qthread.h b/src/kernel/qthread.h deleted file mode 100644 index 192772855..000000000 --- a/src/kernel/qthread.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Definition of TQThread class -** -** Created : 931107 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTHREAD_H -#define TQTHREAD_H - -#if defined(QT_THREAD_SUPPORT) - -#ifndef QT_H -#include "qwindowdefs.h" -#ifndef QT_NO_COMPAT -#include "qmutex.h" -#include "qsemaphore.h" -#include "qwaitcondition.h" -#endif // QT_NO_COMPAT -#endif // QT_H - -#include - -class TQThreadInstance; - -class Q_EXPORT TQThread : public TQt -{ -public: - static TQt::HANDLE currentThread(); - -#ifndef QT_NO_COMPAT - static void postEvent( TQObject *,TQEvent * ); -#endif - - static void initialize(); - static void cleanup(); - - static void exit(); - -#ifdef Q_QDOC - TQThread( unsigned int stackSize = 0 ); -#else - TQThread( unsigned int stackSize ); - TQThread(); -#endif - - virtual ~TQThread(); - - // default argument causes thread to block indefinately - bool wait( unsigned long time = ULONG_MAX ); - - enum Priority { - IdlePriority, - - LowestPriority, - LowPriority, - NormalPriority, - HighPriority, - HighestPriority, - - TimeCriticalPriority, - - InheritPriority - }; - -#ifdef Q_QDOC - void start( Priority = InheritPriority ); -#else - void start( Priority ); - void start(); -#endif - - void terminate(); - - bool finished() const; - bool running() const; - -protected: - virtual void run() = 0; - - static void sleep( unsigned long ); - static void msleep( unsigned long ); - static void usleep( unsigned long ); - -private: - TQThreadInstance * d; - friend class TQThreadInstance; - -#if defined(Q_DISABLE_COPY) - TQThread( const TQThread & ); - TQThread &operator=( const TQThread & ); -#endif // Q_DISABLE_COPY -}; - -#endif // QT_THREAD_SUPPORT - -#endif // TQTHREAD_H diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp index 9776beccd..35de76021 100644 --- a/src/kernel/qthread_unix.cpp +++ b/src/kernel/qthread_unix.cpp @@ -42,11 +42,11 @@ typedef pthread_mutex_t Q_MUTEX_T; -#include "qthread.h" +#include "ntqthread.h" #include #include #include -#include +#include #include #include diff --git a/src/kernel/qtimer.cpp b/src/kernel/qtimer.cpp index 33bb662cc..13bd9bba7 100644 --- a/src/kernel/qtimer.cpp +++ b/src/kernel/qtimer.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qtimer.h" -#include "qsignal.h" -#include "qobjectlist.h" +#include "ntqtimer.h" +#include "ntqsignal.h" +#include "ntqobjectlist.h" /*! - \class TQTimer qtimer.h + \class TQTimer ntqtimer.h \brief The TQTimer class provides timer signals and single-shot timers. \ingroup time @@ -302,8 +302,8 @@ bool TQSingleShotTimer::event( TQEvent * ) Example: \code - #include - #include + #include + #include int main( int argc, char **argv ) { diff --git a/src/kernel/qtimer.h b/src/kernel/qtimer.h deleted file mode 100644 index 3767e1d35..000000000 --- a/src/kernel/qtimer.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTimer class -** -** Created : 931111 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTIMER_H -#define TQTIMER_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - - -class Q_EXPORT TQTimer : public TQObject -{ - Q_OBJECT -public: - TQTimer( TQObject *parent=0, const char *name=0 ); - ~TQTimer(); - - bool isActive() const; - - int start( int msec, bool sshot = FALSE ); - void changeInterval( int msec ); - void stop(); - - static void singleShot( int msec, TQObject *receiver, const char *member ); - - int timerId() const { return id; } - -signals: - void timeout(); - -protected: - bool event( TQEvent * ); - -private: - int id; - uint single : 1; - uint nulltimer : 1; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTimer( const TQTimer & ); - TQTimer &operator=( const TQTimer & ); -#endif -}; - - -inline bool TQTimer::isActive() const -{ - return id >= 0; -} - - -#endif // TQTIMER_H diff --git a/src/kernel/qtkdeintegration_x11.cpp b/src/kernel/qtkdeintegration_x11.cpp index 14d45a564..b61920fcf 100644 --- a/src/kernel/qtkdeintegration_x11.cpp +++ b/src/kernel/qtkdeintegration_x11.cpp @@ -4,12 +4,12 @@ #define QT_CLEAN_NAMESPACE #include "qtkdeintegration_x11_p.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include bool TQKDEIntegration::inited = false; diff --git a/src/kernel/qtkdeintegration_x11_p.h b/src/kernel/qtkdeintegration_x11_p.h index bf247b3e7..10ee4443b 100644 --- a/src/kernel/qtkdeintegration_x11_p.h +++ b/src/kernel/qtkdeintegration_x11_p.h @@ -4,7 +4,7 @@ #ifndef TQKDEINTEGRATION_H #define TQKDEINTEGRATION_H -#include +#include class TQLibrary; class TQWidget; diff --git a/src/kernel/qtranslator.cpp b/src/kernel/qtranslator.cpp index a862de079..015b6cdb8 100644 --- a/src/kernel/qtranslator.cpp +++ b/src/kernel/qtranslator.cpp @@ -52,20 +52,20 @@ static inline int qt_open(const char *pathname, int flags, mode_t mode) # undef truncate #endif -#include "qtranslator.h" +#include "ntqtranslator.h" #ifndef QT_NO_TRANSLATION -#include "qfileinfo.h" -#include "qwidgetlist.h" -#include "qintdict.h" -#include "qstring.h" -#include "qapplication.h" -#include "qfile.h" -#include "qbuffer.h" -#include "qdatastream.h" -#include "qmap.h" -#include "qtl.h" +#include "ntqfileinfo.h" +#include "ntqwidgetlist.h" +#include "ntqintdict.h" +#include "ntqstring.h" +#include "ntqapplication.h" +#include "ntqfile.h" +#include "ntqbuffer.h" +#include "ntqdatastream.h" +#include "ntqmap.h" +#include "ntqtl.h" #if defined(Q_OS_UNIX) #define QT_USE_MMAP diff --git a/src/kernel/qtranslator.h b/src/kernel/qtranslator.h deleted file mode 100644 index 1d7273c2b..000000000 --- a/src/kernel/qtranslator.h +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** -** -** Definition of the translator class -** -** Created : 980906 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - - -#ifndef TQTRANSLATOR_H -#define TQTRANSLATOR_H - -#ifndef QT_H -#include "qobject.h" -#include "qvaluelist.h" -#endif // QT_H - -#ifndef QT_NO_TRANSLATION - -class TQTranslatorPrivate; - -class Q_EXPORT TQTranslatorMessage -{ -public: - TQTranslatorMessage(); - TQTranslatorMessage( const char * context, - const char * sourceText, - const char * comment, - const TQString& translation = TQString::null ); - TQTranslatorMessage( TQDataStream & ); - TQTranslatorMessage( const TQTranslatorMessage & m ); - - TQTranslatorMessage & operator=( const TQTranslatorMessage & m ); - - uint hash() const { return h; } - const char *context() const { return cx; } - const char *sourceText() const { return st; } - const char *comment() const { return cm; } - - void setTranslation( const TQString & translation ) { tn = translation; } - TQString translation() const { return tn; } - - enum Prefix { NoPrefix, Hash, HashContext, HashContextSourceText, - HashContextSourceTextComment }; - void write( TQDataStream & s, bool strip = FALSE, - Prefix prefix = HashContextSourceTextComment ) const; - Prefix commonPrefix( const TQTranslatorMessage& ) const; - - bool operator==( const TQTranslatorMessage& m ) const; - bool operator!=( const TQTranslatorMessage& m ) const - { return !operator==( m ); } - bool operator<( const TQTranslatorMessage& m ) const; - bool operator<=( const TQTranslatorMessage& m ) const - { return !m.operator<( *this ); } - bool operator>( const TQTranslatorMessage& m ) const - { return m.operator<( *this ); } - bool operator>=( const TQTranslatorMessage& m ) const - { return !operator<( m ); } - -private: - uint h; - TQCString cx; - TQCString st; - TQCString cm; - TQString tn; - - enum Tag { Tag_End = 1, Tag_SourceText16, Tag_Translation, Tag_Context16, - Tag_Hash, Tag_SourceText, Tag_Context, Tag_Comment, - Tag_Obsolete1 }; -}; - - -class Q_EXPORT TQTranslator: public TQObject -{ - Q_OBJECT -public: - TQTranslator( TQObject * parent = 0, const char * name = 0 ); - ~TQTranslator(); - -#ifndef QT_NO_COMPAT - TQString find( const char *context, const char *sourceText, const char * comment = 0 ) const { - return findMessage( context, sourceText, comment ).translation(); - } -#endif - virtual TQTranslatorMessage findMessage( const char *, const char *, - const char * = 0 ) const; - - bool load( const TQString & filename, - const TQString & directory = TQString::null, - const TQString & search_delimiters = TQString::null, - const TQString & suffix = TQString::null ); - bool load( const uchar *data, int len ) { - clear(); - return do_load( data, len ); - } - - void clear(); - -#ifndef QT_NO_TRANSLATION_BUILDER - enum SaveMode { Everything, Stripped }; - - bool save( const TQString & filename, SaveMode mode = Everything ); - - void insert( const TQTranslatorMessage& ); - void insert( const char *context, const char *sourceText, const TQString &translation ) { - insert( TQTranslatorMessage(context, sourceText, "", translation) ); - } - void remove( const TQTranslatorMessage& ); - void remove( const char *context, const char *sourceText ) { - remove( TQTranslatorMessage(context, sourceText, "") ); - } - bool contains( const char *, const char *, const char * comment = 0 ) const; - - void squeeze( SaveMode = Everything ); - void unsqueeze(); - - TQValueList messages() const; -#endif - - bool isEmpty() const; - -private: -#if defined(Q_DISABLE_COPY) - TQTranslator( const TQTranslator & ); - TQTranslator &operator=( const TQTranslator & ); -#endif - - bool do_load( const uchar *data, int len ); - - TQTranslatorPrivate * d; -}; - -#endif // QT_NO_TRANSLATION - -#endif diff --git a/src/kernel/qucomextra.cpp b/src/kernel/qucomextra.cpp index df1508140..a705784ba 100644 --- a/src/kernel/qucomextra.cpp +++ b/src/kernel/qucomextra.cpp @@ -39,7 +39,7 @@ **********************************************************************/ #include "qucomextra_p.h" -#include +#include #ifndef QT_NO_VARIANT diff --git a/src/kernel/qurl.cpp b/src/kernel/qurl.cpp index 6e2c10b5c..0a680e0d9 100644 --- a/src/kernel/qurl.cpp +++ b/src/kernel/qurl.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qurl.h" +#include "ntqurl.h" #ifndef QT_NO_URL -#include "qdir.h" +#include "ntqdir.h" #include @@ -92,7 +92,7 @@ static void slashify( TQString& s, bool allowMultiple = TRUE ) /*! - \class TQUrl qurl.h + \class TQUrl ntqurl.h \brief The TQUrl class provides a URL parser and simplifies working with URLs. \if defined(commercial) @@ -126,13 +126,13 @@ static void slashify( TQString& s, bool allowMultiple = TRUE ) Example: - http://doc.trolltech.com/qdockarea.html#lines + http://doc.trolltech.com/ntqdockarea.html#lines \table \header \i Function \i Returns \row \i \l protocol() \i "http" \row \i \l host() \i "doc.trolltech.com" - \row \i \l fileName() \i "qdockarea.html" + \row \i \l fileName() \i "ntqdockarea.html" \row \i \l ref() \i "lines" \endtable diff --git a/src/kernel/qurl.h b/src/kernel/qurl.h deleted file mode 100644 index a7430c9dd..000000000 --- a/src/kernel/qurl.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Definition of TQUrl class -** -** Created : 950429 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQURL_H -#define TQURL_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_URL - -class TQUrlPrivate; - -class Q_EXPORT TQUrl -{ -public: - TQUrl(); - TQUrl( const TQString& url ); - TQUrl( const TQUrl& url ); - TQUrl( const TQUrl& url, const TQString& relUrl, bool checkSlash = FALSE ); - virtual ~TQUrl(); - - TQString protocol() const; - virtual void setProtocol( const TQString& protocol ); - - TQString user() const; - virtual void setUser( const TQString& user ); - bool hasUser() const; - - TQString password() const; - virtual void setPassword( const TQString& pass ); - bool hasPassword() const; - - TQString host() const; - virtual void setHost( const TQString& user ); - bool hasHost() const; - - int port() const; - virtual void setPort( int port ); - bool hasPort() const; - - TQString path( bool correct = TRUE ) const; - virtual void setPath( const TQString& path ); - bool hasPath() const; - - virtual void setEncodedPathAndQuery( const TQString& enc ); - TQString encodedPathAndQuery(); - - virtual void setQuery( const TQString& txt ); - TQString query() const; - - TQString ref() const; - virtual void setRef( const TQString& txt ); - bool hasRef() const; - - bool isValid() const; - bool isLocalFile() const; - - virtual void addPath( const TQString& path ); - virtual void setFileName( const TQString& txt ); - - TQString fileName() const; - TQString dirPath() const; - - TQUrl& operator=( const TQUrl& url ); - TQUrl& operator=( const TQString& url ); - - bool operator==( const TQUrl& url ) const; - bool operator==( const TQString& url ) const; - - static void decode( TQString& url ); - static void encode( TQString& url ); - - operator TQString() const; - virtual TQString toString( bool encodedPath = FALSE, bool forcePrependProtocol = TRUE ) const; - - virtual bool cdUp(); - - static bool isRelativeUrl( const TQString &url ); - -protected: - virtual void reset(); - virtual bool parse( const TQString& url ); - -private: - TQUrlPrivate *d; - -}; - -#endif //QT_NO_URL - -#endif diff --git a/src/kernel/qurlinfo.cpp b/src/kernel/qurlinfo.cpp index 95b224cf7..aafea2a3e 100644 --- a/src/kernel/qurlinfo.cpp +++ b/src/kernel/qurlinfo.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qurlinfo.h" +#include "ntqurlinfo.h" #ifndef QT_NO_NETWORKPROTOCOL -#include "qurloperator.h" -#include "qdir.h" +#include "ntqurloperator.h" +#include "ntqdir.h" #include class TQUrlInfoPrivate @@ -81,7 +81,7 @@ public: /*! - \class TQUrlInfo qurlinfo.h + \class TQUrlInfo ntqurlinfo.h \brief The TQUrlInfo class stores information about URLs. \ingroup io @@ -257,7 +257,7 @@ TQUrlInfo::TQUrlInfo( const TQUrl &url, int permissions, const TQString &owner, /*! Sets the name of the URL to \a name. The name is the full text, - for example, "http://doc.trolltech.com/qurlinfo.html". + for example, "http://doc.trolltech.com/ntqurlinfo.html". If you call this function for an invalid URL info, this function turns it into a valid one. diff --git a/src/kernel/qurlinfo.h b/src/kernel/qurlinfo.h deleted file mode 100644 index bf6f751a2..000000000 --- a/src/kernel/qurlinfo.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Definition of TQUrlInfo class -** -** Created : 950429 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQURLINFO_H -#define TQURLINFO_H - -#ifndef QT_H -#include "qdatetime.h" -#include "qstring.h" -#if defined(QT_ABI_QT4) -#include "qiodevice.h" -#endif -#endif // QT_H - -class TQUrlOperator; -class TQUrl; -class TQUrlInfoPrivate; - -class Q_EXPORT TQUrlInfo -{ -public: - enum PermissionSpec { - ReadOwner = 00400, WriteOwner = 00200, ExeOwner = 00100, - ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010, - ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 }; - - TQUrlInfo(); - TQUrlInfo( const TQUrlOperator &path, const TQString &file ); - TQUrlInfo( const TQUrlInfo &ui ); -#if (QT_VERSION-0 >= 0x040000) -#error "TQUrlInfo::TQUrlInfo() should accept TQIODevice::Offset instead of uint" -#elif defined(QT_ABI_QT4) - TQUrlInfo( const TQString &name, int permissions, const TQString &owner, - const TQString &group, TQIODevice::Offset size, const TQDateTime &lastModified, - const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable ); - TQUrlInfo( const TQUrl &url, int permissions, const TQString &owner, - const TQString &group, TQIODevice::Offset size, const TQDateTime &lastModified, - const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable ); -#else - TQUrlInfo( const TQString &name, int permissions, const TQString &owner, - const TQString &group, uint size, const TQDateTime &lastModified, - const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable ); - TQUrlInfo( const TQUrl &url, int permissions, const TQString &owner, - const TQString &group, uint size, const TQDateTime &lastModified, - const TQDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable ); -#endif - TQUrlInfo &operator=( const TQUrlInfo &ui ); - virtual ~TQUrlInfo(); - - virtual void setName( const TQString &name ); - virtual void setDir( bool b ); - virtual void setFile( bool b ); - virtual void setSymLink( bool b ); - virtual void setOwner( const TQString &s ); - virtual void setGroup( const TQString &s ); -#if (QT_VERSION-0 >= 0x040000) -#error "TQUrlInfo::setSize() should accept TQIODevice::Offset instead of uint" -#elif defined(QT_ABI_QT4) - virtual void setSize( TQIODevice::Offset size ); -#else - virtual void setSize( uint size ); -#endif - virtual void setWritable( bool b ); - virtual void setReadable( bool b ); - virtual void setPermissions( int p ); - virtual void setLastModified( const TQDateTime &dt ); - - bool isValid() const; - - TQString name() const; - int permissions() const; - TQString owner() const; - TQString group() const; -#if (QT_VERSION-0 >= 0x040000) -#error "TQUrlInfo::size() should return TQIODevice::Offset instead of uint" -#elif defined(QT_ABI_QT4) - TQIODevice::Offset size() const; -#else - uint size() const; -#endif - 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 &i1, const TQUrlInfo &i2, - int sortBy ); - static bool lessThan( const TQUrlInfo &i1, const TQUrlInfo &i2, - int sortBy ); - static bool equal( const TQUrlInfo &i1, const TQUrlInfo &i2, - int sortBy ); - - bool operator==( const TQUrlInfo &i ) const; -private: - TQUrlInfoPrivate *d; - -}; - -#endif diff --git a/src/kernel/qurloperator.cpp b/src/kernel/qurloperator.cpp index ecec21620..e4cb185f4 100644 --- a/src/kernel/qurloperator.cpp +++ b/src/kernel/qurloperator.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qurloperator.h" +#include "ntqurloperator.h" #ifndef QT_NO_NETWORKPROTOCOL -#include "qurlinfo.h" -#include "qnetworkprotocol.h" -#include "qmap.h" -#include "qdir.h" -#include "qptrdict.h" -#include "qguardedptr.h" +#include "ntqurlinfo.h" +#include "ntqnetworkprotocol.h" +#include "ntqmap.h" +#include "ntqdir.h" +#include "ntqptrdict.h" +#include "ntqguardedptr.h" //#define TQURLOPERATOR_DEBUG @@ -89,7 +89,7 @@ public: }; /*! - \class TQUrlOperator qurloperator.h + \class TQUrlOperator ntqurloperator.h \brief The TQUrlOperator class provides common operations on URLs. \if defined(commercial) diff --git a/src/kernel/qurloperator.h b/src/kernel/qurloperator.h deleted file mode 100644 index 7b258161a..000000000 --- a/src/kernel/qurloperator.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Definition of TQUrlOperator class -** -** Created : 950429 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQURLOPERATOR_H -#define TQURLOPERATOR_H - -#ifndef QT_H -#include "qobject.h" -#include "qurl.h" -#include "qptrlist.h" -#include "qnetworkprotocol.h" -#include "qstringlist.h" // TQString->TQStringList conversion -#endif // QT_H - -#ifndef QT_NO_NETWORKPROTOCOL - -class TQUrlInfo; -class TQUrlOperatorPrivate; - -class Q_EXPORT TQUrlOperator : public TQObject, public TQUrl -{ - friend class TQNetworkProtocol; - - Q_OBJECT - -public: - TQUrlOperator(); - TQUrlOperator( const TQString &urL ); - TQUrlOperator( const TQUrlOperator& url ); - TQUrlOperator( const TQUrlOperator& url, const TQString& relUrl, bool checkSlash = FALSE ); - virtual ~TQUrlOperator(); - - virtual void setPath( const TQString& path ); - virtual bool cdUp(); - - virtual const TQNetworkOperation *listChildren(); - virtual const TQNetworkOperation *mkdir( const TQString &dirname ); - virtual const TQNetworkOperation *remove( const TQString &filename ); - virtual const TQNetworkOperation *rename( const TQString &oldname, const TQString &newname ); - virtual const TQNetworkOperation *get( const TQString &location = TQString::null ); - virtual const TQNetworkOperation *put( const TQByteArray &data, const TQString &location = TQString::null ); - virtual TQPtrList copy( const TQString &from, const TQString &to, bool move = FALSE, bool toPath = TRUE ); - virtual void copy( const TQStringList &files, const TQString &dest, bool move = FALSE ); - virtual bool isDir( bool *ok = 0 ); - - virtual void setNameFilter( const TQString &nameFilter ); - TQString nameFilter() const; - - virtual TQUrlInfo info( const TQString &entry ) const; - - TQUrlOperator& operator=( const TQUrlOperator &url ); - TQUrlOperator& operator=( const TQString &url ); - - virtual void stop(); - -signals: - void newChildren( const TQValueList &, TQNetworkOperation *res ); - void finished( TQNetworkOperation *res ); - void start( TQNetworkOperation *res ); - void createdDirectory( const TQUrlInfo &, TQNetworkOperation *res ); - void removed( TQNetworkOperation *res ); - void itemChanged( TQNetworkOperation *res ); - void data( const TQByteArray &, TQNetworkOperation *res ); - void dataTransferProgress( int bytesDone, int bytesTotal, TQNetworkOperation *res ); - void startedNextCopy( const TQPtrList &lst ); - void connectionStateChanged( int state, const TQString &data ); - -protected: - void reset(); - bool parse( const TQString& url ); - virtual bool checkValid(); - virtual void clearEntries(); - void getNetworkProtocol(); - void deleteNetworkProtocol(); - -private slots: - const TQNetworkOperation *startOperation( TQNetworkOperation *op ); - void copyGotData( const TQByteArray &data, TQNetworkOperation *op ); - void continueCopy( TQNetworkOperation *op ); - void finishedCopy(); - void addEntry( const TQValueList &i ); - void slotItemChanged( TQNetworkOperation *op ); - -private: - void deleteOperation( TQNetworkOperation *op ); - - TQUrlOperatorPrivate *d; -}; - -#endif // QT_NO_NETWORKPROTOCOL - -#endif // TQURLOPERATOR_H diff --git a/src/kernel/qvariant.cpp b/src/kernel/qvariant.cpp index 417c74dd6..6d4b5d1d1 100644 --- a/src/kernel/qvariant.cpp +++ b/src/kernel/qvariant.cpp @@ -40,31 +40,31 @@ #include -#include "qvariant.h" +#include "ntqvariant.h" #ifndef QT_NO_VARIANT -#include "qstring.h" -#include "qcstring.h" -#include "qfont.h" -#include "qpixmap.h" -#include "qimage.h" -#include "qbrush.h" -#include "qpoint.h" -#include "qrect.h" -#include "qsize.h" -#include "qcolor.h" -#include "qpalette.h" -#include "qiconset.h" -#include "qdatastream.h" -#include "qregion.h" -#include "qpointarray.h" -#include "qbitmap.h" -#include "qcursor.h" -#include "qdatetime.h" -#include "qsizepolicy.h" -#include "qshared.h" -#include "qbitarray.h" -#include "qkeysequence.h" -#include "qpen.h" +#include "ntqstring.h" +#include "ntqcstring.h" +#include "ntqfont.h" +#include "ntqpixmap.h" +#include "ntqimage.h" +#include "ntqbrush.h" +#include "ntqpoint.h" +#include "ntqrect.h" +#include "ntqsize.h" +#include "ntqcolor.h" +#include "ntqpalette.h" +#include "ntqiconset.h" +#include "ntqdatastream.h" +#include "ntqregion.h" +#include "ntqpointarray.h" +#include "ntqbitmap.h" +#include "ntqcursor.h" +#include "ntqdatetime.h" +#include "ntqsizepolicy.h" +#include "ntqshared.h" +#include "ntqbitarray.h" +#include "ntqkeysequence.h" +#include "ntqpen.h" #ifndef DBL_DIG #define DBL_DIG 10 @@ -354,7 +354,7 @@ void TQVariant::Private::clear() } /*! - \class TQVariant qvariant.h + \class TQVariant ntqvariant.h \brief The TQVariant class acts like a union for the most common TQt data types. \ingroup objectmodel @@ -475,7 +475,7 @@ void TQVariant::Private::clear() \value UInt an unsigned int Note that TQt's definition of bool depends on the compiler. - \c qglobal.h has the system-dependent definition of bool. + \c ntqglobal.h has the system-dependent definition of bool. */ /*! diff --git a/src/kernel/qvariant.h b/src/kernel/qvariant.h deleted file mode 100644 index 04cb4c24e..000000000 --- a/src/kernel/qvariant.h +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************** -** -** Definition of TQVariant class -** -** Created : 990414 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVARIANT_H -#define TQVARIANT_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_VARIANT -class TQString; -class TQCString; -class TQFont; -class TQPixmap; -class TQBrush; -class TQRect; -class TQPoint; -class TQImage; -class TQSize; -class TQColor; -class TQPalette; -class TQColorGroup; -class TQIconSet; -class TQDataStream; -class TQPointArray; -class TQRegion; -class TQBitmap; -class TQCursor; -class TQStringList; -class TQSizePolicy; -class TQDate; -class TQTime; -class TQDateTime; -class TQBitArray; -class TQKeySequence; -class TQPen; -// Some headers rejected after TQVariant declaration for GCC 2.7.* compatibility -class TQVariant; -#ifndef QT_NO_TEMPLATE_VARIANT -template class TQValueList; -template class TQValueListConstIterator; -template class TQValueListNode; -template class TQMap; -template class TQMapConstIterator; -#endif - -class Q_EXPORT TQVariant -{ -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(); - TQVariant( const TQVariant& ); -#ifndef QT_NO_DATASTREAM - TQVariant( TQDataStream& s ); -#endif - TQVariant( const TQString& ); - TQVariant( const TQCString& ); - TQVariant( const char* ); -#ifndef QT_NO_STRINGLIST - TQVariant( const TQStringList& ); -#endif - 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& ); -#ifndef QT_NO_ACCEL - TQVariant( const TQKeySequence& ); -#endif - TQVariant( const TQPen& ); -#ifndef QT_NO_TEMPLATE_VARIANT - TQVariant( const TQValueList& ); - TQVariant( const TQMap& ); -#endif - TQVariant( int ); - TQVariant( uint ); - TQVariant( Q_LLONG ); - TQVariant( Q_ULLONG ); - // ### Problems on some compilers ? - TQVariant( bool, int ); - TQVariant( double ); - TQVariant( TQSizePolicy ); - - TQVariant& operator= ( const TQVariant& ); - bool operator==( const TQVariant& ) const; - bool operator!=( const TQVariant& ) const; - - 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; -#ifndef QT_NO_STRINGLIST - const TQStringList toStringList() const; -#endif - 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; -#ifndef QT_NO_ACCEL - const TQKeySequence toKeySequence() const; -#endif - const TQPen toPen() const; - int toInt( bool * ok=0 ) const; - uint toUInt( bool * ok=0 ) const; - Q_LLONG toLongLong( bool * ok=0 ) const; - Q_ULLONG toULongLong( bool * ok=0 ) const; - bool toBool() const; - double toDouble( bool * ok=0 ) const; -#ifndef QT_NO_TEMPLATE_VARIANT - const TQValueList toList() const; - const TQMap toMap() const; -#endif - TQSizePolicy toSizePolicy() const; - -#ifndef QT_NO_TEMPLATE_VARIANT - TQValueListConstIterator stringListBegin() const; - TQValueListConstIterator stringListEnd() const; - TQValueListConstIterator listBegin() const; - TQValueListConstIterator listEnd() const; - TQMapConstIterator mapBegin() const; - TQMapConstIterator mapEnd() const; - TQMapConstIterator mapFind( const TQString& ) const; -#endif - TQString& asString(); - TQCString& asCString(); -#ifndef QT_NO_STRINGLIST - TQStringList& asStringList(); -#endif - 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(); -#ifndef QT_NO_ACCEL - TQKeySequence& asKeySequence(); -#endif - TQPen& asPen(); - int& asInt(); - uint& asUInt(); - Q_LLONG& asLongLong(); - Q_ULLONG& asULongLong(); - bool& asBool(); - double& asDouble(); -#ifndef QT_NO_TEMPLATE_VARIANT - TQValueList& asList(); - TQMap& asMap(); -#endif - TQSizePolicy& asSizePolicy(); - -#ifndef QT_NO_DATASTREAM - void load( TQDataStream& ); - void save( TQDataStream& ) const; -#endif - static const char* typeToName( Type typ ); - static Type nameToType( const char* name ); - -private: - void detach(); - - class Private : public TQShared - { - public: - Private(); - Private( Private* ); - ~Private(); - - void clear(); - - Type typ; - union - { - uint u; - int i; - Q_LLONG ll; - Q_ULLONG ull; - bool b; - double d; - void *ptr; - } value; - uint is_null : 1; // ## 4.0 merge with typ - }; - - Private* d; - -public: - void* rawAccess( void* ptr = 0, Type typ = Invalid, bool deepCopy = FALSE ); -}; - -// down here for GCC 2.7.* compatibility -#ifndef QT_H -#include "qvaluelist.h" -#include "qstringlist.h" -#include "qmap.h" -#endif // QT_H - -inline TQVariant::Type TQVariant::type() const -{ - return d->typ; -} - -inline bool TQVariant::isValid() const -{ - return (d->typ != Invalid); -} - -#ifndef QT_NO_TEMPLATE_VARIANT -inline TQValueListConstIterator TQVariant::stringListBegin() const -{ - if ( d->typ != StringList ) - return TQValueListConstIterator(); - return ((const TQStringList*)d->value.ptr)->begin(); -} - -inline TQValueListConstIterator TQVariant::stringListEnd() const -{ - if ( d->typ != StringList ) - return TQValueListConstIterator(); - return ((const TQStringList*)d->value.ptr)->end(); -} - -inline TQValueListConstIterator TQVariant::listBegin() const -{ - if ( d->typ != List ) - return TQValueListConstIterator(); - return ((const TQValueList*)d->value.ptr)->begin(); -} - -inline TQValueListConstIterator TQVariant::listEnd() const -{ - if ( d->typ != List ) - return TQValueListConstIterator(); - return ((const TQValueList*)d->value.ptr)->end(); -} - -inline TQMapConstIterator TQVariant::mapBegin() const -{ - if ( d->typ != Map ) - return TQMapConstIterator(); - return ((const TQMap*)d->value.ptr)->begin(); -} - -inline TQMapConstIterator TQVariant::mapEnd() const -{ - if ( d->typ != Map ) - return TQMapConstIterator(); - return ((const TQMap*)d->value.ptr)->end(); -} - -inline TQMapConstIterator TQVariant::mapFind( const TQString& key ) const -{ - if ( d->typ != Map ) - return TQMapConstIterator(); - return ((const TQMap*)d->value.ptr)->find( key ); -} -#endif - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream& operator>> ( TQDataStream& s, TQVariant& p ); -Q_EXPORT TQDataStream& operator<< ( TQDataStream& s, const TQVariant& p ); -Q_EXPORT TQDataStream& operator>> ( TQDataStream& s, TQVariant::Type& p ); -Q_EXPORT TQDataStream& operator<< ( TQDataStream& s, const TQVariant::Type p ); -#endif - -#endif //QT_NO_VARIANT -#endif // TQVARIANT_H diff --git a/src/kernel/qvfbhdr.h b/src/kernel/qvfbhdr.h deleted file mode 100644 index 3f6cbe34c..000000000 --- a/src/kernel/qvfbhdr.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** TQt/Embedded virtual framebuffer -** -** Created : 20000605 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVFBHDR_H -#define TQVFBHDR_H - -#ifndef QT_H -#include "qcolor.h" -#include "qrect.h" -#endif // QT_H - -#define QT_VFB_MOUSE_PIPE "/tmp/.qtvfb_mouse-%1" -#define QT_VFB_KEYBOARD_PIPE "/tmp/.qtvfb_keyboard-%1" - -struct TQVFbHeader -{ - int width; - int height; - int depth; - int linestep; - int dataoffset; - TQRect update; - bool dirty; - int numcols; - TQRgb clut[256]; -}; - -struct TQVFbKeyData -{ - unsigned int unicode; - unsigned int modifiers; - bool press; - bool repeat; -}; - -#endif diff --git a/src/kernel/qwidget.cpp b/src/kernel/qwidget.cpp index a4daa5c09..7833f14f6 100644 --- a/src/kernel/qwidget.cpp +++ b/src/kernel/qwidget.cpp @@ -39,25 +39,25 @@ **********************************************************************/ -#include "qobjectlist.h" -#include "qwidget.h" -#include "qwidgetlist.h" -#include "qwidgetintdict.h" -#include "qptrdict.h" -#include "qfocusdata.h" -#include "qcursor.h" -#include "qpixmap.h" -#include "qapplication.h" +#include "ntqobjectlist.h" +#include "ntqwidget.h" +#include "ntqwidgetlist.h" +#include "ntqwidgetintdict.h" +#include "ntqptrdict.h" +#include "ntqfocusdata.h" +#include "ntqcursor.h" +#include "ntqpixmap.h" +#include "ntqapplication.h" #include "qapplication_p.h" -#include "qbrush.h" -#include "qlayout.h" -#include "qstylefactory.h" -#include "qcleanuphandler.h" -#include "qstyle.h" -#include "qmetaobject.h" -#include "qguardedptr.h" +#include "ntqbrush.h" +#include "ntqlayout.h" +#include "ntqstylefactory.h" +#include "ntqcleanuphandler.h" +#include "ntqstyle.h" +#include "ntqmetaobject.h" +#include "ntqguardedptr.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #if defined(Q_WS_WIN) #include "qt_windows.h" @@ -70,7 +70,7 @@ /*! - \class TQWidget qwidget.h + \class TQWidget ntqwidget.h \brief The TQWidget class is the base class of all user interface objects. \ingroup abstractwidgets @@ -410,7 +410,7 @@ \endlist There are also some rather obscure events. They are listed in - \c qevent.h and you need to reimplement event() to handle them. + \c ntqevent.h and you need to reimplement event() to handle them. The default implementation of event() handles Tab and Shift+Tab (to move the keyboard focus), and passes on most other events to one of the more specialized handlers above. @@ -1248,7 +1248,7 @@ void TQWidget::deactivateWidgetCleanup() id. The window identifier type depends on the underlying window - system, see \c qwindowdefs.h for the actual definition. If there + system, see \c ntqwindowdefs.h for the actual definition. If there is no widget with this identifier, 0 is returned. */ diff --git a/src/kernel/qwidget.h b/src/kernel/qwidget.h deleted file mode 100644 index 94c4a3af9..000000000 --- a/src/kernel/qwidget.h +++ /dev/null @@ -1,1094 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWidget class -** -** Created : 931029 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWIDGET_H -#define TQWIDGET_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qobject.h" -#include "qpaintdevice.h" -#include "qpalette.h" -#include "qfont.h" -#include "qfontmetrics.h" -#include "qfontinfo.h" -#include "qsizepolicy.h" -#endif // QT_H - -#if defined(Q_WS_X11) && !defined(QT_NO_IM) -class TQInputContext; -#endif - -class TQLayout; -struct TQWExtra; -struct TQTLWExtra; -class TQFocusData; -class TQCursor; -class TQWSRegionManager; -class TQStyle; - -class Q_EXPORT TQWidget : public TQObject, public TQPaintDevice -{ - Q_OBJECT - Q_ENUMS( BackgroundMode FocusPolicy BackgroundOrigin ) - Q_PROPERTY( bool isTopLevel READ isTopLevel ) - Q_PROPERTY( bool isDialog READ isDialog ) - Q_PROPERTY( bool isModal READ isModal ) - Q_PROPERTY( bool isPopup READ isPopup ) - Q_PROPERTY( bool isDesktop READ isDesktop ) - Q_PROPERTY( bool enabled READ isEnabled WRITE setEnabled ) - Q_PROPERTY( TQRect geometry READ geometry WRITE setGeometry ) - Q_PROPERTY( TQRect frameGeometry READ frameGeometry ) - Q_PROPERTY( int x READ x ) - Q_PROPERTY( int y READ y ) - Q_PROPERTY( TQPoint pos READ pos WRITE move DESIGNABLE false STORED false ) - Q_PROPERTY( TQSize frameSize READ frameSize ) - Q_PROPERTY( TQSize size READ size WRITE resize DESIGNABLE false STORED false ) - Q_PROPERTY( int width READ width ) - Q_PROPERTY( int height READ height ) - Q_PROPERTY( TQRect rect READ rect ) - Q_PROPERTY( TQRect childrenRect READ childrenRect ) - Q_PROPERTY( TQRegion childrenRegion READ childrenRegion ) - Q_PROPERTY( TQSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy ) - Q_PROPERTY( TQSize minimumSize READ minimumSize WRITE setMinimumSize ) - Q_PROPERTY( TQSize maximumSize READ maximumSize WRITE setMaximumSize ) - Q_PROPERTY( int minimumWidth READ minimumWidth WRITE setMinimumWidth STORED false DESIGNABLE false ) - Q_PROPERTY( int minimumHeight READ minimumHeight WRITE setMinimumHeight STORED false DESIGNABLE false ) - Q_PROPERTY( int maximumWidth READ maximumWidth WRITE setMaximumWidth STORED false DESIGNABLE false ) - Q_PROPERTY( int maximumHeight READ maximumHeight WRITE setMaximumHeight STORED false DESIGNABLE false ) - Q_PROPERTY( TQSize sizeIncrement READ sizeIncrement WRITE setSizeIncrement ) - Q_PROPERTY( TQSize baseSize READ baseSize WRITE setBaseSize ) - Q_PROPERTY( BackgroundMode backgroundMode READ backgroundMode WRITE setBackgroundMode DESIGNABLE false ) - Q_PROPERTY( TQColor paletteForegroundColor READ paletteForegroundColor WRITE setPaletteForegroundColor RESET unsetPalette ) - Q_PROPERTY( TQColor paletteBackgroundColor READ paletteBackgroundColor WRITE setPaletteBackgroundColor RESET unsetPalette ) - Q_PROPERTY( TQPixmap paletteBackgroundPixmap READ paletteBackgroundPixmap WRITE setPaletteBackgroundPixmap RESET unsetPalette ) - Q_PROPERTY( TQBrush backgroundBrush READ backgroundBrush ) - Q_PROPERTY( TQColorGroup colorGroup READ colorGroup ) - Q_PROPERTY( TQPalette palette READ palette WRITE setPalette RESET unsetPalette STORED ownPalette ) - Q_PROPERTY( BackgroundOrigin backgroundOrigin READ backgroundOrigin WRITE setBackgroundOrigin ) - Q_PROPERTY( bool ownPalette READ ownPalette ) - Q_PROPERTY( TQFont font READ font WRITE setFont RESET unsetFont STORED ownFont ) - Q_PROPERTY( bool ownFont READ ownFont ) -#ifndef QT_NO_CURSOR - Q_PROPERTY( TQCursor cursor READ cursor WRITE setCursor RESET unsetCursor STORED ownCursor ) - Q_PROPERTY( bool ownCursor READ ownCursor ) -#endif -#ifndef QT_NO_WIDGET_TOPEXTRA - Q_PROPERTY( TQString caption READ caption WRITE setCaption ) - Q_PROPERTY( TQPixmap icon READ icon WRITE setIcon ) - Q_PROPERTY( TQString iconText READ iconText WRITE setIconText ) -#endif - Q_PROPERTY( bool mouseTracking READ hasMouseTracking WRITE setMouseTracking ) - Q_PROPERTY( bool underMouse READ hasMouse ) - Q_PROPERTY( bool isActiveWindow READ isActiveWindow ) - Q_PROPERTY( bool focusEnabled READ isFocusEnabled ) - Q_PROPERTY( FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy ) - Q_PROPERTY( bool focus READ hasFocus ) - Q_PROPERTY( bool updatesEnabled READ isUpdatesEnabled WRITE setUpdatesEnabled DESIGNABLE false ) - Q_PROPERTY( bool visible READ isVisible ) - Q_PROPERTY( TQRect visibleRect READ visibleRect ) // obsolete - Q_PROPERTY( bool hidden READ isHidden WRITE setHidden DESIGNABLE false SCRIPTABLE false ) - Q_PROPERTY( bool shown READ isShown WRITE setShown DESIGNABLE false SCRIPTABLE false ) - Q_PROPERTY( bool minimized READ isMinimized ) - Q_PROPERTY( bool maximized READ isMaximized ) - Q_PROPERTY( bool fullScreen READ isFullScreen ) - Q_PROPERTY( TQSize sizeHint READ sizeHint ) - Q_PROPERTY( TQSize minimumSizeHint READ minimumSizeHint ) - Q_PROPERTY( TQRect microFocusHint READ microFocusHint ) - Q_PROPERTY( bool acceptDrops READ acceptDrops WRITE setAcceptDrops ) - Q_PROPERTY( bool autoMask READ autoMask WRITE setAutoMask DESIGNABLE false SCRIPTABLE false ) - Q_PROPERTY( bool customWhatsThis READ customWhatsThis ) - Q_PROPERTY( bool inputMethodEnabled READ isInputMethodEnabled WRITE setInputMethodEnabled DESIGNABLE false SCRIPTABLE false ) - Q_PROPERTY( double windowOpacity READ windowOpacity WRITE setWindowOpacity DESIGNABLE false ) - -public: - Q_EXPLICIT TQWidget( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - ~TQWidget(); - - WId winId() const; - void setName( const char *name ); -#ifndef QT_NO_STYLE - // GUI style setting - - TQStyle &style() const; - void setStyle( TQStyle * ); - TQStyle* setStyle( const TQString& ); -#endif - // Widget types and states - - 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; - -public slots: - virtual void setEnabled( bool ); - void setDisabled( bool ); - - // Widget coordinates - -public: - TQRect frameGeometry() const; - const TQRect &geometry() const; - int x() const; - int y() const; - TQPoint pos() const; - TQSize frameSize() const; - TQSize size() const; - int width() const; - int height() const; - TQRect rect() const; - TQRect childrenRect() const; - TQRegion childrenRegion() const; - - TQSize minimumSize() const; - TQSize maximumSize() const; - int minimumWidth() const; - int minimumHeight() const; - int maximumWidth() const; - int maximumHeight() const; - void setMinimumSize( const TQSize & ); - virtual void setMinimumSize( int minw, int minh ); - void setMaximumSize( const TQSize & ); - virtual void setMaximumSize( int maxw, int maxh ); - void setMinimumWidth( int minw ); - void setMinimumHeight( int minh ); - void setMaximumWidth( int maxw ); - void setMaximumHeight( int maxh ); - - TQSize sizeIncrement() const; - void setSizeIncrement( const TQSize & ); - virtual void setSizeIncrement( int w, int h ); - TQSize baseSize() const; - void setBaseSize( const TQSize & ); - void setBaseSize( int basew, int baseh ); - - void setFixedSize( const TQSize & ); - void setFixedSize( int w, int h ); - void setFixedWidth( int w ); - void setFixedHeight( int h ); - - // Widget coordinate mapping - - 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; - - // Widget attribute functions - - BackgroundMode backgroundMode() const; - virtual void setBackgroundMode( BackgroundMode ); - void setBackgroundMode( BackgroundMode, BackgroundMode ); - - const TQColor & foregroundColor() const; - - const TQColor & eraseColor() const; - virtual void setEraseColor( const TQColor & ); - - const TQPixmap * erasePixmap() const; - virtual void setErasePixmap( const TQPixmap & ); - -#ifndef QT_NO_PALETTE - const TQColorGroup & colorGroup() const; - const TQPalette & palette() const; - bool ownPalette() const; - virtual void setPalette( const TQPalette & ); - void unsetPalette(); -#endif - - 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; - - TQFont font() const; - bool ownFont() const; - virtual void setFont( const TQFont & ); - void unsetFont(); - TQFontMetrics fontMetrics() const; - TQFontInfo fontInfo() const; - -#ifndef QT_NO_CURSOR - const TQCursor &cursor() const; - bool ownCursor() const; - virtual void setCursor( const TQCursor & ); - virtual void unsetCursor(); -#endif -#ifndef QT_NO_WIDGET_TOPEXTRA - TQString caption() const; - const TQPixmap *icon() const; - TQString iconText() const; -#endif - bool hasMouseTracking() const; - bool hasMouse() const; - - virtual void setMask( const TQBitmap & ); - virtual void setMask( const TQRegion & ); - void clearMask(); - - const TQColor & backgroundColor() const; // obsolete, use eraseColor() - virtual void setBackgroundColor( const TQColor & ); // obsolete, use setEraseColor() - const TQPixmap * backgroundPixmap() const; // obsolete, use erasePixmap() - virtual void setBackgroundPixmap( const TQPixmap & ); // obsolete, use setErasePixmap() - -public slots: -#ifndef QT_NO_WIDGET_TOPEXTRA - virtual void setCaption( const TQString &); - virtual void setIcon( const TQPixmap & ); - virtual void setIconText( const TQString &); -#endif - virtual void setMouseTracking( bool enable ); - - // Keyboard input focus functions - - virtual void setFocus(); - void clearFocus(); - -public: - enum FocusPolicy { - NoFocus = 0, - TabFocus = 0x1, - ClickFocus = 0x2, - StrongFocus = TabFocus | ClickFocus | 0x8, - WheelFocus = StrongFocus | 0x4 - }; - - bool isActiveWindow() const; - virtual void setActiveWindow(); - bool isFocusEnabled() const; - - FocusPolicy focusPolicy() const; - virtual void setFocusPolicy( FocusPolicy ); - bool hasFocus() const; - static void setTabOrder( TQWidget *, TQWidget * ); - virtual void setFocusProxy( TQWidget * ); - TQWidget * focusProxy() const; - - void setInputMethodEnabled( bool b ); - bool isInputMethodEnabled() const; - // Grab functions - - void grabMouse(); -#ifndef QT_NO_CURSOR - void grabMouse( const TQCursor & ); -#endif - void releaseMouse(); - void grabKeyboard(); - void releaseKeyboard(); - static TQWidget * mouseGrabber(); - static TQWidget * keyboardGrabber(); - - // Update/refresh functions - - bool isUpdatesEnabled() const; - -#if 0 //def Q_WS_QWS - void repaintUnclipped( const TQRegion &, bool erase = TRUE ); -#endif -public slots: - virtual void setUpdatesEnabled( bool enable ); - void update(); - void update( int x, int y, int w, int h ); - void update( const TQRect& ); - void repaint(); - void repaint( bool erase ); - void repaint( int x, int y, int w, int h, bool erase=TRUE ); - void repaint( const TQRect &, bool erase = TRUE ); - void repaint( const TQRegion &, bool erase = TRUE ); - - // Widget management functions - - virtual void show(); - virtual void hide(); - void setShown( bool show ); - void setHidden( bool hide ); -#ifndef QT_NO_COMPAT - void iconify() { showMinimized(); } -#endif - virtual void showMinimized(); - virtual void showMaximized(); - void showFullScreen(); - virtual void showNormal(); - virtual void polish(); - void constPolish() const; - bool close(); - - void raise(); - void lower(); - void stackUnder( TQWidget* ); - virtual void move( int x, int y ); - void move( const TQPoint & ); - virtual void resize( int w, int h ); - void resize( const TQSize & ); - virtual void setGeometry( int x, int y, int w, int h ); - virtual void setGeometry( const TQRect & ); // ### make non virtual in TQt 4? - -public: - virtual bool close( bool alsoDelete ); - bool isVisible() const; - bool isVisibleTo(TQWidget*) const; - bool isVisibleToTLW() const; // obsolete - TQRect visibleRect() const; // obsolete - bool isHidden() const; - bool isShown() const; - bool isMinimized() const; - bool isMaximized() const; - bool isFullScreen() const; - - uint windowState() const; - void setWindowState(uint windowState); - - virtual TQSize sizeHint() const; - virtual TQSize minimumSizeHint() const; - virtual TQSizePolicy sizePolicy() const; - virtual void setSizePolicy( TQSizePolicy ); - void setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw = FALSE ); - virtual int heightForWidth(int) const; - - TQRegion clipRegion() const; - -// ### move together with other slots in TQt 4.0 -public slots: - virtual void adjustSize(); - -public: -#ifndef QT_NO_LAYOUT - TQLayout * layout() const { return lay_out; } -#endif - void updateGeometry(); - virtual void reparent( TQWidget *parent, WFlags, const TQPoint &, - bool showIt=FALSE ); - void reparent( TQWidget *parent, const TQPoint &, - bool showIt=FALSE ); -#ifndef QT_NO_COMPAT - void recreate( TQWidget *parent, WFlags f, const TQPoint & p, - bool showIt=FALSE ) { reparent(parent,f,p,showIt); } -#endif - - void erase(); - void erase( int x, int y, int w, int h ); - void erase( const TQRect & ); - void erase( const TQRegion & ); - void scroll( int dx, int dy ); - void scroll( int dx, int dy, const TQRect& ); - - void drawText( int x, int y, const TQString &); - void drawText( const TQPoint &, const TQString &); - - // Misc. functions - - TQWidget * focusWidget() const; - TQRect microFocusHint() const; - - // drag and drop - - bool acceptDrops() const; - virtual void setAcceptDrops( bool on ); - - // transparency and pseudo transparency - - virtual void setAutoMask(bool); - bool autoMask() const; - - enum BackgroundOrigin { WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin }; - - virtual void setBackgroundOrigin( BackgroundOrigin ); - BackgroundOrigin backgroundOrigin() const; - TQPoint backgroundOffset() const; - - // whats this help - virtual bool customWhatsThis() const; - - TQWidget * parentWidget( bool sameWindow = FALSE ) const; - WState testWState( WState s ) const; - WFlags testWFlags( WFlags f ) const; - NFlags testNFlags( NFlags f ) const; - static TQWidget * find( WId ); - static TQWidgetMapper *wmapper(); - - TQWidget *childAt( int x, int y, bool includeThis = FALSE ) const; - TQWidget *childAt( const TQPoint &, bool includeThis = FALSE ) const; - -#if defined(Q_WS_QWS) - virtual TQGfx * graphicsContext(bool clip_children=TRUE) const; -#endif -#if defined(Q_WS_MAC) - TQRegion clippedRegion(bool do_children=TRUE); - uint clippedSerial(bool do_children=TRUE); -#ifndef TQMAC_NO_QUARTZ - CGContextRef macCGContext(bool clipped=TRUE) const; -#endif -#endif -#if defined(Q_WS_X11) - enum X11WindowType { - X11WindowTypeSelect, - X11WindowTypeCombo, - X11WindowTypeDND, - X11WindowTypeTooltip, - X11WindowTypeMenu, // torn-off - X11WindowTypeDropdown, - X11WindowTypePopup - }; - void x11SetWindowType( X11WindowType type = X11WindowTypeSelect ); - void x11SetWindowTransient( TQWidget* parent ); -#endif - void setWindowOpacity(double level); - double windowOpacity() const; - -protected: - // Event handlers - bool event( TQEvent * ); - virtual void mousePressEvent( TQMouseEvent * ); - virtual void mouseReleaseEvent( TQMouseEvent * ); - virtual void mouseDoubleClickEvent( TQMouseEvent * ); - virtual void mouseMoveEvent( TQMouseEvent * ); -#ifndef QT_NO_WHEELEVENT - virtual void wheelEvent( TQWheelEvent * ); -#endif - 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 * ); - -#ifndef QT_NO_DRAGANDDROP - virtual void dragEnterEvent( TQDragEnterEvent * ); - virtual void dragMoveEvent( TQDragMoveEvent * ); - virtual void dragLeaveEvent( TQDragLeaveEvent * ); - virtual void dropEvent( TQDropEvent * ); -#endif - - virtual void showEvent( TQShowEvent * ); - virtual void hideEvent( TQHideEvent * ); - -#if defined(Q_WS_MAC) - virtual bool macEvent( MSG * ); -#endif -#if defined(Q_WS_WIN) - virtual bool winEvent( MSG * ); -#endif -#if defined(Q_WS_X11) - virtual bool x11Event( XEvent * ); -#endif -#if defined(Q_WS_QWS) - virtual bool qwsEvent( TQWSEvent * ); - virtual unsigned char *scanLine( int ) const; - virtual int bytesPerLine() const; -#endif - - virtual void updateMask(); - - // Misc. protected functions - -#ifndef QT_NO_STYLE - virtual void styleChange( TQStyle& ); -#endif - virtual void enabledChange( bool oldEnabled ); -#ifndef QT_NO_PALETTE - virtual void paletteChange( const TQPalette & ); -#endif - virtual void fontChange( const TQFont & ); - virtual void windowActivationChange( bool oldActive ); - - int metric( int ) const; - -#if defined(Q_WS_X11) -#if !defined(QT_NO_IM_EXTENSIONS) - virtual TQWidget *icHolderWidget(); -#else - TQWidget *icHolderWidget(); -#endif - TQInputContext *getInputContext(); - void changeInputContext( const TQString & ); - void sendMouseEventToInputContext( int x, TQEvent::Type type, - TQt::ButtonState button, - TQt::ButtonState state ); -#endif - void resetInputContext(); - - virtual void create( WId = 0, bool initializeWindow = TRUE, - bool destroyOldWindow = TRUE ); - virtual void destroy( bool destroyWindow = TRUE, - bool destroySubWindows = TRUE ); - uint getWState() const; - virtual void setWState( uint ); - void clearWState( uint n ); - WFlags getWFlags() const; - virtual void setWFlags( WFlags ); - void clearWFlags( WFlags n ); - NFlags getNFlags() const; - virtual void setNFlags( NFlags ); - void clearNFlags( NFlags n ); - - virtual bool focusNextPrevChild( bool next ); - - TQWExtra *extraData(); - TQTLWExtra *topData(); - TQFocusData *focusData(); - - virtual void setKeyCompression(bool); - virtual void setMicroFocusHint(int x, int y, int w, int h, bool text=TRUE, TQFont *f = 0); - -#if defined(Q_WS_MAC) - void dirtyClippedRegion(bool); - bool isClippedRegionDirty(); - virtual void setRegionDirty(bool); - virtual void macWidgetChangedWindow(); -#endif - -private slots: - void focusProxyDestroyed(); -#if defined(Q_WS_X11) - void destroyInputContext(); -#endif - -private: - void setFontSys( TQFont *f = 0 ); -#if defined(Q_WS_X11) - void createInputContext(); - void focusInputContext(); - void unfocusInputContext(); - void checkChildrenDnd(); - -#ifndef QT_NO_XSYNC - void createSyncCounter(); - void destroySyncCounter(); - void incrementSyncCounter(); - void handleSyncRequest( void* ev ); -#endif - -#elif defined(Q_WS_MAC) - uint own_id : 1, macDropEnabled : 1; - EventHandlerRef window_event; - //mac event functions - void propagateUpdates(bool update_rgn=TRUE); - void update( const TQRegion& ); - //friends, way too many - fix this immediately! - friend void qt_clean_root_win(); - friend bool qt_recreate_root_win(); - friend TQPoint posInWindow(TQWidget *); - friend bool qt_mac_update_sizer(TQWidget *, int); - friend TQWidget *qt_recursive_match(TQWidget *widg, int x, int y); - friend bool qt_paint_children(TQWidget *,TQRegion &, uchar ops); - friend TQMAC_PASCAL OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); - friend void qt_event_request_updates(TQWidget *, const TQRegion &, bool subtract); - friend bool qt_window_rgn(WId, short, RgnHandle, bool); - friend class TQDragManager; -#endif - -#ifndef QT_NO_LAYOUT - void setLayout( TQLayout *l ); -#endif - void setWinId( WId ); - void showWindow(); - void hideWindow(); - void showChildren( bool spontaneous ); - void hideChildren( bool spontaneous ); - void reparentSys( TQWidget *parent, WFlags, const TQPoint &, bool showIt); - void createTLExtra(); - void createExtra(); - void deleteExtra(); - void createSysExtra(); - void deleteSysExtra(); - void createTLSysExtra(); - void deleteTLSysExtra(); - void deactivateWidgetCleanup(); - void internalSetGeometry( int, int, int, int, bool ); - void reparentFocusWidgets( TQWidget * ); - TQFocusData *focusData( bool create ); - void setBackgroundFromMode(); - void setBackgroundColorDirect( const TQColor & ); - void setBackgroundPixmapDirect( const TQPixmap & ); - void setBackgroundModeDirect( BackgroundMode ); - void setBackgroundEmpty(); - void updateFrameStrut() const; -#if defined(Q_WS_X11) - void setBackgroundX11Relative(); -#endif - - WId winid; - uint widget_state; - uint widget_flags; - uint netwm_flags; - uint reserved_1; - uint reserved_2; - uint reserved_3; - uint reserved_4; - uint focus_policy : 4; - uint own_font :1; - uint own_palette :1; - uint sizehint_forced :1; - uint is_closing :1; - uint in_show : 1; - uint in_show_maximized : 1; - uint fstrut_dirty : 1; - uint im_enabled : 1; - TQRect crect; - TQColor bg_col; -#ifndef QT_NO_PALETTE - TQPalette pal; -#endif - TQFont fnt; -#ifndef QT_NO_LAYOUT - TQLayout *lay_out; -#endif -#if defined(Q_WS_X11) && !defined(QT_NO_IM) && !defined(QT_NO_IM_EXTENSIONS) - TQInputContext *ic; // Input Context -#endif - TQWExtra *extra; -#if defined(Q_WS_QWS) - TQRegion req_region; // Requested region - mutable TQRegion paintable_region; // Paintable region - mutable bool paintable_region_dirty;// needs to be recalculated - mutable TQRegion alloc_region; // Allocated region - mutable bool alloc_region_dirty; // needs to be recalculated - mutable int overlapping_children; // Handle overlapping children - - int alloc_region_index; - int alloc_region_revision; - - void updateOverlappingChildren() const; - void setChildrenAllocatedDirty(); - void setChildrenAllocatedDirty( const TQRegion &r, const TQWidget *dirty=0 ); - bool isAllocatedRegionDirty() const; - void updateRequestedRegion( const TQPoint &gpos ); - TQRegion requestedRegion() const; - TQRegion allocatedRegion() const; - TQRegion paintableRegion() const; - - void updateGraphicsContext( TQGfx *qgfx_qws, bool clip_children ) const; -#ifndef QT_NO_CURSOR - void updateCursor( const TQRegion &r ) const; -#endif - - // used to accumulate dirty region when children moved/resized. - TQRegion dirtyChildren; - bool isSettingGeometry; - friend class TQWSManager; -#endif - static int instanceCounter; // Current number of widget instances - static int maxInstances; // Maximum number of widget instances - - static void createMapper(); - static void destroyMapper(); - static TQWidgetList *wList(); - static TQWidgetList *tlwList(); - static TQWidgetMapper *mapper; - friend class TQApplication; - friend class TQBaseApplication; - friend class TQPainter; - friend class TQFontMetrics; - friend class TQFontInfo; - friend class TQETWidget; - friend class TQLayout; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQWidget( const TQWidget & ); - TQWidget &operator=( const TQWidget & ); -#endif - -public: // obsolete functions to dissappear or to become inline in 3.0 -#ifndef QT_NO_PALETTE - void setPalette( const TQPalette &p, bool ) { setPalette( p ); } -#endif - void setFont( const TQFont &f, bool ) { setFont( f ); } -}; - - -inline TQt::WState TQWidget::testWState( WState s ) const -{ return (widget_state & s); } - -inline TQt::WFlags TQWidget::testWFlags( WFlags f ) const -{ return (widget_flags & f); } - -inline TQt::NFlags TQWidget::testNFlags( NFlags f ) const -{ return (netwm_flags & f); } - -inline WId TQWidget::winId() const -{ return winid; } - -inline bool TQWidget::isTopLevel() const -{ return testWFlags(WType_TopLevel); } - -inline bool TQWidget::isDialog() const -{ return testWFlags(WType_Dialog); } - -inline bool TQWidget::isPopup() const -{ return testWFlags(WType_Popup); } - -inline bool TQWidget::isDesktop() const -{ return testWFlags(WType_Desktop); } - -inline bool TQWidget::isEnabled() const -{ return !testWState(WState_Disabled); } - -inline bool TQWidget::isModal() const -{ return testWFlags(WShowModal); } - -inline bool TQWidget::isEnabledToTLW() const -{ return isEnabled(); } - -inline const TQRect &TQWidget::geometry() const -{ return crect; } - -inline TQSize TQWidget::size() const -{ return crect.size(); } - -inline int TQWidget::width() const -{ return crect.width(); } - -inline int TQWidget::height() const -{ return crect.height(); } - -inline TQRect TQWidget::rect() const -{ return TQRect(0,0,crect.width(),crect.height()); } - -inline int TQWidget::minimumWidth() const -{ return minimumSize().width(); } - -inline int TQWidget::minimumHeight() const -{ return minimumSize().height(); } - -inline int TQWidget::maximumWidth() const -{ return maximumSize().width(); } - -inline int TQWidget::maximumHeight() const -{ return maximumSize().height(); } - -inline void TQWidget::setMinimumSize( const TQSize &s ) -{ setMinimumSize(s.width(),s.height()); } - -inline void TQWidget::setMaximumSize( const TQSize &s ) -{ setMaximumSize(s.width(),s.height()); } - -inline void TQWidget::setSizeIncrement( const TQSize &s ) -{ setSizeIncrement(s.width(),s.height()); } - -inline void TQWidget::setBaseSize( const TQSize &s ) -{ setBaseSize(s.width(),s.height()); } - -inline const TQColor &TQWidget::eraseColor() const -{ return bg_col; } - -#ifndef QT_NO_PALETTE -inline const TQPalette &TQWidget::palette() const -{ return pal; } -#endif - -inline TQFont TQWidget::font() const -{ return fnt; } - -inline TQFontMetrics TQWidget::fontMetrics() const -{ return TQFontMetrics(font()); } - -inline TQFontInfo TQWidget::fontInfo() const -{ return TQFontInfo(font()); } - -inline bool TQWidget::hasMouseTracking() const -{ return testWState(WState_MouseTracking); } - -inline bool TQWidget::hasMouse() const -{ return testWState(WState_HasMouse); } - -inline bool TQWidget::isFocusEnabled() const -{ return (FocusPolicy)focus_policy != NoFocus; } - -inline TQWidget::FocusPolicy TQWidget::focusPolicy() const -{ return (FocusPolicy)focus_policy; } - -inline bool TQWidget::isUpdatesEnabled() const -{ return !testWState(WState_BlockUpdates); } - -inline void TQWidget::update( const TQRect &r ) -{ update( r.x(), r.y(), r.width(), r.height() ); } - -inline void TQWidget::repaint() -{ repaint( TRUE ); } - -inline void TQWidget::repaint( const TQRect &r, bool erase ) -{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); } - -inline void TQWidget::erase() -{ erase( 0, 0, crect.width(), crect.height() ); } - -inline void TQWidget::erase( const TQRect &r ) -{ erase( r.x(), r.y(), r.width(), r.height() ); } - -inline bool TQWidget::close() -{ return close( FALSE ); } - -inline bool TQWidget::isVisible() const -{ return testWState(WState_Visible); } - -inline bool TQWidget::isVisibleToTLW() const // obsolete -{ return isVisible(); } - -inline bool TQWidget::isHidden() const -{ return testWState(WState_ForceHide); } - -inline bool TQWidget::isShown() const -{ return !testWState(WState_ForceHide); } - -inline void TQWidget::move( const TQPoint &p ) -{ move( p.x(), p.y() ); } - -inline void TQWidget::resize( const TQSize &s ) -{ resize( s.width(), s.height()); } - -inline void TQWidget::setGeometry( const TQRect &r ) -{ setGeometry( r.left(), r.top(), r.width(), r.height() ); } - -inline void TQWidget::drawText( const TQPoint &p, const TQString &s ) -{ drawText( p.x(), p.y(), s ); } - -inline TQWidget *TQWidget::parentWidget( bool sameWindow ) const -{ - if ( sameWindow ) - return isTopLevel() ? 0 : (TQWidget *)TQObject::parent(); - return (TQWidget *)TQObject::parent(); -} - -inline TQWidgetMapper *TQWidget::wmapper() -{ return mapper; } - -inline uint TQWidget::getWState() const -{ return widget_state; } - -inline void TQWidget::setWState( uint f ) -{ widget_state |= f; } - -inline void TQWidget::clearWState( uint f ) -{ widget_state &= ~f; } - -inline TQt::WFlags TQWidget::getWFlags() const -{ return widget_flags; } - -inline TQt::NFlags TQWidget::getNFlags() const -{ return netwm_flags; } - -inline void TQWidget::setWFlags( WFlags f ) -{ widget_flags |= f; } - -inline void TQWidget::setNFlags( NFlags f ) -{ netwm_flags |= f; } - -inline void TQWidget::clearWFlags( WFlags f ) -{ widget_flags &= ~f; } - -inline void TQWidget::clearNFlags( NFlags f ) -{ netwm_flags &= ~f; } - -inline void TQWidget::constPolish() const -{ - if ( !testWState(WState_Polished) ) { - TQWidget* that = (TQWidget*) this; - that->polish(); - that->setWState(WState_Polished); // be on the safe side... - } -} -#ifndef QT_NO_CURSOR -inline bool TQWidget::ownCursor() const -{ - return testWState( WState_OwnCursor ); -} -#endif -inline bool TQWidget::ownFont() const -{ - return own_font; -} -#ifndef QT_NO_PALETTE -inline bool TQWidget::ownPalette() const -{ - return own_palette; -} -#endif - -inline void TQWidget::setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw ) -{ - setSizePolicy( TQSizePolicy( hor, ver, hfw) ); -} - -inline bool TQWidget::isInputMethodEnabled() const -{ - return (bool)im_enabled; -} - -// Extra TQWidget data -// - to minimize memory usage for members that are seldom used. -// - top-level widgets have extra extra data to reduce cost further - -class TQFocusData; -class TQWSManager; -#if defined(Q_WS_WIN) -class TQOleDropTarget; -#endif -#if defined(Q_WS_MAC) -class TQMacDndExtra; -#endif - -struct Q_EXPORT TQTLWExtra { -#ifndef QT_NO_WIDGET_TOPEXTRA - TQString caption; // widget caption - TQString iconText; // widget icon text - TQPixmap *icon; // widget icon -#endif - TQFocusData *focusData; // focus data (for TLW) - short incw, inch; // size increments - // frame strut - ulong fleft, fright, ftop, fbottom; - uint unused : 8; // not used at this point... -#if defined( Q_WS_WIN ) || defined( Q_WS_MAC ) - uint opacity : 8; // Stores opacity level on Windows/Mac OS X. -#endif - uint savedFlags; // Save widgetflags while showing fullscreen - short basew, baseh; // base sizes -#if defined(Q_WS_X11) - WId parentWinId; // parent window Id (valid after reparenting) - uint embedded : 1; // window is embedded in another TQt application - uint spont_unmapped: 1; // window was spontaneously unmapped - uint reserved: 1; // reserved - uint dnd : 1; // DND properties installed - uint uspos : 1; // User defined position - uint ussize : 1; // User defined size -#if defined(QT_NO_IM_EXTENSIONS) - void *xic; // Input Context -#endif -#ifndef QT_NO_XSYNC - ulong syncCounter; - uint syncRequestValue[2]; -#endif -#endif -#if defined(Q_WS_MAC) - WindowGroupRef group; - uint is_moved: 1; - uint resizer : 4; -#endif -#if defined(Q_WS_QWS) && !defined ( QT_NO_QWS_MANAGER ) - TQRegion decor_allocated_region; // decoration allocated region - TQWSManager *qwsManager; -#endif -#if defined(Q_WS_WIN) - HICON winIcon; // internal Windows icon -#endif - TQRect normalGeometry; // used by showMin/maximized/FullScreen -#ifdef Q_WS_WIN - uint style, exstyle; -#endif -}; - - -#define TQWIDGETSIZE_MAX 32767 - -// dear user: you can see this struct, but it is internal. do not touch. - -struct Q_EXPORT TQWExtra { - Q_INT16 minw, minh; // minimum size - Q_INT16 maxw, maxh; // maximum size - TQPixmap *bg_pix; // background pixmap - TQWidget *focus_proxy; -#ifndef QT_NO_CURSOR - TQCursor *curs; -#endif - TQTLWExtra *topextra; // only useful for TLWs -#if defined(Q_WS_WIN) - TQOleDropTarget *dropTarget; // drop target -#endif -#if defined(Q_WS_X11) - WId xDndProxy; // XDND forwarding to embedded windows -#endif -#if defined(Q_WS_MAC) - TQRegion clip_saved, clip_sibs, clip_children; - TQMacDndExtra *macDndExtra; - TQRegion dirty_area; - uint clip_dirty : 1, clip_serial : 15; - uint child_dirty : 1, child_serial : 15; -#ifndef TQMAC_NO_QUARTZ - uint ctx_children_clipped:1; -#endif // TQMAC_NO_QUARTZ - uint has_dirty_area:1; -#endif // Q_WS_MAC - uint bg_origin : 2; -#if defined(Q_WS_X11) - uint children_use_dnd : 1; - uint compress_events : 1; -#endif -#if defined(Q_WS_QWS) || defined(Q_WS_MAC) - TQRegion mask; // widget mask -#endif - char bg_mode; // background mode - char bg_mode_visual; // visual background mode -#ifndef QT_NO_STYLE - TQStyle* style; -#endif - TQRect micro_focus_hint; // micro focus hint - TQSizePolicy size_policy; -}; - -#define Q_DEFINED_QWIDGET -#include "qwinexport.h" - -#endif // TQWIDGET_H diff --git a/src/kernel/qwidget_x11.cpp b/src/kernel/qwidget_x11.cpp index 2d77cf658..9fc3e7d05 100644 --- a/src/kernel/qwidget_x11.cpp +++ b/src/kernel/qwidget_x11.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qapplication.h" +#include "ntqapplication.h" #include "qapplication_p.h" -#include "qnamespace.h" -#include "qpaintdevicemetrics.h" -#include "qpainter.h" -#include "qbitmap.h" -#include "qobjectlist.h" -#include "qlayout.h" -#include "qtextcodec.h" -#include "qdatetime.h" -#include "qcursor.h" +#include "ntqnamespace.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqpainter.h" +#include "ntqbitmap.h" +#include "ntqobjectlist.h" +#include "ntqlayout.h" +#include "ntqtextcodec.h" +#include "ntqdatetime.h" +#include "ntqcursor.h" #include "qt_x11_p.h" #include @@ -65,8 +65,8 @@ bool qt_wstate_iconified( WId ); void qt_updated_rootinfo(); #ifndef QT_NO_IM -#include "qinputcontext.h" -#include "qinputcontextfactory.h" +#include "ntqinputcontext.h" +#include "ntqinputcontextfactory.h" #endif // Paint event clipping magic diff --git a/src/kernel/qwidgetcreate_x11.cpp b/src/kernel/qwidgetcreate_x11.cpp index 05144cd99..25a17ccb1 100644 --- a/src/kernel/qwidgetcreate_x11.cpp +++ b/src/kernel/qwidgetcreate_x11.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qwidget.h" +#include "ntqwidget.h" #include "qt_x11_p.h" diff --git a/src/kernel/qwidgetintdict.h b/src/kernel/qwidgetintdict.h deleted file mode 100644 index 7fcc592f6..000000000 --- a/src/kernel/qwidgetintdict.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWidgetIntDict -** -** Created : 950116 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWIDGETINTDICT_H -#define TQWIDGETINTDICT_H - -#ifndef QT_H -#include "qwidget.h" -#include "qintdict.h" -#endif // QT_H - - -#if defined(Q_TEMPLATEDLL) -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDict; -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDictIterator; -#endif - - -class Q_EXPORT TQWidgetIntDict : public TQIntDict -{ -public: - TQWidgetIntDict(int size=17) : TQIntDict(size) {} - TQWidgetIntDict( const TQWidgetIntDict &dict ) : TQIntDict(dict) {} - ~TQWidgetIntDict() { clear(); } - TQWidgetIntDict &operator=(const TQWidgetIntDict &dict) - { return (TQWidgetIntDict&)TQIntDict::operator=(dict); } -}; - -class Q_EXPORT TQWidgetIntDictIt : public TQIntDictIterator -{ -public: - TQWidgetIntDictIt( const TQWidgetIntDict &d ) : TQIntDictIterator(d) {} - TQWidgetIntDictIt &operator=(const TQWidgetIntDictIt &i) - { return (TQWidgetIntDictIt&)TQIntDictIterator::operator=(i); } -}; - - -#endif diff --git a/src/kernel/qwidgetlist.h b/src/kernel/qwidgetlist.h deleted file mode 100644 index 14a1bfd8a..000000000 --- a/src/kernel/qwidgetlist.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWidgetList -** -** Created : 950116 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWIDGETLIST_H -#define TQWIDGETLIST_H - -#ifndef QT_H -#include "qwidget.h" -#include "qptrlist.h" -#endif // QT_H - -class Q_EXPORT TQWidgetList : public TQPtrList -{ -public: - TQWidgetList() : TQPtrList() {} - TQWidgetList( const TQWidgetList &list ) : TQPtrList(list) {} - ~TQWidgetList() { clear(); } - TQWidgetList &operator=(const TQWidgetList &list) - { return (TQWidgetList&)TQPtrList::operator=(list); } -}; - -class Q_EXPORT TQWidgetListIt : public TQPtrListIterator -{ -public: - TQWidgetListIt( const TQWidgetList &l ) : TQPtrListIterator(l) {} - TQWidgetListIt &operator=(const TQWidgetListIt &i) - { return (TQWidgetListIt&)TQPtrListIterator::operator=(i); } -}; - -#endif // TQWIDGETLIST_H diff --git a/src/kernel/qwindowdefs.h b/src/kernel/qwindowdefs.h deleted file mode 100644 index 426ca1d37..000000000 --- a/src/kernel/qwindowdefs.h +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Definition of general window system dependent functions, types and -** constants -** -** Created : 931029 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWINDOWDEFS_H -#define TQWINDOWDEFS_H - -#ifndef QT_H -#include "qobjectdefs.h" -#include "qstring.h" -#include "qnamespace.h" -#endif // QT_H - -// Class forward definitions - -class TQPaintDevice; -class TQPaintDeviceMetrics; -class TQWidget; -class TQWidgetMapper; -class TQDialog; -class TQColor; -class TQColorGroup; -class TQPalette; -class TQCursor; -class TQPoint; -class TQSize; -class TQRect; -class TQPointArray; -class TQPainter; -class TQRegion; -class TQFont; -class TQFontMetrics; -class TQFontInfo; -class TQPen; -class TQBrush; -class TQWMatrix; -class TQPixmap; -class TQBitmap; -class TQMovie; -class TQImage; -class TQImageIO; -class TQPicture; -class TQPrinter; -class TQAccel; -class TQTimer; -class TQTime; -class TQClipboard; - - -// Widget list (defined in qwidgetlist.h) - -class TQWidgetList; -class TQWidgetListIt; - - -// Window system dependent definitions - -#if defined(Q_WS_MAC) -#if QT_MACOSX_VERSION < 0x1020 -typedef struct OpaqueEventLoopTimerRef* EventLoopTimerRef; -typedef struct OpaqueMenuHandle *MenuRef; -#else -typedef struct __EventLoopTimer* EventLoopTimerRef; -typedef struct OpaqueMenuRef* MenuRef; -#endif - -#ifndef Q_WS_MACX -typedef struct CGContext *CGContextRef; -#endif -typedef struct OpaqueWindowGroupRef *WindowGroupRef; -typedef struct OpaqueGrafPtr *CGrafPtr; -typedef struct OpaquePMPrintSession *PMPrintSession; -typedef struct OpaquePMPrintSettings *PMPrintSettings; -typedef struct OpaquePMPageFormat *PMPageFormat; -typedef struct Point Point; -typedef struct OpaqueEventHandlerRef* EventHandlerRef; -typedef struct OpaqueEventHandlerCallRef* EventHandlerCallRef; -typedef struct OpaqueEventRef* EventRef; -typedef long int OSStatus; -typedef struct OpaqueScrapRef *ScrapRef; -typedef struct OpaqueRgnHandle *RgnHandle; -typedef struct OpaqueWindowPtr *WindowPtr; -typedef WindowPtr WindowRef; -typedef struct OpaqueGrafPtr *GWorldPtr; -typedef GWorldPtr GrafPtr; -typedef struct GDevice **GDHandle; -typedef struct ColorTable ColorTable; -typedef struct BitMap BitMap; -typedef struct EventRecord EventRecord; -typedef void * MSG; -typedef int WId; -typedef struct AEDesc AppleEvent; - -#endif // Q_WS_MAC - -#if defined(Q_WS_WIN) -#include "qwindowdefs_win.h" -#endif // Q_WS_WIN - - -#if defined(Q_OS_TEMP) -#include "qwinfunctions_wce.h" -#endif // Q_OS_TEMP - -#if defined(Q_WS_X11) - -typedef struct _XDisplay Display; -typedef union _XEvent XEvent; -typedef struct _XGC *GC; -typedef struct _XRegion *Region; -typedef unsigned long WId; - -Q_EXPORT Display *qt_xdisplay(); -Q_EXPORT int qt_xscreen(); -Q_EXPORT WId qt_xrootwin(); // ### REMOVE 4.0 -Q_EXPORT WId qt_xrootwin( int scrn ); // ### 4.0 add default arg of -1 -Q_EXPORT GC qt_xget_readonly_gc( int scrn, bool monochrome ); -Q_EXPORT GC qt_xget_temp_gc( int scrn, bool monochrome ); - -Q_EXPORT const char *qAppClass(); // get application class - -#endif // Q_WS_X11 - -#if defined(Q_WS_QWS) - -typedef unsigned long WId; -struct TQWSEvent; -class TQGfx; - -#endif // Q_WS_QWS - -class TQApplication; - -#if defined(NEEDS_QMAIN) -#define main qMain -#endif - -// Global platform-independent types and functions - -typedef Q_INT32 TQCOORD; // coordinate type -const TQCOORD TQCOORD_MAX = 2147483647; -const TQCOORD TQCOORD_MIN = -TQCOORD_MAX - 1; - -typedef unsigned int TQRgb; // RGB triplet - -Q_EXPORT const char *qAppName(); // get application name - -// Misc functions - -typedef void (*TQtCleanUpFunction)(); -Q_EXPORT void qAddPostRoutine( TQtCleanUpFunction ); -Q_EXPORT void qRemovePostRoutine( TQtCleanUpFunction ); - -#if !defined(QT_CLEAN_NAMESPACE) -// source compatibility with TQt 2.x -typedef TQtCleanUpFunction Q_CleanUpFunction; -#endif - - -#endif // TQWINDOWDEFS_H diff --git a/src/kernel/qwmatrix.cpp b/src/kernel/qwmatrix.cpp index 9b49dbae0..e85cb00cf 100644 --- a/src/kernel/qwmatrix.cpp +++ b/src/kernel/qwmatrix.cpp @@ -38,9 +38,9 @@ ** **********************************************************************/ -#include "qwmatrix.h" -#include "qdatastream.h" -#include "qregion.h" +#include "ntqwmatrix.h" +#include "ntqdatastream.h" +#include "ntqregion.h" #if defined(Q_WS_X11) double qsincos( double, bool calcCos ); // defined in qpainter_x11.cpp #else @@ -52,7 +52,7 @@ double qsincos( double, bool calcCos ); // defined in qpainter_x11.cpp #ifndef QT_NO_WMATRIX /*! - \class TQWMatrix qwmatrix.h + \class TQWMatrix ntqwmatrix.h \brief The TQWMatrix class specifies 2D transformations of a coordinate system. diff --git a/src/kernel/qwmatrix.h b/src/kernel/qwmatrix.h deleted file mode 100644 index 0cf1a4a8b..000000000 --- a/src/kernel/qwmatrix.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWMatrix class -** -** Created : 941020 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWMATRIX_H -#define TQWMATRIX_H - -#ifndef QT_H -#include "qwindowdefs.h" -#include "qpointarray.h" -#include "qrect.h" -#include "qregion.h" -#endif // QT_H - -#ifndef QT_NO_WMATRIX - - -class Q_EXPORT TQWMatrix // 2D transform matrix -{ -public: - TQWMatrix(); - TQWMatrix( double m11, double m12, double m21, double m22, - double dx, double dy ); - - void setMatrix( double m11, double m12, double m21, double m22, - double dx, double dy ); - - double m11() const { return _m11; } - double m12() const { return _m12; } - double m21() const { return _m21; } - double m22() const { return _m22; } - double dx() const { return _dx; } - double dy() const { return _dy; } - - void map( int x, int y, int *tx, int *ty ) const; - void map( double x, double y, double *tx, double *ty ) const; - TQRect mapRect( const TQRect & ) const; - - TQPoint map( const TQPoint &p ) const { return operator *( p ); } - TQRect map( const TQRect &r ) const { return mapRect ( r ); } - TQPointArray map( const TQPointArray &a ) const { return operator * ( a ); } - TQRegion map( const TQRegion &r ) const { return operator *( r ); } - TQRegion mapToRegion( const TQRect &r ) const { return operator *( r ); } - TQPointArray mapToPolygon( const TQRect &r ) const; - - void reset(); - bool isIdentity() const; - - TQWMatrix &translate( double dx, double dy ); - TQWMatrix &scale( double sx, double sy ); - TQWMatrix &shear( double sh, double sv ); - TQWMatrix &rotate( double a ); - - bool isInvertible() const { return (_m11*_m22 - _m12*_m21) != 0; } - double det() const { return _m11*_m22 - _m12*_m21; } - - TQWMatrix invert( bool * = 0 ) const; - - bool operator==( const TQWMatrix & ) const; - bool operator!=( const TQWMatrix & ) const; - TQWMatrix &operator*=( const TQWMatrix & ); - - /* we use matrix multiplication semantics here */ - TQPoint operator * (const TQPoint & ) const; - TQRegion operator * (const TQRect & ) const; - TQRegion operator * (const TQRegion & ) const; - TQPointArray operator * ( const TQPointArray &a ) const; - - enum TransformationMode { - Points, Areas - }; - static void setTransformationMode( TQWMatrix::TransformationMode m ); - static TransformationMode transformationMode(); -private: - double _m11, _m12; - double _m21, _m22; - double _dx, _dy; -}; - -Q_EXPORT TQWMatrix operator*( const TQWMatrix &, const TQWMatrix & ); - - -/***************************************************************************** - TQWMatrix stream functions - *****************************************************************************/ - -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQWMatrix & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQWMatrix & ); - - -#endif // QT_NO_WMATRIX - -#endif // TQWMATRIX_H diff --git a/src/moc/moc.l b/src/moc/moc.l index 91c170c37..ea5669661 100644 --- a/src/moc/moc.l +++ b/src/moc/moc.l @@ -65,7 +65,7 @@ long buf_size_total = 0, buf_index = 0; } #endif -#include "qstring.h" +#include "ntqstring.h" #define input yyinput // yyinput in C++ diff --git a/src/moc/moc.y b/src/moc/moc.y index 5744269a7..ce1867373 100644 --- a/src/moc/moc.y +++ b/src/moc/moc.y @@ -59,14 +59,14 @@ void yyerror( const char *msg ); #include "qplatformdefs.h" -#include "qasciidict.h" -#include "qdatetime.h" -#include "qdict.h" -#include "qfile.h" -#include "qdir.h" -#include "qptrlist.h" -#include "qregexp.h" -#include "qstrlist.h" +#include "ntqasciidict.h" +#include "ntqdatetime.h" +#include "ntqdict.h" +#include "ntqfile.h" +#include "ntqdir.h" +#include "ntqptrlist.h" +#include "ntqregexp.h" +#include "ntqstrlist.h" #ifdef MOC_MWERKS_PLUGIN # ifdef Q_OS_MACX # undef OLD_DEBUG @@ -569,7 +569,7 @@ class parser_reg { bool noInclude; // no #include bool generatedCode; // no code generated bool mocError; // moc parsing error occurred - bool hasVariantIncluded; //whether or not qvariant.h was included yet + bool hasVariantIncluded; //whether or not ntqvariant.h was included yet TQCString className; // name of parsed class TQCString superClassName; // name of first super class TQStrList multipleSuperClasses; // other superclasses @@ -646,10 +646,10 @@ int tmpYYStart; // Used to store the lexers current mode int tmpYYStart2; // Used to store the lexers current mode // (if tmpYYStart is already used) -// if the format revision changes, you MUST change it in qmetaobject.h too +// if the format revision changes, you MUST change it in ntqmetaobject.h too const int formatRevision = 26; // moc output format revision -// if the flags change, you HAVE to change it in qmetaobject.h too +// if the flags change, you HAVE to change it in ntqmetaobject.h too enum Flags { Invalid = 0x00000000, Readable = 0x00000001, @@ -2906,8 +2906,8 @@ void generateClass() // generate C++ source code for a class g->includeFiles.next(); } } - fprintf( out, "#include <%sqmetaobject.h>\n", (const char*)g->qtPath ); - fprintf( out, "#include <%sqapplication.h>\n\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqmetaobject.h>\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqapplication.h>\n\n", (const char*)g->qtPath ); fprintf( out, "#include <%sprivate/qucomextra_p.h>\n", (const char*)g->qtPath ); fprintf( out, "#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != %d)\n", formatRevision ); fprintf( out, "#error \"This file was generated using the moc from %s." @@ -2925,7 +2925,7 @@ void generateClass() // generate C++ source code for a class needToIncludeVariant = ( f->type != "void" && !validUType( f->type ) && isVariantType( f->type) ); if ( needToIncludeVariant ) { - fprintf( out, "#include <%sqvariant.h>\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqvariant.h>\n", (const char*)g->qtPath ); g->hasVariantIncluded = TRUE; } } @@ -3115,8 +3115,8 @@ void generateClass() // generate C++ source code for a class if ( !predef_call_func && !included_list_headers ) { // yes we need it, because otherwise QT_VERSION may not be defined - fprintf( out, "\n#include <%sqobjectdefs.h>\n", (const char*)g->qtPath ); - fprintf( out, "#include <%sqsignalslotimp.h>\n", (const char*)g->qtPath ); + fprintf( out, "\n#include <%sntqobjectdefs.h>\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqsignalslotimp.h>\n", (const char*)g->qtPath ); included_list_headers = TRUE; } diff --git a/src/moc/moc_lex.cpp b/src/moc/moc_lex.cpp index 6edb1e8ab..0bcb929cb 100644 --- a/src/moc/moc_lex.cpp +++ b/src/moc/moc_lex.cpp @@ -993,7 +993,7 @@ long buf_size_total = 0, buf_index = 0; } #endif -#include "qstring.h" +#include "ntqstring.h" #define input yyinput // yyinput in C++ diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index 81c7c5eaa..575f1f6b4 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -13,14 +13,14 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; void yyerror( const char *msg ); #include "qplatformdefs.h" -#include "qasciidict.h" -#include "qdatetime.h" -#include "qdict.h" -#include "qfile.h" -#include "qdir.h" -#include "qptrlist.h" -#include "qregexp.h" -#include "qstrlist.h" +#include "ntqasciidict.h" +#include "ntqdatetime.h" +#include "ntqdict.h" +#include "ntqfile.h" +#include "ntqdir.h" +#include "ntqptrlist.h" +#include "ntqregexp.h" +#include "ntqstrlist.h" #ifdef MOC_MWERKS_PLUGIN # ifdef Q_OS_MACX # undef OLD_DEBUG @@ -523,7 +523,7 @@ class parser_reg { bool noInclude; /* no #include */ bool generatedCode; /* no code generated*/ bool mocError; /* moc parsing error occurred*/ - bool hasVariantIncluded; /*whether or not qvariant.h was included yet*/ + bool hasVariantIncluded; /*whether or not ntqvariant.h was included yet*/ TQCString className; /* name of parsed class*/ TQCString superClassName; /* name of first super class*/ TQStrList multipleSuperClasses; /* other superclasses*/ @@ -600,10 +600,10 @@ int tmpYYStart; /* Used to store the lexers current mode*/ int tmpYYStart2; /* Used to store the lexers current mode*/ /* (if tmpYYStart is already used)*/ -/* if the format revision changes, you MUST change it in qmetaobject.h too*/ +/* if the format revision changes, you MUST change it in ntqmetaobject.h too*/ const int formatRevision = 26; /* moc output format revision*/ -/* if the flags change, you HAVE to change it in qmetaobject.h too*/ +/* if the flags change, you HAVE to change it in ntqmetaobject.h too*/ enum Flags { Invalid = 0x00000000, Readable = 0x00000001, @@ -2946,8 +2946,8 @@ void generateClass() // generate C++ source code for a class g->includeFiles.next(); } } - fprintf( out, "#include <%sqmetaobject.h>\n", (const char*)g->qtPath ); - fprintf( out, "#include <%sqapplication.h>\n\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqmetaobject.h>\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqapplication.h>\n\n", (const char*)g->qtPath ); fprintf( out, "#include <%sprivate/qucomextra_p.h>\n", (const char*)g->qtPath ); fprintf( out, "#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != %d)\n", formatRevision ); fprintf( out, "#error \"This file was generated using the moc from %s." @@ -2965,7 +2965,7 @@ void generateClass() // generate C++ source code for a class needToIncludeVariant = ( f->type != "void" && !validUType( f->type ) && isVariantType( f->type) ); if ( needToIncludeVariant ) { - fprintf( out, "#include <%sqvariant.h>\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqvariant.h>\n", (const char*)g->qtPath ); g->hasVariantIncluded = TRUE; } } @@ -3155,8 +3155,8 @@ void generateClass() // generate C++ source code for a class if ( !predef_call_func && !included_list_headers ) { // yes we need it, because otherwise QT_VERSION may not be defined - fprintf( out, "\n#include <%sqobjectdefs.h>\n", (const char*)g->qtPath ); - fprintf( out, "#include <%sqsignalslotimp.h>\n", (const char*)g->qtPath ); + fprintf( out, "\n#include <%sntqobjectdefs.h>\n", (const char*)g->qtPath ); + fprintf( out, "#include <%sntqsignalslotimp.h>\n", (const char*)g->qtPath ); included_list_headers = TRUE; } diff --git a/src/network/ntqdns.h b/src/network/ntqdns.h new file mode 100644 index 000000000..96f09d265 --- /dev/null +++ b/src/network/ntqdns.h @@ -0,0 +1,170 @@ +/**************************************************************************** +** +** Definition of TQDns class. +** +** Created : 991122 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDNS_H +#define TQDNS_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqhostaddress.h" +#include "ntqsocketnotifier.h" +#include "ntqstringlist.h" +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_DNS +#else +#define TQM_EXPORT_DNS Q_EXPORT +#endif + +#ifndef QT_NO_DNS + +//#define Q_DNS_SYNCHRONOUS + +class TQDnsPrivate; + +class TQM_EXPORT_DNS TQDns: public TQObject { + Q_OBJECT +public: + enum RecordType { + None, + A, Aaaa, + Mx, Srv, + Cname, + Ptr, + Txt + }; + + TQDns(); + TQDns( const TQString & label, RecordType rr = A ); + TQDns( const TQHostAddress & address, RecordType rr = Ptr ); + virtual ~TQDns(); + + // to set/change the query + virtual void setLabel( const TQString & label ); + virtual void setLabel( const TQHostAddress & address ); + TQString label() const { return l; } + + virtual void setRecordType( RecordType rr = A ); + RecordType recordType() const { return t; } + + // whether something is happening behind the scenes + bool isWorking() const; + + // to query for replies + TQValueList addresses() const; + + class TQM_EXPORT_DNS MailServer { + public: + MailServer( const TQString & n=TQString::null, Q_UINT16 p=0 ) + :name(n), priority(p) {} + TQString name; + Q_UINT16 priority; + Q_DUMMY_COMPARISON_OPERATOR(MailServer) + }; + TQValueList mailServers() const; + + class TQM_EXPORT_DNS Server { + public: + Server(const TQString & n=TQString::null, Q_UINT16 p=0, Q_UINT16 w=0, Q_UINT16 po=0 ) + : name(n), priority(p), weight(w), port(po) {} + TQString name; + Q_UINT16 priority; + Q_UINT16 weight; + Q_UINT16 port; + Q_DUMMY_COMPARISON_OPERATOR(Server) + }; + TQValueList servers() const; + + TQStringList hostNames() const; + + TQStringList texts() const; + + TQString canonicalName() const; // ### real-world but uncommon: TQStringList + + TQStringList qualifiedNames() const { return n; } + +#if defined(Q_DNS_SYNCHRONOUS) +protected: + void connectNotify( const char *signal ); +#endif + +signals: + void resultsReady(); + +private slots: + void startQuery(); + +private: + static void doResInit(); + void setStartQueryTimer(); + static TQString toInAddrArpaDomain( const TQHostAddress &address ); +#if defined(Q_DNS_SYNCHRONOUS) + void doSynchronousLookup(); +#endif + + TQString l; + TQStringList n; + RecordType t; + TQDnsPrivate * d; + + friend class TQDnsAnswer; + friend class TQDnsManager; +}; + + +// TQDnsSocket are sockets that are used for DNS lookup + +class TQDnsSocket: public TQObject { + Q_OBJECT + // note: Private not public. This class contains NO public API. +protected: + TQDnsSocket( TQObject *, const char * ); + virtual ~TQDnsSocket(); + +private slots: + virtual void cleanCache(); + virtual void retransmit(); + virtual void answer(); +}; + +#endif // QT_NO_DNS + +#endif // TQDNS_H diff --git a/src/network/ntqftp.h b/src/network/ntqftp.h new file mode 100644 index 000000000..86ba65822 --- /dev/null +++ b/src/network/ntqftp.h @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Definition of TQFtp class. +** +** Created : 970521 +** +** Copyright (C) 1997-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFTP_H +#define TQFTP_H + +#ifndef QT_H +#include "ntqstring.h" // char*->TQString conversion +#include "ntqurlinfo.h" +#include "ntqnetworkprotocol.h" +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_FTP +#else +#define TQM_EXPORT_FTP Q_EXPORT +#endif + +#ifndef QT_NO_NETWORKPROTOCOL_FTP + + +class TQSocket; +class TQFtpCommand; + +class TQM_EXPORT_FTP TQFtp : public TQNetworkProtocol +{ + Q_OBJECT + +public: + TQFtp(); // ### TQt 4.0: get rid of this overload + TQFtp( TQObject *parent, const char *name=0 ); + virtual ~TQFtp(); + + int supportedOperations() const; + + // non-TQNetworkProtocol functions: + 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 &host, Q_UINT16 port=21 ); + int login( const TQString &user=TQString::null, const TQString &password=TQString::null ); + int close(); + int list( const TQString &dir=TQString::null ); + int cd( const TQString &dir ); + int get( const TQString &file, TQIODevice *dev=0 ); + int put( const TQByteArray &data, const TQString &file ); + int put( TQIODevice *dev, const TQString &file ); + int remove( const TQString &file ); + int mkdir( const TQString &dir ); + int rmdir( const TQString &dir ); + int rename( const TQString &oldname, const TQString &newname ); + + int rawCommand( const TQString &command ); + + Q_ULONG bytesAvailable() const; + Q_LONG readBlock( char *data, Q_ULONG maxlen ); + TQByteArray readAll(); + + 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 &buffer, TQUrlInfo &info ); // ### TQt 4.0: delete this? (not public API) + void operationListChildren( TQNetworkOperation *op ); + void operationMkDir( TQNetworkOperation *op ); + void operationRemove( TQNetworkOperation *op ); + void operationRename( TQNetworkOperation *op ); + void operationGet( TQNetworkOperation *op ); + void operationPut( TQNetworkOperation *op ); + + // ### TQt 4.0: delete these + // unused variables: + TQSocket *commandSocket, *dataSocket; + bool connectionReady, passiveMode; + int getTotalSize, getDoneSize; + bool startGetOnFail; + int putToWrite, putWritten; + bool errorInListChildren; + +private: + void init(); + int addCommand( TQFtpCommand * ); + + bool checkConnection( TQNetworkOperation *op ); + +private slots: + void startNextCommand(); + void piFinished( const TQString& ); + void piError( int, const TQString& ); + void piConnectState( int ); + void piFtpReply( int, const TQString& ); + +private slots: + void npListInfo( const TQUrlInfo & ); + void npDone( bool ); + void npStateChanged( int ); + void npDataTransferProgress( int, int ); + void npReadyRead(); + +protected slots: + // ### TQt 4.0: delete these + void hostFound(); + void connected(); + void closed(); + void dataHostFound(); + void dataConnected(); + void dataClosed(); + void dataReadyRead(); + void dataBytesWritten( int nbytes ); + void error( int ); +}; + +#endif // QT_NO_NETWORKPROTOCOL_FTP + +#endif // TQFTP_H diff --git a/src/network/ntqhostaddress.h b/src/network/ntqhostaddress.h new file mode 100644 index 000000000..17de16289 --- /dev/null +++ b/src/network/ntqhostaddress.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Definition of TQHostAddress class. +** +** Created : 979899 +** +** Copyright (C) 1997-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHOSTADDRESS_H +#define TQHOSTADDRESS_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_NETWORK +#else +#define TQM_EXPORT_NETWORK Q_EXPORT +#endif + +#ifndef QT_NO_NETWORK +class TQHostAddressPrivate; + +typedef struct { + Q_UINT8 c[16]; +} Q_IPV6ADDR; + +class TQM_EXPORT_NETWORK TQHostAddress +{ +public: + TQHostAddress(); + TQHostAddress( Q_UINT32 ip4Addr ); + TQHostAddress( Q_UINT8 *ip6Addr ); + TQHostAddress(const Q_IPV6ADDR &ip6Addr); +#ifndef QT_NO_STRINGLIST + TQHostAddress(const TQString &address); +#endif + TQHostAddress( const TQHostAddress & ); + virtual ~TQHostAddress(); + + TQHostAddress & operator=( const TQHostAddress & ); + + void setAddress( Q_UINT32 ip4Addr ); + void setAddress( Q_UINT8 *ip6Addr ); +#ifndef QT_NO_STRINGLIST + bool setAddress( const TQString& address ); +#endif + bool isIp4Addr() const; // obsolete + Q_UINT32 ip4Addr() const; // obsolete + + bool isIPv4Address() const; + Q_UINT32 toIPv4Address() const; + bool isIPv6Address() const; + Q_IPV6ADDR toIPv6Address() const; + +#ifndef QT_NO_SPRINTF + TQString toString() const; +#endif + + bool operator==( const TQHostAddress & ) const; + bool isNull() const; + +private: + TQHostAddressPrivate* d; +}; + +#endif //QT_NO_NETWORK +#endif diff --git a/src/network/ntqhttp.h b/src/network/ntqhttp.h new file mode 100644 index 000000000..f0f9d2ea9 --- /dev/null +++ b/src/network/ntqhttp.h @@ -0,0 +1,277 @@ +/**************************************************************************** +** +** Definition of TQHttp and related classes. +** +** Created : 970521 +** +** Copyright (C) 1997-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHTTP_H +#define TQHTTP_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqnetworkprotocol.h" +#include "ntqstringlist.h" +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_HTTP +#define TQM_TEMPLATE_EXTERN_HTTP +#else +#define TQM_EXPORT_HTTP Q_EXPORT +#define TQM_TEMPLATE_EXTERN_HTTP Q_TEMPLATE_EXTERN +#endif + +#ifndef QT_NO_NETWORKPROTOCOL_HTTP + +class TQSocket; +class TQTimerEvent; +class TQTextStream; +class TQIODevice; + +class TQHttpPrivate; +class TQHttpRequest; + +class TQM_EXPORT_HTTP TQHttpHeader +{ +public: + TQHttpHeader(); + TQHttpHeader( const TQHttpHeader& header ); + TQHttpHeader( const TQString& str ); + virtual ~TQHttpHeader(); + + TQHttpHeader& operator=( const TQHttpHeader& h ); + + TQString value( const TQString& key ) const; + void setValue( const TQString& key, const TQString& value ); + void removeValue( const TQString& key ); + + TQStringList keys() const; + bool hasKey( const TQString& key ) const; + + bool hasContentLength() const; + uint contentLength() const; + void setContentLength( int len ); + + bool hasContentType() const; + TQString contentType() const; + void setContentType( const TQString& type ); + + virtual TQString toString() const; + bool isValid() const; + + virtual int majorVersion() const = 0; + virtual int minorVersion() const = 0; + +protected: + virtual bool parseLine( const TQString& line, int number ); + bool parse( const TQString& str ); + void setValid( bool ); + +private: + TQMap values; + bool valid; +}; + +class TQM_EXPORT_HTTP TQHttpResponseHeader : public TQHttpHeader +{ +private: + TQHttpResponseHeader( int code, const TQString& text = TQString::null, int majorVer = 1, int minorVer = 1 ); + TQHttpResponseHeader( const TQString& str ); + + void setStatusLine( int code, const TQString& text = TQString::null, int majorVer = 1, int minorVer = 1 ); + +public: + TQHttpResponseHeader(); + TQHttpResponseHeader( const TQHttpResponseHeader& header ); + + int statusCode() const; + TQString reasonPhrase() const; + + int majorVersion() const; + int minorVersion() const; + + TQString toString() const; + +protected: + bool parseLine( const TQString& line, int number ); + +private: + int statCode; + TQString reasonPhr; + int majVer; + int minVer; + + friend class TQHttp; +}; + +class TQM_EXPORT_HTTP TQHttpRequestHeader : public TQHttpHeader +{ +public: + TQHttpRequestHeader(); + TQHttpRequestHeader( const TQString& method, const TQString& path, int majorVer = 1, int minorVer = 1 ); + TQHttpRequestHeader( const TQHttpRequestHeader& header ); + TQHttpRequestHeader( const TQString& str ); + + void setRequest( const TQString& method, const TQString& path, int majorVer = 1, int minorVer = 1 ); + + TQString method() const; + TQString path() const; + + int majorVersion() const; + int minorVersion() const; + + TQString toString() const; + +protected: + bool parseLine( const TQString& line, int number ); + +private: + TQString m; + TQString p; + int majVer; + int minVer; +}; + +class TQM_EXPORT_HTTP TQHttp : public TQNetworkProtocol +{ + Q_OBJECT + +public: + TQHttp(); + TQHttp( TQObject* parent, const char* name = 0 ); // ### TQt 4.0: make parent=0 and get rid of the TQHttp() constructor + TQHttp( const TQString &hostname, Q_UINT16 port=80, TQObject* parent=0, const char* name = 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 &hostname, Q_UINT16 port=80 ); + + int get( const TQString& path, TQIODevice* to=0 ); + int post( const TQString& path, TQIODevice* data, TQIODevice* to=0 ); + int post( const TQString& path, const TQByteArray& data, TQIODevice* to=0 ); + int head( const TQString& path ); + int request( const TQHttpRequestHeader &header, TQIODevice *device=0, TQIODevice *to=0 ); + int request( const TQHttpRequestHeader &header, const TQByteArray &data, TQIODevice *to=0 ); + + int closeConnection(); + + Q_ULONG bytesAvailable() const; + Q_LONG readBlock( char *data, Q_ULONG maxlen ); + TQByteArray readAll(); + + 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& resp ); + void readyRead( const TQHttpResponseHeader& resp ); + void dataSendProgress( int, int ); + void dataReadProgress( int, int ); + + void requestStarted( int ); + void requestFinished( int, bool ); + void done( bool ); + +protected: + void operationGet( TQNetworkOperation *op ); + void operationPut( TQNetworkOperation *op ); + + void timerEvent( TQTimerEvent * ); + +private slots: + void clientReply( const TQHttpResponseHeader &rep ); + void clientDone( bool ); + void clientStateChanged( int ); + + void startNextRequest(); + void slotReadyRead(); + void slotConnected(); + void slotError( int ); + void slotClosed(); + void slotBytesWritten( int ); + +private: + TQHttpPrivate *d; + void *unused; // ### TQt 4.0: remove this (in for binary compatibility) + int bytesRead; + + int addRequest( TQHttpRequest * ); + void sendRequest(); + void finishedWithSuccess(); + void finishedWithError( const TQString& detail, int errorCode ); + + void killIdleTimer(); + + void init(); + void setState( int ); + void close(); + + friend class TQHttpNormalRequest; + friend class TQHttpSetHostRequest; + friend class TQHttpCloseRequest; + friend class TQHttpPGHRequest; +}; + +#define Q_DEFINED_QHTTP +#include "ntqwinexport.h" +#endif +#endif diff --git a/src/network/ntqnetwork.h b/src/network/ntqnetwork.h new file mode 100644 index 000000000..0565ea514 --- /dev/null +++ b/src/network/ntqnetwork.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Definition of qInitNetworkProtocols function. +** +** Created : 970521 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQNETWORK_H +#define TQNETWORK_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_NETWORK +#else +#define TQM_EXPORT_NETWORK Q_EXPORT +#endif + +#ifndef QT_NO_NETWORK + +TQM_EXPORT_NETWORK void qInitNetworkProtocols(); + +#endif + +#endif diff --git a/src/network/ntqserversocket.h b/src/network/ntqserversocket.h new file mode 100644 index 000000000..b5c2a4b88 --- /dev/null +++ b/src/network/ntqserversocket.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Definition of TQServerSocketClass. +** +** Created : 970521 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSERVERSOCKET_H +#define TQSERVERSOCKET_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqhostaddress.h" +#include "ntqsocketdevice.h" // ### remove or keep for users' convenience? +#endif // QT_H +#ifndef QT_NO_NETWORK + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_NETWORK +#else +#define TQM_EXPORT_NETWORK Q_EXPORT +#endif + +class TQServerSocketPrivate; + + +class TQM_EXPORT_NETWORK TQServerSocket : public TQObject +{ + Q_OBJECT +public: + TQServerSocket( Q_UINT16 port, int backlog = 1, + TQObject *parent=0, const char *name=0 ); + TQServerSocket( const TQHostAddress & address, Q_UINT16 port, int backlog = 1, + TQObject *parent=0, const char *name=0 ); + TQServerSocket( TQObject *parent=0, const char *name=0 ); + virtual ~TQServerSocket(); + + bool ok() const; + + Q_UINT16 port() const ; + + int socket() const ; + virtual void setSocket( int socket ); + + TQHostAddress address() const ; + + virtual void newConnection( int socket ) = 0; + +protected: + TQSocketDevice *socketDevice(); + +private slots: + void incomingConnection( int socket ); + +private: + TQServerSocketPrivate *d; + void init( const TQHostAddress & address, Q_UINT16 port, int backlog ); +}; + +#endif // QT_NO_NETWORK +#endif // TQSERVERSOCKET_H diff --git a/src/network/ntqsocket.h b/src/network/ntqsocket.h new file mode 100644 index 000000000..2a727dd30 --- /dev/null +++ b/src/network/ntqsocket.h @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** Definition of TQSocket class. +** +** Created : 970521 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSOCKET_H +#define TQSOCKET_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqiodevice.h" +#include "ntqhostaddress.h" // int->TQHostAddress conversion +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_NETWORK +#else +#define TQM_EXPORT_NETWORK Q_EXPORT +#endif + +#ifndef QT_NO_NETWORK +class TQSocketPrivate; +class TQSocketDevice; + + +class TQM_EXPORT_NETWORK TQSocket : public TQObject, public TQIODevice +{ + Q_OBJECT +public: + enum Error { + ErrConnectionRefused, + ErrHostNotFound, + ErrSocketRead + }; + + TQSocket( TQObject *parent=0, const char *name=0 ); + virtual ~TQSocket(); + + enum State { Idle, HostLookup, Connecting, + Connected, Closing, + Connection=Connected }; + State state() const; + + int socket() const; + virtual void setSocket( int ); + + TQSocketDevice *socketDevice(); + virtual void setSocketDevice( TQSocketDevice * ); + +#ifndef QT_NO_DNS + virtual void connectToHost( const TQString &host, Q_UINT16 port ); +#endif + TQString peerName() const; + + // Implementation of TQIODevice abstract virtual functions + bool open( int mode ); + void close(); + void flush(); + Offset size() const; + Offset at() const; + bool at( Offset ); + bool atEnd() const; + + Q_ULONG bytesAvailable() const; // ### TQIODevice::Offset instead? + Q_ULONG waitForMore( int msecs, bool *timeout ) const; + Q_ULONG waitForMore( int msecs ) const; // ### TQt 4.0: merge the two overloads + Q_ULONG bytesToWrite() const; + void clearPendingData(); + + Q_LONG readBlock( char *data, Q_ULONG maxlen ); + Q_LONG writeBlock( const char *data, Q_ULONG len ); + Q_LONG readLine( char *data, Q_ULONG maxlen ); + + int getch(); + int putch( int ); + int ungetch(int); + + bool canReadLine() const; + virtual TQString readLine(); + + Q_UINT16 port() const; + Q_UINT16 peerPort() const; + TQHostAddress address() const; + TQHostAddress peerAddress() const; + + void setReadBufferSize( Q_ULONG ); + Q_ULONG readBufferSize() const; + +signals: + void hostFound(); + void connected(); + void connectionClosed(); + void delayedCloseFinished(); + void readyRead(); + void bytesWritten( int nbytes ); + void error( int ); + +protected slots: + virtual void sn_read( bool force=FALSE ); + virtual void sn_write(); + +private slots: + void tryConnecting(); + void emitErrorConnectionRefused(); + +private: + TQSocketPrivate *d; + + bool consumeWriteBuf( Q_ULONG nbytes ); + void tryConnection(); + void setSocketIntern( int socket ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSocket( const TQSocket & ); + TQSocket &operator=( const TQSocket & ); +#endif +}; + +#endif //QT_NO_NETWORK +#endif // TQSOCKET_H diff --git a/src/network/ntqsocketdevice.h b/src/network/ntqsocketdevice.h new file mode 100644 index 000000000..bd3d62225 --- /dev/null +++ b/src/network/ntqsocketdevice.h @@ -0,0 +1,170 @@ +/**************************************************************************** +** +** Definition of TQSocketDevice class. +** +** Created : 970521 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the network module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSOCKETDEVICE_H +#define TQSOCKETDEVICE_H + +#ifndef QT_H +#include "ntqiodevice.h" +#include "ntqhostaddress.h" // int->TQHostAddress conversion +#endif // QT_H + +#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) +#define TQM_EXPORT_NETWORK +#else +#define TQM_EXPORT_NETWORK Q_EXPORT +#endif + +#ifndef QT_NO_NETWORK +class TQSocketDevicePrivate; + + +class TQM_EXPORT_NETWORK TQSocketDevice: public TQIODevice +{ +public: + enum Type { Stream, Datagram }; + enum Protocol { IPv4, IPv6, Unknown }; + + TQSocketDevice( Type type = Stream ); + TQSocketDevice( Type type, Protocol protocol, int dummy ); + TQSocketDevice( int socket, Type type ); + virtual ~TQSocketDevice(); + + bool isValid() const; + Type type() const; + Protocol protocol() const; + + int socket() const; + virtual void setSocket( int socket, Type type ); + + bool open( int mode ); + void close(); + void flush(); + + // Implementation of TQIODevice abstract virtual functions + 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 &, Q_UINT16 ); + + virtual bool bind( const TQHostAddress &, Q_UINT16 ); + virtual bool listen( int backlog ); + virtual int accept(); + + Q_LONG bytesAvailable() const; + Q_LONG waitForMore( int msecs, bool *timeout=0 ) const; + Q_LONG readBlock( char *data, Q_ULONG maxlen ); + Q_LONG writeBlock( const char *data, Q_ULONG len ); + virtual Q_LONG writeBlock( const char *data, Q_ULONG len, + const TQHostAddress & host, Q_UINT16 port ); + + int getch(); + int putch( int ); + int ungetch(int); + + Q_UINT16 port() const; + Q_UINT16 peerPort() const; + TQHostAddress address() const; + TQHostAddress peerAddress() const; + + enum Error { + NoError, + AlreadyBound, + Inaccessible, + NoResources, + InternalError, + Bug = InternalError, // ### remove in 4.0? + Impossible, + NoFiles, + ConnectionRefused, + NetworkFailure, + UnknownError + }; + Error error() const; + +protected: + void setError( Error err ); + +private: + int fd; + Type t; + Q_UINT16 p; + TQHostAddress a; + Q_UINT16 pp; + TQHostAddress pa; + TQSocketDevice::Error e; + TQSocketDevicePrivate * d; + + enum Option { Broadcast, ReceiveBuffer, ReuseAddress, SendBuffer }; + + int option( Option ) const; + virtual void setOption( Option, int ); + + void fetchConnectionParameters(); +#if defined(Q_OS_WIN32) + void fetchPeerConnectionParameters(); +#endif + + static void init(); + int createNewSocket(); + Protocol getProtocol() const; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSocketDevice( const TQSocketDevice & ); + TQSocketDevice &operator=( const TQSocketDevice & ); +#endif +}; + +#endif // QT_NO_NETWORK +#endif // TQSOCKETDEVICE_H diff --git a/src/network/qdns.cpp b/src/network/qdns.cpp index 1b896e552..e6dafa6c6 100644 --- a/src/network/qdns.cpp +++ b/src/network/qdns.cpp @@ -60,23 +60,23 @@ # undef socket #endif -#include "qdns.h" +#include "ntqdns.h" #ifndef QT_NO_DNS -#include "qdatetime.h" -#include "qdict.h" -#include "qptrlist.h" -#include "qstring.h" -#include "qtimer.h" -#include "qapplication.h" -#include "qptrvector.h" -#include "qstrlist.h" -#include "qptrdict.h" -#include "qfile.h" -#include "qtextstream.h" -#include "qsocketdevice.h" -#include "qcleanuphandler.h" +#include "ntqdatetime.h" +#include "ntqdict.h" +#include "ntqptrlist.h" +#include "ntqstring.h" +#include "ntqtimer.h" +#include "ntqapplication.h" +#include "ntqptrvector.h" +#include "ntqstrlist.h" +#include "ntqptrdict.h" +#include "ntqfile.h" +#include "ntqtextstream.h" +#include "ntqsocketdevice.h" +#include "ntqcleanuphandler.h" #include #ifdef Q_OS_MAC #include "../3rdparty/dlcompat/dlfcn.h" @@ -1598,7 +1598,7 @@ void TQDnsSocket::answer() /*! - \class TQDns qdns.h + \class TQDns ntqdns.h \brief The TQDns class provides asynchronous DNS lookups. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qdns.h b/src/network/qdns.h deleted file mode 100644 index a14d2024f..000000000 --- a/src/network/qdns.h +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDns class. -** -** Created : 991122 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDNS_H -#define TQDNS_H - -#ifndef QT_H -#include "qobject.h" -#include "qhostaddress.h" -#include "qsocketnotifier.h" -#include "qstringlist.h" -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_DNS -#else -#define TQM_EXPORT_DNS Q_EXPORT -#endif - -#ifndef QT_NO_DNS - -//#define Q_DNS_SYNCHRONOUS - -class TQDnsPrivate; - -class TQM_EXPORT_DNS TQDns: public TQObject { - Q_OBJECT -public: - enum RecordType { - None, - A, Aaaa, - Mx, Srv, - Cname, - Ptr, - Txt - }; - - TQDns(); - TQDns( const TQString & label, RecordType rr = A ); - TQDns( const TQHostAddress & address, RecordType rr = Ptr ); - virtual ~TQDns(); - - // to set/change the query - virtual void setLabel( const TQString & label ); - virtual void setLabel( const TQHostAddress & address ); - TQString label() const { return l; } - - virtual void setRecordType( RecordType rr = A ); - RecordType recordType() const { return t; } - - // whether something is happening behind the scenes - bool isWorking() const; - - // to query for replies - TQValueList addresses() const; - - class TQM_EXPORT_DNS MailServer { - public: - MailServer( const TQString & n=TQString::null, Q_UINT16 p=0 ) - :name(n), priority(p) {} - TQString name; - Q_UINT16 priority; - Q_DUMMY_COMPARISON_OPERATOR(MailServer) - }; - TQValueList mailServers() const; - - class TQM_EXPORT_DNS Server { - public: - Server(const TQString & n=TQString::null, Q_UINT16 p=0, Q_UINT16 w=0, Q_UINT16 po=0 ) - : name(n), priority(p), weight(w), port(po) {} - TQString name; - Q_UINT16 priority; - Q_UINT16 weight; - Q_UINT16 port; - Q_DUMMY_COMPARISON_OPERATOR(Server) - }; - TQValueList servers() const; - - TQStringList hostNames() const; - - TQStringList texts() const; - - TQString canonicalName() const; // ### real-world but uncommon: TQStringList - - TQStringList qualifiedNames() const { return n; } - -#if defined(Q_DNS_SYNCHRONOUS) -protected: - void connectNotify( const char *signal ); -#endif - -signals: - void resultsReady(); - -private slots: - void startQuery(); - -private: - static void doResInit(); - void setStartQueryTimer(); - static TQString toInAddrArpaDomain( const TQHostAddress &address ); -#if defined(Q_DNS_SYNCHRONOUS) - void doSynchronousLookup(); -#endif - - TQString l; - TQStringList n; - RecordType t; - TQDnsPrivate * d; - - friend class TQDnsAnswer; - friend class TQDnsManager; -}; - - -// TQDnsSocket are sockets that are used for DNS lookup - -class TQDnsSocket: public TQObject { - Q_OBJECT - // note: Private not public. This class contains NO public API. -protected: - TQDnsSocket( TQObject *, const char * ); - virtual ~TQDnsSocket(); - -private slots: - virtual void cleanCache(); - virtual void retransmit(); - virtual void answer(); -}; - -#endif // QT_NO_DNS - -#endif // TQDNS_H diff --git a/src/network/qftp.cpp b/src/network/qftp.cpp index 78f29e8cd..441cdda5c 100644 --- a/src/network/qftp.cpp +++ b/src/network/qftp.cpp @@ -38,22 +38,22 @@ ** **********************************************************************/ -#include "qftp.h" +#include "ntqftp.h" #ifndef QT_NO_NETWORKPROTOCOL_FTP -#include "qsocket.h" -#include "qsocketdevice.h" -#include "qurlinfo.h" -#include "qurloperator.h" -#include "qstringlist.h" -#include "qregexp.h" -#include "qtimer.h" -#include "qfileinfo.h" -#include "qptrdict.h" // binary compatibility +#include "ntqsocket.h" +#include "ntqsocketdevice.h" +#include "ntqurlinfo.h" +#include "ntqurloperator.h" +#include "ntqstringlist.h" +#include "ntqregexp.h" +#include "ntqtimer.h" +#include "ntqfileinfo.h" +#include "ntqptrdict.h" // binary compatibility #ifndef QT_NO_TEXTCODEC -#include "qtextcodec.h" +#include "ntqtextcodec.h" #endif //#define TQFTPPI_DEBUG @@ -1064,7 +1064,7 @@ static void delete_d( const TQFtp* foo ) * *********************************************************************/ /*! - \class TQFtp qftp.h + \class TQFtp ntqftp.h \brief The TQFtp class provides an implementation of the FTP protocol. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qftp.h b/src/network/qftp.h deleted file mode 100644 index 475eed1f0..000000000 --- a/src/network/qftp.h +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFtp class. -** -** Created : 970521 -** -** Copyright (C) 1997-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFTP_H -#define TQFTP_H - -#ifndef QT_H -#include "qstring.h" // char*->TQString conversion -#include "qurlinfo.h" -#include "qnetworkprotocol.h" -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_FTP -#else -#define TQM_EXPORT_FTP Q_EXPORT -#endif - -#ifndef QT_NO_NETWORKPROTOCOL_FTP - - -class TQSocket; -class TQFtpCommand; - -class TQM_EXPORT_FTP TQFtp : public TQNetworkProtocol -{ - Q_OBJECT - -public: - TQFtp(); // ### TQt 4.0: get rid of this overload - TQFtp( TQObject *parent, const char *name=0 ); - virtual ~TQFtp(); - - int supportedOperations() const; - - // non-TQNetworkProtocol functions: - 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 &host, Q_UINT16 port=21 ); - int login( const TQString &user=TQString::null, const TQString &password=TQString::null ); - int close(); - int list( const TQString &dir=TQString::null ); - int cd( const TQString &dir ); - int get( const TQString &file, TQIODevice *dev=0 ); - int put( const TQByteArray &data, const TQString &file ); - int put( TQIODevice *dev, const TQString &file ); - int remove( const TQString &file ); - int mkdir( const TQString &dir ); - int rmdir( const TQString &dir ); - int rename( const TQString &oldname, const TQString &newname ); - - int rawCommand( const TQString &command ); - - Q_ULONG bytesAvailable() const; - Q_LONG readBlock( char *data, Q_ULONG maxlen ); - TQByteArray readAll(); - - 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 &buffer, TQUrlInfo &info ); // ### TQt 4.0: delete this? (not public API) - void operationListChildren( TQNetworkOperation *op ); - void operationMkDir( TQNetworkOperation *op ); - void operationRemove( TQNetworkOperation *op ); - void operationRename( TQNetworkOperation *op ); - void operationGet( TQNetworkOperation *op ); - void operationPut( TQNetworkOperation *op ); - - // ### TQt 4.0: delete these - // unused variables: - TQSocket *commandSocket, *dataSocket; - bool connectionReady, passiveMode; - int getTotalSize, getDoneSize; - bool startGetOnFail; - int putToWrite, putWritten; - bool errorInListChildren; - -private: - void init(); - int addCommand( TQFtpCommand * ); - - bool checkConnection( TQNetworkOperation *op ); - -private slots: - void startNextCommand(); - void piFinished( const TQString& ); - void piError( int, const TQString& ); - void piConnectState( int ); - void piFtpReply( int, const TQString& ); - -private slots: - void npListInfo( const TQUrlInfo & ); - void npDone( bool ); - void npStateChanged( int ); - void npDataTransferProgress( int, int ); - void npReadyRead(); - -protected slots: - // ### TQt 4.0: delete these - void hostFound(); - void connected(); - void closed(); - void dataHostFound(); - void dataConnected(); - void dataClosed(); - void dataReadyRead(); - void dataBytesWritten( int nbytes ); - void error( int ); -}; - -#endif // QT_NO_NETWORKPROTOCOL_FTP - -#endif // TQFTP_H diff --git a/src/network/qhostaddress.cpp b/src/network/qhostaddress.cpp index 360045282..43d614cc9 100644 --- a/src/network/qhostaddress.cpp +++ b/src/network/qhostaddress.cpp @@ -38,8 +38,8 @@ ** **********************************************************************/ -#include "qhostaddress.h" -#include "qstringlist.h" +#include "ntqhostaddress.h" +#include "ntqstringlist.h" #ifndef QT_NO_NETWORK class TQHostAddressPrivate @@ -83,7 +83,7 @@ TQHostAddressPrivate::TQHostAddressPrivate(const Q_IPV6ADDR &a_) : a(0), isIp4(F } /*! - \class TQHostAddress qhostaddress.h + \class TQHostAddress ntqhostaddress.h \brief The TQHostAddress class provides an IP address. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qhostaddress.h b/src/network/qhostaddress.h deleted file mode 100644 index 09986861a..000000000 --- a/src/network/qhostaddress.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Definition of TQHostAddress class. -** -** Created : 979899 -** -** Copyright (C) 1997-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHOSTADDRESS_H -#define TQHOSTADDRESS_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_NETWORK -#else -#define TQM_EXPORT_NETWORK Q_EXPORT -#endif - -#ifndef QT_NO_NETWORK -class TQHostAddressPrivate; - -typedef struct { - Q_UINT8 c[16]; -} Q_IPV6ADDR; - -class TQM_EXPORT_NETWORK TQHostAddress -{ -public: - TQHostAddress(); - TQHostAddress( Q_UINT32 ip4Addr ); - TQHostAddress( Q_UINT8 *ip6Addr ); - TQHostAddress(const Q_IPV6ADDR &ip6Addr); -#ifndef QT_NO_STRINGLIST - TQHostAddress(const TQString &address); -#endif - TQHostAddress( const TQHostAddress & ); - virtual ~TQHostAddress(); - - TQHostAddress & operator=( const TQHostAddress & ); - - void setAddress( Q_UINT32 ip4Addr ); - void setAddress( Q_UINT8 *ip6Addr ); -#ifndef QT_NO_STRINGLIST - bool setAddress( const TQString& address ); -#endif - bool isIp4Addr() const; // obsolete - Q_UINT32 ip4Addr() const; // obsolete - - bool isIPv4Address() const; - Q_UINT32 toIPv4Address() const; - bool isIPv6Address() const; - Q_IPV6ADDR toIPv6Address() const; - -#ifndef QT_NO_SPRINTF - TQString toString() const; -#endif - - bool operator==( const TQHostAddress & ) const; - bool isNull() const; - -private: - TQHostAddressPrivate* d; -}; - -#endif //QT_NO_NETWORK -#endif diff --git a/src/network/qhttp.cpp b/src/network/qhttp.cpp index 4d8cc3e53..b8a110e58 100644 --- a/src/network/qhttp.cpp +++ b/src/network/qhttp.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qhttp.h" +#include "ntqhttp.h" #ifndef QT_NO_NETWORKPROTOCOL_HTTP -#include "qsocket.h" -#include "qtextstream.h" -#include "qmap.h" -#include "qstring.h" -#include "qstringlist.h" -#include "qcstring.h" -#include "qbuffer.h" -#include "qurloperator.h" -#include "qtimer.h" +#include "ntqsocket.h" +#include "ntqtextstream.h" +#include "ntqmap.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqcstring.h" +#include "ntqbuffer.h" +#include "ntqurloperator.h" +#include "ntqtimer.h" #include "private/qinternal_p.h" //#define TQHTTP_DEBUG @@ -332,7 +332,7 @@ void TQHttpCloseRequest::start( TQHttp *http ) ****************************************************/ /*! - \class TQHttpHeader qhttp.h + \class TQHttpHeader ntqhttp.h \brief The TQHttpHeader class contains header information for HTTP. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -674,7 +674,7 @@ void TQHttpHeader::setContentType( const TQString& type ) ****************************************************/ /*! - \class TQHttpResponseHeader qhttp.h + \class TQHttpResponseHeader ntqhttp.h \brief The TQHttpResponseHeader class contains response header information for HTTP. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -837,7 +837,7 @@ TQString TQHttpResponseHeader::toString() const ****************************************************/ /*! - \class TQHttpRequestHeader qhttp.h + \class TQHttpRequestHeader ntqhttp.h \brief The TQHttpRequestHeader class contains request header information for \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -1011,7 +1011,7 @@ TQString TQHttpRequestHeader::toString() const * ****************************************************/ /*! - \class TQHttp qhttp.h + \class TQHttp ntqhttp.h \brief The TQHttp class provides an implementation of the HTTP protocol. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qhttp.h b/src/network/qhttp.h deleted file mode 100644 index b71ef105e..000000000 --- a/src/network/qhttp.h +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************** -** -** Definition of TQHttp and related classes. -** -** Created : 970521 -** -** Copyright (C) 1997-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHTTP_H -#define TQHTTP_H - -#ifndef QT_H -#include "qobject.h" -#include "qnetworkprotocol.h" -#include "qstringlist.h" -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_HTTP -#define TQM_TEMPLATE_EXTERN_HTTP -#else -#define TQM_EXPORT_HTTP Q_EXPORT -#define TQM_TEMPLATE_EXTERN_HTTP Q_TEMPLATE_EXTERN -#endif - -#ifndef QT_NO_NETWORKPROTOCOL_HTTP - -class TQSocket; -class TQTimerEvent; -class TQTextStream; -class TQIODevice; - -class TQHttpPrivate; -class TQHttpRequest; - -class TQM_EXPORT_HTTP TQHttpHeader -{ -public: - TQHttpHeader(); - TQHttpHeader( const TQHttpHeader& header ); - TQHttpHeader( const TQString& str ); - virtual ~TQHttpHeader(); - - TQHttpHeader& operator=( const TQHttpHeader& h ); - - TQString value( const TQString& key ) const; - void setValue( const TQString& key, const TQString& value ); - void removeValue( const TQString& key ); - - TQStringList keys() const; - bool hasKey( const TQString& key ) const; - - bool hasContentLength() const; - uint contentLength() const; - void setContentLength( int len ); - - bool hasContentType() const; - TQString contentType() const; - void setContentType( const TQString& type ); - - virtual TQString toString() const; - bool isValid() const; - - virtual int majorVersion() const = 0; - virtual int minorVersion() const = 0; - -protected: - virtual bool parseLine( const TQString& line, int number ); - bool parse( const TQString& str ); - void setValid( bool ); - -private: - TQMap values; - bool valid; -}; - -class TQM_EXPORT_HTTP TQHttpResponseHeader : public TQHttpHeader -{ -private: - TQHttpResponseHeader( int code, const TQString& text = TQString::null, int majorVer = 1, int minorVer = 1 ); - TQHttpResponseHeader( const TQString& str ); - - void setStatusLine( int code, const TQString& text = TQString::null, int majorVer = 1, int minorVer = 1 ); - -public: - TQHttpResponseHeader(); - TQHttpResponseHeader( const TQHttpResponseHeader& header ); - - int statusCode() const; - TQString reasonPhrase() const; - - int majorVersion() const; - int minorVersion() const; - - TQString toString() const; - -protected: - bool parseLine( const TQString& line, int number ); - -private: - int statCode; - TQString reasonPhr; - int majVer; - int minVer; - - friend class TQHttp; -}; - -class TQM_EXPORT_HTTP TQHttpRequestHeader : public TQHttpHeader -{ -public: - TQHttpRequestHeader(); - TQHttpRequestHeader( const TQString& method, const TQString& path, int majorVer = 1, int minorVer = 1 ); - TQHttpRequestHeader( const TQHttpRequestHeader& header ); - TQHttpRequestHeader( const TQString& str ); - - void setRequest( const TQString& method, const TQString& path, int majorVer = 1, int minorVer = 1 ); - - TQString method() const; - TQString path() const; - - int majorVersion() const; - int minorVersion() const; - - TQString toString() const; - -protected: - bool parseLine( const TQString& line, int number ); - -private: - TQString m; - TQString p; - int majVer; - int minVer; -}; - -class TQM_EXPORT_HTTP TQHttp : public TQNetworkProtocol -{ - Q_OBJECT - -public: - TQHttp(); - TQHttp( TQObject* parent, const char* name = 0 ); // ### TQt 4.0: make parent=0 and get rid of the TQHttp() constructor - TQHttp( const TQString &hostname, Q_UINT16 port=80, TQObject* parent=0, const char* name = 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 &hostname, Q_UINT16 port=80 ); - - int get( const TQString& path, TQIODevice* to=0 ); - int post( const TQString& path, TQIODevice* data, TQIODevice* to=0 ); - int post( const TQString& path, const TQByteArray& data, TQIODevice* to=0 ); - int head( const TQString& path ); - int request( const TQHttpRequestHeader &header, TQIODevice *device=0, TQIODevice *to=0 ); - int request( const TQHttpRequestHeader &header, const TQByteArray &data, TQIODevice *to=0 ); - - int closeConnection(); - - Q_ULONG bytesAvailable() const; - Q_LONG readBlock( char *data, Q_ULONG maxlen ); - TQByteArray readAll(); - - 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& resp ); - void readyRead( const TQHttpResponseHeader& resp ); - void dataSendProgress( int, int ); - void dataReadProgress( int, int ); - - void requestStarted( int ); - void requestFinished( int, bool ); - void done( bool ); - -protected: - void operationGet( TQNetworkOperation *op ); - void operationPut( TQNetworkOperation *op ); - - void timerEvent( TQTimerEvent * ); - -private slots: - void clientReply( const TQHttpResponseHeader &rep ); - void clientDone( bool ); - void clientStateChanged( int ); - - void startNextRequest(); - void slotReadyRead(); - void slotConnected(); - void slotError( int ); - void slotClosed(); - void slotBytesWritten( int ); - -private: - TQHttpPrivate *d; - void *unused; // ### TQt 4.0: remove this (in for binary compatibility) - int bytesRead; - - int addRequest( TQHttpRequest * ); - void sendRequest(); - void finishedWithSuccess(); - void finishedWithError( const TQString& detail, int errorCode ); - - void killIdleTimer(); - - void init(); - void setState( int ); - void close(); - - friend class TQHttpNormalRequest; - friend class TQHttpSetHostRequest; - friend class TQHttpCloseRequest; - friend class TQHttpPGHRequest; -}; - -#define Q_DEFINED_QHTTP -#include "qwinexport.h" -#endif -#endif diff --git a/src/network/qnetwork.cpp b/src/network/qnetwork.cpp index 5f5d3cdb8..a3e8a7443 100644 --- a/src/network/qnetwork.cpp +++ b/src/network/qnetwork.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qnetwork.h" +#include "ntqnetwork.h" #ifndef QT_NO_NETWORK -#include "qnetworkprotocol.h" +#include "ntqnetworkprotocol.h" // protocols -#include "qftp.h" -#include "qhttp.h" +#include "ntqftp.h" +#include "ntqhttp.h" -/*! \file qnetwork.h */ +/*! \file ntqnetwork.h */ /*! \relates TQUrlOperator @@ -56,7 +56,7 @@ You must call this function before you use TQUrlOperator for these protocols. - This function is declared in \l qnetwork.h. + This function is declared in \l ntqnetwork.h. */ void qInitNetworkProtocols() { diff --git a/src/network/qnetwork.h b/src/network/qnetwork.h deleted file mode 100644 index 48a1841db..000000000 --- a/src/network/qnetwork.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Definition of qInitNetworkProtocols function. -** -** Created : 970521 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQNETWORK_H -#define TQNETWORK_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_NETWORK -#else -#define TQM_EXPORT_NETWORK Q_EXPORT -#endif - -#ifndef QT_NO_NETWORK - -TQM_EXPORT_NETWORK void qInitNetworkProtocols(); - -#endif - -#endif diff --git a/src/network/qserversocket.cpp b/src/network/qserversocket.cpp index 706be57ee..04dc965ef 100644 --- a/src/network/qserversocket.cpp +++ b/src/network/qserversocket.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qserversocket.h" +#include "ntqserversocket.h" #ifndef QT_NO_NETWORK -#include "qsocketnotifier.h" +#include "ntqsocketnotifier.h" class TQServerSocketPrivate { public: @@ -54,7 +54,7 @@ public: /*! - \class TQServerSocket qserversocket.h + \class TQServerSocket ntqserversocket.h \brief The TQServerSocket class provides a TCP-based server. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qserversocket.h b/src/network/qserversocket.h deleted file mode 100644 index a54b04a7b..000000000 --- a/src/network/qserversocket.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Definition of TQServerSocketClass. -** -** Created : 970521 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSERVERSOCKET_H -#define TQSERVERSOCKET_H - -#ifndef QT_H -#include "qobject.h" -#include "qhostaddress.h" -#include "qsocketdevice.h" // ### remove or keep for users' convenience? -#endif // QT_H -#ifndef QT_NO_NETWORK - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_NETWORK -#else -#define TQM_EXPORT_NETWORK Q_EXPORT -#endif - -class TQServerSocketPrivate; - - -class TQM_EXPORT_NETWORK TQServerSocket : public TQObject -{ - Q_OBJECT -public: - TQServerSocket( Q_UINT16 port, int backlog = 1, - TQObject *parent=0, const char *name=0 ); - TQServerSocket( const TQHostAddress & address, Q_UINT16 port, int backlog = 1, - TQObject *parent=0, const char *name=0 ); - TQServerSocket( TQObject *parent=0, const char *name=0 ); - virtual ~TQServerSocket(); - - bool ok() const; - - Q_UINT16 port() const ; - - int socket() const ; - virtual void setSocket( int socket ); - - TQHostAddress address() const ; - - virtual void newConnection( int socket ) = 0; - -protected: - TQSocketDevice *socketDevice(); - -private slots: - void incomingConnection( int socket ); - -private: - TQServerSocketPrivate *d; - void init( const TQHostAddress & address, Q_UINT16 port, int backlog ); -}; - -#endif // QT_NO_NETWORK -#endif // TQSERVERSOCKET_H diff --git a/src/network/qsocket.cpp b/src/network/qsocket.cpp index 14e45b7dc..8e69aa7cc 100644 --- a/src/network/qsocket.cpp +++ b/src/network/qsocket.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qsocket.h" +#include "ntqsocket.h" #ifndef QT_NO_NETWORK -#include "qptrlist.h" -#include "qtimer.h" -#include "qsocketdevice.h" -#include "qdns.h" +#include "ntqptrlist.h" +#include "ntqtimer.h" +#include "ntqsocketdevice.h" +#include "ntqdns.h" #include "private/qinternal_p.h" #include @@ -224,7 +224,7 @@ void TQSocketPrivate::setSocketDevice( TQSocket *q, TQSocketDevice *device ) } /*! - \class TQSocket qsocket.h + \class TQSocket ntqsocket.h \brief The TQSocket class provides a buffered TCP connection. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qsocket.h b/src/network/qsocket.h deleted file mode 100644 index ee5b38422..000000000 --- a/src/network/qsocket.h +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSocket class. -** -** Created : 970521 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSOCKET_H -#define TQSOCKET_H - -#ifndef QT_H -#include "qobject.h" -#include "qiodevice.h" -#include "qhostaddress.h" // int->TQHostAddress conversion -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_NETWORK -#else -#define TQM_EXPORT_NETWORK Q_EXPORT -#endif - -#ifndef QT_NO_NETWORK -class TQSocketPrivate; -class TQSocketDevice; - - -class TQM_EXPORT_NETWORK TQSocket : public TQObject, public TQIODevice -{ - Q_OBJECT -public: - enum Error { - ErrConnectionRefused, - ErrHostNotFound, - ErrSocketRead - }; - - TQSocket( TQObject *parent=0, const char *name=0 ); - virtual ~TQSocket(); - - enum State { Idle, HostLookup, Connecting, - Connected, Closing, - Connection=Connected }; - State state() const; - - int socket() const; - virtual void setSocket( int ); - - TQSocketDevice *socketDevice(); - virtual void setSocketDevice( TQSocketDevice * ); - -#ifndef QT_NO_DNS - virtual void connectToHost( const TQString &host, Q_UINT16 port ); -#endif - TQString peerName() const; - - // Implementation of TQIODevice abstract virtual functions - bool open( int mode ); - void close(); - void flush(); - Offset size() const; - Offset at() const; - bool at( Offset ); - bool atEnd() const; - - Q_ULONG bytesAvailable() const; // ### TQIODevice::Offset instead? - Q_ULONG waitForMore( int msecs, bool *timeout ) const; - Q_ULONG waitForMore( int msecs ) const; // ### TQt 4.0: merge the two overloads - Q_ULONG bytesToWrite() const; - void clearPendingData(); - - Q_LONG readBlock( char *data, Q_ULONG maxlen ); - Q_LONG writeBlock( const char *data, Q_ULONG len ); - Q_LONG readLine( char *data, Q_ULONG maxlen ); - - int getch(); - int putch( int ); - int ungetch(int); - - bool canReadLine() const; - virtual TQString readLine(); - - Q_UINT16 port() const; - Q_UINT16 peerPort() const; - TQHostAddress address() const; - TQHostAddress peerAddress() const; - - void setReadBufferSize( Q_ULONG ); - Q_ULONG readBufferSize() const; - -signals: - void hostFound(); - void connected(); - void connectionClosed(); - void delayedCloseFinished(); - void readyRead(); - void bytesWritten( int nbytes ); - void error( int ); - -protected slots: - virtual void sn_read( bool force=FALSE ); - virtual void sn_write(); - -private slots: - void tryConnecting(); - void emitErrorConnectionRefused(); - -private: - TQSocketPrivate *d; - - bool consumeWriteBuf( Q_ULONG nbytes ); - void tryConnection(); - void setSocketIntern( int socket ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSocket( const TQSocket & ); - TQSocket &operator=( const TQSocket & ); -#endif -}; - -#endif //QT_NO_NETWORK -#endif // TQSOCKET_H diff --git a/src/network/qsocketdevice.cpp b/src/network/qsocketdevice.cpp index 270d74571..c09cbb59a 100644 --- a/src/network/qsocketdevice.cpp +++ b/src/network/qsocketdevice.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qsocketdevice.h" +#include "ntqsocketdevice.h" #ifndef QT_NO_NETWORK -#include "qwindowdefs.h" +#include "ntqwindowdefs.h" #include @@ -60,7 +60,7 @@ public: /*! - \class TQSocketDevice qsocketdevice.h + \class TQSocketDevice ntqsocketdevice.h \brief The TQSocketDevice class provides a platform-independent low-level socket API. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/network/qsocketdevice.h b/src/network/qsocketdevice.h deleted file mode 100644 index cfb847ce6..000000000 --- a/src/network/qsocketdevice.h +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSocketDevice class. -** -** Created : 970521 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the network module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSOCKETDEVICE_H -#define TQSOCKETDEVICE_H - -#ifndef QT_H -#include "qiodevice.h" -#include "qhostaddress.h" // int->TQHostAddress conversion -#endif // QT_H - -#if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK ) -#define TQM_EXPORT_NETWORK -#else -#define TQM_EXPORT_NETWORK Q_EXPORT -#endif - -#ifndef QT_NO_NETWORK -class TQSocketDevicePrivate; - - -class TQM_EXPORT_NETWORK TQSocketDevice: public TQIODevice -{ -public: - enum Type { Stream, Datagram }; - enum Protocol { IPv4, IPv6, Unknown }; - - TQSocketDevice( Type type = Stream ); - TQSocketDevice( Type type, Protocol protocol, int dummy ); - TQSocketDevice( int socket, Type type ); - virtual ~TQSocketDevice(); - - bool isValid() const; - Type type() const; - Protocol protocol() const; - - int socket() const; - virtual void setSocket( int socket, Type type ); - - bool open( int mode ); - void close(); - void flush(); - - // Implementation of TQIODevice abstract virtual functions - 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 &, Q_UINT16 ); - - virtual bool bind( const TQHostAddress &, Q_UINT16 ); - virtual bool listen( int backlog ); - virtual int accept(); - - Q_LONG bytesAvailable() const; - Q_LONG waitForMore( int msecs, bool *timeout=0 ) const; - Q_LONG readBlock( char *data, Q_ULONG maxlen ); - Q_LONG writeBlock( const char *data, Q_ULONG len ); - virtual Q_LONG writeBlock( const char *data, Q_ULONG len, - const TQHostAddress & host, Q_UINT16 port ); - - int getch(); - int putch( int ); - int ungetch(int); - - Q_UINT16 port() const; - Q_UINT16 peerPort() const; - TQHostAddress address() const; - TQHostAddress peerAddress() const; - - enum Error { - NoError, - AlreadyBound, - Inaccessible, - NoResources, - InternalError, - Bug = InternalError, // ### remove in 4.0? - Impossible, - NoFiles, - ConnectionRefused, - NetworkFailure, - UnknownError - }; - Error error() const; - -protected: - void setError( Error err ); - -private: - int fd; - Type t; - Q_UINT16 p; - TQHostAddress a; - Q_UINT16 pp; - TQHostAddress pa; - TQSocketDevice::Error e; - TQSocketDevicePrivate * d; - - enum Option { Broadcast, ReceiveBuffer, ReuseAddress, SendBuffer }; - - int option( Option ) const; - virtual void setOption( Option, int ); - - void fetchConnectionParameters(); -#if defined(Q_OS_WIN32) - void fetchPeerConnectionParameters(); -#endif - - static void init(); - int createNewSocket(); - Protocol getProtocol() const; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSocketDevice( const TQSocketDevice & ); - TQSocketDevice &operator=( const TQSocketDevice & ); -#endif -}; - -#endif // QT_NO_NETWORK -#endif // TQSOCKETDEVICE_H diff --git a/src/network/qsocketdevice_unix.cpp b/src/network/qsocketdevice_unix.cpp index fe7c619cc..a5adfef06 100644 --- a/src/network/qsocketdevice_unix.cpp +++ b/src/network/qsocketdevice_unix.cpp @@ -80,11 +80,11 @@ static inline int qt_socket_socket(int domain, int type, int protocol) # undef socket #endif -#include "qsocketdevice.h" +#include "ntqsocketdevice.h" #ifndef QT_NO_NETWORK -#include "qwindowdefs.h" +#include "ntqwindowdefs.h" #include #include diff --git a/src/network/qt_network.pri b/src/network/qt_network.pri index 86fcf24d4..537f2b99d 100644 --- a/src/network/qt_network.pri +++ b/src/network/qt_network.pri @@ -1,14 +1,14 @@ # Qt network module network { - HEADERS += $$NETWORK_H/qdns.h \ - $$NETWORK_H/qftp.h \ - $$NETWORK_H/qhttp.h \ - $$NETWORK_H/qhostaddress.h \ - $$NETWORK_H/qnetwork.h \ - $$NETWORK_H/qserversocket.h \ - $$NETWORK_H/qsocket.h \ - $$NETWORK_H/qsocketdevice.h + HEADERS += $$NETWORK_H/ntqdns.h \ + $$NETWORK_H/ntqftp.h \ + $$NETWORK_H/ntqhttp.h \ + $$NETWORK_H/ntqhostaddress.h \ + $$NETWORK_H/ntqnetwork.h \ + $$NETWORK_H/ntqserversocket.h \ + $$NETWORK_H/ntqsocket.h \ + $$NETWORK_H/ntqsocketdevice.h NETWORK_SOURCES = $$NETWORK_CPP/qdns.cpp \ $$NETWORK_CPP/qftp.cpp \ $$NETWORK_CPP/qhttp.cpp \ diff --git a/src/opengl/ntqgl.h b/src/opengl/ntqgl.h new file mode 100644 index 000000000..0476dfeff --- /dev/null +++ b/src/opengl/ntqgl.h @@ -0,0 +1,541 @@ +/**************************************************************************** +** +** Definition of OpenGL classes for TQt +** +** Created : 970112 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the opengl module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGL_H +#define TQGL_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqglcolormap.h" +#endif // QT_H + +#if !defined( QT_MODULE_OPENGL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_OPENGL +#else +#define TQM_EXPORT_OPENGL Q_EXPORT +#endif + +#ifndef QT_NO_COMPAT +#define TQGL_VERSION 450 +#define TQGL_VERSION_STR "4.5" +TQM_EXPORT_OPENGL inline const char *qGLVersion() { + qObsolete( 0, "qGLVersion", "qVersion" ); + return TQGL_VERSION_STR; +} +#endif + +#if defined(Q_WS_WIN) +# include "qt_windows.h" +#endif + +#if defined(Q_WS_MAC) +#if !defined( TQMAC_OPENGL_DOUBLEBUFFER ) +/* This macro is different now. If the macro is not defined TQGLWidget will + * try to determine when you need double buffering. If set to 0 it will + * never double buffer and *can* be acclerated. If set to 1 (the default) + * it will always double buffer. Unlike before the value of this macro does + * not upset binary compatability either. */ +#if QT_MACOSX_VERSION >= 0x1020 +# define TQMAC_OPENGL_DOUBLEBUFFER 0 +#endif +#endif +# include +# include +#else +# include +# include +#endif + +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) +class TQGLCmap; +#endif + +class TQPixmap; +#if defined(Q_WS_X11) +class TQGLOverlayWidget; +#endif + +// Namespace class: +class TQM_EXPORT_OPENGL TQGL +{ +public: + enum FormatOption { + DoubleBuffer = 0x0001, + DepthBuffer = 0x0002, + Rgba = 0x0004, + AlphaChannel = 0x0008, + AccumBuffer = 0x0010, + StencilBuffer = 0x0020, + StereoBuffers = 0x0040, + DirectRendering = 0x0080, + HasOverlay = 0x0100, + SingleBuffer = DoubleBuffer << 16, + NoDepthBuffer = DepthBuffer << 16, + ColorIndex = Rgba << 16, + NoAlphaChannel = AlphaChannel << 16, + NoAccumBuffer = AccumBuffer << 16, + NoStencilBuffer = StencilBuffer << 16, + NoStereoBuffers = StereoBuffers << 16, + IndirectRendering = DirectRendering << 16, + NoOverlay = HasOverlay << 16 + }; +}; + + + +class TQM_EXPORT_OPENGL TQGLFormat : public TQGL +{ +public: + TQGLFormat(); + TQGLFormat( int options, int plane = 0 ); + + bool doubleBuffer() const; + void setDoubleBuffer( bool enable ); + bool depth() const; + void setDepth( bool enable ); + bool rgba() const; + void setRgba( bool enable ); + bool alpha() const; + void setAlpha( bool enable ); + bool accum() const; + void setAccum( bool enable ); + bool stencil() const; + void setStencil( bool enable ); + bool stereo() const; + void setStereo( bool enable ); + bool directRendering() const; + void setDirectRendering( bool enable ); + bool hasOverlay() const; + void setOverlay( bool enable ); + + int plane() const; + void setPlane( int plane ); + + void setOption( FormatOption opt ); + bool testOption( FormatOption opt ) const; + + static TQGLFormat defaultFormat(); + static void setDefaultFormat( const TQGLFormat& f ); + + static TQGLFormat defaultOverlayFormat(); + static void setDefaultOverlayFormat( const TQGLFormat& f ); + + static bool hasOpenGL(); + static bool hasOpenGLOverlays(); + + friend TQM_EXPORT_OPENGL bool operator==( const TQGLFormat&, + const TQGLFormat& ); + friend TQM_EXPORT_OPENGL bool operator!=( const TQGLFormat&, + const TQGLFormat& ); +private: + uint opts; + int pln; +}; + + +TQM_EXPORT_OPENGL bool operator==( const TQGLFormat&, const TQGLFormat& ); +TQM_EXPORT_OPENGL bool operator!=( const TQGLFormat&, const TQGLFormat& ); + +class TQM_EXPORT_OPENGL TQGLContext : public TQGL +{ +public: + TQGLContext( const TQGLFormat& format, TQPaintDevice* device ); + TQGLContext( const TQGLFormat& format ); + virtual ~TQGLContext(); + + virtual bool create( const TQGLContext* shareContext = 0 ); + bool isValid() const; + bool isSharing() const; + virtual void reset(); + + TQGLFormat format() const; + TQGLFormat requestedFormat() const; + virtual void setFormat( const TQGLFormat& format ); + + virtual void makeCurrent(); + virtual void swapBuffers() const; + + TQPaintDevice* device() const; + + TQColor overlayTransparentColor() const; + + static const TQGLContext* currentContext(); + +protected: + virtual bool chooseContext( const TQGLContext* shareContext = 0 ); + virtual void doneCurrent(); // ### 4.0: make this public - needed for multithreading stuff + +#if defined(Q_WS_WIN) + virtual int choosePixelFormat( void* pfd, HDC pdc ); +#endif +#if defined(Q_WS_X11) + virtual void* tryVisual( const TQGLFormat& f, int bufDepth = 1 ); + virtual void* chooseVisual(); +#endif +#if defined(Q_WS_MAC) + virtual void* chooseMacVisual(GDHandle); +#endif + + bool deviceIsPixmap() const; + bool windowCreated() const; + void setWindowCreated( bool on ); + bool initialized() const; + void setInitialized( bool on ); + void generateFontDisplayLists( const TQFont & fnt, int listBase ); + + uint colorIndex( const TQColor& c ) const; + void setValid( bool valid ); + void setDevice( TQPaintDevice *pDev ); + +protected: +#if defined(Q_WS_WIN) + HGLRC rc; + HDC dc; + WId win; + int pixelFormatId; + TQGLCmap* cmap; +#elif defined(Q_WS_X11) || defined(Q_WS_MAC) + void* vi; + void* cx; +#if defined(Q_WS_X11) + Q_UINT32 gpm; +#endif +#endif + TQGLFormat glFormat; + TQGLFormat reqFormat; + static TQGLContext* currentCtx; + +private: + void init( TQPaintDevice *dev = 0 ); + class Private { + public: + bool valid; + bool sharing; + bool initDone; + bool crWin; + TQPaintDevice* paintDevice; + TQColor transpColor; +#ifdef Q_WS_MAC + TQRect oldR; +#endif + }; + Private* d; + + friend class TQGLWidget; +#ifdef Q_WS_MAC + void fixBufferRect(); +#endif + +private: // Disabled copy constructor and operator= + TQGLContext() {} + TQGLContext( const TQGLContext& ) {} + TQGLContext& operator=( const TQGLContext& ) { return *this; } +}; + + + + +class TQM_EXPORT_OPENGL TQGLWidget : public TQWidget, public TQGL +{ + Q_OBJECT +public: + TQGLWidget( TQWidget* parent=0, const char* name=0, + const TQGLWidget* shareWidget = 0, WFlags f=0 ); + TQGLWidget( TQGLContext *context, TQWidget* parent, const char* name=0, + const TQGLWidget* shareWidget = 0, WFlags f=0 ); + TQGLWidget( const TQGLFormat& format, TQWidget* parent=0, const char* name=0, + const TQGLWidget* shareWidget = 0, WFlags f=0 ); + ~TQGLWidget(); + + void qglColor( const TQColor& c ) const; + void qglClearColor( const TQColor& c ) const; + + bool isValid() const; + bool isSharing() const; + virtual void makeCurrent(); + void doneCurrent(); + + bool doubleBuffer() const; + virtual void swapBuffers(); + + TQGLFormat format() const; +#ifndef Q_QDOC + virtual void setFormat( const TQGLFormat& format ); +#endif + + const TQGLContext* context() const; +#ifndef Q_QDOC + virtual void setContext( TQGLContext* context, + const TQGLContext* shareContext = 0, + bool deleteOldContext = TRUE ); +#endif + + virtual TQPixmap renderPixmap( int w = 0, int h = 0, + bool useContext = FALSE ); + virtual TQImage grabFrameBuffer( bool withAlpha = FALSE ); + + virtual void makeOverlayCurrent(); + const TQGLContext* overlayContext() const; + + static TQImage convertToGLFormat( const TQImage& img ); + + void setMouseTracking( bool enable ); + virtual void reparent( TQWidget* parent, WFlags f, const TQPoint& p, + bool showIt = FALSE ); + + const TQGLColormap & colormap() const; + void setColormap( const TQGLColormap & map ); + + void renderText( int x, int y, const TQString & str, + const TQFont & fnt = TQFont(), int listBase = 2000 ); + void renderText( double x, double y, double z, const TQString & str, + const TQFont & fnt = TQFont(), int listBase = 2000 ); +public slots: + virtual void updateGL(); + virtual void updateOverlayGL(); + +protected: + virtual void initializeGL(); + virtual void resizeGL( int w, int h ); + virtual void paintGL(); + + virtual void initializeOverlayGL(); + virtual void resizeOverlayGL( int w, int h ); + virtual void paintOverlayGL(); + + void setAutoBufferSwap( bool on ); + bool autoBufferSwap() const; + + void paintEvent( TQPaintEvent* ); + void resizeEvent( TQResizeEvent* ); + + virtual void glInit(); + virtual void glDraw(); + +private: + int displayListBase( const TQFont & fnt, int listBase ); + void cleanupColormaps(); + void init( TQGLContext *context, const TQGLWidget* shareWidget ); + bool renderCxPm( TQPixmap* pm ); + TQGLContext* glcx; + bool autoSwap; + + TQGLColormap cmap; + +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) + TQGLContext* olcx; +#elif defined(Q_WS_X11) + TQGLOverlayWidget* olw; + friend class TQGLOverlayWidget; +#endif + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQGLWidget( const TQGLWidget& ); + TQGLWidget& operator=( const TQGLWidget& ); +#endif + +#if defined(Q_WS_MAC) +private: + const TQGLContext *slcx; + uint pending_fix : 1, + glcx_dblbuf : 2, + dblbuf : 1, + clp_serial : 15; + TQPixmap *gl_pix; + TQGLFormat req_format; + + void macInternalRecreateContext( TQGLContext *ctx, + const TQGLContext* = NULL, + bool update = TRUE ); + bool macInternalDoubleBuffer( bool fix = TRUE ); + virtual void setRegionDirty( bool ); + virtual void macWidgetChangedWindow(); +#endif +private slots: + void macInternalFixBufferRect(); +}; + + +// +// TQGLFormat inline functions +// + +inline bool TQGLFormat::doubleBuffer() const +{ + return testOption( DoubleBuffer ); +} + +inline bool TQGLFormat::depth() const +{ + return testOption( DepthBuffer ); +} + +inline bool TQGLFormat::rgba() const +{ + return testOption( Rgba ); +} + +inline bool TQGLFormat::alpha() const +{ + return testOption( AlphaChannel ); +} + +inline bool TQGLFormat::accum() const +{ + return testOption( AccumBuffer ); +} + +inline bool TQGLFormat::stencil() const +{ + return testOption( StencilBuffer ); +} + +inline bool TQGLFormat::stereo() const +{ + return testOption( StereoBuffers ); +} + +inline bool TQGLFormat::directRendering() const +{ + return testOption( DirectRendering ); +} + +inline bool TQGLFormat::hasOverlay() const +{ + return testOption( HasOverlay ); +} + +// +// TQGLContext inline functions +// + +inline bool TQGLContext::isValid() const +{ + return d->valid; +} + +inline void TQGLContext::setValid( bool valid ) +{ + d->valid = valid; +} + +inline bool TQGLContext::isSharing() const +{ + return d->sharing; +} + +inline TQGLFormat TQGLContext::format() const +{ + return glFormat; +} + +inline TQGLFormat TQGLContext::requestedFormat() const +{ + return reqFormat; +} + +inline TQPaintDevice* TQGLContext::device() const +{ + return d->paintDevice; +} + +inline bool TQGLContext::deviceIsPixmap() const +{ + return d->paintDevice->devType() == TQInternal::Pixmap; +} + + +inline bool TQGLContext::windowCreated() const +{ + return d->crWin; +} + + +inline void TQGLContext::setWindowCreated( bool on ) +{ + d->crWin = on; +} + +inline bool TQGLContext::initialized() const +{ + return d->initDone; +} + +inline void TQGLContext::setInitialized( bool on ) +{ + d->initDone = on; +} + +inline const TQGLContext* TQGLContext::currentContext() +{ + return currentCtx; +} + +// +// TQGLWidget inline functions +// + +inline TQGLFormat TQGLWidget::format() const +{ + return glcx->format(); +} + +inline const TQGLContext *TQGLWidget::context() const +{ + return glcx; +} + +inline bool TQGLWidget::doubleBuffer() const +{ + return glcx->format().doubleBuffer(); +} + +inline void TQGLWidget::setAutoBufferSwap( bool on ) +{ + autoSwap = on; +} + +inline bool TQGLWidget::autoBufferSwap() const +{ + return autoSwap; +} + +#endif diff --git a/src/opengl/ntqglcolormap.h b/src/opengl/ntqglcolormap.h new file mode 100644 index 000000000..23e334109 --- /dev/null +++ b/src/opengl/ntqglcolormap.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Definition of TQGLColormap class +** +** Created : 20010326 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the opengl module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGLCOLORMAP_H +#define TQGLCOLORMAP_H + +#ifndef QT_H +#include "ntqcolor.h" +#include "ntqmemarray.h" +#include "ntqshared.h" +#endif // QT_H + +#if !defined( QT_MODULE_OPENGL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_OPENGL +#else +#define TQM_EXPORT_OPENGL Q_EXPORT +#endif + +class TQWidget; +class TQM_EXPORT_OPENGL TQGLColormap +{ +public: + TQGLColormap(); + TQGLColormap( const TQGLColormap & ); + ~TQGLColormap(); + + TQGLColormap &operator=( const TQGLColormap & ); + + bool isEmpty() const; + int size() const; + void detach(); + + void setEntries( int count, const TQRgb * colors, int base = 0 ); + void setEntry( int idx, TQRgb color ); + void setEntry( int idx, const TQColor & color ); + TQRgb entryRgb( int idx ) const; + TQColor entryColor( int idx ) const; + int find( TQRgb color ) const; + int findNearest( TQRgb color ) const; + +private: + class Private : public TQShared + { + public: + Private() { + cells.resize( 256 ); // ### hardcoded to 256 entries for now + cmapHandle = 0; + } + + ~Private() { + } + + TQMemArray cells; + TQt::HANDLE cmapHandle; + }; + + Private * d; + + friend class TQGLWidget; +}; + +#endif diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index eed5d37b5..612448d59 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qgl.h" -#include "qpixmap.h" -#include "qpaintdevicemetrics.h" -#include "qimage.h" -#include "qcleanuphandler.h" -#include "qptrdict.h" +#include "ntqgl.h" +#include "ntqpixmap.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqimage.h" +#include "ntqcleanuphandler.h" +#include "ntqptrdict.h" static TQGLFormat* qgl_default_format = 0; static TQGLFormat* qgl_default_overlay_format = 0; @@ -62,7 +62,7 @@ static TQCleanupHandler qgl_cleanup_format; /*! - \class TQGL qgl.h + \class TQGL ntqgl.h \brief The TQGL class is a namespace for miscellaneous identifiers in the TQt OpenGL module. \if defined(commercial) @@ -96,7 +96,7 @@ static TQCleanupHandler qgl_cleanup_format; /*! - \class TQGLFormat qgl.h + \class TQGLFormat ntqgl.h \brief The TQGLFormat class specifies the display format of an OpenGL rendering context. \if defined(commercial) @@ -734,7 +734,7 @@ bool operator!=( const TQGLFormat& a, const TQGLFormat& b ) TQGLContext* TQGLContext::currentCtx = 0; /*! - \class TQGLContext qgl.h + \class TQGLContext ntqgl.h \brief The TQGLContext class encapsulates an OpenGL rendering context. \if defined(commercial) It is part of the TQt Enterprise Edition. @@ -1127,7 +1127,7 @@ bool TQGLContext::create( const TQGLContext* shareContext ) /*! - \class TQGLWidget qgl.h + \class TQGLWidget ntqgl.h \brief The TQGLWidget class is a widget for rendering OpenGL graphics. \if defined(commercial) It is part of the TQt Enterprise Edition. diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h deleted file mode 100644 index e58b18d4d..000000000 --- a/src/opengl/qgl.h +++ /dev/null @@ -1,541 +0,0 @@ -/**************************************************************************** -** -** Definition of OpenGL classes for TQt -** -** Created : 970112 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the opengl module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGL_H -#define TQGL_H - -#ifndef QT_H -#include "qwidget.h" -#include "qglcolormap.h" -#endif // QT_H - -#if !defined( QT_MODULE_OPENGL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_OPENGL -#else -#define TQM_EXPORT_OPENGL Q_EXPORT -#endif - -#ifndef QT_NO_COMPAT -#define TQGL_VERSION 450 -#define TQGL_VERSION_STR "4.5" -TQM_EXPORT_OPENGL inline const char *qGLVersion() { - qObsolete( 0, "qGLVersion", "qVersion" ); - return TQGL_VERSION_STR; -} -#endif - -#if defined(Q_WS_WIN) -# include "qt_windows.h" -#endif - -#if defined(Q_WS_MAC) -#if !defined( TQMAC_OPENGL_DOUBLEBUFFER ) -/* This macro is different now. If the macro is not defined TQGLWidget will - * try to determine when you need double buffering. If set to 0 it will - * never double buffer and *can* be acclerated. If set to 1 (the default) - * it will always double buffer. Unlike before the value of this macro does - * not upset binary compatability either. */ -#if QT_MACOSX_VERSION >= 0x1020 -# define TQMAC_OPENGL_DOUBLEBUFFER 0 -#endif -#endif -# include -# include -#else -# include -# include -#endif - -#if defined(Q_WS_WIN) || defined(Q_WS_MAC) -class TQGLCmap; -#endif - -class TQPixmap; -#if defined(Q_WS_X11) -class TQGLOverlayWidget; -#endif - -// Namespace class: -class TQM_EXPORT_OPENGL TQGL -{ -public: - enum FormatOption { - DoubleBuffer = 0x0001, - DepthBuffer = 0x0002, - Rgba = 0x0004, - AlphaChannel = 0x0008, - AccumBuffer = 0x0010, - StencilBuffer = 0x0020, - StereoBuffers = 0x0040, - DirectRendering = 0x0080, - HasOverlay = 0x0100, - SingleBuffer = DoubleBuffer << 16, - NoDepthBuffer = DepthBuffer << 16, - ColorIndex = Rgba << 16, - NoAlphaChannel = AlphaChannel << 16, - NoAccumBuffer = AccumBuffer << 16, - NoStencilBuffer = StencilBuffer << 16, - NoStereoBuffers = StereoBuffers << 16, - IndirectRendering = DirectRendering << 16, - NoOverlay = HasOverlay << 16 - }; -}; - - - -class TQM_EXPORT_OPENGL TQGLFormat : public TQGL -{ -public: - TQGLFormat(); - TQGLFormat( int options, int plane = 0 ); - - bool doubleBuffer() const; - void setDoubleBuffer( bool enable ); - bool depth() const; - void setDepth( bool enable ); - bool rgba() const; - void setRgba( bool enable ); - bool alpha() const; - void setAlpha( bool enable ); - bool accum() const; - void setAccum( bool enable ); - bool stencil() const; - void setStencil( bool enable ); - bool stereo() const; - void setStereo( bool enable ); - bool directRendering() const; - void setDirectRendering( bool enable ); - bool hasOverlay() const; - void setOverlay( bool enable ); - - int plane() const; - void setPlane( int plane ); - - void setOption( FormatOption opt ); - bool testOption( FormatOption opt ) const; - - static TQGLFormat defaultFormat(); - static void setDefaultFormat( const TQGLFormat& f ); - - static TQGLFormat defaultOverlayFormat(); - static void setDefaultOverlayFormat( const TQGLFormat& f ); - - static bool hasOpenGL(); - static bool hasOpenGLOverlays(); - - friend TQM_EXPORT_OPENGL bool operator==( const TQGLFormat&, - const TQGLFormat& ); - friend TQM_EXPORT_OPENGL bool operator!=( const TQGLFormat&, - const TQGLFormat& ); -private: - uint opts; - int pln; -}; - - -TQM_EXPORT_OPENGL bool operator==( const TQGLFormat&, const TQGLFormat& ); -TQM_EXPORT_OPENGL bool operator!=( const TQGLFormat&, const TQGLFormat& ); - -class TQM_EXPORT_OPENGL TQGLContext : public TQGL -{ -public: - TQGLContext( const TQGLFormat& format, TQPaintDevice* device ); - TQGLContext( const TQGLFormat& format ); - virtual ~TQGLContext(); - - virtual bool create( const TQGLContext* shareContext = 0 ); - bool isValid() const; - bool isSharing() const; - virtual void reset(); - - TQGLFormat format() const; - TQGLFormat requestedFormat() const; - virtual void setFormat( const TQGLFormat& format ); - - virtual void makeCurrent(); - virtual void swapBuffers() const; - - TQPaintDevice* device() const; - - TQColor overlayTransparentColor() const; - - static const TQGLContext* currentContext(); - -protected: - virtual bool chooseContext( const TQGLContext* shareContext = 0 ); - virtual void doneCurrent(); // ### 4.0: make this public - needed for multithreading stuff - -#if defined(Q_WS_WIN) - virtual int choosePixelFormat( void* pfd, HDC pdc ); -#endif -#if defined(Q_WS_X11) - virtual void* tryVisual( const TQGLFormat& f, int bufDepth = 1 ); - virtual void* chooseVisual(); -#endif -#if defined(Q_WS_MAC) - virtual void* chooseMacVisual(GDHandle); -#endif - - bool deviceIsPixmap() const; - bool windowCreated() const; - void setWindowCreated( bool on ); - bool initialized() const; - void setInitialized( bool on ); - void generateFontDisplayLists( const TQFont & fnt, int listBase ); - - uint colorIndex( const TQColor& c ) const; - void setValid( bool valid ); - void setDevice( TQPaintDevice *pDev ); - -protected: -#if defined(Q_WS_WIN) - HGLRC rc; - HDC dc; - WId win; - int pixelFormatId; - TQGLCmap* cmap; -#elif defined(Q_WS_X11) || defined(Q_WS_MAC) - void* vi; - void* cx; -#if defined(Q_WS_X11) - Q_UINT32 gpm; -#endif -#endif - TQGLFormat glFormat; - TQGLFormat reqFormat; - static TQGLContext* currentCtx; - -private: - void init( TQPaintDevice *dev = 0 ); - class Private { - public: - bool valid; - bool sharing; - bool initDone; - bool crWin; - TQPaintDevice* paintDevice; - TQColor transpColor; -#ifdef Q_WS_MAC - TQRect oldR; -#endif - }; - Private* d; - - friend class TQGLWidget; -#ifdef Q_WS_MAC - void fixBufferRect(); -#endif - -private: // Disabled copy constructor and operator= - TQGLContext() {} - TQGLContext( const TQGLContext& ) {} - TQGLContext& operator=( const TQGLContext& ) { return *this; } -}; - - - - -class TQM_EXPORT_OPENGL TQGLWidget : public TQWidget, public TQGL -{ - Q_OBJECT -public: - TQGLWidget( TQWidget* parent=0, const char* name=0, - const TQGLWidget* shareWidget = 0, WFlags f=0 ); - TQGLWidget( TQGLContext *context, TQWidget* parent, const char* name=0, - const TQGLWidget* shareWidget = 0, WFlags f=0 ); - TQGLWidget( const TQGLFormat& format, TQWidget* parent=0, const char* name=0, - const TQGLWidget* shareWidget = 0, WFlags f=0 ); - ~TQGLWidget(); - - void qglColor( const TQColor& c ) const; - void qglClearColor( const TQColor& c ) const; - - bool isValid() const; - bool isSharing() const; - virtual void makeCurrent(); - void doneCurrent(); - - bool doubleBuffer() const; - virtual void swapBuffers(); - - TQGLFormat format() const; -#ifndef Q_QDOC - virtual void setFormat( const TQGLFormat& format ); -#endif - - const TQGLContext* context() const; -#ifndef Q_QDOC - virtual void setContext( TQGLContext* context, - const TQGLContext* shareContext = 0, - bool deleteOldContext = TRUE ); -#endif - - virtual TQPixmap renderPixmap( int w = 0, int h = 0, - bool useContext = FALSE ); - virtual TQImage grabFrameBuffer( bool withAlpha = FALSE ); - - virtual void makeOverlayCurrent(); - const TQGLContext* overlayContext() const; - - static TQImage convertToGLFormat( const TQImage& img ); - - void setMouseTracking( bool enable ); - virtual void reparent( TQWidget* parent, WFlags f, const TQPoint& p, - bool showIt = FALSE ); - - const TQGLColormap & colormap() const; - void setColormap( const TQGLColormap & map ); - - void renderText( int x, int y, const TQString & str, - const TQFont & fnt = TQFont(), int listBase = 2000 ); - void renderText( double x, double y, double z, const TQString & str, - const TQFont & fnt = TQFont(), int listBase = 2000 ); -public slots: - virtual void updateGL(); - virtual void updateOverlayGL(); - -protected: - virtual void initializeGL(); - virtual void resizeGL( int w, int h ); - virtual void paintGL(); - - virtual void initializeOverlayGL(); - virtual void resizeOverlayGL( int w, int h ); - virtual void paintOverlayGL(); - - void setAutoBufferSwap( bool on ); - bool autoBufferSwap() const; - - void paintEvent( TQPaintEvent* ); - void resizeEvent( TQResizeEvent* ); - - virtual void glInit(); - virtual void glDraw(); - -private: - int displayListBase( const TQFont & fnt, int listBase ); - void cleanupColormaps(); - void init( TQGLContext *context, const TQGLWidget* shareWidget ); - bool renderCxPm( TQPixmap* pm ); - TQGLContext* glcx; - bool autoSwap; - - TQGLColormap cmap; - -#if defined(Q_WS_WIN) || defined(Q_WS_MAC) - TQGLContext* olcx; -#elif defined(Q_WS_X11) - TQGLOverlayWidget* olw; - friend class TQGLOverlayWidget; -#endif - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQGLWidget( const TQGLWidget& ); - TQGLWidget& operator=( const TQGLWidget& ); -#endif - -#if defined(Q_WS_MAC) -private: - const TQGLContext *slcx; - uint pending_fix : 1, - glcx_dblbuf : 2, - dblbuf : 1, - clp_serial : 15; - TQPixmap *gl_pix; - TQGLFormat req_format; - - void macInternalRecreateContext( TQGLContext *ctx, - const TQGLContext* = NULL, - bool update = TRUE ); - bool macInternalDoubleBuffer( bool fix = TRUE ); - virtual void setRegionDirty( bool ); - virtual void macWidgetChangedWindow(); -#endif -private slots: - void macInternalFixBufferRect(); -}; - - -// -// TQGLFormat inline functions -// - -inline bool TQGLFormat::doubleBuffer() const -{ - return testOption( DoubleBuffer ); -} - -inline bool TQGLFormat::depth() const -{ - return testOption( DepthBuffer ); -} - -inline bool TQGLFormat::rgba() const -{ - return testOption( Rgba ); -} - -inline bool TQGLFormat::alpha() const -{ - return testOption( AlphaChannel ); -} - -inline bool TQGLFormat::accum() const -{ - return testOption( AccumBuffer ); -} - -inline bool TQGLFormat::stencil() const -{ - return testOption( StencilBuffer ); -} - -inline bool TQGLFormat::stereo() const -{ - return testOption( StereoBuffers ); -} - -inline bool TQGLFormat::directRendering() const -{ - return testOption( DirectRendering ); -} - -inline bool TQGLFormat::hasOverlay() const -{ - return testOption( HasOverlay ); -} - -// -// TQGLContext inline functions -// - -inline bool TQGLContext::isValid() const -{ - return d->valid; -} - -inline void TQGLContext::setValid( bool valid ) -{ - d->valid = valid; -} - -inline bool TQGLContext::isSharing() const -{ - return d->sharing; -} - -inline TQGLFormat TQGLContext::format() const -{ - return glFormat; -} - -inline TQGLFormat TQGLContext::requestedFormat() const -{ - return reqFormat; -} - -inline TQPaintDevice* TQGLContext::device() const -{ - return d->paintDevice; -} - -inline bool TQGLContext::deviceIsPixmap() const -{ - return d->paintDevice->devType() == TQInternal::Pixmap; -} - - -inline bool TQGLContext::windowCreated() const -{ - return d->crWin; -} - - -inline void TQGLContext::setWindowCreated( bool on ) -{ - d->crWin = on; -} - -inline bool TQGLContext::initialized() const -{ - return d->initDone; -} - -inline void TQGLContext::setInitialized( bool on ) -{ - d->initDone = on; -} - -inline const TQGLContext* TQGLContext::currentContext() -{ - return currentCtx; -} - -// -// TQGLWidget inline functions -// - -inline TQGLFormat TQGLWidget::format() const -{ - return glcx->format(); -} - -inline const TQGLContext *TQGLWidget::context() const -{ - return glcx; -} - -inline bool TQGLWidget::doubleBuffer() const -{ - return glcx->format().doubleBuffer(); -} - -inline void TQGLWidget::setAutoBufferSwap( bool on ) -{ - autoSwap = on; -} - -inline bool TQGLWidget::autoBufferSwap() const -{ - return autoSwap; -} - -#endif diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index 939653661..a8f317a4f 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qgl.h" +#include "ntqgl.h" #if defined(Q_WS_X11) -#include "qmap.h" -#include "qpixmap.h" -#include "qapplication.h" +#include "ntqmap.h" +#include "ntqpixmap.h" +#include "ntqapplication.h" -#include "qintdict.h" +#include "ntqintdict.h" #include "private/qfontengine_p.h" #define INT8 dummy_INT8 @@ -74,7 +74,7 @@ extern "C" { #include "qgl_x11_p.h" #ifdef QT_DLOPEN_OPENGL -#include "qlibrary.h" +#include "ntqlibrary.h" extern "C" { _glCallLists qt_glCallLists; diff --git a/src/opengl/qglcolormap.cpp b/src/opengl/qglcolormap.cpp index 22b819f39..048b7dc29 100644 --- a/src/opengl/qglcolormap.cpp +++ b/src/opengl/qglcolormap.cpp @@ -39,7 +39,7 @@ **********************************************************************/ /*! - \class TQGLColormap qglcolormap.h + \class TQGLColormap ntqglcolormap.h \brief The TQGLColormap class is used for installing custom colormaps into TQGLWidgets. \if defined(commercial) @@ -73,8 +73,8 @@ Example of use: \code - #include - #include + #include + #include int main() { @@ -97,8 +97,8 @@ \sa TQGLWidget::setColormap(), TQGLWidget::colormap() */ -#include "qglcolormap.h" -#include "qmemarray.h" +#include "ntqglcolormap.h" +#include "ntqmemarray.h" /*! diff --git a/src/opengl/qglcolormap.h b/src/opengl/qglcolormap.h deleted file mode 100644 index 9aaaf22d1..000000000 --- a/src/opengl/qglcolormap.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGLColormap class -** -** Created : 20010326 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the opengl module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGLCOLORMAP_H -#define TQGLCOLORMAP_H - -#ifndef QT_H -#include "qcolor.h" -#include "qmemarray.h" -#include "qshared.h" -#endif // QT_H - -#if !defined( QT_MODULE_OPENGL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_OPENGL -#else -#define TQM_EXPORT_OPENGL Q_EXPORT -#endif - -class TQWidget; -class TQM_EXPORT_OPENGL TQGLColormap -{ -public: - TQGLColormap(); - TQGLColormap( const TQGLColormap & ); - ~TQGLColormap(); - - TQGLColormap &operator=( const TQGLColormap & ); - - bool isEmpty() const; - int size() const; - void detach(); - - void setEntries( int count, const TQRgb * colors, int base = 0 ); - void setEntry( int idx, TQRgb color ); - void setEntry( int idx, const TQColor & color ); - TQRgb entryRgb( int idx ) const; - TQColor entryColor( int idx ) const; - int find( TQRgb color ) const; - int findNearest( TQRgb color ) const; - -private: - class Private : public TQShared - { - public: - Private() { - cells.resize( 256 ); // ### hardcoded to 256 entries for now - cmapHandle = 0; - } - - ~Private() { - } - - TQMemArray cells; - TQt::HANDLE cmapHandle; - }; - - Private * d; - - friend class TQGLWidget; -}; - -#endif diff --git a/src/opengl/qt_opengl.pri b/src/opengl/qt_opengl.pri index bb0a5d869..b89ea8c27 100644 --- a/src/opengl/qt_opengl.pri +++ b/src/opengl/qt_opengl.pri @@ -1,8 +1,8 @@ # Qt opengl module opengl { - HEADERS += $$OPENGL_H/qgl.h \ - $$OPENGL_H/qglcolormap.h + HEADERS += $$OPENGL_H/ntqgl.h \ + $$OPENGL_H/ntqglcolormap.h SOURCES += $$OPENGL_CPP/qgl.cpp \ $$OPENGL_CPP/qglcolormap.cpp x11 { diff --git a/src/qt.pro b/src/qt.pro index 5e00def09..d0315c61c 100644 --- a/src/qt.pro +++ b/src/qt.pro @@ -183,11 +183,11 @@ wince-* { CONFIG -= incremental message( ...removing plugin stuff... (not permanent) ) HEADERS -= $$TOOLS_CPP/qcomlibrary.h \ - $$KERNEL_CPP/qgplugin.h \ - $$KERNEL_CPP/qimageformatplugin.h \ - $$STYLES_CPP/qstyleplugin.h \ - $$CODECS_CPP/qtextcodecplugin.h \ - $$WIDGETS_CPP/qwidgetplugin.h + $$KERNEL_CPP/ntqgplugin.h \ + $$KERNEL_CPP/ntqimageformatplugin.h \ + $$STYLES_CPP/ntqstyleplugin.h \ + $$CODECS_CPP/ntqtextcodecplugin.h \ + $$WIDGETS_CPP/ntqwidgetplugin.h SOURCES -= $$TOOLS_CPP/qcomlibrary.cpp \ $$KERNEL_CPP/qgplugin.cpp \ diff --git a/src/qt_install.pri b/src/qt_install.pri index 619814dbd..6ef9ec193 100644 --- a/src/qt_install.pri +++ b/src/qt_install.pri @@ -4,8 +4,8 @@ INSTALLS += target #headers headers.files = ../include/*.h -headers.files += $$QT_BUILD_TREE/include/qconfig.h \ - $$QT_BUILD_TREE/include/qmodules.h +headers.files += $$QT_BUILD_TREE/include/ntqconfig.h \ + $$QT_BUILD_TREE/include/ntqmodules.h isEmpty(headers_p.path):headers_p.path=$$headers.path/private headers_p.files = ../include/private/*.h INSTALLS += headers headers_p diff --git a/src/sql/drivers/cache/qsqlcachedresult.cpp b/src/sql/drivers/cache/qsqlcachedresult.cpp index 4c841e5f1..4f60fa252 100644 --- a/src/sql/drivers/cache/qsqlcachedresult.cpp +++ b/src/sql/drivers/cache/qsqlcachedresult.cpp @@ -38,7 +38,7 @@ **********************************************************************/ #include "qsqlcachedresult.h" -#include +#include #ifndef QT_NO_SQL static const uint initial_cache_size = 128; diff --git a/src/sql/drivers/cache/qsqlcachedresult.h b/src/sql/drivers/cache/qsqlcachedresult.h index 6d78f39de..bde3457d1 100644 --- a/src/sql/drivers/cache/qsqlcachedresult.h +++ b/src/sql/drivers/cache/qsqlcachedresult.h @@ -51,11 +51,11 @@ // // -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) #define TQM_EXPORT_SQL diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 22c41064d..f6aff5dbb 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -14,7 +14,7 @@ #include "qsql_ibase.h" -#include +#include #include #include diff --git a/src/sql/drivers/ibase/qsql_ibase.h b/src/sql/drivers/ibase/qsql_ibase.h index fcb738513..45cb4b86b 100644 --- a/src/sql/drivers/ibase/qsql_ibase.h +++ b/src/sql/drivers/ibase/qsql_ibase.h @@ -41,8 +41,8 @@ #ifndef TQSQL_IBASE_H #define TQSQL_IBASE_H -#include "qsqlresult.h" -#include "qsqldriver.h" +#include "ntqsqlresult.h" +#include "ntqsqldriver.h" #include "../cache/qsqlcachedresult.h" diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 10448414e..433e8de26 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -41,9 +41,9 @@ #include "qsql_mysql.h" #include -#include -#include -#include +#include +#include +#include #define TQMYSQL_DRIVER_NAME "TQMYSQL3" diff --git a/src/sql/drivers/mysql/qsql_mysql.h b/src/sql/drivers/mysql/qsql_mysql.h index 4d4c7b1e5..6b1daef3a 100644 --- a/src/sql/drivers/mysql/qsql_mysql.h +++ b/src/sql/drivers/mysql/qsql_mysql.h @@ -41,10 +41,10 @@ #ifndef TQSQL_MYSQL_H #define TQSQL_MYSQL_H -#include -#include -#include -#include +#include +#include +#include +#include #if defined (Q_OS_WIN32) #include diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 9851e1cb1..b91bea329 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -39,13 +39,13 @@ **********************************************************************/ #include "qsql_odbc.h" -#include +#include #if defined (Q_OS_WIN32) #include -#include +#include #endif -#include +#include #include #include #include diff --git a/src/sql/drivers/odbc/qsql_odbc.h b/src/sql/drivers/odbc/qsql_odbc.h index 8583dced4..0ce01703a 100644 --- a/src/sql/drivers/odbc/qsql_odbc.h +++ b/src/sql/drivers/odbc/qsql_odbc.h @@ -41,12 +41,12 @@ #ifndef TQSQL_ODBC_H #define TQSQL_ODBC_H -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if defined (Q_OS_WIN32) #include diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 788a69358..b039a2474 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -43,10 +43,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include // PostgreSQL header included by redefines DEBUG. #if defined(DEBUG) # undef DEBUG diff --git a/src/sql/drivers/psql/qsql_psql.h b/src/sql/drivers/psql/qsql_psql.h index bed3ebbc9..dd1ddc71c 100644 --- a/src/sql/drivers/psql/qsql_psql.h +++ b/src/sql/drivers/psql/qsql_psql.h @@ -41,9 +41,9 @@ #ifndef TQSQL_PSQL_H #define TQSQL_PSQL_H -#include -#include -#include +#include +#include +#include #include #ifdef QT_PLUGIN diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index ecdda1c0c..1662a6e8c 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -14,18 +14,18 @@ #include "qsql_sqlite.h" -#include -#include -#include +#include +#include +#include #if (QT_VERSION-0 < 0x030000) -# include +# include # if !defined Q_WS_WIN32 # include # endif # include "../../../3rdparty/libraries/sqlite/sqlite.h" #else -# include +# include # if !defined Q_WS_WIN32 # include # endif diff --git a/src/sql/drivers/sqlite/qsql_sqlite.h b/src/sql/drivers/sqlite/qsql_sqlite.h index ccde9b865..300642ce1 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.h +++ b/src/sql/drivers/sqlite/qsql_sqlite.h @@ -15,10 +15,10 @@ #ifndef TQSQL_SQLITE_H #define TQSQL_SQLITE_H -#include -#include -#include -#include +#include +#include +#include +#include #include "../cache/qsqlcachedresult.h" #if (QT_VERSION-0 >= 0x030000) diff --git a/src/sql/ntqdatabrowser.h b/src/sql/ntqdatabrowser.h new file mode 100644 index 000000000..9fa57a894 --- /dev/null +++ b/src/sql/ntqdatabrowser.h @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Definition of TQDataBrowser class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDATABROWSER_H +#define TQDATABROWSER_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqsql.h" +#include "ntqsqlindex.h" +#include "ntqsqlcursor.h" +#include "ntqsqlerror.h" +#endif // QT_H + +#ifndef QT_NO_SQL_VIEW_WIDGETS + +class TQSqlForm; +class TQDataBrowserPrivate; + +class Q_EXPORT TQDataBrowser : public TQWidget +{ + Q_OBJECT + Q_PROPERTY( bool boundaryChecking READ boundaryChecking WRITE setBoundaryChecking ) + Q_PROPERTY( TQString filter READ filter WRITE setFilter ) + Q_PROPERTY( TQStringList sort READ sort WRITE setSort ) + Q_PROPERTY( bool confirmEdits READ confirmEdits WRITE setConfirmEdits ) + Q_PROPERTY( bool confirmInsert READ confirmInsert WRITE setConfirmInsert ) + Q_PROPERTY( bool confirmUpdate READ confirmUpdate WRITE setConfirmUpdate ) + Q_PROPERTY( bool confirmDelete READ confirmDelete WRITE setConfirmDelete ) + Q_PROPERTY( bool confirmCancels READ confirmCancels WRITE setConfirmCancels ) + Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) + Q_PROPERTY( bool autoEdit READ autoEdit WRITE setAutoEdit ) + +public: + TQDataBrowser( TQWidget* parent=0, const char* name=0, WFlags fl = 0 ); + ~TQDataBrowser(); + + enum Boundary { + Unknown, + None, + BeforeBeginning, + Beginning, + End, + AfterEnd + }; + + Boundary boundary(); + void setBoundaryChecking( bool active ); + bool boundaryChecking() const; + + void setSort( const TQSqlIndex& sort ); + void setSort( const TQStringList& sort ); + TQStringList sort() const; + void setFilter( const TQString& filter ); + TQString filter() const; + virtual void setSqlCursor( TQSqlCursor* cursor, bool autoDelete = FALSE ); + TQSqlCursor* sqlCursor() const; + virtual void setForm( TQSqlForm* form ); + TQSqlForm* form(); + + virtual void setConfirmEdits( bool confirm ); + virtual void setConfirmInsert( bool confirm ); + virtual void setConfirmUpdate( bool confirm ); + virtual void setConfirmDelete( bool confirm ); + virtual void setConfirmCancels( bool confirm ); + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + + virtual void setReadOnly( bool active ); + bool isReadOnly() const; + virtual void setAutoEdit( bool autoEdit ); + bool autoEdit() const; + + virtual bool seek( int i, bool relative = FALSE ); + +signals: + void firstRecordAvailable( bool available ); + void lastRecordAvailable( bool available ); + void nextRecordAvailable( bool available ); + void prevRecordAvailable( bool available ); + + void currentChanged( const TQSqlRecord* record ); + void primeInsert( TQSqlRecord* buf ); + void primeUpdate( TQSqlRecord* buf ); + void primeDelete( TQSqlRecord* buf ); + void beforeInsert( TQSqlRecord* buf ); + void beforeUpdate( TQSqlRecord* buf ); + void beforeDelete( TQSqlRecord* buf ); + void cursorChanged( TQSqlCursor::Mode mode ); + +public slots: + virtual void refresh(); + + virtual void insert(); + virtual void update(); + virtual void del(); + + virtual void first(); + virtual void last(); + virtual void next(); + virtual void prev(); + + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + + void updateBoundary(); + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + virtual bool currentEdited(); + + virtual TQSql::Confirm confirmEdit( TQSql::Op m ); + virtual TQSql::Confirm confirmCancel( TQSql::Op m ); + + virtual void handleError( const TQSqlError& error ); + +private: + typedef bool (TQSqlCursor::*Nav)(); + bool preNav(); + void postNav( bool primeUpd ); + void nav( Nav nav ); + TQDataBrowserPrivate* d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDataBrowser( const TQDataBrowser & ); + TQDataBrowser &operator=( const TQDataBrowser & ); +#endif +}; + + +#endif +#endif diff --git a/src/sql/ntqdatatable.h b/src/sql/ntqdatatable.h new file mode 100644 index 000000000..11b9c60bf --- /dev/null +++ b/src/sql/ntqdatatable.h @@ -0,0 +1,244 @@ +/**************************************************************************** +** +** Definition of TQDataTable class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDATATABLE_H +#define TQDATATABLE_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqvariant.h" +#include "ntqtable.h" +#include "ntqsql.h" +#include "ntqsqlcursor.h" +#include "ntqsqlindex.h" +#include "ntqsqleditorfactory.h" +#include "ntqiconset.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL_VIEW_WIDGETS + +class TQPainter; +class TQSqlField; +class TQSqlPropertyMap; +class TQDataTablePrivate; + +class TQM_EXPORT_SQL TQDataTable : public TQTable +{ + Q_OBJECT + + Q_PROPERTY( TQString nullText READ nullText WRITE setNullText ) + Q_PROPERTY( TQString trueText READ trueText WRITE setTrueText ) + Q_PROPERTY( TQString falseText READ falseText WRITE setFalseText ) + Q_PROPERTY( DateFormat dateFormat READ dateFormat WRITE setDateFormat ) + Q_PROPERTY( bool confirmEdits READ confirmEdits WRITE setConfirmEdits ) + Q_PROPERTY( bool confirmInsert READ confirmInsert WRITE setConfirmInsert ) + Q_PROPERTY( bool confirmUpdate READ confirmUpdate WRITE setConfirmUpdate ) + Q_PROPERTY( bool confirmDelete READ confirmDelete WRITE setConfirmDelete ) + Q_PROPERTY( bool confirmCancels READ confirmCancels WRITE setConfirmCancels ) + Q_PROPERTY( bool autoEdit READ autoEdit WRITE setAutoEdit ) + Q_PROPERTY( TQString filter READ filter WRITE setFilter ) + Q_PROPERTY( TQStringList sort READ sort WRITE setSort ) + Q_PROPERTY( int numCols READ numCols ) + Q_PROPERTY( int numRows READ numRows ) + +public: + TQDataTable ( TQWidget* parent=0, const char* name=0 ); + TQDataTable ( TQSqlCursor* cursor, bool autoPopulate = FALSE, TQWidget* parent=0, const char* name=0 ); + ~TQDataTable(); + + virtual void addColumn( const TQString& fieldName, + const TQString& label = TQString::null, + int width = -1, + const TQIconSet& iconset = TQIconSet() ); + virtual void removeColumn( uint col ); + virtual void setColumn( uint col, const TQString& fieldName, + const TQString& label = TQString::null, + int width = -1, + const TQIconSet& iconset = 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* cursor = 0, + bool autoPopulate = FALSE, bool autoDelete = FALSE ); + TQSqlCursor* sqlCursor() const; + + virtual void setNullText( const TQString& nullText ); + virtual void setTrueText( const TQString& trueText ); + virtual void setFalseText( const TQString& falseText ); + virtual void setDateFormat( const DateFormat f ); + virtual void setConfirmEdits( bool confirm ); + virtual void setConfirmInsert( bool confirm ); + virtual void setConfirmUpdate( bool confirm ); + virtual void setConfirmDelete( bool confirm ); + virtual void setConfirmCancels( bool confirm ); + virtual void setAutoDelete( bool enable ); + virtual void setAutoEdit( bool autoEdit ); + virtual void setFilter( const TQString& filter ); + virtual void setSort( const TQStringList& sort ); + virtual void setSort( const TQSqlIndex& sort ); + + enum Refresh { + RefreshData = 1, + RefreshColumns = 2, + RefreshAll = 3 + }; + void refresh( Refresh mode ); + void sortColumn ( int col, bool ascending = TRUE, + bool wholeRows = FALSE ); + TQString text ( int row, int col ) const; + TQVariant value ( int row, int col ) const; + TQSqlRecord* currentRecord() const; + + void installEditorFactory( TQSqlEditorFactory * f ); + void installPropertyMap( TQSqlPropertyMap* m ); + + int numCols() const; + int numRows() const; + void setNumCols( int c ); + void setNumRows ( int r ); + bool findBuffer( const TQSqlIndex& idx, int atHint = 0 ); + + void hideColumn( int col ); + void showColumn( int col ); +signals: + void currentChanged( TQSqlRecord* record ); + void primeInsert( TQSqlRecord* buf ); + void primeUpdate( TQSqlRecord* buf ); + void primeDelete( TQSqlRecord* buf ); + void beforeInsert( TQSqlRecord* buf ); + void beforeUpdate( TQSqlRecord* buf ); + void beforeDelete( TQSqlRecord* buf ); + void cursorChanged( TQSql::Op mode ); + +public slots: + virtual void find( const TQString & str, bool caseSensitive, + bool backwards ); + virtual void sortAscending( int col ); + virtual void sortDescending( int col ); + virtual void refresh(); + void setColumnWidth( int col, int w ); + void adjustColumn( int col ); + void setColumnStretchable( int col, bool stretch ); + void swapColumns( int col1, int col2, bool swapHeaders = FALSE ); + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + + virtual TQSql::Confirm confirmEdit( TQSql::Op m ); + virtual TQSql::Confirm confirmCancel( TQSql::Op m ); + + virtual void handleError( const TQSqlError& e ); + + virtual bool beginInsert(); + virtual TQWidget* beginUpdate ( int row, int col, bool replace ); + + bool eventFilter( TQObject *o, TQEvent *e ); + void keyPressEvent( TQKeyEvent* ); + void resizeEvent ( TQResizeEvent * ); + void contentsMousePressEvent( TQMouseEvent* e ); + void contentsContextMenuEvent( TQContextMenuEvent* e ); + void endEdit( int row, int col, bool accept, bool replace ); + TQWidget * createEditor( int row, int col, bool initFromCell ) const; + void activateNextCell(); + int indexOf( uint i ) const; // ### make this public in 4.0 + void reset(); + void setSize( TQSqlCursor* sql ); + void repaintCell( int row, int col ); + void paintCell ( TQPainter * p, int row, int col, const TQRect & cr, + bool selected, const TQColorGroup &cg ); + virtual void paintField( TQPainter * p, const TQSqlField* field, const TQRect & cr, + bool selected ); + void drawContents( TQPainter * p, int cx, int cy, int cw, int ch ); + virtual int fieldAlignment( const TQSqlField* field ); + void columnClicked ( int col ); + void resizeData ( int len ); + + TQTableItem * item ( int row, int col ) const; + void setItem ( int row, int col, TQTableItem * item ); + void clearCell ( int row, int col ) ; + void setPixmap ( int row, int col, const TQPixmap & pix ); + void takeItem ( TQTableItem * i ); + +private slots: + void loadNextPage(); + void setCurrentSelection( int row, int col ); + void updateCurrentSelection(); + void sliderPressed(); + void sliderReleased(); + void doInsertCurrent(); + void doUpdateCurrent(); + +private: + TQString fieldToString( const TQSqlField * field ); + void init(); + TQWidget* beginEdit ( int row, int col, bool replace ); + void updateRow( int row ); + void endInsert(); + void endUpdate(); + TQDataTablePrivate* d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDataTable( const TQDataTable & ); + TQDataTable &operator=( const TQDataTable & ); +#endif +}; + +#endif +#endif diff --git a/src/sql/ntqdataview.h b/src/sql/ntqdataview.h new file mode 100644 index 000000000..244c8039c --- /dev/null +++ b/src/sql/ntqdataview.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Definition of TQDataView class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDATAVIEW_H +#define TQDATAVIEW_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL_VIEW_WIDGETS + +class TQSqlForm; +class TQSqlRecord; +class TQDataViewPrivate; + +class TQM_EXPORT_SQL TQDataView : public TQWidget +{ + Q_OBJECT + +public: + TQDataView( TQWidget* parent=0, const char* name=0, WFlags fl = 0 ); + ~TQDataView(); + + virtual void setForm( TQSqlForm* form ); + TQSqlForm* form(); + virtual void setRecord( TQSqlRecord* record ); + TQSqlRecord* record(); + +public slots: + virtual void refresh( TQSqlRecord* buf ); + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + +private: + TQDataViewPrivate* d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDataView( const TQDataView & ); + TQDataView &operator=( const TQDataView & ); +#endif +}; + + +#endif +#endif diff --git a/src/sql/ntqeditorfactory.h b/src/sql/ntqeditorfactory.h new file mode 100644 index 000000000..9ec8485c8 --- /dev/null +++ b/src/sql/ntqeditorfactory.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Definition of TQEditorFactory class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQEDITORFACTORY_H +#define TQEDITORFACTORY_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqvariant.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL_EDIT_WIDGETS + +class TQM_EXPORT_SQL TQEditorFactory : public TQObject +{ +public: + TQEditorFactory ( TQObject * parent = 0, const char * name = 0 ); + ~TQEditorFactory(); + + virtual TQWidget * createEditor( TQWidget * parent, const TQVariant & v ); + + static TQEditorFactory * defaultFactory(); + static void installDefaultFactory( TQEditorFactory * factory); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQEditorFactory( const TQEditorFactory & ); + TQEditorFactory &operator=( const TQEditorFactory & ); +#endif +}; + +#endif // QT_NO_SQL +#endif // TQEDITORFACTORY_H diff --git a/src/sql/ntqsql.h b/src/sql/ntqsql.h new file mode 100644 index 000000000..68aa971f2 --- /dev/null +++ b/src/sql/ntqsql.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Definition of TQSql class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQL_H +#define TQSQL_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQM_EXPORT_SQL TQSql +{ +public: + TQSql() {} + enum Op { + None = -1, + Insert = 0, + Update = 1, + Delete = 2 + }; + + enum Location { + BeforeFirst = -1, + AfterLast = -2 + }; + + enum Confirm { + Cancel = -1, + No = 0, + Yes = 1 + }; + + enum ParameterType { + In = 1, + Out = 2, + InOut = 3 //InOut = In | Out + }; + + enum TableType { + Tables = 0x01, + SystemTables = 0x02, + Views = 0x04, + AllTables = 0xff + }; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSql( const TQSql & ); + TQSql &operator=( const TQSql & ); +#endif + +}; + +#endif +#endif diff --git a/src/sql/ntqsqlcursor.h b/src/sql/ntqsqlcursor.h new file mode 100644 index 000000000..0e6e3d0b4 --- /dev/null +++ b/src/sql/ntqsqlcursor.h @@ -0,0 +1,160 @@ +/**************************************************************************** +** +** Definition of TQSqlCursor class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLCURSOR_H +#define TQSQLCURSOR_H + +#ifndef QT_H +#include "ntqsqlrecord.h" +#include "ntqstringlist.h" +#include "ntqsqlquery.h" +#include "ntqsqlindex.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQSqlDatabase; +class TQSqlCursorPrivate; + +class TQM_EXPORT_SQL TQSqlCursor : public TQSqlRecord, public TQSqlQuery +{ +public: + TQSqlCursor( const TQString & name = TQString::null, bool autopopulate = TRUE, TQSqlDatabase* db = 0 ); + TQSqlCursor( const TQSqlCursor & other ); + TQSqlCursor& operator=( const TQSqlCursor& other ); + ~TQSqlCursor(); + + enum Mode { + ReadOnly = 0, + Insert = 1, + Update = 2, + Delete = 4, + Writable = 7 + }; + + TQVariant value( int i ) const; + TQVariant value( const TQString& name ) const; + void setValue( int i, const TQVariant& val ); + void setValue( const TQString& name, const TQVariant& val ); + virtual TQSqlIndex primaryIndex( bool prime = TRUE ) const; + virtual TQSqlIndex index( const TQStringList& fieldNames ) const; + TQSqlIndex index( const TQString& fieldName ) const; + TQSqlIndex index( const char* fieldName ) const; + virtual void setPrimaryIndex( const TQSqlIndex& idx ); + + virtual void append( const TQSqlFieldInfo& fieldInfo ); + virtual void insert( int pos, const TQSqlFieldInfo& fieldInfo ); + void remove( int pos ); + void clear(); + void setGenerated( const TQString& name, bool generated ); + void setGenerated( int i, bool generated ); + + virtual TQSqlRecord* editBuffer( bool copy = FALSE ); + virtual TQSqlRecord* primeInsert(); + virtual TQSqlRecord* primeUpdate(); + virtual TQSqlRecord* primeDelete(); + virtual int insert( bool invalidate = TRUE ); + virtual int update( bool invalidate = TRUE ); + virtual int del( bool invalidate = TRUE ); + + virtual void setMode( int flags ); + int mode() const; + virtual void setCalculated( const TQString& name, bool calculated ); + bool isCalculated( const TQString& name ) const; + virtual void setTrimmed( const TQString& name, bool trim ); + bool isTrimmed( const TQString& name ) const; + + bool isReadOnly() const; + bool canInsert() const; + bool canUpdate() const; + bool canDelete() const; + + bool select(); + bool select( const TQSqlIndex& sort ); + bool select( const TQSqlIndex & filter, const TQSqlIndex & sort ); + virtual bool select( const TQString & filter, const TQSqlIndex & sort = TQSqlIndex() ); + + virtual void setSort( const TQSqlIndex& sort ); + TQSqlIndex sort() const; + virtual void setFilter( const TQString& filter ); + TQString filter() const; + virtual void setName( const TQString& name, bool autopopulate = TRUE ); + TQString name() const; + TQString toString( const TQString& prefix = TQString::null, + const TQString& sep = "," ) const; + bool isNull( int i ) const; + bool isNull( const TQString& name ) const; + +protected: + void afterSeek(); + bool exec( const TQString & sql ); + + virtual TQVariant calculateField( const TQString& name ); + virtual int update( const TQString & filter, bool invalidate = TRUE ); + virtual int del( const TQString & filter, bool invalidate = TRUE ); + + virtual TQString toString( const TQString& prefix, TQSqlField* field, const TQString& fieldSep ) const; + virtual TQString toString( TQSqlRecord* rec, const TQString& prefix, const TQString& fieldSep, + const TQString& sep ) const; + virtual TQString toString( const TQSqlIndex& i, TQSqlRecord* rec, const TQString& prefix, + const TQString& fieldSep, const TQString& sep ) const; + +private: + void sync(); + int apply( const TQString& q, bool invalidate ); + int applyPrepared( const TQString& q, bool invalidate ); + TQSqlRecord& operator=( const TQSqlRecord & list ); + void append( const TQSqlField& field ); + void insert( int pos, const TQSqlField& field ); + + TQSqlCursorPrivate* d; +}; + + + + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqldatabase.h b/src/sql/ntqsqldatabase.h new file mode 100644 index 000000000..3112e2b3b --- /dev/null +++ b/src/sql/ntqsqldatabase.h @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Definition of TQSqlDatabase class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLDATABASE_H +#define TQSQLDATABASE_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqstring.h" +#include "ntqsqlquery.h" +#include "ntqstringlist.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQSqlError; +class TQSqlDriver; +class TQSqlIndex; +class TQSqlRecord; +class TQSqlRecordInfo; +class TQSqlDatabasePrivate; + +class TQM_EXPORT_SQL TQSqlDriverCreatorBase +{ +public: + virtual TQSqlDriver* createObject() = 0; +}; + +template +class TQM_EXPORT_SQL TQSqlDriverCreator: public TQSqlDriverCreatorBase +{ +public: + TQSqlDriver* createObject() { return new type; } +}; + +class TQM_EXPORT_SQL TQSqlDatabase : public TQObject +{ + Q_OBJECT + Q_PROPERTY( TQString databaseName READ databaseName WRITE setDatabaseName ) + Q_PROPERTY( TQString userName READ userName WRITE setUserName ) + Q_PROPERTY( TQString password READ password WRITE setPassword ) + Q_PROPERTY( TQString hostName READ hostName WRITE setHostName ) + Q_PROPERTY( int port READ port WRITE setPort ) + Q_PROPERTY( TQString connectOptions READ connectOptions WRITE setConnectOptions ) + +public: + ~TQSqlDatabase(); + + bool open(); + bool open( const TQString& user, const TQString& password ); + void close(); + bool isOpen() const; + bool isOpenError() const; + TQStringList tables() const; + TQStringList tables( TQSql::TableType type ) const; + TQSqlIndex primaryIndex( const TQString& tablename ) const; + TQSqlRecord record( const TQString& tablename ) const; + TQSqlRecord record( const TQSqlQuery& query ) const; + TQSqlRecordInfo recordInfo( const TQString& tablename ) const; + TQSqlRecordInfo recordInfo( const TQSqlQuery& query ) const; + TQSqlQuery exec( const TQString& query = TQString::null ) const; + TQSqlError lastError() const; + + bool transaction(); + bool commit(); + bool rollback(); + + virtual void setDatabaseName( const TQString& name ); + virtual void setUserName( const TQString& name ); + virtual void setPassword( const TQString& password ); + virtual void setHostName( const TQString& host ); + virtual void setPort( int p ); + void setConnectOptions( const TQString& options = 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; + + // MOC_SKIP_BEGIN + QT_STATIC_CONST char * const defaultConnection; + // MOC_SKIP_END + + static TQSqlDatabase* addDatabase( const TQString& type, const TQString& connectionName = defaultConnection ); + static TQSqlDatabase* addDatabase( TQSqlDriver* driver, const TQString& connectionName = defaultConnection ); + static TQSqlDatabase* database( const TQString& connectionName = defaultConnection, bool open = TRUE ); + static void removeDatabase( const TQString& connectionName ); + static void removeDatabase( TQSqlDatabase* db ); + static bool contains( const TQString& connectionName = defaultConnection ); + static TQStringList drivers(); + static void registerSqlDriver( const TQString& name, const TQSqlDriverCreatorBase* creator ); // ### 4.0: creator should not be const + static bool isDriverAvailable( const TQString& name ); + +protected: + TQSqlDatabase( const TQString& type, const TQString& name, TQObject * parent=0, const char * objname=0 ); + TQSqlDatabase( TQSqlDriver* driver, TQObject * parent=0, const char * objname=0 ); +private: + void init( const TQString& type, const TQString& name ); + TQSqlDatabasePrivate* d; +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQSqlDatabase( const TQSqlDatabase & ); + TQSqlDatabase &operator=( const TQSqlDatabase & ); +#endif + +}; + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqldriver.h b/src/sql/ntqsqldriver.h new file mode 100644 index 000000000..c10597723 --- /dev/null +++ b/src/sql/ntqsqldriver.h @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Definition of TQSqlDriver class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLDRIVER_H +#define TQSQLDRIVER_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqptrdict.h" +#include "ntqstring.h" +#include "ntqsqlerror.h" +#include "ntqsqlquery.h" +#include "ntqsqlfield.h" +#include "ntqsqlindex.h" +#include "ntqstringlist.h" +#include "ntqmap.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQSqlDriverExtension; + +class TQSqlDatabase; + +class TQM_EXPORT_SQL TQSqlDriver : public TQObject +{ + friend class TQSqlDatabase; + Q_OBJECT +public: + enum DriverFeature { Transactions, QuerySize, BLOB, Unicode, PreparedQueries, + NamedPlaceholders, PositionalPlaceholders }; + + TQSqlDriver( TQObject * parent=0, const char * name=0 ); + ~TQSqlDriver(); + bool isOpen() const; + bool isOpenError() const; + + virtual bool beginTransaction(); + virtual bool commitTransaction(); + virtual bool rollbackTransaction(); + virtual TQStringList tables( const TQString& tableType ) const; + virtual TQSqlIndex primaryIndex( const TQString& tableName ) const; + virtual TQSqlRecord record( const TQString& tableName ) const; + virtual TQSqlRecord record( const TQSqlQuery& query ) const; + virtual TQSqlRecordInfo recordInfo( const TQString& tablename ) const; + virtual TQSqlRecordInfo recordInfo( const TQSqlQuery& query ) const; + virtual TQString nullText() const; + virtual TQString formatValue( const TQSqlField* field, bool trimStrings = FALSE ) const; + TQSqlError lastError() const; + + virtual bool hasFeature( DriverFeature f ) const = 0; + virtual bool open( const TQString & db, + const TQString & user = TQString::null, + const TQString & password = TQString::null, + const TQString & host = TQString::null, + int port = -1 ) = 0; + virtual void close() = 0; + virtual TQSqlQuery createQuery() const = 0; + + // ### remove for 4.0 + bool open( const TQString& db, + const TQString& user, + const TQString& password, + const TQString& host, + int port, + const TQString& connOpts ); +protected: + virtual void setOpen( bool o ); + virtual void setOpenError( bool e ); + virtual void setLastError( const TQSqlError& e ); +private: + // ### This class needs a d-pointer in 4.0. + int dbState; + TQSqlError error; +#if defined(Q_DISABLE_COPY) + TQSqlDriver( const TQSqlDriver & ); + TQSqlDriver &operator=( const TQSqlDriver & ); +#endif +}; + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqldriverplugin.h b/src/sql/ntqsqldriverplugin.h new file mode 100644 index 000000000..e5a9352a9 --- /dev/null +++ b/src/sql/ntqsqldriverplugin.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Definition of TQSqlDriverPlugin class +** +** Created : 2001-09-20 +** +** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLDRIVERPLUGIN_H +#define TQSQLDRIVERPLUGIN_H + +#ifndef QT_H +#include "ntqgplugin.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_SQL +#ifndef QT_NO_COMPONENT + +class TQSqlDriver; +class TQSqlDriverPluginPrivate; + +class Q_EXPORT TQSqlDriverPlugin : public TQGPlugin +{ + Q_OBJECT +public: + TQSqlDriverPlugin(); + ~TQSqlDriverPlugin(); + + virtual TQStringList keys() const = 0; + virtual TQSqlDriver *create( const TQString &key ) = 0; + +private: + TQSqlDriverPluginPrivate *d; +}; + +#endif // QT_NO_COMPONENT +#endif // QT_NO_SQL + +#endif // TQSQLDRIVERPLUGIN_H diff --git a/src/sql/ntqsqleditorfactory.h b/src/sql/ntqsqleditorfactory.h new file mode 100644 index 000000000..f04e3b35a --- /dev/null +++ b/src/sql/ntqsqleditorfactory.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Definition of TQSqlEditorFactory class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLEDITORFACTORY_H +#define TQSQLEDITORFACTORY_H + +#ifndef QT_H +#include "ntqeditorfactory.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL_EDIT_WIDGETS + +class TQSqlField; + +class TQM_EXPORT_SQL TQSqlEditorFactory : public TQEditorFactory +{ +public: + TQSqlEditorFactory ( TQObject * parent = 0, const char * name = 0 ); + ~TQSqlEditorFactory(); + virtual TQWidget * createEditor( TQWidget * parent, const TQVariant & variant ); + virtual TQWidget * createEditor( TQWidget * parent, const TQSqlField * field ); + + static TQSqlEditorFactory * defaultFactory(); + static void installDefaultFactory( TQSqlEditorFactory * factory ); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQSqlEditorFactory( const TQSqlEditorFactory & ); + TQSqlEditorFactory &operator=( const TQSqlEditorFactory & ); +#endif +}; + +#endif // QT_NO_SQL +#endif // TQSQLEDITORFACTORY_H diff --git a/src/sql/ntqsqlerror.h b/src/sql/ntqsqlerror.h new file mode 100644 index 000000000..04beb09df --- /dev/null +++ b/src/sql/ntqsqlerror.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Definition of TQSqlError class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLERROR_H +#define TQSQLERROR_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQM_EXPORT_SQL TQSqlError +{ +public: + enum Type { + None, + Connection, + Statement, + Transaction, + Unknown + }; + TQSqlError( const TQString& driverText = TQString::null, + const TQString& databaseText = TQString::null, + int type = TQSqlError::None, + int number = -1 ); + TQSqlError( const TQSqlError& other ); + TQSqlError& operator=( const TQSqlError& other ); + virtual ~TQSqlError(); + + TQString driverText() const; + virtual void setDriverText( const TQString& driverText ); + TQString databaseText() const; + virtual void setDatabaseText( const TQString& databaseText ); + int type() const; + virtual void setType( int type ); + int number() const; + virtual void setNumber( int number ); + TQString text() const; + void showMessage( const TQString& msg = TQString::null ) const; + +private: + TQString driverError; + TQString databaseError; + int errorType; + int errorNumber; +}; + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqlfield.h b/src/sql/ntqsqlfield.h new file mode 100644 index 000000000..0c33bb67f --- /dev/null +++ b/src/sql/ntqsqlfield.h @@ -0,0 +1,154 @@ +/**************************************************************************** +** +** Definition of TQSqlField class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLFIELD_H +#define TQSQLFIELD_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqvariant.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQSqlFieldPrivate +{ +public: + TQVariant::Type type; +}; + +class TQM_EXPORT_SQL TQSqlField +{ +public: + TQSqlField( const TQString& fieldName = TQString::null, TQVariant::Type type = TQVariant::Invalid ); + TQSqlField( const TQSqlField& other ); + TQSqlField& operator=( const TQSqlField& other ); + bool operator==(const TQSqlField& other) const; + virtual ~TQSqlField(); + + virtual void setValue( const TQVariant& value ); + virtual TQVariant value() const; + virtual void setName( const TQString& name ); + TQString name() const; + virtual void setNull(); + bool isNull() const; + virtual void setReadOnly( bool readOnly ); + bool isReadOnly() const; + void clear( bool nullify = TRUE ); + TQVariant::Type type() const; + +private: + TQString nm; + TQVariant val; + uint ro: 1; + uint nul: 1; + TQSqlFieldPrivate* d; +}; + +inline TQVariant TQSqlField::value() const +{ return val; } + +inline TQString TQSqlField::name() const +{ return nm; } + +inline bool TQSqlField::isNull() const +{ return nul; } + +inline bool TQSqlField::isReadOnly() const +{ return ro; } + +inline TQVariant::Type TQSqlField::type() const +{ return d->type; } + + +/******************************************/ +/******* TQSqlFieldInfo Class ******/ +/******************************************/ + +struct TQSqlFieldInfoPrivate; + +class TQM_EXPORT_SQL TQSqlFieldInfo +{ +public: + TQSqlFieldInfo( const TQString& name = TQString::null, + TQVariant::Type typ = TQVariant::Invalid, + int required = -1, + int len = -1, + int prec = -1, + const TQVariant& defValue = TQVariant(), + int sqlType = 0, + bool generated = TRUE, + bool trim = FALSE, + bool calculated = FALSE ); + TQSqlFieldInfo( const TQSqlFieldInfo & other ); + TQSqlFieldInfo( const TQSqlField & other, bool generated = TRUE ); + virtual ~TQSqlFieldInfo(); + TQSqlFieldInfo& operator=( const TQSqlFieldInfo& other ); + bool operator==( const TQSqlFieldInfo& f ) const; + + 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 trim ); + virtual void setGenerated( bool gen ); + virtual void setCalculated( bool calc ); + +private: + TQSqlFieldInfoPrivate* d; +}; + + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqlform.h b/src/sql/ntqsqlform.h new file mode 100644 index 000000000..f5aefa763 --- /dev/null +++ b/src/sql/ntqsqlform.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Definition of TQSqlForm class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLFORM_H +#define TQSQLFORM_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqmap.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL_FORM + +class TQSqlField; +class TQSqlRecord; +class TQSqlEditorFactory; +class TQSqlPropertyMap; +class TQWidget; +class TQSqlFormPrivate; + +class TQM_EXPORT_SQL TQSqlForm : public TQObject +{ + Q_OBJECT +public: + TQSqlForm( TQObject * parent = 0, const char * name = 0 ); + ~TQSqlForm(); + + virtual void insert( TQWidget * widget, const TQString& field ); + virtual void remove( const TQString& field ); + uint count() const; + + TQWidget * widget( uint i ) const; + TQSqlField * widgetToField( TQWidget * widget ) const; + TQWidget * fieldToWidget( TQSqlField * field ) const; + + void installPropertyMap( TQSqlPropertyMap * map ); + + virtual void setRecord( TQSqlRecord* buf ); + +public slots: + virtual void readField( TQWidget * widget ); + virtual void writeField( TQWidget * widget ); + virtual void readFields(); + virtual void writeFields(); + + virtual void clear(); + virtual void clearValues( bool nullify = FALSE ); + +protected: + virtual void insert( TQWidget * widget, TQSqlField * field ); + virtual void remove( TQWidget * widget ); + void clearMap(); + +private: + virtual void sync(); + TQSqlFormPrivate* d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQSqlForm( const TQSqlForm & ); + TQSqlForm &operator=( const TQSqlForm & ); +#endif +}; + +#endif // QT_NO_SQL +#endif // TQSQLFORM_H diff --git a/src/sql/ntqsqlindex.h b/src/sql/ntqsqlindex.h new file mode 100644 index 000000000..59ca42200 --- /dev/null +++ b/src/sql/ntqsqlindex.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Definition of TQSqlIndex class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLINDEX_H +#define TQSQLINDEX_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqsqlfield.h" +#include "ntqsqlrecord.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#define TQM_TEMPLATE_EXTERN_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#define TQM_TEMPLATE_EXTERN_SQL Q_TEMPLATE_EXTERN +#endif + +#ifndef QT_NO_SQL + +class TQSqlCursor; + +class TQM_EXPORT_SQL TQSqlIndex : public TQSqlRecord +{ +public: + TQSqlIndex( const TQString& cursorName = TQString::null, const TQString& name = TQString::null ); + TQSqlIndex( const TQSqlIndex& other ); + ~TQSqlIndex(); + TQSqlIndex& operator=( const TQSqlIndex& other ); + virtual void setCursorName( const TQString& cursorName ); + TQString cursorName() const { return cursor; } + virtual void setName( const TQString& name ); + TQString name() const { return nm; } + + void append( const TQSqlField& field ); + virtual void append( const TQSqlField& field, bool desc ); + + bool isDescending( int i ) const; + virtual void setDescending( int i, bool desc ); + + TQString toString( const TQString& prefix = TQString::null, + const TQString& sep = ",", + bool verbose = TRUE ) const; + TQStringList toStringList( const TQString& prefix = TQString::null, + bool verbose = TRUE ) const; + + static TQSqlIndex fromStringList( const TQStringList& l, const TQSqlCursor* cursor ); + +private: + TQString createField( int i, const TQString& prefix, bool verbose ) const; + TQString cursor; + TQString nm; + TQValueList sorts; +}; + +#define Q_DEFINED_QSQLINDEX +#include "ntqwinexport.h" +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqlpropertymap.h b/src/sql/ntqsqlpropertymap.h new file mode 100644 index 000000000..57920009b --- /dev/null +++ b/src/sql/ntqsqlpropertymap.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Definition of TQSqlPropertyMap class +** +** Created : 2000-11-20 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLPROPERTYMAP_H +#define TQSQLPROPERTYMAP_H + +#ifndef QT_H +#include "ntqvariant.h" +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_SQL_FORM + +class TQWidget; +class TQSqlPropertyMapPrivate; + +class Q_EXPORT TQSqlPropertyMap { +public: + TQSqlPropertyMap(); + virtual ~TQSqlPropertyMap(); + + TQVariant property( TQWidget * widget ); + virtual void setProperty( TQWidget * widget, const TQVariant & value ); + + void insert( const TQString & classname, const TQString & property ); + void remove( const TQString & classname ); + + static TQSqlPropertyMap * defaultMap(); + static void installDefaultMap( TQSqlPropertyMap * map ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSqlPropertyMap( const TQSqlPropertyMap & ); + TQSqlPropertyMap &operator=( const TQSqlPropertyMap & ); +#endif + TQSqlPropertyMapPrivate* d; + +}; + +#endif // QT_NO_SQL_FORM +#endif // TQSQLPROPERTYMAP_H diff --git a/src/sql/ntqsqlquery.h b/src/sql/ntqsqlquery.h new file mode 100644 index 000000000..502f07f4a --- /dev/null +++ b/src/sql/ntqsqlquery.h @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Definition of TQSqlQuery class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLTQUERY_H +#define TQSQLTQUERY_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqstring.h" +#include "ntqvariant.h" +#include "ntqvaluelist.h" +#include "ntqsqlerror.h" +#include "ntqsqlfield.h" +#include "ntqsql.h" +#endif // QT_H + +#ifndef QT_NO_SQL + +class TQSqlDriver; +class TQSqlResult; +class TQSqlDatabase; + +class Q_EXPORT TQSqlResultShared : public TQObject, public TQShared +{ + Q_OBJECT +public: + TQSqlResultShared( TQSqlResult* result ); + virtual ~TQSqlResultShared(); + TQSqlResult* sqlResult; + TQString executedQuery; +private slots: + void slotResultDestroyed(); +}; + +class Q_EXPORT TQSqlQuery +{ +public: + TQSqlQuery( TQSqlResult * r ); + TQSqlQuery( const TQString& query = TQString::null, TQSqlDatabase* db = 0 ); + Q_EXPLICIT TQSqlQuery( TQSqlDatabase* db ); + TQSqlQuery( const TQSqlQuery& other ); + TQSqlQuery& operator=( const TQSqlQuery& other ); + virtual ~TQSqlQuery(); + + bool isValid() const; + bool isActive() const; + bool isNull( int field ) 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 forward ); + + virtual bool exec ( const TQString& query ); + virtual TQVariant value( int i ) const; + + virtual bool seek( int i, bool relative = FALSE ); + virtual bool next(); + virtual bool prev(); + virtual bool first(); + virtual bool last(); + + // prepared query support + bool exec(); + bool prepare( const TQString& query ); + void bindValue( const TQString& placeholder, const TQVariant& val ); + void bindValue( int pos, const TQVariant& val ); + void addBindValue( const TQVariant& val ); + // remove these overloads in 4.0 + void bindValue( const TQString& placeholder, const TQVariant& val, TQSql::ParameterType type ); + void bindValue( int pos, const TQVariant& val, TQSql::ParameterType type ); + void addBindValue( const TQVariant& val, TQSql::ParameterType type ); + TQVariant boundValue( const TQString& placeholder ) const; + TQVariant boundValue( int pos ) const; + TQMap boundValues() const; + TQString executedQuery() const; + +protected: + virtual void beforeSeek(); + virtual void afterSeek(); + +private: + void init( const TQString& query, TQSqlDatabase* db ); + void deref(); + bool checkDetach(); + TQSqlResultShared* d; +}; + + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqlrecord.h b/src/sql/ntqsqlrecord.h new file mode 100644 index 000000000..7023cf923 --- /dev/null +++ b/src/sql/ntqsqlrecord.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Definition of TQSqlRecord class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLRECORD_H +#define TQSQLRECORD_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqvariant.h" +#include "ntqsqlfield.h" +#endif // QT_H + +#ifndef QT_NO_SQL + +class TQSqlRecordPrivate; + +class TQSqlRecordShared : public TQShared +{ +public: + TQSqlRecordShared( TQSqlRecordPrivate* sqlRecordPrivate ) + : d( sqlRecordPrivate ) + {} + virtual ~TQSqlRecordShared(); + TQSqlRecordPrivate* d; +}; + +class Q_EXPORT TQSqlRecord +{ +public: + TQSqlRecord(); + TQSqlRecord( const TQSqlRecord& other ); + TQSqlRecord& operator=( const TQSqlRecord& other ); + virtual ~TQSqlRecord(); + virtual TQVariant value( int i ) const; + virtual TQVariant value( const TQString& name ) const; + virtual void setValue( int i, const TQVariant& val ); + virtual void setValue( const TQString& name, const TQVariant& val ); + bool isGenerated( int i ) const; + bool isGenerated( const TQString& name ) const; + virtual void setGenerated( const TQString& name, bool generated ); + virtual void setGenerated( int i, bool generated ); + virtual void setNull( int i ); + virtual void setNull( const TQString& name ); + bool isNull( int i ); // remove in 4.0 + bool isNull( const TQString& name ); // remove in 4.0 + bool isNull( int i ) const; + bool isNull( const TQString& name ) const; + + int position( const TQString& name ) const; + TQString fieldName( int i ) const; + TQSqlField* field( int i ); + TQSqlField* field( const TQString& name ); + const TQSqlField* field( int i ) const; + const TQSqlField* field( const TQString& name ) const; + + virtual void append( const TQSqlField& field ); + virtual void insert( int pos, const TQSqlField& field ); + virtual void remove( int pos ); + + bool isEmpty() const; + bool contains( const TQString& name ) const; + virtual void clear(); + virtual void clearValues( bool nullify = FALSE ); + uint count() const; + virtual TQString toString( const TQString& prefix = TQString::null, + const TQString& sep = "," ) const; + virtual TQStringList toStringList( const TQString& prefix = TQString::null ) const; + +private: + TQString createField( int i, const TQString& prefix ) const; + void deref(); + bool checkDetach(); + TQSqlRecordShared* sh; +}; + +/******************************************/ +/******* TQSqlRecordInfo Class ******/ +/******************************************/ + +#if defined(Q_TEMPLATEDLL) +// MOC_SKIP_BEGIN +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +// MOC_SKIP_END +#endif + +typedef TQValueList TQSqlFieldInfoList; + +class Q_EXPORT TQSqlRecordInfo: public TQSqlFieldInfoList +{ +public: + TQSqlRecordInfo(): TQSqlFieldInfoList() {} + TQSqlRecordInfo( const TQSqlFieldInfoList& other ): TQSqlFieldInfoList( other ) {} + TQSqlRecordInfo( const TQSqlRecord& other ); + + size_type contains( const TQString& fieldName ) const; + TQSqlFieldInfo find( const TQString& fieldName ) const; + TQSqlRecord toRecord() const; + +}; + + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqlresult.h b/src/sql/ntqsqlresult.h new file mode 100644 index 000000000..0ad0d05d0 --- /dev/null +++ b/src/sql/ntqsqlresult.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Definition of TQSqlResult class +** +** Created : 2000-11-03 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLRESULT_H +#define TQSQLRESULT_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqvariant.h" +#include "ntqsqlerror.h" +#include "ntqsqlfield.h" +#include "ntqsql.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQSqlDriver; +class TQSql; +class TQSqlResultPrivate; +class TQSqlExtension; + +class TQM_EXPORT_SQL TQSqlResult +{ +friend class TQSqlQuery; +friend class TQSqlResultShared; +public: + virtual ~TQSqlResult(); + + // BCI HACK - remove in 4.0 + void setExtension( TQSqlExtension * ext ); + TQSqlExtension * extension(); + +protected: + TQSqlResult(const TQSqlDriver * db ); + 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 at ); + virtual void setActive( bool a ); + virtual void setLastError( const TQSqlError& e ); + virtual void setQuery( const TQString& query ); + virtual void setSelect( bool s ); + virtual void setForwardOnly( bool forward ); + + virtual TQVariant data( int i ) = 0; + virtual bool isNull( int i ) = 0; + virtual bool reset ( const TQString& sqlquery ) = 0; + virtual bool fetch( int i ) = 0; + virtual bool fetchNext(); + virtual bool fetchPrev(); + virtual bool fetchFirst() = 0; + virtual bool fetchLast() = 0; + virtual int size() = 0; + virtual int numRowsAffected() = 0; +private: + TQSqlResultPrivate* d; + bool forwardOnly; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSqlResult( const TQSqlResult & ); + TQSqlResult &operator=( const TQSqlResult & ); +#endif +}; + +#endif // QT_NO_SQL +#endif diff --git a/src/sql/ntqsqlselectcursor.h b/src/sql/ntqsqlselectcursor.h new file mode 100644 index 000000000..5ad13ec48 --- /dev/null +++ b/src/sql/ntqsqlselectcursor.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Definition of TQSqlSelectCursor class +** +** Created : 2002-11-13 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the sql module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSQLSELECTCURSOR_H +#define TQSQLSELECTCURSOR_H + +#ifndef QT_H +#include "ntqsqlcursor.h" +#endif // QT_H + +#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) +#define TQM_EXPORT_SQL +#else +#define TQM_EXPORT_SQL Q_EXPORT +#endif + +#ifndef QT_NO_SQL + +class TQSqlSelectCursorPrivate; + +class TQM_EXPORT_SQL TQSqlSelectCursor : public TQSqlCursor +{ +public: + TQSqlSelectCursor( const TQString& query = TQString::null, TQSqlDatabase* db = 0 ); + TQSqlSelectCursor( const TQSqlSelectCursor& other ); + ~TQSqlSelectCursor(); + bool exec( const TQString& query ); + bool select() { return TQSqlCursor::select(); } + +protected: + TQSqlIndex primaryIndex( bool = TRUE ) const { return TQSqlIndex(); } + TQSqlIndex index( const TQStringList& ) const { return TQSqlIndex(); } + TQSqlIndex index( const TQString& ) const { return TQSqlIndex(); } + TQSqlIndex index( const char* ) const { return TQSqlIndex(); } + 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 = FALSE ) { return 0; } + TQSqlRecord* primeInsert() { return 0; } + TQSqlRecord* primeUpdate() { return 0; } + TQSqlRecord* primeDelete() { return 0; } + int insert( bool = TRUE ) { return 0; } + int update( bool = TRUE ) { return 0; } + int del( bool = TRUE ) { return 0; } + void setMode( int ) {} + + void setSort( const TQSqlIndex& ) {} + TQSqlIndex sort() const { return TQSqlIndex(); } + void setFilter( const TQString& ) {} + TQString filter() const { return TQString::null; } + void setName( const TQString&, bool = TRUE ) {} + TQString name() const { return TQString::null; } + TQString toString( const TQString& = TQString::null, const TQString& = "," ) const { return TQString::null; } + bool select( const TQString &, const TQSqlIndex& = TQSqlIndex() ); + +private: + void populateCursor(); + + TQSqlSelectCursorPrivate * d; +}; + +#endif // QT_NO_SQL +#endif // TQSQLSELECTCURSOR_H diff --git a/src/sql/qdatabrowser.cpp b/src/sql/qdatabrowser.cpp index c9570deb2..79ac4ab0b 100644 --- a/src/sql/qdatabrowser.cpp +++ b/src/sql/qdatabrowser.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qdatabrowser.h" +#include "ntqdatabrowser.h" #ifndef QT_NO_SQL_VIEW_WIDGETS -#include "qsqlform.h" +#include "ntqsqlform.h" #include "qsqlmanager_p.h" -#include "qsqlresult.h" +#include "ntqsqlresult.h" class TQDataBrowserPrivate { @@ -58,7 +58,7 @@ public: }; /*! - \class TQDataBrowser qdatabrowser.h + \class TQDataBrowser ntqdatabrowser.h \brief The TQDataBrowser class provides data manipulation and navigation for data entry forms. diff --git a/src/sql/qdatabrowser.h b/src/sql/qdatabrowser.h deleted file mode 100644 index 3c991bfcf..000000000 --- a/src/sql/qdatabrowser.h +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDataBrowser class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDATABROWSER_H -#define TQDATABROWSER_H - -#ifndef QT_H -#include "qwidget.h" -#include "qstring.h" -#include "qstringlist.h" -#include "qsql.h" -#include "qsqlindex.h" -#include "qsqlcursor.h" -#include "qsqlerror.h" -#endif // QT_H - -#ifndef QT_NO_SQL_VIEW_WIDGETS - -class TQSqlForm; -class TQDataBrowserPrivate; - -class Q_EXPORT TQDataBrowser : public TQWidget -{ - Q_OBJECT - Q_PROPERTY( bool boundaryChecking READ boundaryChecking WRITE setBoundaryChecking ) - Q_PROPERTY( TQString filter READ filter WRITE setFilter ) - Q_PROPERTY( TQStringList sort READ sort WRITE setSort ) - Q_PROPERTY( bool confirmEdits READ confirmEdits WRITE setConfirmEdits ) - Q_PROPERTY( bool confirmInsert READ confirmInsert WRITE setConfirmInsert ) - Q_PROPERTY( bool confirmUpdate READ confirmUpdate WRITE setConfirmUpdate ) - Q_PROPERTY( bool confirmDelete READ confirmDelete WRITE setConfirmDelete ) - Q_PROPERTY( bool confirmCancels READ confirmCancels WRITE setConfirmCancels ) - Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) - Q_PROPERTY( bool autoEdit READ autoEdit WRITE setAutoEdit ) - -public: - TQDataBrowser( TQWidget* parent=0, const char* name=0, WFlags fl = 0 ); - ~TQDataBrowser(); - - enum Boundary { - Unknown, - None, - BeforeBeginning, - Beginning, - End, - AfterEnd - }; - - Boundary boundary(); - void setBoundaryChecking( bool active ); - bool boundaryChecking() const; - - void setSort( const TQSqlIndex& sort ); - void setSort( const TQStringList& sort ); - TQStringList sort() const; - void setFilter( const TQString& filter ); - TQString filter() const; - virtual void setSqlCursor( TQSqlCursor* cursor, bool autoDelete = FALSE ); - TQSqlCursor* sqlCursor() const; - virtual void setForm( TQSqlForm* form ); - TQSqlForm* form(); - - virtual void setConfirmEdits( bool confirm ); - virtual void setConfirmInsert( bool confirm ); - virtual void setConfirmUpdate( bool confirm ); - virtual void setConfirmDelete( bool confirm ); - virtual void setConfirmCancels( bool confirm ); - bool confirmEdits() const; - bool confirmInsert() const; - bool confirmUpdate() const; - bool confirmDelete() const; - bool confirmCancels() const; - - virtual void setReadOnly( bool active ); - bool isReadOnly() const; - virtual void setAutoEdit( bool autoEdit ); - bool autoEdit() const; - - virtual bool seek( int i, bool relative = FALSE ); - -signals: - void firstRecordAvailable( bool available ); - void lastRecordAvailable( bool available ); - void nextRecordAvailable( bool available ); - void prevRecordAvailable( bool available ); - - void currentChanged( const TQSqlRecord* record ); - void primeInsert( TQSqlRecord* buf ); - void primeUpdate( TQSqlRecord* buf ); - void primeDelete( TQSqlRecord* buf ); - void beforeInsert( TQSqlRecord* buf ); - void beforeUpdate( TQSqlRecord* buf ); - void beforeDelete( TQSqlRecord* buf ); - void cursorChanged( TQSqlCursor::Mode mode ); - -public slots: - virtual void refresh(); - - virtual void insert(); - virtual void update(); - virtual void del(); - - virtual void first(); - virtual void last(); - virtual void next(); - virtual void prev(); - - virtual void readFields(); - virtual void writeFields(); - virtual void clearValues(); - - void updateBoundary(); - -protected: - virtual bool insertCurrent(); - virtual bool updateCurrent(); - virtual bool deleteCurrent(); - virtual bool currentEdited(); - - virtual TQSql::Confirm confirmEdit( TQSql::Op m ); - virtual TQSql::Confirm confirmCancel( TQSql::Op m ); - - virtual void handleError( const TQSqlError& error ); - -private: - typedef bool (TQSqlCursor::*Nav)(); - bool preNav(); - void postNav( bool primeUpd ); - void nav( Nav nav ); - TQDataBrowserPrivate* d; - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDataBrowser( const TQDataBrowser & ); - TQDataBrowser &operator=( const TQDataBrowser & ); -#endif -}; - - -#endif -#endif diff --git a/src/sql/qdatatable.cpp b/src/sql/qdatatable.cpp index bd3708eda..f300c43e5 100644 --- a/src/sql/qdatatable.cpp +++ b/src/sql/qdatatable.cpp @@ -38,22 +38,22 @@ ** **********************************************************************/ -#include "qdatatable.h" +#include "ntqdatatable.h" #ifndef QT_NO_SQL_VIEW_WIDGETS -#include "qsqldriver.h" -#include "qsqleditorfactory.h" -#include "qsqlpropertymap.h" -#include "qapplication.h" -#include "qlayout.h" -#include "qpainter.h" -#include "qpopupmenu.h" -#include "qvaluelist.h" +#include "ntqsqldriver.h" +#include "ntqsqleditorfactory.h" +#include "ntqsqlpropertymap.h" +#include "ntqapplication.h" +#include "ntqlayout.h" +#include "ntqpainter.h" +#include "ntqpopupmenu.h" +#include "ntqvaluelist.h" #include "qsqlmanager_p.h" -#include "qdatetime.h" -#include "qcursor.h" -#include "qtimer.h" +#include "ntqdatetime.h" +#include "ntqcursor.h" +#include "ntqtimer.h" //#define QT_DEBUG_DATATABLE @@ -132,7 +132,7 @@ void qt_debug_buffer( const TQString& msg, TQSqlRecord* cursor ) /*! - \class TQDataTable qdatatable.h + \class TQDataTable ntqdatatable.h \brief The TQDataTable class provides a flexible SQL table widget that supports browsing and editing. \ingroup database diff --git a/src/sql/qdatatable.h b/src/sql/qdatatable.h deleted file mode 100644 index 46d9c7e34..000000000 --- a/src/sql/qdatatable.h +++ /dev/null @@ -1,244 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDataTable class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDATATABLE_H -#define TQDATATABLE_H - -#ifndef QT_H -#include "qstring.h" -#include "qvariant.h" -#include "qtable.h" -#include "qsql.h" -#include "qsqlcursor.h" -#include "qsqlindex.h" -#include "qsqleditorfactory.h" -#include "qiconset.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL_VIEW_WIDGETS - -class TQPainter; -class TQSqlField; -class TQSqlPropertyMap; -class TQDataTablePrivate; - -class TQM_EXPORT_SQL TQDataTable : public TQTable -{ - Q_OBJECT - - Q_PROPERTY( TQString nullText READ nullText WRITE setNullText ) - Q_PROPERTY( TQString trueText READ trueText WRITE setTrueText ) - Q_PROPERTY( TQString falseText READ falseText WRITE setFalseText ) - Q_PROPERTY( DateFormat dateFormat READ dateFormat WRITE setDateFormat ) - Q_PROPERTY( bool confirmEdits READ confirmEdits WRITE setConfirmEdits ) - Q_PROPERTY( bool confirmInsert READ confirmInsert WRITE setConfirmInsert ) - Q_PROPERTY( bool confirmUpdate READ confirmUpdate WRITE setConfirmUpdate ) - Q_PROPERTY( bool confirmDelete READ confirmDelete WRITE setConfirmDelete ) - Q_PROPERTY( bool confirmCancels READ confirmCancels WRITE setConfirmCancels ) - Q_PROPERTY( bool autoEdit READ autoEdit WRITE setAutoEdit ) - Q_PROPERTY( TQString filter READ filter WRITE setFilter ) - Q_PROPERTY( TQStringList sort READ sort WRITE setSort ) - Q_PROPERTY( int numCols READ numCols ) - Q_PROPERTY( int numRows READ numRows ) - -public: - TQDataTable ( TQWidget* parent=0, const char* name=0 ); - TQDataTable ( TQSqlCursor* cursor, bool autoPopulate = FALSE, TQWidget* parent=0, const char* name=0 ); - ~TQDataTable(); - - virtual void addColumn( const TQString& fieldName, - const TQString& label = TQString::null, - int width = -1, - const TQIconSet& iconset = TQIconSet() ); - virtual void removeColumn( uint col ); - virtual void setColumn( uint col, const TQString& fieldName, - const TQString& label = TQString::null, - int width = -1, - const TQIconSet& iconset = 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* cursor = 0, - bool autoPopulate = FALSE, bool autoDelete = FALSE ); - TQSqlCursor* sqlCursor() const; - - virtual void setNullText( const TQString& nullText ); - virtual void setTrueText( const TQString& trueText ); - virtual void setFalseText( const TQString& falseText ); - virtual void setDateFormat( const DateFormat f ); - virtual void setConfirmEdits( bool confirm ); - virtual void setConfirmInsert( bool confirm ); - virtual void setConfirmUpdate( bool confirm ); - virtual void setConfirmDelete( bool confirm ); - virtual void setConfirmCancels( bool confirm ); - virtual void setAutoDelete( bool enable ); - virtual void setAutoEdit( bool autoEdit ); - virtual void setFilter( const TQString& filter ); - virtual void setSort( const TQStringList& sort ); - virtual void setSort( const TQSqlIndex& sort ); - - enum Refresh { - RefreshData = 1, - RefreshColumns = 2, - RefreshAll = 3 - }; - void refresh( Refresh mode ); - void sortColumn ( int col, bool ascending = TRUE, - bool wholeRows = FALSE ); - TQString text ( int row, int col ) const; - TQVariant value ( int row, int col ) const; - TQSqlRecord* currentRecord() const; - - void installEditorFactory( TQSqlEditorFactory * f ); - void installPropertyMap( TQSqlPropertyMap* m ); - - int numCols() const; - int numRows() const; - void setNumCols( int c ); - void setNumRows ( int r ); - bool findBuffer( const TQSqlIndex& idx, int atHint = 0 ); - - void hideColumn( int col ); - void showColumn( int col ); -signals: - void currentChanged( TQSqlRecord* record ); - void primeInsert( TQSqlRecord* buf ); - void primeUpdate( TQSqlRecord* buf ); - void primeDelete( TQSqlRecord* buf ); - void beforeInsert( TQSqlRecord* buf ); - void beforeUpdate( TQSqlRecord* buf ); - void beforeDelete( TQSqlRecord* buf ); - void cursorChanged( TQSql::Op mode ); - -public slots: - virtual void find( const TQString & str, bool caseSensitive, - bool backwards ); - virtual void sortAscending( int col ); - virtual void sortDescending( int col ); - virtual void refresh(); - void setColumnWidth( int col, int w ); - void adjustColumn( int col ); - void setColumnStretchable( int col, bool stretch ); - void swapColumns( int col1, int col2, bool swapHeaders = FALSE ); - -protected: - virtual bool insertCurrent(); - virtual bool updateCurrent(); - virtual bool deleteCurrent(); - - virtual TQSql::Confirm confirmEdit( TQSql::Op m ); - virtual TQSql::Confirm confirmCancel( TQSql::Op m ); - - virtual void handleError( const TQSqlError& e ); - - virtual bool beginInsert(); - virtual TQWidget* beginUpdate ( int row, int col, bool replace ); - - bool eventFilter( TQObject *o, TQEvent *e ); - void keyPressEvent( TQKeyEvent* ); - void resizeEvent ( TQResizeEvent * ); - void contentsMousePressEvent( TQMouseEvent* e ); - void contentsContextMenuEvent( TQContextMenuEvent* e ); - void endEdit( int row, int col, bool accept, bool replace ); - TQWidget * createEditor( int row, int col, bool initFromCell ) const; - void activateNextCell(); - int indexOf( uint i ) const; // ### make this public in 4.0 - void reset(); - void setSize( TQSqlCursor* sql ); - void repaintCell( int row, int col ); - void paintCell ( TQPainter * p, int row, int col, const TQRect & cr, - bool selected, const TQColorGroup &cg ); - virtual void paintField( TQPainter * p, const TQSqlField* field, const TQRect & cr, - bool selected ); - void drawContents( TQPainter * p, int cx, int cy, int cw, int ch ); - virtual int fieldAlignment( const TQSqlField* field ); - void columnClicked ( int col ); - void resizeData ( int len ); - - TQTableItem * item ( int row, int col ) const; - void setItem ( int row, int col, TQTableItem * item ); - void clearCell ( int row, int col ) ; - void setPixmap ( int row, int col, const TQPixmap & pix ); - void takeItem ( TQTableItem * i ); - -private slots: - void loadNextPage(); - void setCurrentSelection( int row, int col ); - void updateCurrentSelection(); - void sliderPressed(); - void sliderReleased(); - void doInsertCurrent(); - void doUpdateCurrent(); - -private: - TQString fieldToString( const TQSqlField * field ); - void init(); - TQWidget* beginEdit ( int row, int col, bool replace ); - void updateRow( int row ); - void endInsert(); - void endUpdate(); - TQDataTablePrivate* d; - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDataTable( const TQDataTable & ); - TQDataTable &operator=( const TQDataTable & ); -#endif -}; - -#endif -#endif diff --git a/src/sql/qdataview.cpp b/src/sql/qdataview.cpp index a689025f0..32d437ba2 100644 --- a/src/sql/qdataview.cpp +++ b/src/sql/qdataview.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qdataview.h" +#include "ntqdataview.h" #ifndef QT_NO_SQL_VIEW_WIDGETS @@ -53,7 +53,7 @@ public: /*! - \class TQDataView qdataview.h + \class TQDataView ntqdataview.h \brief The TQDataView class provides read-only SQL forms. \ingroup database diff --git a/src/sql/qdataview.h b/src/sql/qdataview.h deleted file mode 100644 index 90f488356..000000000 --- a/src/sql/qdataview.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDataView class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDATAVIEW_H -#define TQDATAVIEW_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL_VIEW_WIDGETS - -class TQSqlForm; -class TQSqlRecord; -class TQDataViewPrivate; - -class TQM_EXPORT_SQL TQDataView : public TQWidget -{ - Q_OBJECT - -public: - TQDataView( TQWidget* parent=0, const char* name=0, WFlags fl = 0 ); - ~TQDataView(); - - virtual void setForm( TQSqlForm* form ); - TQSqlForm* form(); - virtual void setRecord( TQSqlRecord* record ); - TQSqlRecord* record(); - -public slots: - virtual void refresh( TQSqlRecord* buf ); - virtual void readFields(); - virtual void writeFields(); - virtual void clearValues(); - -private: - TQDataViewPrivate* d; - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDataView( const TQDataView & ); - TQDataView &operator=( const TQDataView & ); -#endif -}; - - -#endif -#endif diff --git a/src/sql/qeditorfactory.cpp b/src/sql/qeditorfactory.cpp index 6f5fb7f36..660434cf8 100644 --- a/src/sql/qeditorfactory.cpp +++ b/src/sql/qeditorfactory.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qcleanuphandler.h" -#include "qlabel.h" -#include "qlineedit.h" -#include "qspinbox.h" -#include "qcombobox.h" +#include "ntqcleanuphandler.h" +#include "ntqlabel.h" +#include "ntqlineedit.h" +#include "ntqspinbox.h" +#include "ntqcombobox.h" -#include "qeditorfactory.h" -#include "qdatetimeedit.h" +#include "ntqeditorfactory.h" +#include "ntqdatetimeedit.h" #ifndef QT_NO_SQL_EDIT_WIDGETS /*! - \class TQEditorFactory qeditorfactory.h + \class TQEditorFactory ntqeditorfactory.h \brief The TQEditorFactory class is used to create editor widgets for TQVariant data types. diff --git a/src/sql/qeditorfactory.h b/src/sql/qeditorfactory.h deleted file mode 100644 index 2798c5939..000000000 --- a/src/sql/qeditorfactory.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Definition of TQEditorFactory class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQEDITORFACTORY_H -#define TQEDITORFACTORY_H - -#ifndef QT_H -#include "qobject.h" -#include "qvariant.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL_EDIT_WIDGETS - -class TQM_EXPORT_SQL TQEditorFactory : public TQObject -{ -public: - TQEditorFactory ( TQObject * parent = 0, const char * name = 0 ); - ~TQEditorFactory(); - - virtual TQWidget * createEditor( TQWidget * parent, const TQVariant & v ); - - static TQEditorFactory * defaultFactory(); - static void installDefaultFactory( TQEditorFactory * factory); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQEditorFactory( const TQEditorFactory & ); - TQEditorFactory &operator=( const TQEditorFactory & ); -#endif -}; - -#endif // QT_NO_SQL -#endif // TQEDITORFACTORY_H diff --git a/src/sql/qsql.cpp b/src/sql/qsql.cpp index 42d59c004..74ea4bd4c 100644 --- a/src/sql/qsql.cpp +++ b/src/sql/qsql.cpp @@ -40,7 +40,7 @@ /*! - \class TQSql qsql.h + \class TQSql ntqsql.h \brief The TQSql class is a namespace for TQt SQL identifiers that need to be global-like. diff --git a/src/sql/qsql.h b/src/sql/qsql.h deleted file mode 100644 index b4fddae1a..000000000 --- a/src/sql/qsql.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSql class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQL_H -#define TQSQL_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQM_EXPORT_SQL TQSql -{ -public: - TQSql() {} - enum Op { - None = -1, - Insert = 0, - Update = 1, - Delete = 2 - }; - - enum Location { - BeforeFirst = -1, - AfterLast = -2 - }; - - enum Confirm { - Cancel = -1, - No = 0, - Yes = 1 - }; - - enum ParameterType { - In = 1, - Out = 2, - InOut = 3 //InOut = In | Out - }; - - enum TableType { - Tables = 0x01, - SystemTables = 0x02, - Views = 0x04, - AllTables = 0xff - }; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSql( const TQSql & ); - TQSql &operator=( const TQSql & ); -#endif - -}; - -#endif -#endif diff --git a/src/sql/qsqlcursor.cpp b/src/sql/qsqlcursor.cpp index e5949951b..3ddd2c9e0 100644 --- a/src/sql/qsqlcursor.cpp +++ b/src/sql/qsqlcursor.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qsqlcursor.h" +#include "ntqsqlcursor.h" #ifndef QT_NO_SQL -#include "qsqldriver.h" -#include "qsqlresult.h" -#include "qdatetime.h" -#include "qsqldatabase.h" -#include "qsql.h" +#include "ntqsqldriver.h" +#include "ntqsqlresult.h" +#include "ntqdatetime.h" +#include "ntqsqldatabase.h" +#include "ntqsql.h" class TQSqlCursorPrivate { @@ -124,7 +124,7 @@ TQString qWhereClause( TQSqlRecord* rec, const TQString& prefix, const TQString& } /*! - \class TQSqlCursor qsqlcursor.h + \class TQSqlCursor ntqsqlcursor.h \brief The TQSqlCursor class provides browsing and editing of SQL tables and views. diff --git a/src/sql/qsqlcursor.h b/src/sql/qsqlcursor.h deleted file mode 100644 index 8670ef6f8..000000000 --- a/src/sql/qsqlcursor.h +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlCursor class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLCURSOR_H -#define TQSQLCURSOR_H - -#ifndef QT_H -#include "qsqlrecord.h" -#include "qstringlist.h" -#include "qsqlquery.h" -#include "qsqlindex.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQSqlDatabase; -class TQSqlCursorPrivate; - -class TQM_EXPORT_SQL TQSqlCursor : public TQSqlRecord, public TQSqlQuery -{ -public: - TQSqlCursor( const TQString & name = TQString::null, bool autopopulate = TRUE, TQSqlDatabase* db = 0 ); - TQSqlCursor( const TQSqlCursor & other ); - TQSqlCursor& operator=( const TQSqlCursor& other ); - ~TQSqlCursor(); - - enum Mode { - ReadOnly = 0, - Insert = 1, - Update = 2, - Delete = 4, - Writable = 7 - }; - - TQVariant value( int i ) const; - TQVariant value( const TQString& name ) const; - void setValue( int i, const TQVariant& val ); - void setValue( const TQString& name, const TQVariant& val ); - virtual TQSqlIndex primaryIndex( bool prime = TRUE ) const; - virtual TQSqlIndex index( const TQStringList& fieldNames ) const; - TQSqlIndex index( const TQString& fieldName ) const; - TQSqlIndex index( const char* fieldName ) const; - virtual void setPrimaryIndex( const TQSqlIndex& idx ); - - virtual void append( const TQSqlFieldInfo& fieldInfo ); - virtual void insert( int pos, const TQSqlFieldInfo& fieldInfo ); - void remove( int pos ); - void clear(); - void setGenerated( const TQString& name, bool generated ); - void setGenerated( int i, bool generated ); - - virtual TQSqlRecord* editBuffer( bool copy = FALSE ); - virtual TQSqlRecord* primeInsert(); - virtual TQSqlRecord* primeUpdate(); - virtual TQSqlRecord* primeDelete(); - virtual int insert( bool invalidate = TRUE ); - virtual int update( bool invalidate = TRUE ); - virtual int del( bool invalidate = TRUE ); - - virtual void setMode( int flags ); - int mode() const; - virtual void setCalculated( const TQString& name, bool calculated ); - bool isCalculated( const TQString& name ) const; - virtual void setTrimmed( const TQString& name, bool trim ); - bool isTrimmed( const TQString& name ) const; - - bool isReadOnly() const; - bool canInsert() const; - bool canUpdate() const; - bool canDelete() const; - - bool select(); - bool select( const TQSqlIndex& sort ); - bool select( const TQSqlIndex & filter, const TQSqlIndex & sort ); - virtual bool select( const TQString & filter, const TQSqlIndex & sort = TQSqlIndex() ); - - virtual void setSort( const TQSqlIndex& sort ); - TQSqlIndex sort() const; - virtual void setFilter( const TQString& filter ); - TQString filter() const; - virtual void setName( const TQString& name, bool autopopulate = TRUE ); - TQString name() const; - TQString toString( const TQString& prefix = TQString::null, - const TQString& sep = "," ) const; - bool isNull( int i ) const; - bool isNull( const TQString& name ) const; - -protected: - void afterSeek(); - bool exec( const TQString & sql ); - - virtual TQVariant calculateField( const TQString& name ); - virtual int update( const TQString & filter, bool invalidate = TRUE ); - virtual int del( const TQString & filter, bool invalidate = TRUE ); - - virtual TQString toString( const TQString& prefix, TQSqlField* field, const TQString& fieldSep ) const; - virtual TQString toString( TQSqlRecord* rec, const TQString& prefix, const TQString& fieldSep, - const TQString& sep ) const; - virtual TQString toString( const TQSqlIndex& i, TQSqlRecord* rec, const TQString& prefix, - const TQString& fieldSep, const TQString& sep ) const; - -private: - void sync(); - int apply( const TQString& q, bool invalidate ); - int applyPrepared( const TQString& q, bool invalidate ); - TQSqlRecord& operator=( const TQSqlRecord & list ); - void append( const TQSqlField& field ); - void insert( int pos, const TQSqlField& field ); - - TQSqlCursorPrivate* d; -}; - - - - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqldatabase.cpp b/src/sql/qsqldatabase.cpp index 6d01cf419..ebe65d1ba 100644 --- a/src/sql/qsqldatabase.cpp +++ b/src/sql/qsqldatabase.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qsqldatabase.h" +#include "ntqsqldatabase.h" #ifndef QT_NO_SQL @@ -72,16 +72,16 @@ #include "drivers/ibase/qsql_ibase.h" #endif -#include "qapplication.h" -#include "qsqlresult.h" -#include "qsqldriver.h" +#include "ntqapplication.h" +#include "ntqsqlresult.h" +#include "ntqsqldriver.h" #include "qsqldriverinterface_p.h" #include #include -#include "qobject.h" -#include "qguardedptr.h" -#include "qcleanuphandler.h" -#include "qdict.h" +#include "ntqobject.h" +#include "ntqguardedptr.h" +#include "ntqcleanuphandler.h" +#include "ntqdict.h" #include QT_STATIC_CONST_IMPL char * const TQSqlDatabase::defaultConnection = "qt_sql_default_connection"; @@ -356,7 +356,7 @@ public: }; /*! - \class TQSqlDatabase qsqldatabase.h + \class TQSqlDatabase ntqsqldatabase.h \brief The TQSqlDatabase class is used to create SQL database connections and to provide transaction handling. diff --git a/src/sql/qsqldatabase.h b/src/sql/qsqldatabase.h deleted file mode 100644 index 2fd6d4917..000000000 --- a/src/sql/qsqldatabase.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlDatabase class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLDATABASE_H -#define TQSQLDATABASE_H - -#ifndef QT_H -#include "qobject.h" -#include "qstring.h" -#include "qsqlquery.h" -#include "qstringlist.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQSqlError; -class TQSqlDriver; -class TQSqlIndex; -class TQSqlRecord; -class TQSqlRecordInfo; -class TQSqlDatabasePrivate; - -class TQM_EXPORT_SQL TQSqlDriverCreatorBase -{ -public: - virtual TQSqlDriver* createObject() = 0; -}; - -template -class TQM_EXPORT_SQL TQSqlDriverCreator: public TQSqlDriverCreatorBase -{ -public: - TQSqlDriver* createObject() { return new type; } -}; - -class TQM_EXPORT_SQL TQSqlDatabase : public TQObject -{ - Q_OBJECT - Q_PROPERTY( TQString databaseName READ databaseName WRITE setDatabaseName ) - Q_PROPERTY( TQString userName READ userName WRITE setUserName ) - Q_PROPERTY( TQString password READ password WRITE setPassword ) - Q_PROPERTY( TQString hostName READ hostName WRITE setHostName ) - Q_PROPERTY( int port READ port WRITE setPort ) - Q_PROPERTY( TQString connectOptions READ connectOptions WRITE setConnectOptions ) - -public: - ~TQSqlDatabase(); - - bool open(); - bool open( const TQString& user, const TQString& password ); - void close(); - bool isOpen() const; - bool isOpenError() const; - TQStringList tables() const; - TQStringList tables( TQSql::TableType type ) const; - TQSqlIndex primaryIndex( const TQString& tablename ) const; - TQSqlRecord record( const TQString& tablename ) const; - TQSqlRecord record( const TQSqlQuery& query ) const; - TQSqlRecordInfo recordInfo( const TQString& tablename ) const; - TQSqlRecordInfo recordInfo( const TQSqlQuery& query ) const; - TQSqlQuery exec( const TQString& query = TQString::null ) const; - TQSqlError lastError() const; - - bool transaction(); - bool commit(); - bool rollback(); - - virtual void setDatabaseName( const TQString& name ); - virtual void setUserName( const TQString& name ); - virtual void setPassword( const TQString& password ); - virtual void setHostName( const TQString& host ); - virtual void setPort( int p ); - void setConnectOptions( const TQString& options = 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; - - // MOC_SKIP_BEGIN - QT_STATIC_CONST char * const defaultConnection; - // MOC_SKIP_END - - static TQSqlDatabase* addDatabase( const TQString& type, const TQString& connectionName = defaultConnection ); - static TQSqlDatabase* addDatabase( TQSqlDriver* driver, const TQString& connectionName = defaultConnection ); - static TQSqlDatabase* database( const TQString& connectionName = defaultConnection, bool open = TRUE ); - static void removeDatabase( const TQString& connectionName ); - static void removeDatabase( TQSqlDatabase* db ); - static bool contains( const TQString& connectionName = defaultConnection ); - static TQStringList drivers(); - static void registerSqlDriver( const TQString& name, const TQSqlDriverCreatorBase* creator ); // ### 4.0: creator should not be const - static bool isDriverAvailable( const TQString& name ); - -protected: - TQSqlDatabase( const TQString& type, const TQString& name, TQObject * parent=0, const char * objname=0 ); - TQSqlDatabase( TQSqlDriver* driver, TQObject * parent=0, const char * objname=0 ); -private: - void init( const TQString& type, const TQString& name ); - TQSqlDatabasePrivate* d; -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQSqlDatabase( const TQSqlDatabase & ); - TQSqlDatabase &operator=( const TQSqlDatabase & ); -#endif - -}; - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqldriver.cpp b/src/sql/qsqldriver.cpp index 6ecbdca88..3bce7ee43 100644 --- a/src/sql/qsqldriver.cpp +++ b/src/sql/qsqldriver.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qsqldriver.h" +#include "ntqsqldriver.h" #ifndef QT_NO_SQL -#include "qdatetime.h" +#include "ntqdatetime.h" #include "qsqlextension_p.h" // database states @@ -54,7 +54,7 @@ TQPtrDict *qSqlDriverExtDict(); TQPtrDict *qSqlOpenExtDict(); /*! - \class TQSqlDriver qsqldriver.h + \class TQSqlDriver ntqsqldriver.h \brief The TQSqlDriver class is an abstract base class for accessing SQL databases. diff --git a/src/sql/qsqldriver.h b/src/sql/qsqldriver.h deleted file mode 100644 index b312d3a0d..000000000 --- a/src/sql/qsqldriver.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlDriver class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLDRIVER_H -#define TQSQLDRIVER_H - -#ifndef QT_H -#include "qobject.h" -#include "qptrdict.h" -#include "qstring.h" -#include "qsqlerror.h" -#include "qsqlquery.h" -#include "qsqlfield.h" -#include "qsqlindex.h" -#include "qstringlist.h" -#include "qmap.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQSqlDriverExtension; - -class TQSqlDatabase; - -class TQM_EXPORT_SQL TQSqlDriver : public TQObject -{ - friend class TQSqlDatabase; - Q_OBJECT -public: - enum DriverFeature { Transactions, QuerySize, BLOB, Unicode, PreparedQueries, - NamedPlaceholders, PositionalPlaceholders }; - - TQSqlDriver( TQObject * parent=0, const char * name=0 ); - ~TQSqlDriver(); - bool isOpen() const; - bool isOpenError() const; - - virtual bool beginTransaction(); - virtual bool commitTransaction(); - virtual bool rollbackTransaction(); - virtual TQStringList tables( const TQString& tableType ) const; - virtual TQSqlIndex primaryIndex( const TQString& tableName ) const; - virtual TQSqlRecord record( const TQString& tableName ) const; - virtual TQSqlRecord record( const TQSqlQuery& query ) const; - virtual TQSqlRecordInfo recordInfo( const TQString& tablename ) const; - virtual TQSqlRecordInfo recordInfo( const TQSqlQuery& query ) const; - virtual TQString nullText() const; - virtual TQString formatValue( const TQSqlField* field, bool trimStrings = FALSE ) const; - TQSqlError lastError() const; - - virtual bool hasFeature( DriverFeature f ) const = 0; - virtual bool open( const TQString & db, - const TQString & user = TQString::null, - const TQString & password = TQString::null, - const TQString & host = TQString::null, - int port = -1 ) = 0; - virtual void close() = 0; - virtual TQSqlQuery createQuery() const = 0; - - // ### remove for 4.0 - bool open( const TQString& db, - const TQString& user, - const TQString& password, - const TQString& host, - int port, - const TQString& connOpts ); -protected: - virtual void setOpen( bool o ); - virtual void setOpenError( bool e ); - virtual void setLastError( const TQSqlError& e ); -private: - // ### This class needs a d-pointer in 4.0. - int dbState; - TQSqlError error; -#if defined(Q_DISABLE_COPY) - TQSqlDriver( const TQSqlDriver & ); - TQSqlDriver &operator=( const TQSqlDriver & ); -#endif -}; - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqldriverplugin.cpp b/src/sql/qsqldriverplugin.cpp index fe294ba09..74487f5be 100644 --- a/src/sql/qsqldriverplugin.cpp +++ b/src/sql/qsqldriverplugin.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qsqldriverplugin.h" +#include "ntqsqldriverplugin.h" #ifndef QT_NO_SQL #ifndef QT_NO_COMPONENT @@ -46,7 +46,7 @@ #include "qsqldriverinterface_p.h" /*! - \class TQSqlDriverPlugin qsqldriverplugin.h + \class TQSqlDriverPlugin ntqsqldriverplugin.h \brief The TQSqlDriverPlugin class provides an abstract base for custom TQSqlDriver plugins. \ingroup plugins diff --git a/src/sql/qsqldriverplugin.h b/src/sql/qsqldriverplugin.h deleted file mode 100644 index 54c05b692..000000000 --- a/src/sql/qsqldriverplugin.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlDriverPlugin class -** -** Created : 2001-09-20 -** -** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLDRIVERPLUGIN_H -#define TQSQLDRIVERPLUGIN_H - -#ifndef QT_H -#include "qgplugin.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_SQL -#ifndef QT_NO_COMPONENT - -class TQSqlDriver; -class TQSqlDriverPluginPrivate; - -class Q_EXPORT TQSqlDriverPlugin : public TQGPlugin -{ - Q_OBJECT -public: - TQSqlDriverPlugin(); - ~TQSqlDriverPlugin(); - - virtual TQStringList keys() const = 0; - virtual TQSqlDriver *create( const TQString &key ) = 0; - -private: - TQSqlDriverPluginPrivate *d; -}; - -#endif // QT_NO_COMPONENT -#endif // QT_NO_SQL - -#endif // TQSQLDRIVERPLUGIN_H diff --git a/src/sql/qsqleditorfactory.cpp b/src/sql/qsqleditorfactory.cpp index 55a6d5a7e..c962e4ce8 100644 --- a/src/sql/qsqleditorfactory.cpp +++ b/src/sql/qsqleditorfactory.cpp @@ -38,20 +38,20 @@ ** **********************************************************************/ -#include "qsqleditorfactory.h" +#include "ntqsqleditorfactory.h" #ifndef QT_NO_SQL_EDIT_WIDGETS -#include "qsqlfield.h" -#include "qcleanuphandler.h" -#include "qlabel.h" -#include "qlineedit.h" -#include "qspinbox.h" -#include "qcombobox.h" -#include "qdatetimeedit.h" +#include "ntqsqlfield.h" +#include "ntqcleanuphandler.h" +#include "ntqlabel.h" +#include "ntqlineedit.h" +#include "ntqspinbox.h" +#include "ntqcombobox.h" +#include "ntqdatetimeedit.h" /*! - \class TQSqlEditorFactory qsqleditorfactory.h + \class TQSqlEditorFactory ntqsqleditorfactory.h \brief The TQSqlEditorFactory class is used to create the editors used by TQDataTable and TQSqlForm. diff --git a/src/sql/qsqleditorfactory.h b/src/sql/qsqleditorfactory.h deleted file mode 100644 index 48757d480..000000000 --- a/src/sql/qsqleditorfactory.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlEditorFactory class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLEDITORFACTORY_H -#define TQSQLEDITORFACTORY_H - -#ifndef QT_H -#include "qeditorfactory.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL_EDIT_WIDGETS - -class TQSqlField; - -class TQM_EXPORT_SQL TQSqlEditorFactory : public TQEditorFactory -{ -public: - TQSqlEditorFactory ( TQObject * parent = 0, const char * name = 0 ); - ~TQSqlEditorFactory(); - virtual TQWidget * createEditor( TQWidget * parent, const TQVariant & variant ); - virtual TQWidget * createEditor( TQWidget * parent, const TQSqlField * field ); - - static TQSqlEditorFactory * defaultFactory(); - static void installDefaultFactory( TQSqlEditorFactory * factory ); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQSqlEditorFactory( const TQSqlEditorFactory & ); - TQSqlEditorFactory &operator=( const TQSqlEditorFactory & ); -#endif -}; - -#endif // QT_NO_SQL -#endif // TQSQLEDITORFACTORY_H diff --git a/src/sql/qsqlerror.cpp b/src/sql/qsqlerror.cpp index 1d3d1e7df..c837aecfc 100644 --- a/src/sql/qsqlerror.cpp +++ b/src/sql/qsqlerror.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qsqlerror.h" -#include +#include "ntqsqlerror.h" +#include #ifndef QT_NO_SQL /*! - \class TQSqlError qsqlerror.h + \class TQSqlError ntqsqlerror.h \brief The TQSqlError class provides SQL database error information. \ingroup database diff --git a/src/sql/qsqlerror.h b/src/sql/qsqlerror.h deleted file mode 100644 index 7eb29f027..000000000 --- a/src/sql/qsqlerror.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlError class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLERROR_H -#define TQSQLERROR_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQM_EXPORT_SQL TQSqlError -{ -public: - enum Type { - None, - Connection, - Statement, - Transaction, - Unknown - }; - TQSqlError( const TQString& driverText = TQString::null, - const TQString& databaseText = TQString::null, - int type = TQSqlError::None, - int number = -1 ); - TQSqlError( const TQSqlError& other ); - TQSqlError& operator=( const TQSqlError& other ); - virtual ~TQSqlError(); - - TQString driverText() const; - virtual void setDriverText( const TQString& driverText ); - TQString databaseText() const; - virtual void setDatabaseText( const TQString& databaseText ); - int type() const; - virtual void setType( int type ); - int number() const; - virtual void setNumber( int number ); - TQString text() const; - void showMessage( const TQString& msg = TQString::null ) const; - -private: - TQString driverError; - TQString databaseError; - int errorType; - int errorNumber; -}; - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqlextension_p.h b/src/sql/qsqlextension_p.h index cd189d926..7e4237c6e 100644 --- a/src/sql/qsqlextension_p.h +++ b/src/sql/qsqlextension_p.h @@ -54,11 +54,11 @@ // #ifndef QT_H -#include "qmap.h" -#include "qvaluevector.h" -#include "qstring.h" -#include "qvariant.h" -#include "qsql.h" +#include "ntqmap.h" +#include "ntqvaluevector.h" +#include "ntqstring.h" +#include "ntqvariant.h" +#include "ntqsql.h" #endif // QT_H #ifndef QT_NO_SQL @@ -87,7 +87,7 @@ struct Holder { }; #define Q_DEFINED_QSQLEXTENSION -#include "qwinexport.h" +#include "ntqwinexport.h" class TQM_EXPORT_SQL TQSqlExtension { public: diff --git a/src/sql/qsqlfield.cpp b/src/sql/qsqlfield.cpp index 95c798676..ca7edc3d5 100644 --- a/src/sql/qsqlfield.cpp +++ b/src/sql/qsqlfield.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qsqlfield.h" +#include "ntqsqlfield.h" #ifndef QT_NO_SQL /*! - \class TQSqlField qsqlfield.h + \class TQSqlField ntqsqlfield.h \brief The TQSqlField class manipulates the fields in SQL database tables and views. @@ -306,7 +306,7 @@ struct TQSqlFieldInfoPrivate }; /*! - \class TQSqlFieldInfo qsqlfield.h + \class TQSqlFieldInfo ntqsqlfield.h \brief The TQSqlFieldInfo class stores meta data associated with a SQL field. \ingroup database diff --git a/src/sql/qsqlfield.h b/src/sql/qsqlfield.h deleted file mode 100644 index b81717c7a..000000000 --- a/src/sql/qsqlfield.h +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlField class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLFIELD_H -#define TQSQLFIELD_H - -#ifndef QT_H -#include "qstring.h" -#include "qvariant.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQSqlFieldPrivate -{ -public: - TQVariant::Type type; -}; - -class TQM_EXPORT_SQL TQSqlField -{ -public: - TQSqlField( const TQString& fieldName = TQString::null, TQVariant::Type type = TQVariant::Invalid ); - TQSqlField( const TQSqlField& other ); - TQSqlField& operator=( const TQSqlField& other ); - bool operator==(const TQSqlField& other) const; - virtual ~TQSqlField(); - - virtual void setValue( const TQVariant& value ); - virtual TQVariant value() const; - virtual void setName( const TQString& name ); - TQString name() const; - virtual void setNull(); - bool isNull() const; - virtual void setReadOnly( bool readOnly ); - bool isReadOnly() const; - void clear( bool nullify = TRUE ); - TQVariant::Type type() const; - -private: - TQString nm; - TQVariant val; - uint ro: 1; - uint nul: 1; - TQSqlFieldPrivate* d; -}; - -inline TQVariant TQSqlField::value() const -{ return val; } - -inline TQString TQSqlField::name() const -{ return nm; } - -inline bool TQSqlField::isNull() const -{ return nul; } - -inline bool TQSqlField::isReadOnly() const -{ return ro; } - -inline TQVariant::Type TQSqlField::type() const -{ return d->type; } - - -/******************************************/ -/******* TQSqlFieldInfo Class ******/ -/******************************************/ - -struct TQSqlFieldInfoPrivate; - -class TQM_EXPORT_SQL TQSqlFieldInfo -{ -public: - TQSqlFieldInfo( const TQString& name = TQString::null, - TQVariant::Type typ = TQVariant::Invalid, - int required = -1, - int len = -1, - int prec = -1, - const TQVariant& defValue = TQVariant(), - int sqlType = 0, - bool generated = TRUE, - bool trim = FALSE, - bool calculated = FALSE ); - TQSqlFieldInfo( const TQSqlFieldInfo & other ); - TQSqlFieldInfo( const TQSqlField & other, bool generated = TRUE ); - virtual ~TQSqlFieldInfo(); - TQSqlFieldInfo& operator=( const TQSqlFieldInfo& other ); - bool operator==( const TQSqlFieldInfo& f ) const; - - 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 trim ); - virtual void setGenerated( bool gen ); - virtual void setCalculated( bool calc ); - -private: - TQSqlFieldInfoPrivate* d; -}; - - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqlform.cpp b/src/sql/qsqlform.cpp index 07d0ef4e3..a03a53d63 100644 --- a/src/sql/qsqlform.cpp +++ b/src/sql/qsqlform.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qsqlform.h" +#include "ntqsqlform.h" #ifndef QT_NO_SQL_FORM -#include "qsqlfield.h" -#include "qsqlpropertymap.h" -#include "qsqlrecord.h" -#include "qstringlist.h" -#include "qwidget.h" -#include "qdict.h" +#include "ntqsqlfield.h" +#include "ntqsqlpropertymap.h" +#include "ntqsqlrecord.h" +#include "ntqstringlist.h" +#include "ntqwidget.h" +#include "ntqdict.h" class TQSqlFormPrivate { diff --git a/src/sql/qsqlform.h b/src/sql/qsqlform.h deleted file mode 100644 index 7ca157c0f..000000000 --- a/src/sql/qsqlform.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlForm class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLFORM_H -#define TQSQLFORM_H - -#ifndef QT_H -#include "qobject.h" -#include "qmap.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL_FORM - -class TQSqlField; -class TQSqlRecord; -class TQSqlEditorFactory; -class TQSqlPropertyMap; -class TQWidget; -class TQSqlFormPrivate; - -class TQM_EXPORT_SQL TQSqlForm : public TQObject -{ - Q_OBJECT -public: - TQSqlForm( TQObject * parent = 0, const char * name = 0 ); - ~TQSqlForm(); - - virtual void insert( TQWidget * widget, const TQString& field ); - virtual void remove( const TQString& field ); - uint count() const; - - TQWidget * widget( uint i ) const; - TQSqlField * widgetToField( TQWidget * widget ) const; - TQWidget * fieldToWidget( TQSqlField * field ) const; - - void installPropertyMap( TQSqlPropertyMap * map ); - - virtual void setRecord( TQSqlRecord* buf ); - -public slots: - virtual void readField( TQWidget * widget ); - virtual void writeField( TQWidget * widget ); - virtual void readFields(); - virtual void writeFields(); - - virtual void clear(); - virtual void clearValues( bool nullify = FALSE ); - -protected: - virtual void insert( TQWidget * widget, TQSqlField * field ); - virtual void remove( TQWidget * widget ); - void clearMap(); - -private: - virtual void sync(); - TQSqlFormPrivate* d; - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQSqlForm( const TQSqlForm & ); - TQSqlForm &operator=( const TQSqlForm & ); -#endif -}; - -#endif // QT_NO_SQL -#endif // TQSQLFORM_H diff --git a/src/sql/qsqlindex.cpp b/src/sql/qsqlindex.cpp index 06f17eca8..d0df39788 100644 --- a/src/sql/qsqlindex.cpp +++ b/src/sql/qsqlindex.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qsqlindex.h" +#include "ntqsqlindex.h" #ifndef QT_NO_SQL -#include "qsqlcursor.h" +#include "ntqsqlcursor.h" /*! - \class TQSqlIndex qsqlindex.h + \class TQSqlIndex ntqsqlindex.h \brief The TQSqlIndex class provides functions to manipulate and describe TQSqlCursor and TQSqlDatabase indexes. diff --git a/src/sql/qsqlindex.h b/src/sql/qsqlindex.h deleted file mode 100644 index 61df18aa3..000000000 --- a/src/sql/qsqlindex.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlIndex class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLINDEX_H -#define TQSQLINDEX_H - -#ifndef QT_H -#include "qstring.h" -#include "qstringlist.h" -#include "qsqlfield.h" -#include "qsqlrecord.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#define TQM_TEMPLATE_EXTERN_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#define TQM_TEMPLATE_EXTERN_SQL Q_TEMPLATE_EXTERN -#endif - -#ifndef QT_NO_SQL - -class TQSqlCursor; - -class TQM_EXPORT_SQL TQSqlIndex : public TQSqlRecord -{ -public: - TQSqlIndex( const TQString& cursorName = TQString::null, const TQString& name = TQString::null ); - TQSqlIndex( const TQSqlIndex& other ); - ~TQSqlIndex(); - TQSqlIndex& operator=( const TQSqlIndex& other ); - virtual void setCursorName( const TQString& cursorName ); - TQString cursorName() const { return cursor; } - virtual void setName( const TQString& name ); - TQString name() const { return nm; } - - void append( const TQSqlField& field ); - virtual void append( const TQSqlField& field, bool desc ); - - bool isDescending( int i ) const; - virtual void setDescending( int i, bool desc ); - - TQString toString( const TQString& prefix = TQString::null, - const TQString& sep = ",", - bool verbose = TRUE ) const; - TQStringList toStringList( const TQString& prefix = TQString::null, - bool verbose = TRUE ) const; - - static TQSqlIndex fromStringList( const TQStringList& l, const TQSqlCursor* cursor ); - -private: - TQString createField( int i, const TQString& prefix, bool verbose ) const; - TQString cursor; - TQString nm; - TQValueList sorts; -}; - -#define Q_DEFINED_QSQLINDEX -#include "qwinexport.h" -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqlmanager_p.cpp b/src/sql/qsqlmanager_p.cpp index 1ca0d5f30..0ed88cf8c 100644 --- a/src/sql/qsqlmanager_p.cpp +++ b/src/sql/qsqlmanager_p.cpp @@ -42,14 +42,14 @@ #ifndef QT_NO_SQL -#include "qapplication.h" -#include "qwidget.h" -#include "qsqlcursor.h" -#include "qsqlform.h" -#include "qsqldriver.h" -#include "qstring.h" -#include "qmessagebox.h" -#include "qbitarray.h" +#include "ntqapplication.h" +#include "ntqwidget.h" +#include "ntqsqlcursor.h" +#include "ntqsqlform.h" +#include "ntqsqldriver.h" +#include "ntqstring.h" +#include "ntqmessagebox.h" +#include "ntqbitarray.h" //#define QT_DEBUG_DATAMANAGER diff --git a/src/sql/qsqlmanager_p.h b/src/sql/qsqlmanager_p.h index fd442ead6..b36b4d1ed 100644 --- a/src/sql/qsqlmanager_p.h +++ b/src/sql/qsqlmanager_p.h @@ -54,13 +54,13 @@ // #ifndef QT_H -#include "qglobal.h" -#include "qstring.h" -#include "qstringlist.h" -#include "qsql.h" -#include "qsqlerror.h" -#include "qsqlindex.h" -#include "qsqlcursor.h" +#include "ntqglobal.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqsql.h" +#include "ntqsqlerror.h" +#include "ntqsqlindex.h" +#include "ntqsqlcursor.h" #endif // QT_H #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) diff --git a/src/sql/qsqlpropertymap.cpp b/src/sql/qsqlpropertymap.cpp index 98f3fd159..9d619a016 100644 --- a/src/sql/qsqlpropertymap.cpp +++ b/src/sql/qsqlpropertymap.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qsqlpropertymap.h" +#include "ntqsqlpropertymap.h" #ifndef QT_NO_SQL_FORM -#include "qwidget.h" -#include "qcleanuphandler.h" -#include "qmetaobject.h" -#include "qmap.h" +#include "ntqwidget.h" +#include "ntqcleanuphandler.h" +#include "ntqmetaobject.h" +#include "ntqmap.h" class TQSqlPropertyMapPrivate { @@ -55,7 +55,7 @@ public: }; /*! - \class TQSqlPropertyMap qsqlpropertymap.h + \class TQSqlPropertyMap ntqsqlpropertymap.h \brief The TQSqlPropertyMap class is used to map widgets to SQL fields. \ingroup database diff --git a/src/sql/qsqlpropertymap.h b/src/sql/qsqlpropertymap.h deleted file mode 100644 index 2054b134a..000000000 --- a/src/sql/qsqlpropertymap.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlPropertyMap class -** -** Created : 2000-11-20 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLPROPERTYMAP_H -#define TQSQLPROPERTYMAP_H - -#ifndef QT_H -#include "qvariant.h" -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_SQL_FORM - -class TQWidget; -class TQSqlPropertyMapPrivate; - -class Q_EXPORT TQSqlPropertyMap { -public: - TQSqlPropertyMap(); - virtual ~TQSqlPropertyMap(); - - TQVariant property( TQWidget * widget ); - virtual void setProperty( TQWidget * widget, const TQVariant & value ); - - void insert( const TQString & classname, const TQString & property ); - void remove( const TQString & classname ); - - static TQSqlPropertyMap * defaultMap(); - static void installDefaultMap( TQSqlPropertyMap * map ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSqlPropertyMap( const TQSqlPropertyMap & ); - TQSqlPropertyMap &operator=( const TQSqlPropertyMap & ); -#endif - TQSqlPropertyMapPrivate* d; - -}; - -#endif // QT_NO_SQL_FORM -#endif // TQSQLPROPERTYMAP_H diff --git a/src/sql/qsqlquery.cpp b/src/sql/qsqlquery.cpp index 98b481811..94325d507 100644 --- a/src/sql/qsqlquery.cpp +++ b/src/sql/qsqlquery.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qsqlquery.h" +#include "ntqsqlquery.h" #ifndef QT_NO_SQL //#define QT_DEBUG_SQL -#include "qsqlresult.h" -#include "qsqldriver.h" -#include "qsqldatabase.h" -#include "qsql.h" -#include "qregexp.h" +#include "ntqsqlresult.h" +#include "ntqsqldriver.h" +#include "ntqsqldatabase.h" +#include "ntqsql.h" +#include "ntqregexp.h" #include "private/qsqlextension_p.h" @@ -81,7 +81,7 @@ void TQSqlResultShared::slotResultDestroyed() } /*! - \class TQSqlQuery qsqlquery.h + \class TQSqlQuery ntqsqlquery.h \brief The TQSqlQuery class provides a means of executing and manipulating SQL statements. diff --git a/src/sql/qsqlquery.h b/src/sql/qsqlquery.h deleted file mode 100644 index 8ea2462e4..000000000 --- a/src/sql/qsqlquery.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlQuery class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLTQUERY_H -#define TQSQLTQUERY_H - -#ifndef QT_H -#include "qobject.h" -#include "qstring.h" -#include "qvariant.h" -#include "qvaluelist.h" -#include "qsqlerror.h" -#include "qsqlfield.h" -#include "qsql.h" -#endif // QT_H - -#ifndef QT_NO_SQL - -class TQSqlDriver; -class TQSqlResult; -class TQSqlDatabase; - -class Q_EXPORT TQSqlResultShared : public TQObject, public TQShared -{ - Q_OBJECT -public: - TQSqlResultShared( TQSqlResult* result ); - virtual ~TQSqlResultShared(); - TQSqlResult* sqlResult; - TQString executedQuery; -private slots: - void slotResultDestroyed(); -}; - -class Q_EXPORT TQSqlQuery -{ -public: - TQSqlQuery( TQSqlResult * r ); - TQSqlQuery( const TQString& query = TQString::null, TQSqlDatabase* db = 0 ); - Q_EXPLICIT TQSqlQuery( TQSqlDatabase* db ); - TQSqlQuery( const TQSqlQuery& other ); - TQSqlQuery& operator=( const TQSqlQuery& other ); - virtual ~TQSqlQuery(); - - bool isValid() const; - bool isActive() const; - bool isNull( int field ) 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 forward ); - - virtual bool exec ( const TQString& query ); - virtual TQVariant value( int i ) const; - - virtual bool seek( int i, bool relative = FALSE ); - virtual bool next(); - virtual bool prev(); - virtual bool first(); - virtual bool last(); - - // prepared query support - bool exec(); - bool prepare( const TQString& query ); - void bindValue( const TQString& placeholder, const TQVariant& val ); - void bindValue( int pos, const TQVariant& val ); - void addBindValue( const TQVariant& val ); - // remove these overloads in 4.0 - void bindValue( const TQString& placeholder, const TQVariant& val, TQSql::ParameterType type ); - void bindValue( int pos, const TQVariant& val, TQSql::ParameterType type ); - void addBindValue( const TQVariant& val, TQSql::ParameterType type ); - TQVariant boundValue( const TQString& placeholder ) const; - TQVariant boundValue( int pos ) const; - TQMap boundValues() const; - TQString executedQuery() const; - -protected: - virtual void beforeSeek(); - virtual void afterSeek(); - -private: - void init( const TQString& query, TQSqlDatabase* db ); - void deref(); - bool checkDetach(); - TQSqlResultShared* d; -}; - - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqlrecord.cpp b/src/sql/qsqlrecord.cpp index f8489b0e0..998ba0a71 100644 --- a/src/sql/qsqlrecord.cpp +++ b/src/sql/qsqlrecord.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qsqlrecord.h" +#include "ntqsqlrecord.h" #ifndef QT_NO_SQL -#include "qregexp.h" -#include "qvaluevector.h" -#include "qshared.h" -#include "qnamespace.h" +#include "ntqregexp.h" +#include "ntqvaluevector.h" +#include "ntqshared.h" +#include "ntqnamespace.h" class TQSqlRecordPrivate { @@ -153,7 +153,7 @@ TQSqlRecordShared::~TQSqlRecordShared() } /*! - \class TQSqlRecord qsqlfield.h + \class TQSqlRecord ntqsqlfield.h \brief The TQSqlRecord class encapsulates a database record, i.e. a set of database fields. @@ -688,7 +688,7 @@ void TQSqlRecord::setValue( const TQString& name, const TQVariant& val ) /******************************************/ /*! - \class TQSqlRecordInfo qsqlrecord.h + \class TQSqlRecordInfo ntqsqlrecord.h \brief The TQSqlRecordInfo class encapsulates a set of database field meta data. \ingroup database diff --git a/src/sql/qsqlrecord.h b/src/sql/qsqlrecord.h deleted file mode 100644 index 405961df9..000000000 --- a/src/sql/qsqlrecord.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlRecord class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLRECORD_H -#define TQSQLRECORD_H - -#ifndef QT_H -#include "qstring.h" -#include "qstringlist.h" -#include "qvariant.h" -#include "qsqlfield.h" -#endif // QT_H - -#ifndef QT_NO_SQL - -class TQSqlRecordPrivate; - -class TQSqlRecordShared : public TQShared -{ -public: - TQSqlRecordShared( TQSqlRecordPrivate* sqlRecordPrivate ) - : d( sqlRecordPrivate ) - {} - virtual ~TQSqlRecordShared(); - TQSqlRecordPrivate* d; -}; - -class Q_EXPORT TQSqlRecord -{ -public: - TQSqlRecord(); - TQSqlRecord( const TQSqlRecord& other ); - TQSqlRecord& operator=( const TQSqlRecord& other ); - virtual ~TQSqlRecord(); - virtual TQVariant value( int i ) const; - virtual TQVariant value( const TQString& name ) const; - virtual void setValue( int i, const TQVariant& val ); - virtual void setValue( const TQString& name, const TQVariant& val ); - bool isGenerated( int i ) const; - bool isGenerated( const TQString& name ) const; - virtual void setGenerated( const TQString& name, bool generated ); - virtual void setGenerated( int i, bool generated ); - virtual void setNull( int i ); - virtual void setNull( const TQString& name ); - bool isNull( int i ); // remove in 4.0 - bool isNull( const TQString& name ); // remove in 4.0 - bool isNull( int i ) const; - bool isNull( const TQString& name ) const; - - int position( const TQString& name ) const; - TQString fieldName( int i ) const; - TQSqlField* field( int i ); - TQSqlField* field( const TQString& name ); - const TQSqlField* field( int i ) const; - const TQSqlField* field( const TQString& name ) const; - - virtual void append( const TQSqlField& field ); - virtual void insert( int pos, const TQSqlField& field ); - virtual void remove( int pos ); - - bool isEmpty() const; - bool contains( const TQString& name ) const; - virtual void clear(); - virtual void clearValues( bool nullify = FALSE ); - uint count() const; - virtual TQString toString( const TQString& prefix = TQString::null, - const TQString& sep = "," ) const; - virtual TQStringList toStringList( const TQString& prefix = TQString::null ) const; - -private: - TQString createField( int i, const TQString& prefix ) const; - void deref(); - bool checkDetach(); - TQSqlRecordShared* sh; -}; - -/******************************************/ -/******* TQSqlRecordInfo Class ******/ -/******************************************/ - -#if defined(Q_TEMPLATEDLL) -// MOC_SKIP_BEGIN -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -// MOC_SKIP_END -#endif - -typedef TQValueList TQSqlFieldInfoList; - -class Q_EXPORT TQSqlRecordInfo: public TQSqlFieldInfoList -{ -public: - TQSqlRecordInfo(): TQSqlFieldInfoList() {} - TQSqlRecordInfo( const TQSqlFieldInfoList& other ): TQSqlFieldInfoList( other ) {} - TQSqlRecordInfo( const TQSqlRecord& other ); - - size_type contains( const TQString& fieldName ) const; - TQSqlFieldInfo find( const TQString& fieldName ) const; - TQSqlRecord toRecord() const; - -}; - - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqlresult.cpp b/src/sql/qsqlresult.cpp index d0550f329..5afd6a08d 100644 --- a/src/sql/qsqlresult.cpp +++ b/src/sql/qsqlresult.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qsqlresult.h" +#include "ntqsqlresult.h" #include "private/qsqlextension_p.h" #ifndef QT_NO_SQL diff --git a/src/sql/qsqlresult.h b/src/sql/qsqlresult.h deleted file mode 100644 index 5b72b7f94..000000000 --- a/src/sql/qsqlresult.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlResult class -** -** Created : 2000-11-03 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLRESULT_H -#define TQSQLRESULT_H - -#ifndef QT_H -#include "qstring.h" -#include "qvariant.h" -#include "qsqlerror.h" -#include "qsqlfield.h" -#include "qsql.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQSqlDriver; -class TQSql; -class TQSqlResultPrivate; -class TQSqlExtension; - -class TQM_EXPORT_SQL TQSqlResult -{ -friend class TQSqlQuery; -friend class TQSqlResultShared; -public: - virtual ~TQSqlResult(); - - // BCI HACK - remove in 4.0 - void setExtension( TQSqlExtension * ext ); - TQSqlExtension * extension(); - -protected: - TQSqlResult(const TQSqlDriver * db ); - 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 at ); - virtual void setActive( bool a ); - virtual void setLastError( const TQSqlError& e ); - virtual void setQuery( const TQString& query ); - virtual void setSelect( bool s ); - virtual void setForwardOnly( bool forward ); - - virtual TQVariant data( int i ) = 0; - virtual bool isNull( int i ) = 0; - virtual bool reset ( const TQString& sqlquery ) = 0; - virtual bool fetch( int i ) = 0; - virtual bool fetchNext(); - virtual bool fetchPrev(); - virtual bool fetchFirst() = 0; - virtual bool fetchLast() = 0; - virtual int size() = 0; - virtual int numRowsAffected() = 0; -private: - TQSqlResultPrivate* d; - bool forwardOnly; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSqlResult( const TQSqlResult & ); - TQSqlResult &operator=( const TQSqlResult & ); -#endif -}; - -#endif // QT_NO_SQL -#endif diff --git a/src/sql/qsqlselectcursor.cpp b/src/sql/qsqlselectcursor.cpp index f14d2d378..6919ae994 100644 --- a/src/sql/qsqlselectcursor.cpp +++ b/src/sql/qsqlselectcursor.cpp @@ -38,8 +38,8 @@ ** **********************************************************************/ -#include "qsqlselectcursor.h" -#include "qsqldriver.h" +#include "ntqsqlselectcursor.h" +#include "ntqsqldriver.h" #ifndef QT_NO_SQL @@ -52,7 +52,7 @@ public: }; /*! - \class TQSqlSelectCursor qsqlselectcursor.h + \class TQSqlSelectCursor ntqsqlselectcursor.h \brief The TQSqlSelectCursor class provides browsing of general SQL SELECT statements. diff --git a/src/sql/qsqlselectcursor.h b/src/sql/qsqlselectcursor.h deleted file mode 100644 index 91d5c4d6a..000000000 --- a/src/sql/qsqlselectcursor.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSqlSelectCursor class -** -** Created : 2002-11-13 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the sql module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSQLSELECTCURSOR_H -#define TQSQLSELECTCURSOR_H - -#ifndef QT_H -#include "qsqlcursor.h" -#endif // QT_H - -#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) -#define TQM_EXPORT_SQL -#else -#define TQM_EXPORT_SQL Q_EXPORT -#endif - -#ifndef QT_NO_SQL - -class TQSqlSelectCursorPrivate; - -class TQM_EXPORT_SQL TQSqlSelectCursor : public TQSqlCursor -{ -public: - TQSqlSelectCursor( const TQString& query = TQString::null, TQSqlDatabase* db = 0 ); - TQSqlSelectCursor( const TQSqlSelectCursor& other ); - ~TQSqlSelectCursor(); - bool exec( const TQString& query ); - bool select() { return TQSqlCursor::select(); } - -protected: - TQSqlIndex primaryIndex( bool = TRUE ) const { return TQSqlIndex(); } - TQSqlIndex index( const TQStringList& ) const { return TQSqlIndex(); } - TQSqlIndex index( const TQString& ) const { return TQSqlIndex(); } - TQSqlIndex index( const char* ) const { return TQSqlIndex(); } - 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 = FALSE ) { return 0; } - TQSqlRecord* primeInsert() { return 0; } - TQSqlRecord* primeUpdate() { return 0; } - TQSqlRecord* primeDelete() { return 0; } - int insert( bool = TRUE ) { return 0; } - int update( bool = TRUE ) { return 0; } - int del( bool = TRUE ) { return 0; } - void setMode( int ) {} - - void setSort( const TQSqlIndex& ) {} - TQSqlIndex sort() const { return TQSqlIndex(); } - void setFilter( const TQString& ) {} - TQString filter() const { return TQString::null; } - void setName( const TQString&, bool = TRUE ) {} - TQString name() const { return TQString::null; } - TQString toString( const TQString& = TQString::null, const TQString& = "," ) const { return TQString::null; } - bool select( const TQString &, const TQSqlIndex& = TQSqlIndex() ); - -private: - void populateCursor(); - - TQSqlSelectCursorPrivate * d; -}; - -#endif // QT_NO_SQL -#endif // TQSQLSELECTCURSOR_H diff --git a/src/sql/qt_sql.pri b/src/sql/qt_sql.pri index 5533c6fbe..6856b5730 100644 --- a/src/sql/qt_sql.pri +++ b/src/sql/qt_sql.pri @@ -8,28 +8,28 @@ sql { } SQL_P = sql - HEADERS += $$SQL_H/qsql.h \ - $$SQL_H/qsqlquery.h \ - $$SQL_H/qsqldatabase.h \ - $$SQL_H/qsqlfield.h \ - $$SQL_H/qsqlrecord.h \ - $$SQL_H/qsqlcursor.h \ - $$SQL_H/qsqlform.h \ - $$SQL_H/qeditorfactory.h \ - $$SQL_H/qsqleditorfactory.h \ - $$SQL_H/qsqldriver.h \ + HEADERS += $$SQL_H/ntqsql.h \ + $$SQL_H/ntqsqlquery.h \ + $$SQL_H/ntqsqldatabase.h \ + $$SQL_H/ntqsqlfield.h \ + $$SQL_H/ntqsqlrecord.h \ + $$SQL_H/ntqsqlcursor.h \ + $$SQL_H/ntqsqlform.h \ + $$SQL_H/ntqeditorfactory.h \ + $$SQL_H/ntqsqleditorfactory.h \ + $$SQL_H/ntqsqldriver.h \ $$SQL_P/qsqldriverinterface_p.h \ $$SQL_P/qsqlextension_p.h \ - $$SQL_H/qsqldriverplugin.h \ - $$SQL_H/qsqlerror.h \ - $$SQL_H/qsqlresult.h \ - $$SQL_H/qsqlindex.h \ - $$SQL_H/qsqlpropertymap.h \ + $$SQL_H/ntqsqldriverplugin.h \ + $$SQL_H/ntqsqlerror.h \ + $$SQL_H/ntqsqlresult.h \ + $$SQL_H/ntqsqlindex.h \ + $$SQL_H/ntqsqlpropertymap.h \ $$SQL_P/qsqlmanager_p.h \ - $$SQL_H/qdatatable.h \ - $$SQL_H/qdataview.h \ - $$SQL_H/qdatabrowser.h \ - $$SQL_H/qsqlselectcursor.h + $$SQL_H/ntqdatatable.h \ + $$SQL_H/ntqdataview.h \ + $$SQL_H/ntqdatabrowser.h \ + $$SQL_H/ntqsqlselectcursor.h SOURCES += $$SQL_CPP/qsqlquery.cpp \ $$SQL_CPP/qsqldatabase.cpp \ diff --git a/src/styles/ntqcdestyle.h b/src/styles/ntqcdestyle.h new file mode 100644 index 000000000..f82236e1f --- /dev/null +++ b/src/styles/ntqcdestyle.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Definition of the CDE-like style class +** +** Created : 990513 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + + +#ifndef TQCDESTYLE_H +#define TQCDESTYLE_H + +#ifndef QT_H +#include "ntqmotifstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_CDE) || defined(QT_PLUGIN) + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_CDE +#else +#define Q_EXPORT_STYLE_CDE Q_EXPORT +#endif + +class Q_EXPORT_STYLE_CDE TQCDEStyle : public TQMotifStyle +{ + Q_OBJECT +public: + + TQCDEStyle( bool useHighlightCols = FALSE ); + virtual ~TQCDEStyle(); + + int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + +}; + +#endif // QT_NO_STYLE_CDE + +#endif // TQCDESTYLE_H diff --git a/src/styles/ntqcommonstyle.h b/src/styles/ntqcommonstyle.h new file mode 100644 index 000000000..573121765 --- /dev/null +++ b/src/styles/ntqcommonstyle.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Definition of TQCommonStyle class +** +** Created : 980616 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCOMMONSTYLE_H +#define TQCOMMONSTYLE_H + +#ifndef QT_H +#include "ntqstyle.h" +#endif // QT_H + +#ifndef QT_NO_STYLE + +class Q_EXPORT TQCommonStyle: public TQStyle +{ + Q_OBJECT + +public: + TQCommonStyle(); + ~TQCommonStyle(); + + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControlMask( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect subRect( SubRect r, const TQWidget *widget ) const; + + void drawComplexControl( ComplexControl control, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, +#ifdef Q_QDOC + SCFlags sub = SC_All, +#else + SCFlags sub = (uint)SC_All, +#endif + SCFlags subActive = SC_None, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawComplexControlMask( ComplexControl control, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget *widget, + SubControl sc, + const TQStyleOption& = TQStyleOption::Default ) const; + + SubControl querySubControl( ComplexControl control, + const TQWidget *widget, + const TQPoint &pos, + const TQStyleOption& = TQStyleOption::Default ) const; + + int pixelMetric( PixelMetric m, const TQWidget *widget = 0 ) const; + + TQSize sizeFromContents( ContentsType s, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption& = TQStyleOption::Default ) const; + + int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption &, TQStyleHintReturn *) const; + + TQPixmap stylePixmap( StylePixmap sp, + const TQWidget *widget = 0, + const TQStyleOption& = TQStyleOption::Default ) const; + + +private: + // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQCommonStyle( const TQCommonStyle & ); + TQCommonStyle &operator=( const TQCommonStyle & ); +#endif +}; + + + +#endif // QT_NO_STYLE + +#endif // TQCOMMONSTYLE_H diff --git a/src/styles/ntqcompactstyle.h b/src/styles/ntqcompactstyle.h new file mode 100644 index 000000000..60e298a8e --- /dev/null +++ b/src/styles/ntqcompactstyle.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Definition of compact style class, good for small displays +** +** Created : 000623 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCOMPACTSTYLE_H +#define TQCOMPACTSTYLE_H + +#ifndef QT_H +#include "ntqwindowsstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_COMPACT) || defined(QT_PLUGIN) + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_COMPACT +#else +#define Q_EXPORT_STYLE_COMPACT Q_EXPORT +#endif + +class Q_EXPORT_STYLE_COMPACT TQCompactStyle : public TQWindowsStyle +{ +public: + TQCompactStyle(); + + int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ); + + void drawControl( ControlElement element, TQPainter *p, const TQWidget *w, const TQRect &r, + const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQCompactStyle( const TQCompactStyle & ); + TQCompactStyle& operator=( const TQCompactStyle & ); +#endif +}; + +#endif // QT_NO_STYLE_WINDOWS + +#endif // TQCOMPACTSTYLE_H diff --git a/src/styles/ntqinterlacestyle.h b/src/styles/ntqinterlacestyle.h new file mode 100644 index 000000000..7c00675d9 --- /dev/null +++ b/src/styles/ntqinterlacestyle.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Implementation of TQInterlaceStyle widget class +** +** Created : 010122 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#if 0 // ###### not ported to new API yet +#ifndef TQINTERLACESTYLE_H +#define TQINTERLACESTYLE_H + +#ifndef QT_H +#include "ntqmotifstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_INTERLACE) || defined(QT_PLUGIN) + +#include "ntqpalette.h" + +class Q_EXPORT TQInterlaceStyle : public TQMotifStyle +{ +public: + TQInterlaceStyle(); + void polish( TQApplication*); + void unPolish( TQApplication*); + void polish( TQWidget* ); + void unPolish( TQWidget* ); + + int defaultFrameWidth() const; + TQRect pushButtonContentsRect( TQPushButton *btn ); + + void drawFocusRect ( TQPainter *, const TQRect &, const TQColorGroup &, const TQColor * bg = 0, bool = FALSE ); + void drawButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken = FALSE, + const TQBrush *fill = 0 ); + void drawButtonMask ( TQPainter * p, int x, int y, int w, int h ); + void drawBevelButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken = FALSE, + const TQBrush *fill = 0 ); + + void drawPushButton( TQPushButton* btn, TQPainter *p); + TQSize indicatorSize () const; + void drawIndicator ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE ); + void drawIndicatorMask( TQPainter *p, int x, int y, int w, int h, int ); + TQSize exclusiveIndicatorSize () const; + void drawExclusiveIndicator( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE ); + void drawExclusiveIndicatorMask( TQPainter * p, int x, int y, int w, int h, bool ); + TQRect comboButtonRect ( int x, int y, int w, int h ); + void drawComboButton( TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, bool sunken, bool editable, bool enabled, const TQBrush *fb ); + void drawPushButtonLabel( TQPushButton* btn, TQPainter *p); + void drawPanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken, + int lineWidth, const TQBrush *fill ); + + void scrollBarMetrics( const TQScrollBar* sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim ); + void drawScrollBarControls( TQPainter* p, const TQScrollBar* sb, int sliderStart, uint controls, uint activeControl ); + void drawSlider( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, Orientation, bool tickAbove, bool tickBelow ); + void drawSliderGroove( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, TQCOORD c, Orientation ); + int splitterWidth() const; + void drawSplitter( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, Orientation orient); + + int buttonDefaultIndicatorWidth() const; + int setSliderThickness() const; + TQSize scrollBarExtent() const; + +private: + TQPalette oldPalette; +}; + +#endif // QT_NO_STYLE_INTERLACE + +#endif +#endif diff --git a/src/styles/ntqmotifplusstyle.h b/src/styles/ntqmotifplusstyle.h new file mode 100644 index 000000000..1034d0857 --- /dev/null +++ b/src/styles/ntqmotifplusstyle.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Definition of TQMotifPlusStyle class +** +** Created : 000727 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMOTIFPLUSSTYLE_H +#define TQMOTIFPLUSSTYLE_H + + +#ifndef QT_H +#include "ntqmotifstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_MOTIFPLUS) || defined(QT_PLUGIN) + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_MOTIFPLUS +#else +#define Q_EXPORT_STYLE_MOTIFPLUS Q_EXPORT +#endif + +class Q_EXPORT_STYLE_MOTIFPLUS TQMotifPlusStyle : public TQMotifStyle +{ + Q_OBJECT + +public: + TQMotifPlusStyle(bool hoveringHighlight = TRUE); + virtual ~TQMotifPlusStyle(); + + void polish(TQPalette &pal); + void polish(TQWidget *widget); + void unPolish(TQWidget*widget); + + void polish(TQApplication *app); + void unPolish(TQApplication *app); + + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect subRect(SubRect r, const TQWidget *widget) const; + + void drawComplexControl(ComplexControl control, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, +#ifdef Q_QDOC + SCFlags controls = SC_All, +#else + SCFlags controls = (uint)SC_All, +#endif + SCFlags active = SC_None, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect querySubControlMetrics(ComplexControl control, + const TQWidget *widget, + SubControl subcontrol, + const TQStyleOption& = TQStyleOption::Default) const; + + int pixelMetric(PixelMetric metric, const TQWidget *widget = 0) const; + + int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption & = TQStyleOption::Default, + TQStyleHintReturn* = 0) const; + +protected: + bool eventFilter(TQObject *, TQEvent *); + + +private: + bool useHoveringHighlight; +}; + + +#endif // QT_NO_STYLE_MOTIFPLUS + +#endif // TQMOTIFPLUSSTYLE_H diff --git a/src/styles/ntqmotifstyle.h b/src/styles/ntqmotifstyle.h new file mode 100644 index 000000000..443886601 --- /dev/null +++ b/src/styles/ntqmotifstyle.h @@ -0,0 +1,136 @@ +/**************************************************************************** +** +** Definition of Motif-like style class +** +** Created : 981231 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMOTIFSTYLE_H +#define TQMOTIFSTYLE_H + +#ifndef QT_H +#include "ntqcommonstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_MOTIF) || defined(QT_PLUGIN) + +class TQPalette; + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_MOTIF +#else +#define Q_EXPORT_STYLE_MOTIF Q_EXPORT +#endif + + +class Q_EXPORT_STYLE_MOTIF TQMotifStyle : public TQCommonStyle +{ + Q_OBJECT +public: + TQMotifStyle( bool useHighlightCols=FALSE ); + virtual ~TQMotifStyle(); + + void setUseHighlightColors( bool ); + bool useHighlightColors() const; + + void polish( TQPalette& ); + void polish( TQWidget* ); + void polish( TQApplication* ); + + void polishPopupMenu( TQPopupMenu* ); + + // new style API + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawComplexControl( ComplexControl control, + TQPainter *p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, + SFlags how = Style_Default, +#ifdef Q_QDOC + SCFlags sub = SC_All, +#else + SCFlags sub = (uint)SC_All, +#endif + SCFlags subActive = SC_None, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget *widget, + SubControl sc, + const TQStyleOption& = TQStyleOption::Default ) const; + + int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; + + TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect subRect( SubRect r, const TQWidget *widget ) const; + + TQPixmap stylePixmap(StylePixmap, const TQWidget * = 0, const TQStyleOption& = TQStyleOption::Default) const; + + int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption & = TQStyleOption::Default, + TQStyleHintReturn* = 0) const; + +private: + bool highlightCols; + + // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMotifStyle( const TQMotifStyle & ); + TQMotifStyle& operator=( const TQMotifStyle & ); +#endif +}; + +#endif // QT_NO_STYLE_MOTIF + +#endif // TQMOTIFSTYLE_H diff --git a/src/styles/ntqplatinumstyle.h b/src/styles/ntqplatinumstyle.h new file mode 100644 index 000000000..994cf0516 --- /dev/null +++ b/src/styles/ntqplatinumstyle.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Definition of Platinum-like style class +** +** Created : 981231 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPLATINUMSTYLE_H +#define TQPLATINUMSTYLE_H + +#ifndef QT_H +#include "ntqwindowsstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_PLATINUM) || defined(QT_PLUGIN) + +class TQPalette; + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_PLATINUM +#else +#define Q_EXPORT_STYLE_PLATINUM Q_EXPORT +#endif + +class Q_EXPORT_STYLE_PLATINUM TQPlatinumStyle : public TQWindowsStyle +{ + Q_OBJECT +public: + TQPlatinumStyle(); + virtual ~TQPlatinumStyle(); + + // new Style Stuff + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawComplexControl( ComplexControl control, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, +#ifdef Q_QDOC + SCFlags sub = SC_All, +#else + SCFlags sub = (uint)SC_All, +#endif + SCFlags subActive = SC_None, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget *widget, + SubControl sc, + const TQStyleOption& = TQStyleOption::Default ) const; + + int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; + + TQRect subRect( SubRect r, const TQWidget *widget ) const; + +protected: + TQColor mixedColor(const TQColor &, const TQColor &) const; + void drawRiffles( TQPainter* p, int x, int y, int w, int h, + const TQColorGroup &g, bool horizontal ) const; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPlatinumStyle( const TQPlatinumStyle & ); + TQPlatinumStyle& operator=( const TQPlatinumStyle & ); +#endif +}; + +#endif // QT_NO_STYLE_PLATINUM + +#endif // TQPLATINUMSTYLE_H diff --git a/src/styles/ntqsgistyle.h b/src/styles/ntqsgistyle.h new file mode 100644 index 000000000..16d3a8ba0 --- /dev/null +++ b/src/styles/ntqsgistyle.h @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Definition of SGI-like style class +** +** Created : 981231 +** +** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSGISTYLE_H +#define TQSGISTYLE_H + +#ifndef QT_H +#include "ntqmotifstyle.h" +#include "ntqguardedptr.h" +#include "ntqwidget.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_SGI) || defined(QT_PLUGIN) + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_SGI +#else +#define Q_EXPORT_STYLE_SGI Q_EXPORT +#endif + +class TQSGIStylePrivate; + +class Q_EXPORT_STYLE_SGI TQSGIStyle: public TQMotifStyle +{ + Q_OBJECT +public: + TQSGIStyle( bool useHighlightCols = FALSE ); + virtual ~TQSGIStyle(); + +#if !defined(Q_NO_USING_KEYWORD) + using TQMotifStyle::polish; +#endif + void polish( TQWidget* ); + void unPolish( TQWidget* ); + void polish( TQApplication* ); + void unPolish( TQApplication* ); + + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawComplexControl( ComplexControl control, + TQPainter *p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, + SFlags how = Style_Default, +#ifdef Q_QDOC + SCFlags sub = SC_All, +#else + SCFlags sub = (uint)SC_All, +#endif + SCFlags subActive = SC_None, + const TQStyleOption& = TQStyleOption::Default ) const; + + int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; + + TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect subRect( SubRect r, const TQWidget *widget ) const; + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget *widget, + SubControl sc, + const TQStyleOption& = TQStyleOption::Default ) const; + +protected: + bool eventFilter( TQObject*, TQEvent*); + +private: + TQSGIStylePrivate *d; + + uint isApplicationStyle :1; +#if defined(Q_DISABLE_COPY) + TQSGIStyle( const TQSGIStyle & ); + TQSGIStyle& operator=( const TQSGIStyle & ); +#endif + +}; + +#endif // QT_NO_STYLE_SGI + +#endif // TQSGISTYLE_H diff --git a/src/styles/ntqstylefactory.h b/src/styles/ntqstylefactory.h new file mode 100644 index 000000000..d011fe999 --- /dev/null +++ b/src/styles/ntqstylefactory.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** ... +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTYLEFACTORY_H +#define TQSTYLEFACTORY_H + +#ifndef QT_H +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_STYLE + +class TQString; +class TQStyle; + +class Q_EXPORT TQStyleFactory +{ +public: +#ifndef QT_NO_STRINGLIST + static TQStringList keys(); +#endif + static TQStyle *create( const TQString& ); +}; + +#endif //QT_NO_STYLE + +#endif //TQSTYLEFACTORY_H diff --git a/src/styles/ntqstyleplugin.h b/src/styles/ntqstyleplugin.h new file mode 100644 index 000000000..d527be7ef --- /dev/null +++ b/src/styles/ntqstyleplugin.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Definition of TQStylePlugin class +** +** Created : 010920 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTYLEPLUGIN_H +#define TQSTYLEPLUGIN_H + +#ifndef QT_H +#include "ntqgplugin.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_STYLE +#ifndef QT_NO_COMPONENT + +class TQStyle; +class TQStylePluginPrivate; + +class Q_EXPORT TQStylePlugin : public TQGPlugin +{ + Q_OBJECT +public: + TQStylePlugin(); + ~TQStylePlugin(); + + virtual TQStringList keys() const = 0; + virtual TQStyle *create( const TQString &key ) = 0; + +private: + TQStylePluginPrivate *d; +}; + +#endif // QT_NO_COMPONENT +#endif // QT_NO_STYLE + +#endif // TQSTYLEPLUGIN_H diff --git a/src/styles/ntqwindowsstyle.h b/src/styles/ntqwindowsstyle.h new file mode 100644 index 000000000..0bfec6199 --- /dev/null +++ b/src/styles/ntqwindowsstyle.h @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Definition of Windows-like style class +** +** Created : 981231 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWINDOWSSTYLE_H +#define TQWINDOWSSTYLE_H + +#ifndef QT_H +#include "ntqcommonstyle.h" +#endif // QT_H + +#if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) + +#if defined(QT_PLUGIN) +#define Q_EXPORT_STYLE_WINDOWS +#else +#define Q_EXPORT_STYLE_WINDOWS Q_EXPORT +#endif + + +class Q_EXPORT_STYLE_WINDOWS TQWindowsStyle : public TQCommonStyle +{ + Q_OBJECT +public: + TQWindowsStyle(); + ~TQWindowsStyle(); + + void polish(TQApplication*); + void unPolish(TQApplication*); + + void polish(TQWidget*); + void unPolish(TQWidget*); + + void polish( TQPalette & ); + + virtual void polishPopupMenu( TQPopupMenu* ); + + // new stuff + void drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const; + + void drawComplexControl( ComplexControl control, + TQPainter* p, + const TQWidget* widget, + const TQRect& r, + const TQColorGroup& cg, + SFlags flags = Style_Default, +#ifdef Q_QDOC + SCFlags sub = SC_All, +#else + SCFlags sub = (uint)SC_All, +#endif + SCFlags subActive = SC_None, + const TQStyleOption& = TQStyleOption::Default ) const; + + int pixelMetric( PixelMetric metric, + const TQWidget *widget = 0 ) const; + + TQSize sizeFromContents( ContentsType contents, + const TQWidget *widget, + const TQSize &contentsSize, + const TQStyleOption& = TQStyleOption::Default ) const; + + int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption & = TQStyleOption::Default, + TQStyleHintReturn* = 0) const; + + TQPixmap stylePixmap( StylePixmap stylepixmap, + const TQWidget *widget = 0, + const TQStyleOption& = TQStyleOption::Default ) const; + + TQRect subRect( SubRect r, const TQWidget *widget ) const; + + +private: + class Private; + Private *d; + + // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQWindowsStyle( const TQWindowsStyle & ); + TQWindowsStyle& operator=( const TQWindowsStyle & ); +#endif +}; + +#endif // QT_NO_STYLE_WINDOWS + +#endif // TQWINDOWSSTYLE_H diff --git a/src/styles/qcdestyle.cpp b/src/styles/qcdestyle.cpp index fd03ab049..7a4f2693d 100644 --- a/src/styles/qcdestyle.cpp +++ b/src/styles/qcdestyle.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qcdestyle.h" +#include "ntqcdestyle.h" #if !defined(QT_NO_STYLE_CDE) || defined(QT_PLUGIN) -#include "qpainter.h" -#include "qdrawutil.h" -#include "qbutton.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqbutton.h" #include /*! - \class TQCDEStyle qcdestyle.h + \class TQCDEStyle ntqcdestyle.h \brief The TQCDEStyle class provides a CDE look and feel. \ingroup appearance diff --git a/src/styles/qcdestyle.h b/src/styles/qcdestyle.h deleted file mode 100644 index 47de74162..000000000 --- a/src/styles/qcdestyle.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Definition of the CDE-like style class -** -** Created : 990513 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - - -#ifndef TQCDESTYLE_H -#define TQCDESTYLE_H - -#ifndef QT_H -#include "qmotifstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_CDE) || defined(QT_PLUGIN) - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_CDE -#else -#define Q_EXPORT_STYLE_CDE Q_EXPORT -#endif - -class Q_EXPORT_STYLE_CDE TQCDEStyle : public TQMotifStyle -{ - Q_OBJECT -public: - - TQCDEStyle( bool useHighlightCols = FALSE ); - virtual ~TQCDEStyle(); - - int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - -}; - -#endif // QT_NO_STYLE_CDE - -#endif // TQCDESTYLE_H diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp index 153174ba6..fb04f7e52 100644 --- a/src/styles/qcommonstyle.cpp +++ b/src/styles/qcommonstyle.cpp @@ -38,39 +38,39 @@ ** **********************************************************************/ -#include "qcommonstyle.h" +#include "ntqcommonstyle.h" #ifndef QT_NO_STYLE -#include "qmenubar.h" -#include "qapplication.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qpushbutton.h" -#include "qtabbar.h" -#include "qscrollbar.h" -#include "qtoolbutton.h" -#include "qtoolbar.h" -#include "qdockarea.h" -#include "qheader.h" -#include "qspinbox.h" -#include "qrangecontrol.h" -#include "qgroupbox.h" -#include "qslider.h" -#include "qlistview.h" -#include "qcheckbox.h" -#include "qradiobutton.h" -#include "qbitmap.h" -#include "qprogressbar.h" +#include "ntqmenubar.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqpushbutton.h" +#include "ntqtabbar.h" +#include "ntqscrollbar.h" +#include "ntqtoolbutton.h" +#include "ntqtoolbar.h" +#include "ntqdockarea.h" +#include "ntqheader.h" +#include "ntqspinbox.h" +#include "ntqrangecontrol.h" +#include "ntqgroupbox.h" +#include "ntqslider.h" +#include "ntqlistview.h" +#include "ntqcheckbox.h" +#include "ntqradiobutton.h" +#include "ntqbitmap.h" +#include "ntqprogressbar.h" #include "private/qdialogbuttons_p.h" #include -#include +#include #include "../widgets/qtitlebar_p.h" -#include +#include /*! - \class TQCommonStyle qcommonstyle.h + \class TQCommonStyle ntqcommonstyle.h \brief The TQCommonStyle class encapsulates the common Look and Feel of a GUI. \ingroup appearance diff --git a/src/styles/qcommonstyle.h b/src/styles/qcommonstyle.h deleted file mode 100644 index a1579ce12..000000000 --- a/src/styles/qcommonstyle.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Definition of TQCommonStyle class -** -** Created : 980616 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCOMMONSTYLE_H -#define TQCOMMONSTYLE_H - -#ifndef QT_H -#include "qstyle.h" -#endif // QT_H - -#ifndef QT_NO_STYLE - -class Q_EXPORT TQCommonStyle: public TQStyle -{ - Q_OBJECT - -public: - TQCommonStyle(); - ~TQCommonStyle(); - - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControlMask( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect subRect( SubRect r, const TQWidget *widget ) const; - - void drawComplexControl( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, -#ifdef Q_QDOC - SCFlags sub = SC_All, -#else - SCFlags sub = (uint)SC_All, -#endif - SCFlags subActive = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawComplexControlMask( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect querySubControlMetrics( ComplexControl control, - const TQWidget *widget, - SubControl sc, - const TQStyleOption& = TQStyleOption::Default ) const; - - SubControl querySubControl( ComplexControl control, - const TQWidget *widget, - const TQPoint &pos, - const TQStyleOption& = TQStyleOption::Default ) const; - - int pixelMetric( PixelMetric m, const TQWidget *widget = 0 ) const; - - TQSize sizeFromContents( ContentsType s, - const TQWidget *widget, - const TQSize &contentsSize, - const TQStyleOption& = TQStyleOption::Default ) const; - - int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption &, TQStyleHintReturn *) const; - - TQPixmap stylePixmap( StylePixmap sp, - const TQWidget *widget = 0, - const TQStyleOption& = TQStyleOption::Default ) const; - - -private: - // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQCommonStyle( const TQCommonStyle & ); - TQCommonStyle &operator=( const TQCommonStyle & ); -#endif -}; - - - -#endif // QT_NO_STYLE - -#endif // TQCOMMONSTYLE_H diff --git a/src/styles/qcompactstyle.cpp b/src/styles/qcompactstyle.cpp index 59cb2a232..7dc0ab37c 100644 --- a/src/styles/qcompactstyle.cpp +++ b/src/styles/qcompactstyle.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qcompactstyle.h" +#include "ntqcompactstyle.h" #if !defined(QT_NO_STYLE_COMPACT) || defined(QT_PLUGIN) -#include "qfontmetrics.h" -#include "qpalette.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qmenudata.h" -#include "qpopupmenu.h" +#include "ntqfontmetrics.h" +#include "ntqpalette.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqmenudata.h" +#include "ntqpopupmenu.h" TQCompactStyle::TQCompactStyle() : TQWindowsStyle() diff --git a/src/styles/qcompactstyle.h b/src/styles/qcompactstyle.h deleted file mode 100644 index ecc5c0b6c..000000000 --- a/src/styles/qcompactstyle.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Definition of compact style class, good for small displays -** -** Created : 000623 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCOMPACTSTYLE_H -#define TQCOMPACTSTYLE_H - -#ifndef QT_H -#include "qwindowsstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_COMPACT) || defined(QT_PLUGIN) - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_COMPACT -#else -#define Q_EXPORT_STYLE_COMPACT Q_EXPORT -#endif - -class Q_EXPORT_STYLE_COMPACT TQCompactStyle : public TQWindowsStyle -{ -public: - TQCompactStyle(); - - int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ); - - void drawControl( ControlElement element, TQPainter *p, const TQWidget *w, const TQRect &r, - const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQCompactStyle( const TQCompactStyle & ); - TQCompactStyle& operator=( const TQCompactStyle & ); -#endif -}; - -#endif // QT_NO_STYLE_WINDOWS - -#endif // TQCOMPACTSTYLE_H diff --git a/src/styles/qinterlacestyle.cpp b/src/styles/qinterlacestyle.cpp index 871554716..cf1efe43c 100644 --- a/src/styles/qinterlacestyle.cpp +++ b/src/styles/qinterlacestyle.cpp @@ -40,26 +40,26 @@ #if 0 // ###### not ported to new API yet -#include "qinterlacestyle.h" +#include "ntqinterlacestyle.h" #if !defined(QT_NO_STYLE_INTERLACE) || defined(QT_PLUGIN) -#include "qapplication.h" -#include "qpainter.h" -#include "qdrawutil.h" // for now -#include "qpalette.h" // for now -#include "qwidget.h" -#include "qlabel.h" -#include "qpushbutton.h" -#include "qwidget.h" -#include "qrangecontrol.h" -#include "qscrollbar.h" -#include "qlistbox.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" // for now +#include "ntqpalette.h" // for now +#include "ntqwidget.h" +#include "ntqlabel.h" +#include "ntqpushbutton.h" +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#include "ntqscrollbar.h" +#include "ntqlistbox.h" #include /*! - \class TQInterlaceStyle qinterlacestyle.h + \class TQInterlaceStyle ntqinterlacestyle.h \brief The TQInterlaceStyle class provides a Look and Feel suitable for interlaced displays. \ingroup appearance diff --git a/src/styles/qinterlacestyle.h b/src/styles/qinterlacestyle.h deleted file mode 100644 index d2caecbe0..000000000 --- a/src/styles/qinterlacestyle.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQInterlaceStyle widget class -** -** Created : 010122 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#if 0 // ###### not ported to new API yet -#ifndef TQINTERLACESTYLE_H -#define TQINTERLACESTYLE_H - -#ifndef QT_H -#include "qmotifstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_INTERLACE) || defined(QT_PLUGIN) - -#include "qpalette.h" - -class Q_EXPORT TQInterlaceStyle : public TQMotifStyle -{ -public: - TQInterlaceStyle(); - void polish( TQApplication*); - void unPolish( TQApplication*); - void polish( TQWidget* ); - void unPolish( TQWidget* ); - - int defaultFrameWidth() const; - TQRect pushButtonContentsRect( TQPushButton *btn ); - - void drawFocusRect ( TQPainter *, const TQRect &, const TQColorGroup &, const TQColor * bg = 0, bool = FALSE ); - void drawButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken = FALSE, - const TQBrush *fill = 0 ); - void drawButtonMask ( TQPainter * p, int x, int y, int w, int h ); - void drawBevelButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken = FALSE, - const TQBrush *fill = 0 ); - - void drawPushButton( TQPushButton* btn, TQPainter *p); - TQSize indicatorSize () const; - void drawIndicator ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE ); - void drawIndicatorMask( TQPainter *p, int x, int y, int w, int h, int ); - TQSize exclusiveIndicatorSize () const; - void drawExclusiveIndicator( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE ); - void drawExclusiveIndicatorMask( TQPainter * p, int x, int y, int w, int h, bool ); - TQRect comboButtonRect ( int x, int y, int w, int h ); - void drawComboButton( TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, bool sunken, bool editable, bool enabled, const TQBrush *fb ); - void drawPushButtonLabel( TQPushButton* btn, TQPainter *p); - void drawPanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken, - int lineWidth, const TQBrush *fill ); - - void scrollBarMetrics( const TQScrollBar* sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim ); - void drawScrollBarControls( TQPainter* p, const TQScrollBar* sb, int sliderStart, uint controls, uint activeControl ); - void drawSlider( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, Orientation, bool tickAbove, bool tickBelow ); - void drawSliderGroove( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, TQCOORD c, Orientation ); - int splitterWidth() const; - void drawSplitter( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, Orientation orient); - - int buttonDefaultIndicatorWidth() const; - int setSliderThickness() const; - TQSize scrollBarExtent() const; - -private: - TQPalette oldPalette; -}; - -#endif // QT_NO_STYLE_INTERLACE - -#endif -#endif diff --git a/src/styles/qmotifplusstyle.cpp b/src/styles/qmotifplusstyle.cpp index a3ff8aeb6..528e6dce8 100644 --- a/src/styles/qmotifplusstyle.cpp +++ b/src/styles/qmotifplusstyle.cpp @@ -38,28 +38,28 @@ ** **********************************************************************/ -#include "qmotifplusstyle.h" +#include "ntqmotifplusstyle.h" #if !defined(QT_NO_STYLE_MOTIFPLUS) || defined(QT_PLUGIN) -#include "qmenubar.h" -#include "qapplication.h" -#include "qpainter.h" -#include "qpalette.h" -#include "qframe.h" -#include "qpushbutton.h" -#include "qcheckbox.h" -#include "qradiobutton.h" -#include "qcombobox.h" -#include "qlineedit.h" -#include "qspinbox.h" -#include "qslider.h" -#include "qdrawutil.h" -#include "qscrollbar.h" -#include "qtabbar.h" -#include "qtoolbar.h" -#include "qguardedptr.h" -#include "qlayout.h" +#include "ntqmenubar.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqpalette.h" +#include "ntqframe.h" +#include "ntqpushbutton.h" +#include "ntqcheckbox.h" +#include "ntqradiobutton.h" +#include "ntqcombobox.h" +#include "ntqlineedit.h" +#include "ntqspinbox.h" +#include "ntqslider.h" +#include "ntqdrawutil.h" +#include "ntqscrollbar.h" +#include "ntqtabbar.h" +#include "ntqtoolbar.h" +#include "ntqguardedptr.h" +#include "ntqlayout.h" struct TQMotifPlusStylePrivate @@ -132,7 +132,7 @@ static void drawMotifPlusShade(TQPainter *p, /*! - \class TQMotifPlusStyle qmotifplusstyle.h + \class TQMotifPlusStyle ntqmotifplusstyle.h \brief The TQMotifPlusStyle class provides a more sophisticated Motif-ish look and feel. \ingroup appearance diff --git a/src/styles/qmotifplusstyle.h b/src/styles/qmotifplusstyle.h deleted file mode 100644 index 8490e84c1..000000000 --- a/src/styles/qmotifplusstyle.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMotifPlusStyle class -** -** Created : 000727 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMOTIFPLUSSTYLE_H -#define TQMOTIFPLUSSTYLE_H - - -#ifndef QT_H -#include "qmotifstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_MOTIFPLUS) || defined(QT_PLUGIN) - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_MOTIFPLUS -#else -#define Q_EXPORT_STYLE_MOTIFPLUS Q_EXPORT -#endif - -class Q_EXPORT_STYLE_MOTIFPLUS TQMotifPlusStyle : public TQMotifStyle -{ - Q_OBJECT - -public: - TQMotifPlusStyle(bool hoveringHighlight = TRUE); - virtual ~TQMotifPlusStyle(); - - void polish(TQPalette &pal); - void polish(TQWidget *widget); - void unPolish(TQWidget*widget); - - void polish(TQApplication *app); - void unPolish(TQApplication *app); - - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect subRect(SubRect r, const TQWidget *widget) const; - - void drawComplexControl(ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, -#ifdef Q_QDOC - SCFlags controls = SC_All, -#else - SCFlags controls = (uint)SC_All, -#endif - SCFlags active = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect querySubControlMetrics(ComplexControl control, - const TQWidget *widget, - SubControl subcontrol, - const TQStyleOption& = TQStyleOption::Default) const; - - int pixelMetric(PixelMetric metric, const TQWidget *widget = 0) const; - - int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption & = TQStyleOption::Default, - TQStyleHintReturn* = 0) const; - -protected: - bool eventFilter(TQObject *, TQEvent *); - - -private: - bool useHoveringHighlight; -}; - - -#endif // QT_NO_STYLE_MOTIFPLUS - -#endif // TQMOTIFPLUSSTYLE_H diff --git a/src/styles/qmotifstyle.cpp b/src/styles/qmotifstyle.cpp index 89ea23316..ce25794f9 100644 --- a/src/styles/qmotifstyle.cpp +++ b/src/styles/qmotifstyle.cpp @@ -38,29 +38,29 @@ ** **********************************************************************/ -#include "qmotifstyle.h" +#include "ntqmotifstyle.h" #if !defined(QT_NO_STYLE_MOTIF) || defined(QT_PLUGIN) -#include "qpopupmenu.h" -#include "qapplication.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qpalette.h" -#include "qwidget.h" -#include "qpushbutton.h" -#include "qscrollbar.h" -#include "qtabbar.h" -#include "qtabwidget.h" -#include "qlistview.h" -#include "qsplitter.h" -#include "qslider.h" -#include "qcombobox.h" -#include "qdockwindow.h" -#include "qdockarea.h" -#include "qprogressbar.h" -#include "qimage.h" +#include "ntqpopupmenu.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqpalette.h" +#include "ntqwidget.h" +#include "ntqpushbutton.h" +#include "ntqscrollbar.h" +#include "ntqtabbar.h" +#include "ntqtabwidget.h" +#include "ntqlistview.h" +#include "ntqsplitter.h" +#include "ntqslider.h" +#include "ntqcombobox.h" +#include "ntqdockwindow.h" +#include "ntqdockarea.h" +#include "ntqprogressbar.h" +#include "ntqimage.h" #include @@ -77,7 +77,7 @@ static const int motifCheckMarkSpace = 12; /*! - \class TQMotifStyle qmotifstyle.h + \class TQMotifStyle ntqmotifstyle.h \brief The TQMotifStyle class provides Motif look and feel. \ingroup appearance diff --git a/src/styles/qmotifstyle.h b/src/styles/qmotifstyle.h deleted file mode 100644 index 6490f5d9e..000000000 --- a/src/styles/qmotifstyle.h +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** -** -** Definition of Motif-like style class -** -** Created : 981231 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMOTIFSTYLE_H -#define TQMOTIFSTYLE_H - -#ifndef QT_H -#include "qcommonstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_MOTIF) || defined(QT_PLUGIN) - -class TQPalette; - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_MOTIF -#else -#define Q_EXPORT_STYLE_MOTIF Q_EXPORT -#endif - - -class Q_EXPORT_STYLE_MOTIF TQMotifStyle : public TQCommonStyle -{ - Q_OBJECT -public: - TQMotifStyle( bool useHighlightCols=FALSE ); - virtual ~TQMotifStyle(); - - void setUseHighlightColors( bool ); - bool useHighlightColors() const; - - void polish( TQPalette& ); - void polish( TQWidget* ); - void polish( TQApplication* ); - - void polishPopupMenu( TQPopupMenu* ); - - // new style API - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawComplexControl( ComplexControl control, - TQPainter *p, - const TQWidget* widget, - const TQRect& r, - const TQColorGroup& cg, - SFlags how = Style_Default, -#ifdef Q_QDOC - SCFlags sub = SC_All, -#else - SCFlags sub = (uint)SC_All, -#endif - SCFlags subActive = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect querySubControlMetrics( ComplexControl control, - const TQWidget *widget, - SubControl sc, - const TQStyleOption& = TQStyleOption::Default ) const; - - int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; - - TQSize sizeFromContents( ContentsType contents, - const TQWidget *widget, - const TQSize &contentsSize, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect subRect( SubRect r, const TQWidget *widget ) const; - - TQPixmap stylePixmap(StylePixmap, const TQWidget * = 0, const TQStyleOption& = TQStyleOption::Default) const; - - int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption & = TQStyleOption::Default, - TQStyleHintReturn* = 0) const; - -private: - bool highlightCols; - - // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMotifStyle( const TQMotifStyle & ); - TQMotifStyle& operator=( const TQMotifStyle & ); -#endif -}; - -#endif // QT_NO_STYLE_MOTIF - -#endif // TQMOTIFSTYLE_H diff --git a/src/styles/qplatinumstyle.cpp b/src/styles/qplatinumstyle.cpp index ce6bd78b8..8f9f9ab75 100644 --- a/src/styles/qplatinumstyle.cpp +++ b/src/styles/qplatinumstyle.cpp @@ -38,23 +38,23 @@ ** **********************************************************************/ -#include "qplatinumstyle.h" +#include "ntqplatinumstyle.h" #if !defined(QT_NO_STYLE_PLATINUM) || defined(QT_PLUGIN) -#include "qapplication.h" -#include "qcombobox.h" -#include "qdrawutil.h" -#include "qpainter.h" -#include "qpalette.h" -#include "qpixmap.h" -#include "qpushbutton.h" -#include "qscrollbar.h" -#include "qslider.h" +#include "ntqapplication.h" +#include "ntqcombobox.h" +#include "ntqdrawutil.h" +#include "ntqpainter.h" +#include "ntqpalette.h" +#include "ntqpixmap.h" +#include "ntqpushbutton.h" +#include "ntqscrollbar.h" +#include "ntqslider.h" #include /*! - \class TQPlatinumStyle qplatinumstyle.h + \class TQPlatinumStyle ntqplatinumstyle.h \brief The TQPlatinumStyle class provides Mac/Platinum look and feel. \ingroup appearance diff --git a/src/styles/qplatinumstyle.h b/src/styles/qplatinumstyle.h deleted file mode 100644 index a2f3e5b6d..000000000 --- a/src/styles/qplatinumstyle.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Definition of Platinum-like style class -** -** Created : 981231 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPLATINUMSTYLE_H -#define TQPLATINUMSTYLE_H - -#ifndef QT_H -#include "qwindowsstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_PLATINUM) || defined(QT_PLUGIN) - -class TQPalette; - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_PLATINUM -#else -#define Q_EXPORT_STYLE_PLATINUM Q_EXPORT -#endif - -class Q_EXPORT_STYLE_PLATINUM TQPlatinumStyle : public TQWindowsStyle -{ - Q_OBJECT -public: - TQPlatinumStyle(); - virtual ~TQPlatinumStyle(); - - // new Style Stuff - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawComplexControl( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, -#ifdef Q_QDOC - SCFlags sub = SC_All, -#else - SCFlags sub = (uint)SC_All, -#endif - SCFlags subActive = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect querySubControlMetrics( ComplexControl control, - const TQWidget *widget, - SubControl sc, - const TQStyleOption& = TQStyleOption::Default ) const; - - int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; - - TQRect subRect( SubRect r, const TQWidget *widget ) const; - -protected: - TQColor mixedColor(const TQColor &, const TQColor &) const; - void drawRiffles( TQPainter* p, int x, int y, int w, int h, - const TQColorGroup &g, bool horizontal ) const; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPlatinumStyle( const TQPlatinumStyle & ); - TQPlatinumStyle& operator=( const TQPlatinumStyle & ); -#endif -}; - -#endif // QT_NO_STYLE_PLATINUM - -#endif // TQPLATINUMSTYLE_H diff --git a/src/styles/qsgistyle.cpp b/src/styles/qsgistyle.cpp index f17562eb7..e09b4aa30 100644 --- a/src/styles/qsgistyle.cpp +++ b/src/styles/qsgistyle.cpp @@ -38,26 +38,26 @@ ** **********************************************************************/ -#include "qsgistyle.h" +#include "ntqsgistyle.h" #if !defined(QT_NO_STYLE_SGI) || defined(QT_PLUGIN) -#include "qpopupmenu.h" -#include "qapplication.h" -#include "qbutton.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qpalette.h" -#include "qwidget.h" -#include "qpushbutton.h" -#include "qscrollbar.h" -#include "qcombobox.h" -#include "qslider.h" -#include "qtextedit.h" -#include "qtoolbar.h" -#include "qlineedit.h" -#include "qmenubar.h" +#include "ntqpopupmenu.h" +#include "ntqapplication.h" +#include "ntqbutton.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqpalette.h" +#include "ntqwidget.h" +#include "ntqpushbutton.h" +#include "ntqscrollbar.h" +#include "ntqcombobox.h" +#include "ntqslider.h" +#include "ntqtextedit.h" +#include "ntqtoolbar.h" +#include "ntqlineedit.h" +#include "ntqmenubar.h" #include #ifndef QT_NO_SLIDER @@ -97,7 +97,7 @@ public: }; /*! - \class TQSGIStyle qsgistyle.h + \class TQSGIStyle ntqsgistyle.h \brief The TQSGIStyle class provides SGI/Irix look and feel. \ingroup appearance diff --git a/src/styles/qsgistyle.h b/src/styles/qsgistyle.h deleted file mode 100644 index df0ccb6be..000000000 --- a/src/styles/qsgistyle.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Definition of SGI-like style class -** -** Created : 981231 -** -** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSGISTYLE_H -#define TQSGISTYLE_H - -#ifndef QT_H -#include "qmotifstyle.h" -#include "qguardedptr.h" -#include "qwidget.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_SGI) || defined(QT_PLUGIN) - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_SGI -#else -#define Q_EXPORT_STYLE_SGI Q_EXPORT -#endif - -class TQSGIStylePrivate; - -class Q_EXPORT_STYLE_SGI TQSGIStyle: public TQMotifStyle -{ - Q_OBJECT -public: - TQSGIStyle( bool useHighlightCols = FALSE ); - virtual ~TQSGIStyle(); - -#if !defined(Q_NO_USING_KEYWORD) - using TQMotifStyle::polish; -#endif - void polish( TQWidget* ); - void unPolish( TQWidget* ); - void polish( TQApplication* ); - void unPolish( TQApplication* ); - - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags how = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawComplexControl( ComplexControl control, - TQPainter *p, - const TQWidget* widget, - const TQRect& r, - const TQColorGroup& cg, - SFlags how = Style_Default, -#ifdef Q_QDOC - SCFlags sub = SC_All, -#else - SCFlags sub = (uint)SC_All, -#endif - SCFlags subActive = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const; - - int pixelMetric( PixelMetric metric, const TQWidget *widget = 0 ) const; - - TQSize sizeFromContents( ContentsType contents, - const TQWidget *widget, - const TQSize &contentsSize, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect subRect( SubRect r, const TQWidget *widget ) const; - TQRect querySubControlMetrics( ComplexControl control, - const TQWidget *widget, - SubControl sc, - const TQStyleOption& = TQStyleOption::Default ) const; - -protected: - bool eventFilter( TQObject*, TQEvent*); - -private: - TQSGIStylePrivate *d; - - uint isApplicationStyle :1; -#if defined(Q_DISABLE_COPY) - TQSGIStyle( const TQSGIStyle & ); - TQSGIStyle& operator=( const TQSGIStyle & ); -#endif - -}; - -#endif // QT_NO_STYLE_SGI - -#endif // TQSGISTYLE_H diff --git a/src/styles/qstylefactory.cpp b/src/styles/qstylefactory.cpp index 85e312889..88f25642d 100644 --- a/src/styles/qstylefactory.cpp +++ b/src/styles/qstylefactory.cpp @@ -39,18 +39,18 @@ **********************************************************************/ #include "qstyleinterface_p.h" // up here for GCC 2.7.* compatibility -#include "qstylefactory.h" +#include "ntqstylefactory.h" #ifndef QT_NO_STYLE -#include "qapplication.h" -#include "qwindowsstyle.h" -#include "qmotifstyle.h" -#include "qcdestyle.h" -#include "qmotifplusstyle.h" -#include "qplatinumstyle.h" -#include "qsgistyle.h" -#include "qcompactstyle.h" +#include "ntqapplication.h" +#include "ntqwindowsstyle.h" +#include "ntqmotifstyle.h" +#include "ntqcdestyle.h" +#include "ntqmotifplusstyle.h" +#include "ntqplatinumstyle.h" +#include "ntqsgistyle.h" +#include "ntqcompactstyle.h" #ifndef QT_NO_STYLE_WINDOWSXP #include "qwindowsxpstyle.h" #endif @@ -99,7 +99,7 @@ TQStyleFactoryPrivate::~TQStyleFactoryPrivate() #endif //QT_NO_COMPONENT /*! - \class TQStyleFactory qstylefactory.h + \class TQStyleFactory ntqstylefactory.h \brief The TQStyleFactory class creates TQStyle objects. The style factory creates a TQStyle object for a given key with diff --git a/src/styles/qstylefactory.h b/src/styles/qstylefactory.h deleted file mode 100644 index 0d2a79b37..000000000 --- a/src/styles/qstylefactory.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** ... -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTYLEFACTORY_H -#define TQSTYLEFACTORY_H - -#ifndef QT_H -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_STYLE - -class TQString; -class TQStyle; - -class Q_EXPORT TQStyleFactory -{ -public: -#ifndef QT_NO_STRINGLIST - static TQStringList keys(); -#endif - static TQStyle *create( const TQString& ); -}; - -#endif //QT_NO_STYLE - -#endif //TQSTYLEFACTORY_H diff --git a/src/styles/qstyleplugin.cpp b/src/styles/qstyleplugin.cpp index 22b29bf5b..a76b4d1a4 100644 --- a/src/styles/qstyleplugin.cpp +++ b/src/styles/qstyleplugin.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qstyleplugin.h" +#include "ntqstyleplugin.h" #ifndef QT_NO_STYLE #ifndef QT_NO_COMPONENT #include "qstyleinterface_p.h" -#include "qobjectcleanuphandler.h" -#include "qstyle.h" +#include "ntqobjectcleanuphandler.h" +#include "ntqstyle.h" /*! - \class TQStylePlugin qstyleplugin.h + \class TQStylePlugin ntqstyleplugin.h \brief The TQStylePlugin class provides an abstract base for custom TQStyle plugins. \ingroup plugins diff --git a/src/styles/qstyleplugin.h b/src/styles/qstyleplugin.h deleted file mode 100644 index c282be8ca..000000000 --- a/src/styles/qstyleplugin.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Definition of TQStylePlugin class -** -** Created : 010920 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTYLEPLUGIN_H -#define TQSTYLEPLUGIN_H - -#ifndef QT_H -#include "qgplugin.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_STYLE -#ifndef QT_NO_COMPONENT - -class TQStyle; -class TQStylePluginPrivate; - -class Q_EXPORT TQStylePlugin : public TQGPlugin -{ - Q_OBJECT -public: - TQStylePlugin(); - ~TQStylePlugin(); - - virtual TQStringList keys() const = 0; - virtual TQStyle *create( const TQString &key ) = 0; - -private: - TQStylePluginPrivate *d; -}; - -#endif // QT_NO_COMPONENT -#endif // QT_NO_STYLE - -#endif // TQSTYLEPLUGIN_H diff --git a/src/styles/qt_styles.pri b/src/styles/qt_styles.pri index 913828eab..4f3e1be56 100644 --- a/src/styles/qt_styles.pri +++ b/src/styles/qt_styles.pri @@ -2,10 +2,10 @@ styles { STYLES_P = styles - HEADERS +=$$STYLES_H/qstylefactory.h \ + HEADERS +=$$STYLES_H/ntqstylefactory.h \ $$STYLES_P/qstyleinterface_p.h \ - $$STYLES_H/qstyleplugin.h \ - $$STYLES_H/qcommonstyle.h + $$STYLES_H/ntqstyleplugin.h \ + $$STYLES_H/ntqcommonstyle.h SOURCES +=$$STYLES_CPP/qstylefactory.cpp \ $$STYLES_CPP/qstyleplugin.cpp \ $$STYLES_CPP/qcommonstyle.cpp @@ -44,7 +44,7 @@ styles { else:DEFINES += QT_NO_STYLE_AQUA contains( styles, cde ) { - HEADERS +=$$STYLES_H/qcdestyle.h + HEADERS +=$$STYLES_H/ntqcdestyle.h SOURCES +=$$STYLES_CPP/qcdestyle.cpp !contains( styles, motif ) { @@ -55,7 +55,7 @@ styles { else:DEFINES += QT_NO_STYLE_CDE contains( styles, motifplus ) { - HEADERS +=$$STYLES_H/qmotifplusstyle.h + HEADERS +=$$STYLES_H/ntqmotifplusstyle.h SOURCES +=$$STYLES_CPP/qmotifplusstyle.cpp !contains( styles, motif ) { message( motifplus requires motif ) @@ -65,7 +65,7 @@ styles { else:DEFINES += QT_NO_STYLE_MOTIFPLUS contains( styles, interlace ) { - HEADERS +=$$STYLES_H/qinterlacestyle.h + HEADERS +=$$STYLES_H/ntqinterlacestyle.h SOURCES +=$$STYLES_CPP/qinterlacestyle.cpp !contains( styles, windows ) { message( interlace requires windows ) @@ -75,7 +75,7 @@ styles { else:DEFINES += QT_NO_STYLE_INTERLACE contains( styles, platinum ) { - HEADERS +=$$STYLES_H/qplatinumstyle.h + HEADERS +=$$STYLES_H/ntqplatinumstyle.h SOURCES +=$$STYLES_CPP/qplatinumstyle.cpp !contains( styles, windows ) { message( platinum requires windows ) @@ -95,7 +95,7 @@ styles { else:DEFINES += QT_NO_STYLE_WINDOWSXP contains( styles, sgi ) { - HEADERS +=$$STYLES_H/qsgistyle.h + HEADERS +=$$STYLES_H/ntqsgistyle.h SOURCES +=$$STYLES_CPP/qsgistyle.cpp !contains( styles, motif ) { message( sgi requires motif ) @@ -105,7 +105,7 @@ styles { else:DEFINES += QT_NO_STYLE_SGI contains( styles, compact ) { - HEADERS +=$$STYLES_H/qcompactstyle.h + HEADERS +=$$STYLES_H/ntqcompactstyle.h SOURCES +=$$STYLES_CPP/qcompactstyle.cpp !contains( styles, windows ) { message( compact requires windows ) @@ -127,13 +127,13 @@ styles { else:DEFINES += QT_NO_STYLE_POCKETPC contains( styles, windows ) { - HEADERS +=$$STYLES_H/qwindowsstyle.h + HEADERS +=$$STYLES_H/ntqwindowsstyle.h SOURCES +=$$STYLES_CPP/qwindowsstyle.cpp } else:DEFINES += QT_NO_STYLE_WINDOWS contains( styles, motif ) { - HEADERS +=$$STYLES_H/qmotifstyle.h + HEADERS +=$$STYLES_H/ntqmotifstyle.h SOURCES +=$$STYLES_CPP/qmotifstyle.cpp } else:DEFINES += QT_NO_STYLE_MOTIF diff --git a/src/styles/qwindowsstyle.cpp b/src/styles/qwindowsstyle.cpp index c7677ca02..92c6de147 100644 --- a/src/styles/qwindowsstyle.cpp +++ b/src/styles/qwindowsstyle.cpp @@ -38,33 +38,33 @@ ** **********************************************************************/ -#include "qwindowsstyle.h" +#include "ntqwindowsstyle.h" #if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) -#include "qpopupmenu.h" -#include "qapplication.h" -#include "qpainter.h" -#include "qdrawutil.h" // for now -#include "qpixmap.h" // for now -#include "qwidget.h" -#include "qlabel.h" -#include "qimage.h" -#include "qpushbutton.h" -#include "qcombobox.h" -#include "qlistbox.h" -#include "qwidget.h" -#include "qrangecontrol.h" -#include "qscrollbar.h" -#include "qslider.h" -#include "qtabwidget.h" -#include "qtabbar.h" -#include "qlistview.h" -#include "qbitmap.h" -#include "qcleanuphandler.h" -#include "qdockwindow.h" -#include "qobjectlist.h" -#include "qmenubar.h" +#include "ntqpopupmenu.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" // for now +#include "ntqpixmap.h" // for now +#include "ntqwidget.h" +#include "ntqlabel.h" +#include "ntqimage.h" +#include "ntqpushbutton.h" +#include "ntqcombobox.h" +#include "ntqlistbox.h" +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#include "ntqscrollbar.h" +#include "ntqslider.h" +#include "ntqtabwidget.h" +#include "ntqtabbar.h" +#include "ntqlistview.h" +#include "ntqbitmap.h" +#include "ntqcleanuphandler.h" +#include "ntqdockwindow.h" +#include "ntqobjectlist.h" +#include "ntqmenubar.h" #if defined(Q_WS_WIN) #include "qt_windows.h" @@ -209,7 +209,7 @@ bool TQWindowsStyle::Private::eventFilter(TQObject *o, TQEvent *e) } /*! - \class TQWindowsStyle qwindowsstyle.h + \class TQWindowsStyle ntqwindowsstyle.h \brief The TQWindowsStyle class provides a Microsoft Windows-like look and feel. \ingroup appearance diff --git a/src/styles/qwindowsstyle.h b/src/styles/qwindowsstyle.h deleted file mode 100644 index ab3cc4b78..000000000 --- a/src/styles/qwindowsstyle.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Definition of Windows-like style class -** -** Created : 981231 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWINDOWSSTYLE_H -#define TQWINDOWSSTYLE_H - -#ifndef QT_H -#include "qcommonstyle.h" -#endif // QT_H - -#if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) - -#if defined(QT_PLUGIN) -#define Q_EXPORT_STYLE_WINDOWS -#else -#define Q_EXPORT_STYLE_WINDOWS Q_EXPORT -#endif - - -class Q_EXPORT_STYLE_WINDOWS TQWindowsStyle : public TQCommonStyle -{ - Q_OBJECT -public: - TQWindowsStyle(); - ~TQWindowsStyle(); - - void polish(TQApplication*); - void unPolish(TQApplication*); - - void polish(TQWidget*); - void unPolish(TQWidget*); - - void polish( TQPalette & ); - - virtual void polishPopupMenu( TQPopupMenu* ); - - // new stuff - void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::Default ) const; - - void drawComplexControl( ComplexControl control, - TQPainter* p, - const TQWidget* widget, - const TQRect& r, - const TQColorGroup& cg, - SFlags flags = Style_Default, -#ifdef Q_QDOC - SCFlags sub = SC_All, -#else - SCFlags sub = (uint)SC_All, -#endif - SCFlags subActive = SC_None, - const TQStyleOption& = TQStyleOption::Default ) const; - - int pixelMetric( PixelMetric metric, - const TQWidget *widget = 0 ) const; - - TQSize sizeFromContents( ContentsType contents, - const TQWidget *widget, - const TQSize &contentsSize, - const TQStyleOption& = TQStyleOption::Default ) const; - - int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption & = TQStyleOption::Default, - TQStyleHintReturn* = 0) const; - - TQPixmap stylePixmap( StylePixmap stylepixmap, - const TQWidget *widget = 0, - const TQStyleOption& = TQStyleOption::Default ) const; - - TQRect subRect( SubRect r, const TQWidget *widget ) const; - - -private: - class Private; - Private *d; - - // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQWindowsStyle( const TQWindowsStyle & ); - TQWindowsStyle& operator=( const TQWindowsStyle & ); -#endif -}; - -#endif // QT_NO_STYLE_WINDOWS - -#endif // TQWINDOWSSTYLE_H diff --git a/src/table/ntqtable.h b/src/table/ntqtable.h new file mode 100644 index 000000000..67f7f2a69 --- /dev/null +++ b/src/table/ntqtable.h @@ -0,0 +1,564 @@ +/**************************************************************************** +** +** Definition of TQTable widget class +** +** Created : 000607 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the table module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTABLE_H +#define TQTABLE_H + +#ifndef QT_H +#include "ntqscrollview.h" +#include "ntqpixmap.h" +#include "ntqptrvector.h" +#include "ntqheader.h" +#include "ntqmemarray.h" +#include "ntqptrlist.h" +#include "ntqguardedptr.h" +#include "ntqshared.h" +#include "ntqintdict.h" +#include "ntqstringlist.h" +#endif // QT_H + + +#ifndef QT_NO_TABLE + +#if !defined( QT_MODULE_TABLE ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_TABLE ) +#define TQM_EXPORT_TABLE +#ifndef TQM_TEMPLATE_EXTERN_TABLE +# define TQM_TEMPLATE_EXTERN_TABLE +#endif +#else +#define TQM_EXPORT_TABLE Q_EXPORT +#define TQM_TEMPLATE_EXTERN_TABLE Q_TEMPLATE_EXTERN +#endif + +class TQTableHeader; +class TQValidator; +class TQTable; +class TQPaintEvent; +class TQTimer; +class TQResizeEvent; +class TQComboBox; +class TQCheckBox; +class TQDragObject; + +struct TQTablePrivate; +struct TQTableHeaderPrivate; + + +class TQM_EXPORT_TABLE TQTableSelection +{ +public: + TQTableSelection(); + TQTableSelection( int start_row, int start_col, int end_row, int end_col ); + void init( int row, int col ); + void expandTo( int row, int col ); + bool operator==( const TQTableSelection &s ) const; + bool operator!=( const TQTableSelection &s ) const { return !(operator==(s)); } + + int topRow() const { return tRow; } + int bottomRow() const { return bRow; } + int leftCol() const { return lCol; } + int rightCol() const { return rCol; } + int anchorRow() const { return aRow; } + int anchorCol() const { return aCol; } + int numRows() const; + int numCols() const; + + bool isActive() const { return active; } + bool isEmpty() const { return numRows() == 0; } + +private: + uint active : 1; + uint inited : 1; + int tRow, lCol, bRow, rCol; + int aRow, aCol; +}; + +#define Q_DEFINED_QTABLE_SELECTION +#include "ntqwinexport.h" + +class TQM_EXPORT_TABLE TQTableItem : public TQt +{ + friend class TQTable; + +public: + enum EditType { Never, OnTyping, WhenCurrent, Always }; + + TQTableItem( TQTable *table, EditType et ); + TQTableItem( TQTable *table, EditType et, const TQString &text ); + TQTableItem( TQTable *table, EditType et, const TQString &text, + const TQPixmap &p ); + virtual ~TQTableItem(); + + virtual TQPixmap pixmap() const; + virtual TQString text() const; + virtual void setPixmap( const TQPixmap &p ); + virtual void setText( const TQString &t ); + TQTable *table() const { return t; } + + virtual int alignment() const; + virtual void setWordWrap( bool b ); + bool wordWrap() const; + + EditType editType() const; + virtual TQWidget *createEditor() const; + virtual void setContentFromEditor( TQWidget *w ); + virtual void setReplaceable( bool ); + bool isReplaceable() const; + + virtual TQString key() const; + virtual TQSize sizeHint() const; + + virtual void setSpan( int rs, int cs ); + int rowSpan() const; + int colSpan() const; + + virtual void setRow( int r ); + virtual void setCol( int c ); + int row() const; + int col() const; + + virtual void paint( TQPainter *p, const TQColorGroup &cg, + const TQRect &cr, bool selected ); + + void updateEditor( int oldRow, int oldCol ); + + virtual void setEnabled( bool b ); + bool isEnabled() const; + + virtual int rtti() const; + static int RTTI; + +private: + TQString txt; + TQPixmap pix; + TQTable *t; + EditType edType; + uint wordwrap : 1; + uint tcha : 1; + uint enabled : 1; + int rw, cl; + int rowspan, colspan; +#if (QT_VERSION >= 0x040000) +#error "Add a setAlignment() function in 4.0 (but no d pointer)" +#endif +}; + +#define Q_DEFINED_QTABLE_ITEM +#include "ntqwinexport.h" + +class TQM_EXPORT_TABLE TQComboTableItem : public TQTableItem +{ +public: + TQComboTableItem( TQTable *table, const TQStringList &list, bool editable = FALSE ); + ~TQComboTableItem(); + virtual TQWidget *createEditor() const; + virtual void setContentFromEditor( TQWidget *w ); + virtual void paint( TQPainter *p, const TQColorGroup &cg, + const TQRect &cr, bool selected ); + virtual void setCurrentItem( int i ); + virtual void setCurrentItem( const TQString &i ); + int currentItem() const; + TQString currentText() const; + int count() const; +#if !defined(Q_NO_USING_KEYWORD) + using TQTableItem::text; +#endif + TQString text( int i ) const; + virtual void setEditable( bool b ); + bool isEditable() const; + virtual void setStringList( const TQStringList &l ); + + int rtti() const; + static int RTTI; + + TQSize sizeHint() const; + +private: + TQComboBox *cb; + TQStringList entries; + int current; + bool edit; + static TQComboBox *fakeCombo; + static TQWidget *fakeComboWidget; + static int fakeRef; + +}; + +class TQM_EXPORT_TABLE TQCheckTableItem : public TQTableItem +{ +public: + TQCheckTableItem( TQTable *table, const TQString &txt ); + void setText( const TQString &t ); + virtual TQWidget *createEditor() const; + virtual void setContentFromEditor( TQWidget *w ); + virtual void paint( TQPainter *p, const TQColorGroup &cg, + const TQRect &cr, bool selected ); + virtual void setChecked( bool b ); + bool isChecked() const; + + int rtti() const; + static int RTTI; + + TQSize sizeHint() const; + +private: + TQCheckBox *cb; + bool checked; + +}; + +class TQM_EXPORT_TABLE TQTable : public TQScrollView +{ + Q_OBJECT + Q_ENUMS( SelectionMode FocusStyle ) + Q_PROPERTY( int numRows READ numRows WRITE setNumRows ) + Q_PROPERTY( int numCols READ numCols WRITE setNumCols ) + Q_PROPERTY( bool showGrid READ showGrid WRITE setShowGrid ) + Q_PROPERTY( bool rowMovingEnabled READ rowMovingEnabled WRITE setRowMovingEnabled ) + Q_PROPERTY( bool columnMovingEnabled READ columnMovingEnabled WRITE setColumnMovingEnabled ) + Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) + Q_PROPERTY( bool sorting READ sorting WRITE setSorting ) + Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) + Q_PROPERTY( FocusStyle focusStyle READ focusStyle WRITE setFocusStyle ) + Q_PROPERTY( int numSelections READ numSelections ) + + friend class TQTableHeader; + friend class TQComboTableItem; + friend class TQCheckTableItem; + friend class TQTableItem; + +public: + TQTable( TQWidget* parent=0, const char* name=0 ); + TQTable( int numRows, int numCols, + TQWidget* parent=0, const char* name=0 ); + ~TQTable(); + + TQHeader *horizontalHeader() const; + TQHeader *verticalHeader() const; + + enum SelectionMode { Single, Multi, SingleRow, MultiRow, NoSelection }; + virtual void setSelectionMode( SelectionMode mode ); + SelectionMode selectionMode() const; + + virtual void setItem( int row, int col, TQTableItem *item ); + virtual void setText( int row, int col, const TQString &text ); + virtual void setPixmap( int row, int col, const TQPixmap &pix ); + virtual TQTableItem *item( int row, int col ) const; + virtual TQString text( int row, int col ) const; + virtual TQPixmap pixmap( int row, int col ) const; + virtual void clearCell( int row, int col ); + + virtual TQRect cellGeometry( int row, int col ) const; + virtual int columnWidth( int col ) const; + virtual int rowHeight( int row ) const; + virtual int columnPos( int col ) const; + virtual int rowPos( int row ) const; + virtual int columnAt( int x ) const; + virtual int rowAt( int y ) const; + + virtual int numRows() const; + virtual int numCols() const; + + void updateCell( int row, int col ); + + bool eventFilter( TQObject * o, TQEvent * ); + + int currentRow() const { return curRow; } + int currentColumn() const { return curCol; } + void ensureCellVisible( int row, int col ); + + bool isSelected( int row, int col ) const; + bool isRowSelected( int row, bool full = FALSE ) const; + bool isColumnSelected( int col, bool full = FALSE ) const; + int numSelections() const; + TQTableSelection selection( int num ) const; + virtual int addSelection( const TQTableSelection &s ); + virtual void removeSelection( const TQTableSelection &s ); + virtual void removeSelection( int num ); + virtual int currentSelection() const; + + void selectCells( int start_row, int start_col, int end_row, int end_col ); + void selectRow( int row ); + void selectColumn( int col ); + + bool showGrid() const; + + bool columnMovingEnabled() const; + bool rowMovingEnabled() const; + + virtual void sortColumn( int col, bool ascending = TRUE, + bool wholeRows = FALSE ); + bool sorting() const; + + virtual void takeItem( TQTableItem *i ); + + virtual void setCellWidget( int row, int col, TQWidget *e ); + virtual TQWidget *cellWidget( int row, int col ) const; + virtual void clearCellWidget( int row, int col ); + + virtual TQRect cellRect( int row, int col ) const; + + virtual void paintCell( TQPainter *p, int row, int col, + const TQRect &cr, bool selected ); + virtual void paintCell( TQPainter *p, int row, int col, + const TQRect &cr, bool selected, const TQColorGroup &cg ); + virtual void paintFocus( TQPainter *p, const TQRect &r ); + TQSize sizeHint() const; + + bool isReadOnly() const; + bool isRowReadOnly( int row ) const; + bool isColumnReadOnly( int col ) const; + + void setEnabled( bool b ); + + void repaintSelections(); + + enum FocusStyle { FollowStyle, SpreadSheet }; + virtual void setFocusStyle( FocusStyle fs ); + FocusStyle focusStyle() const; + + void updateHeaderStates(); + +public slots: + virtual void setNumRows( int r ); + virtual void setNumCols( int r ); + virtual void setShowGrid( bool b ); + virtual void hideRow( int row ); + virtual void hideColumn( int col ); + virtual void showRow( int row ); + virtual void showColumn( int col ); + bool isRowHidden( int row ) const; + bool isColumnHidden( int col ) const; + + virtual void setColumnWidth( int col, int w ); + virtual void setRowHeight( int row, int h ); + + virtual void adjustColumn( int col ); + virtual void adjustRow( int row ); + + virtual void setColumnStretchable( int col, bool stretch ); + virtual void setRowStretchable( int row, bool stretch ); + bool isColumnStretchable( int col ) const; + bool isRowStretchable( int row ) const; + virtual void setSorting( bool b ); + virtual void swapRows( int row1, int row2, bool swapHeader = FALSE ); + virtual void swapColumns( int col1, int col2, bool swapHeader = FALSE ); + virtual void swapCells( int row1, int col1, int row2, int col2 ); + + virtual void setLeftMargin( int m ); + virtual void setTopMargin( int m ); + virtual void setCurrentCell( int row, int col ); + void clearSelection( bool repaint = TRUE ); + virtual void setColumnMovingEnabled( bool b ); + virtual void setRowMovingEnabled( bool b ); + + virtual void setReadOnly( bool b ); + virtual void setRowReadOnly( int row, bool ro ); + virtual void setColumnReadOnly( int col, bool ro ); + + virtual void setDragEnabled( bool b ); + bool dragEnabled() const; + + virtual void insertRows( int row, int count = 1 ); + virtual void insertColumns( int col, int count = 1 ); + virtual void removeRow( int row ); + virtual void removeRows( const TQMemArray &rows ); + virtual void removeColumn( int col ); + virtual void removeColumns( const TQMemArray &cols ); + + virtual void editCell( int row, int col, bool replace = FALSE ); + + void setRowLabels( const TQStringList &labels ); + void setColumnLabels( const TQStringList &labels ); + +protected: + enum EditMode { NotEditing, Editing, Replacing }; + void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); + void contentsMousePressEvent( TQMouseEvent* ); + void contentsMouseMoveEvent( TQMouseEvent* ); + void contentsMouseDoubleClickEvent( TQMouseEvent* ); + void contentsMouseReleaseEvent( TQMouseEvent* ); + void contentsContextMenuEvent( TQContextMenuEvent * e ); + void keyPressEvent( TQKeyEvent* ); + void focusInEvent( TQFocusEvent* ); + void focusOutEvent( TQFocusEvent* ); + void viewportResizeEvent( TQResizeEvent * ); + void showEvent( TQShowEvent *e ); + void paintEvent( TQPaintEvent *e ); + void setEditMode( EditMode mode, int row, int col ); +#ifndef QT_NO_DRAGANDDROP + virtual void contentsDragEnterEvent( TQDragEnterEvent *e ); + virtual void contentsDragMoveEvent( TQDragMoveEvent *e ); + virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e ); + virtual void contentsDropEvent( TQDropEvent *e ); + virtual TQDragObject *dragObject(); + virtual void startDrag(); +#endif + + virtual void paintEmptyArea( TQPainter *p, int cx, int cy, int cw, int ch ); + virtual void activateNextCell(); + virtual TQWidget *createEditor( int row, int col, bool initFromCell ) const; + virtual void setCellContentFromEditor( int row, int col ); + virtual TQWidget *beginEdit( int row, int col, bool replace ); + virtual void endEdit( int row, int col, bool accept, bool replace ); + + virtual void resizeData( int len ); + virtual void insertWidget( int row, int col, TQWidget *w ); + int indexOf( int row, int col ) const; + + void windowActivationChange( bool ); + bool isEditing() const; + EditMode editMode() const; + int currEditRow() const; + int currEditCol() const; + +protected slots: + virtual void columnWidthChanged( int col ); + virtual void rowHeightChanged( int row ); + virtual void columnIndexChanged( int section, int fromIndex, int toIndex ); + virtual void rowIndexChanged( int section, int fromIndex, int toIndex ); + virtual void columnClicked( int col ); + +signals: + void currentChanged( int row, int col ); + void clicked( int row, int col, int button, const TQPoint &mousePos ); + void doubleClicked( int row, int col, int button, const TQPoint &mousePos ); + void pressed( int row, int col, int button, const TQPoint &mousePos ); + void selectionChanged(); + void valueChanged( int row, int col ); + void contextMenuRequested( int row, int col, const TQPoint &pos ); +#ifndef QT_NO_DRAGANDDROP + void dropped( TQDropEvent *e ); +#endif + +private slots: + void doAutoScroll(); + void doValueChanged(); + void updateGeometriesSlot(); + +private: + void contentsMousePressEventEx( TQMouseEvent* ); + void drawContents( TQPainter* ); + void updateGeometries(); + void repaintSelections( TQTableSelection *oldSelection, + TQTableSelection *newSelection, + bool updateVertical = TRUE, + bool updateHorizontal = TRUE ); + TQRect rangeGeometry( int topRow, int leftCol, + int bottomRow, int rightCol, bool &optimize ); + void fixRow( int &row, int y ); + void fixCol( int &col, int x ); + + void init( int numRows, int numCols ); + TQSize tableSize() const; + void repaintCell( int row, int col ); + void contentsToViewport2( int x, int y, int& vx, int& vy ); + TQPoint contentsToViewport2( const TQPoint &p ); + void viewportToContents2( int vx, int vy, int& x, int& y ); + TQPoint viewportToContents2( const TQPoint &p ); + + void updateRowWidgets( int row ); + void updateColWidgets( int col ); + bool isSelected( int row, int col, bool includeCurrent ) const; + void setCurrentCell( int row, int col, bool updateSelections, bool ensureVisible = FALSE ); + void fixCell( int &row, int &col, int key ); + void delayedUpdateGeometries(); + struct TableWidget + { + TableWidget( TQWidget *w, int r, int c ) : wid( w ), row( r ), col ( c ) {} + TQWidget *wid; + int row, col; + }; + void saveContents( TQPtrVector &tmp, + TQPtrVector &tmp2 ); + void updateHeaderAndResizeContents( TQTableHeader *header, + int num, int colRow, + int width, bool &updateBefore ); + void restoreContents( TQPtrVector &tmp, + TQPtrVector &tmp2 ); + void finishContentsResze( bool updateBefore ); + +private: + TQPtrVector contents; + TQPtrVector widgets; + int curRow; + int curCol; + TQTableHeader *leftHeader, *topHeader; + EditMode edMode; + int editCol, editRow; + TQPtrList selections; + TQTableSelection *currentSel; + TQTimer *autoScrollTimer; + int lastSortCol; + bool sGrid : 1; + bool mRows : 1; + bool mCols : 1; + bool asc : 1; + bool doSort : 1; + bool unused : 1; + bool readOnly : 1; + bool shouldClearSelection : 1; + bool dEnabled : 1; + bool context_menu : 1; + bool drawActiveSelection : 1; + bool was_visible : 1; + SelectionMode selMode; + int pressedRow, pressedCol; + TQTablePrivate *d; + TQIntDict roRows; + TQIntDict roCols; + int startDragRow; + int startDragCol; + TQPoint dragStartPos; + int oldCurrentRow, oldCurrentCol; + TQWidget *unused_topLeftCorner; //### remove in 4.0 + FocusStyle focusStl; + TQSize unused_cachedSizeHint; // ### remove in 4.0 + +#if defined(Q_DISABLE_COPY) + TQTable( const TQTable & ); + TQTable &operator=( const TQTable & ); +#endif +}; + +#define Q_DEFINED_QTABLE +#include "ntqwinexport.h" +#endif // QT_NO_TABLE +#endif // TABLE_H diff --git a/src/table/qt_table.pri b/src/table/qt_table.pri index c13396389..5a6faafc9 100644 --- a/src/table/qt_table.pri +++ b/src/table/qt_table.pri @@ -1,6 +1,6 @@ # Qt table module table { - HEADERS += $$TABLE_H/qtable.h + HEADERS += $$TABLE_H/ntqtable.h SOURCES += $$TABLE_CPP/qtable.cpp } diff --git a/src/table/qtable.cpp b/src/table/qtable.cpp index 5f8ba78a0..4695d09ac 100644 --- a/src/table/qtable.cpp +++ b/src/table/qtable.cpp @@ -38,31 +38,31 @@ ** **********************************************************************/ -#include "qglobal.h" +#include "ntqglobal.h" #if defined(Q_CC_BOR) // needed for qsort() because of a std namespace problem on Borland #include "qplatformdefs.h" #endif -#include "qtable.h" +#include "ntqtable.h" #ifndef QT_NO_TABLE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -1700,7 +1700,7 @@ TQSize TQCheckTableItem::sizeHint() const 1, although row and column numbers within TQTable begin at 0.) If you want to use mouse tracking call setMouseTracking( TRUE ) on - the \e viewport; (see \link qscrollview.html#allviews + the \e viewport; (see \link ntqscrollview.html#allviews TQScrollView\endlink). \img qtableitems.png Table Items diff --git a/src/table/qtable.h b/src/table/qtable.h deleted file mode 100644 index 1f4f7bac1..000000000 --- a/src/table/qtable.h +++ /dev/null @@ -1,564 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTable widget class -** -** Created : 000607 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the table module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTABLE_H -#define TQTABLE_H - -#ifndef QT_H -#include "qscrollview.h" -#include "qpixmap.h" -#include "qptrvector.h" -#include "qheader.h" -#include "qmemarray.h" -#include "qptrlist.h" -#include "qguardedptr.h" -#include "qshared.h" -#include "qintdict.h" -#include "qstringlist.h" -#endif // QT_H - - -#ifndef QT_NO_TABLE - -#if !defined( QT_MODULE_TABLE ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_TABLE ) -#define TQM_EXPORT_TABLE -#ifndef TQM_TEMPLATE_EXTERN_TABLE -# define TQM_TEMPLATE_EXTERN_TABLE -#endif -#else -#define TQM_EXPORT_TABLE Q_EXPORT -#define TQM_TEMPLATE_EXTERN_TABLE Q_TEMPLATE_EXTERN -#endif - -class TQTableHeader; -class TQValidator; -class TQTable; -class TQPaintEvent; -class TQTimer; -class TQResizeEvent; -class TQComboBox; -class TQCheckBox; -class TQDragObject; - -struct TQTablePrivate; -struct TQTableHeaderPrivate; - - -class TQM_EXPORT_TABLE TQTableSelection -{ -public: - TQTableSelection(); - TQTableSelection( int start_row, int start_col, int end_row, int end_col ); - void init( int row, int col ); - void expandTo( int row, int col ); - bool operator==( const TQTableSelection &s ) const; - bool operator!=( const TQTableSelection &s ) const { return !(operator==(s)); } - - int topRow() const { return tRow; } - int bottomRow() const { return bRow; } - int leftCol() const { return lCol; } - int rightCol() const { return rCol; } - int anchorRow() const { return aRow; } - int anchorCol() const { return aCol; } - int numRows() const; - int numCols() const; - - bool isActive() const { return active; } - bool isEmpty() const { return numRows() == 0; } - -private: - uint active : 1; - uint inited : 1; - int tRow, lCol, bRow, rCol; - int aRow, aCol; -}; - -#define Q_DEFINED_QTABLE_SELECTION -#include "qwinexport.h" - -class TQM_EXPORT_TABLE TQTableItem : public TQt -{ - friend class TQTable; - -public: - enum EditType { Never, OnTyping, WhenCurrent, Always }; - - TQTableItem( TQTable *table, EditType et ); - TQTableItem( TQTable *table, EditType et, const TQString &text ); - TQTableItem( TQTable *table, EditType et, const TQString &text, - const TQPixmap &p ); - virtual ~TQTableItem(); - - virtual TQPixmap pixmap() const; - virtual TQString text() const; - virtual void setPixmap( const TQPixmap &p ); - virtual void setText( const TQString &t ); - TQTable *table() const { return t; } - - virtual int alignment() const; - virtual void setWordWrap( bool b ); - bool wordWrap() const; - - EditType editType() const; - virtual TQWidget *createEditor() const; - virtual void setContentFromEditor( TQWidget *w ); - virtual void setReplaceable( bool ); - bool isReplaceable() const; - - virtual TQString key() const; - virtual TQSize sizeHint() const; - - virtual void setSpan( int rs, int cs ); - int rowSpan() const; - int colSpan() const; - - virtual void setRow( int r ); - virtual void setCol( int c ); - int row() const; - int col() const; - - virtual void paint( TQPainter *p, const TQColorGroup &cg, - const TQRect &cr, bool selected ); - - void updateEditor( int oldRow, int oldCol ); - - virtual void setEnabled( bool b ); - bool isEnabled() const; - - virtual int rtti() const; - static int RTTI; - -private: - TQString txt; - TQPixmap pix; - TQTable *t; - EditType edType; - uint wordwrap : 1; - uint tcha : 1; - uint enabled : 1; - int rw, cl; - int rowspan, colspan; -#if (QT_VERSION >= 0x040000) -#error "Add a setAlignment() function in 4.0 (but no d pointer)" -#endif -}; - -#define Q_DEFINED_QTABLE_ITEM -#include "qwinexport.h" - -class TQM_EXPORT_TABLE TQComboTableItem : public TQTableItem -{ -public: - TQComboTableItem( TQTable *table, const TQStringList &list, bool editable = FALSE ); - ~TQComboTableItem(); - virtual TQWidget *createEditor() const; - virtual void setContentFromEditor( TQWidget *w ); - virtual void paint( TQPainter *p, const TQColorGroup &cg, - const TQRect &cr, bool selected ); - virtual void setCurrentItem( int i ); - virtual void setCurrentItem( const TQString &i ); - int currentItem() const; - TQString currentText() const; - int count() const; -#if !defined(Q_NO_USING_KEYWORD) - using TQTableItem::text; -#endif - TQString text( int i ) const; - virtual void setEditable( bool b ); - bool isEditable() const; - virtual void setStringList( const TQStringList &l ); - - int rtti() const; - static int RTTI; - - TQSize sizeHint() const; - -private: - TQComboBox *cb; - TQStringList entries; - int current; - bool edit; - static TQComboBox *fakeCombo; - static TQWidget *fakeComboWidget; - static int fakeRef; - -}; - -class TQM_EXPORT_TABLE TQCheckTableItem : public TQTableItem -{ -public: - TQCheckTableItem( TQTable *table, const TQString &txt ); - void setText( const TQString &t ); - virtual TQWidget *createEditor() const; - virtual void setContentFromEditor( TQWidget *w ); - virtual void paint( TQPainter *p, const TQColorGroup &cg, - const TQRect &cr, bool selected ); - virtual void setChecked( bool b ); - bool isChecked() const; - - int rtti() const; - static int RTTI; - - TQSize sizeHint() const; - -private: - TQCheckBox *cb; - bool checked; - -}; - -class TQM_EXPORT_TABLE TQTable : public TQScrollView -{ - Q_OBJECT - Q_ENUMS( SelectionMode FocusStyle ) - Q_PROPERTY( int numRows READ numRows WRITE setNumRows ) - Q_PROPERTY( int numCols READ numCols WRITE setNumCols ) - Q_PROPERTY( bool showGrid READ showGrid WRITE setShowGrid ) - Q_PROPERTY( bool rowMovingEnabled READ rowMovingEnabled WRITE setRowMovingEnabled ) - Q_PROPERTY( bool columnMovingEnabled READ columnMovingEnabled WRITE setColumnMovingEnabled ) - Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) - Q_PROPERTY( bool sorting READ sorting WRITE setSorting ) - Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) - Q_PROPERTY( FocusStyle focusStyle READ focusStyle WRITE setFocusStyle ) - Q_PROPERTY( int numSelections READ numSelections ) - - friend class TQTableHeader; - friend class TQComboTableItem; - friend class TQCheckTableItem; - friend class TQTableItem; - -public: - TQTable( TQWidget* parent=0, const char* name=0 ); - TQTable( int numRows, int numCols, - TQWidget* parent=0, const char* name=0 ); - ~TQTable(); - - TQHeader *horizontalHeader() const; - TQHeader *verticalHeader() const; - - enum SelectionMode { Single, Multi, SingleRow, MultiRow, NoSelection }; - virtual void setSelectionMode( SelectionMode mode ); - SelectionMode selectionMode() const; - - virtual void setItem( int row, int col, TQTableItem *item ); - virtual void setText( int row, int col, const TQString &text ); - virtual void setPixmap( int row, int col, const TQPixmap &pix ); - virtual TQTableItem *item( int row, int col ) const; - virtual TQString text( int row, int col ) const; - virtual TQPixmap pixmap( int row, int col ) const; - virtual void clearCell( int row, int col ); - - virtual TQRect cellGeometry( int row, int col ) const; - virtual int columnWidth( int col ) const; - virtual int rowHeight( int row ) const; - virtual int columnPos( int col ) const; - virtual int rowPos( int row ) const; - virtual int columnAt( int x ) const; - virtual int rowAt( int y ) const; - - virtual int numRows() const; - virtual int numCols() const; - - void updateCell( int row, int col ); - - bool eventFilter( TQObject * o, TQEvent * ); - - int currentRow() const { return curRow; } - int currentColumn() const { return curCol; } - void ensureCellVisible( int row, int col ); - - bool isSelected( int row, int col ) const; - bool isRowSelected( int row, bool full = FALSE ) const; - bool isColumnSelected( int col, bool full = FALSE ) const; - int numSelections() const; - TQTableSelection selection( int num ) const; - virtual int addSelection( const TQTableSelection &s ); - virtual void removeSelection( const TQTableSelection &s ); - virtual void removeSelection( int num ); - virtual int currentSelection() const; - - void selectCells( int start_row, int start_col, int end_row, int end_col ); - void selectRow( int row ); - void selectColumn( int col ); - - bool showGrid() const; - - bool columnMovingEnabled() const; - bool rowMovingEnabled() const; - - virtual void sortColumn( int col, bool ascending = TRUE, - bool wholeRows = FALSE ); - bool sorting() const; - - virtual void takeItem( TQTableItem *i ); - - virtual void setCellWidget( int row, int col, TQWidget *e ); - virtual TQWidget *cellWidget( int row, int col ) const; - virtual void clearCellWidget( int row, int col ); - - virtual TQRect cellRect( int row, int col ) const; - - virtual void paintCell( TQPainter *p, int row, int col, - const TQRect &cr, bool selected ); - virtual void paintCell( TQPainter *p, int row, int col, - const TQRect &cr, bool selected, const TQColorGroup &cg ); - virtual void paintFocus( TQPainter *p, const TQRect &r ); - TQSize sizeHint() const; - - bool isReadOnly() const; - bool isRowReadOnly( int row ) const; - bool isColumnReadOnly( int col ) const; - - void setEnabled( bool b ); - - void repaintSelections(); - - enum FocusStyle { FollowStyle, SpreadSheet }; - virtual void setFocusStyle( FocusStyle fs ); - FocusStyle focusStyle() const; - - void updateHeaderStates(); - -public slots: - virtual void setNumRows( int r ); - virtual void setNumCols( int r ); - virtual void setShowGrid( bool b ); - virtual void hideRow( int row ); - virtual void hideColumn( int col ); - virtual void showRow( int row ); - virtual void showColumn( int col ); - bool isRowHidden( int row ) const; - bool isColumnHidden( int col ) const; - - virtual void setColumnWidth( int col, int w ); - virtual void setRowHeight( int row, int h ); - - virtual void adjustColumn( int col ); - virtual void adjustRow( int row ); - - virtual void setColumnStretchable( int col, bool stretch ); - virtual void setRowStretchable( int row, bool stretch ); - bool isColumnStretchable( int col ) const; - bool isRowStretchable( int row ) const; - virtual void setSorting( bool b ); - virtual void swapRows( int row1, int row2, bool swapHeader = FALSE ); - virtual void swapColumns( int col1, int col2, bool swapHeader = FALSE ); - virtual void swapCells( int row1, int col1, int row2, int col2 ); - - virtual void setLeftMargin( int m ); - virtual void setTopMargin( int m ); - virtual void setCurrentCell( int row, int col ); - void clearSelection( bool repaint = TRUE ); - virtual void setColumnMovingEnabled( bool b ); - virtual void setRowMovingEnabled( bool b ); - - virtual void setReadOnly( bool b ); - virtual void setRowReadOnly( int row, bool ro ); - virtual void setColumnReadOnly( int col, bool ro ); - - virtual void setDragEnabled( bool b ); - bool dragEnabled() const; - - virtual void insertRows( int row, int count = 1 ); - virtual void insertColumns( int col, int count = 1 ); - virtual void removeRow( int row ); - virtual void removeRows( const TQMemArray &rows ); - virtual void removeColumn( int col ); - virtual void removeColumns( const TQMemArray &cols ); - - virtual void editCell( int row, int col, bool replace = FALSE ); - - void setRowLabels( const TQStringList &labels ); - void setColumnLabels( const TQStringList &labels ); - -protected: - enum EditMode { NotEditing, Editing, Replacing }; - void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); - void contentsMousePressEvent( TQMouseEvent* ); - void contentsMouseMoveEvent( TQMouseEvent* ); - void contentsMouseDoubleClickEvent( TQMouseEvent* ); - void contentsMouseReleaseEvent( TQMouseEvent* ); - void contentsContextMenuEvent( TQContextMenuEvent * e ); - void keyPressEvent( TQKeyEvent* ); - void focusInEvent( TQFocusEvent* ); - void focusOutEvent( TQFocusEvent* ); - void viewportResizeEvent( TQResizeEvent * ); - void showEvent( TQShowEvent *e ); - void paintEvent( TQPaintEvent *e ); - void setEditMode( EditMode mode, int row, int col ); -#ifndef QT_NO_DRAGANDDROP - virtual void contentsDragEnterEvent( TQDragEnterEvent *e ); - virtual void contentsDragMoveEvent( TQDragMoveEvent *e ); - virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e ); - virtual void contentsDropEvent( TQDropEvent *e ); - virtual TQDragObject *dragObject(); - virtual void startDrag(); -#endif - - virtual void paintEmptyArea( TQPainter *p, int cx, int cy, int cw, int ch ); - virtual void activateNextCell(); - virtual TQWidget *createEditor( int row, int col, bool initFromCell ) const; - virtual void setCellContentFromEditor( int row, int col ); - virtual TQWidget *beginEdit( int row, int col, bool replace ); - virtual void endEdit( int row, int col, bool accept, bool replace ); - - virtual void resizeData( int len ); - virtual void insertWidget( int row, int col, TQWidget *w ); - int indexOf( int row, int col ) const; - - void windowActivationChange( bool ); - bool isEditing() const; - EditMode editMode() const; - int currEditRow() const; - int currEditCol() const; - -protected slots: - virtual void columnWidthChanged( int col ); - virtual void rowHeightChanged( int row ); - virtual void columnIndexChanged( int section, int fromIndex, int toIndex ); - virtual void rowIndexChanged( int section, int fromIndex, int toIndex ); - virtual void columnClicked( int col ); - -signals: - void currentChanged( int row, int col ); - void clicked( int row, int col, int button, const TQPoint &mousePos ); - void doubleClicked( int row, int col, int button, const TQPoint &mousePos ); - void pressed( int row, int col, int button, const TQPoint &mousePos ); - void selectionChanged(); - void valueChanged( int row, int col ); - void contextMenuRequested( int row, int col, const TQPoint &pos ); -#ifndef QT_NO_DRAGANDDROP - void dropped( TQDropEvent *e ); -#endif - -private slots: - void doAutoScroll(); - void doValueChanged(); - void updateGeometriesSlot(); - -private: - void contentsMousePressEventEx( TQMouseEvent* ); - void drawContents( TQPainter* ); - void updateGeometries(); - void repaintSelections( TQTableSelection *oldSelection, - TQTableSelection *newSelection, - bool updateVertical = TRUE, - bool updateHorizontal = TRUE ); - TQRect rangeGeometry( int topRow, int leftCol, - int bottomRow, int rightCol, bool &optimize ); - void fixRow( int &row, int y ); - void fixCol( int &col, int x ); - - void init( int numRows, int numCols ); - TQSize tableSize() const; - void repaintCell( int row, int col ); - void contentsToViewport2( int x, int y, int& vx, int& vy ); - TQPoint contentsToViewport2( const TQPoint &p ); - void viewportToContents2( int vx, int vy, int& x, int& y ); - TQPoint viewportToContents2( const TQPoint &p ); - - void updateRowWidgets( int row ); - void updateColWidgets( int col ); - bool isSelected( int row, int col, bool includeCurrent ) const; - void setCurrentCell( int row, int col, bool updateSelections, bool ensureVisible = FALSE ); - void fixCell( int &row, int &col, int key ); - void delayedUpdateGeometries(); - struct TableWidget - { - TableWidget( TQWidget *w, int r, int c ) : wid( w ), row( r ), col ( c ) {} - TQWidget *wid; - int row, col; - }; - void saveContents( TQPtrVector &tmp, - TQPtrVector &tmp2 ); - void updateHeaderAndResizeContents( TQTableHeader *header, - int num, int colRow, - int width, bool &updateBefore ); - void restoreContents( TQPtrVector &tmp, - TQPtrVector &tmp2 ); - void finishContentsResze( bool updateBefore ); - -private: - TQPtrVector contents; - TQPtrVector widgets; - int curRow; - int curCol; - TQTableHeader *leftHeader, *topHeader; - EditMode edMode; - int editCol, editRow; - TQPtrList selections; - TQTableSelection *currentSel; - TQTimer *autoScrollTimer; - int lastSortCol; - bool sGrid : 1; - bool mRows : 1; - bool mCols : 1; - bool asc : 1; - bool doSort : 1; - bool unused : 1; - bool readOnly : 1; - bool shouldClearSelection : 1; - bool dEnabled : 1; - bool context_menu : 1; - bool drawActiveSelection : 1; - bool was_visible : 1; - SelectionMode selMode; - int pressedRow, pressedCol; - TQTablePrivate *d; - TQIntDict roRows; - TQIntDict roCols; - int startDragRow; - int startDragCol; - TQPoint dragStartPos; - int oldCurrentRow, oldCurrentCol; - TQWidget *unused_topLeftCorner; //### remove in 4.0 - FocusStyle focusStl; - TQSize unused_cachedSizeHint; // ### remove in 4.0 - -#if defined(Q_DISABLE_COPY) - TQTable( const TQTable & ); - TQTable &operator=( const TQTable & ); -#endif -}; - -#define Q_DEFINED_QTABLE -#include "qwinexport.h" -#endif // QT_NO_TABLE -#endif // TABLE_H diff --git a/src/tools/ntqasciicache.h b/src/tools/ntqasciicache.h new file mode 100644 index 000000000..7323635c6 --- /dev/null +++ b/src/tools/ntqasciicache.h @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Definition of TQAsciiCache template/macro class +** +** Created : 950209 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQASCIICACHE_H +#define TQASCIICACHE_H + +#ifndef QT_H +#include "ntqgcache.h" +#endif // QT_H + + +template +class TQAsciiCache +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGCache +#endif +{ +public: + TQAsciiCache( const TQAsciiCache &c ) : TQGCache(c) {} + TQAsciiCache( int maxCost=100, int size=17, bool caseSensitive=TRUE, + bool copyKeys=TRUE ) + : TQGCache( maxCost, size, AsciiKey, caseSensitive, copyKeys ) {} + ~TQAsciiCache() { clear(); } + TQAsciiCache &operator=( const TQAsciiCache &c ) + { return (TQAsciiCache&)TQGCache::operator=(c); } + int maxCost() const { return TQGCache::maxCost(); } + int totalCost() const { return TQGCache::totalCost(); } + void setMaxCost( int m ) { TQGCache::setMaxCost(m); } + uint count() const { return TQGCache::count(); } + uint size() const { return TQGCache::size(); } + bool isEmpty() const { return TQGCache::count() == 0; } + void clear() { TQGCache::clear(); } + bool insert( const char *k, const type *d, int c=1, int p=0 ) + { return TQGCache::insert_other(k,(Item)d,c,p);} + bool remove( const char *k ) + { return TQGCache::remove_other(k); } + type *take( const char *k ) + { return (type *)TQGCache::take_other(k); } + type *find( const char *k, bool ref=TRUE ) const + { return (type *)TQGCache::find_other(k,ref);} + type *operator[]( const char *k ) const + { return (type *)TQGCache::find_other(k);} + void statistics() const { TQGCache::statistics(); } +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQAsciiCache::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQAsciiCache::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + + +template +class TQAsciiCacheIterator : public TQGCacheIterator +{ +public: + TQAsciiCacheIterator( const TQAsciiCache &c ):TQGCacheIterator((TQGCache &)c) {} + TQAsciiCacheIterator( const TQAsciiCacheIterator &ci) + : TQGCacheIterator( (TQGCacheIterator &)ci ) {} + TQAsciiCacheIterator &operator=(const TQAsciiCacheIterator&ci) + { return ( TQAsciiCacheIterator&)TQGCacheIterator::operator=( ci ); } + uint count() const { return TQGCacheIterator::count(); } + bool isEmpty() const { return TQGCacheIterator::count() == 0; } + bool atFirst() const { return TQGCacheIterator::atFirst(); } + bool atLast() const { return TQGCacheIterator::atLast(); } + type *toFirst() { return (type *)TQGCacheIterator::toFirst(); } + type *toLast() { return (type *)TQGCacheIterator::toLast(); } + operator type *() const { return (type *)TQGCacheIterator::get(); } + type *current() const { return (type *)TQGCacheIterator::get(); } + const char *currentKey() const { return TQGCacheIterator::getKeyAscii(); } + type *operator()() { return (type *)TQGCacheIterator::operator()();} + type *operator++() { return (type *)TQGCacheIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGCacheIterator::operator+=(j);} + type *operator--() { return (type *)TQGCacheIterator::operator--(); } + type *operator-=(uint j) { return (type *)TQGCacheIterator::operator-=(j);} +}; + + +#endif // TQASCIICACHE_H diff --git a/src/tools/ntqasciidict.h b/src/tools/ntqasciidict.h new file mode 100644 index 000000000..ef09bc025 --- /dev/null +++ b/src/tools/ntqasciidict.h @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Definition of TQAsciiDict template class +** +** Created : 920821 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQASCIIDICT_H +#define TQASCIIDICT_H + +#ifndef QT_H +#include "ntqgdict.h" +#endif // QT_H + +template +class TQAsciiDict +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGDict +#endif +{ +public: + TQAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE ) + : TQGDict(size,AsciiKey,caseSensitive,copyKeys) {} + TQAsciiDict( const TQAsciiDict &d ) : TQGDict(d) {} + ~TQAsciiDict() { clear(); } + TQAsciiDict &operator=(const TQAsciiDict &d) + { return (TQAsciiDict&)TQGDict::operator=(d); } + uint count() const { return TQGDict::count(); } + uint size() const { return TQGDict::size(); } + bool isEmpty() const { return TQGDict::count() == 0; } + + void insert( const char *k, const type *d ) + { TQGDict::look_ascii(k,(Item)d,1); } + void replace( const char *k, const type *d ) + { TQGDict::look_ascii(k,(Item)d,2); } + bool remove( const char *k ) { return TQGDict::remove_ascii(k); } + type *take( const char *k ) { return (type *)TQGDict::take_ascii(k); } + type *find( const char *k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_ascii(k,0,0); } + type *operator[]( const char *k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_ascii(k,0,0); } + + void clear() { TQGDict::clear(); } + void resize( uint n ) { TQGDict::resize(n); } + void statistics() const { TQGDict::statistics(); } + +#ifdef Q_QDOC +protected: + virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); + virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQAsciiDict::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQAsciiDict::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class TQAsciiDictIterator : public TQGDictIterator +{ +public: + TQAsciiDictIterator(const TQAsciiDict &d) + : TQGDictIterator((TQGDict &)d) {} + ~TQAsciiDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)TQGDictIterator::toFirst(); } + operator type *() const { return (type *)TQGDictIterator::get(); } + type *current() const { return (type *)TQGDictIterator::get(); } + const char *currentKey() const { return TQGDictIterator::getKeyAscii(); } + type *operator()() { return (type *)TQGDictIterator::operator()(); } + type *operator++() { return (type *)TQGDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j);} +}; + +#define Q_DEFINED_QASCIIDICT +#include "ntqwinexport.h" +#endif // TQASCIIDICT_H diff --git a/src/tools/ntqbitarray.h b/src/tools/ntqbitarray.h new file mode 100644 index 000000000..45a022e6d --- /dev/null +++ b/src/tools/ntqbitarray.h @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** Definition of TQBitArray class +** +** Created : 940118 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQBITARRAY_H +#define TQBITARRAY_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + + +/***************************************************************************** + TQBitVal class; a context class for TQBitArray::operator[] + *****************************************************************************/ + +class TQBitArray; + +class Q_EXPORT TQBitVal +{ +private: + TQBitArray *array; + uint index; +public: + TQBitVal( TQBitArray *a, uint i ) : array(a), index(i) {} + operator int(); + TQBitVal &operator=( const TQBitVal &v ); + TQBitVal &operator=( bool v ); +}; + + +/***************************************************************************** + TQBitArray class + *****************************************************************************/ + +class Q_EXPORT TQBitArray : public TQByteArray +{ +public: + TQBitArray(); + TQBitArray( uint size ); + TQBitArray( const TQBitArray &a ) : TQByteArray( a ) {} + + TQBitArray &operator=( const TQBitArray & ); + + uint size() const; + bool resize( uint size ); + + bool fill( bool v, int size = -1 ); + + void detach(); + TQBitArray copy() const; + + bool testBit( uint index ) const; + void setBit( uint index ); + void setBit( uint index, bool value ); + void clearBit( uint index ); + bool toggleBit( uint index ); + + bool at( uint index ) const; + TQBitVal operator[]( int index ); + bool operator[]( int index ) const; + + TQBitArray &operator&=( const TQBitArray & ); + TQBitArray &operator|=( const TQBitArray & ); + TQBitArray &operator^=( const TQBitArray & ); + TQBitArray operator~() const; + +protected: + struct bitarr_data : public TQGArray::array_data { + uint nbits; + }; + array_data *newData() { return new bitarr_data; } + void deleteData( array_data *d ) { delete (bitarr_data*)d; } +private: + void pad0(); +}; + + +inline TQBitArray &TQBitArray::operator=( const TQBitArray &a ) +{ return (TQBitArray&)assign( a ); } + +inline uint TQBitArray::size() const +{ return ((bitarr_data*)sharedBlock())->nbits; } + +inline void TQBitArray::setBit( uint index, bool value ) +{ if ( value ) setBit(index); else clearBit(index); } + +inline bool TQBitArray::at( uint index ) const +{ return testBit(index); } + +inline TQBitVal TQBitArray::operator[]( int index ) +{ return TQBitVal( (TQBitArray*)this, index ); } + +inline bool TQBitArray::operator[]( int index ) const +{ return testBit( index ); } + + +/***************************************************************************** + Misc. TQBitArray operator functions + *****************************************************************************/ + +Q_EXPORT TQBitArray operator&( const TQBitArray &, const TQBitArray & ); +Q_EXPORT TQBitArray operator|( const TQBitArray &, const TQBitArray & ); +Q_EXPORT TQBitArray operator^( const TQBitArray &, const TQBitArray & ); + + +inline TQBitVal::operator int() +{ + return array->testBit( index ); +} + +inline TQBitVal &TQBitVal::operator=( const TQBitVal &v ) +{ + array->setBit( index, v.array->testBit(v.index) ); + return *this; +} + +inline TQBitVal &TQBitVal::operator=( bool v ) +{ + array->setBit( index, v ); + return *this; +} + + +/***************************************************************************** + TQBitArray stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQBitArray & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQBitArray & ); +#endif + +#endif // TQBITARRAY_H diff --git a/src/tools/ntqbuffer.h b/src/tools/ntqbuffer.h new file mode 100644 index 000000000..ba5aea33b --- /dev/null +++ b/src/tools/ntqbuffer.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Definition of TQBuffer class +** +** Created : 930812 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQBUFFER_H +#define TQBUFFER_H + +#ifndef QT_H +#include "ntqiodevice.h" +#include "ntqstring.h" +#endif // QT_H + + +class Q_EXPORT TQBuffer : public TQIODevice +{ +public: + TQBuffer(); + TQBuffer( TQByteArray ); + ~TQBuffer(); + + TQByteArray buffer() const; + bool setBuffer( TQByteArray ); + + bool open( int ); + void close(); + void flush(); + + Offset size() const; + Offset at() const; + bool at( Offset ); + + Q_LONG readBlock( char *p, Q_ULONG ); + Q_LONG writeBlock( const char *p, Q_ULONG ); + Q_LONG writeBlock( const TQByteArray& data ) + { return TQIODevice::writeBlock(data); } + Q_LONG readLine( char *p, Q_ULONG ); + + int getch(); + int putch( int ); + int ungetch( int ); + +protected: + TQByteArray a; + +private: + uint a_len; + uint a_inc; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQBuffer( const TQBuffer & ); + TQBuffer &operator=( const TQBuffer & ); +#endif +}; + + +inline TQByteArray TQBuffer::buffer() const +{ return a; } + +inline TQIODevice::Offset TQBuffer::size() const +{ return (Offset)a.size(); } + +inline TQIODevice::Offset TQBuffer::at() const +{ return ioIndex; } + + +#endif // TQBUFFER_H diff --git a/src/tools/ntqcache.h b/src/tools/ntqcache.h new file mode 100644 index 000000000..9d747e346 --- /dev/null +++ b/src/tools/ntqcache.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Definition of TQCache template class +** +** Created : 950209 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCACHE_H +#define TQCACHE_H + +#ifndef QT_H +#include "ntqgcache.h" +#endif // QT_H + +template +class TQCache +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGCache +#endif +{ +public: + TQCache( const TQCache &c ) : TQGCache(c) {} + TQCache( int maxCost=100, int size=17, bool caseSensitive=TRUE ) + : TQGCache( maxCost, size, StringKey, caseSensitive, FALSE ) {} + ~TQCache() { clear(); } + TQCache &operator=( const TQCache &c ) + { return (TQCache&)TQGCache::operator=(c); } + int maxCost() const { return TQGCache::maxCost(); } + int totalCost() const { return TQGCache::totalCost(); } + void setMaxCost( int m ) { TQGCache::setMaxCost(m); } + uint count() const { return TQGCache::count(); } + uint size() const { return TQGCache::size(); } + bool isEmpty() const { return TQGCache::count() == 0; } + void clear() { TQGCache::clear(); } + bool insert( const TQString &k, const type *d, int c=1, int p=0 ) + { return TQGCache::insert_string(k,(Item)d,c,p);} + bool remove( const TQString &k ) + { return TQGCache::remove_string(k); } + type *take( const TQString &k ) + { return (type *)TQGCache::take_string(k); } + type *find( const TQString &k, bool ref=TRUE ) const + { return (type *)TQGCache::find_string(k,ref);} + type *operator[]( const TQString &k ) const + { return (type *)TQGCache::find_string(k);} + void statistics() const { TQGCache::statistics(); } +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQCache::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQCache::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class TQCacheIterator : public TQGCacheIterator +{ +public: + TQCacheIterator( const TQCache &c ):TQGCacheIterator((TQGCache &)c) {} + TQCacheIterator( const TQCacheIterator &ci) + : TQGCacheIterator( (TQGCacheIterator &)ci ) {} + TQCacheIterator &operator=(const TQCacheIterator&ci) + { return ( TQCacheIterator&)TQGCacheIterator::operator=( ci ); } + uint count() const { return TQGCacheIterator::count(); } + bool isEmpty() const { return TQGCacheIterator::count() == 0; } + bool atFirst() const { return TQGCacheIterator::atFirst(); } + bool atLast() const { return TQGCacheIterator::atLast(); } + type *toFirst() { return (type *)TQGCacheIterator::toFirst(); } + type *toLast() { return (type *)TQGCacheIterator::toLast(); } + operator type *() const { return (type *)TQGCacheIterator::get(); } + type *current() const { return (type *)TQGCacheIterator::get(); } + TQString currentKey() const{ return TQGCacheIterator::getKeyString(); } + type *operator()() { return (type *)TQGCacheIterator::operator()();} + type *operator++() { return (type *)TQGCacheIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGCacheIterator::operator+=(j);} + type *operator--() { return (type *)TQGCacheIterator::operator--(); } + type *operator-=(uint j) { return (type *)TQGCacheIterator::operator-=(j);} +}; + +#endif // TQCACHE_H diff --git a/src/tools/ntqcleanuphandler.h b/src/tools/ntqcleanuphandler.h new file mode 100644 index 000000000..e1dc339b3 --- /dev/null +++ b/src/tools/ntqcleanuphandler.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** ... +** +** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCLEANUPHANDLER_H +#define TQCLEANUPHANDLER_H + +#ifndef QT_H +#include "ntqptrlist.h" +#endif // QT_H + +template +class TQCleanupHandler +{ +public: + TQCleanupHandler() : cleanupObjects( 0 ) {} + ~TQCleanupHandler() { clear(); } + + Type* add( Type **object ) { + if ( !cleanupObjects ) + cleanupObjects = new TQPtrList; + cleanupObjects->insert( 0, object ); + return *object; + } + + void remove( Type **object ) { + if ( !cleanupObjects ) + return; + if ( cleanupObjects->findRef( object ) >= 0 ) + (void) cleanupObjects->take(); + } + + bool isEmpty() const { + return cleanupObjects ? cleanupObjects->isEmpty() : TRUE; + } + + void clear() { + if ( !cleanupObjects ) + return; + TQPtrListIterator it( *cleanupObjects ); + Type **object; + while ( ( object = it.current() ) ) { + delete *object; + *object = 0; + cleanupObjects->remove( object ); + } + delete cleanupObjects; + cleanupObjects = 0; + } + +private: + TQPtrList *cleanupObjects; +}; + +template +class TQSingleCleanupHandler +{ +public: + TQSingleCleanupHandler() : object( 0 ) {} + ~TQSingleCleanupHandler() { + if ( object ) { + delete *object; + *object = 0; + } + } + Type* set( Type **o ) { + object = o; + return *object; + } + void reset() { object = 0; } +private: + Type **object; +}; + +template +class TQSharedCleanupHandler +{ +public: + TQSharedCleanupHandler() : object( 0 ) {} + ~TQSharedCleanupHandler() { + if ( object ) { + if ( (*object)->deref() ) + delete *object; + *object = 0; + } + } + Type* set( Type **o ) { + object = o; + return *object; + } + void reset() { object = 0; } +private: + Type **object; +}; + +#endif //TQCLEANUPHANDLER_H diff --git a/src/tools/ntqcstring.h b/src/tools/ntqcstring.h new file mode 100644 index 000000000..f3893f63e --- /dev/null +++ b/src/tools/ntqcstring.h @@ -0,0 +1,396 @@ +/**************************************************************************** +** +** Definition of the extended char array operations, +** and TQByteArray and TQCString classes +** +** Created : 920609 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCSTRING_H +#define TQCSTRING_H + +#ifndef QT_H +#include "ntqmemarray.h" +#endif // QT_H + +#include + + +/***************************************************************************** + Safe and portable C string functions; extensions to standard string.h + *****************************************************************************/ + +Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); + +Q_EXPORT char *qstrdup( const char * ); + +Q_EXPORT inline uint qstrlen( const char *str ) +{ return str ? (uint)strlen(str) : 0u; } + +Q_EXPORT inline char *qstrcpy( char *dst, const char *src ) +{ return src ? strcpy(dst, src) : 0; } + +Q_EXPORT char *qstrncpy( char *dst, const char *src, uint len ); + +Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 ) +{ + return ( str1 && str2 ) ? strcmp( str1, str2 ) + : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); +} + +Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len ) +{ + return ( str1 && str2 ) ? strncmp( str1, str2, len ) + : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); +} + +Q_EXPORT int qstricmp( const char *, const char * ); + +Q_EXPORT int qstrnicmp( const char *, const char *, uint len ); + +#ifndef QT_CLEAN_NAMESPACE +Q_EXPORT inline uint cstrlen( const char *str ) +{ return (uint)strlen(str); } + +Q_EXPORT inline char *cstrcpy( char *dst, const char *src ) +{ return strcpy(dst,src); } + +Q_EXPORT inline int cstrcmp( const char *str1, const char *str2 ) +{ return strcmp(str1,str2); } + +Q_EXPORT inline int cstrncmp( const char *str1, const char *str2, uint len ) +{ return strncmp(str1,str2,len); } +#endif + + +// qChecksum: Internet checksum + +Q_EXPORT Q_UINT16 qChecksum( const char *s, uint len ); + +/***************************************************************************** + TQByteArray class + *****************************************************************************/ + +#if defined(Q_QDOC) +/* + We want qdoc to document TQByteArray as a real class that inherits + TQMemArray and that is inherited by TQBitArray. +*/ +class TQByteArray : public TQMemArray +{ +public: + TQByteArray(); + TQByteArray( int size ); +}; +#else +typedef TQMemArray TQByteArray; +#endif + +#ifndef QT_NO_COMPRESS +Q_EXPORT TQByteArray qCompress( const uchar* data, int nbytes ); +Q_EXPORT TQByteArray qUncompress( const uchar* data, int nbytes ); +Q_EXPORT inline TQByteArray qCompress( const TQByteArray& data) +{ return qCompress( (const uchar*)data.data(), data.size() ); } +Q_EXPORT inline TQByteArray qUncompress( const TQByteArray& data ) +{ return qUncompress( (const uchar*)data.data(), data.size() ); } +#endif + +/***************************************************************************** + TQByteArray stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQByteArray & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQByteArray & ); +#endif + +/***************************************************************************** + TQCString class + *****************************************************************************/ + +class TQRegExp; + +class Q_EXPORT TQCString : public TQByteArray // C string class +{ +public: + TQCString() {} // make null string + TQCString( int size ); // allocate size incl. \0 + TQCString( const TQCString &s ) : TQByteArray( s ) {} + TQCString( const char *str ); // deep copy + TQCString( const char *str, uint maxlen ); // deep copy, max length + ~TQCString(); + + TQCString &operator=( const TQCString &s );// shallow copy + TQCString &operator=( const char *str ); // deep copy + + bool isNull() const; + bool isEmpty() const; + uint length() const; + bool resize( uint newlen ); + bool truncate( uint pos ); + bool fill( char c, int len = -1 ); + + TQCString copy() const; + + TQCString &sprintf( const char *format, ... ) +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 2, 3))) +#endif + ; + + int find( char c, int index=0, bool cs=TRUE ) const; + int find( const char *str, int index=0, bool cs=TRUE ) const; +#ifndef QT_NO_REGEXP + int find( const TQRegExp &, int index=0 ) const; +#endif + int findRev( char c, int index=-1, bool cs=TRUE) const; + int findRev( const char *str, int index=-1, bool cs=TRUE) const; +#ifndef QT_NO_REGEXP_CAPTURE + int findRev( const TQRegExp &, int index=-1 ) const; +#endif + int contains( char c, bool cs=TRUE ) const; + int contains( const char *str, bool cs=TRUE ) const; +#ifndef QT_NO_REGEXP + int contains( const TQRegExp & ) const; +#endif + TQCString left( uint len ) const; + TQCString right( uint len ) const; + TQCString mid( uint index, uint len=0xffffffff) const; + + TQCString leftJustify( uint width, char fill=' ', bool trunc=FALSE)const; + TQCString rightJustify( uint width, char fill=' ',bool trunc=FALSE)const; + + TQCString lower() const; + TQCString upper() const; + + TQCString stripWhiteSpace() const; + TQCString simplifyWhiteSpace() const; + + TQCString &insert( uint index, const char * ); + TQCString &insert( uint index, char ); + TQCString &append( const char * ); + TQCString &prepend( const char * ); + TQCString &remove( uint index, uint len ); + TQCString &replace( uint index, uint len, const char * ); +#ifndef QT_NO_REGEXP + TQCString &replace( const TQRegExp &, const char * ); +#endif + TQCString &replace( char c, const char *after ); + TQCString &replace( const char *, const char * ); + TQCString &replace( char, char ); + + short toShort( bool *ok=0 ) const; + ushort toUShort( bool *ok=0 ) const; + int toInt( bool *ok=0 ) const; + uint toUInt( bool *ok=0 ) const; + long toLong( bool *ok=0 ) const; + ulong toULong( bool *ok=0 ) const; + float toFloat( bool *ok=0 ) const; + double toDouble( bool *ok=0 ) const; + + TQCString &setStr( const char *s ); + TQCString &setNum( short ); + TQCString &setNum( ushort ); + TQCString &setNum( int ); + TQCString &setNum( uint ); + TQCString &setNum( long ); + TQCString &setNum( ulong ); + TQCString &setNum( float, char f='g', int prec=6 ); + TQCString &setNum( double, char f='g', int prec=6 ); + + bool setExpand( uint index, char c ); + + operator const char *() const; + TQCString &operator+=( const char *str ); + TQCString &operator+=( char c ); +private: + int find( const char *str, int index, bool cs, uint l ) const; +}; + + +/***************************************************************************** + TQCString stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQCString & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQCString & ); +#endif + +/***************************************************************************** + TQCString inline functions + *****************************************************************************/ + +inline TQCString &TQCString::operator=( const TQCString &s ) +{ return (TQCString&)assign( s ); } + +inline TQCString &TQCString::operator=( const char *str ) +{ return (TQCString&)duplicate( str, qstrlen(str)+1 ); } + +inline bool TQCString::isNull() const +{ return data() == 0; } + +inline bool TQCString::isEmpty() const +{ return data() == 0 || *data() == '\0'; } + +inline uint TQCString::length() const +{ return qstrlen( data() ); } + +inline bool TQCString::truncate( uint pos ) +{ return resize(pos+1); } + +inline TQCString TQCString::copy() const +{ return TQCString( data() ); } + +inline TQCString &TQCString::prepend( const char *s ) +{ return insert(0,s); } + +inline TQCString &TQCString::append( const char *s ) +{ return operator+=(s); } + +inline TQCString &TQCString::setNum( short n ) +{ return setNum((long)n); } + +inline TQCString &TQCString::setNum( ushort n ) +{ return setNum((ulong)n); } + +inline TQCString &TQCString::setNum( int n ) +{ return setNum((long)n); } + +inline TQCString &TQCString::setNum( uint n ) +{ return setNum((ulong)n); } + +inline TQCString &TQCString::setNum( float n, char f, int prec ) +{ return setNum((double)n,f,prec); } + +inline TQCString::operator const char *() const +{ return (const char *)data(); } + + +/***************************************************************************** + TQCString non-member operators + *****************************************************************************/ + +Q_EXPORT inline bool operator==( const TQCString &s1, const TQCString &s2 ) +{ return qstrcmp( s1.data(), s2.data() ) == 0; } + +Q_EXPORT inline bool operator==( const TQCString &s1, const char *s2 ) +{ return qstrcmp( s1.data(), s2 ) == 0; } + +Q_EXPORT inline bool operator==( const char *s1, const TQCString &s2 ) +{ return qstrcmp( s1, s2.data() ) == 0; } + +Q_EXPORT inline bool operator!=( const TQCString &s1, const TQCString &s2 ) +{ return qstrcmp( s1.data(), s2.data() ) != 0; } + +Q_EXPORT inline bool operator!=( const TQCString &s1, const char *s2 ) +{ return qstrcmp( s1.data(), s2 ) != 0; } + +Q_EXPORT inline bool operator!=( const char *s1, const TQCString &s2 ) +{ return qstrcmp( s1, s2.data() ) != 0; } + +Q_EXPORT inline bool operator<( const TQCString &s1, const TQCString& s2 ) +{ return qstrcmp( s1.data(), s2.data() ) < 0; } + +Q_EXPORT inline bool operator<( const TQCString &s1, const char *s2 ) +{ return qstrcmp( s1.data(), s2 ) < 0; } + +Q_EXPORT inline bool operator<( const char *s1, const TQCString &s2 ) +{ return qstrcmp( s1, s2.data() ) < 0; } + +Q_EXPORT inline bool operator<=( const TQCString &s1, const TQCString &s2 ) +{ return qstrcmp( s1.data(), s2.data() ) <= 0; } + +Q_EXPORT inline bool operator<=( const TQCString &s1, const char *s2 ) +{ return qstrcmp( s1.data(), s2 ) <= 0; } + +Q_EXPORT inline bool operator<=( const char *s1, const TQCString &s2 ) +{ return qstrcmp( s1, s2.data() ) <= 0; } + +Q_EXPORT inline bool operator>( const TQCString &s1, const TQCString &s2 ) +{ return qstrcmp( s1.data(), s2.data() ) > 0; } + +Q_EXPORT inline bool operator>( const TQCString &s1, const char *s2 ) +{ return qstrcmp( s1.data(), s2 ) > 0; } + +Q_EXPORT inline bool operator>( const char *s1, const TQCString &s2 ) +{ return qstrcmp( s1, s2.data() ) > 0; } + +Q_EXPORT inline bool operator>=( const TQCString &s1, const TQCString& s2 ) +{ return qstrcmp( s1.data(), s2.data() ) >= 0; } + +Q_EXPORT inline bool operator>=( const TQCString &s1, const char *s2 ) +{ return qstrcmp( s1.data(), s2 ) >= 0; } + +Q_EXPORT inline bool operator>=( const char *s1, const TQCString &s2 ) +{ return qstrcmp( s1, s2.data() ) >= 0; } + +Q_EXPORT inline const TQCString operator+( const TQCString &s1, + const TQCString &s2 ) +{ + TQCString tmp( s1.data() ); + tmp += s2; + return tmp; +} + +Q_EXPORT inline const TQCString operator+( const TQCString &s1, const char *s2 ) +{ + TQCString tmp( s1.data() ); + tmp += s2; + return tmp; +} + +Q_EXPORT inline const TQCString operator+( const char *s1, const TQCString &s2 ) +{ + TQCString tmp( s1 ); + tmp += s2; + return tmp; +} + +Q_EXPORT inline const TQCString operator+( const TQCString &s1, char c2 ) +{ + TQCString tmp( s1.data() ); + tmp += c2; + return tmp; +} + +Q_EXPORT inline const TQCString operator+( char c1, const TQCString &s2 ) +{ + TQCString tmp; + tmp += c1; + tmp += s2; + return tmp; +} +#include "ntqwinexport.h" +#endif // TQCSTRING_H diff --git a/src/tools/ntqdatastream.h b/src/tools/ntqdatastream.h new file mode 100644 index 000000000..73fa584cf --- /dev/null +++ b/src/tools/ntqdatastream.h @@ -0,0 +1,193 @@ +/**************************************************************************** +** +** Definition of TQDataStream class +** +** Created : 930831 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDATASTREAM_H +#define TQDATASTREAM_H + +#ifndef QT_H +#include "ntqiodevice.h" +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_DATASTREAM +class Q_EXPORT TQDataStream // data stream class +{ +public: + TQDataStream(); + TQDataStream( TQIODevice * ); + TQDataStream( TQByteArray, int mode ); + virtual ~TQDataStream(); + + 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 ); + + TQDataStream &operator>>( Q_INT8 &i ); + TQDataStream &operator>>( Q_UINT8 &i ); + TQDataStream &operator>>( Q_INT16 &i ); + TQDataStream &operator>>( Q_UINT16 &i ); + TQDataStream &operator>>( Q_INT32 &i ); + TQDataStream &operator>>( Q_UINT32 &i ); + TQDataStream &operator>>( Q_INT64 &i ); + TQDataStream &operator>>( Q_UINT64 &i ); +#if !defined(Q_OS_WIN64) + TQDataStream &operator>>( Q_LONG &i ); + TQDataStream &operator>>( Q_ULONG &i ); +#endif + + TQDataStream &operator>>( float &f ); + TQDataStream &operator>>( double &f ); + TQDataStream &operator>>( char *&str ); + + TQDataStream &operator<<( Q_INT8 i ); + TQDataStream &operator<<( Q_UINT8 i ); + TQDataStream &operator<<( Q_INT16 i ); + TQDataStream &operator<<( Q_UINT16 i ); + TQDataStream &operator<<( Q_INT32 i ); + TQDataStream &operator<<( Q_UINT32 i ); + TQDataStream &operator<<( Q_INT64 i ); + TQDataStream &operator<<( Q_UINT64 i ); +#if !defined(Q_OS_WIN64) + TQDataStream &operator<<( Q_LONG i ); + TQDataStream &operator<<( Q_ULONG i ); +#endif + TQDataStream &operator<<( float f ); + TQDataStream &operator<<( double f ); + TQDataStream &operator<<( const char *str ); + + TQDataStream &readBytes( char *&, uint &len ); + TQDataStream &readRawBytes( char *, uint len ); + + TQDataStream &writeBytes( const char *, uint len ); + TQDataStream &writeRawBytes( const char *, uint len ); + +private: + TQIODevice *dev; + bool owndev; + int byteorder; + bool printable; + bool noswap; + int ver; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQDataStream( const TQDataStream & ); + TQDataStream &operator=( const TQDataStream & ); +#endif +}; + + +/***************************************************************************** + TQDataStream inline functions + *****************************************************************************/ + +inline TQIODevice *TQDataStream::device() const +{ return dev; } + +inline bool TQDataStream::atEnd() const +{ return dev ? dev->atEnd() : TRUE; } + +inline bool TQDataStream::eof() const +{ return atEnd(); } + +inline int TQDataStream::byteOrder() const +{ return byteorder; } + +inline bool TQDataStream::isPrintableData() const +{ return printable; } + +inline void TQDataStream::setPrintableData( bool p ) +{ printable = p; } + +inline int TQDataStream::version() const +{ return ver; } + +inline void TQDataStream::setVersion( int v ) +{ ver = v; } + +inline TQDataStream &TQDataStream::operator>>( Q_UINT8 &i ) +{ return *this >> (Q_INT8&)i; } + +inline TQDataStream &TQDataStream::operator>>( Q_UINT16 &i ) +{ return *this >> (Q_INT16&)i; } + +inline TQDataStream &TQDataStream::operator>>( Q_UINT32 &i ) +{ return *this >> (Q_INT32&)i; } + +inline TQDataStream &TQDataStream::operator>>( Q_UINT64 &i ) +{ return *this >> (Q_INT64&)i; } + +#if !defined(Q_OS_WIN64) +inline TQDataStream &TQDataStream::operator>>( Q_ULONG &i ) +{ return *this >> (Q_LONG&)i; } +#endif + +inline TQDataStream &TQDataStream::operator<<( Q_UINT8 i ) +{ return *this << (Q_INT8)i; } + +inline TQDataStream &TQDataStream::operator<<( Q_UINT16 i ) +{ return *this << (Q_INT16)i; } + +inline TQDataStream &TQDataStream::operator<<( Q_UINT32 i ) +{ return *this << (Q_INT32)i; } + +inline TQDataStream &TQDataStream::operator<<( Q_UINT64 i ) +{ return *this << (Q_INT64)i; } + +#if !defined(Q_OS_WIN64) +inline TQDataStream &TQDataStream::operator<<( Q_ULONG i ) +{ return *this << (Q_LONG)i; } +#endif + +#endif // QT_NO_DATASTREAM +#endif // TQDATASTREAM_H diff --git a/src/tools/ntqdatetime.h b/src/tools/ntqdatetime.h new file mode 100644 index 000000000..4c5a3b4f8 --- /dev/null +++ b/src/tools/ntqdatetime.h @@ -0,0 +1,253 @@ +/************************************************************************* +** +** Definition of date and time classes +** +** Created : 940124 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDATETIME_H +#define TQDATETIME_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqnamespace.h" +#endif // QT_H + + +/***************************************************************************** + TQDate class + *****************************************************************************/ + +class Q_EXPORT TQDate +{ +public: + TQDate() { jd = 0; } + TQDate( int y, int m, int d ); + + bool isNull() const { return jd == 0; } + 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 *yearNum = 0 ) const; + +#ifndef QT_NO_TEXTDATE +#ifndef QT_NO_COMPAT + static TQString monthName( int month ) { return shortMonthName( month ); } + static TQString dayName( int weekday ) { return shortDayName( weekday ); } +#endif + static TQString shortMonthName( int month ); + static TQString shortDayName( int weekday ); + static TQString longMonthName( int month ); + static TQString longDayName( int weekday ); +#endif //QT_NO_TEXTDATE +#ifndef QT_NO_TEXTSTRING +#if !defined(QT_NO_SPRINTF) + TQString toString( TQt::DateFormat f = TQt::TextDate ) const; +#endif + TQString toString( const TQString& format ) const; +#endif + bool setYMD( int y, int m, int d ); + + TQDate addDays( int days ) const; + TQDate addMonths( int months ) const; + TQDate addYears( int years ) const; + int daysTo( const TQDate & ) const; + + bool operator==( const TQDate &d ) const { return jd == d.jd; } + bool operator!=( const TQDate &d ) const { return jd != d.jd; } + bool operator<( const TQDate &d ) const { return jd < d.jd; } + bool operator<=( const TQDate &d ) const { return jd <= d.jd; } + bool operator>( const TQDate &d ) const { return jd > d.jd; } + bool operator>=( const TQDate &d ) const { return jd >= d.jd; } + + static TQDate currentDate(); + static TQDate currentDate( TQt::TimeSpec ); +#ifndef QT_NO_DATESTRING + static TQDate fromString( const TQString& s, TQt::DateFormat f = TQt::TextDate ); +#endif + static bool isValid( int y, int m, int d ); + static bool leapYear( int year ); + + static uint gregorianToJulian( int y, int m, int d ); + static void julianToGregorian( uint jd, int &y, int &m, int &d ); +private: + uint jd; + friend class TQDateTime; +#ifndef QT_NO_DATASTREAM + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDate & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDate & ); +#endif +}; + + +/***************************************************************************** + TQTime class + *****************************************************************************/ + +class Q_EXPORT TQTime +{ +public: + TQTime() { ds=0; } // set null time + TQTime( int h, int m, int s=0, int ms=0 ); // set time + + bool isNull() const { return ds == 0; } + bool isValid() const; // valid time + + int hour() const; // 0..23 + int minute() const; // 0..59 + int second() const; // 0..59 + int msec() const; // 0..999 +#ifndef QT_NO_DATESTRING +#ifndef QT_NO_SPRINTF + TQString toString( TQt::DateFormat f = TQt::TextDate ) const; +#endif + TQString toString( const TQString& format ) const; +#endif + bool setHMS( int h, int m, int s, int ms=0 ); + + TQTime addSecs( int secs ) const; + int secsTo( const TQTime & ) const; + TQTime addMSecs( int ms ) const; + int msecsTo( const TQTime & ) const; + + bool operator==( const TQTime &d ) const { return ds == d.ds; } + bool operator!=( const TQTime &d ) const { return ds != d.ds; } + bool operator<( const TQTime &d ) const { return ds < d.ds; } + bool operator<=( const TQTime &d ) const { return ds <= d.ds; } + bool operator>( const TQTime &d ) const { return ds > d.ds; } + bool operator>=( const TQTime &d ) const { return ds >= d.ds; } + + static TQTime currentTime(); + static TQTime currentTime( TQt::TimeSpec ); +#ifndef QT_NO_DATESTRING + static TQTime fromString( const TQString& s, TQt::DateFormat f = TQt::TextDate ); +#endif + static bool isValid( int h, int m, int s, int ms=0 ); + + void start(); + int restart(); + int elapsed() const; + +private: + static bool currentTime( TQTime * ); + static bool currentTime( TQTime *, TQt::TimeSpec ); + + uint ds; + friend class TQDateTime; +#ifndef QT_NO_DATASTREAM + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQTime & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQTime & ); +#endif +}; + + +/***************************************************************************** + TQDateTime class + *****************************************************************************/ + +class Q_EXPORT TQDateTime +{ +public: + TQDateTime() {} // set null date and null time + TQDateTime( const TQDate & ); + TQDateTime( const TQDate &, const TQTime & ); + + bool isNull() const { return d.isNull() && t.isNull(); } + bool isValid() const { return d.isValid() && t.isValid(); } + + TQDate date() const { return d; } + TQTime time() const { return t; } + uint toTime_t() const; + void setDate( const TQDate &date ) { d = date; } + void setTime( const TQTime &time ) { t = time; } + void setTime_t( uint secsSince1Jan1970UTC ); + void setTime_t( uint secsSince1Jan1970UTC, TQt::TimeSpec ); +#ifndef QT_NO_DATESTRING +#ifndef QT_NO_SPRINTF + TQString toString( TQt::DateFormat f = TQt::TextDate ) const; +#endif + TQString toString( const TQString& format ) const; +#endif + TQDateTime addDays( int days ) const; + TQDateTime addMonths( int months ) const; + TQDateTime addYears( int years ) const; + TQDateTime addSecs( int secs ) const; + int daysTo( const TQDateTime & ) const; + int secsTo( const TQDateTime & ) const; + + bool operator==( const TQDateTime &dt ) const; + bool operator!=( const TQDateTime &dt ) const; + bool operator<( const TQDateTime &dt ) const; + bool operator<=( const TQDateTime &dt ) const; + bool operator>( const TQDateTime &dt ) const; + bool operator>=( const TQDateTime &dt ) const; + + static TQDateTime currentDateTime(); + static TQDateTime currentDateTime( TQt::TimeSpec ); +#ifndef QT_NO_DATESTRING + static TQDateTime fromString( const TQString& s, TQt::DateFormat f = TQt::TextDate ); +#endif +private: + TQDate d; + TQTime t; +#ifndef QT_NO_DATASTREAM + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDateTime &); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDateTime & ); +#endif +}; + + +/***************************************************************************** + Date and time stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDate & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDate & ); +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQTime & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQTime & ); +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDateTime & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDateTime & ); +#endif // QT_NO_DATASTREAM + +#endif // TQDATETIME_H + diff --git a/src/tools/ntqdeepcopy.h b/src/tools/ntqdeepcopy.h new file mode 100644 index 000000000..abe1fc8f1 --- /dev/null +++ b/src/tools/ntqdeepcopy.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Definition of TQDeepCopy class +** +** Created : 20020613 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDEEPCOPY_H +#define TQDEEPCOPY_H + +#ifndef QT_H +# include "ntqglobal.h" +#endif // QT_H + +template +class TQDeepCopy +{ +public: + inline TQDeepCopy() + { + } + + inline TQDeepCopy( const T &t ) + : deepcopy( t ) + { + deepcopy.detach(); + } + + inline TQDeepCopy &operator=( const T &t ) + { + deepcopy = t; + deepcopy.detach(); + return *this; + } + + inline operator T () + { + T tmp = deepcopy; + tmp.detach(); + return tmp; + } + +private: + T deepcopy; +}; + +#endif // TQDEEPCOPY_H diff --git a/src/tools/ntqdict.h b/src/tools/ntqdict.h new file mode 100644 index 000000000..d363538d0 --- /dev/null +++ b/src/tools/ntqdict.h @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Definition of TQDict template class +** +** Created : 920821 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDICT_H +#define TQDICT_H + +#ifndef QT_H +#include "ntqgdict.h" +#endif // QT_H + +template +class TQDict +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGDict +#endif +{ +public: + TQDict( int size = 17, bool caseSensitive = TRUE ) + : TQGDict( size, StringKey, caseSensitive, FALSE ) { } + TQDict( const TQDict &d ) : TQGDict( d ) { } + ~TQDict() { clear(); } + TQDict &operator=(const TQDict &d) + { return (TQDict&)TQGDict::operator=(d); } + uint count() const { return TQGDict::count(); } + uint size() const { return TQGDict::size(); } + bool isEmpty() const { return TQGDict::count() == 0; } + + void insert( const TQString &k, const type *d ) + { TQGDict::look_string(k,(Item)d,1); } + void replace( const TQString &k, const type *d ) + { TQGDict::look_string(k,(Item)d,2); } + bool remove( const TQString &k ) { return TQGDict::remove_string(k); } + type *take( const TQString &k ) { return (type *)TQGDict::take_string(k); } + type *find( const TQString &k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_string(k,0,0); } + type *operator[]( const TQString &k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_string(k,0,0); } + + void clear() { TQGDict::clear(); } + void resize( uint n ) { TQGDict::resize(n); } + void statistics() const { TQGDict::statistics(); } + +#ifdef Q_QDOC +protected: + virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); + virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQDict::deleteItem( Item ) +{ +} +#endif + +template inline void TQDict::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class TQDictIterator : public TQGDictIterator +{ +public: + TQDictIterator(const TQDict &d) : TQGDictIterator((TQGDict &)d) { } + ~TQDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)TQGDictIterator::toFirst(); } + operator type *() const { return (type *)TQGDictIterator::get(); } + type *operator*() { return (type *)TQGDictIterator::get(); } + type *current() const { return (type *)TQGDictIterator::get(); } + TQString currentKey() const{ return TQGDictIterator::getKeyString(); } + type *operator()() { return (type *)TQGDictIterator::operator()(); } + type *operator++() { return (type *)TQGDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j); } +}; + +#define Q_DEFINED_QDICT +#include "ntqwinexport.h" +#endif // TQDICT_H diff --git a/src/tools/ntqdir.h b/src/tools/ntqdir.h new file mode 100644 index 000000000..87083f8f4 --- /dev/null +++ b/src/tools/ntqdir.h @@ -0,0 +1,250 @@ +/**************************************************************************** +** +** Definition of TQDir class +** +** Created : 950427 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDIR_H +#define TQDIR_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqstrlist.h" +#include "ntqfileinfo.h" +#endif // QT_H + + +#ifndef QT_NO_DIR +typedef TQPtrList TQFileInfoList; +typedef TQPtrListIterator TQFileInfoListIterator; +class TQStringList; +template class TQDeepCopy; + + +class Q_EXPORT TQDir +{ +public: + enum FilterSpec { Dirs = 0x001, + Files = 0x002, + Drives = 0x004, + NoSymLinks = 0x008, + All = 0x007, + TypeMask = 0x00F, + + Readable = 0x010, + Writable = 0x020, + Executable = 0x040, + RWEMask = 0x070, + + Modified = 0x080, + Hidden = 0x100, + System = 0x200, + AccessMask = 0x3F0, + + DefaultFilter = -1 }; + + enum SortSpec { Name = 0x00, + Time = 0x01, + Size = 0x02, + Unsorted = 0x03, + SortByMask = 0x03, + + DirsFirst = 0x04, + Reversed = 0x08, + IgnoreCase = 0x10, + LocaleAware = 0x20, + DefaultSort = -1 }; + + TQDir(); + TQDir( const TQString &path, const TQString &nameFilter = TQString::null, + int sortSpec = Name | IgnoreCase, int filterSpec = All ); + TQDir( const TQDir & ); + + virtual ~TQDir(); + + TQDir &operator=( const TQDir & ); + TQDir &operator=( const TQString &path ); + + virtual void setPath( const TQString &path ); + virtual TQString path() const; + virtual TQString absPath() const; + virtual TQString canonicalPath() const; + + virtual TQString dirName() const; + virtual TQString filePath( const TQString &fileName, + bool acceptAbsPath = TRUE ) const; + virtual TQString absFilePath( const TQString &fileName, + bool acceptAbsPath = TRUE ) const; + + static TQString convertSeparators( const TQString &pathName ); + + virtual bool cd( const TQString &dirName, bool acceptAbsPath = TRUE ); + virtual bool cdUp(); + + TQString nameFilter() const; + virtual void setNameFilter( const TQString &nameFilter ); + FilterSpec filter() const; + virtual void setFilter( int filterSpec ); + SortSpec sorting() const; + virtual void setSorting( int sortSpec ); + + bool matchAllDirs() const; + virtual void setMatchAllDirs( bool ); + + uint count() const; + TQString operator[]( int ) const; + + virtual TQStrList encodedEntryList( int filterSpec = DefaultFilter, + int sortSpec = DefaultSort ) const; + virtual TQStrList encodedEntryList( const TQString &nameFilter, + int filterSpec = DefaultFilter, + int sortSpec = DefaultSort ) const; + virtual TQStringList entryList( int filterSpec = DefaultFilter, + int sortSpec = DefaultSort ) const; + virtual TQStringList entryList( const TQString &nameFilter, + int filterSpec = DefaultFilter, + int sortSpec = DefaultSort ) const; + + virtual const TQFileInfoList *entryInfoList( int filterSpec = DefaultFilter, + int sortSpec = DefaultSort ) const; + virtual const TQFileInfoList *entryInfoList( const TQString &nameFilter, + int filterSpec = DefaultFilter, + int sortSpec = DefaultSort ) const; + + static const TQFileInfoList *drives(); + + virtual bool mkdir( const TQString &dirName, + bool acceptAbsPath = TRUE ) const; + virtual bool rmdir( const TQString &dirName, + bool acceptAbsPath = TRUE ) const; + + virtual bool isReadable() const; + virtual bool exists() const; + virtual bool isRoot() const; + + virtual bool isRelative() const; + virtual void convertToAbs(); + + virtual bool operator==( const TQDir & ) const; + virtual bool operator!=( const TQDir & ) const; + + virtual bool remove( const TQString &fileName, + bool acceptAbsPath = TRUE ); + virtual bool rename( const TQString &name, const TQString &newName, + bool acceptAbsPaths = TRUE ); + virtual bool exists( const TQString &name, + bool acceptAbsPath = TRUE ); + + static char separator(); + + static bool setCurrent( const TQString &path ); + static TQDir current(); + static TQDir home(); + static TQDir root(); + static TQString currentDirPath(); + static TQString homeDirPath(); + static TQString rootDirPath(); + + static bool match( const TQStringList &filters, const TQString &fileName ); + static bool match( const TQString &filter, const TQString &fileName ); + static TQString cleanDirPath( const TQString &dirPath ); + static bool isRelativePath( const TQString &path ); + void refresh() const; + +private: +#ifdef Q_OS_MAC + typedef struct FSSpec FSSpec; + static FSSpec *make_spec(const TQString &); +#endif + void init(); + virtual bool readDirEntries( const TQString &nameFilter, + int FilterSpec, int SortSpec ); + + static void slashify( TQString & ); + + TQString dPath; + TQStringList *fList; + TQFileInfoList *fiList; + TQString nameFilt; + FilterSpec filtS; + SortSpec sortS; + uint dirty : 1; + uint allDirs : 1; + + void detach(); + friend class TQDeepCopy< TQDir >; +}; + + +inline TQString TQDir::path() const +{ + return dPath; +} + +inline TQString TQDir::nameFilter() const +{ + return nameFilt; +} + +inline TQDir::FilterSpec TQDir::filter() const +{ + return filtS; +} + +inline TQDir::SortSpec TQDir::sorting() const +{ + return sortS; +} + +inline bool TQDir::matchAllDirs() const +{ + return allDirs; +} + +inline bool TQDir::operator!=( const TQDir &d ) const +{ + return !(*this == d); +} + + +struct TQDirSortItem { + TQString filename_cache; + TQFileInfo* item; +}; + +#endif // QT_NO_DIR +#endif // TQDIR_H diff --git a/src/tools/ntqfeatures.h b/src/tools/ntqfeatures.h new file mode 100644 index 000000000..6e0a38182 --- /dev/null +++ b/src/tools/ntqfeatures.h @@ -0,0 +1,994 @@ +// All feature and their dependencies +// +// This list is generated from $QTDIR/src/tools/qfeatures.txt +// +// Asynchronous I/O +//#define QT_NO_ASYNC_IO + +// Bezier curves +//#define QT_NO_BEZIER + +// Buttons +//#define QT_NO_BUTTON + +// Named colors +//#define QT_NO_COLORNAMES + +// Cursors +//#define QT_NO_CURSOR + +// TQDataStream +//#define QT_NO_DATASTREAM + +// TQDate/TQTime/TQDateTime toString() and fromString() +//#define QT_NO_DATESTRING + +// Dialogs +//#define QT_NO_DIALOG + +// TQDirectPainter +//#define QT_NO_DIRECTPAINTER + +// Special widget effects (fading, scrolling) +//#define QT_NO_EFFECTS + +// Freetype font engine +//#define QT_NO_FREETYPE + +// Dither TQImage to 1-bit image +//#define QT_NO_IMAGE_DITHER_TO_1 + +// TQImage::createHeuristicMask() +//#define QT_NO_IMAGE_HEURISTIC_MASK + +// TQImage mirroring +//#define QT_NO_IMAGE_MIRROR + +// Smooth TQImage scaling +//#define QT_NO_IMAGE_SMOOTHSCALE + +// TrueColor TQImage +//#define QT_NO_IMAGE_TRUECOLOR + +// Automatic widget layout +//#define QT_NO_LAYOUT + +// Networking +//#define QT_NO_NETWORK + +// Palettes +//#define QT_NO_PALETTE + +// Alpha-blended cursor +//#define QT_NO_QWS_ALPHA_CURSOR + +// 1-bit monochrome +//#define QT_NO_QWS_DEPTH_1 + +// 15 or 16-bit color +//#define QT_NO_QWS_DEPTH_16 + +// 24-bit color +//#define QT_NO_QWS_DEPTH_24 + +// 32-bit color +//#define QT_NO_QWS_DEPTH_32 + +// 4-bit grayscale +//#define QT_NO_QWS_DEPTH_4 + +// 8-bit color +//#define QT_NO_QWS_DEPTH_8 + +// 8-bit grayscale +//#define QT_NO_QWS_DEPTH_8GRAYSCALE + +// Favour code size over graphics speed +//#define QT_NO_QWS_GFX_SPEED + +// Console keyboard +//#define QT_NO_QWS_KEYBOARD + +// Linux framebuffer +//#define QT_NO_QWS_LINUXFB + +// Mach64 acceleration +//#define QT_NO_QWS_MACH64 + +// Window Manager +//#define QT_NO_QWS_MANAGER + +// Matrox MGA acceleration +//#define QT_NO_QWS_MATROX + +// Autodetecting mouse driver +//#define QT_NO_QWS_MOUSE_AUTO + +// Non-autodetecting mouse driver +//#define QT_NO_QWS_MOUSE_MANUAL + +// TQt/Embedded window system properties. +//#define QT_NO_QWS_PROPERTIES + +// Repeater display +//#define QT_NO_QWS_REPEATER + +// Saving of fonts +//#define QT_NO_QWS_SAVEFONTS + +// Shadow frame buffer +//#define QT_NO_QWS_SHADOWFB + +// Virtual frame buffer +//#define QT_NO_QWS_VFB + +// 4-bit VGA +//#define QT_NO_QWS_VGA_16 + +// Voodoo3 acceleration +//#define QT_NO_QWS_VOODOO3 + +// Range-control widgets +//#define QT_NO_RANGECONTROL + +// Regular expression capture +//#define QT_NO_REGEXP + +// TQSignalMapper +//#define QT_NO_SIGNALMAPPER + +// Playing sounds +//#define QT_NO_SOUND + +// Standard template library compatiblity +//#define QT_NO_STL + +// TQStringList +//#define QT_NO_STRINGLIST + +// Character set conversions +//#define QT_NO_TEXTCODEC + +// TQTextStream +//#define QT_NO_TEXTSTREAM + +// Unicode property tables +//#define QT_NO_UNICODETABLES + +// Input validators +//#define QT_NO_VALIDATOR + +// TQVariant +//#define QT_NO_VARIANT + +// Wheel-mouse events +//#define QT_NO_WHEELEVENT + +// TQWMatrix +//#define QT_NO_WMATRIX + +// Non-Unicode text conversions +#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) +#define QT_NO_CODECS +#endif + +// TQCop IPC +#if !defined(QT_NO_COP) && (defined(QT_NO_DATASTREAM)) +#define QT_NO_COP +#endif + +// TQFontDatabase +#if !defined(QT_NO_FONTDATABASE) && (defined(QT_NO_STRINGLIST)) +#define QT_NO_FONTDATABASE +#endif + +// Image formats +#if !defined(QT_NO_IMAGEIO) && (defined(QT_NO_REGEXP)) +#define QT_NO_IMAGEIO +#endif + +// 16-bit TQImage +#if !defined(QT_NO_IMAGE_16_BIT) && (defined(QT_NO_IMAGE_TRUECOLOR)) +#define QT_NO_IMAGE_16_BIT +#endif + +// Image file text strings +#if !defined(QT_NO_IMAGE_TEXT) && (defined(QT_NO_STRINGLIST)) +#define QT_NO_IMAGE_TEXT +#endif + +// Shared library wrapper +#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_REGEXP)) +#define QT_NO_LIBRARY +#endif + +// Pixmap transformations +#if !defined(QT_NO_PIXMAP_TRANSFORMATION) && (defined(QT_NO_WMATRIX)) +#define QT_NO_PIXMAP_TRANSFORMATION +#endif + +// Convert UUID to/from string +#if !defined(QT_NO_QUUID_STRING) && (defined(QT_NO_STRINGLIST)) +#define QT_NO_QUUID_STRING +#endif + +// The "BeOS" style +#if !defined(QT_NO_QWS_BEOS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) +#define QT_NO_QWS_BEOS_WM_STYLE +#endif + +// Visible cursor +#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR)) +#define QT_NO_QWS_CURSOR +#endif + +// 32-bit color, BGR order +#if !defined(QT_NO_QWS_DEPTH_32_BGR) && (defined(QT_NO_QWS_DEPTH_32)) +#define QT_NO_QWS_DEPTH_32_BGR +#endif + +// The "Hydro" style +#if !defined(QT_NO_QWS_HYDRO_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) +#define QT_NO_QWS_HYDRO_WM_STYLE +#endif + +// Keyboard for SHARP Zaurus SL5xxx devices +#if !defined(QT_NO_QWS_KBD_SHARP) && (defined(QT_NO_QWS_KEYBOARD)) +#define QT_NO_QWS_KBD_SHARP +#endif + +// The "KDE2" style +#if !defined(QT_NO_QWS_KDE2_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) +#define QT_NO_QWS_KDE2_WM_STYLE +#endif + +// The "KDE" style +#if !defined(QT_NO_QWS_KDE_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) +#define QT_NO_QWS_KDE_WM_STYLE +#endif + +// Multi-process architecture +#if !defined(QT_NO_QWS_MULTIPROCESS) && (defined(QT_NO_NETWORK)) +#define QT_NO_QWS_MULTIPROCESS +#endif + +// Transformed frame buffer +#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_LINUXFB)) +#define QT_NO_QWS_TRANSFORMED +#endif + +// Remote frame buffer (VNC) +#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_NETWORK)) +#define QT_NO_QWS_VNC +#endif + +// The "Windows" style +#if !defined(QT_NO_QWS_WINDOWS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) +#define QT_NO_QWS_WINDOWS_WM_STYLE +#endif + +// Regular expression anchors +#if !defined(QT_NO_REGEXP_ANCHOR_ALT) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_ANCHOR_ALT +#endif + +// Regular expression back-reference +#if !defined(QT_NO_REGEXP_BACKREF) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_BACKREF +#endif + +// Regular expression character-class +#if !defined(QT_NO_REGEXP_CCLASS) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_CCLASS +#endif + +// Regular expression escape +#if !defined(QT_NO_REGEXP_ESCAPE) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_ESCAPE +#endif + +// Regular expression interval +#if !defined(QT_NO_REGEXP_INTERVAL) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_INTERVAL +#endif + +// Regular expression lookahead +#if !defined(QT_NO_REGEXP_LOOKAHEAD) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_LOOKAHEAD +#endif + +// Regular expression optimization +#if !defined(QT_NO_REGEXP_OPTIM) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_OPTIM +#endif + +// Regular expression wildcard +#if !defined(QT_NO_REGEXP_WILDCARD) && (defined(QT_NO_REGEXP)) +#define QT_NO_REGEXP_WILDCARD +#endif + +// Semi-modal dialogs +#if !defined(QT_NO_SEMIMODAL) && (defined(QT_NO_DIALOG)) +#define QT_NO_SEMIMODAL +#endif + +// Session management +#if !defined(QT_NO_SESSIONMANAGER) && (defined(QT_NO_STRINGLIST)) +#define QT_NO_SESSIONMANAGER +#endif + +// TQString::sprintf() +#if !defined(QT_NO_SPRINTF) && (defined(QT_NO_REGEXP)) +#define QT_NO_SPRINTF +#endif + +// Scaling and rotation +#if !defined(QT_NO_TRANSFORMATIONS) && (defined(QT_NO_WMATRIX)) +#define QT_NO_TRANSFORMATIONS +#endif + +// Translations via TQObject::tr() +#if !defined(QT_NO_TRANSLATION) && (defined(QT_NO_DATASTREAM)) +#define QT_NO_TRANSLATION +#endif + +// Window icon and caption +#if !defined(QT_NO_WIDGET_TOPEXTRA) && (defined(QT_NO_IMAGE_HEURISTIC_MASK)) +#define QT_NO_WIDGET_TOPEXTRA +#endif + +// Keyboard accelerators and shortcuts +#if !defined(QT_NO_ACCEL) && (defined(QT_NO_SPRINTF)) +#define QT_NO_ACCEL +#endif + +// Asynchronous image I/O +#if !defined(QT_NO_ASYNC_IMAGE_IO) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_ASYNC_IMAGE_IO +#endif + +// BDF font files +#if !defined(QT_NO_BDF) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_STRINGLIST)) +#define QT_NO_BDF +#endif + +// TQDir +#if !defined(QT_NO_DIR) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP)) +#define QT_NO_DIR +#endif + +// JPEG image I/O +#if !defined(QT_NO_IMAGEIO_JPEG) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_IMAGEIO_JPEG +#endif + +// MNG image I/O +#if !defined(QT_NO_IMAGEIO_MNG) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_IMAGEIO_MNG +#endif + +// PNG image I/O +#if !defined(QT_NO_IMAGEIO_PNG) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_IMAGEIO_PNG +#endif + +// PPM image I/O +#if !defined(QT_NO_IMAGEIO_PPM) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_IMAGEIO_PPM +#endif + +// XBM image I/O +#if !defined(QT_NO_IMAGEIO_XBM) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_IMAGEIO_XBM +#endif + +// Image transformations +#if !defined(QT_NO_IMAGE_TRANSFORMATION) && (defined(QT_NO_PIXMAP_TRANSFORMATION)) +#define QT_NO_IMAGE_TRANSFORMATION +#endif + +// External process invocation. +#if !defined(QT_NO_PROCESS) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP)) +#define QT_NO_PROCESS +#endif + +// Regular expression capture +#if !defined(QT_NO_REGEXP_CAPTURE) && (defined(QT_NO_REGEXP) || defined(QT_NO_STRINGLIST)) +#define QT_NO_REGEXP_CAPTURE +#endif + +// Splash screen widget +#if !defined(QT_NO_SPLASHSCREEN) && (defined(QT_NO_IMAGEIO)) +#define QT_NO_SPLASHSCREEN +#endif + +// Template classes in TQVariant +#if !defined(QT_NO_TEMPLATE_VARIANT) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST)) +#define QT_NO_TEMPLATE_VARIANT +#endif + +// Month and day names in dates +#if !defined(QT_NO_TEXTDATE) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_DATESTRING)) +#define QT_NO_TEXTDATE +#endif + +// Drawing utility functions +#if !defined(QT_NO_DRAWUTIL) && (defined(QT_NO_SPRINTF) || defined(QT_NO_PALETTE)) +#define QT_NO_DRAWUTIL +#endif + +// BMP image I/O +#if !defined(QT_NO_IMAGEIO_BMP) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_DATASTREAM)) +#define QT_NO_IMAGEIO_BMP +#endif + +// TQPicture +#if !defined(QT_NO_PICTURE) && (defined(QT_NO_DATASTREAM) || defined(QT_NO_IMAGEIO)) +#define QT_NO_PICTURE +#endif + +// Translations via TQObject::trUtf8() +#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) +#define QT_NO_TRANSLATION_UTF8 +#endif + +// URL parser +#if !defined(QT_NO_URL) && (defined(QT_NO_DIR)) +#define QT_NO_URL +#endif + +// Animated images +#if !defined(QT_NO_MOVIE) && (defined(QT_NO_ASYNC_IO) || defined(QT_NO_ASYNC_IMAGE_IO)) +#define QT_NO_MOVIE +#endif + +// TQStyle +#if !defined(QT_NO_STYLE) && (defined(QT_NO_DRAWUTIL)) +#define QT_NO_STYLE +#endif + +// DNS +#if !defined(QT_NO_DNS) && (defined(QT_NO_NETWORK) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF)) +#define QT_NO_DNS +#endif + +// Framed widgets +#if !defined(QT_NO_FRAME) && (defined(QT_NO_STYLE)) +#define QT_NO_FRAME +#endif + +// TQIconSet +#if !defined(QT_NO_ICONSET) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_IMAGE_SMOOTHSCALE) || defined(QT_NO_PALETTE) || defined(QT_NO_IMAGE_HEURISTIC_MASK)) +#define QT_NO_ICONSET +#endif + +// XPM image I/O +#if !defined(QT_NO_IMAGEIO_XPM) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_SPRINTF) || defined(QT_NO_TEXTSTREAM)) +#define QT_NO_IMAGEIO_XPM +#endif + +// Network file access +#if !defined(QT_NO_NETWORKPROTOCOL) && (defined(QT_NO_TEXTCODEC) || defined(QT_NO_URL)) +#define QT_NO_NETWORKPROTOCOL +#endif + +// TQSizeGrip +#if !defined(QT_NO_SIZEGRIP) && (defined(QT_NO_STYLE)) +#define QT_NO_SIZEGRIP +#endif + +// Motif style +#if !defined(QT_NO_STYLE_MOTIF) && (defined(QT_NO_STYLE)) +#define QT_NO_STYLE_MOTIF +#endif + +// Windows style +#if !defined(QT_NO_STYLE_WINDOWS) && (defined(QT_NO_STYLE)) +#define QT_NO_STYLE_WINDOWS +#endif + +// Internal titlebar widget +#if !defined(QT_NO_TITLEBAR) && (defined(QT_NO_STYLE)) +#define QT_NO_TITLEBAR +#endif + +// XML +#if !defined(QT_NO_XML) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC) || defined(QT_NO_REGEXP_CAPTURE)) +#define QT_NO_XML +#endif + +// Check-boxes +#if !defined(QT_NO_CHECKBOX) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) +#define QT_NO_CHECKBOX +#endif + +// Dials +#if !defined(QT_NO_DIAL) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) +#define QT_NO_DIAL +#endif + +// TQLabel +#if !defined(QT_NO_LABEL) && (defined(QT_NO_FRAME)) +#define QT_NO_LABEL +#endif + +// TQLCDNumber +#if !defined(QT_NO_LCDNUMBER) && (defined(QT_NO_FRAME)) +#define QT_NO_LCDNUMBER +#endif + +// Single-line edits +#if !defined(QT_NO_LINEEDIT) && (defined(QT_NO_FRAME)) +#define QT_NO_LINEEDIT +#endif + +// MIME +#if !defined(QT_NO_MIME) && (defined(QT_NO_DIR) || defined(QT_NO_IMAGEIO) || defined(QT_NO_TEXTCODEC)) +#define QT_NO_MIME +#endif + +// Progress bars +#if !defined(QT_NO_PROGRESSBAR) && (defined(QT_NO_FRAME)) +#define QT_NO_PROGRESSBAR +#endif + +// Push-buttons +#if !defined(QT_NO_PUSHBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) +#define QT_NO_PUSHBUTTON +#endif + +// Radio-buttons +#if !defined(QT_NO_RADIOBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) +#define QT_NO_RADIOBUTTON +#endif + +// Internal resize handler +#if !defined(QT_NO_RESIZEHANDLER) && (defined(QT_NO_FRAME)) +#define QT_NO_RESIZEHANDLER +#endif + +// Scroll bars +#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) +#define QT_NO_SCROLLBAR +#endif + +// Sliders +#if !defined(QT_NO_SLIDER) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) +#define QT_NO_SLIDER +#endif + +// Spinbox control widget +#if !defined(QT_NO_SPINWIDGET) && (defined(QT_NO_FRAME)) +#define QT_NO_SPINWIDGET +#endif + +// Status bars +#if !defined(QT_NO_STATUSBAR) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE)) +#define QT_NO_STATUSBAR +#endif + +// Compact Windows style +#if !defined(QT_NO_STYLE_COMPACT) && (defined(QT_NO_STYLE_WINDOWS)) +#define QT_NO_STYLE_COMPACT +#endif + +// Interlace-friendly style +#if !defined(QT_NO_STYLE_INTERLACE) && (defined(QT_NO_STYLE_MOTIF)) +#define QT_NO_STYLE_INTERLACE +#endif + +// Platinum style +#if !defined(QT_NO_STYLE_PLATINUM) && (defined(QT_NO_STYLE_WINDOWS)) +#define QT_NO_STYLE_PLATINUM +#endif + +// Widget stacks +#if !defined(QT_NO_WIDGETSTACK) && (defined(QT_NO_FRAME)) +#define QT_NO_WIDGETSTACK +#endif + +// Grid layout widgets +#if !defined(QT_NO_GRID) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME)) +#define QT_NO_GRID +#endif + +// Group boxes +#if !defined(QT_NO_GROUPBOX) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT)) +#define QT_NO_GROUPBOX +#endif + +// Horizontal box layout widgets +#if !defined(QT_NO_HBOX) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME)) +#define QT_NO_HBOX +#endif + +// Menu-oriented widgets +#if !defined(QT_NO_MENUDATA) && (defined(QT_NO_ICONSET) || defined(QT_NO_VARIANT)) +#define QT_NO_MENUDATA +#endif + +// Persistent application settings +#if !defined(QT_NO_SETTINGS) && (defined(QT_NO_DIR) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_REGEXP_CAPTURE)) +#define QT_NO_SETTINGS +#endif + +// Splitters +#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT)) +#define QT_NO_SPLITTER +#endif + +// Table-like widgets +#if !defined(QT_NO_TABLEVIEW) && (defined(QT_NO_SCROLLBAR)) +#define QT_NO_TABLEVIEW +#endif + +// Tool tips +#if !defined(QT_NO_TOOLTIP) && (defined(QT_NO_LABEL)) +#define QT_NO_TOOLTIP +#endif + +// Cut and paste +#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_MIME)) +#define QT_NO_CLIPBOARD +#endif + +// Horizontal group boxes +#if !defined(QT_NO_HGROUPBOX) && (defined(QT_NO_GROUPBOX)) +#define QT_NO_HGROUPBOX +#endif + +// Properties +#if !defined(QT_NO_PROPERTIES) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST) || defined(QT_NO_ICONSET)) +#define QT_NO_PROPERTIES +#endif + +// RichText (HTML) display +#if !defined(QT_NO_RICHTEXT) && (defined(QT_NO_STYLE) || defined(QT_NO_LAYOUT) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM)) +#define QT_NO_RICHTEXT +#endif + +// SQL classes +#if !defined(QT_NO_SQL) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP_CAPTURE) || defined(QT_NO_VARIANT) || defined(QT_NO_SPRINTF) || defined(QT_NO_DATESTRING)) +#define QT_NO_SQL +#endif + +// CDE style +#if !defined(QT_NO_STYLE_CDE) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS)) +#define QT_NO_STYLE_CDE +#endif + +// Vertical box layout widgets +#if !defined(QT_NO_VBOX) && (defined(QT_NO_HBOX)) +#define QT_NO_VBOX +#endif + +// Button groups +#if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX) || defined(QT_NO_BUTTON)) +#define QT_NO_BUTTONGROUP +#endif + +// Complex scripts (eg. BiDi) +#if !defined(QT_NO_COMPLEXTEXT) && (defined(QT_NO_RICHTEXT)) +#define QT_NO_COMPLEXTEXT +#endif + +// Cut and paste non-text +#if !defined(QT_NO_MIMECLIPBOARD) && (defined(QT_NO_CLIPBOARD)) +#define QT_NO_MIMECLIPBOARD +#endif + +// Printing +#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_DATESTRING) || defined(QT_NO_REGEXP_CAPTURE)) +#define QT_NO_PRINTER +#endif + +// Aqua style +#if !defined(QT_NO_STYLE_AQUA) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGE_TRANSFORMATION)) +#define QT_NO_STYLE_AQUA +#endif + +// Vertical group boxes +#if !defined(QT_NO_VGROUPBOX) && (defined(QT_NO_HGROUPBOX)) +#define QT_NO_VGROUPBOX +#endif + +// Horizontal button groups +#if !defined(QT_NO_HBUTTONGROUP) && (defined(QT_NO_BUTTONGROUP)) +#define QT_NO_HBUTTONGROUP +#endif + +// Server to play sound +#if !defined(QT_NO_QWS_SOUNDSERVER) && (defined(QT_NO_SOUND) || defined(QT_NO_DIR) || defined(QT_NO_DNS)) +#define QT_NO_QWS_SOUNDSERVER +#endif + +// TQHeader +#if !defined(QT_NO_HEADER) && (defined(QT_NO_STYLE) || defined(QT_NO_ICONSET)) +#define QT_NO_HEADER +#endif + +// Vertical button groups +#if !defined(QT_NO_VBUTTONGROUP) && (defined(QT_NO_HBUTTONGROUP)) +#define QT_NO_VBUTTONGROUP +#endif + +// Hebrew Codec +#if !defined(QT_NO_CODEC_HEBREW) && (defined(QT_NO_CODECS) || defined(QT_NO_COMPLEXTEXT)) +#define QT_NO_CODEC_HEBREW +#endif + +// HTTP file access +#if !defined(QT_NO_NETWORKPROTOCOL_HTTP) && (defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS)) +#define QT_NO_NETWORKPROTOCOL_HTTP +#endif + +// Tool-buttons +#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_ICONSET) || defined(QT_NO_STYLE)) +#define QT_NO_TOOLBUTTON +#endif + +// Big Codecs (eg. CJK) +#if !defined(QT_NO_BIG_CODECS) && (defined(QT_NO_CODEC_HEBREW)) +#define QT_NO_BIG_CODECS +#endif + +// Experimental internal class +#if !defined(QT_NO_DIALOGBUTTONS) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE) || defined(QT_NO_PUSHBUTTON)) +#define QT_NO_DIALOGBUTTONS +#endif + +// Document Object Model +#if !defined(QT_NO_DOM) && (defined(QT_NO_XML) || defined(QT_NO_MIME)) +#define QT_NO_DOM +#endif + +// Scrollable view widgets +#if !defined(QT_NO_SCROLLVIEW) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_FRAME)) +#define QT_NO_SCROLLVIEW +#endif + +// Tab-bars +#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) +#define QT_NO_TABBAR +#endif + +// Drag and drop +#if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_MIME) || defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_IMAGEIO_XPM)) +#define QT_NO_DRAGANDDROP +#endif + +// TQGridView +#if !defined(QT_NO_GRIDVIEW) && (defined(QT_NO_SCROLLVIEW)) +#define QT_NO_GRIDVIEW +#endif + +// Popup-menus +#if !defined(QT_NO_POPUPMENU) && (defined(QT_NO_MENUDATA) || defined(QT_NO_FRAME)) +#define QT_NO_POPUPMENU +#endif + +// TQCanvas +#if !defined(QT_NO_CANVAS) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_BEZIER)) +#define QT_NO_CANVAS +#endif + +// Dynamic module linking +#if !defined(QT_NO_COMPONENT) && (defined(QT_NO_QUUID_STRING) || defined(QT_NO_SETTINGS) || defined(QT_NO_SPRINTF) || defined(QT_NO_LIBRARY) || defined(QT_NO_DATESTRING)) +#define QT_NO_COMPONENT +#endif + +// TQListBox +#if !defined(QT_NO_LISTBOX) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_STRINGLIST)) +#define QT_NO_LISTBOX +#endif + +// Menu bars +#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_POPUPMENU)) +#define QT_NO_MENUBAR +#endif + +// TQMessageBox +#if !defined(QT_NO_MESSAGEBOX) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LABEL)) +#define QT_NO_MESSAGEBOX +#endif + +// FTP file access +#if !defined(QT_NO_NETWORKPROTOCOL_FTP) && (defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS) || defined(QT_NO_TEXTDATE)) +#define QT_NO_NETWORKPROTOCOL_FTP +#endif + +// Spin boxes +#if !defined(QT_NO_SPINBOX) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) +#define QT_NO_SPINBOX +#endif + +// RichText (HTML) tables and images +#if !defined(QT_NO_TEXTCUSTOMITEM) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_MIME)) +#define QT_NO_TEXTCUSTOMITEM +#endif + +// TQDateTimeEdit +#if !defined(QT_NO_DATETIMEEDIT) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_SPINWIDGET) || defined(QT_NO_DATESTRING)) +#define QT_NO_DATETIMEEDIT +#endif + +// TQTextCodecPlugin +#if !defined(QT_NO_TEXTCODECPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_TEXTCODEC)) +#define QT_NO_TEXTCODECPLUGIN +#endif + +// TQImageFormatPlugin +#if !defined(QT_NO_IMAGEFORMATPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_IMAGEIO)) +#define QT_NO_IMAGEFORMATPLUGIN +#endif + +// TQSqlForm +#if !defined(QT_NO_SQL_FORM) && (defined(QT_NO_SQL) || defined(QT_NO_PROPERTIES)) +#define QT_NO_SQL_FORM +#endif + +// Scalable Vector Graphics (SVG) +#if !defined(QT_NO_SVG) && (defined(QT_NO_DOM) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_SPRINTF)) +#define QT_NO_SVG +#endif + +// TQIconView +#if !defined(QT_NO_ICONVIEW) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_IMAGEIO_XPM) || defined(QT_NO_IMAGE_HEURISTIC_MASK)) +#define QT_NO_ICONVIEW +#endif + +// Tab widgets +#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_WIDGETSTACK)) +#define QT_NO_TABWIDGET +#endif + +// "What's this" help +#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLTIP) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_WHATSTHIS +#endif + +// TQWidgetPlugin +#if !defined(QT_NO_WIDGETPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_ICONSET)) +#define QT_NO_WIDGETPLUGIN +#endif + +// TQProgressDialog +#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_SEMIMODAL) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_PROGRESSBAR)) +#define QT_NO_PROGRESSDIALOG +#endif + +// Motif-plus style +#if !defined(QT_NO_STYLE_MOTIFPLUS) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_BUTTON) || defined(QT_NO_SCROLLBAR) || defined(QT_NO_SLIDER)) +#define QT_NO_STYLE_MOTIFPLUS +#endif + +// Rich text edit +#if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_SCROLLVIEW)) +#define QT_NO_TEXTEDIT +#endif + +// TQWizard +#if !defined(QT_NO_WIZARD) && (defined(QT_NO_DIALOG) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL)) +#define QT_NO_WIZARD +#endif + +// Multi-line edits +#if !defined(QT_NO_MULTILINEEDIT) && (defined(QT_NO_TEXTEDIT)) +#define QT_NO_MULTILINEEDIT +#endif + +// Rich text syntax highlighting +#if !defined(QT_NO_SYNTAXHIGHLIGHTER) && (defined(QT_NO_TEXTEDIT)) +#define QT_NO_SYNTAXHIGHLIGHTER +#endif + +// TQTextView +#if !defined(QT_NO_TEXTVIEW) && (defined(QT_NO_TEXTEDIT)) +#define QT_NO_TEXTVIEW +#endif + +// TQTabDialog +#if !defined(QT_NO_TABDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LAYOUT) || defined(QT_NO_TABWIDGET)) +#define QT_NO_TABDIALOG +#endif + +// TQTextBrowser +#if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTVIEW) || defined(QT_NO_MIME)) +#define QT_NO_TEXTBROWSER +#endif + +// TQListView +#if !defined(QT_NO_LISTVIEW) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_HEADER) || defined(QT_NO_LINEEDIT)) +#define QT_NO_LISTVIEW +#endif + +// TQComboBox +#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LISTBOX) || defined(QT_NO_LINEEDIT) || defined(QT_NO_POPUPMENU)) +#define QT_NO_COMBOBOX +#endif + +// TQColorDialog +#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR) || defined(QT_NO_GRIDVIEW) || defined(QT_NO_LAYOUT)) +#define QT_NO_COLORDIALOG +#endif + +// Tool box +#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_ICONSET) || defined(QT_NO_SCROLLVIEW) || defined(QT_NO_TOOLTIP) || defined(QT_NO_LAYOUT) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_TOOLBOX +#endif + +// SGI style +#if !defined(QT_NO_STYLE_SGI) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_BUTTON) || defined(QT_NO_SCROLLBAR) || defined(QT_NO_SLIDER) || defined(QT_NO_LINEEDIT) || defined(QT_NO_MENUBAR)) +#define QT_NO_STYLE_SGI +#endif + +// TQErrorMessage +#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LABEL) || defined(QT_NO_CHECKBOX) || defined(QT_NO_TEXTVIEW)) +#define QT_NO_ERRORMESSAGE +#endif + +// Main-windows +#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_POPUPMENU) || defined(QT_NO_TITLEBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_STATUSBAR)) +#define QT_NO_MAINWINDOW +#endif + +// Toolbars +#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) +#define QT_NO_TOOLBAR +#endif + +// TQAction +#if !defined(QT_NO_ACTION) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_COMBOBOX)) +#define QT_NO_ACTION +#endif + +// TQTable +#if !defined(QT_NO_TABLE) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_HEADER) || defined(QT_NO_CHECKBOX)) +#define QT_NO_TABLE +#endif + +// TQFontDialog +#if !defined(QT_NO_FONTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_CHECKBOX) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_VGROUPBOX) || defined(QT_NO_VALIDATOR)) +#define QT_NO_FONTDIALOG +#endif + +// TQInputDialog +#if !defined(QT_NO_INPUTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_SPINBOX) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_LAYOUT)) +#define QT_NO_INPUTDIALOG +#endif + +// SQL value editor widgets +#if !defined(QT_NO_SQL_EDIT_WIDGETS) && (defined(QT_NO_SQL) || defined(QT_NO_SPINBOX) || defined(QT_NO_COMBOBOX) || defined(QT_NO_CHECKBOX) || defined(QT_NO_DATETIMEEDIT)) +#define QT_NO_SQL_EDIT_WIDGETS +#endif + +// TQPrintDialog +#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_RADIOBUTTON) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_DIR)) +#define QT_NO_PRINTDIALOG +#endif + +// TQFileDialog +#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_MESSAGEBOX) || defined(QT_NO_LISTVIEW) || defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_SEMIMODAL) || defined(QT_NO_REGEXP_CAPTURE) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_VBOX) || defined(QT_NO_SPLITTER) || defined(QT_NO_PROGRESSBAR) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_DATESTRING)) +#define QT_NO_FILEDIALOG +#endif + +// SQL table widgets +#if !defined(QT_NO_SQL_VIEW_WIDGETS) && (defined(QT_NO_SQL_FORM) || defined(QT_NO_SQL_EDIT_WIDGETS) || defined(QT_NO_TABLE)) +#define QT_NO_SQL_VIEW_WIDGETS +#endif + +// TQWorkSpace +#if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_VBOX) || defined(QT_NO_TITLEBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_POPUPMENU) || defined(QT_NO_LABEL) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MENUBAR)) +#define QT_NO_WORKSPACE +#endif + +// Input method +#if !defined(QT_NO_IM) && (defined(QT_NO_STRINGLIST)) +#define QT_NO_IM +#endif + +// Input method extensions +#if !defined(QT_NO_IM_EXTENSIONS) && (defined(QT_NO_IM) || defined(QT_NO_STRINGLIST)) +#define QT_NO_IM_EXTENSIONS +#endif + diff --git a/src/tools/ntqfile.h b/src/tools/ntqfile.h new file mode 100644 index 000000000..40ad46856 --- /dev/null +++ b/src/tools/ntqfile.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Definition of TQFile class +** +** Created : 930831 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFILE_H +#define TQFILE_H + +#ifndef QT_H +#include "ntqiodevice.h" +#include "ntqstring.h" +#include +#endif // QT_H + +class TQDir; +class TQFilePrivate; + +class Q_EXPORT TQFile : public TQIODevice // file I/O device class +{ +public: + TQFile(); + TQFile( const TQString &name ); + ~TQFile(); + + TQString name() const; + void setName( const TQString &name ); + + typedef TQCString (*EncoderFn)( const TQString &fileName ); + typedef TQString (*DecoderFn)( const TQCString &localfileName ); + static TQCString encodeName( const TQString &fileName ); + static TQString decodeName( const TQCString &localFileName ); + static void setEncodingFunction( EncoderFn ); + static void setDecodingFunction( DecoderFn ); + + bool exists() const; + static bool exists( const TQString &fileName ); + + bool remove(); + static bool remove( const TQString &fileName ); + + bool open( int ); + bool open( int, FILE * ); + bool open( int, int ); + void close(); + void flush(); + + Offset size() const; + Offset at() const; + bool at( Offset ); + bool atEnd() const; + + Q_LONG readBlock( char *data, Q_ULONG len ); + Q_LONG writeBlock( const char *data, Q_ULONG len ); + Q_LONG writeBlock( const TQByteArray& data ) + { return TQIODevice::writeBlock(data); } + Q_LONG readLine( char *data, Q_ULONG maxlen ); + Q_LONG readLine( TQString &, Q_ULONG maxlen ); + + int getch(); + int putch( int ); + int ungetch( int ); + + int handle() const; + + TQString errorString() const; // ### TQt 4: move into TQIODevice + +protected: + void setErrorString( const TQString& ); // ### TQt 4: move into TQIODevice + TQString fn; + FILE *fh; + int fd; + Offset length; + bool ext_f; + TQFilePrivate *d; // ### TQt 4: make private + +private: + void init(); + void setErrorStringErrno( int ); + TQCString ungetchBuffer; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQFile( const TQFile & ); + TQFile &operator=( const TQFile & ); +#endif +}; + + +inline TQString TQFile::name() const +{ return fn; } + +inline TQIODevice::Offset TQFile::at() const +{ return ioIndex; } + + +#endif // TQFILE_H diff --git a/src/tools/ntqfileinfo.h b/src/tools/ntqfileinfo.h new file mode 100644 index 000000000..36cf4d7a2 --- /dev/null +++ b/src/tools/ntqfileinfo.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Definition of TQFileInfo class +** +** Created : 950628 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFILEINFO_H +#define TQFILEINFO_H + +#ifndef QT_H +#include "ntqfile.h" +#include "ntqdatetime.h" +#endif // QT_H + + +class TQDir; +struct TQFileInfoCache; +template class TQDeepCopy; + + +class Q_EXPORT TQFileInfo +{ +public: + enum PermissionSpec { + ReadOwner = 04000, WriteOwner = 02000, ExeOwner = 01000, + ReadUser = 00400, WriteUser = 00200, ExeUser = 00100, + ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010, + ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 }; + + TQFileInfo(); + TQFileInfo( const TQString &file ); + TQFileInfo( const TQFile & ); +#ifndef QT_NO_DIR + TQFileInfo( const TQDir &, const TQString &fileName ); +#endif + TQFileInfo( const TQFileInfo & ); + ~TQFileInfo(); + + TQFileInfo &operator=( const TQFileInfo & ); + + void setFile( const TQString &file ); + void setFile( const TQFile & ); +#ifndef QT_NO_DIR + void setFile( const TQDir &, const TQString &fileName ); +#endif + bool exists() const; + void refresh() const; + bool caching() const; + void setCaching( bool ); + + TQString filePath() const; + TQString fileName() const; +#ifndef QT_NO_DIR //### + TQString absFilePath() const; +#endif + TQString baseName( bool complete = FALSE ) const; + TQString extension( bool complete = TRUE ) const; + +#ifndef QT_NO_DIR //### + TQString dirPath( bool absPath = FALSE ) const; +#endif +#ifndef QT_NO_DIR + TQDir dir( bool absPath = FALSE ) const; +#endif + bool isReadable() const; + bool isWritable() const; + bool isExecutable() const; + bool isHidden() const; + +#ifndef QT_NO_DIR //### + bool isRelative() const; + bool convertToAbs(); +#endif + + bool isFile() const; + bool isDir() const; + bool isSymLink() const; + + TQString readLink() const; + + TQString owner() const; + uint ownerId() const; + TQString group() const; + uint groupId() const; + + bool permission( int permissionSpec ) const; + +#if (QT_VERSION-0 >= 0x040000) +#error "TQFileInfo::size() should return TQIODevice::Offset instead of uint" +#elif defined(QT_ABI_QT4) + TQIODevice::Offset size() const; +#else + uint size() const; +#endif + + TQDateTime created() const; + TQDateTime lastModified() const; + TQDateTime lastRead() const; + +private: + void doStat() const; + static void slashify( TQString & ); + static void makeAbs( TQString & ); + + TQString fn; + TQFileInfoCache *fic; + bool cache; +#if defined(Q_OS_UNIX) + bool symLink; +#endif + + void detach(); + friend class TQDeepCopy< TQFileInfo >; +}; + + +inline bool TQFileInfo::caching() const +{ + return cache; +} + + +#endif // TQFILEINFO_H diff --git a/src/tools/ntqgarray.h b/src/tools/ntqgarray.h new file mode 100644 index 000000000..76a5cf34a --- /dev/null +++ b/src/tools/ntqgarray.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Definition of TQGArray class +** +** Created : 930906 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGARRAY_H +#define TQGARRAY_H + +#ifndef QT_H +#include "ntqshared.h" +#endif // QT_H + + +class Q_EXPORT TQGArray // generic array +{ +friend class TQBuffer; +public: + // do not use this, even though this is public + // ### make protected or private in TQt 4.0 beta? + struct array_data : public TQShared { // shared array + array_data():data(0),len(0) +#ifdef QT_QGARRAY_SPEED_OPTIM + ,maxl(0) +#endif + {} + char *data; // actual array data + uint len; +#ifdef QT_QGARRAY_SPEED_OPTIM + uint maxl; +#endif + }; + TQGArray(); + enum Optimization { MemOptim, SpeedOptim }; +protected: + TQGArray( int, int ); // dummy; does not alloc + TQGArray( int size ); // allocate 'size' bytes + TQGArray( const TQGArray &a ); // shallow copy + virtual ~TQGArray(); + + TQGArray &operator=( const TQGArray &a ) { return assign( a ); } + + virtual void detach() { duplicate(*this); } + + // ### TQt 4.0: maybe provide two versions of data(), at(), etc. + char *data() const { return shd->data; } + uint nrefs() const { return shd->count; } + uint size() const { return shd->len; } + bool isEqual( const TQGArray &a ) const; + + bool resize( uint newsize, Optimization optim ); + bool resize( uint newsize ); + + bool fill( const char *d, int len, uint sz ); + + TQGArray &assign( const TQGArray &a ); + TQGArray &assign( const char *d, uint len ); + TQGArray &duplicate( const TQGArray &a ); + TQGArray &duplicate( const char *d, uint len ); + void store( const char *d, uint len ); + + array_data *sharedBlock() const { return shd; } + void setSharedBlock( array_data *p ) { shd=(array_data*)p; } + + TQGArray &setRawData( const char *d, uint len ); + void resetRawData( const char *d, uint len ); + + int find( const char *d, uint index, uint sz ) const; + int contains( const char *d, uint sz ) const; + + void sort( uint sz ); + int bsearch( const char *d, uint sz ) const; + + char *at( uint index ) const; + + bool setExpand( uint index, const char *d, uint sz ); + +protected: + virtual array_data *newData(); + virtual void deleteData( array_data *p ); + +private: + static void msg_index( uint ); + array_data *shd; +}; + + +inline char *TQGArray::at( uint index ) const +{ +#if defined(QT_CHECK_RANGE) + if ( index >= size() ) { + msg_index( index ); + index = 0; + } +#endif + return &shd->data[index]; +} + + +#endif // TQGARRAY_H diff --git a/src/tools/ntqgcache.h b/src/tools/ntqgcache.h new file mode 100644 index 000000000..d9a3e1edb --- /dev/null +++ b/src/tools/ntqgcache.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Definition of TQGCache and TQGCacheIterator classes +** +** Created : 950208 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGCACHE_H +#define TQGCACHE_H + +#ifndef QT_H +#include "ntqptrcollection.h" +#include "ntqglist.h" +#include "ntqgdict.h" +#endif // QT_H + + +class TQCList; // internal classes +class TQCListIt; +class TQCDict; + + +class Q_EXPORT TQGCache : public TQPtrCollection // generic LRU cache +{ +friend class TQGCacheIterator; +protected: + enum KeyType { StringKey, AsciiKey, IntKey, PtrKey }; + // identical to TQGDict's, but PtrKey is not used at the moment + + TQGCache( int maxCost, uint size, KeyType kt, bool caseSensitive, + bool copyKeys ); + TQGCache( const TQGCache & ); // not allowed, calls fatal() + ~TQGCache(); + TQGCache &operator=( const TQGCache & ); // not allowed, calls fatal() + + uint count() const; + uint size() const; + int maxCost() const { return mCost; } + int totalCost() const { return tCost; } + void setMaxCost( int maxCost ); + void clear(); + + bool insert_string( const TQString &key, TQPtrCollection::Item, + int cost, int priority ); + bool insert_other( const char *key, TQPtrCollection::Item, + int cost, int priority ); + bool remove_string( const TQString &key ); + bool remove_other( const char *key ); + TQPtrCollection::Item take_string( const TQString &key ); + TQPtrCollection::Item take_other( const char *key ); + + TQPtrCollection::Item find_string( const TQString &key, bool ref=TRUE ) const; + TQPtrCollection::Item find_other( const char *key, bool ref=TRUE ) const; + + void statistics() const; + +private: + bool makeRoomFor( int cost, int priority = -1 ); + KeyType keytype; + TQCList *lruList; + TQCDict *dict; + int mCost; + int tCost; + bool copyk; +}; + + +class Q_EXPORT TQGCacheIterator // generic cache iterator +{ +protected: + TQGCacheIterator( const TQGCache & ); + TQGCacheIterator( const TQGCacheIterator & ); + ~TQGCacheIterator(); + TQGCacheIterator &operator=( const TQGCacheIterator & ); + + uint count() const; + bool atFirst() const; + bool atLast() const; + TQPtrCollection::Item toFirst(); + TQPtrCollection::Item toLast(); + + TQPtrCollection::Item get() const; + TQString getKeyString() const; + const char *getKeyAscii() const; + long getKeyInt() const; + + TQPtrCollection::Item operator()(); + TQPtrCollection::Item operator++(); + TQPtrCollection::Item operator+=( uint ); + TQPtrCollection::Item operator--(); + TQPtrCollection::Item operator-=( uint ); + +protected: + TQCListIt *it; // iterator on cache list +}; + + +#endif // TQGCACHE_H diff --git a/src/tools/ntqgdict.h b/src/tools/ntqgdict.h new file mode 100644 index 000000000..5465fd2f2 --- /dev/null +++ b/src/tools/ntqgdict.h @@ -0,0 +1,225 @@ +/**************************************************************************** +** +** Definition of TQGDict and TQGDictIterator classes +** +** Created : 920529 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGDICT_H +#define TQGDICT_H + +#ifndef QT_H +#include "ntqptrcollection.h" +#include "ntqstring.h" +#endif // QT_H + +class TQGDictIterator; +class TQGDItList; + + +class TQBaseBucket // internal dict node +{ +public: + TQPtrCollection::Item getData() { return data; } + TQPtrCollection::Item setData( TQPtrCollection::Item d ) { return data = d; } + TQBaseBucket *getNext() { return next; } + void setNext( TQBaseBucket *n) { next = n; } +protected: + TQBaseBucket( TQPtrCollection::Item d, TQBaseBucket *n ) : data(d), next(n) {} + TQPtrCollection::Item data; + TQBaseBucket *next; +}; + +class TQStringBucket : public TQBaseBucket +{ +public: + TQStringBucket( const TQString &k, TQPtrCollection::Item d, TQBaseBucket *n ) + : TQBaseBucket(d,n), key(k) {} + const TQString &getKey() const { return key; } +private: + TQString key; +}; + +class TQAsciiBucket : public TQBaseBucket +{ +public: + TQAsciiBucket( const char *k, TQPtrCollection::Item d, TQBaseBucket *n ) + : TQBaseBucket(d,n), key(k) {} + const char *getKey() const { return key; } +private: + const char *key; +}; + +class TQIntBucket : public TQBaseBucket +{ +public: + TQIntBucket( long k, TQPtrCollection::Item d, TQBaseBucket *n ) + : TQBaseBucket(d,n), key(k) {} + long getKey() const { return key; } +private: + long key; +}; + +class TQPtrBucket : public TQBaseBucket +{ +public: + TQPtrBucket( void *k, TQPtrCollection::Item d, TQBaseBucket *n ) + : TQBaseBucket(d,n), key(k) {} + void *getKey() const { return key; } +private: + void *key; +}; + + +class Q_EXPORT TQGDict : public TQPtrCollection // generic dictionary class +{ +public: + uint count() const { return numItems; } + uint size() const { return vlen; } + TQPtrCollection::Item look_string( const TQString& key, TQPtrCollection::Item, + int ); + TQPtrCollection::Item look_ascii( const char *key, TQPtrCollection::Item, int ); + TQPtrCollection::Item look_int( long key, TQPtrCollection::Item, int ); + TQPtrCollection::Item look_ptr( void *key, TQPtrCollection::Item, int ); +#ifndef QT_NO_DATASTREAM + TQDataStream &read( TQDataStream & ); + TQDataStream &write( TQDataStream & ) const; +#endif +protected: + enum KeyType { StringKey, AsciiKey, IntKey, PtrKey }; + + TQGDict( uint len, KeyType kt, bool cs, bool ck ); + TQGDict( const TQGDict & ); + ~TQGDict(); + + TQGDict &operator=( const TQGDict & ); + + bool remove_string( const TQString &key, TQPtrCollection::Item item=0 ); + bool remove_ascii( const char *key, TQPtrCollection::Item item=0 ); + bool remove_int( long key, TQPtrCollection::Item item=0 ); + bool remove_ptr( void *key, TQPtrCollection::Item item=0 ); + TQPtrCollection::Item take_string( const TQString &key ); + TQPtrCollection::Item take_ascii( const char *key ); + TQPtrCollection::Item take_int( long key ); + TQPtrCollection::Item take_ptr( void *key ); + + void clear(); + void resize( uint ); + + int hashKeyString( const TQString & ); + int hashKeyAscii( const char * ); + + void statistics() const; + +#ifndef QT_NO_DATASTREAM + virtual TQDataStream &read( TQDataStream &, TQPtrCollection::Item & ); + virtual TQDataStream &write( TQDataStream &, TQPtrCollection::Item ) const; +#endif +private: + TQBaseBucket **vec; + uint vlen; + uint numItems; + uint keytype : 2; + uint cases : 1; + uint copyk : 1; + TQGDItList *iterators; + void unlink_common( int, TQBaseBucket *, TQBaseBucket * ); + TQStringBucket *unlink_string( const TQString &, + TQPtrCollection::Item item = 0 ); + TQAsciiBucket *unlink_ascii( const char *, TQPtrCollection::Item item = 0 ); + TQIntBucket *unlink_int( long, TQPtrCollection::Item item = 0 ); + TQPtrBucket *unlink_ptr( void *, TQPtrCollection::Item item = 0 ); + void init( uint, KeyType, bool, bool ); + friend class TQGDictIterator; +}; + + +class Q_EXPORT TQGDictIterator // generic dictionary iterator +{ +friend class TQGDict; +public: + TQGDictIterator( const TQGDict & ); + TQGDictIterator( const TQGDictIterator & ); + TQGDictIterator &operator=( const TQGDictIterator & ); + ~TQGDictIterator(); + + TQPtrCollection::Item toFirst(); + + TQPtrCollection::Item get() const; + TQString getKeyString() const; + const char *getKeyAscii() const; + long getKeyInt() const; + void *getKeyPtr() const; + + TQPtrCollection::Item operator()(); + TQPtrCollection::Item operator++(); + TQPtrCollection::Item operator+=(uint); + +protected: + TQGDict *dict; + +private: + TQBaseBucket *curNode; + uint curIndex; +}; + +inline TQPtrCollection::Item TQGDictIterator::get() const +{ + return curNode ? curNode->getData() : 0; +} + +inline TQString TQGDictIterator::getKeyString() const +{ + return curNode ? ((TQStringBucket*)curNode)->getKey() : TQString::null; +} + +inline const char *TQGDictIterator::getKeyAscii() const +{ + return curNode ? ((TQAsciiBucket*)curNode)->getKey() : 0; +} + +inline long TQGDictIterator::getKeyInt() const +{ + return curNode ? ((TQIntBucket*)curNode)->getKey() : 0; +} + +inline void *TQGDictIterator::getKeyPtr() const +{ + return curNode ? ((TQPtrBucket*)curNode)->getKey() : 0; +} + + +#endif // TQGDICT_H diff --git a/src/tools/ntqgeneric.h b/src/tools/ntqgeneric.h new file mode 100644 index 000000000..b82f18849 --- /dev/null +++ b/src/tools/ntqgeneric.h @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Macros for pasting tokens; utilized by our generic classes +** +** Created : 920529 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGENERIC_H +#define TQGENERIC_H + +#error "do not include ntqgeneric.h any more" + +#endif // TQGENERIC_H diff --git a/src/tools/ntqglist.h b/src/tools/ntqglist.h new file mode 100644 index 000000000..41363a2f9 --- /dev/null +++ b/src/tools/ntqglist.h @@ -0,0 +1,271 @@ +/**************************************************************************** +** +** Definition of TQGList and TQGListIterator classes +** +** Created : 920624 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGLIST_H +#define TQGLIST_H + +#ifndef QT_H +#include "ntqptrcollection.h" +#endif // QT_H + +class Q_EXPORT TQLNode +{ +friend class TQGList; +friend class TQGListIterator; +friend class TQGListStdIterator; +public: + TQPtrCollection::Item getData() { return data; } +private: + TQPtrCollection::Item data; + TQLNode *prev; + TQLNode *next; + TQLNode( TQPtrCollection::Item d ) { data = d; } +}; + +class TQGListIteratorList; // internal helper class + +class Q_EXPORT TQGList : public TQPtrCollection // doubly linked generic list +{ +friend class TQGListIterator; +friend class TQGListIteratorList; +friend class TQGVector; // needed by TQGVector::toList +public: + uint count() const; // return number of nodes + +#ifndef QT_NO_DATASTREAM + TQDataStream &read( TQDataStream & ); // read list from stream + TQDataStream &write( TQDataStream & ) const; // write list to stream +#endif +protected: + TQGList(); // create empty list + TQGList( const TQGList & ); // make copy of other list + virtual ~TQGList(); + + TQGList &operator=( const TQGList & ); // assign from other list + bool operator==( const TQGList& ) const; + + void inSort( TQPtrCollection::Item ); // add item sorted in list + void append( TQPtrCollection::Item ); // add item at end of list + bool insertAt( uint index, TQPtrCollection::Item ); // add item at i'th position + void relinkNode( TQLNode * ); // relink as first item + bool removeNode( TQLNode * ); // remove node + bool remove( TQPtrCollection::Item = 0 ); // remove item (0=current) + bool removeRef( TQPtrCollection::Item = 0 ); // remove item (0=current) + bool removeFirst(); // remove first item + bool removeLast(); // remove last item + bool removeAt( uint ); // remove item at i'th position + bool replaceAt( uint, TQPtrCollection::Item ); // replace item at position i with item + TQPtrCollection::Item takeNode( TQLNode * ); // take out node + TQPtrCollection::Item take(); // take out current item + TQPtrCollection::Item takeAt( uint index ); // take out item at i'th pos + TQPtrCollection::Item takeFirst(); // take out first item + TQPtrCollection::Item takeLast(); // take out last item + + void sort(); // sort all items; + void clear(); // remove all items + + int findRef( TQPtrCollection::Item, bool = TRUE ); // find exact item in list + int find( TQPtrCollection::Item, bool = TRUE ); // find equal item in list + + uint containsRef( TQPtrCollection::Item ) const; // get number of exact matches + uint contains( TQPtrCollection::Item ) const; // get number of equal matches + + TQPtrCollection::Item at( uint index ); // access item at i'th pos + int at() const; // get current index + TQLNode *currentNode() const; // get current node + + TQPtrCollection::Item get() const; // get current item + + TQPtrCollection::Item cfirst() const; // get ptr to first list item + TQPtrCollection::Item clast() const; // get ptr to last list item + TQPtrCollection::Item first(); // set first item in list curr + TQPtrCollection::Item last(); // set last item in list curr + TQPtrCollection::Item next(); // set next item in list curr + TQPtrCollection::Item prev(); // set prev item in list curr + + void toVector( TQGVector * ) const; // put items in vector + + virtual int compareItems( TQPtrCollection::Item, TQPtrCollection::Item ); + +#ifndef QT_NO_DATASTREAM + virtual TQDataStream &read( TQDataStream &, TQPtrCollection::Item & ); + virtual TQDataStream &write( TQDataStream &, TQPtrCollection::Item ) const; +#endif + + TQLNode* begin() const { return firstNode; } + TQLNode* end() const { return 0; } + TQLNode* erase( TQLNode* it ); + +private: + void prepend( TQPtrCollection::Item ); // add item at start of list + + void heapSortPushDown( TQPtrCollection::Item* heap, int first, int last ); + + TQLNode *firstNode; // first node + TQLNode *lastNode; // last node + TQLNode *curNode; // current node + int curIndex; // current index + uint numNodes; // number of nodes + TQGListIteratorList *iterators; // list of iterators + + TQLNode *locate( uint ); // get node at i'th pos + TQLNode *unlink(); // unlink node +}; + + +inline uint TQGList::count() const +{ + return numNodes; +} + +inline bool TQGList::removeFirst() +{ + first(); + return remove(); +} + +inline bool TQGList::removeLast() +{ + last(); + return remove(); +} + +inline int TQGList::at() const +{ + return curIndex; +} + +inline TQPtrCollection::Item TQGList::at( uint index ) +{ + TQLNode *n = locate( index ); + return n ? n->data : 0; +} + +inline TQLNode *TQGList::currentNode() const +{ + return curNode; +} + +inline TQPtrCollection::Item TQGList::get() const +{ + return curNode ? curNode->data : 0; +} + +inline TQPtrCollection::Item TQGList::cfirst() const +{ + return firstNode ? firstNode->data : 0; +} + +inline TQPtrCollection::Item TQGList::clast() const +{ + return lastNode ? lastNode->data : 0; +} + + +/***************************************************************************** + TQGList stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQGList & ); +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQGList & ); +#endif + +/***************************************************************************** + TQGListIterator class + *****************************************************************************/ + +class Q_EXPORT TQGListIterator // TQGList iterator +{ +friend class TQGList; +friend class TQGListIteratorList; +protected: + TQGListIterator( const TQGList & ); + TQGListIterator( const TQGListIterator & ); + TQGListIterator &operator=( const TQGListIterator & ); + ~TQGListIterator(); + + bool atFirst() const; // test if at first item + bool atLast() const; // test if at last item + TQPtrCollection::Item toFirst(); // move to first item + TQPtrCollection::Item toLast(); // move to last item + + TQPtrCollection::Item get() const; // get current item + TQPtrCollection::Item operator()(); // get current and move to next + TQPtrCollection::Item operator++(); // move to next item (prefix) + TQPtrCollection::Item operator+=(uint); // move n positions forward + TQPtrCollection::Item operator--(); // move to prev item (prefix) + TQPtrCollection::Item operator-=(uint); // move n positions backward + +protected: + TQGList *list; // reference to list + +private: + TQLNode *curNode; // current node in list +}; + + +inline bool TQGListIterator::atFirst() const +{ + return curNode == list->firstNode; +} + +inline bool TQGListIterator::atLast() const +{ + return curNode == list->lastNode; +} + +inline TQPtrCollection::Item TQGListIterator::get() const +{ + return curNode ? curNode->data : 0; +} + +class Q_EXPORT TQGListStdIterator +{ +public: + inline TQGListStdIterator( TQLNode* n ) : node( n ){} + inline operator TQLNode* () { return node; } +protected: + inline TQLNode *next() { return node->next; } + TQLNode *node; +}; + + +#endif // TQGLIST_H diff --git a/src/tools/ntqglobal.h b/src/tools/ntqglobal.h new file mode 100644 index 000000000..34d9acea2 --- /dev/null +++ b/src/tools/ntqglobal.h @@ -0,0 +1,1141 @@ +/**************************************************************************** +** +** Global type declarations and definitions +** +** Created : 920529 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGLOBAL_H +#define TQGLOBAL_H + +#define TQT_REAL_TQT 1 + +#define QT_VERSION_STR "3.4.0" +/* + QT_VERSION is (major << 16) + (minor << 8) + patch. + */ +#define QT_VERSION 0x030400 + +/* + The operating system, must be one of: (Q_OS_x) + + MACX - Mac OS X + MAC9 - Mac OS 9 + DARWIN - Darwin OS (Without Mac OS X) + MSDOS - MS-DOS and Windows + OS2 - OS/2 + OS2EMX - XFree86 on OS/2 (not PM) + WIN32 - Win32 (Windows 95/98/ME and Windows NT/2000/XP) + CYGWIN - Cygwin + SOLARIS - Sun Solaris + HPUX - HP-UX + ULTRIX - DEC Ultrix + LINUX - Linux + FREEBSD - FreeBSD + NETBSD - NetBSD + OPENBSD - OpenBSD + BSDI - BSD/OS + IRIX - SGI Irix + OSF - HP Tru64 UNIX + SCO - SCO OpenServer 5 + UNIXWARE - UnixWare 7, Open UNIX 8 + AIX - AIX + HURD - GNU Hurd + DGUX - DG/UX + RELIANT - Reliant UNIX + DYNIX - DYNIX/ptx + TQNX - TQNX + TQNX6 - TQNX RTP 6.1 + LYNX - LynxOS + BSD4 - Any BSD 4.4 system + UNIX - Any UNIX BSD/SYSV system +*/ + +#if defined(__DARWIN_X11__) +# define Q_OS_DARWIN +#elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__)) +# define Q_OS_MACX +#elif defined(__MACOSX__) +# define Q_OS_MACX +#elif defined(macintosh) +# define Q_OS_MAC9 +#elif defined(__CYGWIN__) +# define Q_OS_CYGWIN +#elif defined(MSDOS) || defined(_MSDOS) +# define Q_OS_MSDOS +#elif defined(__OS2__) +# if defined(__EMX__) +# define Q_OS_OS2EMX +# else +# define Q_OS_OS2 +# endif +#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) +# define Q_OS_WIN32 +# define Q_OS_WIN64 +#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) +# define Q_OS_WIN32 +#elif defined(__MWERKS__) && defined(__INTEL__) +# define Q_OS_WIN32 +#elif defined(__sun) || defined(sun) +# define Q_OS_SOLARIS +#elif defined(hpux) || defined(__hpux) +# define Q_OS_HPUX +#elif defined(__ultrix) || defined(ultrix) +# define Q_OS_ULTRIX +#elif defined(sinix) +# define Q_OS_RELIANT +#elif defined(__GNU__) +# define Q_OS_HURD +#elif defined(__linux__) || defined(__linux) || defined(__GNU__) || defined(__GLIBC__) +# define Q_OS_LINUX +#elif defined(__FreeBSD__) || defined(__DragonFly__) +# define Q_OS_FREEBSD +# define Q_OS_BSD4 +#elif defined(__NetBSD__) +# define Q_OS_NETBSD +# define Q_OS_BSD4 +#elif defined(__OpenBSD__) +# define Q_OS_OPENBSD +# define Q_OS_BSD4 +#elif defined(__bsdi__) +# define Q_OS_BSDI +# define Q_OS_BSD4 +#elif defined(__sgi) +# define Q_OS_IRIX +#elif defined(__osf__) +# define Q_OS_OSF +#elif defined(_AIX) +# define Q_OS_AIX +#elif defined(__Lynx__) +# define Q_OS_LYNX +#elif defined(__DGUX__) +# define Q_OS_DGUX +#elif defined(__QNXNTO__) +# define Q_OS_QNX6 +#elif defined(__QNX__) +# define Q_OS_QNX +#elif defined(_SETQUENT_) +# define Q_OS_DYNIX +#elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */ +# define Q_OS_SCO +#elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */ +# define Q_OS_UNIXWARE +# define Q_OS_UNIXWARE7 +#elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */ +# define Q_OS_UNIXWARE +# define Q_OS_UNIXWARE7 +#elif defined(__MAKEDEPEND__) +#else +# error "TQt has not been ported to this OS - talk to qt-bugs@trolltech.com" +#endif + +#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) +# define Q_OS_WIN +#endif + +#if defined(Q_OS_MAC9) || defined(Q_OS_MACX) +# define Q_OS_MAC +#endif + +#if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) +# undef Q_OS_UNIX +#elif !defined(Q_OS_UNIX) +# define Q_OS_UNIX +#endif + +#if defined(Q_OS_MACX) +# ifdef MAC_OS_X_VERSION_MIN_REQUIRED +# undef MAC_OS_X_VERSION_MIN_REQUIRED +# endif +# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_2 +# include +# if !defined(MAC_OS_X_VERSION_10_3) +# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1 +# endif +# if !defined(MAC_OS_X_VERSION_10_4) +# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1 +# endif +# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4) +# error "This version of Mac OS X is unsupported" +# endif +#endif + + +/* + The compiler, must be one of: (Q_CC_x) + + SYM - Symantec C++ for both PC and Macintosh + MPW - MPW C++ + MWERKS - Metrowerks CodeWarrior + MSVC - Microsoft Visual C/C++, Intel C++ for Windows + BOR - Borland/Turbo C++ + WAT - Watcom C++ + GNU - GNU C++ + COMEAU - Comeau C++ + EDG - Edison Design Group C++ + OC - CenterLine C++ + SUN - Sun WorkShop, Forte Developer, or Sun ONE Studio C++ + MIPS - MIPSpro C++ + DEC - DEC C++ + HP - HPUX C++ + HPACC - HPUX ANSI C++ + USLC - SCO OUDK, UDK, and UnixWare 2.X C++ + CDS - Reliant C++ + KAI - KAI C++ + INTEL - Intel C++ for Linux, Intel C++ for Windows + HIGHC - MetaWare High C/C++ + PGI - Portland Group C++ + GHS - Green Hills Optimizing C++ Compilers + + Should be sorted most to least authoritative. +*/ + +/* Symantec C++ is now Digital Mars */ +#if defined(__DMC__) || defined(__SC__) +# define Q_CC_SYM +/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */ +# if defined(__SC__) && __SC__ < 0x750 +# define Q_NO_EXPLICIT_KEYWORD +# endif +# define Q_NO_USING_KEYWORD +# if !defined(_CPPUNWIND) +# define Q_NO_EXCEPTIONS +# endif + +#elif defined(applec) +# define Q_CC_MPW +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# define Q_NO_USING_KEYWORD + +#elif defined(__MWERKS__) +# define Q_CC_MWERKS +/* "explicit" recognized since 4.0d1 */ +# define TQMAC_PASCAL pascal + +#elif defined(_MSC_VER) +# define Q_CC_MSVC +/* proper support of bool for _MSC_VER >= 1100 */ +# define Q_CANNOT_DELETE_CONSTANT +# define Q_INLINE_TEMPLATES inline +/* Visual C++.Net issues for _MSC_VER >= 1300 */ +# if _MSC_VER >= 1300 +# define Q_CC_MSVC_NET +# if _MSC_VER < 1310 || (defined(Q_OS_WIN64) && defined(_M_IA64)) +# define Q_TYPENAME +# endif +# endif +/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */ +# if defined(__INTEL_COMPILER) +# define Q_CC_INTEL +# if !defined(__EXCEPTIONS) +# define Q_NO_EXCEPTIONS +# endif +# else +# define Q_NO_USING_KEYWORD /* ### check "using" status */ +# endif + +#elif defined(__BORLANDC__) || defined(__TURBOC__) +# define Q_CC_BOR +# if __BORLANDC__ < 0x502 +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# endif +# define Q_NO_USING_KEYWORD /* ### check "using" status */ + +#elif defined(__WATCOMC__) +# define Q_CC_WAT +# if defined(Q_OS_QNX4) +/* compiler flags */ +# define Q_TYPENAME +# define Q_NO_BOOL_TYPE +# define Q_CANNOT_DELETE_CONSTANT +# define mutable +/* ??? */ +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +/* no template classes in TQVariant */ +# define QT_NO_TEMPLATE_VARIANT +/* Wcc does not fill in functions needed by valuelists, maps, and + valuestacks implicitly */ +# define Q_FULL_TEMPLATE_INSTANTIATION +/* can we just compare the structures? */ +# define Q_FULL_TEMPLATE_INSTANTIATION_MEMCMP +/* these are not useful to our customers */ +# define QT_QWS_NO_SHM +# define QT_NO_QWS_MULTIPROCESS +# define QT_NO_SQL +# define QT_NO_QWS_CURSOR +# endif + +#elif defined(__GNUC__) +# define Q_CC_GNU +# define Q_C_CALLBACKS +# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 +# define Q_FULL_TEMPLATE_INSTANTIATION +# endif +/* GCC 2.95 knows "using" but does not support it correctly */ +# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 +# define Q_NO_USING_KEYWORD +# endif +/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */ +# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1 +# define Q_WRONG_SB_CTYPE_MACROS +# endif + +/* ARM gcc pads structs to 32 bits, even when they contain a single + char, or short. We tell gcc to pack TQChars to 16 bits, to avoid + TQString bloat. However, gcc 3.4 doesn't allow us to create references to + members of a packed struct. (Pointers are OK, because then you + supposedly know what you are doing.) */ +# if (defined(__arm__) || defined(__ARMEL__)) && !defined(__ARM_EABI__) && !defined(QT_MOC_CPP) +# define Q_PACKED __attribute__ ((packed)) +# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 +# define Q_NO_PACKED_REFERENCE +# endif +# endif +# if !defined(__EXCEPTIONS) +# define Q_NO_EXCEPTIONS +# endif + +/* IBM compiler versions are a bit messy. There are actually two products: + the C product, and the C++ product. The C++ compiler is always packaged + with the latest version of the C compiler. Version numbers do not always + match. This little table (I'm not sure it's accurate) should be helpful: + + C++ product C product + + C Set 3.1 C Compiler 3.0 + ... ... + C++ Compiler 3.6.6 C Compiler 4.3 + ... ... + Visual Age C++ 4.0 ... + ... ... + Visual Age C++ 5.0 C Compiler 5.0 + ... ... + Visual Age C++ 6.0 C Compiler 6.0 + + Now: + __xlC__ is the version of the C compiler in hexadecimal notation + is only an approximation of the C++ compiler version + __IBMCPP__ is the version of the C++ compiler in decimal notation + but it is not defined on older compilers like C Set 3.1 */ +#elif defined(__xlC__) +# define Q_CC_XLC +# define Q_FULL_TEMPLATE_INSTANTIATION +# if __xlC__ < 0x400 +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# define Q_NO_USING_KEYWORD +# define Q_TYPENAME +# define Q_INLINE_TEMPLATES inline +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_CANNOT_DELETE_CONSTANT +# endif + +/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed + on DEC C++ V5.5-004. New versions do define __EDG__ - observed on + Compaq C++ V6.3-002. + This compiler is different enough from other EDG compilers to handle + it separately anyway. */ +#elif defined(__DECCXX) || defined(__DECC) +# define Q_CC_DEC +/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older + DEC C++ V5 compilers. */ +# if defined(__EDG__) +# define Q_CC_EDG +# endif +/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead + - observed on Compaq C++ V6.3-002. + In any case versions prior to Compaq C++ V6.0-005 do not have bool. */ +# if !defined(_BOOL_EXISTS) +# define Q_NO_BOOL_TYPE +# endif +/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */ +# define Q_NO_USING_KEYWORD +/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on + DEC C++ V5.5-004. */ +# if __DECCXX_VER < 60060000 +# define Q_TYPENAME +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_CANNOT_DELETE_CONSTANT +# endif +/* avoid undefined symbol problems with out-of-line template members */ +# define Q_INLINE_TEMPLATES inline + +/* Compilers with EDG front end are similar. To detect them we test: + __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b + __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 */ +#elif defined(__EDG) || defined(__EDG__) +# define Q_CC_EDG +/* From the EDG documentation (does not seem to apply to Compaq C++): + _BOOL + Defined in C++ mode when bool is a keyword. The name of this + predefined macro is specified by a configuration flag. _BOOL + is the default. + __BOOL_DEFINED + Defined in Microsoft C++ mode when bool is a keyword. */ +# if !defined(_BOOL) && !defined(__BOOL_DEFINED) +# define Q_NO_BOOL_TYPE +# endif + +/* The Comeau compiler is based on EDG and does define __EDG__ */ +# if defined(__COMO__) +# define Q_CC_COMEAU +# define Q_C_CALLBACKS + +/* The `using' keyword was introduced to avoid KAI C++ warnings + but it's now causing KAI C++ errors instead. The standard is + unclear about the use of this keyword, and in practice every + compiler is using its own set of rules. Forget it. */ +# elif defined(__KCC) +# define Q_CC_KAI +# if !defined(_EXCEPTIONS) +# define Q_NO_EXCEPTIONS +# endif +# define Q_NO_USING_KEYWORD + +/* Using the `using' keyword avoids Intel C++ for Linux warnings */ +# elif defined(__INTEL_COMPILER) +# define Q_CC_INTEL +# if !defined(__EXCEPTIONS) +# define Q_NO_EXCEPTIONS +# endif + +/* The Portland Group compiler is based on EDG and does define __EDG__ */ +# elif defined(__PGI) +# define Q_CC_PGI +# if !defined(__EXCEPTIONS) +# define Q_NO_EXCEPTIONS +# endif + +/* Never tested! */ +# elif defined(__ghs) +# define Q_CC_GHS + +/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */ +# elif defined(__USLC__) && defined(__SCO_VERSION__) +# define Q_CC_USLC +/* The latest UDK 7.1.1b does not need this, but previous versions do */ +# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010) +# define Q_INLINE_TEMPLATES inline +# endif +# define Q_NO_USING_KEYWORD /* ### check "using" status */ + +/* Never tested! */ +# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER) +# define Q_CC_OC +# define Q_NO_USING_KEYWORD + +/* CDS++ defines __EDG__ although this is not documented in the Reliant + documentation. It also follows conventions like _BOOL and this documented */ +# elif defined(sinix) +# define Q_CC_CDS +# define Q_NO_USING_KEYWORD +# if defined(__cplusplus) && (__cplusplus < 2) /* Cfront C++ mode */ +# define Q_NO_EXCEPTIONS +# endif + +/* The MIPSpro compiler in o32 mode is based on EDG but disables features + such as template specialization nevertheless */ +# elif defined(__sgi) +# define Q_CC_MIPS +# if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */ +# define Q_TYPENAME +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_NO_EXPLICIT_KEYWORD +# define Q_INLINE_TEMPLATES inline +# elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */ +# define Q_TYPENAME +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# endif +# define Q_NO_USING_KEYWORD /* ### check "using" status */ +# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740) +# pragma set woff 3624,3625, 3649 /* turn off some harmless warnings */ +# endif +# endif + +/* The older UnixWare 2.X compiler? */ +#elif defined(__USLC__) +# define Q_CC_USLC +# define Q_TYPENAME +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# define Q_NO_USING_KEYWORD +# define Q_INLINE_TEMPLATES inline + +/* Never tested! */ +#elif defined(__HIGHC__) +# define Q_CC_HIGHC + +#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) +# define Q_CC_SUN +/* 5.0 compiler or better + 'bool' is enabled by default but can be disabled using -features=nobool + in which case _BOOL is not defined + this is the default in 4.2 compatibility mode triggered by -compat=4 */ +# if __SUNPRO_CC >= 0x500 +# if !defined(_BOOL) +# define Q_NO_BOOL_TYPE +# endif +# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4) +# define Q_NO_USING_KEYWORD +# endif +# define Q_C_CALLBACKS +/* 4.2 compiler or older */ +# else +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# define Q_NO_USING_KEYWORD +# endif + +/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant + documentation but nevertheless uses EDG conventions like _BOOL */ +#elif defined(sinix) +# define Q_CC_EDG +# define Q_CC_CDS +# if !defined(_BOOL) +# define Q_NO_BOOL_TYPE +# endif +# define Q_BROKEN_TEMPLATE_SPECIALIZATION + +#elif defined(Q_OS_HPUX) +/* __HP_aCC was not defined in first aCC releases */ +# if defined(__HP_aCC) || __cplusplus >= 199707L +# define Q_CC_HPACC +# else +# define Q_CC_HP +# define Q_NO_BOOL_TYPE +# define Q_FULL_TEMPLATE_INSTANTIATION +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_NO_EXPLICIT_KEYWORD +# endif +# define Q_NO_USING_KEYWORD /* ### check "using" status */ + +#else +# error "TQt has not been tested with this compiler - talk to qt-bugs@trolltech.com" +#endif + +#ifndef Q_PACKED +# define Q_PACKED +#endif + + +/* + The window system, must be one of: (Q_WS_x) + + MACX - Mac OS X + MAC9 - Mac OS 9 + TQWS - TQt/Embedded + WIN32 - Windows + X11 - X Window System + PM - unsupported + WIN16 - unsupported +*/ + +#if defined(Q_OS_MAC9) +# define Q_WS_MAC9 +#elif defined(Q_OS_MSDOS) +# define Q_WS_WIN16 +# error "TQt requires Win32 and does not work with Windows 3.x" +#elif defined(_WIN32_X11_) +# define Q_WS_X11 +#elif defined(Q_OS_WIN32) +# define Q_WS_WIN32 +# if defined(Q_OS_WIN64) +# define Q_WS_WIN64 +# endif +#elif defined(Q_OS_OS2) +# define Q_WS_PM +# error "TQt does not work with OS/2 Presentation Manager or Workplace Shell" +#elif defined(Q_OS_UNIX) +# if defined(TQWS) +# define Q_WS_QWS +# define QT_NO_QWS_IM +# elif defined(Q_OS_MACX) +# define Q_WS_MACX +# else +# define Q_WS_X11 +# endif +#endif +#if defined(Q_OS_MAC) && !defined(TQMAC_PASCAL) +# define TQMAC_PASCAL +#endif + +#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) +# define Q_WS_WIN +#endif + +#if (defined(Q_WS_MAC9) || defined(Q_WS_MACX)) && !defined(Q_WS_QWS) && !defined(Q_WS_X11) +# define Q_WS_MAC +#endif + + +/* + Some classes do not permit copies to be made of an object. + These classes contains a private copy constructor and operator= + to disable copying (the compiler gives an error message). + Undefine Q_DISABLE_COPY to turn off this checking. +*/ + +#define Q_DISABLE_COPY + +#if defined(__cplusplus) + + +// +// Useful type definitions for TQt +// + +#if defined(Q_NO_BOOL_TYPE) +#if defined(Q_CC_HP) +// bool is an unsupported reserved keyword in later versions +#define bool int +#else +typedef int bool; +#endif +#endif + +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; + + +// +// Constant bool values +// + +#ifndef TRUE +const bool FALSE = 0; +const bool TRUE = !0; +#endif +#if defined(__WATCOMC__) +# if defined(Q_OS_QNX4) +const bool false = FALSE; +const bool true = TRUE; +# endif +#endif + +// +// Proper for-scoping +// ### turn on in 4.0 + +#if 0 && defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) +# define for if(0){}else for +#endif + +// +// Use the "explicit" keyword on platforms that support it. +// + +#if !defined(Q_NO_EXPLICIT_KEYWORD) +# define Q_EXPLICIT explicit +#else +# define Q_EXPLICIT +#endif + + +// +// Workaround for static const members on MSVC++. +// + +#if defined(Q_CC_MSVC) +# define QT_STATIC_CONST static +# define QT_STATIC_CONST_IMPL +#else +# define QT_STATIC_CONST static const +# define QT_STATIC_CONST_IMPL const +#endif + + +// +// Utility macros and inline functions +// + +#define TQMAX(a, b) ((b) < (a) ? (a) : (b)) +#define TQMIN(a, b) ((a) < (b) ? (a) : (b)) +#define TQABS(a) ((a) >= 0 ? (a) : -(a)) + +inline int qRound( double d ) +{ + return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1); +} + + +// +// Size-dependent types (architechture-dependent byte order) +// + +#if !defined(QT_CLEAN_NAMESPACE) +// source compatibility with TQt 1.x +typedef signed char INT8; // 8 bit signed +typedef unsigned char UINT8; // 8 bit unsigned +typedef short INT16; // 16 bit signed +typedef unsigned short UINT16; // 16 bit unsigned +typedef int INT32; // 32 bit signed +typedef unsigned int UINT32; // 32 bit unsigned +#endif + +typedef signed char Q_INT8; // 8 bit signed +typedef unsigned char Q_UINT8; // 8 bit unsigned +typedef short Q_INT16; // 16 bit signed +typedef unsigned short Q_UINT16; // 16 bit unsigned +typedef int Q_INT32; // 32 bit signed +typedef unsigned int Q_UINT32; // 32 bit unsigned +#if defined(Q_OS_WIN64) +typedef __int64 Q_LONG; // word up to 64 bit signed +typedef unsigned __int64 Q_ULONG; // word up to 64 bit unsigned +#else +typedef long Q_LONG; // word up to 64 bit signed +typedef unsigned long Q_ULONG; // word up to 64 bit unsigned +#endif +#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) +# define Q_INT64_C(c) c ## i64 // signed 64 bit constant +# define Q_UINT64_C(c) c ## ui64 // unsigned 64 bit constant +typedef __int64 Q_INT64; // 64 bit signed +typedef unsigned __int64 Q_UINT64; // 64 bit unsigned +#else +# define Q_INT64_C(c) c ## LL // signed 64 bit constant +# define Q_UINT64_C(c) c ## ULL // unsigned 64 bit constant +typedef long long Q_INT64; // 64 bit signed +typedef unsigned long long Q_UINT64; // 64 bit unsigned +#endif +typedef Q_INT64 Q_LLONG; // signed long long +typedef Q_UINT64 Q_ULLONG; // unsigned long long + +#if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT) +# define QT_LARGEFILE_SUPPORT 64 +#endif +#if defined(QT_LARGEFILE_SUPPORT) + typedef Q_ULLONG TQtOffset; +#else + typedef Q_ULONG TQtOffset; +#endif + + +// +// Data stream functions is provided by many classes (defined in ntqdatastream.h) +// + +class TQDataStream; + + +// +// Feature subsetting +// +// Note that disabling some features will produce a libqt that is not +// compatible with other libqt builds. Such modifications are only +// supported on TQt/Embedded where reducing the library size is important +// and where the application-suite is often a fixed set. +// + +#if !defined(QT_MOC) +#if defined(TQCONFIG_LOCAL) +#include "qconfig-local.h" +#elif defined(TQCONFIG_MINIMAL) +#include "qconfig-minimal.h" +#elif defined(TQCONFIG_SMALL) +#include "qconfig-small.h" +#elif defined(TQCONFIG_MEDIUM) +#include "qconfig-medium.h" +#elif defined(TQCONFIG_LARGE) +#include "qconfig-large.h" +#else // everything... +#include "ntqconfig.h" +#endif +#endif + + +#ifndef QT_BUILD_KEY +#define QT_BUILD_KEY "unspecified" +#endif + +// prune to local config +#include "ntqmodules.h" +#ifndef QT_MODULE_DIALOGS +# define QT_NO_DIALOG +#endif +#ifndef QT_MODULE_ICONVIEW +# define QT_NO_ICONVIEW +#endif +#ifndef QT_MODULE_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_MODULE_NETWORK +#define QT_NO_NETWORK +#endif +#ifndef QT_MODULE_CANVAS +# define QT_NO_CANVAS +#endif +#ifndef QT_MODULE_TABLE +#define QT_NO_TABLE +#endif +#ifndef QT_MODULE_XML +# define QT_NO_XML +#endif +#ifndef QT_MODULE_OPENGL +# define QT_NO_OPENGL +#endif +#if !defined(QT_MODULE_SQL) +# define QT_NO_SQL +#endif + +#if defined(Q_WS_MAC9) +//No need for menu merging +# ifndef TQMAC_QMENUBAR_NO_MERGE +# define TQMAC_QMENUBAR_NO_MERGE +# endif +//Mac9 does not use quartz +# ifndef TQMAC_NO_QUARTZ +# define TQMAC_NO_QUARTZ +# endif +# ifndef TQMAC_QMENUBAR_NO_EVENT +# define TQMAC_QMENUBAR_NO_EVENT +# endif +#endif +#if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks +# ifndef TQMAC_NO_QUARTZ +# define TQMAC_NO_QUARTZ +# endif +# ifndef TQMAC_QMENUBAR_NO_EVENT +# define TQMAC_QMENUBAR_NO_EVENT +# endif +#endif + +#if !defined(Q_WS_QWS) && !defined(QT_NO_COP) +# define QT_NO_COP +#endif + +#ifndef QT_H +#include "ntqfeatures.h" +#endif /* QT_H */ + + +// +// Create TQt DLL if QT_DLL is defined (Windows only) +// or QT_SHARED is defined (Kylix only) +// + +#if defined(Q_OS_WIN) +# if defined(QT_NODLL) +# undef QT_MAKEDLL +# undef QT_DLL +# elif defined(QT_MAKEDLL) /* create a TQt DLL library */ +# if defined(QT_DLL) +# undef QT_DLL +# endif +# define Q_EXPORT __declspec(dllexport) +# define Q_TEMPLATEDLL +# define Q_TEMPLATE_EXTERN +# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# elif defined(QT_DLL) /* use a TQt DLL library */ +# define Q_EXPORT __declspec(dllimport) +# define Q_TEMPLATEDLL +# ifndef Q_TEMPLATE_EXTERN +# if defined(Q_CC_MSVC_NET) +# define Q_TEMPLATE_EXTERN extern +# else +# define Q_TEMPLATE_EXTERN +# endif +# endif +# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# endif +#elif defined(Q_OS_LINUX) && defined(Q_CC_BOR) +# if defined(QT_SHARED) /* create a TQt shared library */ +# define Q_EXPORT __declspec(dllexport) +# define Q_TEMPLATEDLL +# define Q_TEMPLATE_EXTERN +# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# else +# define Q_TEMPLATEDLL +# define Q_TEMPLATE_EXTERN +# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# endif +#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4 +# define Q_EXPORT __attribute__((visibility("default"))) +# undef QT_MAKEDLL /* ignore these for other platforms */ +# undef QT_DLL +#else +# undef QT_MAKEDLL /* ignore these for other platforms */ +# undef QT_DLL +#endif + +#ifndef Q_EXPORT +# define Q_EXPORT +#endif + + +// +// Some platform specific stuff +// + +#if defined(Q_WS_WIN) +extern Q_EXPORT bool qt_winunicode; +#endif + + +// +// System information +// + +Q_EXPORT const char *qVersion(); +Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian ); +Q_EXPORT bool qSharedBuild(); +#if defined(Q_OS_MAC) +int qMacVersion(); +#elif defined(Q_WS_WIN) +Q_EXPORT int qWinVersion(); +#if defined(UNICODE) +#define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi } +#define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi ) +#else +#define QT_WA( uni, ansi ) ansi +#define QT_WA_INLINE( uni, ansi ) ansi +#endif +#endif + +#ifdef Q_OS_TEMP +#ifdef QT_WA +#undef QT_WA +#undef QT_WA_INLINE +#endif +#define QT_WA( uni, ansi ) uni +#define QT_WA_INLINE( uni, ansi ) ( uni ) +#endif + +#ifndef Q_INLINE_TEMPLATES +# define Q_INLINE_TEMPLATES +#endif + +#ifndef Q_TYPENAME +# define Q_TYPENAME typename +#endif + +// +// Use to avoid "unused parameter" warnings +// +#define Q_UNUSED(x) (void)x; + +// +// Debugging and error handling +// + +#if !defined(QT_NO_CHECK) +# define QT_CHECK_STATE // check state of objects etc. +# define QT_CHECK_RANGE // check range of indexes etc. +# define QT_CHECK_NULL // check null pointers +# define QT_CHECK_MATH // check math functions +#endif + +#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG) +# define QT_DEBUG // display debug messages +# if !defined(QT_NO_COMPAT) // compatibility with TQt 2 +# if !defined(NO_DEBUG) && !defined(DEBUG) +# if !defined(Q_OS_MACX) // clash with MacOS X headers +# define DEBUG +# endif +# endif +# endif +#endif + + +Q_EXPORT void qDebug( const char *, ... ) // print debug message +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +Q_EXPORT void qWarning( const char *, ... ) // print warning message +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +Q_EXPORT void qFatal( const char *, ... ) // print fatal message and exit +#if defined(Q_CC_GNU) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +Q_EXPORT void qSystemWarning( const char *, int code = -1 ); + +#if !defined(QT_CLEAN_NAMESPACE) // compatibility with TQt 1 + +Q_EXPORT void debug( const char *, ... ) // print debug message +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +Q_EXPORT void warning( const char *, ... ) // print warning message +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +Q_EXPORT void fatal( const char *, ... ) // print fatal message and exit +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +#endif // QT_CLEAN_NAMESPACE + + +#if !defined(Q_ASSERT) +# if defined(QT_CHECK_STATE) +# if defined(QT_FATAL_ASSERT) +# define Q_ASSERT(x) ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)) +# else +# define Q_ASSERT(x) ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)) +# endif +# else +# define Q_ASSERT(x) +# endif +#endif + +#if !defined(QT_NO_COMPAT) // compatibility with TQt 2 +# if !defined(ASSERT) +# if !defined(Q_OS_TEMP) +# define ASSERT(x) Q_ASSERT(x) +# endif +# endif +#endif // QT_NO_COMPAT + + +Q_EXPORT bool qt_check_pointer( bool c, const char *, int ); + +#if defined(QT_CHECK_NULL) +# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__)) +#else +# define Q_CHECK_PTR(p) +#endif + +#if !defined(QT_NO_COMPAT) // compatibility with TQt 2 +# if !defined(CHECK_PTR) +# define CHECK_PTR(x) Q_CHECK_PTR(x) +# endif +#endif // QT_NO_COMPAT + +enum TQtMsgType { TQtDebugMsg, TQtWarningMsg, TQtFatalMsg }; + +typedef void (*TQtMsgHandler)(TQtMsgType, const char *); +Q_EXPORT TQtMsgHandler qInstallMsgHandler( TQtMsgHandler ); + +#if !defined(QT_NO_COMPAT) // compatibility with TQt 2 +typedef TQtMsgHandler msg_handler; +#endif // QT_NO_COMPAT + +Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE ); + +Q_EXPORT void qObsolete( const char *obj, const char *oldfunc, + const char *newfunc ); +Q_EXPORT void qObsolete( const char *obj, const char *oldfunc ); +Q_EXPORT void qObsolete( const char *message ); + + +// +// Install paths from configure +// + +Q_EXPORT const char *qInstallPath(); +Q_EXPORT const char *qInstallPathDocs(); +Q_EXPORT const char *qInstallPathHeaders(); +Q_EXPORT const char *qInstallPathLibs(); +Q_EXPORT const char *qInstallPathBins(); +Q_EXPORT const char *qInstallPathPlugins(); +Q_EXPORT const char *qInstallPathData(); +Q_EXPORT const char *qInstallPathTranslations(); +Q_EXPORT const char *qInstallPathSysconf(); + +#endif /* __cplusplus */ + +/* + compilers which follow outdated template instantiation rules + require a class to have a comparison operator to exist when + a TQValueList of this type is instantiated. It's not actually + used in the list, though. Hence the dummy implementation. + Just in case other code relies on it we better trigger a warning + mandating a real implementation. +*/ +#ifdef Q_FULL_TEMPLATE_INSTANTIATION +# define Q_DUMMY_COMPARISON_OPERATOR(C) \ + bool operator==( const C& ) const { \ + qWarning( #C"::operator==( const "#C"& ) got called." ); \ + return FALSE; \ + } +#else +# define Q_DUMMY_COMPARISON_OPERATOR(C) +#endif + +#endif /* TQGLOBAL_H */ + +/* + Avoid some particularly useless warnings from some stupid compilers. + To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out + the line "#define QT_NO_WARNINGS" +*/ + +#if !defined(QT_CC_WARNINGS) +# define QT_NO_WARNINGS +#endif +#if defined(QT_NO_WARNINGS) +# if defined(Q_CC_MSVC) +# pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data +# pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' +# pragma warning(disable: 4514) // unreferenced inline/local function has been removed +# pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning) +# pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2' +# pragma warning(disable: 4706) // assignment within conditional expression +# pragma warning(disable: 4786) // truncating debug info after 255 characters +# pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated +# pragma warning(disable: 4355) // 'this' : used in base member initializer list +# pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation +# pragma warning(disable: 4710) // function not inlined +# elif defined(Q_CC_BOR) +# pragma option -w-inl +# pragma option -w-aus +# pragma warn -inl +# pragma warn -pia +# pragma warn -ccc +# pragma warn -rch +# pragma warn -sig +# endif +#endif + diff --git a/src/tools/ntqgvector.h b/src/tools/ntqgvector.h new file mode 100644 index 000000000..40667c6aa --- /dev/null +++ b/src/tools/ntqgvector.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Definition of TQGVector class +** +** Created : 930907 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGVECTOR_H +#define TQGVECTOR_H + +#ifndef QT_H +#include "ntqptrcollection.h" +#endif // QT_H + + +class Q_EXPORT TQGVector : public TQPtrCollection // generic vector +{ +friend class TQGList; // needed by TQGList::toVector +public: +#ifndef QT_NO_DATASTREAM + TQDataStream &read( TQDataStream & ); // read vector from stream + TQDataStream &write( TQDataStream & ) const; // write vector to stream +#endif + virtual int compareItems( Item, Item ); + +protected: + TQGVector(); // create empty vector + TQGVector( uint size ); // create vector with nullptrs + TQGVector( const TQGVector &v ); // make copy of other vector + ~TQGVector(); + + TQGVector &operator=( const TQGVector &v ); // assign from other vector + bool operator==( const TQGVector &v ) const; + + Item *data() const { return vec; } + uint size() const { return len; } + uint count() const { return numItems; } + + bool insert( uint index, Item ); // insert item at index + bool remove( uint index ); // remove item + Item take( uint index ); // take out item + + void clear(); // clear vector + bool resize( uint newsize ); // resize vector + + bool fill( Item, int flen ); // resize and fill vector + + void sort(); // sort vector + int bsearch( Item ) const; // binary search (when sorted) + + int findRef( Item, uint index ) const; // find exact item in vector + int find( Item, uint index ) const; // find equal item in vector + uint containsRef( Item ) const; // get number of exact matches + uint contains( Item ) const; // get number of equal matches + + Item at( uint index ) const // return indexed item + { +#if defined(QT_CHECK_RANGE) + if ( index >= len ) + warningIndexRange( index ); +#endif + return vec[index]; + } + + bool insertExpand( uint index, Item ); // insert, expand if necessary + + void toList( TQGList * ) const; // put items in list + +#ifndef QT_NO_DATASTREAM + virtual TQDataStream &read( TQDataStream &, Item & ); + virtual TQDataStream &write( TQDataStream &, Item ) const; +#endif +private: + Item *vec; + uint len; + uint numItems; + + static void warningIndexRange( uint ); +}; + + +/***************************************************************************** + TQGVector stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQGVector & ); +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQGVector & ); +#endif + +#endif // TQGVECTOR_H diff --git a/src/tools/ntqintcache.h b/src/tools/ntqintcache.h new file mode 100644 index 000000000..116618058 --- /dev/null +++ b/src/tools/ntqintcache.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Definition of TQIntCache template class +** +** Created : 950209 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQINTCACHE_H +#define TQINTCACHE_H + +#ifndef QT_H +#include "ntqgcache.h" +#endif // QT_H + + +template +class TQIntCache +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGCache +#endif +{ +public: + TQIntCache( const TQIntCache &c ) : TQGCache(c) {} + TQIntCache( int maxCost=100, int size=17 ) + : TQGCache( maxCost, size, IntKey, FALSE, FALSE ) {} + ~TQIntCache() { clear(); } + TQIntCache &operator=( const TQIntCache &c ) + { return (TQIntCache&)TQGCache::operator=(c); } + int maxCost() const { return TQGCache::maxCost(); } + int totalCost() const { return TQGCache::totalCost(); } + void setMaxCost( int m) { TQGCache::setMaxCost(m); } + uint count() const { return TQGCache::count(); } + uint size() const { return TQGCache::size(); } + bool isEmpty() const { return TQGCache::count() == 0; } + bool insert( long k, const type *d, int c=1, int p=0 ) + { return TQGCache::insert_other((const char*)k,(Item)d,c,p); } + bool remove( long k ) + { return TQGCache::remove_other((const char*)k); } + type *take( long k ) + { return (type *)TQGCache::take_other((const char*)k);} + void clear() { TQGCache::clear(); } + type *find( long k, bool ref=TRUE ) const + { return (type *)TQGCache::find_other( (const char*)k,ref);} + type *operator[]( long k ) const + { return (type *)TQGCache::find_other( (const char*)k); } + void statistics() const { TQGCache::statistics(); } +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQIntCache::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQIntCache::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class TQIntCacheIterator : public TQGCacheIterator +{ +public: + TQIntCacheIterator( const TQIntCache &c ) + : TQGCacheIterator( (TQGCache &)c ) {} + TQIntCacheIterator( const TQIntCacheIterator &ci ) + : TQGCacheIterator((TQGCacheIterator &)ci) {} + TQIntCacheIterator &operator=( const TQIntCacheIterator&ci ) + { return ( TQIntCacheIterator&)TQGCacheIterator::operator=( ci );} + uint count() const { return TQGCacheIterator::count(); } + bool isEmpty() const { return TQGCacheIterator::count() == 0; } + bool atFirst() const { return TQGCacheIterator::atFirst(); } + bool atLast() const { return TQGCacheIterator::atLast(); } + type *toFirst() { return (type *)TQGCacheIterator::toFirst(); } + type *toLast() { return (type *)TQGCacheIterator::toLast(); } + operator type *() const { return (type *)TQGCacheIterator::get(); } + type *current() const { return (type *)TQGCacheIterator::get(); } + long currentKey() const { return (long)TQGCacheIterator::getKeyInt();} + type *operator()() { return (type *)TQGCacheIterator::operator()();} + type *operator++() { return (type *)TQGCacheIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGCacheIterator::operator+=(j);} + type *operator--() { return (type *)TQGCacheIterator::operator--(); } + type *operator-=(uint j) { return (type *)TQGCacheIterator::operator-=(j);} +}; + + +#endif // TQINTCACHE_H diff --git a/src/tools/ntqintdict.h b/src/tools/ntqintdict.h new file mode 100644 index 000000000..162625855 --- /dev/null +++ b/src/tools/ntqintdict.h @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** Definition of TQIntDict template class +** +** Created : 940624 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQINTDICT_H +#define TQINTDICT_H + +#ifndef QT_H +#include "ntqgdict.h" +#endif // QT_H + +template +class TQIntDict +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGDict +#endif +{ +public: + TQIntDict(int size=17) : TQGDict(size,IntKey,0,0) {} + TQIntDict( const TQIntDict &d ) : TQGDict(d) {} + ~TQIntDict() { clear(); } + TQIntDict &operator=(const TQIntDict &d) + { return (TQIntDict&)TQGDict::operator=(d); } + uint count() const { return TQGDict::count(); } + uint size() const { return TQGDict::size(); } + bool isEmpty() const { return TQGDict::count() == 0; } + void insert( long k, const type *d ) + { TQGDict::look_int(k,(Item)d,1); } + void replace( long k, const type *d ) + { TQGDict::look_int(k,(Item)d,2); } + bool remove( long k ) { return TQGDict::remove_int(k); } + type *take( long k ) { return (type*)TQGDict::take_int(k); } + type *find( long k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_int(k,0,0); } + type *operator[]( long k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_int(k,0,0); } + void clear() { TQGDict::clear(); } + void resize( uint n ) { TQGDict::resize(n); } + void statistics() const { TQGDict::statistics(); } + +#ifdef Q_QDOC +protected: + virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); + virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQIntDict::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQIntDict::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type*)d; +} + +template +class TQIntDictIterator : public TQGDictIterator +{ +public: + TQIntDictIterator(const TQIntDict &d) :TQGDictIterator((TQGDict &)d) {} + ~TQIntDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)TQGDictIterator::toFirst(); } + operator type *() const { return (type *)TQGDictIterator::get(); } + type *current() const { return (type *)TQGDictIterator::get(); } + long currentKey() const { return TQGDictIterator::getKeyInt(); } + type *operator()() { return (type *)TQGDictIterator::operator()(); } + type *operator++() { return (type *)TQGDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j);} +}; + +#define Q_DEFINED_QINTDICT +#include "ntqwinexport.h" +#endif // TQINTDICT_H diff --git a/src/tools/ntqiodevice.h b/src/tools/ntqiodevice.h new file mode 100644 index 000000000..65c4c59df --- /dev/null +++ b/src/tools/ntqiodevice.h @@ -0,0 +1,164 @@ +/**************************************************************************** +** +** Definition of TQIODevice class +** +** Created : 940913 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQIODEVICE_H +#define TQIODEVICE_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqcstring.h" +#endif // QT_H + + +// IO device access types + +#define IO_Direct 0x0100 // direct access device +#define IO_Sequential 0x0200 // sequential access device +#define IO_Combined 0x0300 // combined direct/sequential +#define IO_TypeMask 0x0f00 + +// IO handling modes + +#define IO_Raw 0x0040 // raw access (not buffered) +#define IO_Async 0x0080 // asynchronous mode + +// IO device open modes + +#define IO_ReadOnly 0x0001 // readable device +#define IO_WriteOnly 0x0002 // writable device +#define IO_ReadWrite 0x0003 // read+write device +#define IO_Append 0x0004 // append +#define IO_Truncate 0x0008 // truncate device +#define IO_Translate 0x0010 // translate CR+LF +#define IO_ModeMask 0x00ff + +// IO device state + +#define IO_Open 0x1000 // device is open +#define IO_StateMask 0xf000 + +// IO device status + +#define IO_Ok 0 +#define IO_ReadError 1 // read error +#define IO_WriteError 2 // write error +#define IO_FatalError 3 // fatal unrecoverable error +#define IO_ResourceError 4 // resource limitation +#define IO_OpenError 5 // cannot open device +#define IO_ConnectError 5 // cannot connect to device +#define IO_AbortError 6 // abort error +#define IO_TimeOutError 7 // time out +#define IO_UnspecifiedError 8 // unspecified error + + +class Q_EXPORT TQIODevice +{ +public: +#if defined(QT_ABI_QT4) + typedef Q_LLONG Offset; +#else + typedef Q_ULONG Offset; +#endif + + TQIODevice(); + virtual ~TQIODevice(); + + int flags() const { return ioMode; } + int mode() const { return ioMode & IO_ModeMask; } + int state() const { return ioMode & IO_StateMask; } + + bool isDirectAccess() const { return ((ioMode & IO_Direct) == IO_Direct); } + bool isSequentialAccess() const { return ((ioMode & IO_Sequential) == IO_Sequential); } + bool isCombinedAccess() const { return ((ioMode & IO_Combined) == IO_Combined); } + bool isBuffered() const { return ((ioMode & IO_Raw) != IO_Raw); } + bool isRaw() const { return ((ioMode & IO_Raw) == IO_Raw); } + bool isSynchronous() const { return ((ioMode & IO_Async) != IO_Async); } + bool isAsynchronous() const { return ((ioMode & IO_Async) == IO_Async); } + bool isTranslated() const { return ((ioMode & IO_Translate) == IO_Translate); } + bool isReadable() const { return ((ioMode & IO_ReadOnly) == IO_ReadOnly); } + bool isWritable() const { return ((ioMode & IO_WriteOnly) == IO_WriteOnly); } + bool isReadWrite() const { return ((ioMode & IO_ReadWrite) == IO_ReadWrite); } + bool isInactive() const { return state() == 0; } + bool isOpen() const { return state() == IO_Open; } + + int status() const { return ioSt; } + void resetStatus() { ioSt = IO_Ok; } + + virtual bool open( int mode ) = 0; + virtual void close() = 0; + virtual void flush() = 0; + + virtual Offset size() const = 0; + virtual Offset at() const; + virtual bool at( Offset ); + virtual bool atEnd() const; + bool reset() { return at(0); } + + virtual Q_LONG readBlock( char *data, Q_ULONG maxlen ) = 0; + virtual Q_LONG writeBlock( const char *data, Q_ULONG len ) = 0; + virtual Q_LONG readLine( char *data, Q_ULONG maxlen ); + Q_LONG writeBlock( const TQByteArray& data ); + virtual TQByteArray readAll(); + + virtual int getch() = 0; + virtual int putch( int ) = 0; + virtual int ungetch( int ) = 0; + +protected: + void setFlags( int f ) { ioMode = f; } + void setType( int ); + void setMode( int ); + void setState( int ); + void setStatus( int ); + Offset ioIndex; + +private: + int ioMode; + int ioSt; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQIODevice( const TQIODevice & ); + TQIODevice &operator=( const TQIODevice & ); +#endif +}; + + +#endif // TQIODEVICE_H diff --git a/src/tools/ntqlibrary.h b/src/tools/ntqlibrary.h new file mode 100644 index 000000000..385726b8e --- /dev/null +++ b/src/tools/ntqlibrary.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Definition of TQLibrary class +** +** Created : 000101 +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLIBRARY_H +#define TQLIBRARY_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_LIBRARY + +class TQLibraryPrivate; + +class Q_EXPORT TQLibrary +{ +public: + TQLibrary( const TQString& filename ); + virtual ~TQLibrary(); + + void *resolve( const char* ); + static void *resolve( const TQString &filename, const char * ); + + bool load(); + virtual bool unload(); + bool isLoaded() const; + + bool autoUnload() const; + void setAutoUnload( bool enable ); + + TQString library() const; + +private: + TQLibraryPrivate *d; + + TQString libfile; + uint aunload : 1; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQLibrary( const TQLibrary & ); + TQLibrary &operator=( const TQLibrary & ); +#endif +}; + +#define Q_DEFINED_QLIBRARY +#include "ntqwinexport.h" +#endif //QT_NO_LIBRARY +#endif //TQLIBRARY_H diff --git a/src/tools/ntqlocale.h b/src/tools/ntqlocale.h new file mode 100644 index 000000000..231203f4e --- /dev/null +++ b/src/tools/ntqlocale.h @@ -0,0 +1,494 @@ +/**************************************************************************** +** +** Declaration of the TQLocale class +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLOCALE_H +#define TQLOCALE_H + +#include "ntqstring.h" + +struct TQLocalePrivate; + +class Q_EXPORT TQLocale +{ + friend class TQString; + +public: + enum Language { + C = 1, + Abkhazian = 2, + Afan = 3, + Afar = 4, + Afrikaans = 5, + Albanian = 6, + Amharic = 7, + Arabic = 8, + Armenian = 9, + Assamese = 10, + Aymara = 11, + Azerbaijani = 12, + Bashkir = 13, + Basque = 14, + Bengali = 15, + Bhutani = 16, + Bihari = 17, + Bislama = 18, + Breton = 19, + Bulgarian = 20, + Burmese = 21, + Byelorussian = 22, + Cambodian = 23, + Catalan = 24, + Chinese = 25, + Corsican = 26, + Croatian = 27, + Czech = 28, + Danish = 29, + Dutch = 30, + English = 31, + Esperanto = 32, + Estonian = 33, + Faroese = 34, + FijiLanguage = 35, + Finnish = 36, + French = 37, + Frisian = 38, + Gaelic = 39, + Galician = 40, + Georgian = 41, + German = 42, + Greek = 43, + Greenlandic = 44, + Guarani = 45, + Gujarati = 46, + Hausa = 47, + Hebrew = 48, + Hindi = 49, + Hungarian = 50, + Icelandic = 51, + Indonesian = 52, + Interlingua = 53, + Interlingue = 54, + Inuktitut = 55, + Inupiak = 56, + Irish = 57, + Italian = 58, + Japanese = 59, + Javanese = 60, + Kannada = 61, + Kashmiri = 62, + Kazakh = 63, + Kinyarwanda = 64, + Kirghiz = 65, + Korean = 66, + Kurdish = 67, + Kurundi = 68, + Laothian = 69, + Latin = 70, + Latvian = 71, + Lingala = 72, + Lithuanian = 73, + Macedonian = 74, + Malagasy = 75, + Malay = 76, + Malayalam = 77, + Maltese = 78, + Maori = 79, + Marathi = 80, + Moldavian = 81, + Mongolian = 82, + NauruLanguage = 83, + Nepali = 84, + Norwegian = 85, + Occitan = 86, + Oriya = 87, + Pashto = 88, + Persian = 89, + Polish = 90, + Portuguese = 91, + Punjabi = 92, + Quechua = 93, + RhaetoRomance = 94, + Romanian = 95, + Russian = 96, + Samoan = 97, + Sangho = 98, + Sanskrit = 99, + Serbian = 100, + SerboCroatian = 101, + Sesotho = 102, + Setswana = 103, + Shona = 104, + Sindhi = 105, + Singhalese = 106, + Siswati = 107, + Slovak = 108, + Slovenian = 109, + Somali = 110, + Spanish = 111, + Sundanese = 112, + Swahili = 113, + Swedish = 114, + Tagalog = 115, + Tajik = 116, + Tamil = 117, + Tatar = 118, + Telugu = 119, + Thai = 120, + Tibetan = 121, + Tigrinya = 122, + TongaLanguage = 123, + Tsonga = 124, + Turkish = 125, + Turkmen = 126, + Twi = 127, + Uigur = 128, + Ukrainian = 129, + Urdu = 130, + Uzbek = 131, + Vietnamese = 132, + Volapuk = 133, + Welsh = 134, + Wolof = 135, + Xhosa = 136, + Yiddish = 137, + Yoruba = 138, + Zhuang = 139, + Zulu = 140, + LastLanguage = Zulu + }; + + enum Country { + AnyCountry = 0, + Afghanistan = 1, + Albania = 2, + Algeria = 3, + AmericanSamoa = 4, + Andorra = 5, + Angola = 6, + Anguilla = 7, + Antarctica = 8, + AntiguaAndBarbuda = 9, + Argentina = 10, + Armenia = 11, + Aruba = 12, + Australia = 13, + Austria = 14, + Azerbaijan = 15, + Bahamas = 16, + Bahrain = 17, + Bangladesh = 18, + Barbados = 19, + Belarus = 20, + Belgium = 21, + Belize = 22, + Benin = 23, + Bermuda = 24, + Bhutan = 25, + Bolivia = 26, + BosniaAndHerzegowina = 27, + Botswana = 28, + BouvetIsland = 29, + Brazil = 30, + BritishIndianOceanTerritory = 31, + BruneiDarussalam = 32, + Bulgaria = 33, + BurkinaFaso = 34, + Burundi = 35, + Cambodia = 36, + Cameroon = 37, + Canada = 38, + CapeVerde = 39, + CaymanIslands = 40, + CentralAfricanRepublic = 41, + Chad = 42, + Chile = 43, + China = 44, + ChristmasIsland = 45, + CocosIslands = 46, + Colombia = 47, + Comoros = 48, + DemocraticRepublicOfCongo = 49, + PeoplesRepublicOfCongo = 50, + CookIslands = 51, + CostaRica = 52, + IvoryCoast = 53, + Croatia = 54, + Cuba = 55, + Cyprus = 56, + CzechRepublic = 57, + Denmark = 58, + Djibouti = 59, + Dominica = 60, + DominicanRepublic = 61, + EastTimor = 62, + Ecuador = 63, + Egypt = 64, + ElSalvador = 65, + EquatorialGuinea = 66, + Eritrea = 67, + Estonia = 68, + Ethiopia = 69, + FalklandIslands = 70, + FaroeIslands = 71, + FijiCountry = 72, + Finland = 73, + France = 74, + MetropolitanFrance = 75, + FrenchGuiana = 76, + FrenchPolynesia = 77, + FrenchSouthernTerritories = 78, + Gabon = 79, + Gambia = 80, + Georgia = 81, + Germany = 82, + Ghana = 83, + Gibraltar = 84, + Greece = 85, + Greenland = 86, + Grenada = 87, + Guadeloupe = 88, + Guam = 89, + Guatemala = 90, + Guinea = 91, + GuineaBissau = 92, + Guyana = 93, + Haiti = 94, + HeardAndMcDonaldIslands = 95, + Honduras = 96, + HongKong = 97, + Hungary = 98, + Iceland = 99, + India = 100, + Indonesia = 101, + Iran = 102, + Iraq = 103, + Ireland = 104, + Israel = 105, + Italy = 106, + Jamaica = 107, + Japan = 108, + Jordan = 109, + Kazakhstan = 110, + Kenya = 111, + Kiribati = 112, + DemocraticRepublicOfKorea = 113, + RepublicOfKorea = 114, + Kuwait = 115, + Kyrgyzstan = 116, + Lao = 117, + Latvia = 118, + Lebanon = 119, + Lesotho = 120, + Liberia = 121, + LibyanArabJamahiriya = 122, + Liechtenstein = 123, + Lithuania = 124, + Luxembourg = 125, + Macau = 126, + Macedonia = 127, + Madagascar = 128, + Malawi = 129, + Malaysia = 130, + Maldives = 131, + Mali = 132, + Malta = 133, + MarshallIslands = 134, + Martinique = 135, + Mauritania = 136, + Mauritius = 137, + Mayotte = 138, + Mexico = 139, + Micronesia = 140, + Moldova = 141, + Monaco = 142, + Mongolia = 143, + Montserrat = 144, + Morocco = 145, + Mozambique = 146, + Myanmar = 147, + Namibia = 148, + NauruCountry = 149, + Nepal = 150, + Netherlands = 151, + NetherlandsAntilles = 152, + NewCaledonia = 153, + NewZealand = 154, + Nicaragua = 155, + Niger = 156, + Nigeria = 157, + Niue = 158, + NorfolkIsland = 159, + NorthernMarianaIslands = 160, + Norway = 161, + Oman = 162, + Pakistan = 163, + Palau = 164, + PalestinianTerritory = 165, + Panama = 166, + PapuaNewGuinea = 167, + Paraguay = 168, + Peru = 169, + Philippines = 170, + Pitcairn = 171, + Poland = 172, + Portugal = 173, + PuertoRico = 174, + Qatar = 175, + Reunion = 176, + Romania = 177, + RussianFederation = 178, + Rwanda = 179, + SaintKittsAndNevis = 180, + StLucia = 181, + StVincentAndTheGrenadines = 182, + Samoa = 183, + SanMarino = 184, + SaoTomeAndPrincipe = 185, + SaudiArabia = 186, + Senegal = 187, + Seychelles = 188, + SierraLeone = 189, + Singapore = 190, + Slovakia = 191, + Slovenia = 192, + SolomonIslands = 193, + Somalia = 194, + SouthAfrica = 195, + SouthGeorgiaAndTheSouthSandwichIslands = 196, + Spain = 197, + SriLanka = 198, + StHelena = 199, + StPierreAndMiquelon = 200, + Sudan = 201, + Suriname = 202, + SvalbardAndJanMayenIslands = 203, + Swaziland = 204, + Sweden = 205, + Switzerland = 206, + SyrianArabRepublic = 207, + Taiwan = 208, + Tajikistan = 209, + Tanzania = 210, + Thailand = 211, + Togo = 212, + Tokelau = 213, + TongaCountry = 214, + TrinidadAndTobago = 215, + Tunisia = 216, + Turkey = 217, + Turkmenistan = 218, + TurksAndCaicosIslands = 219, + Tuvalu = 220, + Uganda = 221, + Ukraine = 222, + UnitedArabEmirates = 223, + UnitedKingdom = 224, + UnitedStates = 225, + UnitedStatesMinorOutlyingIslands = 226, + Uruguay = 227, + Uzbekistan = 228, + Vanuatu = 229, + VaticanCityState = 230, + Venezuela = 231, + VietNam = 232, + BritishVirginIslands = 233, + USVirginIslands = 234, + WallisAndFutunaIslands = 235, + WesternSahara = 236, + Yemen = 237, + Yugoslavia = 238, + Zambia = 239, + Zimbabwe = 240, + LastCountry = Zimbabwe + }; + + TQLocale(); + TQLocale(const TQString &name); + TQLocale(Language language, Country country = AnyCountry); + TQLocale(const TQLocale &other); + + TQLocale &operator=(const TQLocale &other); + + Language language() const; + Country country() const; + TQString name() const; + + short toShort(const TQString &s, bool *ok = 0) const; + ushort toUShort(const TQString &s, bool *ok = 0) const; + int toInt(const TQString &s, bool *ok = 0) const; + uint toUInt(const TQString &s, bool *ok = 0) const; + Q_LONG toLong(const TQString &s, bool *ok = 0) const; + Q_ULONG toULong(const TQString &s, bool *ok = 0) const; + Q_LLONG toLongLong(const TQString &s, bool *ok = 0) const; + Q_ULLONG toULongLong(const TQString &s, bool *ok = 0) const; + float toFloat(const TQString &s, bool *ok = 0) const; + double toDouble(const TQString &s, bool *ok = 0) const; + + TQString toString(short i) const + { return toString((Q_LLONG)i); } + TQString toString(ushort i) const + { return toString((Q_ULLONG)i); } + TQString toString(int i) const + { return toString((Q_LLONG)i); } + TQString toString(uint i) const + { return toString((Q_ULLONG)i); } +#if !defined(Q_OS_WIN64) + TQString toString(Q_LONG i) const + { return toString((Q_LLONG)i); } + TQString toString(Q_ULONG i) const + { return toString((Q_ULLONG)i); } +#endif + TQString toString(Q_LLONG i) const; + TQString toString(Q_ULLONG i) const; + TQString toString(float i, char f = 'g', int prec = 6) const + { return toString((double) i, f, prec); } + TQString toString(double i, char f = 'g', int prec = 6) const; + + static TQString languageToString(Language language); + static TQString countryToString(Country country); + static void setDefault(const TQLocale &locale); + + static TQLocale c() { return TQLocale(C); } + static TQLocale system(); + +private: + const TQLocalePrivate *d; + static const TQLocalePrivate *default_d; +}; + +#endif diff --git a/src/tools/ntqmap.h b/src/tools/ntqmap.h new file mode 100644 index 000000000..7c0d375cf --- /dev/null +++ b/src/tools/ntqmap.h @@ -0,0 +1,877 @@ +/**************************************************************************** +** +** Definition of TQMap class +** +** Created : 990406 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMAP_H +#define TQMAP_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqshared.h" +#include "ntqdatastream.h" +#include "ntqpair.h" +#include "ntqvaluelist.h" +#endif // QT_H + +#ifndef QT_NO_STL +#include +#include +#include +#endif + +//#define QT_CHECK_MAP_RANGE + +struct Q_EXPORT TQMapNodeBase +{ + enum Color { Red, Black }; + + TQMapNodeBase* left; + TQMapNodeBase* right; + TQMapNodeBase* parent; + + Color color; + + TQMapNodeBase* minimum() { + TQMapNodeBase* x = this; + while ( x->left ) + x = x->left; + return x; + } + + TQMapNodeBase* maximum() { + TQMapNodeBase* x = this; + while ( x->right ) + x = x->right; + return x; + } +}; + + +template +struct TQMapNode : public TQMapNodeBase +{ + TQMapNode( const K& _key, const T& _data ) { data = _data; key = _key; } + TQMapNode( const K& _key ) { key = _key; } + TQMapNode( const TQMapNode& _n ) { key = _n.key; data = _n.data; } + TQMapNode() { } + T data; + K key; +}; + + +template +class TQMapIterator +{ + public: + /** + * Typedefs + */ + typedef TQMapNode< K, T >* NodePtr; +#ifndef QT_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; +#endif + typedef T value_type; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + typedef T* pointer; + typedef T& reference; + + /** + * Variables + */ + TQMapNode* node; + + /** + * Functions + */ + TQMapIterator() : node( 0 ) {} + TQMapIterator( TQMapNode* p ) : node( p ) {} + TQMapIterator( const TQMapIterator& it ) : node( it.node ) {} + + bool operator==( const TQMapIterator& it ) const { return node == it.node; } + bool operator!=( const TQMapIterator& it ) const { return node != it.node; } + T& operator*() { return node->data; } + const T& operator*() const { return node->data; } + // UDT for T = x* + // T* operator->() const { return &node->data; } + + const K& key() const { return node->key; } + T& data() { return node->data; } + const T& data() const { return node->data; } + +private: + int inc(); + int dec(); + +public: + TQMapIterator& operator++() { + inc(); + return *this; + } + + TQMapIterator operator++(int) { + TQMapIterator tmp = *this; + inc(); + return tmp; + } + + TQMapIterator& operator--() { + dec(); + return *this; + } + + TQMapIterator operator--(int) { + TQMapIterator tmp = *this; + dec(); + return tmp; + } +}; + +template +Q_INLINE_TEMPLATES int TQMapIterator::inc() +{ + TQMapNodeBase* tmp = node; + if ( tmp->right ) { + tmp = tmp->right; + while ( tmp->left ) + tmp = tmp->left; + } else { + TQMapNodeBase* y = tmp->parent; + while (tmp == y->right) { + tmp = y; + y = y->parent; + } + if (tmp->right != y) + tmp = y; + } + node = (NodePtr)tmp; + return 0; +} + +template +Q_INLINE_TEMPLATES int TQMapIterator::dec() +{ + TQMapNodeBase* tmp = node; + if (tmp->color == TQMapNodeBase::Red && + tmp->parent->parent == tmp ) { + tmp = tmp->right; + } else if (tmp->left != 0) { + TQMapNodeBase* y = tmp->left; + while ( y->right ) + y = y->right; + tmp = y; + } else { + TQMapNodeBase* y = tmp->parent; + while (tmp == y->left) { + tmp = y; + y = y->parent; + } + tmp = y; + } + node = (NodePtr)tmp; + return 0; +} + +template +class TQMapConstIterator +{ + public: + /** + * Typedefs + */ + typedef TQMapNode< K, T >* NodePtr; +#ifndef QT_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; +#endif + typedef T value_type; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + typedef const T* pointer; + typedef const T& reference; + + + /** + * Variables + */ + TQMapNode* node; + + /** + * Functions + */ + TQMapConstIterator() : node( 0 ) {} + TQMapConstIterator( TQMapNode* p ) : node( p ) {} + TQMapConstIterator( const TQMapConstIterator& it ) : node( it.node ) {} + TQMapConstIterator( const TQMapIterator& it ) : node( it.node ) {} + + bool operator==( const TQMapConstIterator& it ) const { return node == it.node; } + bool operator!=( const TQMapConstIterator& it ) const { return node != it.node; } + const T& operator*() const { return node->data; } + // UDT for T = x* + // const T* operator->() const { return &node->data; } + + const K& key() const { return node->key; } + const T& data() const { return node->data; } + +private: + int inc(); + int dec(); + +public: + TQMapConstIterator& operator++() { + inc(); + return *this; + } + + TQMapConstIterator operator++(int) { + TQMapConstIterator tmp = *this; + inc(); + return tmp; + } + + TQMapConstIterator& operator--() { + dec(); + return *this; + } + + TQMapConstIterator operator--(int) { + TQMapConstIterator tmp = *this; + dec(); + return tmp; + } +}; + +template +Q_INLINE_TEMPLATES int TQMapConstIterator::inc() +{ + TQMapNodeBase* tmp = node; + if ( tmp->right ) { + tmp = tmp->right; + while ( tmp->left ) + tmp = tmp->left; + } else { + TQMapNodeBase* y = tmp->parent; + while (tmp == y->right) { + tmp = y; + y = y->parent; + } + if (tmp->right != y) + tmp = y; + } + node = (NodePtr)tmp; + return 0; +} + +template +Q_INLINE_TEMPLATES int TQMapConstIterator::dec() +{ + TQMapNodeBase* tmp = node; + if (tmp->color == TQMapNodeBase::Red && + tmp->parent->parent == tmp ) { + tmp = tmp->right; + } else if (tmp->left != 0) { + TQMapNodeBase* y = tmp->left; + while ( y->right ) + y = y->right; + tmp = y; + } else { + TQMapNodeBase* y = tmp->parent; + while (tmp == y->left) { + tmp = y; + y = y->parent; + } + tmp = y; + } + node = (NodePtr)tmp; + return 0; +} + +// ### 4.0: rename to something without Private in it. Not really internal. +class Q_EXPORT TQMapPrivateBase : public TQShared +{ +public: + TQMapPrivateBase() { + node_count = 0; + } + TQMapPrivateBase( const TQMapPrivateBase* _map) { + node_count = _map->node_count; + } + + /** + * Implementations of basic tree algorithms + */ + void rotateLeft( TQMapNodeBase* x, TQMapNodeBase*& root); + void rotateRight( TQMapNodeBase* x, TQMapNodeBase*& root ); + void rebalance( TQMapNodeBase* x, TQMapNodeBase*& root ); + TQMapNodeBase* removeAndRebalance( TQMapNodeBase* z, TQMapNodeBase*& root, + TQMapNodeBase*& leftmost, + TQMapNodeBase*& rightmost ); + + /** + * Variables + */ + int node_count; +}; + + +template +class TQMapPrivate : public TQMapPrivateBase +{ +public: + /** + * Typedefs + */ + typedef TQMapIterator< Key, T > Iterator; + typedef TQMapConstIterator< Key, T > ConstIterator; + typedef TQMapNode< Key, T > Node; + typedef TQMapNode< Key, T >* NodePtr; + + /** + * Functions + */ + TQMapPrivate(); + TQMapPrivate( const TQMapPrivate< Key, T >* _map ); + ~TQMapPrivate() { clear(); delete header; } + + NodePtr copy( NodePtr p ); + void clear(); + void clear( NodePtr p ); + + Iterator begin() { return Iterator( (NodePtr)(header->left ) ); } + Iterator end() { return Iterator( header ); } + ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); } + ConstIterator end() const { return ConstIterator( header ); } + + ConstIterator find(const Key& k) const; + + void remove( Iterator it ) { + NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right ); + delete del; + --node_count; + } + +#ifdef QT_QMAP_DEBUG + void inorder( TQMapNodeBase* x = 0, int level = 0 ){ + if ( !x ) + x = header->parent; + if ( x->left ) + inorder( x->left, level + 1 ); + //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl; + if ( x->right ) + inorder( x->right, level + 1 ); + } +#endif + +#if 0 + Iterator insertMulti(const Key& v){ + TQMapNodeBase* y = header; + TQMapNodeBase* x = header->parent; + while (x != 0){ + y = x; + x = ( v < key(x) ) ? x->left : x->right; + } + return insert(x, y, v); + } +#endif + + Iterator insertSingle( const Key& k ); + Iterator insert( TQMapNodeBase* x, TQMapNodeBase* y, const Key& k ); + +protected: + /** + * Helpers + */ + const Key& key( TQMapNodeBase* b ) const { return ((NodePtr)b)->key; } + + /** + * Variables + */ + NodePtr header; +}; + + +template +Q_INLINE_TEMPLATES TQMapPrivate::TQMapPrivate() { + header = new Node; + header->color = TQMapNodeBase::Red; // Mark the header + header->parent = 0; + header->left = header->right = header; +} +template +Q_INLINE_TEMPLATES TQMapPrivate::TQMapPrivate( const TQMapPrivate< Key, T >* _map ) : TQMapPrivateBase( _map ) { + header = new Node; + header->color = TQMapNodeBase::Red; // Mark the header + if ( _map->header->parent == 0 ) { + header->parent = 0; + header->left = header->right = header; + } else { + header->parent = copy( (NodePtr)(_map->header->parent) ); + header->parent->parent = header; + header->left = header->parent->minimum(); + header->right = header->parent->maximum(); + } +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::NodePtr TQMapPrivate::copy( Q_TYPENAME TQMapPrivate::NodePtr p ) +{ + if ( !p ) + return 0; + NodePtr n = new Node( *p ); + n->color = p->color; + if ( p->left ) { + n->left = copy( (NodePtr)(p->left) ); + n->left->parent = n; + } else { + n->left = 0; + } + if ( p->right ) { + n->right = copy( (NodePtr)(p->right) ); + n->right->parent = n; + } else { + n->right = 0; + } + return n; +} + +template +Q_INLINE_TEMPLATES void TQMapPrivate::clear() +{ + clear( (NodePtr)(header->parent) ); + header->color = TQMapNodeBase::Red; + header->parent = 0; + header->left = header->right = header; + node_count = 0; +} + +template +Q_INLINE_TEMPLATES void TQMapPrivate::clear( Q_TYPENAME TQMapPrivate::NodePtr p ) +{ + while ( p != 0 ) { + clear( (NodePtr)p->right ); + NodePtr y = (NodePtr)p->left; + delete p; + p = y; + } +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::ConstIterator TQMapPrivate::find(const Key& k) const +{ + TQMapNodeBase* y = header; // Last node + TQMapNodeBase* x = header->parent; // Root node. + + while ( x != 0 ) { + // If as k <= key(x) go left + if ( !( key(x) < k ) ) { + y = x; + x = x->left; + } else { + x = x->right; + } + } + + // Was k bigger/smaller then the biggest/smallest + // element of the tree ? Return end() + if ( y == header || k < key(y) ) + return ConstIterator( header ); + return ConstIterator( (NodePtr)y ); +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::Iterator TQMapPrivate::insertSingle( const Key& k ) +{ + // Search correct position in the tree + TQMapNodeBase* y = header; + TQMapNodeBase* x = header->parent; + bool result = TRUE; + while ( x != 0 ) { + result = ( k < key(x) ); + y = x; + x = result ? x->left : x->right; + } + // Get iterator on the last not empty one + Iterator j( (NodePtr)y ); + if ( result ) { + // Smaller then the leftmost one ? + if ( j == begin() ) { + return insert(x, y, k ); + } else { + // Perhaps daddy is the right one ? + --j; + } + } + // Really bigger ? + if ( (j.node->key) < k ) + return insert(x, y, k ); + // We are going to replace a node + return j; +} + + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::Iterator TQMapPrivate::insert( TQMapNodeBase* x, TQMapNodeBase* y, const Key& k ) +{ + NodePtr z = new Node( k ); + if (y == header || x != 0 || k < key(y) ) { + y->left = z; // also makes leftmost = z when y == header + if ( y == header ) { + header->parent = z; + header->right = z; + } else if ( y == header->left ) + header->left = z; // maintain leftmost pointing to min node + } else { + y->right = z; + if ( y == header->right ) + header->right = z; // maintain rightmost pointing to max node + } + z->parent = y; + z->left = 0; + z->right = 0; + rebalance( z, header->parent ); + ++node_count; + return Iterator(z); +} + + +#ifdef QT_CHECK_RANGE +# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_MAP_RANGE ) +# define QT_CHECK_INVALID_MAP_ELEMENT if ( empty() ) qWarning( "TQMap: Warning invalid element" ) +# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL Q_ASSERT( !empty() ); +# else +# define QT_CHECK_INVALID_MAP_ELEMENT +# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL +# endif +#else +# define QT_CHECK_INVALID_MAP_ELEMENT +# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL +#endif + +template class TQDeepCopy; + +template +class TQMap +{ +public: + /** + * Typedefs + */ + typedef Key key_type; + typedef T mapped_type; + typedef TQPair value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + typedef size_t size_type; + typedef TQMapIterator iterator; + typedef TQMapConstIterator const_iterator; + typedef TQPair insert_pair; + + typedef TQMapIterator< Key, T > Iterator; + typedef TQMapConstIterator< Key, T > ConstIterator; + typedef T ValueType; + typedef TQMapPrivate< Key, T > Priv; + + /** + * API + */ + TQMap() + { + sh = new TQMapPrivate< Key, T >; + } + TQMap( const TQMap& m ) + { + sh = m.sh; sh->ref(); + } + +#ifndef QT_NO_STL + TQMap( const std::map& m ) + { + sh = new TQMapPrivate; + Q_TYPENAME std::map::const_iterator it = m.begin(); + for ( ; it != m.end(); ++it ) { + value_type p( (*it).first, (*it).second ); + insert( p ); + } + } +#endif + ~TQMap() + { + if ( sh->deref() ) + delete sh; + } + TQMap& operator= ( const TQMap& m ); +#ifndef QT_NO_STL + TQMap& operator= ( const std::map& m ) + { + clear(); + Q_TYPENAME std::map::const_iterator it = m.begin(); + for ( ; it != m.end(); ++it ) { + value_type p( (*it).first, (*it).second ); + insert( p ); + } + return *this; + } +#endif + + iterator begin() { detach(); return sh->begin(); } + iterator end() { detach(); return sh->end(); } + const_iterator begin() const { return ((const Priv*)sh)->begin(); } + const_iterator end() const { return ((const Priv*)sh)->end(); } + const_iterator constBegin() const { return begin(); } + const_iterator constEnd() const { return end(); } + + iterator replace( const Key& k, const T& v ) + { + remove( k ); + return insert( k, v ); + } + + size_type size() const + { + return sh->node_count; + } + bool empty() const + { + return sh->node_count == 0; + } + TQPair insert( const value_type& x ); + + void erase( iterator it ) + { + detach(); + sh->remove( it ); + } + void erase( const key_type& k ); + size_type count( const key_type& k ) const; + T& operator[] ( const Key& k ); + void clear(); + + iterator find ( const Key& k ) + { + detach(); + return iterator( sh->find( k ).node ); + } + const_iterator find ( const Key& k ) const { return sh->find( k ); } + + const T& operator[] ( const Key& k ) const + { QT_CHECK_INVALID_MAP_ELEMENT; return sh->find( k ).data(); } + bool contains ( const Key& k ) const + { return find( k ) != end(); } + //{ return sh->find( k ) != ((const Priv*)sh)->end(); } + + size_type count() const { return sh->node_count; } + + TQValueList keys() const { + TQValueList r; + for (const_iterator i=begin(); i!=end(); ++i) + r.append(i.key()); + return r; + } + + TQValueList values() const { + TQValueList r; + for (const_iterator i=begin(); i!=end(); ++i) + r.append(*i); + return r; + } + + bool isEmpty() const { return sh->node_count == 0; } + + iterator insert( const Key& key, const T& value, bool overwrite = TRUE ); + void remove( iterator it ) { detach(); sh->remove( it ); } + void remove( const Key& k ); + +#if defined(Q_FULL_TEMPLATE_INSTANTIATION) + bool operator==( const TQMap& ) const { return FALSE; } +#ifndef QT_NO_STL + bool operator==( const std::map& ) const { return FALSE; } +#endif +#endif + +protected: + /** + * Helpers + */ + void detach() { if ( sh->count > 1 ) detachInternal(); } + + Priv* sh; +private: + void detachInternal(); + + friend class TQDeepCopy< TQMap >; +}; + +template +Q_INLINE_TEMPLATES TQMap& TQMap::operator= ( const TQMap& m ) +{ + m.sh->ref(); + if ( sh->deref() ) + delete sh; + sh = m.sh; + return *this; +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMap::insert_pair TQMap::insert( const Q_TYPENAME TQMap::value_type& x ) +{ + detach(); + size_type n = size(); + iterator it = sh->insertSingle( x.first ); + bool inserted = FALSE; + if ( n < size() ) { + inserted = TRUE; + it.data() = x.second; + } + return TQPair( it, inserted ); +} + +template +Q_INLINE_TEMPLATES void TQMap::erase( const Key& k ) +{ + detach(); + iterator it( sh->find( k ).node ); + if ( it != end() ) + sh->remove( it ); +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMap::size_type TQMap::count( const Key& k ) const +{ + const_iterator it( sh->find( k ).node ); + if ( it != end() ) { + size_type c = 0; + while ( it != end() ) { + ++it; + ++c; + } + return c; + } + return 0; +} + +template +Q_INLINE_TEMPLATES T& TQMap::operator[] ( const Key& k ) +{ + detach(); + TQMapNode* p = sh->find( k ).node; + if ( p != sh->end().node ) + return p->data; + return insert( k, T() ).data(); +} + +template +Q_INLINE_TEMPLATES void TQMap::clear() +{ + if ( sh->count == 1 ) + sh->clear(); + else { + sh->deref(); + sh = new TQMapPrivate; + } +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQMap::iterator TQMap::insert( const Key& key, const T& value, bool overwrite ) +{ + detach(); + size_type n = size(); + iterator it = sh->insertSingle( key ); + if ( overwrite || n < size() ) + it.data() = value; + return it; +} + +template +Q_INLINE_TEMPLATES void TQMap::remove( const Key& k ) +{ + detach(); + iterator it( sh->find( k ).node ); + if ( it != end() ) + sh->remove( it ); +} + +template +Q_INLINE_TEMPLATES void TQMap::detachInternal() +{ + sh->deref(); sh = new TQMapPrivate( sh ); +} + + +#ifndef QT_NO_DATASTREAM +template +Q_INLINE_TEMPLATES TQDataStream& operator>>( TQDataStream& s, TQMap& m ) { + m.clear(); + Q_UINT32 c; + s >> c; + for( Q_UINT32 i = 0; i < c; ++i ) { + Key k; T t; + s >> k >> t; + m.insert( k, t ); + if ( s.atEnd() ) + break; + } + return s; +} + + +template +Q_INLINE_TEMPLATES TQDataStream& operator<<( TQDataStream& s, const TQMap& m ) { + s << (Q_UINT32)m.size(); + TQMapConstIterator it = m.begin(); + for( ; it != m.end(); ++it ) + s << it.key() << it.data(); + return s; +} +#endif + +#define Q_DEFINED_QMAP +#include "ntqwinexport.h" +#endif // TQMAP_H diff --git a/src/tools/ntqmemarray.h b/src/tools/ntqmemarray.h new file mode 100644 index 000000000..483671167 --- /dev/null +++ b/src/tools/ntqmemarray.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Definition of TQMemArray template/macro class +** +** Created : 930906 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMEMARRAY_H +#define TQMEMARRAY_H + +#ifndef QT_H +#include "ntqgarray.h" +#endif // QT_H + + +template +class TQMemArray : public TQGArray +{ +public: + typedef type* Iterator; + typedef const type* ConstIterator; + typedef type ValueType; + +protected: + TQMemArray( int, int ) : TQGArray( 0, 0 ) {} + +public: + TQMemArray() {} + TQMemArray( int size ) : TQGArray(size*sizeof(type)) {} // ### 4.0 Q_EXPLICIT + TQMemArray( const TQMemArray &a ) : TQGArray(a) {} + ~TQMemArray() {} + TQMemArray &operator=(const TQMemArray &a) + { return (TQMemArray&)TQGArray::assign(a); } + type *data() const { return (type *)TQGArray::data(); } + uint nrefs() const { return TQGArray::nrefs(); } + uint size() const { return TQGArray::size()/sizeof(type); } + uint count() const { return size(); } + bool isEmpty() const { return TQGArray::size() == 0; } + bool isNull() const { return TQGArray::data() == 0; } + bool resize( uint size ) { return TQGArray::resize(size*sizeof(type)); } + bool resize( uint size, Optimization optim ) { return TQGArray::resize(size*sizeof(type), optim); } + bool truncate( uint pos ) { return TQGArray::resize(pos*sizeof(type)); } + bool fill( const type &d, int size = -1 ) + { return TQGArray::fill((char*)&d,size,sizeof(type) ); } + void detach() { TQGArray::detach(); } + TQMemArray copy() const + { TQMemArray tmp; return tmp.duplicate(*this); } + TQMemArray& assign( const TQMemArray& a ) + { return (TQMemArray&)TQGArray::assign(a); } + TQMemArray& assign( const type *a, uint n ) + { return (TQMemArray&)TQGArray::assign((char*)a,n*sizeof(type)); } + TQMemArray& duplicate( const TQMemArray& a ) + { return (TQMemArray&)TQGArray::duplicate(a); } + TQMemArray& duplicate( const type *a, uint n ) + { return (TQMemArray&)TQGArray::duplicate((char*)a,n*sizeof(type)); } + TQMemArray& setRawData( const type *a, uint n ) + { return (TQMemArray&)TQGArray::setRawData((char*)a, + n*sizeof(type)); } + void resetRawData( const type *a, uint n ) + { TQGArray::resetRawData((char*)a,n*sizeof(type)); } + int find( const type &d, uint i=0 ) const + { return TQGArray::find((char*)&d,i,sizeof(type)); } + int contains( const type &d ) const + { return TQGArray::contains((char*)&d,sizeof(type)); } + void sort() { TQGArray::sort(sizeof(type)); } + int bsearch( const type &d ) const + { return TQGArray::bsearch((const char*)&d,sizeof(type)); } + // ### TQt 4.0: maybe provide uint overload as work-around for MSVC bug + type& operator[]( int i ) const + { return (type &)(*(type *)TQGArray::at(i*sizeof(type))); } + type& at( uint i ) const + { return (type &)(*(type *)TQGArray::at(i*sizeof(type))); } + operator const type*() const { return (const type *)TQGArray::data(); } + bool operator==( const TQMemArray &a ) const { return isEqual(a); } + bool operator!=( const TQMemArray &a ) const { return !isEqual(a); } + Iterator begin() { return data(); } + Iterator end() { return data() + size(); } + ConstIterator begin() const { return data(); } + ConstIterator end() const { return data() + size(); } +}; + +#ifndef QT_NO_COMPAT +#define TQArray TQMemArray +#endif + +#define Q_DEFINED_QMEMARRAY +#include "ntqwinexport.h" +#endif // TQARRAY_H diff --git a/src/tools/ntqmutex.h b/src/tools/ntqmutex.h new file mode 100644 index 000000000..90c5150c3 --- /dev/null +++ b/src/tools/ntqmutex.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Definition of TQMutex class +** +** Created : 931107 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMUTEX_H +#define TQMUTEX_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#if defined(QT_THREAD_SUPPORT) + +class TQMutexPrivate; + +const int Q_MUTEX_NORMAL = 0; +const int Q_MUTEX_RECURSIVE = 1; + +class Q_EXPORT TQMutex +{ + friend class TQThread; + friend class TQWaitCondition; + friend class TQWaitConditionPrivate; + +public: + TQMutex(bool recursive = FALSE); + virtual ~TQMutex(); + + void lock(); + void unlock(); + bool locked(); + bool tryLock(); + +private: + TQMutexPrivate * d; + +#if defined(Q_DISABLE_COPY) + TQMutex( const TQMutex & ); + TQMutex &operator=( const TQMutex & ); +#endif +}; + +class Q_EXPORT TQMutexLocker +{ +public: + TQMutexLocker( TQMutex * ); + ~TQMutexLocker(); + + TQMutex *mutex() const; + +private: + TQMutex *mtx; + +#if defined(Q_DISABLE_COPY) + TQMutexLocker( const TQMutexLocker & ); + TQMutexLocker &operator=( const TQMutexLocker & ); +#endif +}; + +inline TQMutexLocker::TQMutexLocker( TQMutex *m ) + : mtx( m ) +{ + if ( mtx ) mtx->lock(); +} + +inline TQMutexLocker::~TQMutexLocker() +{ + if ( mtx ) mtx->unlock(); +} + +inline TQMutex *TQMutexLocker::mutex() const +{ + return mtx; +} + +#endif + +#endif diff --git a/src/tools/ntqpair.h b/src/tools/ntqpair.h new file mode 100644 index 000000000..60f73f961 --- /dev/null +++ b/src/tools/ntqpair.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Definition of TQPair class +** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPAIR_H +#define TQPAIR_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqdatastream.h" +#endif // QT_H + +template +struct TQPair +{ + typedef T1 first_type; + typedef T2 second_type; + + TQPair() + : first( T1() ), second( T2() ) + {} + TQPair( const T1& t1, const T2& t2 ) + : first( t1 ), second( t2 ) + {} + + TQPair& operator=(const TQPair& other) + { + if (this != &other) { + first = other.first; + second = other.second; + } + return *this; + } + + T1 first; + T2 second; +}; + +template +Q_INLINE_TEMPLATES bool operator==( const TQPair& x, const TQPair& y ) +{ + return x.first == y.first && x.second == y.second; +} + +template +Q_INLINE_TEMPLATES bool operator<( const TQPair& x, const TQPair& y ) +{ + return x.first < y.first || + ( !( y.first < x.first ) && x.second < y.second ); +} + +template +Q_INLINE_TEMPLATES TQPair qMakePair( const T1& x, const T2& y ) +{ + return TQPair( x, y ); +} + +#ifndef QT_NO_DATASTREAM +template +inline TQDataStream& operator>>( TQDataStream& s, TQPair& p ) +{ + s >> p.first >> p.second; + return s; +} + +template +inline TQDataStream& operator<<( TQDataStream& s, const TQPair& p ) +{ + s << p.first << p.second; + return s; +} +#endif + +#endif diff --git a/src/tools/ntqptrcollection.h b/src/tools/ntqptrcollection.h new file mode 100644 index 000000000..5f0690afa --- /dev/null +++ b/src/tools/ntqptrcollection.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Definition of base class for all pointer based collection classes +** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPTRCOLLECTION_H +#define TQPTRCOLLECTION_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + + +class TQGVector; +class TQGList; +class TQGDict; + + +class Q_EXPORT TQPtrCollection // inherited by all collections +{ +public: + bool autoDelete() const { return del_item; } + void setAutoDelete( bool enable ) { del_item = enable; } + + virtual uint count() const = 0; + virtual void clear() = 0; // delete all objects + + typedef void *Item; // generic collection item + +protected: + TQPtrCollection() { del_item = FALSE; } // no deletion of objects + TQPtrCollection(const TQPtrCollection &) { del_item = FALSE; } + virtual ~TQPtrCollection() {} + + bool del_item; // default FALSE + + virtual Item newItem( Item ); // create object + virtual void deleteItem( Item ) = 0; // delete object +}; + + +#ifndef QT_NO_COMPAT +#define TQCollection TQPtrCollection +#endif + +#endif // TQPTRCOLLECTION_H diff --git a/src/tools/ntqptrdict.h b/src/tools/ntqptrdict.h new file mode 100644 index 000000000..181492bd9 --- /dev/null +++ b/src/tools/ntqptrdict.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Definition of TQPtrDict template class +** +** Created : 970415 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPTRDICT_H +#define TQPTRDICT_H + +#ifndef QT_H +#include "ntqgdict.h" +#endif // QT_H + +template +class TQPtrDict +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGDict +#endif +{ +public: + TQPtrDict(int size=17) : TQGDict(size,PtrKey,0,0) {} + TQPtrDict( const TQPtrDict &d ) : TQGDict(d) {} + ~TQPtrDict() { clear(); } + TQPtrDict &operator=(const TQPtrDict &d) + { return (TQPtrDict&)TQGDict::operator=(d); } + uint count() const { return TQGDict::count(); } + uint size() const { return TQGDict::size(); } + bool isEmpty() const { return TQGDict::count() == 0; } + void insert( void *k, const type *d ) + { TQGDict::look_ptr(k,(Item)d,1); } + void replace( void *k, const type *d ) + { TQGDict::look_ptr(k,(Item)d,2); } + bool remove( void *k ) { return TQGDict::remove_ptr(k); } + type *take( void *k ) { return (type*)TQGDict::take_ptr(k); } + type *find( void *k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_ptr(k,0,0); } + type *operator[]( void *k ) const + { return (type *)((TQGDict*)this)->TQGDict::look_ptr(k,0,0); } + void clear() { TQGDict::clear(); } + void resize( uint n ) { TQGDict::resize(n); } + void statistics() const { TQGDict::statistics(); } + +#ifdef Q_QDOC +protected: + virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); + virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQPtrDict::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template +inline void TQPtrDict::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class TQPtrDictIterator : public TQGDictIterator +{ +public: + TQPtrDictIterator(const TQPtrDict &d) :TQGDictIterator((TQGDict &)d) {} + ~TQPtrDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)TQGDictIterator::toFirst(); } + operator type *() const { return (type *)TQGDictIterator::get(); } + type *current() const { return (type *)TQGDictIterator::get(); } + void *currentKey() const { return TQGDictIterator::getKeyPtr(); } + type *operator()() { return (type *)TQGDictIterator::operator()(); } + type *operator++() { return (type *)TQGDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j);} +}; + +#endif // TQPTRDICT_H diff --git a/src/tools/ntqptrlist.h b/src/tools/ntqptrlist.h new file mode 100644 index 000000000..4482d0a9b --- /dev/null +++ b/src/tools/ntqptrlist.h @@ -0,0 +1,195 @@ +/**************************************************************************** +** +** Definition of TQPtrList template/macro class +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPTRLIST_H +#define TQPTRLIST_H + +#ifndef QT_H +#include "ntqglist.h" +#endif // QT_H + +template +class TQPtrListStdIterator : public TQGListStdIterator +{ +public: + inline TQPtrListStdIterator( TQLNode* n ): TQGListStdIterator(n) {} + type *operator*() { return node ? (type *)node->getData() : 0; } + inline TQPtrListStdIterator operator++() + { node = next(); return *this; } + inline TQPtrListStdIterator operator++(int) + { TQLNode* n = node; node = next(); return TQPtrListStdIterator( n ); } + inline bool operator==( const TQPtrListStdIterator& it ) const { return node == it.node; } + inline bool operator!=( const TQPtrListStdIterator& it ) const { return node != it.node; } +}; + + +template +class TQPtrList +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGList +#endif +{ +public: + + TQPtrList() {} + TQPtrList( const TQPtrList &l ) : TQGList(l) {} + ~TQPtrList() { clear(); } + TQPtrList &operator=(const TQPtrList &l) + { return (TQPtrList&)TQGList::operator=(l); } + bool operator==( const TQPtrList &list ) const + { return TQGList::operator==( list ); } + bool operator!=( const TQPtrList &list ) const + { return !TQGList::operator==( list ); } + uint count() const { return TQGList::count(); } + bool isEmpty() const { return TQGList::count() == 0; } + bool insert( uint i, const type *d){ return TQGList::insertAt(i,(TQPtrCollection::Item)d); } + void inSort( const type *d ) { TQGList::inSort((TQPtrCollection::Item)d); } + void prepend( const type *d ) { TQGList::insertAt(0,(TQPtrCollection::Item)d); } + void append( const type *d ) { TQGList::append((TQPtrCollection::Item)d); } + bool remove( uint i ) { return TQGList::removeAt(i); } + bool remove() { return TQGList::remove((TQPtrCollection::Item)0); } + bool remove( const type *d ) { return TQGList::remove((TQPtrCollection::Item)d); } + bool removeRef( const type *d ) { return TQGList::removeRef((TQPtrCollection::Item)d); } + void removeNode( TQLNode *n ) { TQGList::removeNode(n); } + bool removeFirst() { return TQGList::removeFirst(); } + bool removeLast() { return TQGList::removeLast(); } + type *take( uint i ) { return (type *)TQGList::takeAt(i); } + type *take() { return (type *)TQGList::take(); } + type *takeNode( TQLNode *n ) { return (type *)TQGList::takeNode(n); } + void clear() { TQGList::clear(); } + void sort() { TQGList::sort(); } + int find( const type *d ) { return TQGList::find((TQPtrCollection::Item)d); } + int findNext( const type *d ) { return TQGList::find((TQPtrCollection::Item)d,FALSE); } + int findRef( const type *d ) { return TQGList::findRef((TQPtrCollection::Item)d); } + int findNextRef( const type *d ){ return TQGList::findRef((TQPtrCollection::Item)d,FALSE);} + uint contains( const type *d ) const { return TQGList::contains((TQPtrCollection::Item)d); } + uint containsRef( const type *d ) const + { return TQGList::containsRef((TQPtrCollection::Item)d); } + bool replace( uint i, const type *d ) { return TQGList::replaceAt( i, (TQPtrCollection::Item)d ); } + type *at( uint i ) { return (type *)TQGList::at(i); } + int at() const { return TQGList::at(); } + type *current() const { return (type *)TQGList::get(); } + TQLNode *currentNode() const { return TQGList::currentNode(); } + type *getFirst() const { return (type *)TQGList::cfirst(); } + type *getLast() const { return (type *)TQGList::clast(); } + type *first() { return (type *)TQGList::first(); } + type *last() { return (type *)TQGList::last(); } + type *next() { return (type *)TQGList::next(); } + type *prev() { return (type *)TQGList::prev(); } + void toVector( TQGVector *vec )const{ TQGList::toVector(vec); } + + + // standard iterators + typedef TQPtrListStdIterator Iterator; + typedef TQPtrListStdIterator ConstIterator; + inline Iterator begin() { return TQGList::begin(); } + inline ConstIterator begin() const { return TQGList::begin(); } + inline ConstIterator constBegin() const { return TQGList::begin(); } + inline Iterator end() { return TQGList::end(); } + inline ConstIterator end() const { return TQGList::end(); } + inline ConstIterator constEnd() const { return TQGList::end(); } + inline Iterator erase( Iterator it ) { return TQGList::erase( it ); } + // stl syntax compatibility + typedef Iterator iterator; + typedef ConstIterator const_iterator; + + +#ifdef Q_QDOC +protected: + virtual int compareItems( TQPtrCollection::Item, TQPtrCollection::Item ); + virtual TQDataStream& read( TQDataStream&, TQPtrCollection::Item& ); + virtual TQDataStream& write( TQDataStream&, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQPtrList::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQPtrList::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class TQPtrListIterator : public TQGListIterator +{ +public: + TQPtrListIterator(const TQPtrList &l) :TQGListIterator((TQGList &)l) {} + ~TQPtrListIterator() {} + uint count() const { return list->count(); } + bool isEmpty() const { return list->count() == 0; } + bool atFirst() const { return TQGListIterator::atFirst(); } + bool atLast() const { return TQGListIterator::atLast(); } + type *toFirst() { return (type *)TQGListIterator::toFirst(); } + type *toLast() { return (type *)TQGListIterator::toLast(); } + operator type *() const { return (type *)TQGListIterator::get(); } + type *operator*() { return (type *)TQGListIterator::get(); } + + // No good, since TQPtrList (ie. TQStrList fails... + // + // MSVC++ gives warning + // Sunpro C++ 4.1 gives error + // type *operator->() { return (type *)TQGListIterator::get(); } + + type *current() const { return (type *)TQGListIterator::get(); } + type *operator()() { return (type *)TQGListIterator::operator()();} + type *operator++() { return (type *)TQGListIterator::operator++(); } + type *operator+=(uint j) { return (type *)TQGListIterator::operator+=(j);} + type *operator--() { return (type *)TQGListIterator::operator--(); } + type *operator-=(uint j) { return (type *)TQGListIterator::operator-=(j);} + TQPtrListIterator& operator=(const TQPtrListIterator&it) + { TQGListIterator::operator=(it); return *this; } +}; + +#ifndef QT_NO_COMPAT +#define TQList TQPtrList +#define TQListIterator TQPtrListIterator +#endif + +#define Q_DEFINED_QPTRLIST +#include "ntqwinexport.h" + +#endif // TQPTRLIST_H diff --git a/src/tools/ntqptrqueue.h b/src/tools/ntqptrqueue.h new file mode 100644 index 000000000..0c1bd5e6b --- /dev/null +++ b/src/tools/ntqptrqueue.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Definition of TQPtrQueue template/macro class +** +** Created : 920917 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPTRTQUEUE_H +#define TQPTRTQUEUE_H + +#ifndef QT_H +#include "ntqglist.h" +#endif // QT_H + +template +class TQPtrQueue : protected TQGList +{ +public: + TQPtrQueue() {} + TQPtrQueue( const TQPtrQueue &q ) : TQGList(q) {} + ~TQPtrQueue() { clear(); } + TQPtrQueue& operator=(const TQPtrQueue &q) + { return (TQPtrQueue&)TQGList::operator=(q); } + bool autoDelete() const { return TQPtrCollection::autoDelete(); } + void setAutoDelete( bool del ) { TQPtrCollection::setAutoDelete(del); } + uint count() const { return TQGList::count(); } + bool isEmpty() const { return TQGList::count() == 0; } + void enqueue( const type *d ) { TQGList::append(Item(d)); } + type *dequeue() { return (type *)TQGList::takeFirst();} + bool remove() { return TQGList::removeFirst(); } + void clear() { TQGList::clear(); } + type *head() const { return (type *)TQGList::cfirst(); } + operator type *() const { return (type *)TQGList::cfirst(); } + type *current() const { return (type *)TQGList::cfirst(); } + +#ifdef Q_QDOC +protected: + virtual TQDataStream& read( TQDataStream&, TQPtrCollection::Item& ); + virtual TQDataStream& write( TQDataStream&, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQPtrQueue::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQPtrQueue::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +#ifndef QT_NO_COMPAT +#define TQQueue TQPtrQueue +#endif + +#endif // TQPTRTQUEUE_H diff --git a/src/tools/ntqptrstack.h b/src/tools/ntqptrstack.h new file mode 100644 index 000000000..913dae356 --- /dev/null +++ b/src/tools/ntqptrstack.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Definition of TQPtrStack pointer based template class +** +** Created : 920917 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPTRSTACK_H +#define TQPTRSTACK_H + +#ifndef QT_H +#include "ntqglist.h" +#endif // QT_H + +template +class TQPtrStack : protected TQGList +{ +public: + TQPtrStack() { } + TQPtrStack( const TQPtrStack &s ) : TQGList( s ) { } + ~TQPtrStack() { clear(); } + TQPtrStack &operator=(const TQPtrStack &s) + { return (TQPtrStack&)TQGList::operator=(s); } + bool autoDelete() const { return TQPtrCollection::autoDelete(); } + void setAutoDelete( bool del ) { TQPtrCollection::setAutoDelete(del); } + uint count() const { return TQGList::count(); } + bool isEmpty() const { return TQGList::count() == 0; } + void push( const type *d ) { TQGList::insertAt(0,Item(d)); } + type *pop() { return (type *)TQGList::takeFirst(); } + bool remove() { return TQGList::removeFirst(); } + void clear() { TQGList::clear(); } + type *top() const { return (type *)TQGList::cfirst(); } + operator type *() const { return (type *)TQGList::cfirst(); } + type *current() const { return (type *)TQGList::cfirst(); } + +#ifdef Q_QDOC +protected: + virtual TQDataStream& read( TQDataStream&, TQPtrCollection::Item& ); + virtual TQDataStream& write( TQDataStream&, TQPtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQPtrStack::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQPtrStack::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +#ifndef QT_NO_COMPAT +#define TQStack TQPtrStack +#endif + +#endif // TQPTRSTACK_H diff --git a/src/tools/ntqptrvector.h b/src/tools/ntqptrvector.h new file mode 100644 index 000000000..046dc9486 --- /dev/null +++ b/src/tools/ntqptrvector.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Definition of TQPtrVector pointer based template class +** +** Created : 930907 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPTRVECTOR_H +#define TQPTRVECTOR_H + +#ifndef QT_H +#include "ntqgvector.h" +#endif // QT_H + +template +class TQPtrVector +#ifdef Q_QDOC + : public TQPtrCollection +#else + : public TQGVector +#endif +{ +public: + TQPtrVector() { } + TQPtrVector( uint size ) : TQGVector(size) { } + TQPtrVector( const TQPtrVector &v ) : TQGVector( v ) { } + ~TQPtrVector() { clear(); } + TQPtrVector &operator=(const TQPtrVector &v) + { return (TQPtrVector&)TQGVector::operator=(v); } + bool operator==( const TQPtrVector &v ) const { return TQGVector::operator==(v); } + type **data() const { return (type **)TQGVector::data(); } + uint size() const { return TQGVector::size(); } + uint count() const { return TQGVector::count(); } + bool isEmpty() const { return TQGVector::count() == 0; } + bool isNull() const { return TQGVector::size() == 0; } + bool resize( uint size ) { return TQGVector::resize(size); } + bool insert( uint i, const type *d){ return TQGVector::insert(i,(Item)d); } + bool remove( uint i ) { return TQGVector::remove(i); } + type *take( uint i ) { return (type *)TQGVector::take(i); } + void clear() { TQGVector::clear(); } + bool fill( const type *d, int size=-1 ) + { return TQGVector::fill((Item)d,size);} + void sort() { TQGVector::sort(); } + int bsearch( const type *d ) const{ return TQGVector::bsearch((Item)d); } + int findRef( const type *d, uint i=0 ) const + { return TQGVector::findRef((Item)d,i);} + int find( const type *d, uint i= 0 ) const + { return TQGVector::find((Item)d,i); } + uint containsRef( const type *d ) const + { return TQGVector::containsRef((Item)d); } + uint contains( const type *d ) const + { return TQGVector::contains((Item)d); } + type *operator[]( int i ) const { return (type *)TQGVector::at(i); } + type *at( uint i ) const { return (type *)TQGVector::at(i); } + void toList( TQGList *list ) const { TQGVector::toList(list); } + +#ifdef Q_QDOC +protected: + virtual int compareItems( TQPtrCollection::Item d1, TQPtrCollection::Item d2 ); + virtual TQDataStream& read( TQDataStream &s, TQPtrCollection::Item &d ); + virtual TQDataStream& write( TQDataStream &s, TQPtrCollection::Item d ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void TQPtrVector::deleteItem( TQPtrCollection::Item ) +{ +} +#endif + +template inline void TQPtrVector::deleteItem( TQPtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +#ifndef QT_NO_COMPAT +#define TQVector TQPtrVector +#endif + +#define Q_DEFINED_QPTRVECTOR +#include "ntqwinexport.h" +#endif // TQVECTOR_H diff --git a/src/tools/ntqregexp.h b/src/tools/ntqregexp.h new file mode 100644 index 000000000..075572224 --- /dev/null +++ b/src/tools/ntqregexp.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Definition of TQRegExp class +** +** Created : 950126 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQREGEXP_H +#define TQREGEXP_H + +#ifndef QT_H +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_REGEXP +class TQRegExpEngine; +struct TQRegExpPrivate; + +class Q_EXPORT TQRegExp +{ +public: + enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch }; + + TQRegExp(); + TQRegExp( const TQString& pattern, bool caseSensitive = TRUE, + bool wildcard = FALSE ); + TQRegExp( const TQRegExp& rx ); + ~TQRegExp(); + TQRegExp& operator=( const TQRegExp& rx ); + + bool operator==( const TQRegExp& rx ) const; + bool operator!=( const TQRegExp& rx ) const { return !operator==( rx ); } + + bool isEmpty() const; + bool isValid() const; + TQString pattern() const; + void setPattern( const TQString& pattern ); + bool caseSensitive() const; + void setCaseSensitive( bool sensitive ); +#ifndef QT_NO_REGEXP_WILDCARD + bool wildcard() const; + void setWildcard( bool wildcard ); +#endif + bool minimal() const; + void setMinimal( bool minimal ); + + bool exactMatch( const TQString& str ) const; +#ifndef QT_NO_COMPAT + int match( const TQString& str, int index = 0, int *len = 0, + bool indexIsStart = TRUE ) const; +#endif + +#if defined(Q_QDOC) + int search( const TQString& str, int offset = 0, + CaretMode caretMode = CaretAtZero ) const; + int searchRev( const TQString& str, int offset = -1, + CaretMode caretMode = CaretAtZero ) const; +#else + // ### TQt 4.0: reduce these four to two functions + int search( const TQString& str, int offset = 0 ) const; + int search( const TQString& str, int offset, CaretMode caretMode ) const; + int searchRev( const TQString& str, int offset = -1 ) const; + int searchRev( const TQString& str, int offset, CaretMode caretMode ) const; +#endif + int matchedLength() const; +#ifndef QT_NO_REGEXP_CAPTURE + int numCaptures() const; + TQStringList capturedTexts(); + TQString cap( int nth = 0 ); + int pos( int nth = 0 ); + TQString errorString(); +#endif + + static TQString escape( const TQString& str ); + +private: + void prepareEngine() const; + void prepareEngineForMatch( const TQString& str ) const; + void invalidateEngine(); + + static int caretIndex( int offset, CaretMode caretMode ); + + TQRegExpEngine *eng; + TQRegExpPrivate *priv; +}; +#endif // QT_NO_REGEXP +#endif // TQREGEXP_H diff --git a/src/tools/ntqsemaphore.h b/src/tools/ntqsemaphore.h new file mode 100644 index 000000000..8b246054c --- /dev/null +++ b/src/tools/ntqsemaphore.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Definition of TQSemaphore class +** +** Created : 931107 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSEMAPHORE_H +#define TQSEMAPHORE_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#if defined(QT_THREAD_SUPPORT) + +class TQSemaphorePrivate; + +class Q_EXPORT TQSemaphore +{ +public: + TQSemaphore( int ); + virtual ~TQSemaphore(); + + int available() const; + int total() const; + + // postfix operators + int operator++(int); + int operator--(int); + + int operator+=(int); + int operator-=(int); + + bool tryAccess(int); + +private: + TQSemaphorePrivate *d; + +#if defined(Q_DISABLE_COPY) + TQSemaphore(const TQSemaphore &); + TQSemaphore &operator=(const TQSemaphore &); +#endif +}; + +#endif + +#endif diff --git a/src/tools/ntqsettings.h b/src/tools/ntqsettings.h new file mode 100644 index 000000000..5c4b24cac --- /dev/null +++ b/src/tools/ntqsettings.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Definition of TQSettings class +** +** Created : 000626 +** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSETTINGS_H +#define TQSETTINGS_H + +#ifndef QT_H +#include "ntqdatetime.h" +#include "ntqstringlist.h" +#endif // QT_H + +#ifndef QT_NO_SETTINGS + +class TQSettingsPrivate; + + +class Q_EXPORT TQSettings +{ +public: + enum Format { + Native = 0, + Ini + }; + enum System { + Unix = 0, + Windows, + Mac + }; + enum Scope { + User, + Global + }; + + TQSettings(); + TQSettings( Format format ); + + ~TQSettings(); + +#if !defined(Q_NO_BOOL_TYPE) + bool writeEntry( const TQString &, bool ); +#endif + bool writeEntry( const TQString &, double ); + bool writeEntry( const TQString &, int ); + 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& sep ); + + TQStringList entryList(const TQString &) const; + TQStringList subkeyList(const TQString &) const; + + //### remove non const versions in 4.0 + TQStringList readListEntry( const TQString &, bool * = 0 ); + TQStringList readListEntry( const TQString &, const TQChar& sep, bool * = 0 ); + TQString readEntry( const TQString &, const TQString &def = TQString::null, bool * = 0 ); + int readNumEntry( const TQString &, int def = 0, bool * = 0 ); + double readDoubleEntry( const TQString &, double def = 0, bool * = 0 ); + bool readBoolEntry( const TQString &, bool def = FALSE, bool * = 0 ); + + //### make those non-inlined in 4.0 + TQStringList readListEntry( const TQString &key, bool *ok = 0 ) const + { + TQSettings *that = (TQSettings*)this; + return that->readListEntry( key, ok ); + } + TQStringList readListEntry( const TQString &key, const TQChar& sep, bool *ok = 0 ) const + { + TQSettings *that = (TQSettings*)this; + return that->readListEntry( key, sep, ok ); + } + TQString readEntry( const TQString &key, const TQString &def = TQString::null, + bool *ok = 0 ) const + { + TQSettings *that = (TQSettings*)this; + return that->readEntry( key, def, ok ); + } + int readNumEntry( const TQString &key, int def = 0, bool *ok = 0 ) const + { + TQSettings *that = (TQSettings*)this; + return that->readNumEntry( key, def, ok ); + } + + double readDoubleEntry( const TQString &key, double def = 0, bool *ok = 0 ) const + { + TQSettings *that = (TQSettings*)this; + return that->readDoubleEntry( key, def, ok ); + } + bool readBoolEntry( const TQString &key, bool def = FALSE, bool *ok = 0 ) const + { + TQSettings *that = (TQSettings*)this; + return that->readBoolEntry( key, def, ok ); + } + + bool removeEntry( const TQString & ); + + void insertSearchPath( System, const TQString & ); + void removeSearchPath( System, const TQString & ); + + void setPath( const TQString &domain, const TQString &product, Scope = Global ); + + void beginGroup( const TQString &group ); + void endGroup(); + void resetGroup(); + TQString group() const; + + bool sync(); + +private: + TQSettingsPrivate *d; + +#if defined(Q_DISABLE_COPY) + TQSettings(const TQSettings &); + TQSettings &operator=(const TQSettings &); +#endif + + TQDateTime lastModificationTime( const TQString & ); + + friend class TQApplication; +}; + +#endif // QT_NO_SETTINGS +#endif // TQSETTINGS_H diff --git a/src/tools/ntqshared.h b/src/tools/ntqshared.h new file mode 100644 index 000000000..7f02c772a --- /dev/null +++ b/src/tools/ntqshared.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Definition of TQShared struct +** +** Created : 940112 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSHARED_H +#define TQSHARED_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + + +struct Q_EXPORT TQShared +{ + TQShared() : count( 1 ) { } + void ref() { count++; } + bool deref() { return !--count; } + uint count; +}; + + +#endif // TQSHARED_H diff --git a/src/tools/ntqsortedlist.h b/src/tools/ntqsortedlist.h new file mode 100644 index 000000000..5923e3f17 --- /dev/null +++ b/src/tools/ntqsortedlist.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Definition of TQSortedList template/macro class +** +** Created : 920701 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSORTEDLIST_H +#define TQSORTEDLIST_H + +#ifndef QT_H +#include "ntqptrlist.h" +#endif // QT_H + + +template +class TQSortedList : public TQPtrList +{ +public: + TQSortedList() {} + TQSortedList( const TQSortedList &l ) : TQPtrList(l) {} + ~TQSortedList() { this->clear(); } + TQSortedList &operator=(const TQSortedList &l) + { return (TQSortedList&)TQPtrList::operator=(l); } + + virtual int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) + { if ( *((type*)s1) == *((type*)s2) ) return 0; return ( *((type*)s1) < *((type*)s2) ? -1 : 1 ); } +}; + +#endif diff --git a/src/tools/ntqstring.h b/src/tools/ntqstring.h new file mode 100644 index 000000000..85dacc8c2 --- /dev/null +++ b/src/tools/ntqstring.h @@ -0,0 +1,1115 @@ +/**************************************************************************** +** +** Definition of the TQString class, and related Unicode functions. +** +** Created : 920609 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTRING_H +#define TQSTRING_H + +#ifndef QT_H +#include "ntqcstring.h" +#endif // QT_H + +#ifndef QT_NO_CAST_ASCII +#include +#endif + +#ifndef QT_NO_STL +#if defined ( Q_CC_MSVC_NET ) && _MSC_VER < 1310 // Avoids nasty warning for xlocale, line 450 +# pragma warning ( push ) +# pragma warning ( disable : 4189 ) +# include +# pragma warning ( pop ) +#else +# include +#endif +#if defined(Q_WRONG_SB_CTYPE_MACROS) && defined(_SB_CTYPE_MACROS) +#undef _SB_CTYPE_MACROS +#endif +#endif + + +/***************************************************************************** + TQString class + *****************************************************************************/ + +class TQRegExp; +class TQString; +class TQCharRef; +template class TQDeepCopy; + +class Q_EXPORT TQChar { +public: + TQChar(); + TQChar( char c ); + TQChar( uchar c ); + TQChar( uchar c, uchar r ); + TQChar( const TQChar& c ); // ### remove in 4.0 to allow compiler optimization + TQChar( ushort rc ); + TQChar( short rc ); + TQChar( uint rc ); + TQChar( int rc ); + + QT_STATIC_CONST TQChar null; // 0000 + QT_STATIC_CONST TQChar replacement; // FFFD + QT_STATIC_CONST TQChar byteOrderMark; // FEFF + QT_STATIC_CONST TQChar byteOrderSwapped; // FFFE + QT_STATIC_CONST TQChar nbsp; // 00A0 + + // Unicode information + + enum Category + { + NoCategory, + + Mark_NonSpacing, // Mn + Mark_SpacingCombining, // Mc + Mark_Enclosing, // Me + + Number_DecimalDigit, // Nd + Number_Letter, // Nl + Number_Other, // No + + Separator_Space, // Zs + Separator_Line, // Zl + Separator_Paragraph, // Zp + + Other_Control, // Cc + Other_Format, // Cf + Other_Surrogate, // Cs + Other_PrivateUse, // Co + Other_NotAssigned, // Cn + + Letter_Uppercase, // Lu + Letter_Lowercase, // Ll + Letter_Titlecase, // Lt + Letter_Modifier, // Lm + Letter_Other, // Lo + + Punctuation_Connector, // Pc + Punctuation_Dash, // Pd + Punctuation_Dask = Punctuation_Dash, // oops + Punctuation_Open, // Ps + Punctuation_Close, // Pe + Punctuation_InitialQuote, // Pi + Punctuation_FinalQuote, // Pf + Punctuation_Other, // Po + + Symbol_Math, // Sm + Symbol_Currency, // Sc + Symbol_Modifier, // Sk + Symbol_Other // So + }; + + 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 = 200, + Combining_BelowAttached = 202, + Combining_BelowRightAttached = 204, + Combining_LeftAttached = 208, + Combining_RightAttached = 210, + Combining_AboveLeftAttached = 212, + Combining_AboveAttached = 214, + Combining_AboveRightAttached = 216, + + Combining_BelowLeft = 218, + Combining_Below = 220, + Combining_BelowRight = 222, + Combining_Left = 224, + Combining_Right = 226, + Combining_AboveLeft = 228, + Combining_Above = 230, + Combining_AboveRight = 232, + + Combining_DoubleBelow = 233, + Combining_DoubleAbove = 234, + Combining_IotaSubscript = 240 + }; + + // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO TQCharRef TOO + + 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; // ### return just TQString in 4.0 + Decomposition decompositionTag() const; + unsigned char combiningClass() const; + + char latin1() const { return ucs > 0xff ? 0 : (char) ucs; } + ushort unicode() const { return ucs; } +#ifdef Q_NO_PACKED_REFERENCE + ushort &unicode() { return *((ushort*)&ucs); } +#else + ushort &unicode() { return ucs; } +#endif +#ifndef QT_NO_CAST_ASCII + // like all ifdef'd code this is undocumented + operator char() const { return latin1(); } +#endif + + bool isNull() const { return unicode()==0; } + 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() const { return ((uchar) ucs & 0xff); } + uchar row() const { return ((uchar) (ucs>>8)&0xff); } + void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; } + void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); } + + static bool networkOrdered() { + int wordSize; + bool bigEndian = FALSE; + qSysInfo( &wordSize, &bigEndian ); + return bigEndian; + } + + friend inline bool operator==( char ch, TQChar c ); + friend inline bool operator==( TQChar c, char ch ); + friend inline bool operator==( TQChar c1, TQChar c2 ); + friend inline bool operator!=( TQChar c1, TQChar c2 ); + friend inline bool operator!=( char ch, TQChar c ); + friend inline bool operator!=( TQChar c, char ch ); + friend inline bool operator<=( TQChar c, char ch ); + friend inline bool operator<=( char ch, TQChar c ); + friend inline bool operator<=( TQChar c1, TQChar c2 ); + +private: + ushort ucs; +#if defined(QT_QSTRING_UCS_4) + ushort grp; +#endif +} Q_PACKED; + +inline TQChar::TQChar() : ucs( 0 ) +#ifdef QT_QSTRING_UCS_4 + , grp( 0 ) +#endif +{ +} +inline TQChar::TQChar( char c ) : ucs( (uchar)c ) +#ifdef QT_QSTRING_UCS_4 + , grp( 0 ) +#endif +{ +} +inline TQChar::TQChar( uchar c ) : ucs( c ) +#ifdef QT_QSTRING_UCS_4 + , grp( 0 ) +#endif +{ +} +inline TQChar::TQChar( uchar c, uchar r ) : ucs( (r << 8) | c ) +#ifdef QT_QSTRING_UCS_4 + , grp( 0 ) +#endif +{ +} +inline TQChar::TQChar( const TQChar& c ) : ucs( c.ucs ) +#ifdef QT_QSTRING_UCS_4 + , grp( c.grp ) +#endif +{ +} + +inline TQChar::TQChar( ushort rc ) : ucs( rc ) +#ifdef QT_QSTRING_UCS_4 + , grp( 0 ) +#endif +{ +} +inline TQChar::TQChar( short rc ) : ucs( (ushort) rc ) +#ifdef QT_QSTRING_UCS_4 + , grp( 0 ) +#endif +{ +} +inline TQChar::TQChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) ) +#ifdef QT_QSTRING_UCS_4 + , grp( (ushort) ((rc >> 16) & 0xffff) ) +#endif +{ +} +inline TQChar::TQChar( int rc ) : ucs( (ushort) (rc & 0xffff) ) +#ifdef QT_QSTRING_UCS_4 + , grp( (ushort) ((rc >> 16) & 0xffff) ) +#endif +{ +} + +inline bool operator==( char ch, TQChar c ) +{ + return ((uchar) ch) == c.ucs; +} + +inline bool operator==( TQChar c, char ch ) +{ + return ((uchar) ch) == c.ucs; +} + +inline bool operator==( TQChar c1, TQChar c2 ) +{ + return c1.ucs == c2.ucs; +} + +inline bool operator!=( TQChar c1, TQChar c2 ) +{ + return c1.ucs != c2.ucs; +} + +inline bool operator!=( char ch, TQChar c ) +{ + return ((uchar)ch) != c.ucs; +} + +inline bool operator!=( TQChar c, char ch ) +{ + return ((uchar) ch) != c.ucs; +} + +inline bool operator<=( TQChar c, char ch ) +{ + return c.ucs <= ((uchar) ch); +} + +inline bool operator<=( char ch, TQChar c ) +{ + return ((uchar) ch) <= c.ucs; +} + +inline bool operator<=( TQChar c1, TQChar c2 ) +{ + return c1.ucs <= c2.ucs; +} + +inline bool operator>=( TQChar c, char ch ) { return ch <= c; } +inline bool operator>=( char ch, TQChar c ) { return c <= ch; } +inline bool operator>=( TQChar c1, TQChar c2 ) { return c2 <= c1; } +inline bool operator<( TQChar c, char ch ) { return !(ch<=c); } +inline bool operator<( char ch, TQChar c ) { return !(c<=ch); } +inline bool operator<( TQChar c1, TQChar c2 ) { return !(c2<=c1); } +inline bool operator>( TQChar c, char ch ) { return !(ch>=c); } +inline bool operator>( char ch, TQChar c ) { return !(c>=ch); } +inline bool operator>( TQChar c1, TQChar c2 ) { return !(c2>=c1); } + +// internal +struct Q_EXPORT TQStringData : public TQShared { + TQStringData() : + TQShared(), unicode(0), ascii(0), len(0), issimpletext(TRUE), maxl(0), islatin1(FALSE) { ref(); } + TQStringData(TQChar *u, uint l, uint m) : + TQShared(), unicode(u), ascii(0), len(l), issimpletext(FALSE), maxl(m), islatin1(FALSE) { } + ~TQStringData() { if ( unicode ) delete[] ((char*)unicode); + if ( ascii ) delete[] ascii; } + + void deleteSelf(); + TQChar *unicode; + char *ascii; + void setDirty() { + if ( ascii ) { + delete [] ascii; + ascii = 0; + } + issimpletext = FALSE; + } +#ifdef Q_OS_MAC9 + uint len; +#else + uint len : 30; +#endif + uint issimpletext : 1; +#ifdef Q_OS_MAC9 + uint maxl; +#else + uint maxl : 30; +#endif + uint islatin1 : 1; + +private: +#if defined(Q_DISABLE_COPY) + TQStringData( const TQStringData& ); + TQStringData& operator=( const TQStringData& ); +#endif +}; + + +class Q_EXPORT TQString +{ +public: + TQString(); // make null string + TQString( TQChar ); // one-char string + TQString( const TQString & ); // impl-shared copy + TQString( const TQByteArray& ); // deep copy + TQString( const TQChar* unicode, uint length ); // deep copy +#ifndef QT_NO_CAST_ASCII + TQString( const char *str ); // deep copy +#endif +#ifndef QT_NO_STL + TQString( const std::string& ); // deep copy +#endif + ~TQString(); + + TQString &operator=( const TQString & ); // impl-shared copy + TQString &operator=( const char * ); // deep copy +#ifndef QT_NO_STL + TQString &operator=( const std::string& ); // deep copy +#endif + TQString &operator=( const TQCString& ); // deep copy + TQString &operator=( TQChar c ); + TQString &operator=( char c ); + + QT_STATIC_CONST TQString null; + + bool isNull() const; + bool isEmpty() const; + uint length() const; + void truncate( uint pos ); + + TQString & fill( TQChar c, int len = -1 ); + + TQString copy() const; + + TQString arg( long a, int fieldWidth = 0, int base = 10 ) const; + TQString arg( ulong a, int fieldWidth = 0, int base = 10 ) const; + TQString arg( Q_LLONG a, int fieldwidth=0, int base=10 ) const; + TQString arg( Q_ULLONG a, int fieldwidth=0, int base=10 ) const; + TQString arg( int a, int fieldWidth = 0, int base = 10 ) const; + TQString arg( uint a, int fieldWidth = 0, int base = 10 ) const; + TQString arg( short a, int fieldWidth = 0, int base = 10 ) const; + TQString arg( ushort a, int fieldWidth = 0, int base = 10 ) const; + TQString arg( double a, int fieldWidth = 0, char fmt = 'g', + int prec = -1 ) const; + TQString arg( char a, int fieldWidth = 0 ) const; + TQString arg( TQChar a, int fieldWidth = 0 ) const; + TQString arg( const TQString& a, int fieldWidth = 0 ) const; + TQString arg( const TQString& a1, const TQString& a2 ) const; + TQString arg( const TQString& a1, const TQString& a2, + const TQString& a3 ) const; + TQString arg( const TQString& a1, const TQString& a2, const TQString& a3, + const TQString& a4 ) const; + +#ifndef QT_NO_SPRINTF + TQString &sprintf( const char* format, ... ) +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 2, 3))) +#endif + ; +#endif + + int find( TQChar c, int index=0, bool cs=TRUE ) const; + int find( char c, int index=0, bool cs=TRUE ) const; + int find( const TQString &str, int index=0, bool cs=TRUE ) const; +#ifndef QT_NO_REGEXP + int find( const TQRegExp &, int index=0 ) const; +#endif +#ifndef QT_NO_CAST_ASCII + int find( const char* str, int index=0 ) const; +#endif + int findRev( TQChar c, int index=-1, bool cs=TRUE) const; + int findRev( char c, int index=-1, bool cs=TRUE) const; + int findRev( const TQString &str, int index=-1, bool cs=TRUE) const; +#ifndef QT_NO_REGEXP + int findRev( const TQRegExp &, int index=-1 ) const; +#endif +#ifndef QT_NO_CAST_ASCII + int findRev( const char* str, int index=-1 ) const; +#endif + int contains( TQChar c, bool cs=TRUE ) const; + int contains( char c, bool cs=TRUE ) const + { return contains(TQChar(c), cs); } +#ifndef QT_NO_CAST_ASCII + int contains( const char* str, bool cs=TRUE ) const; +#endif + int contains( const TQString &str, bool cs=TRUE ) const; +#ifndef QT_NO_REGEXP + int contains( const TQRegExp & ) const; +#endif + + enum SectionFlags { + SectionDefault = 0x00, + SectionSkipEmpty = 0x01, + SectionIncludeLeadingSep = 0x02, + SectionIncludeTrailingSep = 0x04, + SectionCaseInsensitiveSeps = 0x08 + }; + TQString section( TQChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; + TQString section( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; +#ifndef QT_NO_CAST_ASCII + TQString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; +#endif + TQString section( const TQString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; +#ifndef QT_NO_REGEXP + TQString section( const TQRegExp ®, int start, int end = 0xffffffff, int flags = SectionDefault ) const; +#endif + + TQString left( uint len ) const; + TQString right( uint len ) const; + TQString mid( uint index, uint len=0xffffffff) const; + + TQString leftJustify( uint width, TQChar fill=' ', bool trunc=FALSE)const; + TQString rightJustify( uint width, TQChar fill=' ',bool trunc=FALSE)const; + + TQString lower() const; + TQString upper() const; + + TQString stripWhiteSpace() const; + TQString simplifyWhiteSpace() const; + + TQString &insert( uint index, const TQString & ); +#ifndef QT_NO_CAST_ASCII + TQString &insert( uint index, const TQByteArray & ); + TQString &insert( uint index, const char * ); +#endif + TQString &insert( uint index, const TQChar*, uint len ); + TQString &insert( uint index, TQChar ); + TQString &insert( uint index, char c ) { return insert(index,TQChar(c)); } + TQString &append( char ); + TQString &append( TQChar ); + TQString &append( const TQString & ); +#ifndef QT_NO_CAST_ASCII + TQString &append( const TQByteArray & ); + TQString &append( const char * ); +#endif +#if !defined(QT_NO_STL) && !defined(QT_NO_CAST_ASCII) + TQString &append( const std::string& ); +#endif + TQString &prepend( char ); + TQString &prepend( TQChar ); + TQString &prepend( const TQString & ); +#ifndef QT_NO_CAST_ASCII + TQString &prepend( const TQByteArray & ); + TQString &prepend( const char * ); +#endif +#if !defined(QT_NO_STL) && !defined(QT_NO_CAST_ASCII) + TQString &prepend( const std::string& ); +#endif + TQString &remove( uint index, uint len ); +#if defined(Q_QDOC) + TQString &remove( const TQString & str, bool cs = TRUE ); +#else + // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack + TQString &remove( const TQString & ); + TQString &remove( const TQString &, bool cs ); +#endif + TQString &remove( TQChar c ); + TQString &remove( char c ) + { return remove( TQChar(c) ); } +#ifndef QT_NO_CAST_ASCII + TQString &remove( const char * ); +#endif +#ifndef QT_NO_REGEXP + TQString &remove( const TQRegExp & ); +#endif + TQString &replace( uint index, uint len, const TQString & ); + TQString &replace( uint index, uint len, const TQChar*, uint clen ); + TQString &replace( uint index, uint len, TQChar ); + TQString &replace( uint index, uint len, char c ) + { return replace( index, len, TQChar(c) ); } +#if defined(Q_QDOC) + TQString &replace( TQChar c, const TQString & after, bool cs = TRUE ); + TQString &replace( char c, const TQString & after, bool cs = TRUE ); + TQString &replace( const TQString & before, const TQString & after, + bool cs = TRUE ); +#else + // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack + TQString &replace( TQChar c, const TQString & ); + TQString &replace( TQChar c, const TQString &, bool ); + + // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack + TQString &replace( char c, const TQString & after ) + { return replace( TQChar(c), after, TRUE ); } + TQString &replace( char c, const TQString & after, bool cs ) + { return replace( TQChar(c), after, cs ); } + + // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack + TQString &replace( const TQString &, const TQString & ); + TQString &replace( const TQString &, const TQString &, bool ); +#endif +#ifndef QT_NO_REGEXP_CAPTURE + TQString &replace( const TQRegExp &, const TQString & ); +#endif + TQString &replace( TQChar, TQChar ); + + short toShort( bool *ok=0, int base=10 ) const; + ushort toUShort( bool *ok=0, int base=10 ) const; + int toInt( bool *ok=0, int base=10 ) const; + uint toUInt( bool *ok=0, int base=10 ) const; + long toLong( bool *ok=0, int base=10 ) const; + ulong toULong( bool *ok=0, int base=10 ) const; + Q_LLONG toLongLong( bool *ok=0, int base=10 ) const; + Q_ULLONG toULongLong( bool *ok=0, int base=10 ) const; + float toFloat( bool *ok=0 ) const; + double toDouble( bool *ok=0 ) const; + + TQString &setNum( short, int base=10 ); + TQString &setNum( ushort, int base=10 ); + TQString &setNum( int, int base=10 ); + TQString &setNum( uint, int base=10 ); + TQString &setNum( long, int base=10 ); + TQString &setNum( ulong, int base=10 ); + TQString &setNum( Q_LLONG, int base=10 ); + TQString &setNum( Q_ULLONG, int base=10 ); + TQString &setNum( float, char f='g', int prec=6 ); + TQString &setNum( double, char f='g', int prec=6 ); + + static TQString number( long, int base=10 ); + static TQString number( ulong, int base=10); + static TQString number( Q_LLONG, int base=10 ); + static TQString number( Q_ULLONG, int base=10); + static TQString number( int, int base=10 ); + static TQString number( uint, int base=10); + static TQString number( double, char f='g', int prec=6 ); + + void setExpand( uint index, TQChar c ); + + TQString &operator+=( const TQString &str ); +#ifndef QT_NO_CAST_ASCII + TQString &operator+=( const TQByteArray &str ); + TQString &operator+=( const char *str ); +#endif +#if !defined(QT_NO_STL) && !defined(QT_NO_CAST_ASCII) + TQString &operator+=( const std::string& ); +#endif + TQString &operator+=( TQChar c ); + TQString &operator+=( char c ); + + TQChar at( uint i ) const + { return i < d->len ? d->unicode[i] : TQChar::null; } + TQChar operator[]( int i ) const { return at((uint)i); } + TQCharRef at( uint i ); + TQCharRef operator[]( int i ); + + TQChar constref(uint i) const + { return at(i); } + TQChar& ref(uint i) + { // Optimized for easy-inlining by simple compilers. + if ( d->count != 1 || i >= d->len ) + subat( i ); + d->setDirty(); + return d->unicode[i]; + } + + const TQChar* unicode() const { return d->unicode; } + const char* ascii() const; + static TQString fromAscii(const char*, int len=-1); + const char* latin1() const; + static TQString fromLatin1(const char*, int len=-1); + TQCString utf8() const; + static TQString fromUtf8(const char*, int len=-1); + TQCString local8Bit() const; + static TQString fromLocal8Bit(const char*, int len=-1); + bool operator!() const; +#ifndef QT_NO_ASCII_CAST + operator const char *() const { return ascii(); } +#endif +#ifndef QT_NO_STL + operator std::string() const { return ascii() ? ascii() : ""; } +#endif + + static TQString fromUcs2( const unsigned short *ucs2 ); + const unsigned short *ucs2() const; + + TQString &setUnicode( const TQChar* unicode, uint len ); + TQString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len ); + TQString &setAscii( const char*, int len=-1 ); + TQString &setLatin1( const char*, int len=-1 ); + + int compare( const TQString& s ) const; + static int compare( const TQString& s1, const TQString& s2 ) + { return s1.compare( s2 ); } + + int localeAwareCompare( const TQString& s ) const; + static int localeAwareCompare( const TQString& s1, const TQString& s2 ) + { return s1.localeAwareCompare( s2 ); } + +#ifndef QT_NO_DATASTREAM + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQString & ); +#endif + + void compose(); + +#ifndef QT_NO_COMPAT + const char* data() const { return ascii(); } +#endif + +#if defined(Q_QDOC) + bool startsWith( const TQString& str, bool cs = TRUE ) const; + bool endsWith( const TQString& str, bool cs = TRUE ) const; +#else + // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack + bool startsWith( const TQString& str ) const; + bool startsWith( const TQString& str, bool cs ) const; + + // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack + bool endsWith( const TQString& str ) const; + bool endsWith( const TQString& str, bool cs ) const; +#endif + + void setLength( uint newLength ); + + uint capacity() const; + void reserve( uint minCapacity ); + void squeeze(); + + bool simpleText() const { if ( !d->issimpletext ) checkSimpleText(); return (bool)d->issimpletext; } + bool isRightToLeft() const; + + +private: + TQString( int size, bool /* dummy */ ); // allocate size incl. \0 + + void deref(); + void real_detach(); + void subat( uint ); + TQString multiArg( int numArgs, const TQString& a1, const TQString& a2, + const TQString& a3 = TQString::null, + const TQString& a4 = TQString::null ) const; + + void checkSimpleText() const; + void grow( uint newLength ); +#ifndef QT_NO_CAST_ASCII + TQString &insertHelper( uint index, const char *s, uint len=UINT_MAX ); + TQString &operatorPlusEqHelper( const char *s, uint len2=UINT_MAX ); +#endif + + static TQChar* latin1ToUnicode( const char*, uint * len, uint maxlen=(uint)-1 ); + static TQChar* latin1ToUnicode( const TQByteArray&, uint * len ); + static char* unicodeToLatin1( const TQChar*, uint len ); + + TQStringData *d; + static TQStringData* shared_null; + static TQStringData* makeSharedNull(); + + friend class TQConstString; + friend class TQTextStream; + TQString( TQStringData* dd, bool /* dummy */ ) : d(dd) { } + + // needed for TQDeepCopy + void detach(); + friend class TQDeepCopy; +}; + +class Q_EXPORT TQCharRef { + friend class TQString; + TQString& s; + uint p; + TQCharRef(TQString* str, uint pos) : s(*str), p(pos) { } + +public: + // most TQChar operations repeated here + + // all this is not documented: We just say "like TQChar" and let it be. +#ifndef Q_QDOC + ushort unicode() const { return s.constref(p).unicode(); } + char latin1() const { return s.constref(p).latin1(); } + + // An operator= for each TQChar cast constructors + TQCharRef operator=(char c ) { s.ref(p)=c; return *this; } + TQCharRef operator=(uchar c ) { s.ref(p)=c; return *this; } + TQCharRef operator=(TQChar c ) { s.ref(p)=c; return *this; } + TQCharRef operator=(const TQCharRef& c ) { s.ref(p)=c.unicode(); return *this; } + TQCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; } + TQCharRef operator=(short rc ) { s.ref(p)=rc; return *this; } + TQCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; } + TQCharRef operator=(int rc ) { s.ref(p)=rc; return *this; } + + operator TQChar () const { return s.constref(p); } + + // each function... + bool isNull() const { return unicode()==0; } + bool isPrint() const { return s.constref(p).isPrint(); } + bool isPunct() const { return s.constref(p).isPunct(); } + bool isSpace() const { return s.constref(p).isSpace(); } + bool isMark() const { return s.constref(p).isMark(); } + bool isLetter() const { return s.constref(p).isLetter(); } + bool isNumber() const { return s.constref(p).isNumber(); } + bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); } + bool isDigit() const { return s.constref(p).isDigit(); } + + int digitValue() const { return s.constref(p).digitValue(); } + TQChar lower() const { return s.constref(p).lower(); } + TQChar upper() const { return s.constref(p).upper(); } + + TQChar::Category category() const { return s.constref(p).category(); } + TQChar::Direction direction() const { return s.constref(p).direction(); } + TQChar::Joining joining() const { return s.constref(p).joining(); } + bool mirrored() const { return s.constref(p).mirrored(); } + TQChar mirroredChar() const { return s.constref(p).mirroredChar(); } + const TQString &decomposition() const { return s.constref(p).decomposition(); } + TQChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); } + unsigned char combiningClass() const { return s.constref(p).combiningClass(); } + + // Not the non-const ones of these. + uchar cell() const { return s.constref(p).cell(); } + uchar row() const { return s.constref(p).row(); } +#endif +}; + +inline TQCharRef TQString::at( uint i ) { return TQCharRef(this,i); } +inline TQCharRef TQString::operator[]( int i ) { return at((uint)i); } + + +class Q_EXPORT TQConstString : private TQString { +public: + TQConstString( const TQChar* unicode, uint length ); + ~TQConstString(); + const TQString& string() const { return *this; } +}; + + +/***************************************************************************** + TQString stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQString & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQString & ); +#endif + +/***************************************************************************** + TQString inline functions + *****************************************************************************/ + +// These two move code into makeSharedNull() and deletesData() +// to improve cache-coherence (and reduce code bloat), while +// keeping the common cases fast. +// +// No safe way to pre-init shared_null on ALL compilers/linkers. +inline TQString::TQString() : + d(shared_null ? shared_null : makeSharedNull()) +{ + d->ref(); +} +// +inline TQString::~TQString() +{ + if ( d->deref() ) { + if ( d != shared_null ) + d->deleteSelf(); + } +} + +// needed for TQDeepCopy +inline void TQString::detach() +{ real_detach(); } + +inline TQString TQString::section( TQChar sep, int start, int end, int flags ) const +{ return section(TQString(sep), start, end, flags); } + +inline TQString TQString::section( char sep, int start, int end, int flags ) const +{ return section(TQChar(sep), start, end, flags); } + +#ifndef QT_NO_CAST_ASCII +inline TQString TQString::section( const char *in_sep, int start, int end, int flags ) const +{ return section(TQString(in_sep), start, end, flags); } +#endif + +inline TQString &TQString::operator=( TQChar c ) +{ *this = TQString(c); return *this; } + +inline TQString &TQString::operator=( char c ) +{ *this = TQString(TQChar(c)); return *this; } + +inline bool TQString::isNull() const +{ return unicode() == 0; } + +inline bool TQString::operator!() const +{ return isNull(); } + +inline uint TQString::length() const +{ return d->len; } + +inline uint TQString::capacity() const +{ return d->maxl; } + +inline bool TQString::isEmpty() const +{ return length() == 0; } + +inline TQString TQString::copy() const +{ return TQString( *this ); } + +#ifndef QT_NO_CAST_ASCII +inline TQString &TQString::insert( uint index, const char *s ) +{ return insertHelper( index, s ); } + +inline TQString &TQString::insert( uint index, const TQByteArray &s ) +{ + int pos = s.find( 0 ); + return insertHelper( index, s, pos==-1 ? s.size() : pos ); +} +#endif + +inline TQString &TQString::prepend( const TQString & s ) +{ return insert(0,s); } + +inline TQString &TQString::prepend( TQChar c ) +{ return insert(0,c); } + +inline TQString &TQString::prepend( char c ) +{ return insert(0,c); } + +#ifndef QT_NO_CAST_ASCII +inline TQString &TQString::prepend( const TQByteArray & s ) +{ return insert(0,s); } +#endif + +#ifndef QT_NO_CAST_ASCII +inline TQString &TQString::operator+=( const TQByteArray &s ) +{ + int pos = s.find( 0 ); + return operatorPlusEqHelper( s, pos==-1 ? s.size() : pos ); +} +#endif + +inline TQString &TQString::append( const TQString & s ) +{ return operator+=(s); } + +#ifndef QT_NO_CAST_ASCII +inline TQString &TQString::append( const TQByteArray &s ) +{ return operator+=(s); } + +inline TQString &TQString::append( const char * s ) +{ return operator+=(s); } +#endif + +inline TQString &TQString::append( TQChar c ) +{ return operator+=(c); } + +inline TQString &TQString::append( char c ) +{ return operator+=(c); } + +#ifndef QT_NO_STL +inline TQString &TQString::operator=( const std::string& str ) +{ return operator=(str.c_str()); } +#ifndef QT_NO_CAST_ASCII +inline TQString &TQString::operator+=( const std::string& s ) +{ return operator+=(s.c_str()); } +inline TQString &TQString::append( const std::string& s ) +{ return operator+=(s); } +inline TQString &TQString::prepend( const std::string& s ) +{ return insert(0, s); } +#endif +#endif + +inline TQString &TQString::setNum( short n, int base ) +{ return setNum((Q_LLONG)n, base); } + +inline TQString &TQString::setNum( ushort n, int base ) +{ return setNum((Q_ULLONG)n, base); } + +inline TQString &TQString::setNum( int n, int base ) +{ return setNum((Q_LLONG)n, base); } + +inline TQString &TQString::setNum( uint n, int base ) +{ return setNum((Q_ULLONG)n, base); } + +inline TQString &TQString::setNum( float n, char f, int prec ) +{ return setNum((double)n,f,prec); } + +inline TQString TQString::arg( int a, int fieldWidth, int base ) const +{ return arg( (Q_LLONG)a, fieldWidth, base ); } + +inline TQString TQString::arg( uint a, int fieldWidth, int base ) const +{ return arg( (Q_ULLONG)a, fieldWidth, base ); } + +inline TQString TQString::arg( short a, int fieldWidth, int base ) const +{ return arg( (Q_LLONG)a, fieldWidth, base ); } + +inline TQString TQString::arg( ushort a, int fieldWidth, int base ) const +{ return arg( (Q_ULLONG)a, fieldWidth, base ); } + +inline TQString TQString::arg( const TQString& a1, const TQString& a2 ) const { + return multiArg( 2, a1, a2 ); +} + +inline TQString TQString::arg( const TQString& a1, const TQString& a2, + const TQString& a3 ) const { + return multiArg( 3, a1, a2, a3 ); +} + +inline TQString TQString::arg( const TQString& a1, const TQString& a2, + const TQString& a3, const TQString& a4 ) const { + return multiArg( 4, a1, a2, a3, a4 ); +} + +inline int TQString::find( char c, int index, bool cs ) const +{ return find(TQChar(c), index, cs); } + +inline int TQString::findRev( char c, int index, bool cs ) const +{ return findRev( TQChar(c), index, cs ); } + +#ifndef QT_NO_CAST_ASCII +inline int TQString::find( const char* str, int index ) const +{ return find(TQString::fromAscii(str), index); } + +inline int TQString::findRev( const char* str, int index ) const +{ return findRev(TQString::fromAscii(str), index); } +#endif + + +/***************************************************************************** + TQString non-member operators + *****************************************************************************/ + +Q_EXPORT bool operator!=( const TQString &s1, const TQString &s2 ); +Q_EXPORT bool operator<( const TQString &s1, const TQString &s2 ); +Q_EXPORT bool operator<=( const TQString &s1, const TQString &s2 ); +Q_EXPORT bool operator==( const TQString &s1, const TQString &s2 ); +Q_EXPORT bool operator>( const TQString &s1, const TQString &s2 ); +Q_EXPORT bool operator>=( const TQString &s1, const TQString &s2 ); +#ifndef QT_NO_CAST_ASCII +Q_EXPORT bool operator!=( const TQString &s1, const char *s2 ); +Q_EXPORT bool operator<( const TQString &s1, const char *s2 ); +Q_EXPORT bool operator<=( const TQString &s1, const char *s2 ); +Q_EXPORT bool operator==( const TQString &s1, const char *s2 ); +Q_EXPORT bool operator>( const TQString &s1, const char *s2 ); +Q_EXPORT bool operator>=( const TQString &s1, const char *s2 ); +Q_EXPORT bool operator!=( const char *s1, const TQString &s2 ); +Q_EXPORT bool operator<( const char *s1, const TQString &s2 ); +Q_EXPORT bool operator<=( const char *s1, const TQString &s2 ); +Q_EXPORT bool operator==( const char *s1, const TQString &s2 ); +//Q_EXPORT bool operator>( const char *s1, const TQString &s2 ); // MSVC++ +Q_EXPORT bool operator>=( const char *s1, const TQString &s2 ); +#endif + +Q_EXPORT inline const TQString operator+( const TQString &s1, const TQString &s2 ) +{ + TQString tmp( s1 ); + tmp += s2; + return tmp; +} + +#ifndef QT_NO_CAST_ASCII +Q_EXPORT inline const TQString operator+( const TQString &s1, const char *s2 ) +{ + TQString tmp( s1 ); + tmp += TQString::fromAscii(s2); + return tmp; +} + +Q_EXPORT inline const TQString operator+( const char *s1, const TQString &s2 ) +{ + TQString tmp = TQString::fromAscii( s1 ); + tmp += s2; + return tmp; +} +#endif + +Q_EXPORT inline const TQString operator+( const TQString &s1, TQChar c2 ) +{ + TQString tmp( s1 ); + tmp += c2; + return tmp; +} + +Q_EXPORT inline const TQString operator+( const TQString &s1, char c2 ) +{ + TQString tmp( s1 ); + tmp += c2; + return tmp; +} + +Q_EXPORT inline const TQString operator+( TQChar c1, const TQString &s2 ) +{ + TQString tmp; + tmp += c1; + tmp += s2; + return tmp; +} + +Q_EXPORT inline const TQString operator+( char c1, const TQString &s2 ) +{ + TQString tmp; + tmp += c1; + tmp += s2; + return tmp; +} + +#ifndef QT_NO_STL +Q_EXPORT inline const TQString operator+(const TQString& s1, const std::string& s2) +{ + return s1 + TQString(s2); +} + +Q_EXPORT inline const TQString operator+(const std::string& s1, const TQString& s2) +{ + TQString tmp(s2); + return TQString(tmp.prepend(s1)); +} +#endif + + +#if defined(Q_OS_WIN32) +extern Q_EXPORT TQString qt_winTQString(void*); +extern Q_EXPORT const void* qt_winTchar(const TQString& str, bool addnul); +extern Q_EXPORT void* qt_winTchar_new(const TQString& str); +extern Q_EXPORT TQCString qt_winTQString2MB( const TQString& s, int len=-1 ); +extern Q_EXPORT TQString qt_winMB2TQString( const char* mb, int len=-1 ); +#endif + +#define Q_DEFINED_QSTRING +#include "ntqwinexport.h" +#endif // TQSTRING_H diff --git a/src/tools/ntqstringlist.h b/src/tools/ntqstringlist.h new file mode 100644 index 000000000..b5f857d5c --- /dev/null +++ b/src/tools/ntqstringlist.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Definition of TQStringList class +** +** Created : 990406 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTRINGLIST_H +#define TQSTRINGLIST_H + +#ifndef QT_H +#include "ntqvaluelist.h" +#include "ntqstring.h" +#include "ntqstrlist.h" +#endif // QT_H + +#ifndef QT_NO_STRINGLIST + +class TQRegExp; +template class TQDeepCopy; + +#if defined(Q_TEMPLATEDLL) +// MOC_SKIP_BEGIN +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +// MOC_SKIP_END +#endif + +class Q_EXPORT TQStringList : public TQValueList +{ +public: + TQStringList() { } + TQStringList( const TQStringList& l ) : TQValueList(l) { } + TQStringList( const TQValueList& l ) : TQValueList(l) { } + TQStringList( const TQString& i ) { append(i); } +#ifndef QT_NO_CAST_ASCII + TQStringList( const char* i ) { append(i); } +#endif + + static TQStringList fromStrList(const TQStrList&); + + void sort(); + + static TQStringList split( const TQString &sep, const TQString &str, bool allowEmptyEntries = FALSE ); + static TQStringList split( const TQChar &sep, const TQString &str, bool allowEmptyEntries = FALSE ); +#ifndef QT_NO_REGEXP + static TQStringList split( const TQRegExp &sep, const TQString &str, bool allowEmptyEntries = FALSE ); +#endif + TQString join( const TQString &sep ) const; + + TQStringList grep( const TQString &str, bool cs = TRUE ) const; +#ifndef QT_NO_REGEXP + TQStringList grep( const TQRegExp &expr ) const; +#endif + + TQStringList& gres( const TQString &before, const TQString &after, + bool cs = TRUE ); +#ifndef QT_NO_REGEXP_CAPTURE + TQStringList& gres( const TQRegExp &expr, const TQString &after ); +#endif + +protected: + void detach() { TQValueList::detach(); } + friend class TQDeepCopy< TQStringList >; +}; + +#ifndef QT_NO_DATASTREAM +class TQDataStream; +extern Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQStringList& ); +extern Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQStringList& ); +#endif + +#endif // QT_NO_STRINGLIST +#endif // TQSTRINGLIST_H diff --git a/src/tools/ntqstrlist.h b/src/tools/ntqstrlist.h new file mode 100644 index 000000000..67d88048e --- /dev/null +++ b/src/tools/ntqstrlist.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Definition of TQStrList, TQStrIList and TQStrListIterator classes +** +** Created : 920730 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTRLIST_H +#define TQSTRLIST_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqptrlist.h" +#include "ntqdatastream.h" +#endif // QT_H + +#if defined(Q_QDOC) +class TQStrListIterator : public TQPtrListIterator +{ +}; +#else +typedef TQPtrListIterator TQStrListIterator; +#endif + +class Q_EXPORT TQStrList : public TQPtrList +{ +public: + TQStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; } + TQStrList( const TQStrList & ); + ~TQStrList() { clear(); } + TQStrList& operator=( const TQStrList & ); + +private: + TQPtrCollection::Item newItem( TQPtrCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; } + void deleteItem( TQPtrCollection::Item d ) { if ( del_item ) delete[] (char*)d; } + int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) { return qstrcmp((const char*)s1, + (const char*)s2); } +#ifndef QT_NO_DATASTREAM + TQDataStream &read( TQDataStream &s, TQPtrCollection::Item &d ) + { s >> (char *&)d; return s; } + TQDataStream &write( TQDataStream &s, TQPtrCollection::Item d ) const + { return s << (const char *)d; } +#endif + bool dc; +}; + + +class Q_EXPORT TQStrIList : public TQStrList // case insensitive string list +{ +public: + TQStrIList( bool deepCopies=TRUE ) : TQStrList( deepCopies ) {} + ~TQStrIList() { clear(); } +private: + int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) + { return qstricmp((const char*)s1, + (const char*)s2); } +}; + + +inline TQStrList & TQStrList::operator=( const TQStrList &strList ) +{ + clear(); + dc = strList.dc; + del_item = dc; + TQPtrList::operator=( strList ); + return *this; +} + +inline TQStrList::TQStrList( const TQStrList &strList ) + : TQPtrList( strList ) +{ + dc = FALSE; + operator=( strList ); +} + +#endif // TQSTRLIST_H diff --git a/src/tools/ntqstrvec.h b/src/tools/ntqstrvec.h new file mode 100644 index 000000000..8eb7afd8b --- /dev/null +++ b/src/tools/ntqstrvec.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Definition of TQStrVec and TQStrIVec classes +** +** Created : 931203 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTRVEC_H +#define TQSTRVEC_H + +#ifndef QT_H +#include "ntqstring.h" +#include "ntqptrvector.h" +#include "ntqdatastream.h" +#endif // QT_H + +class Q_EXPORT TQStrVec : public TQPtrVector +{ +public: + TQStrVec() { dc = TRUE; } + TQStrVec( uint size, bool deepc = TRUE ) : TQPtrVector(size) {dc=deepc;} + ~TQStrVec() { clear(); } +private: + Item newItem( Item d ) { return dc ? qstrdup( (const char*)d ) : d; } + void deleteItem( Item d ) { if ( dc ) delete[] (char*)d; } + int compareItems( Item s1, Item s2 ) + { return qstrcmp((const char*)s1, + (const char*)s2); } +#ifndef QT_NO_DATASTREAM + TQDataStream &read( TQDataStream &s, Item &d ) + { s >> (char *&)d; return s; } + TQDataStream &write( TQDataStream &s, Item d ) const + { return s << (const char*)d; } +#endif + bool dc; +}; + + +class Q_EXPORT TQStrIVec : public TQStrVec // case insensitive string vec +{ +public: + TQStrIVec() {} + TQStrIVec( uint size, bool dc = TRUE ) : TQStrVec( size, dc ) {} + ~TQStrIVec() { clear(); } +private: + int compareItems( Item s1, Item s2 ) + { return qstricmp((const char*)s1, + (const char*)s2); } +}; + + +#endif // TQSTRVEC_H diff --git a/src/tools/ntqtextstream.h b/src/tools/ntqtextstream.h new file mode 100644 index 000000000..a99c8e26c --- /dev/null +++ b/src/tools/ntqtextstream.h @@ -0,0 +1,338 @@ +/**************************************************************************** +** +** Definition of TQTextStream class +** +** Created : 940922 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTSTREAM_H +#define TQTEXTSTREAM_H + +#ifndef QT_H +#include "ntqiodevice.h" +#include "ntqstring.h" +#include +#endif // QT_H + +#ifndef QT_NO_TEXTSTREAM +class TQTextCodec; +class TQTextDecoder; + +class TQTextStreamPrivate; + +class Q_EXPORT TQTextStream // text stream class +{ +public: + enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder, + UnicodeReverse, RawUnicode, UnicodeUTF8 }; + + void setEncoding( Encoding ); +#ifndef QT_NO_TEXTCODEC + void setCodec( TQTextCodec* ); + TQTextCodec *codec(); +#endif + + TQTextStream(); + TQTextStream( TQIODevice * ); + TQTextStream( TQString*, int mode ); + TQTextStream( TQString&, int mode ); // obsolete + TQTextStream( TQByteArray, int mode ); + TQTextStream( FILE *, int mode ); + virtual ~TQTextStream(); + + TQIODevice *device() const; + void setDevice( TQIODevice * ); + void unsetDevice(); + + bool atEnd() const; + bool eof() const; + + TQTextStream &operator>>( TQChar & ); + TQTextStream &operator>>( char & ); + TQTextStream &operator>>( signed short & ); + TQTextStream &operator>>( unsigned short & ); + TQTextStream &operator>>( signed int & ); + TQTextStream &operator>>( unsigned int & ); + TQTextStream &operator>>( signed long & ); + TQTextStream &operator>>( unsigned long & ); + TQTextStream &operator>>( float & ); + TQTextStream &operator>>( double & ); + TQTextStream &operator>>( char * ); + TQTextStream &operator>>( TQString & ); + TQTextStream &operator>>( TQCString & ); + + TQTextStream &operator<<( TQChar ); + TQTextStream &operator<<( char ); + TQTextStream &operator<<( signed short ); + TQTextStream &operator<<( unsigned short ); + TQTextStream &operator<<( signed int ); + TQTextStream &operator<<( unsigned int ); + TQTextStream &operator<<( signed long ); + TQTextStream &operator<<( unsigned long ); + TQTextStream &operator<<( float ); + TQTextStream &operator<<( double ); + TQTextStream &operator<<( const char* ); + TQTextStream &operator<<( const TQString & ); + TQTextStream &operator<<( const TQCString & ); + TQTextStream &operator<<( void * ); // any pointer + + TQTextStream &readRawBytes( char *, uint len ); + TQTextStream &writeRawBytes( const char* , uint len ); + + TQString readLine(); + TQString read(); + void skipWhiteSpace(); + + enum { + skipws = 0x0001, // skip whitespace on input + left = 0x0002, // left-adjust output + right = 0x0004, // right-adjust output + internal = 0x0008, // pad after sign + bin = 0x0010, // binary format integer + oct = 0x0020, // octal format integer + dec = 0x0040, // decimal format integer + hex = 0x0080, // hex format integer + showbase = 0x0100, // show base indicator + showpoint = 0x0200, // force decimal point (float) + uppercase = 0x0400, // upper-case hex output + showpos = 0x0800, // add '+' to positive integers + scientific= 0x1000, // scientific float output + fixed = 0x2000 // fixed float output + }; + + static const int basefield; // bin | oct | dec | hex + static const int adjustfield; // left | right | internal + static const int floatfield; // scientific | fixed + + int flags() const; + int flags( int f ); + int setf( int bits ); + int setf( int bits, int mask ); + int unsetf( int bits ); + + void reset(); + + int width() const; + int width( int ); + int fill() const; + int fill( int ); + int precision() const; + int precision( int ); + +private: + long input_int(); + void init(); + TQTextStream &output_int( int, ulong, bool ); + TQIODevice *dev; + + int fflags; + int fwidth; + int fillchar; + int fprec; + bool doUnicodeHeader; + bool owndev; + TQTextCodec *mapper; + TQTextStreamPrivate * d; + TQChar unused1; // ### remove in TQt 4.0 + bool latin1; + bool internalOrder; + bool networkOrder; + void *unused2; // ### remove in TQt 4.0 + + TQChar eat_ws(); + uint ts_getline( TQChar* ); + void ts_ungetc( TQChar ); + TQChar ts_getc(); + uint ts_getbuf( TQChar*, uint ); + void ts_putc(int); + void ts_putc(TQChar); + bool ts_isspace(TQChar); + bool ts_isdigit(TQChar); + ulong input_bin(); + ulong input_oct(); + ulong input_dec(); + ulong input_hex(); + double input_double(); + TQTextStream &writeBlock( const char* p, uint len ); + TQTextStream &writeBlock( const TQChar* p, uint len ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTextStream( const TQTextStream & ); + TQTextStream &operator=( const TQTextStream & ); +#endif +}; + +typedef TQTextStream TQTS; + +class Q_EXPORT TQTextIStream : public TQTextStream { +public: + TQTextIStream( const TQString* s ) : + TQTextStream((TQString*)s,IO_ReadOnly) { } + TQTextIStream( TQByteArray ba ) : + TQTextStream(ba,IO_ReadOnly) { } + TQTextIStream( FILE *f ) : + TQTextStream(f,IO_ReadOnly) { } + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTextIStream( const TQTextIStream & ); + TQTextIStream &operator=( const TQTextIStream & ); +#endif +}; + +class Q_EXPORT TQTextOStream : public TQTextStream { +public: + TQTextOStream( TQString* s ) : + TQTextStream(s,IO_WriteOnly) { } + TQTextOStream( TQByteArray ba ) : + TQTextStream(ba,IO_WriteOnly) { } + TQTextOStream( FILE *f ) : + TQTextStream(f,IO_WriteOnly) { } + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTextOStream( const TQTextOStream & ); + TQTextOStream &operator=( const TQTextOStream & ); +#endif +}; + +/***************************************************************************** + TQTextStream inline functions + *****************************************************************************/ + +inline TQIODevice *TQTextStream::device() const +{ return dev; } + +inline bool TQTextStream::atEnd() const +{ return dev ? dev->atEnd() : FALSE; } + +inline bool TQTextStream::eof() const +{ return atEnd(); } + +inline int TQTextStream::flags() const +{ return fflags; } + +inline int TQTextStream::flags( int f ) +{ int oldf = fflags; fflags = f; return oldf; } + +inline int TQTextStream::setf( int bits ) +{ int oldf = fflags; fflags |= bits; return oldf; } + +inline int TQTextStream::setf( int bits, int mask ) +{ int oldf = fflags; fflags = (fflags & ~mask) | (bits & mask); return oldf; } + +inline int TQTextStream::unsetf( int bits ) +{ int oldf = fflags; fflags &= ~bits; return oldf; } + +inline int TQTextStream::width() const +{ return fwidth; } + +inline int TQTextStream::width( int w ) +{ int oldw = fwidth; fwidth = w; return oldw; } + +inline int TQTextStream::fill() const +{ return fillchar; } + +inline int TQTextStream::fill( int f ) +{ int oldc = fillchar; fillchar = f; return oldc; } + +inline int TQTextStream::precision() const +{ return fprec; } + +inline int TQTextStream::precision( int p ) +{ int oldp = fprec; fprec = p; return oldp; } + +/*! + Returns one character from the stream, or EOF. +*/ +inline TQChar TQTextStream::ts_getc() +{ TQChar r; return ( ts_getbuf( &r,1 ) == 1 ? r : TQChar((ushort)0xffff) ); } + +/***************************************************************************** + TQTextStream manipulators + *****************************************************************************/ + +typedef TQTextStream & (*TQTSFUNC)(TQTextStream &);// manipulator function +typedef int (TQTextStream::*TQTSMFI)(int); // manipulator w/int argument + +class Q_EXPORT TQTSManip { // text stream manipulator +public: + TQTSManip( TQTSMFI m, int a ) { mf=m; arg=a; } + void exec( TQTextStream &s ) { (s.*mf)(arg); } +private: + TQTSMFI mf; // TQTextStream member function + int arg; // member function argument +}; + +Q_EXPORT inline TQTextStream &operator>>( TQTextStream &s, TQTSFUNC f ) +{ return (*f)( s ); } + +Q_EXPORT inline TQTextStream &operator<<( TQTextStream &s, TQTSFUNC f ) +{ return (*f)( s ); } + +Q_EXPORT inline TQTextStream &operator<<( TQTextStream &s, TQTSManip m ) +{ m.exec(s); return s; } + +Q_EXPORT TQTextStream &bin( TQTextStream &s ); // set bin notation +Q_EXPORT TQTextStream &oct( TQTextStream &s ); // set oct notation +Q_EXPORT TQTextStream &dec( TQTextStream &s ); // set dec notation +Q_EXPORT TQTextStream &hex( TQTextStream &s ); // set hex notation +Q_EXPORT TQTextStream &endl( TQTextStream &s ); // insert EOL ('\n') +Q_EXPORT TQTextStream &flush( TQTextStream &s ); // flush output +Q_EXPORT TQTextStream &ws( TQTextStream &s ); // eat whitespace on input +Q_EXPORT TQTextStream &reset( TQTextStream &s ); // set default flags + +Q_EXPORT inline TQTSManip qSetW( int w ) +{ + TQTSMFI func = &TQTextStream::width; + return TQTSManip(func,w); +} + +Q_EXPORT inline TQTSManip qSetFill( int f ) +{ + TQTSMFI func = &TQTextStream::fill; + return TQTSManip(func,f); +} + +Q_EXPORT inline TQTSManip qSetPrecision( int p ) +{ + TQTSMFI func = &TQTextStream::precision; + return TQTSManip(func,p); +} + +#endif // QT_NO_TEXTSTREAM +#endif // TQTEXTSTREAM_H diff --git a/src/tools/ntqthreadstorage.h b/src/tools/ntqthreadstorage.h new file mode 100644 index 000000000..acce6dbaa --- /dev/null +++ b/src/tools/ntqthreadstorage.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** ... +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTHREADSTORAGE_H +#define TQTHREADSTORAGE_H + +#ifdef QT_THREAD_SUPPORT + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +class Q_EXPORT TQThreadStorageData +{ +public: + TQThreadStorageData( void (*func)(void *) ); + ~TQThreadStorageData(); + + void** get() const; + void** set( void* p ); + + static void finish( void** ); + int id; +}; + + +template +class TQThreadStorage +{ +private: + TQThreadStorageData d; + +#if defined(Q_DISABLE_COPY) + // disable copy constructor and operator= + TQThreadStorage( const TQThreadStorage & ); + TQThreadStorage &operator=( const TQThreadStorage & ); +#endif // Q_DISABLE_COPY + + static void deleteData( void *x ) { delete (T)x; } + +public: + inline TQThreadStorage() : d( deleteData ) { } + inline ~TQThreadStorage() { } + + inline bool hasLocalData() const + { return d.get() != 0; } + + inline T& localData() + { void **v = d.get(); if ( !v ) v = d.set( 0 ); return *(T*)v; } + + inline T localData() const + { void **v = d.get(); return ( v ? *(T*)v : 0 ); } + + inline void setLocalData( T t ) + { (void) d.set( t ); } +}; + +#endif // QT_THREAD_SUPPORT + +#endif // TQTHREADSTORAGE_H diff --git a/src/tools/ntqtl.h b/src/tools/ntqtl.h new file mode 100644 index 000000000..ae8c5af87 --- /dev/null +++ b/src/tools/ntqtl.h @@ -0,0 +1,325 @@ +/**************************************************************************** +** +** Definition of TQt template library classes +** +** Created : 990128 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTL_H +#define TQTL_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqtextstream.h" +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_TEXTSTREAM +template +class TQTextOStreamIterator +{ +protected: + TQTextOStream& stream; + TQString separator; + +public: + TQTextOStreamIterator( TQTextOStream& s) : stream( s ) {} + TQTextOStreamIterator( TQTextOStream& s, const TQString& sep ) + : stream( s ), separator( sep ) {} + TQTextOStreamIterator& operator= ( const T& x ) { + stream << x; + if ( !separator.isEmpty() ) + stream << separator; + return *this; + } + TQTextOStreamIterator& operator*() { return *this; } + TQTextOStreamIterator& operator++() { return *this; } + TQTextOStreamIterator& operator++(int) { return *this; } +}; +#endif //QT_NO_TEXTSTREAM + +template +inline OutputIterator qCopy( InputIterator _begin, InputIterator _end, + OutputIterator _dest ) +{ + while( _begin != _end ) + *_dest++ = *_begin++; + return _dest; +} + +template +inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end, + BiOutputIterator _dest ) +{ + while ( _begin != _end ) + *--_dest = *--_end; + return _dest; +} + +template +inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 ) +{ + // ### compare using !(*first1 == *first2) in TQt 4.0 + for ( ; first1 != last1; ++first1, ++first2 ) + if ( *first1 != *first2 ) + return FALSE; + return TRUE; +} + +template +inline void qFill( ForwardIterator first, ForwardIterator last, const T& val ) +{ + for ( ; first != last; ++first ) + *first = val; +} + +#if 0 +template +inline OutputIterator qReverseCopy( BiIterator _begin, BiIterator _end, + OutputIterator _dest ) +{ + while ( _begin != _end ) { + --_end; + *_dest = *_end; + ++_dest; + } + return _dest; +} +#endif + + +template +inline InputIterator qFind( InputIterator first, InputIterator last, + const T& val ) +{ + while ( first != last && *first != val ) + ++first; + return first; +} + +template +inline void qCount( InputIterator first, InputIterator last, const T& value, + Size& n ) +{ + for ( ; first != last; ++first ) + if ( *first == value ) + ++n; +} + +template +inline void qSwap( T& _value1, T& _value2 ) +{ + T tmp = _value1; + _value1 = _value2; + _value2 = tmp; +} + + +template +Q_INLINE_TEMPLATES void qBubbleSort( InputIterator b, InputIterator e ) +{ + // Goto last element; + InputIterator last = e; + --last; + // only one element or no elements ? + if ( last == b ) + return; + + // So we have at least two elements in here + while( b != last ) { + bool swapped = FALSE; + InputIterator swap_pos = b; + InputIterator x = e; + InputIterator y = x; + y--; + do { + --x; + --y; + if ( *x < *y ) { + swapped = TRUE; + qSwap( *x, *y ); + swap_pos = y; + } + } while( y != b ); + if ( !swapped ) + return; + b = swap_pos; + b++; + } +} + + +template +inline void qBubbleSort( Container &c ) +{ + qBubbleSort( c.begin(), c.end() ); +} + + +template +Q_INLINE_TEMPLATES void qHeapSortPushDown( Value* heap, int first, int last ) +{ + int r = first; + while ( r <= last / 2 ) { + if ( last == 2 * r ) { + // node r has only one child + if ( heap[2 * r] < heap[r] ) + qSwap( heap[r], heap[2 * r] ); + r = last; + } else { + // node r has two children + if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) { + // swap with left child + qSwap( heap[r], heap[2 * r] ); + r *= 2; + } else if ( heap[2 * r + 1] < heap[r] + && heap[2 * r + 1] < heap[2 * r] ) { + // swap with right child + qSwap( heap[r], heap[2 * r + 1] ); + r = 2 * r + 1; + } else { + r = last; + } + } + } +} + + +template +Q_INLINE_TEMPLATES void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n ) +{ + // Create the heap + InputIterator insert = b; + Value* realheap = new Value[n]; + // Wow, what a fake. But I want the heap to be indexed as 1...n + Value* heap = realheap - 1; + int size = 0; + for( ; insert != e; ++insert ) { + heap[++size] = *insert; + int i = size; + while( i > 1 && heap[i] < heap[i / 2] ) { + qSwap( heap[i], heap[i / 2] ); + i /= 2; + } + } + + // Now do the sorting + for( uint i = n; i > 0; i-- ) { + *b++ = heap[1]; + if ( i > 1 ) { + heap[1] = heap[i]; + qHeapSortPushDown( heap, 1, (int)i - 1 ); + } + } + + delete[] realheap; +} + + +template +Q_INLINE_TEMPLATES void qHeapSort( InputIterator b, InputIterator e ) +{ + // Empty ? + if ( b == e ) + return; + + // How many entries have to be sorted ? + InputIterator it = b; + uint n = 0; + while ( it != e ) { + ++n; + ++it; + } + + // The second last parameter is a hack to retrieve the value type + // Do the real sorting here + qHeapSortHelper( b, e, *b, n ); +} + + +template +Q_INLINE_TEMPLATES void qHeapSort( Container &c ) +{ + if ( c.begin() == c.end() ) + return; + + // The second last parameter is a hack to retrieve the value type + // Do the real sorting here + qHeapSortHelper( c.begin(), c.end(), *(c.begin()), (uint)c.count() ); +} + +template +class TQBackInsertIterator +{ +public: + Q_EXPLICIT TQBackInsertIterator( Container &c ) + : container( &c ) + { + } + + TQBackInsertIterator& + operator=( const Q_TYPENAME Container::value_type &value ) + { + container->push_back( value ); + return *this; + } + + TQBackInsertIterator& operator*() + { + return *this; + } + + TQBackInsertIterator& operator++() + { + return *this; + } + + TQBackInsertIterator& operator++(int) + { + return *this; + } + +protected: + Container *container; +}; + +template +inline TQBackInsertIterator qBackInserter( Container &c ) +{ + return TQBackInsertIterator( c ); +} + +#endif diff --git a/src/tools/ntquuid.h b/src/tools/ntquuid.h new file mode 100644 index 000000000..f518f3e75 --- /dev/null +++ b/src/tools/ntquuid.h @@ -0,0 +1,194 @@ +/**************************************************************************** +** +** Definition of TQUuid class +** +** Created : 010523 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQUUID_H +#define TQUUID_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#include + +#if defined(Q_OS_WIN32) +#ifndef GUID_DEFINED +#define GUID_DEFINED +typedef struct _GUID +{ + ulong Data1; + ushort Data2; + ushort Data3; + uchar Data4[ 8 ]; +} GUID, *REFGUID, *LPGUID; +#endif +#endif + + +struct Q_EXPORT TQUuid +{ + enum Variant { + VarUnknown =-1, + NCS = 0, // 0 - - + DCE = 2, // 1 0 - + Microsoft = 6, // 1 1 0 + Reserved = 7 // 1 1 1 + }; + + enum Version { + VerUnknown =-1, + Time = 1, // 0 0 0 1 + EmbeddedPOSIX = 2, // 0 0 1 0 + Name = 3, // 0 0 1 1 + Random = 4 // 0 1 0 0 + }; + + TQUuid() + { + memset( this, 0, sizeof(TQUuid) ); + } + TQUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) + { + data1 = l; + data2 = w1; + data3 = w2; + data4[0] = b1; + data4[1] = b2; + data4[2] = b3; + data4[3] = b4; + data4[4] = b5; + data4[5] = b6; + data4[6] = b7; + data4[7] = b8; + } + TQUuid( const TQUuid &uuid ) + { + memcpy( this, &uuid, sizeof(TQUuid) ); + } +#ifndef QT_NO_QUUID_STRING + TQUuid( const TQString & ); + TQUuid( const char * ); + TQString toString() const; + operator TQString() const { return toString(); } +#endif + bool isNull() const; + + TQUuid &operator=(const TQUuid &orig ) + { + memcpy( this, &orig, sizeof(TQUuid) ); + return *this; + } + + bool operator==(const TQUuid &orig ) const + { + uint i; + if ( data1 != orig.data1 || data2 != orig.data2 || + data3 != orig.data3 ) + return FALSE; + + for( i = 0; i < 8; i++ ) + if ( data4[i] != orig.data4[i] ) + return FALSE; + + return TRUE; + } + + bool operator!=(const TQUuid &orig ) const + { + return !( *this == orig ); + } + + bool operator<(const TQUuid &other ) const; + bool operator>(const TQUuid &other ) const; + +#if defined(Q_OS_WIN32) + // On Windows we have a type GUID that is used by the platform API, so we + // provide convenience operators to cast from and to this type. + TQUuid( const GUID &guid ) + { + memcpy( this, &guid, sizeof(GUID) ); + } + + TQUuid &operator=(const GUID &orig ) + { + memcpy( this, &orig, sizeof(TQUuid) ); + return *this; + } + + operator GUID() const + { + GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } }; + return guid; + } + + bool operator==( const GUID &guid ) const + { + uint i; + if ( data1 != guid.Data1 || data2 != guid.Data2 || + data3 != guid.Data3 ) + return FALSE; + + for( i = 0; i < 8; i++ ) + if ( data4[i] != guid.Data4[i] ) + return FALSE; + + return TRUE; + } + + bool operator!=( const GUID &guid ) const + { + return !( *this == guid ); + } +#endif + static TQUuid createUuid(); + TQUuid::Variant variant() const; + TQUuid::Version version() const; + + uint data1; + ushort data2; + ushort data3; + uchar data4[ 8 ]; +}; + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQUuid & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQUuid & ); +#endif + +#endif //TQUUID_H diff --git a/src/tools/ntqvaluelist.h b/src/tools/ntqvaluelist.h new file mode 100644 index 000000000..c217a7892 --- /dev/null +++ b/src/tools/ntqvaluelist.h @@ -0,0 +1,670 @@ +/**************************************************************************** +** +** Definition of TQValueList class +** +** Created : 990406 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVALUELIST_H +#define TQVALUELIST_H + +#ifndef QT_H +#include "ntqtl.h" +#include "ntqshared.h" +#include "ntqdatastream.h" +#endif // QT_H + +#ifndef QT_NO_STL +#include +#include +#include +#endif + +//#define QT_CHECK_VALUELIST_RANGE + +#if defined(Q_CC_MSVC) +#pragma warning(disable:4284) // "return type for operator -> is not a UDT" +#endif + +template +class TQValueListNode +{ +public: + TQValueListNode( const T& t ) : data( t ) { } + TQValueListNode() { } +#if defined(Q_TEMPLATEDLL) + // Workaround MS bug in memory de/allocation in DLL vs. EXE + virtual ~TQValueListNode() { } +#endif + + TQValueListNode* next; + TQValueListNode* prev; + T data; +}; + +template +class TQValueListIterator +{ + public: + /** + * Typedefs + */ + typedef TQValueListNode* NodePtr; +#ifndef QT_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; +#endif + typedef T value_type; + typedef size_t size_type; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + typedef T* pointer; + typedef T& reference; + + /** + * Variables + */ + NodePtr node; + + /** + * Functions + */ + TQValueListIterator() : node( 0 ) {} + TQValueListIterator( NodePtr p ) : node( p ) {} + TQValueListIterator( const TQValueListIterator& it ) : node( it.node ) {} + + bool operator==( const TQValueListIterator& it ) const { return node == it.node; } + bool operator!=( const TQValueListIterator& it ) const { return node != it.node; } + const T& operator*() const { return node->data; } + T& operator*() { return node->data; } + // UDT for T = x* + // T* operator->() const { return &node->data; } + + TQValueListIterator& operator++() { + node = node->next; + return *this; + } + + TQValueListIterator operator++(int) { + TQValueListIterator tmp = *this; + node = node->next; + return tmp; + } + + TQValueListIterator& operator--() { + node = node->prev; + return *this; + } + + TQValueListIterator operator--(int) { + TQValueListIterator tmp = *this; + node = node->prev; + return tmp; + } + + TQValueListIterator& operator+=( int j ) { + while ( j-- ) + node = node->next; + return *this; + } + + TQValueListIterator& operator-=( int j ) { + while ( j-- ) + node = node->prev; + return *this; + } + +}; + +template +class TQValueListConstIterator +{ + public: + /** + * Typedefs + */ + typedef TQValueListNode* NodePtr; +#ifndef QT_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; +#endif + typedef T value_type; + typedef size_t size_type; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + typedef const T* pointer; + typedef const T& reference; + + /** + * Variables + */ + NodePtr node; + + /** + * Functions + */ + TQValueListConstIterator() : node( 0 ) {} + TQValueListConstIterator( NodePtr p ) : node( p ) {} + TQValueListConstIterator( const TQValueListConstIterator& it ) : node( it.node ) {} + TQValueListConstIterator( const TQValueListIterator& it ) : node( it.node ) {} + + bool operator==( const TQValueListConstIterator& it ) const { return node == it.node; } + bool operator!=( const TQValueListConstIterator& it ) const { return node != it.node; } + const T& operator*() const { return node->data; } + // UDT for T = x* + // const T* operator->() const { return &node->data; } + + TQValueListConstIterator& operator++() { + node = node->next; + return *this; + } + + TQValueListConstIterator operator++(int) { + TQValueListConstIterator tmp = *this; + node = node->next; + return tmp; + } + + TQValueListConstIterator& operator--() { + node = node->prev; + return *this; + } + + TQValueListConstIterator operator--(int) { + TQValueListConstIterator tmp = *this; + node = node->prev; + return tmp; + } +}; + +template +class TQValueListPrivate : public TQShared +{ +public: + /** + * Typedefs + */ + typedef TQValueListIterator Iterator; + typedef TQValueListConstIterator ConstIterator; + typedef TQValueListNode Node; + typedef TQValueListNode* NodePtr; + typedef size_t size_type; + + /** + * Functions + */ + TQValueListPrivate(); + TQValueListPrivate( const TQValueListPrivate& _p ); + + void derefAndDelete() // ### hack to get around hp-cc brain damage + { + if ( deref() ) + delete this; + } + +#if defined(Q_TEMPLATEDLL) + // Workaround MS bug in memory de/allocation in DLL vs. EXE + virtual +#endif + ~TQValueListPrivate(); + + Iterator insert( Iterator it, const T& x ); + Iterator remove( Iterator it ); + NodePtr find( NodePtr start, const T& x ) const; + int findIndex( NodePtr start, const T& x ) const; + uint contains( const T& x ) const; + uint remove( const T& x ); + NodePtr at( size_type i ) const; + void clear(); + + NodePtr node; + size_type nodes; +}; + +template +Q_INLINE_TEMPLATES TQValueListPrivate::TQValueListPrivate() +{ + node = new Node; node->next = node->prev = node; nodes = 0; +} + +template +Q_INLINE_TEMPLATES TQValueListPrivate::TQValueListPrivate( const TQValueListPrivate& _p ) + : TQShared() +{ + node = new Node; node->next = node->prev = node; nodes = 0; + Iterator b( _p.node->next ); + Iterator e( _p.node ); + Iterator i( node ); + while( b != e ) + insert( i, *b++ ); +} + +template +Q_INLINE_TEMPLATES TQValueListPrivate::~TQValueListPrivate() { + NodePtr p = node->next; + while( p != node ) { + NodePtr x = p->next; + delete p; + p = x; + } + delete node; +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::Iterator TQValueListPrivate::insert( Q_TYPENAME TQValueListPrivate::Iterator it, const T& x ) +{ + NodePtr p = new Node( x ); + p->next = it.node; + p->prev = it.node->prev; + it.node->prev->next = p; + it.node->prev = p; + nodes++; + return p; +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::Iterator TQValueListPrivate::remove( Q_TYPENAME TQValueListPrivate::Iterator it ) +{ + Q_ASSERT ( it.node != node ); + NodePtr next = it.node->next; + NodePtr prev = it.node->prev; + prev->next = next; + next->prev = prev; + delete it.node; + nodes--; + return Iterator( next ); +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::NodePtr TQValueListPrivate::find( Q_TYPENAME TQValueListPrivate::NodePtr start, const T& x ) const +{ + ConstIterator first( start ); + ConstIterator last( node ); + while( first != last) { + if ( *first == x ) + return first.node; + ++first; + } + return last.node; +} + +template +Q_INLINE_TEMPLATES int TQValueListPrivate::findIndex( Q_TYPENAME TQValueListPrivate::NodePtr start, const T& x ) const +{ + ConstIterator first( start ); + ConstIterator last( node ); + int pos = 0; + while( first != last) { + if ( *first == x ) + return pos; + ++first; + ++pos; + } + return -1; +} + +template +Q_INLINE_TEMPLATES uint TQValueListPrivate::contains( const T& x ) const +{ + uint result = 0; + Iterator first = Iterator( node->next ); + Iterator last = Iterator( node ); + while( first != last) { + if ( *first == x ) + ++result; + ++first; + } + return result; +} + +template +Q_INLINE_TEMPLATES uint TQValueListPrivate::remove( const T& _x ) +{ + const T x = _x; + uint result = 0; + Iterator first = Iterator( node->next ); + Iterator last = Iterator( node ); + while( first != last) { + if ( *first == x ) { + first = remove( first ); + ++result; + } else + ++first; + } + return result; +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::NodePtr TQValueListPrivate::at( size_type i ) const +{ + Q_ASSERT( i <= nodes ); + NodePtr p = node->next; + for( size_type x = 0; x < i; ++x ) + p = p->next; + return p; +} + +template +Q_INLINE_TEMPLATES void TQValueListPrivate::clear() +{ + nodes = 0; + NodePtr p = node->next; + while( p != node ) { + NodePtr next = p->next; + delete p; + p = next; + } + node->next = node->prev = node; +} + +#ifdef QT_CHECK_RANGE +# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_VALUELIST_RANGE ) +# define QT_CHECK_INVALID_LIST_ELEMENT if ( empty() ) qWarning( "TQValueList: Warning invalid element" ) +# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL Q_ASSERT( !empty() ); +# else +# define QT_CHECK_INVALID_LIST_ELEMENT +# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL +# endif +#else +# define QT_CHECK_INVALID_LIST_ELEMENT +# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL +#endif + +template class TQDeepCopy; + +template +class TQValueList +{ +public: + /** + * Typedefs + */ + typedef TQValueListIterator iterator; + typedef TQValueListConstIterator const_iterator; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + + /** + * API + */ + TQValueList() { sh = new TQValueListPrivate; } + TQValueList( const TQValueList& l ) { sh = l.sh; sh->ref(); } +#ifndef QT_NO_STL + TQValueList( const std::list& l ) + { + sh = new TQValueListPrivate; + qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); + } +#endif + ~TQValueList() { sh->derefAndDelete(); } + + TQValueList& operator= ( const TQValueList& l ) + { + l.sh->ref(); + sh->derefAndDelete(); + sh = l.sh; + return *this; + } +#ifndef QT_NO_STL + TQValueList& operator= ( const std::list& l ) + { + detach(); + qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); + return *this; + } + bool operator== ( const std::list& l ) const + { + if ( size() != l.size() ) + return FALSE; + const_iterator it2 = begin(); +#if !defined(Q_CC_MIPS) + typename +#endif + std::list::const_iterator it = l.begin(); + for ( ; it2 != end(); ++it2, ++it ) + if ( !((*it2) == (*it)) ) + return FALSE; + return TRUE; + } +#endif + bool operator== ( const TQValueList& l ) const; + bool operator!= ( const TQValueList& l ) const { return !( *this == l ); } + iterator begin() { detach(); return iterator( sh->node->next ); } + const_iterator begin() const { return const_iterator( sh->node->next ); } + const_iterator constBegin() const { return const_iterator( sh->node->next ); } + iterator end() { detach(); return iterator( sh->node ); } + const_iterator end() const { return const_iterator( sh->node ); } + const_iterator constEnd() const { return const_iterator( sh->node ); } + iterator insert( iterator it, const T& x ) { detach(); return sh->insert( it, x ); } + uint remove( const T& x ) { detach(); return sh->remove( x ); } + void clear(); + + // ### 4.0: move out of class + TQValueList& operator<< ( const T& x ) + { + append( x ); + return *this; + } + + size_type size() const { return sh->nodes; } + bool empty() const { return sh->nodes == 0; } + void push_front( const T& x ) { detach(); sh->insert( begin(), x ); } + void push_back( const T& x ) { detach(); sh->insert( end(), x ); } + iterator erase( iterator pos ) { detach(); return sh->remove( pos ); } + iterator erase( iterator first, iterator last ); + reference front() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); } + const_reference front() const { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); } + reference back() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); } + const_reference back() const { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); } + void pop_front() { QT_CHECK_INVALID_LIST_ELEMENT; erase( begin() ); } + void pop_back() { + QT_CHECK_INVALID_LIST_ELEMENT; + iterator tmp = end(); + erase( --tmp ); + } + void insert( iterator pos, size_type n, const T& x ); + // Some compilers (incl. vc++) would instantiate this function even if + // it is not used; this would constrain TQValueList to classes that provide + // an operator< + /* + void sort() + { + qHeapSort( *this ); + } + */ + + TQValueList operator+ ( const TQValueList& l ) const; + TQValueList& operator+= ( const TQValueList& l ); + + iterator fromLast() { detach(); return iterator( sh->node->prev ); } + const_iterator fromLast() const { return const_iterator( sh->node->prev ); } + + bool isEmpty() const { return ( sh->nodes == 0 ); } + + iterator append( const T& x ) { detach(); return sh->insert( end(), x ); } + iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); } + + iterator remove( iterator it ) { detach(); return sh->remove( it ); } + + T& first() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->next->data; } + const T& first() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->next->data; } + T& last() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->prev->data; } + const T& last() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->prev->data; } + + T& operator[] ( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->at(i)->data; } + const T& operator[] ( size_type i ) const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->at(i)->data; } + iterator at( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return iterator( sh->at(i) ); } + const_iterator at( size_type i ) const { QT_CHECK_INVALID_LIST_ELEMENT; return const_iterator( sh->at(i) ); } + iterator find ( const T& x ) { detach(); return iterator( sh->find( sh->node->next, x) ); } + const_iterator find ( const T& x ) const { return const_iterator( sh->find( sh->node->next, x) ); } + iterator find ( iterator it, const T& x ) { detach(); return iterator( sh->find( it.node, x ) ); } + const_iterator find ( const_iterator it, const T& x ) const { return const_iterator( sh->find( it.node, x ) ); } + int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; } + size_type contains( const T& x ) const { return sh->contains( x ); } + + size_type count() const { return sh->nodes; } + + TQValueList& operator+= ( const T& x ) + { + append( x ); + return *this; + } + typedef TQValueListIterator Iterator; + typedef TQValueListConstIterator ConstIterator; + typedef T ValueType; + +protected: + /** + * Helpers + */ + void detach() { if ( sh->count > 1 ) detachInternal(); } + + /** + * Variables + */ + TQValueListPrivate* sh; + +private: + void detachInternal(); + + friend class TQDeepCopy< TQValueList >; +}; + +template +Q_INLINE_TEMPLATES bool TQValueList::operator== ( const TQValueList& l ) const +{ + if ( size() != l.size() ) + return FALSE; + const_iterator it2 = begin(); + const_iterator it = l.begin(); + for( ; it != l.end(); ++it, ++it2 ) + if ( !( *it == *it2 ) ) + return FALSE; + return TRUE; +} + +template +Q_INLINE_TEMPLATES void TQValueList::clear() +{ + if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new TQValueListPrivate; } +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueList::iterator TQValueList::erase( Q_TYPENAME TQValueList::iterator first, Q_TYPENAME TQValueList::iterator last ) +{ + while ( first != last ) + erase( first++ ); + return last; +} + + +template +Q_INLINE_TEMPLATES void TQValueList::insert( Q_TYPENAME TQValueList::iterator pos, size_type n, const T& x ) +{ + for ( ; n > 0; --n ) + insert( pos, x ); +} + +template +Q_INLINE_TEMPLATES TQValueList TQValueList::operator+ ( const TQValueList& l ) const +{ + TQValueList l2( *this ); + for( const_iterator it = l.begin(); it != l.end(); ++it ) + l2.append( *it ); + return l2; +} + +template +Q_INLINE_TEMPLATES TQValueList& TQValueList::operator+= ( const TQValueList& l ) +{ + TQValueList copy = l; + for( const_iterator it = copy.begin(); it != copy.end(); ++it ) + append( *it ); + return *this; +} + +template +Q_INLINE_TEMPLATES void TQValueList::detachInternal() +{ + sh->deref(); sh = new TQValueListPrivate( *sh ); +} + +#ifndef QT_NO_DATASTREAM +template +Q_INLINE_TEMPLATES TQDataStream& operator>>( TQDataStream& s, TQValueList& l ) +{ + l.clear(); + Q_UINT32 c; + s >> c; + for( Q_UINT32 i = 0; i < c; ++i ) + { + T t; + s >> t; + l.append( t ); + if ( s.atEnd() ) + break; + } + return s; +} + +template +Q_INLINE_TEMPLATES TQDataStream& operator<<( TQDataStream& s, const TQValueList& l ) +{ + s << (Q_UINT32)l.size(); + TQValueListConstIterator it = l.begin(); + for( ; it != l.end(); ++it ) + s << *it; + return s; +} +#endif // QT_NO_DATASTREAM + +#define Q_DEFINED_QVALUELIST +#define Q_DEFINED_QVALUELIST +#include "ntqwinexport.h" +#endif // TQVALUELIST_H diff --git a/src/tools/ntqvaluestack.h b/src/tools/ntqvaluestack.h new file mode 100644 index 000000000..1c1259fb1 --- /dev/null +++ b/src/tools/ntqvaluestack.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Definition of TQValueStack class +** +** Created : 990925 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVALUESTACK_H +#define TQVALUESTACK_H + +#ifndef QT_H +#include "ntqvaluelist.h" +#endif // QT_H + + +template +class TQValueStack : public TQValueList +{ +public: + TQValueStack() {} + ~TQValueStack() {} + void push( const T& d ) { this->append(d); } + T pop() + { + T elem( this->last() ); + if ( !this->isEmpty() ) + this->remove( this->fromLast() ); + return elem; + } + T& top() { return this->last(); } + const T& top() const { return this->last(); } +}; + +#endif diff --git a/src/tools/ntqvaluevector.h b/src/tools/ntqvaluevector.h new file mode 100644 index 000000000..bef40f54b --- /dev/null +++ b/src/tools/ntqvaluevector.h @@ -0,0 +1,577 @@ +/**************************************************************************** +** +** Definition of TQValueVector class +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVALUEVECTOR_H +#define TQVALUEVECTOR_H + +#include + +#ifndef QT_H +#include "ntqtl.h" +#include "ntqshared.h" +#include "ntqdatastream.h" +#endif // QT_H + +#ifndef QT_NO_STL +#include +#endif + +template +class TQValueVectorPrivate : public TQShared +{ +public: + typedef T value_type; + typedef T* pointer; + + TQValueVectorPrivate() + : start( 0 ), finish( 0 ), end( 0 ) + { + } + + TQValueVectorPrivate( const TQValueVectorPrivate& x ); + TQValueVectorPrivate( size_t size ); + + void derefAndDelete() // work-around for hp-cc + { + if ( deref() ) + delete this; + } + +#if defined(Q_TEMPLATEDLL) + // Workaround MS bug in memory de/allocation in DLL vs. EXE + virtual +#endif + ~TQValueVectorPrivate() + { + delete[] start; + } + + size_t size() const + { + return finish - start; + } + + bool empty() const + { + return start == finish; + } + + size_t capacity() const + { + return end - start; + } + + void insert( pointer pos, const T& x ); + void insert( pointer pos, size_t n, const T& x ); + void reserve( size_t n ); + + void clear() + { + delete[] start; + start = 0; + finish = 0; + end = 0; + } + + + pointer start; + pointer finish; + pointer end; + +private: + pointer growAndCopy( size_t n, pointer s, pointer f ); + + TQValueVectorPrivate& operator=( const TQValueVectorPrivate& x ); + +}; + +template +Q_INLINE_TEMPLATES TQValueVectorPrivate::TQValueVectorPrivate( const TQValueVectorPrivate& x ) + : TQShared() +{ + size_t i = x.size(); + if ( i > 0 ) { + start = new T[ i ]; + finish = start + i; + end = start + i; +#if defined(__xlC__) && __xlC__ < 0x400 // xlC 3.6 confused by const + qCopy( (pointer)x.start, (pointer)x.finish, start ); +#else + qCopy( x.start, x.finish, start ); +#endif + } else { + start = 0; + finish = 0; + end = 0; + } +} + +template +Q_INLINE_TEMPLATES TQValueVectorPrivate::TQValueVectorPrivate( size_t size ) +{ + if ( size > 0 ) { + start = new T[size]; + finish = start + size; + end = start + size; + } else { + start = 0; + finish = 0; + end = 0; + } +} + +template +Q_INLINE_TEMPLATES void TQValueVectorPrivate::insert( pointer pos, const T& x ) +{ + const size_t lastSize = size(); + const size_t n = lastSize !=0 ? 2*lastSize : 1; + const size_t offset = pos - start; + pointer newStart = new T[n]; + pointer newFinish = newStart + offset; + qCopy( start, pos, newStart ); + *newFinish = x; + qCopy( pos, finish, ++newFinish ); + delete[] start; + start = newStart; + finish = newStart + lastSize + 1; + end = newStart + n; +} + +template +Q_INLINE_TEMPLATES void TQValueVectorPrivate::insert( pointer pos, size_t n, const T& x ) +{ + if ( size_t( end - finish ) >= n ) { + // enough room + const size_t elems_after = finish - pos; + pointer old_finish = finish; + if ( elems_after > n ) { + qCopy( finish - n, finish, finish ); + finish += n; + qCopyBackward( pos, old_finish - n, old_finish ); + qFill( pos, pos + n, x ); + } else { + pointer filler = finish; + size_t i = n - elems_after; + for ( ; i > 0; --i, ++filler ) + *filler = x; + finish += n - elems_after; + qCopy( pos, old_finish, finish ); + finish += elems_after; + qFill( pos, old_finish, x ); + } + } else { + // not enough room + const size_t lastSize = size(); + const size_t len = lastSize + TQMAX( lastSize, n ); + pointer newStart = new T[len]; + pointer newFinish = qCopy( start, pos, newStart ); + // fill up inserted space + size_t i = n; + for ( ; i > 0; --i, ++newFinish ) + *newFinish = x; + newFinish = qCopy( pos, finish, newFinish ); + delete[] start; + start = newStart; + finish = newFinish; + end = newStart + len; + } +} + +template +Q_INLINE_TEMPLATES void TQValueVectorPrivate::reserve( size_t n ) +{ + const size_t lastSize = size(); + pointer tmp = growAndCopy( n, start, finish ); + start = tmp; + finish = tmp + lastSize; + end = start + n; +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueVectorPrivate::pointer TQValueVectorPrivate::growAndCopy( size_t n, pointer s, pointer f ) +{ + pointer newStart = new T[n]; + qCopy( s, f, newStart ); + delete[] start; + return newStart; +} + +template class TQDeepCopy; + +template +class TQValueVector +{ +public: + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type* iterator; + typedef const value_type* const_iterator; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + + TQValueVector() + { + sh = new TQValueVectorPrivate; + } + + TQValueVector( const TQValueVector& v ) + { + sh = v.sh; + sh->ref(); + } + + TQValueVector( size_type n, const T& val = T() ); + +#ifndef QT_NO_STL + TQValueVector( std::vector& v ) // ### remove in 4.0 + { + sh = new TQValueVectorPrivate( v.size() ); + qCopy( v.begin(), v.end(), begin() ); + } + + TQValueVector( const std::vector& v ) + { + sh = new TQValueVectorPrivate( v.size() ); + qCopy( v.begin(), v.end(), begin() ); + } +#endif + + ~TQValueVector() + { + sh->derefAndDelete(); + } + + TQValueVector& operator= ( const TQValueVector& v ) + { + v.sh->ref(); + sh->derefAndDelete(); + sh = v.sh; + return *this; + } + +#ifndef QT_NO_STL + TQValueVector& operator= ( const std::vector& v ) + { + clear(); + resize( v.size() ); + qCopy( v.begin(), v.end(), begin() ); + return *this; + } +#endif + + size_type size() const { return sh->size(); } + + bool empty() const { return sh->empty(); } + + size_type capacity() const + { + return size_type( sh->capacity() ); + } + + iterator begin() + { + detach(); + return sh->start; + } + + const_iterator begin() const + { + return sh->start; + } + + const_iterator constBegin() const + { + return sh->start; + } + + iterator end() + { + detach(); + return sh->finish; + } + + const_iterator end() const + { + return sh->finish; + } + + const_iterator constEnd() const + { + return sh->finish; + } + + reference at( size_type i, bool* ok = 0 ) + { + detach(); + if ( ok ) + *ok = ( i < size() ); + return *( begin() + i ); + } + + const_reference at( size_type i, bool* ok = 0 ) const + { + if ( ok ) + *ok = ( i < size() ); + return *( begin() + i ); + } + + reference operator[]( size_type i ) + { + detach(); + return *( begin() + i ); + } + + const_reference operator[]( size_type i ) const + { + return *( begin() + i ); + } + + reference front() + { + Q_ASSERT( !empty() ); + detach(); + return *begin(); + } + + const_reference front() const + { + Q_ASSERT( !empty() ); + return *begin(); + } + + reference back() + { + Q_ASSERT( !empty() ); + detach(); + return *( end() - 1 ); + } + + const_reference back() const + { + Q_ASSERT( !empty() ); + return *( end() - 1 ); + } + + void push_back( const T& x ) + { + detach(); + if ( sh->finish == sh->end ) { + sh->reserve( size()+size()/2+1 ); + } + *sh->finish = x; + ++sh->finish; + } + + void pop_back() + { + detach(); + if ( empty() ) + return; + --sh->finish; + } + + iterator insert( iterator pos, const T& x ); + iterator insert( iterator pos, size_type n, const T& x ); + + void reserve( size_type n ) + { + if ( capacity() < n ) { + detach(); + sh->reserve( n ); + } + } + + void resize( size_type n, const T& val = T() ) + { + if ( n < size() ) + erase( begin() + n, end() ); + else + insert( end(), n - size(), val ); + } + + void clear() + { + detach(); + sh->clear(); + } + + iterator erase( iterator pos ) + { + detach(); + if ( pos + 1 != end() ) + qCopy( pos + 1, sh->finish, pos ); + --sh->finish; + return pos; + } + + iterator erase( iterator first, iterator last ) + { + detach(); + qCopy( last, sh->finish, first ); + sh->finish = sh->finish - ( last - first ); + return first; + } + + // ### remove in TQt 4.0 + bool operator==( const TQValueVector& x ) + { + return size()==x.size() ? qEqual( constBegin(), constEnd(), x.begin()) : FALSE; + } + + bool operator==( const TQValueVector& x ) const + { + return size()==x.size() ? qEqual( begin(), end(), x.begin() ) : FALSE; + } + + typedef T ValueType; + typedef ValueType *Iterator; + typedef const ValueType *ConstIterator; + + size_type count() const { return size(); } + bool isEmpty() const { return empty(); } + + reference first() { return front(); } + const_reference first() const { return front(); } + reference last() { return back(); } + const_reference last() const { return back(); } + void append( const T& x ) { push_back( x ); } + +protected: + void detach() + { + if ( sh->count > 1 ) { detachInternal(); } + } + void detachInternal(); + TQValueVectorPrivate* sh; + +private: + friend class TQDeepCopy< TQValueVector >; +}; + +template +Q_INLINE_TEMPLATES TQValueVector::TQValueVector( size_type n, const T& val ) +{ + sh = new TQValueVectorPrivate( n ); + qFill( begin(), end(), val ); +} + +template +Q_INLINE_TEMPLATES void TQValueVector::detachInternal() +{ + sh->deref(); + sh = new TQValueVectorPrivate( *sh ); +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueVector::iterator TQValueVector::insert( iterator pos, const T& x ) +{ + size_type offset = pos - sh->start; + detach(); + if ( pos == end() ) { + if ( sh->finish == sh->end ) + push_back( x ); + else { + *sh->finish = x; + ++sh->finish; + } + } else { + if ( sh->finish == sh->end ) { + sh->insert( pos, x ); + } else { + *sh->finish = *(sh->finish - 1); + ++sh->finish; + qCopyBackward( pos, sh->finish - 2, sh->finish - 1 ); + *pos = x; + } + } + return begin() + offset; +} + +template +Q_INLINE_TEMPLATES Q_TYPENAME TQValueVector::iterator TQValueVector::insert( iterator pos, size_type n, const T& x ) +{ + if ( n != 0 ) { + size_type offset = pos - sh->start; + detach(); + pos = begin() + offset; + sh->insert( pos, n, x ); + } + return pos; +} + + +#ifndef QT_NO_DATASTREAM +template +Q_INLINE_TEMPLATES TQDataStream& operator>>( TQDataStream& s, TQValueVector& v ) +{ + v.clear(); + Q_UINT32 c; + s >> c; + v.resize( c ); + for( Q_UINT32 i = 0; i < c; ++i ) + { + T t; + s >> t; + v[i] = t; + } + return s; +} + +template +Q_INLINE_TEMPLATES TQDataStream& operator<<( TQDataStream& s, const TQValueVector& v ) +{ + s << (Q_UINT32)v.size(); + // ### use typename TQValueVector::const_iterator once all supported + // ### compilers know about the 'typename' keyword. + const T* it = v.begin(); + for( ; it != v.end(); ++it ) + s << *it; + return s; +} +#endif // QT_NO_DATASTREAM + +#define Q_DEFINED_QVALUEVECTOR +#include "ntqwinexport.h" +#endif // TQVALUEVECTOR_H diff --git a/src/tools/ntqwaitcondition.h b/src/tools/ntqwaitcondition.h new file mode 100644 index 000000000..6e6038801 --- /dev/null +++ b/src/tools/ntqwaitcondition.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Definition of TQWaitCondition class +** +** Created : 931107 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWAITCONDITION_H +#define TQWAITCONDITION_H + +#ifndef QT_H +#include "ntqglobal.h" +#endif // QT_H + +#if defined(QT_THREAD_SUPPORT) + +#include + +class TQWaitConditionPrivate; +class TQMutex; + +class Q_EXPORT TQWaitCondition +{ +public: + TQWaitCondition(); + virtual ~TQWaitCondition(); + + // default argument causes thread to block indefinately + bool wait( unsigned long time = ULONG_MAX ); + bool wait( TQMutex *mutex, unsigned long time = ULONG_MAX ); + + void wakeOne(); + void wakeAll(); + +private: + TQWaitConditionPrivate * d; + +#if defined(Q_DISABLE_COPY) + TQWaitCondition( const TQWaitCondition & ); + TQWaitCondition &operator=( const TQWaitCondition & ); +#endif +}; + +#endif + +#endif diff --git a/src/tools/ntqwinexport.h b/src/tools/ntqwinexport.h new file mode 100644 index 000000000..0936ade6c --- /dev/null +++ b/src/tools/ntqwinexport.h @@ -0,0 +1,224 @@ +/**************************************************************************** +** +** Global type declarations and definitions +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the tools module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) ) +// MOC_SKIP_BEGIN + +#if defined(Q_DEFINED_QASCIIDICT) && defined(Q_DEFINED_QCONNECTION_LIST) && !defined(Q_EXPORTED_QASCIIDICT_TEMPLATES) +#define Q_EXPORTED_QASCIIDICT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQAsciiDictIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQAsciiDict; +#endif + +#if defined(Q_DEFINED_QSTYLESHEET) && defined(Q_DEFINED_QDICT) && !defined(Q_EXPORTED_QSTYLESHEET_TEMPLATES) +#define Q_EXPORTED_QSTYLESHEET_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQDict; +#endif + +#if defined(Q_DEFINED_QLIBRARY) && defined(Q_DEFINED_QDICT) && !defined(Q_EXPORTED_QDICTLIBRARY_TEMPLATES) +#define Q_EXPORTED_QDICTLIBRARY_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQDict; // for TQtopia +#endif + +#if defined(Q_DEFINED_QGUARDEDPTR) && defined(Q_DEFINED_QOBJECT) && !defined(Q_EXPORTED_QGUARDEDPTROBJECT_TEMPLATES) +#define Q_EXPORTED_QGUARDEDPTROBJECT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQGuardedPtr; +#endif + +// needed for TQtopia +#if defined(Q_DEFINED_QGUARDEDPTR) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED_QGUARDEDPTRTQWIDGET_TEMPLATES) +#define Q_EXPORTED_QGUARDEDPTRTQWIDGET_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQGuardedPtr; +#endif + +#if defined(Q_DEFINED_QGUARDEDPTR) && defined(Q_DEFINED_QACCESSIBLE_OBJECT) && !defined(Q_EXPORTED_QACCESSIBLEOBJECT_TEMPLATES) +#define Q_EXPORTED_QACCESSIBLEOBJECT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQGuardedPtr; +#endif + +#if defined(Q_DEFINED_QINTDICT) && !defined(Q_EXPORTED_QINTDICT_TEMPLATES) +#define Q_EXPORTED_QINTDICT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDict; +#endif + +#if defined(Q_DEFINED_QINTDICT) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED__TEMPLATES) +#define Q_EXPORTED__TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDictIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDict; +#endif + +#if defined(Q_DEFINED_QMAP) && !defined(Q_EXPORTED_QMAPBASIC_TEMPLATES) +#define Q_EXPORTED_QMAPBASIC_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia +#endif + +#if defined(Q_DEFINED_QMAP) && defined(Q_DEFINED_QSTRING) && !defined(Q_EXPORTED_QMAPTQSTRING_TEMPLATES) +#define Q_EXPORTED_QMAPTQSTRING_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia +#endif + +#if defined(Q_DEFINED_QMEMARRAY) && !defined(Q_EXPORTED_QMEMARRAY_BASIC_TEMPLATES) +#define Q_EXPORTED_QMEMARRAY_BASIC_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; +#endif + +#if defined(Q_DEFINED_QMEMARRAY) && defined(Q_DEFINED_QPOINT) && !defined(Q_EXPORTED_QMEMARAYPOINT_TEMPLATES) +#define Q_EXPORTED_QMEMARAYPOINT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; +#endif + +#if defined(Q_DEFINED_QPTRLIST) && !defined(Q_EXPORTED_QPTRLIST_BASIC_TEMPLATES) +#define Q_EXPORTED_QPTRLIST_BASIC_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; +#endif + +#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED_QPTRLISTWIDGET_TEMPLATES) +#define Q_EXPORTED_QPTRLISTWIDGET_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; +#endif + +#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QCONNECTION) && !defined(Q_EXPORTED_QPTRLISTCONNECTION_TEMPLATES) +#define Q_EXPORTED_QPTRLISTCONNECTION_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; +#endif + +#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QOBJECT) && !defined(Q_EXPORTED_QPTRLISTOBJECT_TEMPLATES) +#define Q_EXPORTED_QPTRLISTOBJECT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; +#endif + +#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QDOCKWINDOW) && !defined(Q_EXPORTED_QPTRLISTDOCWINDOW_TEMPLATES) +#define Q_EXPORTED_QPTRLISTDOCWINDOW_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; +#endif + +#if defined(Q_DEFINED_QPTRVECTOR) && !defined(Q_EXPORTED_QPTRVECTOR_BASIC_TEMPLATES) +#define Q_EXPORTED_QPTRVECTOR_BASIC_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +#endif + +#if defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QSTYLESHEET) && !defined(Q_EXPORTED_QPTRVECTORSTYLESHEETITEM_TEMPLATES) +#define Q_EXPORTED_QPTRVECTORSTYLESHEETITEM_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +#endif + +#if defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED_QPTRVECTORWIDGET_TEMPLATES) +#define Q_EXPORTED_QPTRVECTORWIDGET_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +#endif + +#if defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QCONNECTION_LIST) && !defined(Q_EXPORTED_QPTRVECTORCONNECTTIONLIST_TEMPLATES) +#define Q_EXPORTED_QPTRVECTORCONNECTTIONLIST_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +#endif + +#if defined(Q_DEFINED_QVALUELIST) && !defined(Q_EXPORTED_QVALUELIST_BASIC_TEMPLATES) +#define Q_EXPORTED_QVALUELIST_BASIC_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +#endif + +#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QRECT) && !defined(Q_EXPORTED_QVALUELISTRECT_TEMPLATES) +#define Q_EXPORTED_QVALUELISTRECT_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +#endif + +#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QSTRING) && !defined(Q_EXPORTED_QVALUELISTSTRING_TEMPLATES) +#define Q_EXPORTED_QVALUELISTSTRING_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +#endif + +// TQStylesheet template exports +#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QSTYLESHEET) && !defined(Q_EXPORTED_QSTYLESHEETITEM1_TEMPLATES) +#define Q_EXPORTED_QSTYLESHEETITEM1_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList< TQPtrVector< TQStyleSheetItem> >; +#endif + +#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QSTYLESHEET) && !defined(Q_EXPORTED_QSTYLESHEETITEM2_TEMPLATES) +#define Q_EXPORTED_QSTYLESHEETITEM2_TEMPLATES +Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; +#endif + +// qcanvas template exports +#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QCANVAS) && !defined(Q_EXPORTED_QCANVAS1_TEMPLATES) +#define Q_EXPORTED_QCANVAS1_TEMPLATES +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrListIterator< TQCanvasItem >; +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrList< TQCanvasItem >; +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrListIterator< TQCanvasView >; +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrList< TQCanvasView >; +#endif + +// qtable template exports +#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QTABLE_SELECTION) && !defined(Q_EXPORTED_QTABLESELECTION_TEMPLATES) +#define Q_EXPORTED_QTABLESELECTION_TEMPLATES +TQM_TEMPLATE_EXTERN_TABLE template class TQM_EXPORT_TABLE TQPtrList; +#endif + +#if defined(Q_DEFINED_QTABLE_ITEM) && defined(Q_DEFINED_QPTRVECTOR) && !defined(Q_EXPORTED_QTABLEITEM_TEMPLATES) +#define Q_EXPORTED_QTABLEITEM_TEMPLATES +TQM_TEMPLATE_EXTERN_TABLE template class TQM_EXPORT_TABLE TQPtrVector; +#endif + +#if defined(Q_DEFINED_QTABLE) && defined(Q_DEFINED_QPTRVECTOR) +//Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; +#endif + +// qsqlextension template exports +#if defined(Q_DEFINED_QSQLEXTENSION) && defined(Q_DEFINED_QMAP) && defined(Q_DEFINED_QVALUEVECTOR) && defined(Q_DEFINED_QSTRING) && !defined(Q_EXPORTED_QSQLEXTENSION_TEMPLATES) +#define Q_EXPORTED_QSQLEXTENSION_TEMPLATES +TQM_TEMPLATE_EXTERN_SQL template class TQM_EXPORT_SQL TQMap; +TQM_TEMPLATE_EXTERN_SQL template class TQM_EXPORT_SQL TQValueVector; +#endif + + +// MOC_SKIP_END +#endif // template defined diff --git a/src/tools/qasciicache.h b/src/tools/qasciicache.h deleted file mode 100644 index 42c8a86c1..000000000 --- a/src/tools/qasciicache.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Definition of TQAsciiCache template/macro class -** -** Created : 950209 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQASCIICACHE_H -#define TQASCIICACHE_H - -#ifndef QT_H -#include "qgcache.h" -#endif // QT_H - - -template -class TQAsciiCache -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGCache -#endif -{ -public: - TQAsciiCache( const TQAsciiCache &c ) : TQGCache(c) {} - TQAsciiCache( int maxCost=100, int size=17, bool caseSensitive=TRUE, - bool copyKeys=TRUE ) - : TQGCache( maxCost, size, AsciiKey, caseSensitive, copyKeys ) {} - ~TQAsciiCache() { clear(); } - TQAsciiCache &operator=( const TQAsciiCache &c ) - { return (TQAsciiCache&)TQGCache::operator=(c); } - int maxCost() const { return TQGCache::maxCost(); } - int totalCost() const { return TQGCache::totalCost(); } - void setMaxCost( int m ) { TQGCache::setMaxCost(m); } - uint count() const { return TQGCache::count(); } - uint size() const { return TQGCache::size(); } - bool isEmpty() const { return TQGCache::count() == 0; } - void clear() { TQGCache::clear(); } - bool insert( const char *k, const type *d, int c=1, int p=0 ) - { return TQGCache::insert_other(k,(Item)d,c,p);} - bool remove( const char *k ) - { return TQGCache::remove_other(k); } - type *take( const char *k ) - { return (type *)TQGCache::take_other(k); } - type *find( const char *k, bool ref=TRUE ) const - { return (type *)TQGCache::find_other(k,ref);} - type *operator[]( const char *k ) const - { return (type *)TQGCache::find_other(k);} - void statistics() const { TQGCache::statistics(); } -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQAsciiCache::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQAsciiCache::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - - -template -class TQAsciiCacheIterator : public TQGCacheIterator -{ -public: - TQAsciiCacheIterator( const TQAsciiCache &c ):TQGCacheIterator((TQGCache &)c) {} - TQAsciiCacheIterator( const TQAsciiCacheIterator &ci) - : TQGCacheIterator( (TQGCacheIterator &)ci ) {} - TQAsciiCacheIterator &operator=(const TQAsciiCacheIterator&ci) - { return ( TQAsciiCacheIterator&)TQGCacheIterator::operator=( ci ); } - uint count() const { return TQGCacheIterator::count(); } - bool isEmpty() const { return TQGCacheIterator::count() == 0; } - bool atFirst() const { return TQGCacheIterator::atFirst(); } - bool atLast() const { return TQGCacheIterator::atLast(); } - type *toFirst() { return (type *)TQGCacheIterator::toFirst(); } - type *toLast() { return (type *)TQGCacheIterator::toLast(); } - operator type *() const { return (type *)TQGCacheIterator::get(); } - type *current() const { return (type *)TQGCacheIterator::get(); } - const char *currentKey() const { return TQGCacheIterator::getKeyAscii(); } - type *operator()() { return (type *)TQGCacheIterator::operator()();} - type *operator++() { return (type *)TQGCacheIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGCacheIterator::operator+=(j);} - type *operator--() { return (type *)TQGCacheIterator::operator--(); } - type *operator-=(uint j) { return (type *)TQGCacheIterator::operator-=(j);} -}; - - -#endif // TQASCIICACHE_H diff --git a/src/tools/qasciidict.h b/src/tools/qasciidict.h deleted file mode 100644 index 16bf49144..000000000 --- a/src/tools/qasciidict.h +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Definition of TQAsciiDict template class -** -** Created : 920821 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQASCIIDICT_H -#define TQASCIIDICT_H - -#ifndef QT_H -#include "qgdict.h" -#endif // QT_H - -template -class TQAsciiDict -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGDict -#endif -{ -public: - TQAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE ) - : TQGDict(size,AsciiKey,caseSensitive,copyKeys) {} - TQAsciiDict( const TQAsciiDict &d ) : TQGDict(d) {} - ~TQAsciiDict() { clear(); } - TQAsciiDict &operator=(const TQAsciiDict &d) - { return (TQAsciiDict&)TQGDict::operator=(d); } - uint count() const { return TQGDict::count(); } - uint size() const { return TQGDict::size(); } - bool isEmpty() const { return TQGDict::count() == 0; } - - void insert( const char *k, const type *d ) - { TQGDict::look_ascii(k,(Item)d,1); } - void replace( const char *k, const type *d ) - { TQGDict::look_ascii(k,(Item)d,2); } - bool remove( const char *k ) { return TQGDict::remove_ascii(k); } - type *take( const char *k ) { return (type *)TQGDict::take_ascii(k); } - type *find( const char *k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_ascii(k,0,0); } - type *operator[]( const char *k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_ascii(k,0,0); } - - void clear() { TQGDict::clear(); } - void resize( uint n ) { TQGDict::resize(n); } - void statistics() const { TQGDict::statistics(); } - -#ifdef Q_QDOC -protected: - virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); - virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQAsciiDict::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQAsciiDict::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -template -class TQAsciiDictIterator : public TQGDictIterator -{ -public: - TQAsciiDictIterator(const TQAsciiDict &d) - : TQGDictIterator((TQGDict &)d) {} - ~TQAsciiDictIterator() {} - uint count() const { return dict->count(); } - bool isEmpty() const { return dict->count() == 0; } - type *toFirst() { return (type *)TQGDictIterator::toFirst(); } - operator type *() const { return (type *)TQGDictIterator::get(); } - type *current() const { return (type *)TQGDictIterator::get(); } - const char *currentKey() const { return TQGDictIterator::getKeyAscii(); } - type *operator()() { return (type *)TQGDictIterator::operator()(); } - type *operator++() { return (type *)TQGDictIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j);} -}; - -#define Q_DEFINED_QASCIIDICT -#include "qwinexport.h" -#endif // TQASCIIDICT_H diff --git a/src/tools/qbitarray.cpp b/src/tools/qbitarray.cpp index 08e0bd9b7..c1433887a 100644 --- a/src/tools/qbitarray.cpp +++ b/src/tools/qbitarray.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qbitarray.h" -#include "qdatastream.h" +#include "ntqbitarray.h" +#include "ntqdatastream.h" #define SHBLOCK ((bitarr_data*)(sharedBlock())) /*! - \class TQBitVal qbitarray.h + \class TQBitVal ntqbitarray.h \reentrant \brief The TQBitVal class is an internal class, used with TQBitArray. @@ -84,7 +84,7 @@ /*! - \class TQBitArray qbitarray.h + \class TQBitArray ntqbitarray.h \reentrant \brief The TQBitArray class provides an array of bits. diff --git a/src/tools/qbitarray.h b/src/tools/qbitarray.h deleted file mode 100644 index 2e50875ab..000000000 --- a/src/tools/qbitarray.h +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** -** -** Definition of TQBitArray class -** -** Created : 940118 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQBITARRAY_H -#define TQBITARRAY_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - - -/***************************************************************************** - TQBitVal class; a context class for TQBitArray::operator[] - *****************************************************************************/ - -class TQBitArray; - -class Q_EXPORT TQBitVal -{ -private: - TQBitArray *array; - uint index; -public: - TQBitVal( TQBitArray *a, uint i ) : array(a), index(i) {} - operator int(); - TQBitVal &operator=( const TQBitVal &v ); - TQBitVal &operator=( bool v ); -}; - - -/***************************************************************************** - TQBitArray class - *****************************************************************************/ - -class Q_EXPORT TQBitArray : public TQByteArray -{ -public: - TQBitArray(); - TQBitArray( uint size ); - TQBitArray( const TQBitArray &a ) : TQByteArray( a ) {} - - TQBitArray &operator=( const TQBitArray & ); - - uint size() const; - bool resize( uint size ); - - bool fill( bool v, int size = -1 ); - - void detach(); - TQBitArray copy() const; - - bool testBit( uint index ) const; - void setBit( uint index ); - void setBit( uint index, bool value ); - void clearBit( uint index ); - bool toggleBit( uint index ); - - bool at( uint index ) const; - TQBitVal operator[]( int index ); - bool operator[]( int index ) const; - - TQBitArray &operator&=( const TQBitArray & ); - TQBitArray &operator|=( const TQBitArray & ); - TQBitArray &operator^=( const TQBitArray & ); - TQBitArray operator~() const; - -protected: - struct bitarr_data : public TQGArray::array_data { - uint nbits; - }; - array_data *newData() { return new bitarr_data; } - void deleteData( array_data *d ) { delete (bitarr_data*)d; } -private: - void pad0(); -}; - - -inline TQBitArray &TQBitArray::operator=( const TQBitArray &a ) -{ return (TQBitArray&)assign( a ); } - -inline uint TQBitArray::size() const -{ return ((bitarr_data*)sharedBlock())->nbits; } - -inline void TQBitArray::setBit( uint index, bool value ) -{ if ( value ) setBit(index); else clearBit(index); } - -inline bool TQBitArray::at( uint index ) const -{ return testBit(index); } - -inline TQBitVal TQBitArray::operator[]( int index ) -{ return TQBitVal( (TQBitArray*)this, index ); } - -inline bool TQBitArray::operator[]( int index ) const -{ return testBit( index ); } - - -/***************************************************************************** - Misc. TQBitArray operator functions - *****************************************************************************/ - -Q_EXPORT TQBitArray operator&( const TQBitArray &, const TQBitArray & ); -Q_EXPORT TQBitArray operator|( const TQBitArray &, const TQBitArray & ); -Q_EXPORT TQBitArray operator^( const TQBitArray &, const TQBitArray & ); - - -inline TQBitVal::operator int() -{ - return array->testBit( index ); -} - -inline TQBitVal &TQBitVal::operator=( const TQBitVal &v ) -{ - array->setBit( index, v.array->testBit(v.index) ); - return *this; -} - -inline TQBitVal &TQBitVal::operator=( bool v ) -{ - array->setBit( index, v ); - return *this; -} - - -/***************************************************************************** - TQBitArray stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQBitArray & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQBitArray & ); -#endif - -#endif // TQBITARRAY_H diff --git a/src/tools/qbuffer.cpp b/src/tools/qbuffer.cpp index ebf3dd0e2..75bb35da7 100644 --- a/src/tools/qbuffer.cpp +++ b/src/tools/qbuffer.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qbuffer.h" +#include "ntqbuffer.h" #include /*! - \class TQBuffer qbuffer.h + \class TQBuffer ntqbuffer.h \reentrant \brief The TQBuffer class is an I/O device that operates on a TQByteArray. diff --git a/src/tools/qbuffer.h b/src/tools/qbuffer.h deleted file mode 100644 index e638a83e8..000000000 --- a/src/tools/qbuffer.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Definition of TQBuffer class -** -** Created : 930812 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQBUFFER_H -#define TQBUFFER_H - -#ifndef QT_H -#include "qiodevice.h" -#include "qstring.h" -#endif // QT_H - - -class Q_EXPORT TQBuffer : public TQIODevice -{ -public: - TQBuffer(); - TQBuffer( TQByteArray ); - ~TQBuffer(); - - TQByteArray buffer() const; - bool setBuffer( TQByteArray ); - - bool open( int ); - void close(); - void flush(); - - Offset size() const; - Offset at() const; - bool at( Offset ); - - Q_LONG readBlock( char *p, Q_ULONG ); - Q_LONG writeBlock( const char *p, Q_ULONG ); - Q_LONG writeBlock( const TQByteArray& data ) - { return TQIODevice::writeBlock(data); } - Q_LONG readLine( char *p, Q_ULONG ); - - int getch(); - int putch( int ); - int ungetch( int ); - -protected: - TQByteArray a; - -private: - uint a_len; - uint a_inc; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQBuffer( const TQBuffer & ); - TQBuffer &operator=( const TQBuffer & ); -#endif -}; - - -inline TQByteArray TQBuffer::buffer() const -{ return a; } - -inline TQIODevice::Offset TQBuffer::size() const -{ return (Offset)a.size(); } - -inline TQIODevice::Offset TQBuffer::at() const -{ return ioIndex; } - - -#endif // TQBUFFER_H diff --git a/src/tools/qcache.h b/src/tools/qcache.h deleted file mode 100644 index 1ecbe2548..000000000 --- a/src/tools/qcache.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Definition of TQCache template class -** -** Created : 950209 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCACHE_H -#define TQCACHE_H - -#ifndef QT_H -#include "qgcache.h" -#endif // QT_H - -template -class TQCache -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGCache -#endif -{ -public: - TQCache( const TQCache &c ) : TQGCache(c) {} - TQCache( int maxCost=100, int size=17, bool caseSensitive=TRUE ) - : TQGCache( maxCost, size, StringKey, caseSensitive, FALSE ) {} - ~TQCache() { clear(); } - TQCache &operator=( const TQCache &c ) - { return (TQCache&)TQGCache::operator=(c); } - int maxCost() const { return TQGCache::maxCost(); } - int totalCost() const { return TQGCache::totalCost(); } - void setMaxCost( int m ) { TQGCache::setMaxCost(m); } - uint count() const { return TQGCache::count(); } - uint size() const { return TQGCache::size(); } - bool isEmpty() const { return TQGCache::count() == 0; } - void clear() { TQGCache::clear(); } - bool insert( const TQString &k, const type *d, int c=1, int p=0 ) - { return TQGCache::insert_string(k,(Item)d,c,p);} - bool remove( const TQString &k ) - { return TQGCache::remove_string(k); } - type *take( const TQString &k ) - { return (type *)TQGCache::take_string(k); } - type *find( const TQString &k, bool ref=TRUE ) const - { return (type *)TQGCache::find_string(k,ref);} - type *operator[]( const TQString &k ) const - { return (type *)TQGCache::find_string(k);} - void statistics() const { TQGCache::statistics(); } -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQCache::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQCache::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -template -class TQCacheIterator : public TQGCacheIterator -{ -public: - TQCacheIterator( const TQCache &c ):TQGCacheIterator((TQGCache &)c) {} - TQCacheIterator( const TQCacheIterator &ci) - : TQGCacheIterator( (TQGCacheIterator &)ci ) {} - TQCacheIterator &operator=(const TQCacheIterator&ci) - { return ( TQCacheIterator&)TQGCacheIterator::operator=( ci ); } - uint count() const { return TQGCacheIterator::count(); } - bool isEmpty() const { return TQGCacheIterator::count() == 0; } - bool atFirst() const { return TQGCacheIterator::atFirst(); } - bool atLast() const { return TQGCacheIterator::atLast(); } - type *toFirst() { return (type *)TQGCacheIterator::toFirst(); } - type *toLast() { return (type *)TQGCacheIterator::toLast(); } - operator type *() const { return (type *)TQGCacheIterator::get(); } - type *current() const { return (type *)TQGCacheIterator::get(); } - TQString currentKey() const{ return TQGCacheIterator::getKeyString(); } - type *operator()() { return (type *)TQGCacheIterator::operator()();} - type *operator++() { return (type *)TQGCacheIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGCacheIterator::operator+=(j);} - type *operator--() { return (type *)TQGCacheIterator::operator--(); } - type *operator-=(uint j) { return (type *)TQGCacheIterator::operator-=(j);} -}; - -#endif // TQCACHE_H diff --git a/src/tools/qcleanuphandler.h b/src/tools/qcleanuphandler.h deleted file mode 100644 index e90975fff..000000000 --- a/src/tools/qcleanuphandler.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** ... -** -** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCLEANUPHANDLER_H -#define TQCLEANUPHANDLER_H - -#ifndef QT_H -#include "qptrlist.h" -#endif // QT_H - -template -class TQCleanupHandler -{ -public: - TQCleanupHandler() : cleanupObjects( 0 ) {} - ~TQCleanupHandler() { clear(); } - - Type* add( Type **object ) { - if ( !cleanupObjects ) - cleanupObjects = new TQPtrList; - cleanupObjects->insert( 0, object ); - return *object; - } - - void remove( Type **object ) { - if ( !cleanupObjects ) - return; - if ( cleanupObjects->findRef( object ) >= 0 ) - (void) cleanupObjects->take(); - } - - bool isEmpty() const { - return cleanupObjects ? cleanupObjects->isEmpty() : TRUE; - } - - void clear() { - if ( !cleanupObjects ) - return; - TQPtrListIterator it( *cleanupObjects ); - Type **object; - while ( ( object = it.current() ) ) { - delete *object; - *object = 0; - cleanupObjects->remove( object ); - } - delete cleanupObjects; - cleanupObjects = 0; - } - -private: - TQPtrList *cleanupObjects; -}; - -template -class TQSingleCleanupHandler -{ -public: - TQSingleCleanupHandler() : object( 0 ) {} - ~TQSingleCleanupHandler() { - if ( object ) { - delete *object; - *object = 0; - } - } - Type* set( Type **o ) { - object = o; - return *object; - } - void reset() { object = 0; } -private: - Type **object; -}; - -template -class TQSharedCleanupHandler -{ -public: - TQSharedCleanupHandler() : object( 0 ) {} - ~TQSharedCleanupHandler() { - if ( object ) { - if ( (*object)->deref() ) - delete *object; - *object = 0; - } - } - Type* set( Type **o ) { - object = o; - return *object; - } - void reset() { object = 0; } -private: - Type **object; -}; - -#endif //TQCLEANUPHANDLER_H diff --git a/src/tools/qcom_p.h b/src/tools/qcom_p.h index 6992f94e8..0bf1f4aea 100644 --- a/src/tools/qcom_p.h +++ b/src/tools/qcom_p.h @@ -52,8 +52,8 @@ // #ifndef QT_H -#include "qstringlist.h" -#include "quuid.h" +#include "ntqstringlist.h" +#include "ntquuid.h" #endif // QT_H #if __GNUC__ - 0 > 3 @@ -289,7 +289,7 @@ public: \ #endif #endif -// this is duplicated at Q_PLUGIN_VERIFICATION_DATA in qgplugin.h +// this is duplicated at Q_PLUGIN_VERIFICATION_DATA in ntqgplugin.h // NOTE: if you change pattern, you MUST change the pattern in // qcomlibrary.cpp as well. changing the pattern will break all // backwards compatibility as well (no old plugins will be loaded). diff --git a/src/tools/qcomlibrary.cpp b/src/tools/qcomlibrary.cpp index 08287bcf3..c6d22e2e8 100644 --- a/src/tools/qcomlibrary.cpp +++ b/src/tools/qcomlibrary.cpp @@ -39,11 +39,11 @@ #include "qcomlibrary_p.h" #ifndef QT_NO_COMPONENT -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifndef NO_ERRNO_H #include #endif // NO_ERROR_H diff --git a/src/tools/qcomlibrary_p.h b/src/tools/qcomlibrary_p.h index b2cfbe743..201ca476d 100644 --- a/src/tools/qcomlibrary_p.h +++ b/src/tools/qcomlibrary_p.h @@ -53,7 +53,7 @@ #ifndef QT_H #include "qcom_p.h" -#include "qlibrary.h" +#include "ntqlibrary.h" #endif // QT_H #ifndef QT_NO_COMPONENT diff --git a/src/tools/qcomponentfactory.cpp b/src/tools/qcomponentfactory.cpp index c02e9f064..9109cc5b2 100644 --- a/src/tools/qcomponentfactory.cpp +++ b/src/tools/qcomponentfactory.cpp @@ -41,10 +41,10 @@ #include "qcomponentfactory_p.h" #ifndef QT_NO_COMPONENT -#include "qsettings.h" +#include "ntqsettings.h" #include -#include "qdir.h" -#include "qapplication.h" +#include "ntqdir.h" +#include "ntqapplication.h" /*! \class TQComponentFactory qcomponentfactory.h diff --git a/src/tools/qcstring.cpp b/src/tools/qcstring.cpp index ac7fa4750..60e698f34 100644 --- a/src/tools/qcstring.cpp +++ b/src/tools/qcstring.cpp @@ -39,9 +39,9 @@ ** **********************************************************************/ -#include "qstring.h" -#include "qregexp.h" -#include "qdatastream.h" +#include "ntqstring.h" +#include "ntqregexp.h" +#include "ntqdatastream.h" #ifdef QT_THREAD_SUPPORT # include @@ -568,7 +568,7 @@ TQDataStream &operator>>( TQDataStream &s, TQByteArray &a ) *****************************************************************************/ /*! - \class TQCString qcstring.h + \class TQCString ntqcstring.h \reentrant \brief The TQCString class provides an abstraction of the classic C zero-terminated char array (char *). diff --git a/src/tools/qcstring.h b/src/tools/qcstring.h deleted file mode 100644 index 96eb9f801..000000000 --- a/src/tools/qcstring.h +++ /dev/null @@ -1,396 +0,0 @@ -/**************************************************************************** -** -** Definition of the extended char array operations, -** and TQByteArray and TQCString classes -** -** Created : 920609 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCSTRING_H -#define TQCSTRING_H - -#ifndef QT_H -#include "qmemarray.h" -#endif // QT_H - -#include - - -/***************************************************************************** - Safe and portable C string functions; extensions to standard string.h - *****************************************************************************/ - -Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); - -Q_EXPORT char *qstrdup( const char * ); - -Q_EXPORT inline uint qstrlen( const char *str ) -{ return str ? (uint)strlen(str) : 0u; } - -Q_EXPORT inline char *qstrcpy( char *dst, const char *src ) -{ return src ? strcpy(dst, src) : 0; } - -Q_EXPORT char *qstrncpy( char *dst, const char *src, uint len ); - -Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 ) -{ - return ( str1 && str2 ) ? strcmp( str1, str2 ) - : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); -} - -Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len ) -{ - return ( str1 && str2 ) ? strncmp( str1, str2, len ) - : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); -} - -Q_EXPORT int qstricmp( const char *, const char * ); - -Q_EXPORT int qstrnicmp( const char *, const char *, uint len ); - -#ifndef QT_CLEAN_NAMESPACE -Q_EXPORT inline uint cstrlen( const char *str ) -{ return (uint)strlen(str); } - -Q_EXPORT inline char *cstrcpy( char *dst, const char *src ) -{ return strcpy(dst,src); } - -Q_EXPORT inline int cstrcmp( const char *str1, const char *str2 ) -{ return strcmp(str1,str2); } - -Q_EXPORT inline int cstrncmp( const char *str1, const char *str2, uint len ) -{ return strncmp(str1,str2,len); } -#endif - - -// qChecksum: Internet checksum - -Q_EXPORT Q_UINT16 qChecksum( const char *s, uint len ); - -/***************************************************************************** - TQByteArray class - *****************************************************************************/ - -#if defined(Q_QDOC) -/* - We want qdoc to document TQByteArray as a real class that inherits - TQMemArray and that is inherited by TQBitArray. -*/ -class TQByteArray : public TQMemArray -{ -public: - TQByteArray(); - TQByteArray( int size ); -}; -#else -typedef TQMemArray TQByteArray; -#endif - -#ifndef QT_NO_COMPRESS -Q_EXPORT TQByteArray qCompress( const uchar* data, int nbytes ); -Q_EXPORT TQByteArray qUncompress( const uchar* data, int nbytes ); -Q_EXPORT inline TQByteArray qCompress( const TQByteArray& data) -{ return qCompress( (const uchar*)data.data(), data.size() ); } -Q_EXPORT inline TQByteArray qUncompress( const TQByteArray& data ) -{ return qUncompress( (const uchar*)data.data(), data.size() ); } -#endif - -/***************************************************************************** - TQByteArray stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQByteArray & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQByteArray & ); -#endif - -/***************************************************************************** - TQCString class - *****************************************************************************/ - -class TQRegExp; - -class Q_EXPORT TQCString : public TQByteArray // C string class -{ -public: - TQCString() {} // make null string - TQCString( int size ); // allocate size incl. \0 - TQCString( const TQCString &s ) : TQByteArray( s ) {} - TQCString( const char *str ); // deep copy - TQCString( const char *str, uint maxlen ); // deep copy, max length - ~TQCString(); - - TQCString &operator=( const TQCString &s );// shallow copy - TQCString &operator=( const char *str ); // deep copy - - bool isNull() const; - bool isEmpty() const; - uint length() const; - bool resize( uint newlen ); - bool truncate( uint pos ); - bool fill( char c, int len = -1 ); - - TQCString copy() const; - - TQCString &sprintf( const char *format, ... ) -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 2, 3))) -#endif - ; - - int find( char c, int index=0, bool cs=TRUE ) const; - int find( const char *str, int index=0, bool cs=TRUE ) const; -#ifndef QT_NO_REGEXP - int find( const TQRegExp &, int index=0 ) const; -#endif - int findRev( char c, int index=-1, bool cs=TRUE) const; - int findRev( const char *str, int index=-1, bool cs=TRUE) const; -#ifndef QT_NO_REGEXP_CAPTURE - int findRev( const TQRegExp &, int index=-1 ) const; -#endif - int contains( char c, bool cs=TRUE ) const; - int contains( const char *str, bool cs=TRUE ) const; -#ifndef QT_NO_REGEXP - int contains( const TQRegExp & ) const; -#endif - TQCString left( uint len ) const; - TQCString right( uint len ) const; - TQCString mid( uint index, uint len=0xffffffff) const; - - TQCString leftJustify( uint width, char fill=' ', bool trunc=FALSE)const; - TQCString rightJustify( uint width, char fill=' ',bool trunc=FALSE)const; - - TQCString lower() const; - TQCString upper() const; - - TQCString stripWhiteSpace() const; - TQCString simplifyWhiteSpace() const; - - TQCString &insert( uint index, const char * ); - TQCString &insert( uint index, char ); - TQCString &append( const char * ); - TQCString &prepend( const char * ); - TQCString &remove( uint index, uint len ); - TQCString &replace( uint index, uint len, const char * ); -#ifndef QT_NO_REGEXP - TQCString &replace( const TQRegExp &, const char * ); -#endif - TQCString &replace( char c, const char *after ); - TQCString &replace( const char *, const char * ); - TQCString &replace( char, char ); - - short toShort( bool *ok=0 ) const; - ushort toUShort( bool *ok=0 ) const; - int toInt( bool *ok=0 ) const; - uint toUInt( bool *ok=0 ) const; - long toLong( bool *ok=0 ) const; - ulong toULong( bool *ok=0 ) const; - float toFloat( bool *ok=0 ) const; - double toDouble( bool *ok=0 ) const; - - TQCString &setStr( const char *s ); - TQCString &setNum( short ); - TQCString &setNum( ushort ); - TQCString &setNum( int ); - TQCString &setNum( uint ); - TQCString &setNum( long ); - TQCString &setNum( ulong ); - TQCString &setNum( float, char f='g', int prec=6 ); - TQCString &setNum( double, char f='g', int prec=6 ); - - bool setExpand( uint index, char c ); - - operator const char *() const; - TQCString &operator+=( const char *str ); - TQCString &operator+=( char c ); -private: - int find( const char *str, int index, bool cs, uint l ) const; -}; - - -/***************************************************************************** - TQCString stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQCString & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQCString & ); -#endif - -/***************************************************************************** - TQCString inline functions - *****************************************************************************/ - -inline TQCString &TQCString::operator=( const TQCString &s ) -{ return (TQCString&)assign( s ); } - -inline TQCString &TQCString::operator=( const char *str ) -{ return (TQCString&)duplicate( str, qstrlen(str)+1 ); } - -inline bool TQCString::isNull() const -{ return data() == 0; } - -inline bool TQCString::isEmpty() const -{ return data() == 0 || *data() == '\0'; } - -inline uint TQCString::length() const -{ return qstrlen( data() ); } - -inline bool TQCString::truncate( uint pos ) -{ return resize(pos+1); } - -inline TQCString TQCString::copy() const -{ return TQCString( data() ); } - -inline TQCString &TQCString::prepend( const char *s ) -{ return insert(0,s); } - -inline TQCString &TQCString::append( const char *s ) -{ return operator+=(s); } - -inline TQCString &TQCString::setNum( short n ) -{ return setNum((long)n); } - -inline TQCString &TQCString::setNum( ushort n ) -{ return setNum((ulong)n); } - -inline TQCString &TQCString::setNum( int n ) -{ return setNum((long)n); } - -inline TQCString &TQCString::setNum( uint n ) -{ return setNum((ulong)n); } - -inline TQCString &TQCString::setNum( float n, char f, int prec ) -{ return setNum((double)n,f,prec); } - -inline TQCString::operator const char *() const -{ return (const char *)data(); } - - -/***************************************************************************** - TQCString non-member operators - *****************************************************************************/ - -Q_EXPORT inline bool operator==( const TQCString &s1, const TQCString &s2 ) -{ return qstrcmp( s1.data(), s2.data() ) == 0; } - -Q_EXPORT inline bool operator==( const TQCString &s1, const char *s2 ) -{ return qstrcmp( s1.data(), s2 ) == 0; } - -Q_EXPORT inline bool operator==( const char *s1, const TQCString &s2 ) -{ return qstrcmp( s1, s2.data() ) == 0; } - -Q_EXPORT inline bool operator!=( const TQCString &s1, const TQCString &s2 ) -{ return qstrcmp( s1.data(), s2.data() ) != 0; } - -Q_EXPORT inline bool operator!=( const TQCString &s1, const char *s2 ) -{ return qstrcmp( s1.data(), s2 ) != 0; } - -Q_EXPORT inline bool operator!=( const char *s1, const TQCString &s2 ) -{ return qstrcmp( s1, s2.data() ) != 0; } - -Q_EXPORT inline bool operator<( const TQCString &s1, const TQCString& s2 ) -{ return qstrcmp( s1.data(), s2.data() ) < 0; } - -Q_EXPORT inline bool operator<( const TQCString &s1, const char *s2 ) -{ return qstrcmp( s1.data(), s2 ) < 0; } - -Q_EXPORT inline bool operator<( const char *s1, const TQCString &s2 ) -{ return qstrcmp( s1, s2.data() ) < 0; } - -Q_EXPORT inline bool operator<=( const TQCString &s1, const TQCString &s2 ) -{ return qstrcmp( s1.data(), s2.data() ) <= 0; } - -Q_EXPORT inline bool operator<=( const TQCString &s1, const char *s2 ) -{ return qstrcmp( s1.data(), s2 ) <= 0; } - -Q_EXPORT inline bool operator<=( const char *s1, const TQCString &s2 ) -{ return qstrcmp( s1, s2.data() ) <= 0; } - -Q_EXPORT inline bool operator>( const TQCString &s1, const TQCString &s2 ) -{ return qstrcmp( s1.data(), s2.data() ) > 0; } - -Q_EXPORT inline bool operator>( const TQCString &s1, const char *s2 ) -{ return qstrcmp( s1.data(), s2 ) > 0; } - -Q_EXPORT inline bool operator>( const char *s1, const TQCString &s2 ) -{ return qstrcmp( s1, s2.data() ) > 0; } - -Q_EXPORT inline bool operator>=( const TQCString &s1, const TQCString& s2 ) -{ return qstrcmp( s1.data(), s2.data() ) >= 0; } - -Q_EXPORT inline bool operator>=( const TQCString &s1, const char *s2 ) -{ return qstrcmp( s1.data(), s2 ) >= 0; } - -Q_EXPORT inline bool operator>=( const char *s1, const TQCString &s2 ) -{ return qstrcmp( s1, s2.data() ) >= 0; } - -Q_EXPORT inline const TQCString operator+( const TQCString &s1, - const TQCString &s2 ) -{ - TQCString tmp( s1.data() ); - tmp += s2; - return tmp; -} - -Q_EXPORT inline const TQCString operator+( const TQCString &s1, const char *s2 ) -{ - TQCString tmp( s1.data() ); - tmp += s2; - return tmp; -} - -Q_EXPORT inline const TQCString operator+( const char *s1, const TQCString &s2 ) -{ - TQCString tmp( s1 ); - tmp += s2; - return tmp; -} - -Q_EXPORT inline const TQCString operator+( const TQCString &s1, char c2 ) -{ - TQCString tmp( s1.data() ); - tmp += c2; - return tmp; -} - -Q_EXPORT inline const TQCString operator+( char c1, const TQCString &s2 ) -{ - TQCString tmp; - tmp += c1; - tmp += s2; - return tmp; -} -#include "qwinexport.h" -#endif // TQCSTRING_H diff --git a/src/tools/qdatastream.cpp b/src/tools/qdatastream.cpp index 329bf8f25..3359d68bc 100644 --- a/src/tools/qdatastream.cpp +++ b/src/tools/qdatastream.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qdatastream.h" +#include "ntqdatastream.h" #ifndef QT_NO_DATASTREAM -#include "qbuffer.h" +#include "ntqbuffer.h" #include #include #include @@ -52,7 +52,7 @@ #endif /*! - \class TQDataStream qdatastream.h + \class TQDataStream ntqdatastream.h \reentrant \brief The TQDataStream class provides serialization of binary data to a TQIODevice. diff --git a/src/tools/qdatastream.h b/src/tools/qdatastream.h deleted file mode 100644 index c531b6cf5..000000000 --- a/src/tools/qdatastream.h +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDataStream class -** -** Created : 930831 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDATASTREAM_H -#define TQDATASTREAM_H - -#ifndef QT_H -#include "qiodevice.h" -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_DATASTREAM -class Q_EXPORT TQDataStream // data stream class -{ -public: - TQDataStream(); - TQDataStream( TQIODevice * ); - TQDataStream( TQByteArray, int mode ); - virtual ~TQDataStream(); - - 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 ); - - TQDataStream &operator>>( Q_INT8 &i ); - TQDataStream &operator>>( Q_UINT8 &i ); - TQDataStream &operator>>( Q_INT16 &i ); - TQDataStream &operator>>( Q_UINT16 &i ); - TQDataStream &operator>>( Q_INT32 &i ); - TQDataStream &operator>>( Q_UINT32 &i ); - TQDataStream &operator>>( Q_INT64 &i ); - TQDataStream &operator>>( Q_UINT64 &i ); -#if !defined(Q_OS_WIN64) - TQDataStream &operator>>( Q_LONG &i ); - TQDataStream &operator>>( Q_ULONG &i ); -#endif - - TQDataStream &operator>>( float &f ); - TQDataStream &operator>>( double &f ); - TQDataStream &operator>>( char *&str ); - - TQDataStream &operator<<( Q_INT8 i ); - TQDataStream &operator<<( Q_UINT8 i ); - TQDataStream &operator<<( Q_INT16 i ); - TQDataStream &operator<<( Q_UINT16 i ); - TQDataStream &operator<<( Q_INT32 i ); - TQDataStream &operator<<( Q_UINT32 i ); - TQDataStream &operator<<( Q_INT64 i ); - TQDataStream &operator<<( Q_UINT64 i ); -#if !defined(Q_OS_WIN64) - TQDataStream &operator<<( Q_LONG i ); - TQDataStream &operator<<( Q_ULONG i ); -#endif - TQDataStream &operator<<( float f ); - TQDataStream &operator<<( double f ); - TQDataStream &operator<<( const char *str ); - - TQDataStream &readBytes( char *&, uint &len ); - TQDataStream &readRawBytes( char *, uint len ); - - TQDataStream &writeBytes( const char *, uint len ); - TQDataStream &writeRawBytes( const char *, uint len ); - -private: - TQIODevice *dev; - bool owndev; - int byteorder; - bool printable; - bool noswap; - int ver; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQDataStream( const TQDataStream & ); - TQDataStream &operator=( const TQDataStream & ); -#endif -}; - - -/***************************************************************************** - TQDataStream inline functions - *****************************************************************************/ - -inline TQIODevice *TQDataStream::device() const -{ return dev; } - -inline bool TQDataStream::atEnd() const -{ return dev ? dev->atEnd() : TRUE; } - -inline bool TQDataStream::eof() const -{ return atEnd(); } - -inline int TQDataStream::byteOrder() const -{ return byteorder; } - -inline bool TQDataStream::isPrintableData() const -{ return printable; } - -inline void TQDataStream::setPrintableData( bool p ) -{ printable = p; } - -inline int TQDataStream::version() const -{ return ver; } - -inline void TQDataStream::setVersion( int v ) -{ ver = v; } - -inline TQDataStream &TQDataStream::operator>>( Q_UINT8 &i ) -{ return *this >> (Q_INT8&)i; } - -inline TQDataStream &TQDataStream::operator>>( Q_UINT16 &i ) -{ return *this >> (Q_INT16&)i; } - -inline TQDataStream &TQDataStream::operator>>( Q_UINT32 &i ) -{ return *this >> (Q_INT32&)i; } - -inline TQDataStream &TQDataStream::operator>>( Q_UINT64 &i ) -{ return *this >> (Q_INT64&)i; } - -#if !defined(Q_OS_WIN64) -inline TQDataStream &TQDataStream::operator>>( Q_ULONG &i ) -{ return *this >> (Q_LONG&)i; } -#endif - -inline TQDataStream &TQDataStream::operator<<( Q_UINT8 i ) -{ return *this << (Q_INT8)i; } - -inline TQDataStream &TQDataStream::operator<<( Q_UINT16 i ) -{ return *this << (Q_INT16)i; } - -inline TQDataStream &TQDataStream::operator<<( Q_UINT32 i ) -{ return *this << (Q_INT32)i; } - -inline TQDataStream &TQDataStream::operator<<( Q_UINT64 i ) -{ return *this << (Q_INT64)i; } - -#if !defined(Q_OS_WIN64) -inline TQDataStream &TQDataStream::operator<<( Q_ULONG i ) -{ return *this << (Q_LONG)i; } -#endif - -#endif // QT_NO_DATASTREAM -#endif // TQDATASTREAM_H diff --git a/src/tools/qdatetime.cpp b/src/tools/qdatetime.cpp index c9e34ddba..d1358cc87 100644 --- a/src/tools/qdatetime.cpp +++ b/src/tools/qdatetime.cpp @@ -40,9 +40,9 @@ #include "qplatformdefs.h" -#include "qdatetime.h" -#include "qdatastream.h" -#include "qregexp.h" +#include "ntqdatetime.h" +#include "ntqdatastream.h" +#include "ntqregexp.h" #include #ifndef Q_OS_TEMP @@ -202,7 +202,7 @@ static TQString fmtDateTime( const TQString& f, const TQTime* dt = 0, const TQDa *****************************************************************************/ /*! - \class TQDate qdatetime.h + \class TQDate ntqdatetime.h \reentrant \brief The TQDate class provides date functions. @@ -1240,7 +1240,7 @@ void TQDate::julianToGregorian( uint jd, int &y, int &m, int &d ) *****************************************************************************/ /*! - \class TQTime qdatetime.h + \class TQTime ntqdatetime.h \reentrant \brief The TQTime class provides clock time functions. @@ -1862,7 +1862,7 @@ int TQTime::elapsed() const *****************************************************************************/ /*! - \class TQDateTime qdatetime.h + \class TQDateTime ntqdatetime.h \reentrant \brief The TQDateTime class provides date and time functions. diff --git a/src/tools/qdatetime.h b/src/tools/qdatetime.h deleted file mode 100644 index 9a5b858cc..000000000 --- a/src/tools/qdatetime.h +++ /dev/null @@ -1,253 +0,0 @@ -/************************************************************************* -** -** Definition of date and time classes -** -** Created : 940124 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDATETIME_H -#define TQDATETIME_H - -#ifndef QT_H -#include "qstring.h" -#include "qnamespace.h" -#endif // QT_H - - -/***************************************************************************** - TQDate class - *****************************************************************************/ - -class Q_EXPORT TQDate -{ -public: - TQDate() { jd = 0; } - TQDate( int y, int m, int d ); - - bool isNull() const { return jd == 0; } - 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 *yearNum = 0 ) const; - -#ifndef QT_NO_TEXTDATE -#ifndef QT_NO_COMPAT - static TQString monthName( int month ) { return shortMonthName( month ); } - static TQString dayName( int weekday ) { return shortDayName( weekday ); } -#endif - static TQString shortMonthName( int month ); - static TQString shortDayName( int weekday ); - static TQString longMonthName( int month ); - static TQString longDayName( int weekday ); -#endif //QT_NO_TEXTDATE -#ifndef QT_NO_TEXTSTRING -#if !defined(QT_NO_SPRINTF) - TQString toString( TQt::DateFormat f = TQt::TextDate ) const; -#endif - TQString toString( const TQString& format ) const; -#endif - bool setYMD( int y, int m, int d ); - - TQDate addDays( int days ) const; - TQDate addMonths( int months ) const; - TQDate addYears( int years ) const; - int daysTo( const TQDate & ) const; - - bool operator==( const TQDate &d ) const { return jd == d.jd; } - bool operator!=( const TQDate &d ) const { return jd != d.jd; } - bool operator<( const TQDate &d ) const { return jd < d.jd; } - bool operator<=( const TQDate &d ) const { return jd <= d.jd; } - bool operator>( const TQDate &d ) const { return jd > d.jd; } - bool operator>=( const TQDate &d ) const { return jd >= d.jd; } - - static TQDate currentDate(); - static TQDate currentDate( TQt::TimeSpec ); -#ifndef QT_NO_DATESTRING - static TQDate fromString( const TQString& s, TQt::DateFormat f = TQt::TextDate ); -#endif - static bool isValid( int y, int m, int d ); - static bool leapYear( int year ); - - static uint gregorianToJulian( int y, int m, int d ); - static void julianToGregorian( uint jd, int &y, int &m, int &d ); -private: - uint jd; - friend class TQDateTime; -#ifndef QT_NO_DATASTREAM - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDate & ); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDate & ); -#endif -}; - - -/***************************************************************************** - TQTime class - *****************************************************************************/ - -class Q_EXPORT TQTime -{ -public: - TQTime() { ds=0; } // set null time - TQTime( int h, int m, int s=0, int ms=0 ); // set time - - bool isNull() const { return ds == 0; } - bool isValid() const; // valid time - - int hour() const; // 0..23 - int minute() const; // 0..59 - int second() const; // 0..59 - int msec() const; // 0..999 -#ifndef QT_NO_DATESTRING -#ifndef QT_NO_SPRINTF - TQString toString( TQt::DateFormat f = TQt::TextDate ) const; -#endif - TQString toString( const TQString& format ) const; -#endif - bool setHMS( int h, int m, int s, int ms=0 ); - - TQTime addSecs( int secs ) const; - int secsTo( const TQTime & ) const; - TQTime addMSecs( int ms ) const; - int msecsTo( const TQTime & ) const; - - bool operator==( const TQTime &d ) const { return ds == d.ds; } - bool operator!=( const TQTime &d ) const { return ds != d.ds; } - bool operator<( const TQTime &d ) const { return ds < d.ds; } - bool operator<=( const TQTime &d ) const { return ds <= d.ds; } - bool operator>( const TQTime &d ) const { return ds > d.ds; } - bool operator>=( const TQTime &d ) const { return ds >= d.ds; } - - static TQTime currentTime(); - static TQTime currentTime( TQt::TimeSpec ); -#ifndef QT_NO_DATESTRING - static TQTime fromString( const TQString& s, TQt::DateFormat f = TQt::TextDate ); -#endif - static bool isValid( int h, int m, int s, int ms=0 ); - - void start(); - int restart(); - int elapsed() const; - -private: - static bool currentTime( TQTime * ); - static bool currentTime( TQTime *, TQt::TimeSpec ); - - uint ds; - friend class TQDateTime; -#ifndef QT_NO_DATASTREAM - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQTime & ); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQTime & ); -#endif -}; - - -/***************************************************************************** - TQDateTime class - *****************************************************************************/ - -class Q_EXPORT TQDateTime -{ -public: - TQDateTime() {} // set null date and null time - TQDateTime( const TQDate & ); - TQDateTime( const TQDate &, const TQTime & ); - - bool isNull() const { return d.isNull() && t.isNull(); } - bool isValid() const { return d.isValid() && t.isValid(); } - - TQDate date() const { return d; } - TQTime time() const { return t; } - uint toTime_t() const; - void setDate( const TQDate &date ) { d = date; } - void setTime( const TQTime &time ) { t = time; } - void setTime_t( uint secsSince1Jan1970UTC ); - void setTime_t( uint secsSince1Jan1970UTC, TQt::TimeSpec ); -#ifndef QT_NO_DATESTRING -#ifndef QT_NO_SPRINTF - TQString toString( TQt::DateFormat f = TQt::TextDate ) const; -#endif - TQString toString( const TQString& format ) const; -#endif - TQDateTime addDays( int days ) const; - TQDateTime addMonths( int months ) const; - TQDateTime addYears( int years ) const; - TQDateTime addSecs( int secs ) const; - int daysTo( const TQDateTime & ) const; - int secsTo( const TQDateTime & ) const; - - bool operator==( const TQDateTime &dt ) const; - bool operator!=( const TQDateTime &dt ) const; - bool operator<( const TQDateTime &dt ) const; - bool operator<=( const TQDateTime &dt ) const; - bool operator>( const TQDateTime &dt ) const; - bool operator>=( const TQDateTime &dt ) const; - - static TQDateTime currentDateTime(); - static TQDateTime currentDateTime( TQt::TimeSpec ); -#ifndef QT_NO_DATESTRING - static TQDateTime fromString( const TQString& s, TQt::DateFormat f = TQt::TextDate ); -#endif -private: - TQDate d; - TQTime t; -#ifndef QT_NO_DATASTREAM - friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDateTime &); - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDateTime & ); -#endif -}; - - -/***************************************************************************** - Date and time stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDate & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDate & ); -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQTime & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQTime & ); -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQDateTime & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQDateTime & ); -#endif // QT_NO_DATASTREAM - -#endif // TQDATETIME_H - diff --git a/src/tools/qdeepcopy.cpp b/src/tools/qdeepcopy.cpp index 9c57adfe5..ea23fa639 100644 --- a/src/tools/qdeepcopy.cpp +++ b/src/tools/qdeepcopy.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qdeepcopy.h" +#include "ntqdeepcopy.h" /*! - \class TQDeepCopy qdeepcopy.h + \class TQDeepCopy ntqdeepcopy.h \brief The TQDeepCopy class is a template class which ensures that implicitly shared and explicitly shared classes reference unique data. diff --git a/src/tools/qdeepcopy.h b/src/tools/qdeepcopy.h deleted file mode 100644 index fe8a5ddde..000000000 --- a/src/tools/qdeepcopy.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDeepCopy class -** -** Created : 20020613 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDEEPCOPY_H -#define TQDEEPCOPY_H - -#ifndef QT_H -# include "qglobal.h" -#endif // QT_H - -template -class TQDeepCopy -{ -public: - inline TQDeepCopy() - { - } - - inline TQDeepCopy( const T &t ) - : deepcopy( t ) - { - deepcopy.detach(); - } - - inline TQDeepCopy &operator=( const T &t ) - { - deepcopy = t; - deepcopy.detach(); - return *this; - } - - inline operator T () - { - T tmp = deepcopy; - tmp.detach(); - return tmp; - } - -private: - T deepcopy; -}; - -#endif // TQDEEPCOPY_H diff --git a/src/tools/qdict.h b/src/tools/qdict.h deleted file mode 100644 index dc3b2fdcb..000000000 --- a/src/tools/qdict.h +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDict template class -** -** Created : 920821 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDICT_H -#define TQDICT_H - -#ifndef QT_H -#include "qgdict.h" -#endif // QT_H - -template -class TQDict -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGDict -#endif -{ -public: - TQDict( int size = 17, bool caseSensitive = TRUE ) - : TQGDict( size, StringKey, caseSensitive, FALSE ) { } - TQDict( const TQDict &d ) : TQGDict( d ) { } - ~TQDict() { clear(); } - TQDict &operator=(const TQDict &d) - { return (TQDict&)TQGDict::operator=(d); } - uint count() const { return TQGDict::count(); } - uint size() const { return TQGDict::size(); } - bool isEmpty() const { return TQGDict::count() == 0; } - - void insert( const TQString &k, const type *d ) - { TQGDict::look_string(k,(Item)d,1); } - void replace( const TQString &k, const type *d ) - { TQGDict::look_string(k,(Item)d,2); } - bool remove( const TQString &k ) { return TQGDict::remove_string(k); } - type *take( const TQString &k ) { return (type *)TQGDict::take_string(k); } - type *find( const TQString &k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_string(k,0,0); } - type *operator[]( const TQString &k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_string(k,0,0); } - - void clear() { TQGDict::clear(); } - void resize( uint n ) { TQGDict::resize(n); } - void statistics() const { TQGDict::statistics(); } - -#ifdef Q_QDOC -protected: - virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); - virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQDict::deleteItem( Item ) -{ -} -#endif - -template inline void TQDict::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -template -class TQDictIterator : public TQGDictIterator -{ -public: - TQDictIterator(const TQDict &d) : TQGDictIterator((TQGDict &)d) { } - ~TQDictIterator() {} - uint count() const { return dict->count(); } - bool isEmpty() const { return dict->count() == 0; } - type *toFirst() { return (type *)TQGDictIterator::toFirst(); } - operator type *() const { return (type *)TQGDictIterator::get(); } - type *operator*() { return (type *)TQGDictIterator::get(); } - type *current() const { return (type *)TQGDictIterator::get(); } - TQString currentKey() const{ return TQGDictIterator::getKeyString(); } - type *operator()() { return (type *)TQGDictIterator::operator()(); } - type *operator++() { return (type *)TQGDictIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j); } -}; - -#define Q_DEFINED_QDICT -#include "qwinexport.h" -#endif // TQDICT_H diff --git a/src/tools/qdir.cpp b/src/tools/qdir.cpp index 48f2d5b39..17b748510 100644 --- a/src/tools/qdir.cpp +++ b/src/tools/qdir.cpp @@ -39,14 +39,14 @@ **********************************************************************/ #include "qplatformdefs.h" -#include "qdir.h" +#include "ntqdir.h" #ifndef QT_NO_DIR #include -#include "qfileinfo.h" -#include "qregexp.h" -#include "qstringlist.h" -#include "qdeepcopy.h" +#include "ntqfileinfo.h" +#include "ntqregexp.h" +#include "ntqstringlist.h" +#include "ntqdeepcopy.h" #include #if defined(Q_FS_FAT) && !defined(Q_OS_UNIX) @@ -151,7 +151,7 @@ const bool CaseSensitiveFS = TRUE; (excluding symbolic links), sorted by size, smallest first: \code #include - #include + #include int main( int argc, char **argv ) { @@ -561,7 +561,7 @@ bool TQDir::cdUp() nameFilter. The \a nameFilter is a wildcard (globbing) filter that understands - "*" and "?" wildcards. (See \link qregexp.html#wildcard-matching + "*" and "?" wildcards. (See \link ntqregexp.html#wildcard-matching TQRegExp wildcard matching\endlink.) You may specify several filter entries all separated by a single space " " or by a semi-colon ";". @@ -1198,7 +1198,7 @@ bool qt_matchFilterList( const TQValueList& filters, Returns TRUE if the \a fileName matches any of the wildcard (glob) patterns in the list of \a filters; otherwise returns FALSE. - (See \link qregexp.html#wildcard-matching TQRegExp wildcard + (See \link ntqregexp.html#wildcard-matching TQRegExp wildcard matching.\endlink) \sa TQRegExp::match() */ @@ -1220,7 +1220,7 @@ bool TQDir::match( const TQStringList &filters, const TQString &fileName ) pattern \a filter; otherwise returns FALSE. The \a filter may contain multiple patterns separated by spaces or semicolons. - (See \link qregexp.html#wildcard-matching TQRegExp wildcard + (See \link ntqregexp.html#wildcard-matching TQRegExp wildcard matching.\endlink) \sa TQRegExp::match() */ diff --git a/src/tools/qdir.h b/src/tools/qdir.h deleted file mode 100644 index c178ca49f..000000000 --- a/src/tools/qdir.h +++ /dev/null @@ -1,250 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDir class -** -** Created : 950427 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDIR_H -#define TQDIR_H - -#ifndef QT_H -#include "qglobal.h" -#include "qstrlist.h" -#include "qfileinfo.h" -#endif // QT_H - - -#ifndef QT_NO_DIR -typedef TQPtrList TQFileInfoList; -typedef TQPtrListIterator TQFileInfoListIterator; -class TQStringList; -template class TQDeepCopy; - - -class Q_EXPORT TQDir -{ -public: - enum FilterSpec { Dirs = 0x001, - Files = 0x002, - Drives = 0x004, - NoSymLinks = 0x008, - All = 0x007, - TypeMask = 0x00F, - - Readable = 0x010, - Writable = 0x020, - Executable = 0x040, - RWEMask = 0x070, - - Modified = 0x080, - Hidden = 0x100, - System = 0x200, - AccessMask = 0x3F0, - - DefaultFilter = -1 }; - - enum SortSpec { Name = 0x00, - Time = 0x01, - Size = 0x02, - Unsorted = 0x03, - SortByMask = 0x03, - - DirsFirst = 0x04, - Reversed = 0x08, - IgnoreCase = 0x10, - LocaleAware = 0x20, - DefaultSort = -1 }; - - TQDir(); - TQDir( const TQString &path, const TQString &nameFilter = TQString::null, - int sortSpec = Name | IgnoreCase, int filterSpec = All ); - TQDir( const TQDir & ); - - virtual ~TQDir(); - - TQDir &operator=( const TQDir & ); - TQDir &operator=( const TQString &path ); - - virtual void setPath( const TQString &path ); - virtual TQString path() const; - virtual TQString absPath() const; - virtual TQString canonicalPath() const; - - virtual TQString dirName() const; - virtual TQString filePath( const TQString &fileName, - bool acceptAbsPath = TRUE ) const; - virtual TQString absFilePath( const TQString &fileName, - bool acceptAbsPath = TRUE ) const; - - static TQString convertSeparators( const TQString &pathName ); - - virtual bool cd( const TQString &dirName, bool acceptAbsPath = TRUE ); - virtual bool cdUp(); - - TQString nameFilter() const; - virtual void setNameFilter( const TQString &nameFilter ); - FilterSpec filter() const; - virtual void setFilter( int filterSpec ); - SortSpec sorting() const; - virtual void setSorting( int sortSpec ); - - bool matchAllDirs() const; - virtual void setMatchAllDirs( bool ); - - uint count() const; - TQString operator[]( int ) const; - - virtual TQStrList encodedEntryList( int filterSpec = DefaultFilter, - int sortSpec = DefaultSort ) const; - virtual TQStrList encodedEntryList( const TQString &nameFilter, - int filterSpec = DefaultFilter, - int sortSpec = DefaultSort ) const; - virtual TQStringList entryList( int filterSpec = DefaultFilter, - int sortSpec = DefaultSort ) const; - virtual TQStringList entryList( const TQString &nameFilter, - int filterSpec = DefaultFilter, - int sortSpec = DefaultSort ) const; - - virtual const TQFileInfoList *entryInfoList( int filterSpec = DefaultFilter, - int sortSpec = DefaultSort ) const; - virtual const TQFileInfoList *entryInfoList( const TQString &nameFilter, - int filterSpec = DefaultFilter, - int sortSpec = DefaultSort ) const; - - static const TQFileInfoList *drives(); - - virtual bool mkdir( const TQString &dirName, - bool acceptAbsPath = TRUE ) const; - virtual bool rmdir( const TQString &dirName, - bool acceptAbsPath = TRUE ) const; - - virtual bool isReadable() const; - virtual bool exists() const; - virtual bool isRoot() const; - - virtual bool isRelative() const; - virtual void convertToAbs(); - - virtual bool operator==( const TQDir & ) const; - virtual bool operator!=( const TQDir & ) const; - - virtual bool remove( const TQString &fileName, - bool acceptAbsPath = TRUE ); - virtual bool rename( const TQString &name, const TQString &newName, - bool acceptAbsPaths = TRUE ); - virtual bool exists( const TQString &name, - bool acceptAbsPath = TRUE ); - - static char separator(); - - static bool setCurrent( const TQString &path ); - static TQDir current(); - static TQDir home(); - static TQDir root(); - static TQString currentDirPath(); - static TQString homeDirPath(); - static TQString rootDirPath(); - - static bool match( const TQStringList &filters, const TQString &fileName ); - static bool match( const TQString &filter, const TQString &fileName ); - static TQString cleanDirPath( const TQString &dirPath ); - static bool isRelativePath( const TQString &path ); - void refresh() const; - -private: -#ifdef Q_OS_MAC - typedef struct FSSpec FSSpec; - static FSSpec *make_spec(const TQString &); -#endif - void init(); - virtual bool readDirEntries( const TQString &nameFilter, - int FilterSpec, int SortSpec ); - - static void slashify( TQString & ); - - TQString dPath; - TQStringList *fList; - TQFileInfoList *fiList; - TQString nameFilt; - FilterSpec filtS; - SortSpec sortS; - uint dirty : 1; - uint allDirs : 1; - - void detach(); - friend class TQDeepCopy< TQDir >; -}; - - -inline TQString TQDir::path() const -{ - return dPath; -} - -inline TQString TQDir::nameFilter() const -{ - return nameFilt; -} - -inline TQDir::FilterSpec TQDir::filter() const -{ - return filtS; -} - -inline TQDir::SortSpec TQDir::sorting() const -{ - return sortS; -} - -inline bool TQDir::matchAllDirs() const -{ - return allDirs; -} - -inline bool TQDir::operator!=( const TQDir &d ) const -{ - return !(*this == d); -} - - -struct TQDirSortItem { - TQString filename_cache; - TQFileInfo* item; -}; - -#endif // QT_NO_DIR -#endif // TQDIR_H diff --git a/src/tools/qdir_p.h b/src/tools/qdir_p.h index 03be15a83..4538e5b26 100644 --- a/src/tools/qdir_p.h +++ b/src/tools/qdir_p.h @@ -55,8 +55,8 @@ // #ifndef QT_H -#include "qregexp.h" -#include "qvaluelist.h" +#include "ntqregexp.h" +#include "ntqvaluelist.h" #endif // QT_H extern TQValueList qt_makeFilterList( const TQString & ); diff --git a/src/tools/qdir_unix.cpp b/src/tools/qdir_unix.cpp index 83880d290..c5d7173e7 100644 --- a/src/tools/qdir_unix.cpp +++ b/src/tools/qdir_unix.cpp @@ -39,14 +39,14 @@ **********************************************************************/ #include "qplatformdefs.h" -#include "qdir.h" +#include "ntqdir.h" #ifndef QT_NO_DIR #include "qdir_p.h" -#include "qfileinfo.h" -#include "qregexp.h" -#include "qstringlist.h" +#include "ntqfileinfo.h" +#include "ntqregexp.h" +#include "ntqstringlist.h" #ifdef QT_THREAD_SUPPORT # include diff --git a/src/tools/qfeatures.h b/src/tools/qfeatures.h deleted file mode 100644 index 6e0a38182..000000000 --- a/src/tools/qfeatures.h +++ /dev/null @@ -1,994 +0,0 @@ -// All feature and their dependencies -// -// This list is generated from $QTDIR/src/tools/qfeatures.txt -// -// Asynchronous I/O -//#define QT_NO_ASYNC_IO - -// Bezier curves -//#define QT_NO_BEZIER - -// Buttons -//#define QT_NO_BUTTON - -// Named colors -//#define QT_NO_COLORNAMES - -// Cursors -//#define QT_NO_CURSOR - -// TQDataStream -//#define QT_NO_DATASTREAM - -// TQDate/TQTime/TQDateTime toString() and fromString() -//#define QT_NO_DATESTRING - -// Dialogs -//#define QT_NO_DIALOG - -// TQDirectPainter -//#define QT_NO_DIRECTPAINTER - -// Special widget effects (fading, scrolling) -//#define QT_NO_EFFECTS - -// Freetype font engine -//#define QT_NO_FREETYPE - -// Dither TQImage to 1-bit image -//#define QT_NO_IMAGE_DITHER_TO_1 - -// TQImage::createHeuristicMask() -//#define QT_NO_IMAGE_HEURISTIC_MASK - -// TQImage mirroring -//#define QT_NO_IMAGE_MIRROR - -// Smooth TQImage scaling -//#define QT_NO_IMAGE_SMOOTHSCALE - -// TrueColor TQImage -//#define QT_NO_IMAGE_TRUECOLOR - -// Automatic widget layout -//#define QT_NO_LAYOUT - -// Networking -//#define QT_NO_NETWORK - -// Palettes -//#define QT_NO_PALETTE - -// Alpha-blended cursor -//#define QT_NO_QWS_ALPHA_CURSOR - -// 1-bit monochrome -//#define QT_NO_QWS_DEPTH_1 - -// 15 or 16-bit color -//#define QT_NO_QWS_DEPTH_16 - -// 24-bit color -//#define QT_NO_QWS_DEPTH_24 - -// 32-bit color -//#define QT_NO_QWS_DEPTH_32 - -// 4-bit grayscale -//#define QT_NO_QWS_DEPTH_4 - -// 8-bit color -//#define QT_NO_QWS_DEPTH_8 - -// 8-bit grayscale -//#define QT_NO_QWS_DEPTH_8GRAYSCALE - -// Favour code size over graphics speed -//#define QT_NO_QWS_GFX_SPEED - -// Console keyboard -//#define QT_NO_QWS_KEYBOARD - -// Linux framebuffer -//#define QT_NO_QWS_LINUXFB - -// Mach64 acceleration -//#define QT_NO_QWS_MACH64 - -// Window Manager -//#define QT_NO_QWS_MANAGER - -// Matrox MGA acceleration -//#define QT_NO_QWS_MATROX - -// Autodetecting mouse driver -//#define QT_NO_QWS_MOUSE_AUTO - -// Non-autodetecting mouse driver -//#define QT_NO_QWS_MOUSE_MANUAL - -// TQt/Embedded window system properties. -//#define QT_NO_QWS_PROPERTIES - -// Repeater display -//#define QT_NO_QWS_REPEATER - -// Saving of fonts -//#define QT_NO_QWS_SAVEFONTS - -// Shadow frame buffer -//#define QT_NO_QWS_SHADOWFB - -// Virtual frame buffer -//#define QT_NO_QWS_VFB - -// 4-bit VGA -//#define QT_NO_QWS_VGA_16 - -// Voodoo3 acceleration -//#define QT_NO_QWS_VOODOO3 - -// Range-control widgets -//#define QT_NO_RANGECONTROL - -// Regular expression capture -//#define QT_NO_REGEXP - -// TQSignalMapper -//#define QT_NO_SIGNALMAPPER - -// Playing sounds -//#define QT_NO_SOUND - -// Standard template library compatiblity -//#define QT_NO_STL - -// TQStringList -//#define QT_NO_STRINGLIST - -// Character set conversions -//#define QT_NO_TEXTCODEC - -// TQTextStream -//#define QT_NO_TEXTSTREAM - -// Unicode property tables -//#define QT_NO_UNICODETABLES - -// Input validators -//#define QT_NO_VALIDATOR - -// TQVariant -//#define QT_NO_VARIANT - -// Wheel-mouse events -//#define QT_NO_WHEELEVENT - -// TQWMatrix -//#define QT_NO_WMATRIX - -// Non-Unicode text conversions -#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_CODECS -#endif - -// TQCop IPC -#if !defined(QT_NO_COP) && (defined(QT_NO_DATASTREAM)) -#define QT_NO_COP -#endif - -// TQFontDatabase -#if !defined(QT_NO_FONTDATABASE) && (defined(QT_NO_STRINGLIST)) -#define QT_NO_FONTDATABASE -#endif - -// Image formats -#if !defined(QT_NO_IMAGEIO) && (defined(QT_NO_REGEXP)) -#define QT_NO_IMAGEIO -#endif - -// 16-bit TQImage -#if !defined(QT_NO_IMAGE_16_BIT) && (defined(QT_NO_IMAGE_TRUECOLOR)) -#define QT_NO_IMAGE_16_BIT -#endif - -// Image file text strings -#if !defined(QT_NO_IMAGE_TEXT) && (defined(QT_NO_STRINGLIST)) -#define QT_NO_IMAGE_TEXT -#endif - -// Shared library wrapper -#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_REGEXP)) -#define QT_NO_LIBRARY -#endif - -// Pixmap transformations -#if !defined(QT_NO_PIXMAP_TRANSFORMATION) && (defined(QT_NO_WMATRIX)) -#define QT_NO_PIXMAP_TRANSFORMATION -#endif - -// Convert UUID to/from string -#if !defined(QT_NO_QUUID_STRING) && (defined(QT_NO_STRINGLIST)) -#define QT_NO_QUUID_STRING -#endif - -// The "BeOS" style -#if !defined(QT_NO_QWS_BEOS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) -#define QT_NO_QWS_BEOS_WM_STYLE -#endif - -// Visible cursor -#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR)) -#define QT_NO_QWS_CURSOR -#endif - -// 32-bit color, BGR order -#if !defined(QT_NO_QWS_DEPTH_32_BGR) && (defined(QT_NO_QWS_DEPTH_32)) -#define QT_NO_QWS_DEPTH_32_BGR -#endif - -// The "Hydro" style -#if !defined(QT_NO_QWS_HYDRO_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) -#define QT_NO_QWS_HYDRO_WM_STYLE -#endif - -// Keyboard for SHARP Zaurus SL5xxx devices -#if !defined(QT_NO_QWS_KBD_SHARP) && (defined(QT_NO_QWS_KEYBOARD)) -#define QT_NO_QWS_KBD_SHARP -#endif - -// The "KDE2" style -#if !defined(QT_NO_QWS_KDE2_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) -#define QT_NO_QWS_KDE2_WM_STYLE -#endif - -// The "KDE" style -#if !defined(QT_NO_QWS_KDE_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) -#define QT_NO_QWS_KDE_WM_STYLE -#endif - -// Multi-process architecture -#if !defined(QT_NO_QWS_MULTIPROCESS) && (defined(QT_NO_NETWORK)) -#define QT_NO_QWS_MULTIPROCESS -#endif - -// Transformed frame buffer -#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_LINUXFB)) -#define QT_NO_QWS_TRANSFORMED -#endif - -// Remote frame buffer (VNC) -#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_NETWORK)) -#define QT_NO_QWS_VNC -#endif - -// The "Windows" style -#if !defined(QT_NO_QWS_WINDOWS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) -#define QT_NO_QWS_WINDOWS_WM_STYLE -#endif - -// Regular expression anchors -#if !defined(QT_NO_REGEXP_ANCHOR_ALT) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_ANCHOR_ALT -#endif - -// Regular expression back-reference -#if !defined(QT_NO_REGEXP_BACKREF) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_BACKREF -#endif - -// Regular expression character-class -#if !defined(QT_NO_REGEXP_CCLASS) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_CCLASS -#endif - -// Regular expression escape -#if !defined(QT_NO_REGEXP_ESCAPE) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_ESCAPE -#endif - -// Regular expression interval -#if !defined(QT_NO_REGEXP_INTERVAL) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_INTERVAL -#endif - -// Regular expression lookahead -#if !defined(QT_NO_REGEXP_LOOKAHEAD) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_LOOKAHEAD -#endif - -// Regular expression optimization -#if !defined(QT_NO_REGEXP_OPTIM) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_OPTIM -#endif - -// Regular expression wildcard -#if !defined(QT_NO_REGEXP_WILDCARD) && (defined(QT_NO_REGEXP)) -#define QT_NO_REGEXP_WILDCARD -#endif - -// Semi-modal dialogs -#if !defined(QT_NO_SEMIMODAL) && (defined(QT_NO_DIALOG)) -#define QT_NO_SEMIMODAL -#endif - -// Session management -#if !defined(QT_NO_SESSIONMANAGER) && (defined(QT_NO_STRINGLIST)) -#define QT_NO_SESSIONMANAGER -#endif - -// TQString::sprintf() -#if !defined(QT_NO_SPRINTF) && (defined(QT_NO_REGEXP)) -#define QT_NO_SPRINTF -#endif - -// Scaling and rotation -#if !defined(QT_NO_TRANSFORMATIONS) && (defined(QT_NO_WMATRIX)) -#define QT_NO_TRANSFORMATIONS -#endif - -// Translations via TQObject::tr() -#if !defined(QT_NO_TRANSLATION) && (defined(QT_NO_DATASTREAM)) -#define QT_NO_TRANSLATION -#endif - -// Window icon and caption -#if !defined(QT_NO_WIDGET_TOPEXTRA) && (defined(QT_NO_IMAGE_HEURISTIC_MASK)) -#define QT_NO_WIDGET_TOPEXTRA -#endif - -// Keyboard accelerators and shortcuts -#if !defined(QT_NO_ACCEL) && (defined(QT_NO_SPRINTF)) -#define QT_NO_ACCEL -#endif - -// Asynchronous image I/O -#if !defined(QT_NO_ASYNC_IMAGE_IO) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_ASYNC_IMAGE_IO -#endif - -// BDF font files -#if !defined(QT_NO_BDF) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_STRINGLIST)) -#define QT_NO_BDF -#endif - -// TQDir -#if !defined(QT_NO_DIR) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP)) -#define QT_NO_DIR -#endif - -// JPEG image I/O -#if !defined(QT_NO_IMAGEIO_JPEG) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_IMAGEIO_JPEG -#endif - -// MNG image I/O -#if !defined(QT_NO_IMAGEIO_MNG) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_IMAGEIO_MNG -#endif - -// PNG image I/O -#if !defined(QT_NO_IMAGEIO_PNG) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_IMAGEIO_PNG -#endif - -// PPM image I/O -#if !defined(QT_NO_IMAGEIO_PPM) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_IMAGEIO_PPM -#endif - -// XBM image I/O -#if !defined(QT_NO_IMAGEIO_XBM) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_IMAGEIO_XBM -#endif - -// Image transformations -#if !defined(QT_NO_IMAGE_TRANSFORMATION) && (defined(QT_NO_PIXMAP_TRANSFORMATION)) -#define QT_NO_IMAGE_TRANSFORMATION -#endif - -// External process invocation. -#if !defined(QT_NO_PROCESS) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP)) -#define QT_NO_PROCESS -#endif - -// Regular expression capture -#if !defined(QT_NO_REGEXP_CAPTURE) && (defined(QT_NO_REGEXP) || defined(QT_NO_STRINGLIST)) -#define QT_NO_REGEXP_CAPTURE -#endif - -// Splash screen widget -#if !defined(QT_NO_SPLASHSCREEN) && (defined(QT_NO_IMAGEIO)) -#define QT_NO_SPLASHSCREEN -#endif - -// Template classes in TQVariant -#if !defined(QT_NO_TEMPLATE_VARIANT) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST)) -#define QT_NO_TEMPLATE_VARIANT -#endif - -// Month and day names in dates -#if !defined(QT_NO_TEXTDATE) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_DATESTRING)) -#define QT_NO_TEXTDATE -#endif - -// Drawing utility functions -#if !defined(QT_NO_DRAWUTIL) && (defined(QT_NO_SPRINTF) || defined(QT_NO_PALETTE)) -#define QT_NO_DRAWUTIL -#endif - -// BMP image I/O -#if !defined(QT_NO_IMAGEIO_BMP) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_DATASTREAM)) -#define QT_NO_IMAGEIO_BMP -#endif - -// TQPicture -#if !defined(QT_NO_PICTURE) && (defined(QT_NO_DATASTREAM) || defined(QT_NO_IMAGEIO)) -#define QT_NO_PICTURE -#endif - -// Translations via TQObject::trUtf8() -#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) -#define QT_NO_TRANSLATION_UTF8 -#endif - -// URL parser -#if !defined(QT_NO_URL) && (defined(QT_NO_DIR)) -#define QT_NO_URL -#endif - -// Animated images -#if !defined(QT_NO_MOVIE) && (defined(QT_NO_ASYNC_IO) || defined(QT_NO_ASYNC_IMAGE_IO)) -#define QT_NO_MOVIE -#endif - -// TQStyle -#if !defined(QT_NO_STYLE) && (defined(QT_NO_DRAWUTIL)) -#define QT_NO_STYLE -#endif - -// DNS -#if !defined(QT_NO_DNS) && (defined(QT_NO_NETWORK) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF)) -#define QT_NO_DNS -#endif - -// Framed widgets -#if !defined(QT_NO_FRAME) && (defined(QT_NO_STYLE)) -#define QT_NO_FRAME -#endif - -// TQIconSet -#if !defined(QT_NO_ICONSET) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_IMAGE_SMOOTHSCALE) || defined(QT_NO_PALETTE) || defined(QT_NO_IMAGE_HEURISTIC_MASK)) -#define QT_NO_ICONSET -#endif - -// XPM image I/O -#if !defined(QT_NO_IMAGEIO_XPM) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_SPRINTF) || defined(QT_NO_TEXTSTREAM)) -#define QT_NO_IMAGEIO_XPM -#endif - -// Network file access -#if !defined(QT_NO_NETWORKPROTOCOL) && (defined(QT_NO_TEXTCODEC) || defined(QT_NO_URL)) -#define QT_NO_NETWORKPROTOCOL -#endif - -// TQSizeGrip -#if !defined(QT_NO_SIZEGRIP) && (defined(QT_NO_STYLE)) -#define QT_NO_SIZEGRIP -#endif - -// Motif style -#if !defined(QT_NO_STYLE_MOTIF) && (defined(QT_NO_STYLE)) -#define QT_NO_STYLE_MOTIF -#endif - -// Windows style -#if !defined(QT_NO_STYLE_WINDOWS) && (defined(QT_NO_STYLE)) -#define QT_NO_STYLE_WINDOWS -#endif - -// Internal titlebar widget -#if !defined(QT_NO_TITLEBAR) && (defined(QT_NO_STYLE)) -#define QT_NO_TITLEBAR -#endif - -// XML -#if !defined(QT_NO_XML) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC) || defined(QT_NO_REGEXP_CAPTURE)) -#define QT_NO_XML -#endif - -// Check-boxes -#if !defined(QT_NO_CHECKBOX) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) -#define QT_NO_CHECKBOX -#endif - -// Dials -#if !defined(QT_NO_DIAL) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) -#define QT_NO_DIAL -#endif - -// TQLabel -#if !defined(QT_NO_LABEL) && (defined(QT_NO_FRAME)) -#define QT_NO_LABEL -#endif - -// TQLCDNumber -#if !defined(QT_NO_LCDNUMBER) && (defined(QT_NO_FRAME)) -#define QT_NO_LCDNUMBER -#endif - -// Single-line edits -#if !defined(QT_NO_LINEEDIT) && (defined(QT_NO_FRAME)) -#define QT_NO_LINEEDIT -#endif - -// MIME -#if !defined(QT_NO_MIME) && (defined(QT_NO_DIR) || defined(QT_NO_IMAGEIO) || defined(QT_NO_TEXTCODEC)) -#define QT_NO_MIME -#endif - -// Progress bars -#if !defined(QT_NO_PROGRESSBAR) && (defined(QT_NO_FRAME)) -#define QT_NO_PROGRESSBAR -#endif - -// Push-buttons -#if !defined(QT_NO_PUSHBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) -#define QT_NO_PUSHBUTTON -#endif - -// Radio-buttons -#if !defined(QT_NO_RADIOBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) -#define QT_NO_RADIOBUTTON -#endif - -// Internal resize handler -#if !defined(QT_NO_RESIZEHANDLER) && (defined(QT_NO_FRAME)) -#define QT_NO_RESIZEHANDLER -#endif - -// Scroll bars -#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) -#define QT_NO_SCROLLBAR -#endif - -// Sliders -#if !defined(QT_NO_SLIDER) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) -#define QT_NO_SLIDER -#endif - -// Spinbox control widget -#if !defined(QT_NO_SPINWIDGET) && (defined(QT_NO_FRAME)) -#define QT_NO_SPINWIDGET -#endif - -// Status bars -#if !defined(QT_NO_STATUSBAR) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE)) -#define QT_NO_STATUSBAR -#endif - -// Compact Windows style -#if !defined(QT_NO_STYLE_COMPACT) && (defined(QT_NO_STYLE_WINDOWS)) -#define QT_NO_STYLE_COMPACT -#endif - -// Interlace-friendly style -#if !defined(QT_NO_STYLE_INTERLACE) && (defined(QT_NO_STYLE_MOTIF)) -#define QT_NO_STYLE_INTERLACE -#endif - -// Platinum style -#if !defined(QT_NO_STYLE_PLATINUM) && (defined(QT_NO_STYLE_WINDOWS)) -#define QT_NO_STYLE_PLATINUM -#endif - -// Widget stacks -#if !defined(QT_NO_WIDGETSTACK) && (defined(QT_NO_FRAME)) -#define QT_NO_WIDGETSTACK -#endif - -// Grid layout widgets -#if !defined(QT_NO_GRID) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME)) -#define QT_NO_GRID -#endif - -// Group boxes -#if !defined(QT_NO_GROUPBOX) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT)) -#define QT_NO_GROUPBOX -#endif - -// Horizontal box layout widgets -#if !defined(QT_NO_HBOX) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME)) -#define QT_NO_HBOX -#endif - -// Menu-oriented widgets -#if !defined(QT_NO_MENUDATA) && (defined(QT_NO_ICONSET) || defined(QT_NO_VARIANT)) -#define QT_NO_MENUDATA -#endif - -// Persistent application settings -#if !defined(QT_NO_SETTINGS) && (defined(QT_NO_DIR) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_REGEXP_CAPTURE)) -#define QT_NO_SETTINGS -#endif - -// Splitters -#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT)) -#define QT_NO_SPLITTER -#endif - -// Table-like widgets -#if !defined(QT_NO_TABLEVIEW) && (defined(QT_NO_SCROLLBAR)) -#define QT_NO_TABLEVIEW -#endif - -// Tool tips -#if !defined(QT_NO_TOOLTIP) && (defined(QT_NO_LABEL)) -#define QT_NO_TOOLTIP -#endif - -// Cut and paste -#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_MIME)) -#define QT_NO_CLIPBOARD -#endif - -// Horizontal group boxes -#if !defined(QT_NO_HGROUPBOX) && (defined(QT_NO_GROUPBOX)) -#define QT_NO_HGROUPBOX -#endif - -// Properties -#if !defined(QT_NO_PROPERTIES) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST) || defined(QT_NO_ICONSET)) -#define QT_NO_PROPERTIES -#endif - -// RichText (HTML) display -#if !defined(QT_NO_RICHTEXT) && (defined(QT_NO_STYLE) || defined(QT_NO_LAYOUT) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM)) -#define QT_NO_RICHTEXT -#endif - -// SQL classes -#if !defined(QT_NO_SQL) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP_CAPTURE) || defined(QT_NO_VARIANT) || defined(QT_NO_SPRINTF) || defined(QT_NO_DATESTRING)) -#define QT_NO_SQL -#endif - -// CDE style -#if !defined(QT_NO_STYLE_CDE) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS)) -#define QT_NO_STYLE_CDE -#endif - -// Vertical box layout widgets -#if !defined(QT_NO_VBOX) && (defined(QT_NO_HBOX)) -#define QT_NO_VBOX -#endif - -// Button groups -#if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX) || defined(QT_NO_BUTTON)) -#define QT_NO_BUTTONGROUP -#endif - -// Complex scripts (eg. BiDi) -#if !defined(QT_NO_COMPLEXTEXT) && (defined(QT_NO_RICHTEXT)) -#define QT_NO_COMPLEXTEXT -#endif - -// Cut and paste non-text -#if !defined(QT_NO_MIMECLIPBOARD) && (defined(QT_NO_CLIPBOARD)) -#define QT_NO_MIMECLIPBOARD -#endif - -// Printing -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_DATESTRING) || defined(QT_NO_REGEXP_CAPTURE)) -#define QT_NO_PRINTER -#endif - -// Aqua style -#if !defined(QT_NO_STYLE_AQUA) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGE_TRANSFORMATION)) -#define QT_NO_STYLE_AQUA -#endif - -// Vertical group boxes -#if !defined(QT_NO_VGROUPBOX) && (defined(QT_NO_HGROUPBOX)) -#define QT_NO_VGROUPBOX -#endif - -// Horizontal button groups -#if !defined(QT_NO_HBUTTONGROUP) && (defined(QT_NO_BUTTONGROUP)) -#define QT_NO_HBUTTONGROUP -#endif - -// Server to play sound -#if !defined(QT_NO_QWS_SOUNDSERVER) && (defined(QT_NO_SOUND) || defined(QT_NO_DIR) || defined(QT_NO_DNS)) -#define QT_NO_QWS_SOUNDSERVER -#endif - -// TQHeader -#if !defined(QT_NO_HEADER) && (defined(QT_NO_STYLE) || defined(QT_NO_ICONSET)) -#define QT_NO_HEADER -#endif - -// Vertical button groups -#if !defined(QT_NO_VBUTTONGROUP) && (defined(QT_NO_HBUTTONGROUP)) -#define QT_NO_VBUTTONGROUP -#endif - -// Hebrew Codec -#if !defined(QT_NO_CODEC_HEBREW) && (defined(QT_NO_CODECS) || defined(QT_NO_COMPLEXTEXT)) -#define QT_NO_CODEC_HEBREW -#endif - -// HTTP file access -#if !defined(QT_NO_NETWORKPROTOCOL_HTTP) && (defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS)) -#define QT_NO_NETWORKPROTOCOL_HTTP -#endif - -// Tool-buttons -#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_ICONSET) || defined(QT_NO_STYLE)) -#define QT_NO_TOOLBUTTON -#endif - -// Big Codecs (eg. CJK) -#if !defined(QT_NO_BIG_CODECS) && (defined(QT_NO_CODEC_HEBREW)) -#define QT_NO_BIG_CODECS -#endif - -// Experimental internal class -#if !defined(QT_NO_DIALOGBUTTONS) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE) || defined(QT_NO_PUSHBUTTON)) -#define QT_NO_DIALOGBUTTONS -#endif - -// Document Object Model -#if !defined(QT_NO_DOM) && (defined(QT_NO_XML) || defined(QT_NO_MIME)) -#define QT_NO_DOM -#endif - -// Scrollable view widgets -#if !defined(QT_NO_SCROLLVIEW) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_FRAME)) -#define QT_NO_SCROLLVIEW -#endif - -// Tab-bars -#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_TABBAR -#endif - -// Drag and drop -#if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_MIME) || defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_IMAGEIO_XPM)) -#define QT_NO_DRAGANDDROP -#endif - -// TQGridView -#if !defined(QT_NO_GRIDVIEW) && (defined(QT_NO_SCROLLVIEW)) -#define QT_NO_GRIDVIEW -#endif - -// Popup-menus -#if !defined(QT_NO_POPUPMENU) && (defined(QT_NO_MENUDATA) || defined(QT_NO_FRAME)) -#define QT_NO_POPUPMENU -#endif - -// TQCanvas -#if !defined(QT_NO_CANVAS) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_BEZIER)) -#define QT_NO_CANVAS -#endif - -// Dynamic module linking -#if !defined(QT_NO_COMPONENT) && (defined(QT_NO_QUUID_STRING) || defined(QT_NO_SETTINGS) || defined(QT_NO_SPRINTF) || defined(QT_NO_LIBRARY) || defined(QT_NO_DATESTRING)) -#define QT_NO_COMPONENT -#endif - -// TQListBox -#if !defined(QT_NO_LISTBOX) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_STRINGLIST)) -#define QT_NO_LISTBOX -#endif - -// Menu bars -#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_POPUPMENU)) -#define QT_NO_MENUBAR -#endif - -// TQMessageBox -#if !defined(QT_NO_MESSAGEBOX) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LABEL)) -#define QT_NO_MESSAGEBOX -#endif - -// FTP file access -#if !defined(QT_NO_NETWORKPROTOCOL_FTP) && (defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS) || defined(QT_NO_TEXTDATE)) -#define QT_NO_NETWORKPROTOCOL_FTP -#endif - -// Spin boxes -#if !defined(QT_NO_SPINBOX) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) -#define QT_NO_SPINBOX -#endif - -// RichText (HTML) tables and images -#if !defined(QT_NO_TEXTCUSTOMITEM) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_MIME)) -#define QT_NO_TEXTCUSTOMITEM -#endif - -// TQDateTimeEdit -#if !defined(QT_NO_DATETIMEEDIT) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_SPINWIDGET) || defined(QT_NO_DATESTRING)) -#define QT_NO_DATETIMEEDIT -#endif - -// TQTextCodecPlugin -#if !defined(QT_NO_TEXTCODECPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_TEXTCODEC)) -#define QT_NO_TEXTCODECPLUGIN -#endif - -// TQImageFormatPlugin -#if !defined(QT_NO_IMAGEFORMATPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_IMAGEIO)) -#define QT_NO_IMAGEFORMATPLUGIN -#endif - -// TQSqlForm -#if !defined(QT_NO_SQL_FORM) && (defined(QT_NO_SQL) || defined(QT_NO_PROPERTIES)) -#define QT_NO_SQL_FORM -#endif - -// Scalable Vector Graphics (SVG) -#if !defined(QT_NO_SVG) && (defined(QT_NO_DOM) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_SPRINTF)) -#define QT_NO_SVG -#endif - -// TQIconView -#if !defined(QT_NO_ICONVIEW) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_IMAGEIO_XPM) || defined(QT_NO_IMAGE_HEURISTIC_MASK)) -#define QT_NO_ICONVIEW -#endif - -// Tab widgets -#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_WIDGETSTACK)) -#define QT_NO_TABWIDGET -#endif - -// "What's this" help -#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLTIP) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_WHATSTHIS -#endif - -// TQWidgetPlugin -#if !defined(QT_NO_WIDGETPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_ICONSET)) -#define QT_NO_WIDGETPLUGIN -#endif - -// TQProgressDialog -#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_SEMIMODAL) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_PROGRESSBAR)) -#define QT_NO_PROGRESSDIALOG -#endif - -// Motif-plus style -#if !defined(QT_NO_STYLE_MOTIFPLUS) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_BUTTON) || defined(QT_NO_SCROLLBAR) || defined(QT_NO_SLIDER)) -#define QT_NO_STYLE_MOTIFPLUS -#endif - -// Rich text edit -#if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_SCROLLVIEW)) -#define QT_NO_TEXTEDIT -#endif - -// TQWizard -#if !defined(QT_NO_WIZARD) && (defined(QT_NO_DIALOG) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL)) -#define QT_NO_WIZARD -#endif - -// Multi-line edits -#if !defined(QT_NO_MULTILINEEDIT) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_MULTILINEEDIT -#endif - -// Rich text syntax highlighting -#if !defined(QT_NO_SYNTAXHIGHLIGHTER) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_SYNTAXHIGHLIGHTER -#endif - -// TQTextView -#if !defined(QT_NO_TEXTVIEW) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_TEXTVIEW -#endif - -// TQTabDialog -#if !defined(QT_NO_TABDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LAYOUT) || defined(QT_NO_TABWIDGET)) -#define QT_NO_TABDIALOG -#endif - -// TQTextBrowser -#if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTVIEW) || defined(QT_NO_MIME)) -#define QT_NO_TEXTBROWSER -#endif - -// TQListView -#if !defined(QT_NO_LISTVIEW) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_HEADER) || defined(QT_NO_LINEEDIT)) -#define QT_NO_LISTVIEW -#endif - -// TQComboBox -#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LISTBOX) || defined(QT_NO_LINEEDIT) || defined(QT_NO_POPUPMENU)) -#define QT_NO_COMBOBOX -#endif - -// TQColorDialog -#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR) || defined(QT_NO_GRIDVIEW) || defined(QT_NO_LAYOUT)) -#define QT_NO_COLORDIALOG -#endif - -// Tool box -#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_ICONSET) || defined(QT_NO_SCROLLVIEW) || defined(QT_NO_TOOLTIP) || defined(QT_NO_LAYOUT) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_TOOLBOX -#endif - -// SGI style -#if !defined(QT_NO_STYLE_SGI) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_BUTTON) || defined(QT_NO_SCROLLBAR) || defined(QT_NO_SLIDER) || defined(QT_NO_LINEEDIT) || defined(QT_NO_MENUBAR)) -#define QT_NO_STYLE_SGI -#endif - -// TQErrorMessage -#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LABEL) || defined(QT_NO_CHECKBOX) || defined(QT_NO_TEXTVIEW)) -#define QT_NO_ERRORMESSAGE -#endif - -// Main-windows -#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_POPUPMENU) || defined(QT_NO_TITLEBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_STATUSBAR)) -#define QT_NO_MAINWINDOW -#endif - -// Toolbars -#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) -#define QT_NO_TOOLBAR -#endif - -// TQAction -#if !defined(QT_NO_ACTION) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_COMBOBOX)) -#define QT_NO_ACTION -#endif - -// TQTable -#if !defined(QT_NO_TABLE) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_HEADER) || defined(QT_NO_CHECKBOX)) -#define QT_NO_TABLE -#endif - -// TQFontDialog -#if !defined(QT_NO_FONTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_CHECKBOX) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_VGROUPBOX) || defined(QT_NO_VALIDATOR)) -#define QT_NO_FONTDIALOG -#endif - -// TQInputDialog -#if !defined(QT_NO_INPUTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_SPINBOX) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_LAYOUT)) -#define QT_NO_INPUTDIALOG -#endif - -// SQL value editor widgets -#if !defined(QT_NO_SQL_EDIT_WIDGETS) && (defined(QT_NO_SQL) || defined(QT_NO_SPINBOX) || defined(QT_NO_COMBOBOX) || defined(QT_NO_CHECKBOX) || defined(QT_NO_DATETIMEEDIT)) -#define QT_NO_SQL_EDIT_WIDGETS -#endif - -// TQPrintDialog -#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_RADIOBUTTON) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_DIR)) -#define QT_NO_PRINTDIALOG -#endif - -// TQFileDialog -#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_MESSAGEBOX) || defined(QT_NO_LISTVIEW) || defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_SEMIMODAL) || defined(QT_NO_REGEXP_CAPTURE) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_VBOX) || defined(QT_NO_SPLITTER) || defined(QT_NO_PROGRESSBAR) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_DATESTRING)) -#define QT_NO_FILEDIALOG -#endif - -// SQL table widgets -#if !defined(QT_NO_SQL_VIEW_WIDGETS) && (defined(QT_NO_SQL_FORM) || defined(QT_NO_SQL_EDIT_WIDGETS) || defined(QT_NO_TABLE)) -#define QT_NO_SQL_VIEW_WIDGETS -#endif - -// TQWorkSpace -#if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_VBOX) || defined(QT_NO_TITLEBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_POPUPMENU) || defined(QT_NO_LABEL) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MENUBAR)) -#define QT_NO_WORKSPACE -#endif - -// Input method -#if !defined(QT_NO_IM) && (defined(QT_NO_STRINGLIST)) -#define QT_NO_IM -#endif - -// Input method extensions -#if !defined(QT_NO_IM_EXTENSIONS) && (defined(QT_NO_IM) || defined(QT_NO_STRINGLIST)) -#define QT_NO_IM_EXTENSIONS -#endif - diff --git a/src/tools/qfile.cpp b/src/tools/qfile.cpp index 1fabc595f..ab5248fe9 100644 --- a/src/tools/qfile.cpp +++ b/src/tools/qfile.cpp @@ -50,13 +50,13 @@ # undef truncate #endif -#include "qfile.h" +#include "ntqfile.h" #ifndef NO_ERRNO_H #include #endif -// Duplicated from qobject.h, but we cannot include qobject.h here since +// Duplicated from ntqobject.h, but we cannot include ntqobject.h here since // it causes qmake to not build on irix g++ #define QT_TRANSLATE_NOOP(scope,x) (x) @@ -78,7 +78,7 @@ public: extern bool qt_file_access( const TQString& fn, int t ); /*! - \class TQFile qfile.h + \class TQFile ntqfile.h \reentrant \brief The TQFile class is an I/O device that operates on files. diff --git a/src/tools/qfile.h b/src/tools/qfile.h deleted file mode 100644 index c8255e1cd..000000000 --- a/src/tools/qfile.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFile class -** -** Created : 930831 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFILE_H -#define TQFILE_H - -#ifndef QT_H -#include "qiodevice.h" -#include "qstring.h" -#include -#endif // QT_H - -class TQDir; -class TQFilePrivate; - -class Q_EXPORT TQFile : public TQIODevice // file I/O device class -{ -public: - TQFile(); - TQFile( const TQString &name ); - ~TQFile(); - - TQString name() const; - void setName( const TQString &name ); - - typedef TQCString (*EncoderFn)( const TQString &fileName ); - typedef TQString (*DecoderFn)( const TQCString &localfileName ); - static TQCString encodeName( const TQString &fileName ); - static TQString decodeName( const TQCString &localFileName ); - static void setEncodingFunction( EncoderFn ); - static void setDecodingFunction( DecoderFn ); - - bool exists() const; - static bool exists( const TQString &fileName ); - - bool remove(); - static bool remove( const TQString &fileName ); - - bool open( int ); - bool open( int, FILE * ); - bool open( int, int ); - void close(); - void flush(); - - Offset size() const; - Offset at() const; - bool at( Offset ); - bool atEnd() const; - - Q_LONG readBlock( char *data, Q_ULONG len ); - Q_LONG writeBlock( const char *data, Q_ULONG len ); - Q_LONG writeBlock( const TQByteArray& data ) - { return TQIODevice::writeBlock(data); } - Q_LONG readLine( char *data, Q_ULONG maxlen ); - Q_LONG readLine( TQString &, Q_ULONG maxlen ); - - int getch(); - int putch( int ); - int ungetch( int ); - - int handle() const; - - TQString errorString() const; // ### TQt 4: move into TQIODevice - -protected: - void setErrorString( const TQString& ); // ### TQt 4: move into TQIODevice - TQString fn; - FILE *fh; - int fd; - Offset length; - bool ext_f; - TQFilePrivate *d; // ### TQt 4: make private - -private: - void init(); - void setErrorStringErrno( int ); - TQCString ungetchBuffer; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQFile( const TQFile & ); - TQFile &operator=( const TQFile & ); -#endif -}; - - -inline TQString TQFile::name() const -{ return fn; } - -inline TQIODevice::Offset TQFile::at() const -{ return ioIndex; } - - -#endif // TQFILE_H diff --git a/src/tools/qfile_unix.cpp b/src/tools/qfile_unix.cpp index d9ed6d82c..85d0fd4fa 100644 --- a/src/tools/qfile_unix.cpp +++ b/src/tools/qfile_unix.cpp @@ -52,7 +52,7 @@ static inline int qt_open(const char *pathname, int flags, mode_t mode) # undef truncate #endif -#include "qfile.h" +#include "ntqfile.h" #include #include diff --git a/src/tools/qfileinfo.cpp b/src/tools/qfileinfo.cpp index b144de1b2..014e037c8 100644 --- a/src/tools/qfileinfo.cpp +++ b/src/tools/qfileinfo.cpp @@ -40,11 +40,11 @@ #include "qplatformdefs.h" -#include "qfileinfo.h" -#include "qdatetime.h" -#include "qdir.h" +#include "ntqfileinfo.h" +#include "ntqdatetime.h" +#include "ntqdir.h" #include "qfiledefs_p.h" -#include "qdeepcopy.h" +#include "ntqdeepcopy.h" #if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4) #include #endif diff --git a/src/tools/qfileinfo.h b/src/tools/qfileinfo.h deleted file mode 100644 index bd41896e8..000000000 --- a/src/tools/qfileinfo.h +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFileInfo class -** -** Created : 950628 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFILEINFO_H -#define TQFILEINFO_H - -#ifndef QT_H -#include "qfile.h" -#include "qdatetime.h" -#endif // QT_H - - -class TQDir; -struct TQFileInfoCache; -template class TQDeepCopy; - - -class Q_EXPORT TQFileInfo -{ -public: - enum PermissionSpec { - ReadOwner = 04000, WriteOwner = 02000, ExeOwner = 01000, - ReadUser = 00400, WriteUser = 00200, ExeUser = 00100, - ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010, - ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 }; - - TQFileInfo(); - TQFileInfo( const TQString &file ); - TQFileInfo( const TQFile & ); -#ifndef QT_NO_DIR - TQFileInfo( const TQDir &, const TQString &fileName ); -#endif - TQFileInfo( const TQFileInfo & ); - ~TQFileInfo(); - - TQFileInfo &operator=( const TQFileInfo & ); - - void setFile( const TQString &file ); - void setFile( const TQFile & ); -#ifndef QT_NO_DIR - void setFile( const TQDir &, const TQString &fileName ); -#endif - bool exists() const; - void refresh() const; - bool caching() const; - void setCaching( bool ); - - TQString filePath() const; - TQString fileName() const; -#ifndef QT_NO_DIR //### - TQString absFilePath() const; -#endif - TQString baseName( bool complete = FALSE ) const; - TQString extension( bool complete = TRUE ) const; - -#ifndef QT_NO_DIR //### - TQString dirPath( bool absPath = FALSE ) const; -#endif -#ifndef QT_NO_DIR - TQDir dir( bool absPath = FALSE ) const; -#endif - bool isReadable() const; - bool isWritable() const; - bool isExecutable() const; - bool isHidden() const; - -#ifndef QT_NO_DIR //### - bool isRelative() const; - bool convertToAbs(); -#endif - - bool isFile() const; - bool isDir() const; - bool isSymLink() const; - - TQString readLink() const; - - TQString owner() const; - uint ownerId() const; - TQString group() const; - uint groupId() const; - - bool permission( int permissionSpec ) const; - -#if (QT_VERSION-0 >= 0x040000) -#error "TQFileInfo::size() should return TQIODevice::Offset instead of uint" -#elif defined(QT_ABI_QT4) - TQIODevice::Offset size() const; -#else - uint size() const; -#endif - - TQDateTime created() const; - TQDateTime lastModified() const; - TQDateTime lastRead() const; - -private: - void doStat() const; - static void slashify( TQString & ); - static void makeAbs( TQString & ); - - TQString fn; - TQFileInfoCache *fic; - bool cache; -#if defined(Q_OS_UNIX) - bool symLink; -#endif - - void detach(); - friend class TQDeepCopy< TQFileInfo >; -}; - - -inline bool TQFileInfo::caching() const -{ - return cache; -} - - -#endif // TQFILEINFO_H diff --git a/src/tools/qfileinfo_unix.cpp b/src/tools/qfileinfo_unix.cpp index c1ad38bd9..5f10a2074 100644 --- a/src/tools/qfileinfo_unix.cpp +++ b/src/tools/qfileinfo_unix.cpp @@ -39,10 +39,10 @@ **********************************************************************/ #include "qplatformdefs.h" -#include "qfileinfo.h" +#include "ntqfileinfo.h" #include "qfiledefs_p.h" -#include "qdatetime.h" -#include "qdir.h" +#include "ntqdatetime.h" +#include "ntqdir.h" #include #if !defined(TQWS) && defined(Q_OS_MAC) diff --git a/src/tools/qgarray.cpp b/src/tools/qgarray.cpp index b5a74eae5..4d7fd38e4 100644 --- a/src/tools/qgarray.cpp +++ b/src/tools/qgarray.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qglobal.h" +#include "ntqglobal.h" #if defined(Q_CC_BOR) // needed for qsort() because of a std namespace problem on Borland # include "qplatformdefs.h" @@ -48,7 +48,7 @@ #endif #define TQGARRAY_CPP -#include "qgarray.h" +#include "ntqgarray.h" #include #include @@ -77,7 +77,7 @@ #endif /*! - \class TQShared qshared.h + \class TQShared ntqshared.h \reentrant \ingroup shared \brief The TQShared class is used internally for implementing shared classes. @@ -94,7 +94,7 @@ */ /*! - \class TQGArray qgarray.h + \class TQGArray ntqgarray.h \reentrant \ingroup shared \ingroup collection diff --git a/src/tools/qgarray.h b/src/tools/qgarray.h deleted file mode 100644 index ee8cdca1a..000000000 --- a/src/tools/qgarray.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGArray class -** -** Created : 930906 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGARRAY_H -#define TQGARRAY_H - -#ifndef QT_H -#include "qshared.h" -#endif // QT_H - - -class Q_EXPORT TQGArray // generic array -{ -friend class TQBuffer; -public: - // do not use this, even though this is public - // ### make protected or private in TQt 4.0 beta? - struct array_data : public TQShared { // shared array - array_data():data(0),len(0) -#ifdef QT_QGARRAY_SPEED_OPTIM - ,maxl(0) -#endif - {} - char *data; // actual array data - uint len; -#ifdef QT_QGARRAY_SPEED_OPTIM - uint maxl; -#endif - }; - TQGArray(); - enum Optimization { MemOptim, SpeedOptim }; -protected: - TQGArray( int, int ); // dummy; does not alloc - TQGArray( int size ); // allocate 'size' bytes - TQGArray( const TQGArray &a ); // shallow copy - virtual ~TQGArray(); - - TQGArray &operator=( const TQGArray &a ) { return assign( a ); } - - virtual void detach() { duplicate(*this); } - - // ### TQt 4.0: maybe provide two versions of data(), at(), etc. - char *data() const { return shd->data; } - uint nrefs() const { return shd->count; } - uint size() const { return shd->len; } - bool isEqual( const TQGArray &a ) const; - - bool resize( uint newsize, Optimization optim ); - bool resize( uint newsize ); - - bool fill( const char *d, int len, uint sz ); - - TQGArray &assign( const TQGArray &a ); - TQGArray &assign( const char *d, uint len ); - TQGArray &duplicate( const TQGArray &a ); - TQGArray &duplicate( const char *d, uint len ); - void store( const char *d, uint len ); - - array_data *sharedBlock() const { return shd; } - void setSharedBlock( array_data *p ) { shd=(array_data*)p; } - - TQGArray &setRawData( const char *d, uint len ); - void resetRawData( const char *d, uint len ); - - int find( const char *d, uint index, uint sz ) const; - int contains( const char *d, uint sz ) const; - - void sort( uint sz ); - int bsearch( const char *d, uint sz ) const; - - char *at( uint index ) const; - - bool setExpand( uint index, const char *d, uint sz ); - -protected: - virtual array_data *newData(); - virtual void deleteData( array_data *p ); - -private: - static void msg_index( uint ); - array_data *shd; -}; - - -inline char *TQGArray::at( uint index ) const -{ -#if defined(QT_CHECK_RANGE) - if ( index >= size() ) { - msg_index( index ); - index = 0; - } -#endif - return &shd->data[index]; -} - - -#endif // TQGARRAY_H diff --git a/src/tools/qgcache.cpp b/src/tools/qgcache.cpp index f7a4aeead..190e3c9e9 100644 --- a/src/tools/qgcache.cpp +++ b/src/tools/qgcache.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qgcache.h" -#include "qptrlist.h" -#include "qdict.h" -#include "qstring.h" +#include "ntqgcache.h" +#include "ntqptrlist.h" +#include "ntqdict.h" +#include "ntqstring.h" /*! - \class TQGCache qgcache.h + \class TQGCache ntqgcache.h \reentrant \ingroup shared \ingroup collection @@ -672,7 +672,7 @@ void TQGCache::statistics() const *****************************************************************************/ /*! - \class TQGCacheIterator qgcache.h + \class TQGCacheIterator ntqgcache.h \reentrant \ingroup shared \ingroup collection diff --git a/src/tools/qgcache.h b/src/tools/qgcache.h deleted file mode 100644 index 6cfabbc8a..000000000 --- a/src/tools/qgcache.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGCache and TQGCacheIterator classes -** -** Created : 950208 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGCACHE_H -#define TQGCACHE_H - -#ifndef QT_H -#include "qptrcollection.h" -#include "qglist.h" -#include "qgdict.h" -#endif // QT_H - - -class TQCList; // internal classes -class TQCListIt; -class TQCDict; - - -class Q_EXPORT TQGCache : public TQPtrCollection // generic LRU cache -{ -friend class TQGCacheIterator; -protected: - enum KeyType { StringKey, AsciiKey, IntKey, PtrKey }; - // identical to TQGDict's, but PtrKey is not used at the moment - - TQGCache( int maxCost, uint size, KeyType kt, bool caseSensitive, - bool copyKeys ); - TQGCache( const TQGCache & ); // not allowed, calls fatal() - ~TQGCache(); - TQGCache &operator=( const TQGCache & ); // not allowed, calls fatal() - - uint count() const; - uint size() const; - int maxCost() const { return mCost; } - int totalCost() const { return tCost; } - void setMaxCost( int maxCost ); - void clear(); - - bool insert_string( const TQString &key, TQPtrCollection::Item, - int cost, int priority ); - bool insert_other( const char *key, TQPtrCollection::Item, - int cost, int priority ); - bool remove_string( const TQString &key ); - bool remove_other( const char *key ); - TQPtrCollection::Item take_string( const TQString &key ); - TQPtrCollection::Item take_other( const char *key ); - - TQPtrCollection::Item find_string( const TQString &key, bool ref=TRUE ) const; - TQPtrCollection::Item find_other( const char *key, bool ref=TRUE ) const; - - void statistics() const; - -private: - bool makeRoomFor( int cost, int priority = -1 ); - KeyType keytype; - TQCList *lruList; - TQCDict *dict; - int mCost; - int tCost; - bool copyk; -}; - - -class Q_EXPORT TQGCacheIterator // generic cache iterator -{ -protected: - TQGCacheIterator( const TQGCache & ); - TQGCacheIterator( const TQGCacheIterator & ); - ~TQGCacheIterator(); - TQGCacheIterator &operator=( const TQGCacheIterator & ); - - uint count() const; - bool atFirst() const; - bool atLast() const; - TQPtrCollection::Item toFirst(); - TQPtrCollection::Item toLast(); - - TQPtrCollection::Item get() const; - TQString getKeyString() const; - const char *getKeyAscii() const; - long getKeyInt() const; - - TQPtrCollection::Item operator()(); - TQPtrCollection::Item operator++(); - TQPtrCollection::Item operator+=( uint ); - TQPtrCollection::Item operator--(); - TQPtrCollection::Item operator-=( uint ); - -protected: - TQCListIt *it; // iterator on cache list -}; - - -#endif // TQGCACHE_H diff --git a/src/tools/qgdict.cpp b/src/tools/qgdict.cpp index 18282aa6e..99c0cbc29 100644 --- a/src/tools/qgdict.cpp +++ b/src/tools/qgdict.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qgdict.h" -#include "qptrlist.h" -#include "qstring.h" -#include "qdatastream.h" +#include "ntqgdict.h" +#include "ntqptrlist.h" +#include "ntqstring.h" +#include "ntqdatastream.h" #include /*! @@ -997,7 +997,7 @@ TQDataStream& TQGDict::write( TQDataStream &s ) const *****************************************************************************/ /*! - \class TQGDictIterator qgdict.h + \class TQGDictIterator ntqgdict.h \reentrant \ingroup collection \brief The TQGDictIterator class is an internal class for implementing TQDictIterator and TQIntDictIterator. diff --git a/src/tools/qgdict.h b/src/tools/qgdict.h deleted file mode 100644 index dd4b04a52..000000000 --- a/src/tools/qgdict.h +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGDict and TQGDictIterator classes -** -** Created : 920529 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGDICT_H -#define TQGDICT_H - -#ifndef QT_H -#include "qptrcollection.h" -#include "qstring.h" -#endif // QT_H - -class TQGDictIterator; -class TQGDItList; - - -class TQBaseBucket // internal dict node -{ -public: - TQPtrCollection::Item getData() { return data; } - TQPtrCollection::Item setData( TQPtrCollection::Item d ) { return data = d; } - TQBaseBucket *getNext() { return next; } - void setNext( TQBaseBucket *n) { next = n; } -protected: - TQBaseBucket( TQPtrCollection::Item d, TQBaseBucket *n ) : data(d), next(n) {} - TQPtrCollection::Item data; - TQBaseBucket *next; -}; - -class TQStringBucket : public TQBaseBucket -{ -public: - TQStringBucket( const TQString &k, TQPtrCollection::Item d, TQBaseBucket *n ) - : TQBaseBucket(d,n), key(k) {} - const TQString &getKey() const { return key; } -private: - TQString key; -}; - -class TQAsciiBucket : public TQBaseBucket -{ -public: - TQAsciiBucket( const char *k, TQPtrCollection::Item d, TQBaseBucket *n ) - : TQBaseBucket(d,n), key(k) {} - const char *getKey() const { return key; } -private: - const char *key; -}; - -class TQIntBucket : public TQBaseBucket -{ -public: - TQIntBucket( long k, TQPtrCollection::Item d, TQBaseBucket *n ) - : TQBaseBucket(d,n), key(k) {} - long getKey() const { return key; } -private: - long key; -}; - -class TQPtrBucket : public TQBaseBucket -{ -public: - TQPtrBucket( void *k, TQPtrCollection::Item d, TQBaseBucket *n ) - : TQBaseBucket(d,n), key(k) {} - void *getKey() const { return key; } -private: - void *key; -}; - - -class Q_EXPORT TQGDict : public TQPtrCollection // generic dictionary class -{ -public: - uint count() const { return numItems; } - uint size() const { return vlen; } - TQPtrCollection::Item look_string( const TQString& key, TQPtrCollection::Item, - int ); - TQPtrCollection::Item look_ascii( const char *key, TQPtrCollection::Item, int ); - TQPtrCollection::Item look_int( long key, TQPtrCollection::Item, int ); - TQPtrCollection::Item look_ptr( void *key, TQPtrCollection::Item, int ); -#ifndef QT_NO_DATASTREAM - TQDataStream &read( TQDataStream & ); - TQDataStream &write( TQDataStream & ) const; -#endif -protected: - enum KeyType { StringKey, AsciiKey, IntKey, PtrKey }; - - TQGDict( uint len, KeyType kt, bool cs, bool ck ); - TQGDict( const TQGDict & ); - ~TQGDict(); - - TQGDict &operator=( const TQGDict & ); - - bool remove_string( const TQString &key, TQPtrCollection::Item item=0 ); - bool remove_ascii( const char *key, TQPtrCollection::Item item=0 ); - bool remove_int( long key, TQPtrCollection::Item item=0 ); - bool remove_ptr( void *key, TQPtrCollection::Item item=0 ); - TQPtrCollection::Item take_string( const TQString &key ); - TQPtrCollection::Item take_ascii( const char *key ); - TQPtrCollection::Item take_int( long key ); - TQPtrCollection::Item take_ptr( void *key ); - - void clear(); - void resize( uint ); - - int hashKeyString( const TQString & ); - int hashKeyAscii( const char * ); - - void statistics() const; - -#ifndef QT_NO_DATASTREAM - virtual TQDataStream &read( TQDataStream &, TQPtrCollection::Item & ); - virtual TQDataStream &write( TQDataStream &, TQPtrCollection::Item ) const; -#endif -private: - TQBaseBucket **vec; - uint vlen; - uint numItems; - uint keytype : 2; - uint cases : 1; - uint copyk : 1; - TQGDItList *iterators; - void unlink_common( int, TQBaseBucket *, TQBaseBucket * ); - TQStringBucket *unlink_string( const TQString &, - TQPtrCollection::Item item = 0 ); - TQAsciiBucket *unlink_ascii( const char *, TQPtrCollection::Item item = 0 ); - TQIntBucket *unlink_int( long, TQPtrCollection::Item item = 0 ); - TQPtrBucket *unlink_ptr( void *, TQPtrCollection::Item item = 0 ); - void init( uint, KeyType, bool, bool ); - friend class TQGDictIterator; -}; - - -class Q_EXPORT TQGDictIterator // generic dictionary iterator -{ -friend class TQGDict; -public: - TQGDictIterator( const TQGDict & ); - TQGDictIterator( const TQGDictIterator & ); - TQGDictIterator &operator=( const TQGDictIterator & ); - ~TQGDictIterator(); - - TQPtrCollection::Item toFirst(); - - TQPtrCollection::Item get() const; - TQString getKeyString() const; - const char *getKeyAscii() const; - long getKeyInt() const; - void *getKeyPtr() const; - - TQPtrCollection::Item operator()(); - TQPtrCollection::Item operator++(); - TQPtrCollection::Item operator+=(uint); - -protected: - TQGDict *dict; - -private: - TQBaseBucket *curNode; - uint curIndex; -}; - -inline TQPtrCollection::Item TQGDictIterator::get() const -{ - return curNode ? curNode->getData() : 0; -} - -inline TQString TQGDictIterator::getKeyString() const -{ - return curNode ? ((TQStringBucket*)curNode)->getKey() : TQString::null; -} - -inline const char *TQGDictIterator::getKeyAscii() const -{ - return curNode ? ((TQAsciiBucket*)curNode)->getKey() : 0; -} - -inline long TQGDictIterator::getKeyInt() const -{ - return curNode ? ((TQIntBucket*)curNode)->getKey() : 0; -} - -inline void *TQGDictIterator::getKeyPtr() const -{ - return curNode ? ((TQPtrBucket*)curNode)->getKey() : 0; -} - - -#endif // TQGDICT_H diff --git a/src/tools/qgeneric.h b/src/tools/qgeneric.h deleted file mode 100644 index af1ec86e6..000000000 --- a/src/tools/qgeneric.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Macros for pasting tokens; utilized by our generic classes -** -** Created : 920529 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGENERIC_H -#define TQGENERIC_H - -#error "do not include qgeneric.h any more" - -#endif // TQGENERIC_H diff --git a/src/tools/qglist.cpp b/src/tools/qglist.cpp index a72798cec..c9f14102b 100644 --- a/src/tools/qglist.cpp +++ b/src/tools/qglist.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qglist.h" -#include "qgvector.h" -#include "qdatastream.h" -#include "qvaluelist.h" +#include "ntqglist.h" +#include "ntqgvector.h" +#include "ntqdatastream.h" +#include "ntqvaluelist.h" /*! - \class TQLNode qglist.h + \class TQLNode ntqglist.h \reentrant \ingroup collection \brief The TQLNode class is an internal class for the TQPtrList template collection. @@ -74,7 +74,7 @@ /*! - \class TQGList qglist.h + \class TQGList ntqglist.h \reentrant \ingroup collection \brief The TQGList class is an internal class for implementing TQt collection classes. @@ -88,7 +88,7 @@ customize the subclasses, namely compareItems(), read() and write. Normally, you do not have to reimplement any of these functions. If you still want to reimplement them, see the TQStrList - class (qstrlist.h) for an example. + class (ntqstrlist.h) for an example. */ @@ -1080,7 +1080,7 @@ TQLNode* TQGList::erase( TQLNode* it ) *****************************************************************************/ /*! - \class TQGListIterator qglist.h + \class TQGListIterator ntqglist.h \reentrant \ingroup collection \brief The TQGListIterator class is an internal class for implementing TQPtrListIterator. diff --git a/src/tools/qglist.h b/src/tools/qglist.h deleted file mode 100644 index 568a2b90c..000000000 --- a/src/tools/qglist.h +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGList and TQGListIterator classes -** -** Created : 920624 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGLIST_H -#define TQGLIST_H - -#ifndef QT_H -#include "qptrcollection.h" -#endif // QT_H - -class Q_EXPORT TQLNode -{ -friend class TQGList; -friend class TQGListIterator; -friend class TQGListStdIterator; -public: - TQPtrCollection::Item getData() { return data; } -private: - TQPtrCollection::Item data; - TQLNode *prev; - TQLNode *next; - TQLNode( TQPtrCollection::Item d ) { data = d; } -}; - -class TQGListIteratorList; // internal helper class - -class Q_EXPORT TQGList : public TQPtrCollection // doubly linked generic list -{ -friend class TQGListIterator; -friend class TQGListIteratorList; -friend class TQGVector; // needed by TQGVector::toList -public: - uint count() const; // return number of nodes - -#ifndef QT_NO_DATASTREAM - TQDataStream &read( TQDataStream & ); // read list from stream - TQDataStream &write( TQDataStream & ) const; // write list to stream -#endif -protected: - TQGList(); // create empty list - TQGList( const TQGList & ); // make copy of other list - virtual ~TQGList(); - - TQGList &operator=( const TQGList & ); // assign from other list - bool operator==( const TQGList& ) const; - - void inSort( TQPtrCollection::Item ); // add item sorted in list - void append( TQPtrCollection::Item ); // add item at end of list - bool insertAt( uint index, TQPtrCollection::Item ); // add item at i'th position - void relinkNode( TQLNode * ); // relink as first item - bool removeNode( TQLNode * ); // remove node - bool remove( TQPtrCollection::Item = 0 ); // remove item (0=current) - bool removeRef( TQPtrCollection::Item = 0 ); // remove item (0=current) - bool removeFirst(); // remove first item - bool removeLast(); // remove last item - bool removeAt( uint ); // remove item at i'th position - bool replaceAt( uint, TQPtrCollection::Item ); // replace item at position i with item - TQPtrCollection::Item takeNode( TQLNode * ); // take out node - TQPtrCollection::Item take(); // take out current item - TQPtrCollection::Item takeAt( uint index ); // take out item at i'th pos - TQPtrCollection::Item takeFirst(); // take out first item - TQPtrCollection::Item takeLast(); // take out last item - - void sort(); // sort all items; - void clear(); // remove all items - - int findRef( TQPtrCollection::Item, bool = TRUE ); // find exact item in list - int find( TQPtrCollection::Item, bool = TRUE ); // find equal item in list - - uint containsRef( TQPtrCollection::Item ) const; // get number of exact matches - uint contains( TQPtrCollection::Item ) const; // get number of equal matches - - TQPtrCollection::Item at( uint index ); // access item at i'th pos - int at() const; // get current index - TQLNode *currentNode() const; // get current node - - TQPtrCollection::Item get() const; // get current item - - TQPtrCollection::Item cfirst() const; // get ptr to first list item - TQPtrCollection::Item clast() const; // get ptr to last list item - TQPtrCollection::Item first(); // set first item in list curr - TQPtrCollection::Item last(); // set last item in list curr - TQPtrCollection::Item next(); // set next item in list curr - TQPtrCollection::Item prev(); // set prev item in list curr - - void toVector( TQGVector * ) const; // put items in vector - - virtual int compareItems( TQPtrCollection::Item, TQPtrCollection::Item ); - -#ifndef QT_NO_DATASTREAM - virtual TQDataStream &read( TQDataStream &, TQPtrCollection::Item & ); - virtual TQDataStream &write( TQDataStream &, TQPtrCollection::Item ) const; -#endif - - TQLNode* begin() const { return firstNode; } - TQLNode* end() const { return 0; } - TQLNode* erase( TQLNode* it ); - -private: - void prepend( TQPtrCollection::Item ); // add item at start of list - - void heapSortPushDown( TQPtrCollection::Item* heap, int first, int last ); - - TQLNode *firstNode; // first node - TQLNode *lastNode; // last node - TQLNode *curNode; // current node - int curIndex; // current index - uint numNodes; // number of nodes - TQGListIteratorList *iterators; // list of iterators - - TQLNode *locate( uint ); // get node at i'th pos - TQLNode *unlink(); // unlink node -}; - - -inline uint TQGList::count() const -{ - return numNodes; -} - -inline bool TQGList::removeFirst() -{ - first(); - return remove(); -} - -inline bool TQGList::removeLast() -{ - last(); - return remove(); -} - -inline int TQGList::at() const -{ - return curIndex; -} - -inline TQPtrCollection::Item TQGList::at( uint index ) -{ - TQLNode *n = locate( index ); - return n ? n->data : 0; -} - -inline TQLNode *TQGList::currentNode() const -{ - return curNode; -} - -inline TQPtrCollection::Item TQGList::get() const -{ - return curNode ? curNode->data : 0; -} - -inline TQPtrCollection::Item TQGList::cfirst() const -{ - return firstNode ? firstNode->data : 0; -} - -inline TQPtrCollection::Item TQGList::clast() const -{ - return lastNode ? lastNode->data : 0; -} - - -/***************************************************************************** - TQGList stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQGList & ); -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQGList & ); -#endif - -/***************************************************************************** - TQGListIterator class - *****************************************************************************/ - -class Q_EXPORT TQGListIterator // TQGList iterator -{ -friend class TQGList; -friend class TQGListIteratorList; -protected: - TQGListIterator( const TQGList & ); - TQGListIterator( const TQGListIterator & ); - TQGListIterator &operator=( const TQGListIterator & ); - ~TQGListIterator(); - - bool atFirst() const; // test if at first item - bool atLast() const; // test if at last item - TQPtrCollection::Item toFirst(); // move to first item - TQPtrCollection::Item toLast(); // move to last item - - TQPtrCollection::Item get() const; // get current item - TQPtrCollection::Item operator()(); // get current and move to next - TQPtrCollection::Item operator++(); // move to next item (prefix) - TQPtrCollection::Item operator+=(uint); // move n positions forward - TQPtrCollection::Item operator--(); // move to prev item (prefix) - TQPtrCollection::Item operator-=(uint); // move n positions backward - -protected: - TQGList *list; // reference to list - -private: - TQLNode *curNode; // current node in list -}; - - -inline bool TQGListIterator::atFirst() const -{ - return curNode == list->firstNode; -} - -inline bool TQGListIterator::atLast() const -{ - return curNode == list->lastNode; -} - -inline TQPtrCollection::Item TQGListIterator::get() const -{ - return curNode ? curNode->data : 0; -} - -class Q_EXPORT TQGListStdIterator -{ -public: - inline TQGListStdIterator( TQLNode* n ) : node( n ){} - inline operator TQLNode* () { return node; } -protected: - inline TQLNode *next() { return node->next; } - TQLNode *node; -}; - - -#endif // TQGLIST_H diff --git a/src/tools/qglobal.cpp b/src/tools/qglobal.cpp index 805e7fd64..2336fb0b1 100644 --- a/src/tools/qglobal.cpp +++ b/src/tools/qglobal.cpp @@ -40,7 +40,7 @@ #include "qplatformdefs.h" -#include "qasciidict.h" +#include "ntqasciidict.h" #include #include #include @@ -699,7 +699,7 @@ void qSystemWarning( const char* msg, int code ) Prints a warning message containing the source code file name and line number if \a test is FALSE. - This is really a macro defined in \c qglobal.h. + This is really a macro defined in \c ntqglobal.h. Q_ASSERT is useful for testing pre- and post-conditions. @@ -709,7 +709,7 @@ void qSystemWarning( const char* msg, int code ) // File: div.cpp // - #include + #include int divide( int a, int b ) { @@ -736,7 +736,7 @@ void qSystemWarning( const char* msg, int code ) If \a p is 0, prints a warning message containing the source code file name and line number, saying that the program ran out of memory. - This is really a macro defined in \c qglobal.h. + This is really a macro defined in \c ntqglobal.h. Example: \code @@ -858,7 +858,7 @@ void qObsolete( const char *message ) Example: \code - #include + #include #include #include diff --git a/src/tools/qglobal.h b/src/tools/qglobal.h deleted file mode 100644 index b888c7be4..000000000 --- a/src/tools/qglobal.h +++ /dev/null @@ -1,1141 +0,0 @@ -/**************************************************************************** -** -** Global type declarations and definitions -** -** Created : 920529 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGLOBAL_H -#define TQGLOBAL_H - -#define TQT_REAL_TQT 1 - -#define QT_VERSION_STR "3.4.0" -/* - QT_VERSION is (major << 16) + (minor << 8) + patch. - */ -#define QT_VERSION 0x030400 - -/* - The operating system, must be one of: (Q_OS_x) - - MACX - Mac OS X - MAC9 - Mac OS 9 - DARWIN - Darwin OS (Without Mac OS X) - MSDOS - MS-DOS and Windows - OS2 - OS/2 - OS2EMX - XFree86 on OS/2 (not PM) - WIN32 - Win32 (Windows 95/98/ME and Windows NT/2000/XP) - CYGWIN - Cygwin - SOLARIS - Sun Solaris - HPUX - HP-UX - ULTRIX - DEC Ultrix - LINUX - Linux - FREEBSD - FreeBSD - NETBSD - NetBSD - OPENBSD - OpenBSD - BSDI - BSD/OS - IRIX - SGI Irix - OSF - HP Tru64 UNIX - SCO - SCO OpenServer 5 - UNIXWARE - UnixWare 7, Open UNIX 8 - AIX - AIX - HURD - GNU Hurd - DGUX - DG/UX - RELIANT - Reliant UNIX - DYNIX - DYNIX/ptx - TQNX - TQNX - TQNX6 - TQNX RTP 6.1 - LYNX - LynxOS - BSD4 - Any BSD 4.4 system - UNIX - Any UNIX BSD/SYSV system -*/ - -#if defined(__DARWIN_X11__) -# define Q_OS_DARWIN -#elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__)) -# define Q_OS_MACX -#elif defined(__MACOSX__) -# define Q_OS_MACX -#elif defined(macintosh) -# define Q_OS_MAC9 -#elif defined(__CYGWIN__) -# define Q_OS_CYGWIN -#elif defined(MSDOS) || defined(_MSDOS) -# define Q_OS_MSDOS -#elif defined(__OS2__) -# if defined(__EMX__) -# define Q_OS_OS2EMX -# else -# define Q_OS_OS2 -# endif -#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) -# define Q_OS_WIN32 -# define Q_OS_WIN64 -#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) -# define Q_OS_WIN32 -#elif defined(__MWERKS__) && defined(__INTEL__) -# define Q_OS_WIN32 -#elif defined(__sun) || defined(sun) -# define Q_OS_SOLARIS -#elif defined(hpux) || defined(__hpux) -# define Q_OS_HPUX -#elif defined(__ultrix) || defined(ultrix) -# define Q_OS_ULTRIX -#elif defined(sinix) -# define Q_OS_RELIANT -#elif defined(__GNU__) -# define Q_OS_HURD -#elif defined(__linux__) || defined(__linux) || defined(__GNU__) || defined(__GLIBC__) -# define Q_OS_LINUX -#elif defined(__FreeBSD__) || defined(__DragonFly__) -# define Q_OS_FREEBSD -# define Q_OS_BSD4 -#elif defined(__NetBSD__) -# define Q_OS_NETBSD -# define Q_OS_BSD4 -#elif defined(__OpenBSD__) -# define Q_OS_OPENBSD -# define Q_OS_BSD4 -#elif defined(__bsdi__) -# define Q_OS_BSDI -# define Q_OS_BSD4 -#elif defined(__sgi) -# define Q_OS_IRIX -#elif defined(__osf__) -# define Q_OS_OSF -#elif defined(_AIX) -# define Q_OS_AIX -#elif defined(__Lynx__) -# define Q_OS_LYNX -#elif defined(__DGUX__) -# define Q_OS_DGUX -#elif defined(__QNXNTO__) -# define Q_OS_QNX6 -#elif defined(__QNX__) -# define Q_OS_QNX -#elif defined(_SETQUENT_) -# define Q_OS_DYNIX -#elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */ -# define Q_OS_SCO -#elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */ -# define Q_OS_UNIXWARE -# define Q_OS_UNIXWARE7 -#elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */ -# define Q_OS_UNIXWARE -# define Q_OS_UNIXWARE7 -#elif defined(__MAKEDEPEND__) -#else -# error "TQt has not been ported to this OS - talk to qt-bugs@trolltech.com" -#endif - -#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) -# define Q_OS_WIN -#endif - -#if defined(Q_OS_MAC9) || defined(Q_OS_MACX) -# define Q_OS_MAC -#endif - -#if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) -# undef Q_OS_UNIX -#elif !defined(Q_OS_UNIX) -# define Q_OS_UNIX -#endif - -#if defined(Q_OS_MACX) -# ifdef MAC_OS_X_VERSION_MIN_REQUIRED -# undef MAC_OS_X_VERSION_MIN_REQUIRED -# endif -# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_2 -# include -# if !defined(MAC_OS_X_VERSION_10_3) -# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1 -# endif -# if !defined(MAC_OS_X_VERSION_10_4) -# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1 -# endif -# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4) -# error "This version of Mac OS X is unsupported" -# endif -#endif - - -/* - The compiler, must be one of: (Q_CC_x) - - SYM - Symantec C++ for both PC and Macintosh - MPW - MPW C++ - MWERKS - Metrowerks CodeWarrior - MSVC - Microsoft Visual C/C++, Intel C++ for Windows - BOR - Borland/Turbo C++ - WAT - Watcom C++ - GNU - GNU C++ - COMEAU - Comeau C++ - EDG - Edison Design Group C++ - OC - CenterLine C++ - SUN - Sun WorkShop, Forte Developer, or Sun ONE Studio C++ - MIPS - MIPSpro C++ - DEC - DEC C++ - HP - HPUX C++ - HPACC - HPUX ANSI C++ - USLC - SCO OUDK, UDK, and UnixWare 2.X C++ - CDS - Reliant C++ - KAI - KAI C++ - INTEL - Intel C++ for Linux, Intel C++ for Windows - HIGHC - MetaWare High C/C++ - PGI - Portland Group C++ - GHS - Green Hills Optimizing C++ Compilers - - Should be sorted most to least authoritative. -*/ - -/* Symantec C++ is now Digital Mars */ -#if defined(__DMC__) || defined(__SC__) -# define Q_CC_SYM -/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */ -# if defined(__SC__) && __SC__ < 0x750 -# define Q_NO_EXPLICIT_KEYWORD -# endif -# define Q_NO_USING_KEYWORD -# if !defined(_CPPUNWIND) -# define Q_NO_EXCEPTIONS -# endif - -#elif defined(applec) -# define Q_CC_MPW -# define Q_NO_BOOL_TYPE -# define Q_NO_EXPLICIT_KEYWORD -# define Q_NO_USING_KEYWORD - -#elif defined(__MWERKS__) -# define Q_CC_MWERKS -/* "explicit" recognized since 4.0d1 */ -# define TQMAC_PASCAL pascal - -#elif defined(_MSC_VER) -# define Q_CC_MSVC -/* proper support of bool for _MSC_VER >= 1100 */ -# define Q_CANNOT_DELETE_CONSTANT -# define Q_INLINE_TEMPLATES inline -/* Visual C++.Net issues for _MSC_VER >= 1300 */ -# if _MSC_VER >= 1300 -# define Q_CC_MSVC_NET -# if _MSC_VER < 1310 || (defined(Q_OS_WIN64) && defined(_M_IA64)) -# define Q_TYPENAME -# endif -# endif -/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */ -# if defined(__INTEL_COMPILER) -# define Q_CC_INTEL -# if !defined(__EXCEPTIONS) -# define Q_NO_EXCEPTIONS -# endif -# else -# define Q_NO_USING_KEYWORD /* ### check "using" status */ -# endif - -#elif defined(__BORLANDC__) || defined(__TURBOC__) -# define Q_CC_BOR -# if __BORLANDC__ < 0x502 -# define Q_NO_BOOL_TYPE -# define Q_NO_EXPLICIT_KEYWORD -# endif -# define Q_NO_USING_KEYWORD /* ### check "using" status */ - -#elif defined(__WATCOMC__) -# define Q_CC_WAT -# if defined(Q_OS_QNX4) -/* compiler flags */ -# define Q_TYPENAME -# define Q_NO_BOOL_TYPE -# define Q_CANNOT_DELETE_CONSTANT -# define mutable -/* ??? */ -# define Q_BROKEN_TEMPLATE_SPECIALIZATION -/* no template classes in TQVariant */ -# define QT_NO_TEMPLATE_VARIANT -/* Wcc does not fill in functions needed by valuelists, maps, and - valuestacks implicitly */ -# define Q_FULL_TEMPLATE_INSTANTIATION -/* can we just compare the structures? */ -# define Q_FULL_TEMPLATE_INSTANTIATION_MEMCMP -/* these are not useful to our customers */ -# define QT_QWS_NO_SHM -# define QT_NO_QWS_MULTIPROCESS -# define QT_NO_SQL -# define QT_NO_QWS_CURSOR -# endif - -#elif defined(__GNUC__) -# define Q_CC_GNU -# define Q_C_CALLBACKS -# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 -# define Q_FULL_TEMPLATE_INSTANTIATION -# endif -/* GCC 2.95 knows "using" but does not support it correctly */ -# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 -# define Q_NO_USING_KEYWORD -# endif -/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */ -# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1 -# define Q_WRONG_SB_CTYPE_MACROS -# endif - -/* ARM gcc pads structs to 32 bits, even when they contain a single - char, or short. We tell gcc to pack TQChars to 16 bits, to avoid - TQString bloat. However, gcc 3.4 doesn't allow us to create references to - members of a packed struct. (Pointers are OK, because then you - supposedly know what you are doing.) */ -# if (defined(__arm__) || defined(__ARMEL__)) && !defined(__ARM_EABI__) && !defined(QT_MOC_CPP) -# define Q_PACKED __attribute__ ((packed)) -# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 -# define Q_NO_PACKED_REFERENCE -# endif -# endif -# if !defined(__EXCEPTIONS) -# define Q_NO_EXCEPTIONS -# endif - -/* IBM compiler versions are a bit messy. There are actually two products: - the C product, and the C++ product. The C++ compiler is always packaged - with the latest version of the C compiler. Version numbers do not always - match. This little table (I'm not sure it's accurate) should be helpful: - - C++ product C product - - C Set 3.1 C Compiler 3.0 - ... ... - C++ Compiler 3.6.6 C Compiler 4.3 - ... ... - Visual Age C++ 4.0 ... - ... ... - Visual Age C++ 5.0 C Compiler 5.0 - ... ... - Visual Age C++ 6.0 C Compiler 6.0 - - Now: - __xlC__ is the version of the C compiler in hexadecimal notation - is only an approximation of the C++ compiler version - __IBMCPP__ is the version of the C++ compiler in decimal notation - but it is not defined on older compilers like C Set 3.1 */ -#elif defined(__xlC__) -# define Q_CC_XLC -# define Q_FULL_TEMPLATE_INSTANTIATION -# if __xlC__ < 0x400 -# define Q_NO_BOOL_TYPE -# define Q_NO_EXPLICIT_KEYWORD -# define Q_NO_USING_KEYWORD -# define Q_TYPENAME -# define Q_INLINE_TEMPLATES inline -# define Q_BROKEN_TEMPLATE_SPECIALIZATION -# define Q_CANNOT_DELETE_CONSTANT -# endif - -/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed - on DEC C++ V5.5-004. New versions do define __EDG__ - observed on - Compaq C++ V6.3-002. - This compiler is different enough from other EDG compilers to handle - it separately anyway. */ -#elif defined(__DECCXX) || defined(__DECC) -# define Q_CC_DEC -/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older - DEC C++ V5 compilers. */ -# if defined(__EDG__) -# define Q_CC_EDG -# endif -/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead - - observed on Compaq C++ V6.3-002. - In any case versions prior to Compaq C++ V6.0-005 do not have bool. */ -# if !defined(_BOOL_EXISTS) -# define Q_NO_BOOL_TYPE -# endif -/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */ -# define Q_NO_USING_KEYWORD -/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on - DEC C++ V5.5-004. */ -# if __DECCXX_VER < 60060000 -# define Q_TYPENAME -# define Q_BROKEN_TEMPLATE_SPECIALIZATION -# define Q_CANNOT_DELETE_CONSTANT -# endif -/* avoid undefined symbol problems with out-of-line template members */ -# define Q_INLINE_TEMPLATES inline - -/* Compilers with EDG front end are similar. To detect them we test: - __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b - __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 */ -#elif defined(__EDG) || defined(__EDG__) -# define Q_CC_EDG -/* From the EDG documentation (does not seem to apply to Compaq C++): - _BOOL - Defined in C++ mode when bool is a keyword. The name of this - predefined macro is specified by a configuration flag. _BOOL - is the default. - __BOOL_DEFINED - Defined in Microsoft C++ mode when bool is a keyword. */ -# if !defined(_BOOL) && !defined(__BOOL_DEFINED) -# define Q_NO_BOOL_TYPE -# endif - -/* The Comeau compiler is based on EDG and does define __EDG__ */ -# if defined(__COMO__) -# define Q_CC_COMEAU -# define Q_C_CALLBACKS - -/* The `using' keyword was introduced to avoid KAI C++ warnings - but it's now causing KAI C++ errors instead. The standard is - unclear about the use of this keyword, and in practice every - compiler is using its own set of rules. Forget it. */ -# elif defined(__KCC) -# define Q_CC_KAI -# if !defined(_EXCEPTIONS) -# define Q_NO_EXCEPTIONS -# endif -# define Q_NO_USING_KEYWORD - -/* Using the `using' keyword avoids Intel C++ for Linux warnings */ -# elif defined(__INTEL_COMPILER) -# define Q_CC_INTEL -# if !defined(__EXCEPTIONS) -# define Q_NO_EXCEPTIONS -# endif - -/* The Portland Group compiler is based on EDG and does define __EDG__ */ -# elif defined(__PGI) -# define Q_CC_PGI -# if !defined(__EXCEPTIONS) -# define Q_NO_EXCEPTIONS -# endif - -/* Never tested! */ -# elif defined(__ghs) -# define Q_CC_GHS - -/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */ -# elif defined(__USLC__) && defined(__SCO_VERSION__) -# define Q_CC_USLC -/* The latest UDK 7.1.1b does not need this, but previous versions do */ -# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010) -# define Q_INLINE_TEMPLATES inline -# endif -# define Q_NO_USING_KEYWORD /* ### check "using" status */ - -/* Never tested! */ -# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER) -# define Q_CC_OC -# define Q_NO_USING_KEYWORD - -/* CDS++ defines __EDG__ although this is not documented in the Reliant - documentation. It also follows conventions like _BOOL and this documented */ -# elif defined(sinix) -# define Q_CC_CDS -# define Q_NO_USING_KEYWORD -# if defined(__cplusplus) && (__cplusplus < 2) /* Cfront C++ mode */ -# define Q_NO_EXCEPTIONS -# endif - -/* The MIPSpro compiler in o32 mode is based on EDG but disables features - such as template specialization nevertheless */ -# elif defined(__sgi) -# define Q_CC_MIPS -# if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */ -# define Q_TYPENAME -# define Q_BROKEN_TEMPLATE_SPECIALIZATION -# define Q_NO_EXPLICIT_KEYWORD -# define Q_INLINE_TEMPLATES inline -# elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */ -# define Q_TYPENAME -# define Q_BROKEN_TEMPLATE_SPECIALIZATION -# endif -# define Q_NO_USING_KEYWORD /* ### check "using" status */ -# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740) -# pragma set woff 3624,3625, 3649 /* turn off some harmless warnings */ -# endif -# endif - -/* The older UnixWare 2.X compiler? */ -#elif defined(__USLC__) -# define Q_CC_USLC -# define Q_TYPENAME -# define Q_NO_BOOL_TYPE -# define Q_NO_EXPLICIT_KEYWORD -# define Q_NO_USING_KEYWORD -# define Q_INLINE_TEMPLATES inline - -/* Never tested! */ -#elif defined(__HIGHC__) -# define Q_CC_HIGHC - -#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) -# define Q_CC_SUN -/* 5.0 compiler or better - 'bool' is enabled by default but can be disabled using -features=nobool - in which case _BOOL is not defined - this is the default in 4.2 compatibility mode triggered by -compat=4 */ -# if __SUNPRO_CC >= 0x500 -# if !defined(_BOOL) -# define Q_NO_BOOL_TYPE -# endif -# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4) -# define Q_NO_USING_KEYWORD -# endif -# define Q_C_CALLBACKS -/* 4.2 compiler or older */ -# else -# define Q_NO_BOOL_TYPE -# define Q_NO_EXPLICIT_KEYWORD -# define Q_NO_USING_KEYWORD -# endif - -/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant - documentation but nevertheless uses EDG conventions like _BOOL */ -#elif defined(sinix) -# define Q_CC_EDG -# define Q_CC_CDS -# if !defined(_BOOL) -# define Q_NO_BOOL_TYPE -# endif -# define Q_BROKEN_TEMPLATE_SPECIALIZATION - -#elif defined(Q_OS_HPUX) -/* __HP_aCC was not defined in first aCC releases */ -# if defined(__HP_aCC) || __cplusplus >= 199707L -# define Q_CC_HPACC -# else -# define Q_CC_HP -# define Q_NO_BOOL_TYPE -# define Q_FULL_TEMPLATE_INSTANTIATION -# define Q_BROKEN_TEMPLATE_SPECIALIZATION -# define Q_NO_EXPLICIT_KEYWORD -# endif -# define Q_NO_USING_KEYWORD /* ### check "using" status */ - -#else -# error "TQt has not been tested with this compiler - talk to qt-bugs@trolltech.com" -#endif - -#ifndef Q_PACKED -# define Q_PACKED -#endif - - -/* - The window system, must be one of: (Q_WS_x) - - MACX - Mac OS X - MAC9 - Mac OS 9 - TQWS - TQt/Embedded - WIN32 - Windows - X11 - X Window System - PM - unsupported - WIN16 - unsupported -*/ - -#if defined(Q_OS_MAC9) -# define Q_WS_MAC9 -#elif defined(Q_OS_MSDOS) -# define Q_WS_WIN16 -# error "TQt requires Win32 and does not work with Windows 3.x" -#elif defined(_WIN32_X11_) -# define Q_WS_X11 -#elif defined(Q_OS_WIN32) -# define Q_WS_WIN32 -# if defined(Q_OS_WIN64) -# define Q_WS_WIN64 -# endif -#elif defined(Q_OS_OS2) -# define Q_WS_PM -# error "TQt does not work with OS/2 Presentation Manager or Workplace Shell" -#elif defined(Q_OS_UNIX) -# if defined(TQWS) -# define Q_WS_QWS -# define QT_NO_QWS_IM -# elif defined(Q_OS_MACX) -# define Q_WS_MACX -# else -# define Q_WS_X11 -# endif -#endif -#if defined(Q_OS_MAC) && !defined(TQMAC_PASCAL) -# define TQMAC_PASCAL -#endif - -#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) -# define Q_WS_WIN -#endif - -#if (defined(Q_WS_MAC9) || defined(Q_WS_MACX)) && !defined(Q_WS_QWS) && !defined(Q_WS_X11) -# define Q_WS_MAC -#endif - - -/* - Some classes do not permit copies to be made of an object. - These classes contains a private copy constructor and operator= - to disable copying (the compiler gives an error message). - Undefine Q_DISABLE_COPY to turn off this checking. -*/ - -#define Q_DISABLE_COPY - -#if defined(__cplusplus) - - -// -// Useful type definitions for TQt -// - -#if defined(Q_NO_BOOL_TYPE) -#if defined(Q_CC_HP) -// bool is an unsupported reserved keyword in later versions -#define bool int -#else -typedef int bool; -#endif -#endif - -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; - - -// -// Constant bool values -// - -#ifndef TRUE -const bool FALSE = 0; -const bool TRUE = !0; -#endif -#if defined(__WATCOMC__) -# if defined(Q_OS_QNX4) -const bool false = FALSE; -const bool true = TRUE; -# endif -#endif - -// -// Proper for-scoping -// ### turn on in 4.0 - -#if 0 && defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) -# define for if(0){}else for -#endif - -// -// Use the "explicit" keyword on platforms that support it. -// - -#if !defined(Q_NO_EXPLICIT_KEYWORD) -# define Q_EXPLICIT explicit -#else -# define Q_EXPLICIT -#endif - - -// -// Workaround for static const members on MSVC++. -// - -#if defined(Q_CC_MSVC) -# define QT_STATIC_CONST static -# define QT_STATIC_CONST_IMPL -#else -# define QT_STATIC_CONST static const -# define QT_STATIC_CONST_IMPL const -#endif - - -// -// Utility macros and inline functions -// - -#define TQMAX(a, b) ((b) < (a) ? (a) : (b)) -#define TQMIN(a, b) ((a) < (b) ? (a) : (b)) -#define TQABS(a) ((a) >= 0 ? (a) : -(a)) - -inline int qRound( double d ) -{ - return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1); -} - - -// -// Size-dependent types (architechture-dependent byte order) -// - -#if !defined(QT_CLEAN_NAMESPACE) -// source compatibility with TQt 1.x -typedef signed char INT8; // 8 bit signed -typedef unsigned char UINT8; // 8 bit unsigned -typedef short INT16; // 16 bit signed -typedef unsigned short UINT16; // 16 bit unsigned -typedef int INT32; // 32 bit signed -typedef unsigned int UINT32; // 32 bit unsigned -#endif - -typedef signed char Q_INT8; // 8 bit signed -typedef unsigned char Q_UINT8; // 8 bit unsigned -typedef short Q_INT16; // 16 bit signed -typedef unsigned short Q_UINT16; // 16 bit unsigned -typedef int Q_INT32; // 32 bit signed -typedef unsigned int Q_UINT32; // 32 bit unsigned -#if defined(Q_OS_WIN64) -typedef __int64 Q_LONG; // word up to 64 bit signed -typedef unsigned __int64 Q_ULONG; // word up to 64 bit unsigned -#else -typedef long Q_LONG; // word up to 64 bit signed -typedef unsigned long Q_ULONG; // word up to 64 bit unsigned -#endif -#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) -# define Q_INT64_C(c) c ## i64 // signed 64 bit constant -# define Q_UINT64_C(c) c ## ui64 // unsigned 64 bit constant -typedef __int64 Q_INT64; // 64 bit signed -typedef unsigned __int64 Q_UINT64; // 64 bit unsigned -#else -# define Q_INT64_C(c) c ## LL // signed 64 bit constant -# define Q_UINT64_C(c) c ## ULL // unsigned 64 bit constant -typedef long long Q_INT64; // 64 bit signed -typedef unsigned long long Q_UINT64; // 64 bit unsigned -#endif -typedef Q_INT64 Q_LLONG; // signed long long -typedef Q_UINT64 Q_ULLONG; // unsigned long long - -#if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT) -# define QT_LARGEFILE_SUPPORT 64 -#endif -#if defined(QT_LARGEFILE_SUPPORT) - typedef Q_ULLONG TQtOffset; -#else - typedef Q_ULONG TQtOffset; -#endif - - -// -// Data stream functions is provided by many classes (defined in qdatastream.h) -// - -class TQDataStream; - - -// -// Feature subsetting -// -// Note that disabling some features will produce a libqt that is not -// compatible with other libqt builds. Such modifications are only -// supported on TQt/Embedded where reducing the library size is important -// and where the application-suite is often a fixed set. -// - -#if !defined(QT_MOC) -#if defined(TQCONFIG_LOCAL) -#include "qconfig-local.h" -#elif defined(TQCONFIG_MINIMAL) -#include "qconfig-minimal.h" -#elif defined(TQCONFIG_SMALL) -#include "qconfig-small.h" -#elif defined(TQCONFIG_MEDIUM) -#include "qconfig-medium.h" -#elif defined(TQCONFIG_LARGE) -#include "qconfig-large.h" -#else // everything... -#include "qconfig.h" -#endif -#endif - - -#ifndef QT_BUILD_KEY -#define QT_BUILD_KEY "unspecified" -#endif - -// prune to local config -#include "qmodules.h" -#ifndef QT_MODULE_DIALOGS -# define QT_NO_DIALOG -#endif -#ifndef QT_MODULE_ICONVIEW -# define QT_NO_ICONVIEW -#endif -#ifndef QT_MODULE_WORKSPACE -# define QT_NO_WORKSPACE -#endif -#ifndef QT_MODULE_NETWORK -#define QT_NO_NETWORK -#endif -#ifndef QT_MODULE_CANVAS -# define QT_NO_CANVAS -#endif -#ifndef QT_MODULE_TABLE -#define QT_NO_TABLE -#endif -#ifndef QT_MODULE_XML -# define QT_NO_XML -#endif -#ifndef QT_MODULE_OPENGL -# define QT_NO_OPENGL -#endif -#if !defined(QT_MODULE_SQL) -# define QT_NO_SQL -#endif - -#if defined(Q_WS_MAC9) -//No need for menu merging -# ifndef TQMAC_QMENUBAR_NO_MERGE -# define TQMAC_QMENUBAR_NO_MERGE -# endif -//Mac9 does not use quartz -# ifndef TQMAC_NO_QUARTZ -# define TQMAC_NO_QUARTZ -# endif -# ifndef TQMAC_QMENUBAR_NO_EVENT -# define TQMAC_QMENUBAR_NO_EVENT -# endif -#endif -#if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks -# ifndef TQMAC_NO_QUARTZ -# define TQMAC_NO_QUARTZ -# endif -# ifndef TQMAC_QMENUBAR_NO_EVENT -# define TQMAC_QMENUBAR_NO_EVENT -# endif -#endif - -#if !defined(Q_WS_QWS) && !defined(QT_NO_COP) -# define QT_NO_COP -#endif - -#ifndef QT_H -#include "qfeatures.h" -#endif /* QT_H */ - - -// -// Create TQt DLL if QT_DLL is defined (Windows only) -// or QT_SHARED is defined (Kylix only) -// - -#if defined(Q_OS_WIN) -# if defined(QT_NODLL) -# undef QT_MAKEDLL -# undef QT_DLL -# elif defined(QT_MAKEDLL) /* create a TQt DLL library */ -# if defined(QT_DLL) -# undef QT_DLL -# endif -# define Q_EXPORT __declspec(dllexport) -# define Q_TEMPLATEDLL -# define Q_TEMPLATE_EXTERN -# undef Q_DISABLE_COPY /* avoid unresolved externals */ -# elif defined(QT_DLL) /* use a TQt DLL library */ -# define Q_EXPORT __declspec(dllimport) -# define Q_TEMPLATEDLL -# ifndef Q_TEMPLATE_EXTERN -# if defined(Q_CC_MSVC_NET) -# define Q_TEMPLATE_EXTERN extern -# else -# define Q_TEMPLATE_EXTERN -# endif -# endif -# undef Q_DISABLE_COPY /* avoid unresolved externals */ -# endif -#elif defined(Q_OS_LINUX) && defined(Q_CC_BOR) -# if defined(QT_SHARED) /* create a TQt shared library */ -# define Q_EXPORT __declspec(dllexport) -# define Q_TEMPLATEDLL -# define Q_TEMPLATE_EXTERN -# undef Q_DISABLE_COPY /* avoid unresolved externals */ -# else -# define Q_TEMPLATEDLL -# define Q_TEMPLATE_EXTERN -# undef Q_DISABLE_COPY /* avoid unresolved externals */ -# endif -#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4 -# define Q_EXPORT __attribute__((visibility("default"))) -# undef QT_MAKEDLL /* ignore these for other platforms */ -# undef QT_DLL -#else -# undef QT_MAKEDLL /* ignore these for other platforms */ -# undef QT_DLL -#endif - -#ifndef Q_EXPORT -# define Q_EXPORT -#endif - - -// -// Some platform specific stuff -// - -#if defined(Q_WS_WIN) -extern Q_EXPORT bool qt_winunicode; -#endif - - -// -// System information -// - -Q_EXPORT const char *qVersion(); -Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian ); -Q_EXPORT bool qSharedBuild(); -#if defined(Q_OS_MAC) -int qMacVersion(); -#elif defined(Q_WS_WIN) -Q_EXPORT int qWinVersion(); -#if defined(UNICODE) -#define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi } -#define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi ) -#else -#define QT_WA( uni, ansi ) ansi -#define QT_WA_INLINE( uni, ansi ) ansi -#endif -#endif - -#ifdef Q_OS_TEMP -#ifdef QT_WA -#undef QT_WA -#undef QT_WA_INLINE -#endif -#define QT_WA( uni, ansi ) uni -#define QT_WA_INLINE( uni, ansi ) ( uni ) -#endif - -#ifndef Q_INLINE_TEMPLATES -# define Q_INLINE_TEMPLATES -#endif - -#ifndef Q_TYPENAME -# define Q_TYPENAME typename -#endif - -// -// Use to avoid "unused parameter" warnings -// -#define Q_UNUSED(x) (void)x; - -// -// Debugging and error handling -// - -#if !defined(QT_NO_CHECK) -# define QT_CHECK_STATE // check state of objects etc. -# define QT_CHECK_RANGE // check range of indexes etc. -# define QT_CHECK_NULL // check null pointers -# define QT_CHECK_MATH // check math functions -#endif - -#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG) -# define QT_DEBUG // display debug messages -# if !defined(QT_NO_COMPAT) // compatibility with TQt 2 -# if !defined(NO_DEBUG) && !defined(DEBUG) -# if !defined(Q_OS_MACX) // clash with MacOS X headers -# define DEBUG -# endif -# endif -# endif -#endif - - -Q_EXPORT void qDebug( const char *, ... ) // print debug message -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 1, 2))) -#endif -; - -Q_EXPORT void qWarning( const char *, ... ) // print warning message -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 1, 2))) -#endif -; - -Q_EXPORT void qFatal( const char *, ... ) // print fatal message and exit -#if defined(Q_CC_GNU) - __attribute__ ((format (printf, 1, 2))) -#endif -; - -Q_EXPORT void qSystemWarning( const char *, int code = -1 ); - -#if !defined(QT_CLEAN_NAMESPACE) // compatibility with TQt 1 - -Q_EXPORT void debug( const char *, ... ) // print debug message -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 1, 2))) -#endif -; - -Q_EXPORT void warning( const char *, ... ) // print warning message -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 1, 2))) -#endif -; - -Q_EXPORT void fatal( const char *, ... ) // print fatal message and exit -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 1, 2))) -#endif -; - -#endif // QT_CLEAN_NAMESPACE - - -#if !defined(Q_ASSERT) -# if defined(QT_CHECK_STATE) -# if defined(QT_FATAL_ASSERT) -# define Q_ASSERT(x) ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)) -# else -# define Q_ASSERT(x) ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)) -# endif -# else -# define Q_ASSERT(x) -# endif -#endif - -#if !defined(QT_NO_COMPAT) // compatibility with TQt 2 -# if !defined(ASSERT) -# if !defined(Q_OS_TEMP) -# define ASSERT(x) Q_ASSERT(x) -# endif -# endif -#endif // QT_NO_COMPAT - - -Q_EXPORT bool qt_check_pointer( bool c, const char *, int ); - -#if defined(QT_CHECK_NULL) -# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__)) -#else -# define Q_CHECK_PTR(p) -#endif - -#if !defined(QT_NO_COMPAT) // compatibility with TQt 2 -# if !defined(CHECK_PTR) -# define CHECK_PTR(x) Q_CHECK_PTR(x) -# endif -#endif // QT_NO_COMPAT - -enum TQtMsgType { TQtDebugMsg, TQtWarningMsg, TQtFatalMsg }; - -typedef void (*TQtMsgHandler)(TQtMsgType, const char *); -Q_EXPORT TQtMsgHandler qInstallMsgHandler( TQtMsgHandler ); - -#if !defined(QT_NO_COMPAT) // compatibility with TQt 2 -typedef TQtMsgHandler msg_handler; -#endif // QT_NO_COMPAT - -Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE ); - -Q_EXPORT void qObsolete( const char *obj, const char *oldfunc, - const char *newfunc ); -Q_EXPORT void qObsolete( const char *obj, const char *oldfunc ); -Q_EXPORT void qObsolete( const char *message ); - - -// -// Install paths from configure -// - -Q_EXPORT const char *qInstallPath(); -Q_EXPORT const char *qInstallPathDocs(); -Q_EXPORT const char *qInstallPathHeaders(); -Q_EXPORT const char *qInstallPathLibs(); -Q_EXPORT const char *qInstallPathBins(); -Q_EXPORT const char *qInstallPathPlugins(); -Q_EXPORT const char *qInstallPathData(); -Q_EXPORT const char *qInstallPathTranslations(); -Q_EXPORT const char *qInstallPathSysconf(); - -#endif /* __cplusplus */ - -/* - compilers which follow outdated template instantiation rules - require a class to have a comparison operator to exist when - a TQValueList of this type is instantiated. It's not actually - used in the list, though. Hence the dummy implementation. - Just in case other code relies on it we better trigger a warning - mandating a real implementation. -*/ -#ifdef Q_FULL_TEMPLATE_INSTANTIATION -# define Q_DUMMY_COMPARISON_OPERATOR(C) \ - bool operator==( const C& ) const { \ - qWarning( #C"::operator==( const "#C"& ) got called." ); \ - return FALSE; \ - } -#else -# define Q_DUMMY_COMPARISON_OPERATOR(C) -#endif - -#endif /* TQGLOBAL_H */ - -/* - Avoid some particularly useless warnings from some stupid compilers. - To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out - the line "#define QT_NO_WARNINGS" -*/ - -#if !defined(QT_CC_WARNINGS) -# define QT_NO_WARNINGS -#endif -#if defined(QT_NO_WARNINGS) -# if defined(Q_CC_MSVC) -# pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data -# pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' -# pragma warning(disable: 4514) // unreferenced inline/local function has been removed -# pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning) -# pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2' -# pragma warning(disable: 4706) // assignment within conditional expression -# pragma warning(disable: 4786) // truncating debug info after 255 characters -# pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated -# pragma warning(disable: 4355) // 'this' : used in base member initializer list -# pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation -# pragma warning(disable: 4710) // function not inlined -# elif defined(Q_CC_BOR) -# pragma option -w-inl -# pragma option -w-aus -# pragma warn -inl -# pragma warn -pia -# pragma warn -ccc -# pragma warn -rch -# pragma warn -sig -# endif -#endif - diff --git a/src/tools/qgpluginmanager.cpp b/src/tools/qgpluginmanager.cpp index 6b22e3b96..5afd8bc41 100644 --- a/src/tools/qgpluginmanager.cpp +++ b/src/tools/qgpluginmanager.cpp @@ -39,8 +39,8 @@ #include "qgpluginmanager_p.h" #ifndef QT_NO_COMPONENT #include "qcomlibrary_p.h" -#include "qmap.h" -#include "qdir.h" +#include "ntqmap.h" +#include "ntqdir.h" /* The following co-occurrence code is borrowed from TQt Linguist. @@ -287,7 +287,7 @@ static int similarity( const TQString& s1, const TQString& s2 ) -#include +#include TQGPluginManager::TQGPluginManager( const TQUuid& id, const TQStringList& paths, const TQString &suffix, bool cs ) : interfaceId( id ), plugDict( 17, cs ), casesens( cs ), autounload( TRUE ) diff --git a/src/tools/qgpluginmanager_p.h b/src/tools/qgpluginmanager_p.h index 4e4194793..82bfdf053 100644 --- a/src/tools/qgpluginmanager_p.h +++ b/src/tools/qgpluginmanager_p.h @@ -40,10 +40,10 @@ #define TQGPLUGINMANAGER_P_H #ifndef QT_H -#include "qdict.h" -#include "qlibrary.h" -#include "quuid.h" -#include "qstringlist.h" +#include "ntqdict.h" +#include "ntqlibrary.h" +#include "ntquuid.h" +#include "ntqstringlist.h" #include "qcom_p.h" #endif // QT_H diff --git a/src/tools/qgvector.cpp b/src/tools/qgvector.cpp index d9602aeff..b53e41721 100644 --- a/src/tools/qgvector.cpp +++ b/src/tools/qgvector.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qglobal.h" +#include "ntqglobal.h" #if defined(Q_CC_BOR) // needed for qsort() because of a std namespace problem on Borland #include "qplatformdefs.h" #endif #define TQGVECTOR_CPP -#include "qgvector.h" -#include "qglist.h" -#include "qstring.h" -#include "qdatastream.h" +#include "ntqgvector.h" +#include "ntqglist.h" +#include "ntqstring.h" +#include "ntqdatastream.h" #include #ifdef QT_THREAD_SUPPORT diff --git a/src/tools/qgvector.h b/src/tools/qgvector.h deleted file mode 100644 index 0e388c0c8..000000000 --- a/src/tools/qgvector.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Definition of TQGVector class -** -** Created : 930907 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGVECTOR_H -#define TQGVECTOR_H - -#ifndef QT_H -#include "qptrcollection.h" -#endif // QT_H - - -class Q_EXPORT TQGVector : public TQPtrCollection // generic vector -{ -friend class TQGList; // needed by TQGList::toVector -public: -#ifndef QT_NO_DATASTREAM - TQDataStream &read( TQDataStream & ); // read vector from stream - TQDataStream &write( TQDataStream & ) const; // write vector to stream -#endif - virtual int compareItems( Item, Item ); - -protected: - TQGVector(); // create empty vector - TQGVector( uint size ); // create vector with nullptrs - TQGVector( const TQGVector &v ); // make copy of other vector - ~TQGVector(); - - TQGVector &operator=( const TQGVector &v ); // assign from other vector - bool operator==( const TQGVector &v ) const; - - Item *data() const { return vec; } - uint size() const { return len; } - uint count() const { return numItems; } - - bool insert( uint index, Item ); // insert item at index - bool remove( uint index ); // remove item - Item take( uint index ); // take out item - - void clear(); // clear vector - bool resize( uint newsize ); // resize vector - - bool fill( Item, int flen ); // resize and fill vector - - void sort(); // sort vector - int bsearch( Item ) const; // binary search (when sorted) - - int findRef( Item, uint index ) const; // find exact item in vector - int find( Item, uint index ) const; // find equal item in vector - uint containsRef( Item ) const; // get number of exact matches - uint contains( Item ) const; // get number of equal matches - - Item at( uint index ) const // return indexed item - { -#if defined(QT_CHECK_RANGE) - if ( index >= len ) - warningIndexRange( index ); -#endif - return vec[index]; - } - - bool insertExpand( uint index, Item ); // insert, expand if necessary - - void toList( TQGList * ) const; // put items in list - -#ifndef QT_NO_DATASTREAM - virtual TQDataStream &read( TQDataStream &, Item & ); - virtual TQDataStream &write( TQDataStream &, Item ) const; -#endif -private: - Item *vec; - uint len; - uint numItems; - - static void warningIndexRange( uint ); -}; - - -/***************************************************************************** - TQGVector stream functions - *****************************************************************************/ - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQGVector & ); -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQGVector & ); -#endif - -#endif // TQGVECTOR_H diff --git a/src/tools/qintcache.h b/src/tools/qintcache.h deleted file mode 100644 index b3401b621..000000000 --- a/src/tools/qintcache.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Definition of TQIntCache template class -** -** Created : 950209 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQINTCACHE_H -#define TQINTCACHE_H - -#ifndef QT_H -#include "qgcache.h" -#endif // QT_H - - -template -class TQIntCache -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGCache -#endif -{ -public: - TQIntCache( const TQIntCache &c ) : TQGCache(c) {} - TQIntCache( int maxCost=100, int size=17 ) - : TQGCache( maxCost, size, IntKey, FALSE, FALSE ) {} - ~TQIntCache() { clear(); } - TQIntCache &operator=( const TQIntCache &c ) - { return (TQIntCache&)TQGCache::operator=(c); } - int maxCost() const { return TQGCache::maxCost(); } - int totalCost() const { return TQGCache::totalCost(); } - void setMaxCost( int m) { TQGCache::setMaxCost(m); } - uint count() const { return TQGCache::count(); } - uint size() const { return TQGCache::size(); } - bool isEmpty() const { return TQGCache::count() == 0; } - bool insert( long k, const type *d, int c=1, int p=0 ) - { return TQGCache::insert_other((const char*)k,(Item)d,c,p); } - bool remove( long k ) - { return TQGCache::remove_other((const char*)k); } - type *take( long k ) - { return (type *)TQGCache::take_other((const char*)k);} - void clear() { TQGCache::clear(); } - type *find( long k, bool ref=TRUE ) const - { return (type *)TQGCache::find_other( (const char*)k,ref);} - type *operator[]( long k ) const - { return (type *)TQGCache::find_other( (const char*)k); } - void statistics() const { TQGCache::statistics(); } -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQIntCache::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQIntCache::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -template -class TQIntCacheIterator : public TQGCacheIterator -{ -public: - TQIntCacheIterator( const TQIntCache &c ) - : TQGCacheIterator( (TQGCache &)c ) {} - TQIntCacheIterator( const TQIntCacheIterator &ci ) - : TQGCacheIterator((TQGCacheIterator &)ci) {} - TQIntCacheIterator &operator=( const TQIntCacheIterator&ci ) - { return ( TQIntCacheIterator&)TQGCacheIterator::operator=( ci );} - uint count() const { return TQGCacheIterator::count(); } - bool isEmpty() const { return TQGCacheIterator::count() == 0; } - bool atFirst() const { return TQGCacheIterator::atFirst(); } - bool atLast() const { return TQGCacheIterator::atLast(); } - type *toFirst() { return (type *)TQGCacheIterator::toFirst(); } - type *toLast() { return (type *)TQGCacheIterator::toLast(); } - operator type *() const { return (type *)TQGCacheIterator::get(); } - type *current() const { return (type *)TQGCacheIterator::get(); } - long currentKey() const { return (long)TQGCacheIterator::getKeyInt();} - type *operator()() { return (type *)TQGCacheIterator::operator()();} - type *operator++() { return (type *)TQGCacheIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGCacheIterator::operator+=(j);} - type *operator--() { return (type *)TQGCacheIterator::operator--(); } - type *operator-=(uint j) { return (type *)TQGCacheIterator::operator-=(j);} -}; - - -#endif // TQINTCACHE_H diff --git a/src/tools/qintdict.h b/src/tools/qintdict.h deleted file mode 100644 index e6a70c5de..000000000 --- a/src/tools/qintdict.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Definition of TQIntDict template class -** -** Created : 940624 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQINTDICT_H -#define TQINTDICT_H - -#ifndef QT_H -#include "qgdict.h" -#endif // QT_H - -template -class TQIntDict -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGDict -#endif -{ -public: - TQIntDict(int size=17) : TQGDict(size,IntKey,0,0) {} - TQIntDict( const TQIntDict &d ) : TQGDict(d) {} - ~TQIntDict() { clear(); } - TQIntDict &operator=(const TQIntDict &d) - { return (TQIntDict&)TQGDict::operator=(d); } - uint count() const { return TQGDict::count(); } - uint size() const { return TQGDict::size(); } - bool isEmpty() const { return TQGDict::count() == 0; } - void insert( long k, const type *d ) - { TQGDict::look_int(k,(Item)d,1); } - void replace( long k, const type *d ) - { TQGDict::look_int(k,(Item)d,2); } - bool remove( long k ) { return TQGDict::remove_int(k); } - type *take( long k ) { return (type*)TQGDict::take_int(k); } - type *find( long k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_int(k,0,0); } - type *operator[]( long k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_int(k,0,0); } - void clear() { TQGDict::clear(); } - void resize( uint n ) { TQGDict::resize(n); } - void statistics() const { TQGDict::statistics(); } - -#ifdef Q_QDOC -protected: - virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); - virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQIntDict::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQIntDict::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type*)d; -} - -template -class TQIntDictIterator : public TQGDictIterator -{ -public: - TQIntDictIterator(const TQIntDict &d) :TQGDictIterator((TQGDict &)d) {} - ~TQIntDictIterator() {} - uint count() const { return dict->count(); } - bool isEmpty() const { return dict->count() == 0; } - type *toFirst() { return (type *)TQGDictIterator::toFirst(); } - operator type *() const { return (type *)TQGDictIterator::get(); } - type *current() const { return (type *)TQGDictIterator::get(); } - long currentKey() const { return TQGDictIterator::getKeyInt(); } - type *operator()() { return (type *)TQGDictIterator::operator()(); } - type *operator++() { return (type *)TQGDictIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j);} -}; - -#define Q_DEFINED_QINTDICT -#include "qwinexport.h" -#endif // TQINTDICT_H diff --git a/src/tools/qiodevice.cpp b/src/tools/qiodevice.cpp index 74fbb9f7e..64c39915f 100644 --- a/src/tools/qiodevice.cpp +++ b/src/tools/qiodevice.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qiodevice.h" +#include "ntqiodevice.h" /*! - \class TQIODevice qiodevice.h + \class TQIODevice ntqiodevice.h \reentrant \brief The TQIODevice class is the base class of I/O devices. diff --git a/src/tools/qiodevice.h b/src/tools/qiodevice.h deleted file mode 100644 index 2d8d7affa..000000000 --- a/src/tools/qiodevice.h +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** -** -** Definition of TQIODevice class -** -** Created : 940913 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQIODEVICE_H -#define TQIODEVICE_H - -#ifndef QT_H -#include "qglobal.h" -#include "qcstring.h" -#endif // QT_H - - -// IO device access types - -#define IO_Direct 0x0100 // direct access device -#define IO_Sequential 0x0200 // sequential access device -#define IO_Combined 0x0300 // combined direct/sequential -#define IO_TypeMask 0x0f00 - -// IO handling modes - -#define IO_Raw 0x0040 // raw access (not buffered) -#define IO_Async 0x0080 // asynchronous mode - -// IO device open modes - -#define IO_ReadOnly 0x0001 // readable device -#define IO_WriteOnly 0x0002 // writable device -#define IO_ReadWrite 0x0003 // read+write device -#define IO_Append 0x0004 // append -#define IO_Truncate 0x0008 // truncate device -#define IO_Translate 0x0010 // translate CR+LF -#define IO_ModeMask 0x00ff - -// IO device state - -#define IO_Open 0x1000 // device is open -#define IO_StateMask 0xf000 - -// IO device status - -#define IO_Ok 0 -#define IO_ReadError 1 // read error -#define IO_WriteError 2 // write error -#define IO_FatalError 3 // fatal unrecoverable error -#define IO_ResourceError 4 // resource limitation -#define IO_OpenError 5 // cannot open device -#define IO_ConnectError 5 // cannot connect to device -#define IO_AbortError 6 // abort error -#define IO_TimeOutError 7 // time out -#define IO_UnspecifiedError 8 // unspecified error - - -class Q_EXPORT TQIODevice -{ -public: -#if defined(QT_ABI_QT4) - typedef Q_LLONG Offset; -#else - typedef Q_ULONG Offset; -#endif - - TQIODevice(); - virtual ~TQIODevice(); - - int flags() const { return ioMode; } - int mode() const { return ioMode & IO_ModeMask; } - int state() const { return ioMode & IO_StateMask; } - - bool isDirectAccess() const { return ((ioMode & IO_Direct) == IO_Direct); } - bool isSequentialAccess() const { return ((ioMode & IO_Sequential) == IO_Sequential); } - bool isCombinedAccess() const { return ((ioMode & IO_Combined) == IO_Combined); } - bool isBuffered() const { return ((ioMode & IO_Raw) != IO_Raw); } - bool isRaw() const { return ((ioMode & IO_Raw) == IO_Raw); } - bool isSynchronous() const { return ((ioMode & IO_Async) != IO_Async); } - bool isAsynchronous() const { return ((ioMode & IO_Async) == IO_Async); } - bool isTranslated() const { return ((ioMode & IO_Translate) == IO_Translate); } - bool isReadable() const { return ((ioMode & IO_ReadOnly) == IO_ReadOnly); } - bool isWritable() const { return ((ioMode & IO_WriteOnly) == IO_WriteOnly); } - bool isReadWrite() const { return ((ioMode & IO_ReadWrite) == IO_ReadWrite); } - bool isInactive() const { return state() == 0; } - bool isOpen() const { return state() == IO_Open; } - - int status() const { return ioSt; } - void resetStatus() { ioSt = IO_Ok; } - - virtual bool open( int mode ) = 0; - virtual void close() = 0; - virtual void flush() = 0; - - virtual Offset size() const = 0; - virtual Offset at() const; - virtual bool at( Offset ); - virtual bool atEnd() const; - bool reset() { return at(0); } - - virtual Q_LONG readBlock( char *data, Q_ULONG maxlen ) = 0; - virtual Q_LONG writeBlock( const char *data, Q_ULONG len ) = 0; - virtual Q_LONG readLine( char *data, Q_ULONG maxlen ); - Q_LONG writeBlock( const TQByteArray& data ); - virtual TQByteArray readAll(); - - virtual int getch() = 0; - virtual int putch( int ) = 0; - virtual int ungetch( int ) = 0; - -protected: - void setFlags( int f ) { ioMode = f; } - void setType( int ); - void setMode( int ); - void setState( int ); - void setStatus( int ); - Offset ioIndex; - -private: - int ioMode; - int ioSt; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQIODevice( const TQIODevice & ); - TQIODevice &operator=( const TQIODevice & ); -#endif -}; - - -#endif // TQIODEVICE_H diff --git a/src/tools/qlibrary.cpp b/src/tools/qlibrary.cpp index 71b533a81..a96e0c068 100644 --- a/src/tools/qlibrary.cpp +++ b/src/tools/qlibrary.cpp @@ -40,8 +40,8 @@ #include "qplatformdefs.h" #include -#include -#include +#include +#include #ifndef QT_NO_LIBRARY @@ -69,7 +69,7 @@ TQLibraryPrivate::TQLibraryPrivate( TQLibrary *lib ) /*! - \class TQLibrary qlibrary.h + \class TQLibrary ntqlibrary.h \reentrant \brief The TQLibrary class provides a wrapper for handling shared libraries. diff --git a/src/tools/qlibrary.h b/src/tools/qlibrary.h deleted file mode 100644 index 899333fc0..000000000 --- a/src/tools/qlibrary.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Definition of TQLibrary class -** -** Created : 000101 -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLIBRARY_H -#define TQLIBRARY_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_LIBRARY - -class TQLibraryPrivate; - -class Q_EXPORT TQLibrary -{ -public: - TQLibrary( const TQString& filename ); - virtual ~TQLibrary(); - - void *resolve( const char* ); - static void *resolve( const TQString &filename, const char * ); - - bool load(); - virtual bool unload(); - bool isLoaded() const; - - bool autoUnload() const; - void setAutoUnload( bool enable ); - - TQString library() const; - -private: - TQLibraryPrivate *d; - - TQString libfile; - uint aunload : 1; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQLibrary( const TQLibrary & ); - TQLibrary &operator=( const TQLibrary & ); -#endif -}; - -#define Q_DEFINED_QLIBRARY -#include "qwinexport.h" -#endif //QT_NO_LIBRARY -#endif //TQLIBRARY_H diff --git a/src/tools/qlibrary_p.h b/src/tools/qlibrary_p.h index cf603e9a4..c2e4166b1 100644 --- a/src/tools/qlibrary_p.h +++ b/src/tools/qlibrary_p.h @@ -53,12 +53,12 @@ // // -#include "qlibrary.h" +#include "ntqlibrary.h" #ifndef QT_NO_LIBRARY #ifndef QT_H -#include "qwindowdefs.h" +#include "ntqwindowdefs.h" #endif // QT_H class TQLibraryPrivate diff --git a/src/tools/qlocale.cpp b/src/tools/qlocale.cpp index 59d23f804..dd1769216 100644 --- a/src/tools/qlocale.cpp +++ b/src/tools/qlocale.cpp @@ -43,12 +43,12 @@ #include #include -#include "qlocale.h" +#include "ntqlocale.h" #include "qlocale_p.h" -#include "qnamespace.h" +#include "ntqnamespace.h" #ifdef QT_QLOCALE_USES_FCVT -# include +# include # include #endif diff --git a/src/tools/qlocale.h b/src/tools/qlocale.h deleted file mode 100644 index 955669c9e..000000000 --- a/src/tools/qlocale.h +++ /dev/null @@ -1,494 +0,0 @@ -/**************************************************************************** -** -** Declaration of the TQLocale class -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLOCALE_H -#define TQLOCALE_H - -#include "qstring.h" - -struct TQLocalePrivate; - -class Q_EXPORT TQLocale -{ - friend class TQString; - -public: - enum Language { - C = 1, - Abkhazian = 2, - Afan = 3, - Afar = 4, - Afrikaans = 5, - Albanian = 6, - Amharic = 7, - Arabic = 8, - Armenian = 9, - Assamese = 10, - Aymara = 11, - Azerbaijani = 12, - Bashkir = 13, - Basque = 14, - Bengali = 15, - Bhutani = 16, - Bihari = 17, - Bislama = 18, - Breton = 19, - Bulgarian = 20, - Burmese = 21, - Byelorussian = 22, - Cambodian = 23, - Catalan = 24, - Chinese = 25, - Corsican = 26, - Croatian = 27, - Czech = 28, - Danish = 29, - Dutch = 30, - English = 31, - Esperanto = 32, - Estonian = 33, - Faroese = 34, - FijiLanguage = 35, - Finnish = 36, - French = 37, - Frisian = 38, - Gaelic = 39, - Galician = 40, - Georgian = 41, - German = 42, - Greek = 43, - Greenlandic = 44, - Guarani = 45, - Gujarati = 46, - Hausa = 47, - Hebrew = 48, - Hindi = 49, - Hungarian = 50, - Icelandic = 51, - Indonesian = 52, - Interlingua = 53, - Interlingue = 54, - Inuktitut = 55, - Inupiak = 56, - Irish = 57, - Italian = 58, - Japanese = 59, - Javanese = 60, - Kannada = 61, - Kashmiri = 62, - Kazakh = 63, - Kinyarwanda = 64, - Kirghiz = 65, - Korean = 66, - Kurdish = 67, - Kurundi = 68, - Laothian = 69, - Latin = 70, - Latvian = 71, - Lingala = 72, - Lithuanian = 73, - Macedonian = 74, - Malagasy = 75, - Malay = 76, - Malayalam = 77, - Maltese = 78, - Maori = 79, - Marathi = 80, - Moldavian = 81, - Mongolian = 82, - NauruLanguage = 83, - Nepali = 84, - Norwegian = 85, - Occitan = 86, - Oriya = 87, - Pashto = 88, - Persian = 89, - Polish = 90, - Portuguese = 91, - Punjabi = 92, - Quechua = 93, - RhaetoRomance = 94, - Romanian = 95, - Russian = 96, - Samoan = 97, - Sangho = 98, - Sanskrit = 99, - Serbian = 100, - SerboCroatian = 101, - Sesotho = 102, - Setswana = 103, - Shona = 104, - Sindhi = 105, - Singhalese = 106, - Siswati = 107, - Slovak = 108, - Slovenian = 109, - Somali = 110, - Spanish = 111, - Sundanese = 112, - Swahili = 113, - Swedish = 114, - Tagalog = 115, - Tajik = 116, - Tamil = 117, - Tatar = 118, - Telugu = 119, - Thai = 120, - Tibetan = 121, - Tigrinya = 122, - TongaLanguage = 123, - Tsonga = 124, - Turkish = 125, - Turkmen = 126, - Twi = 127, - Uigur = 128, - Ukrainian = 129, - Urdu = 130, - Uzbek = 131, - Vietnamese = 132, - Volapuk = 133, - Welsh = 134, - Wolof = 135, - Xhosa = 136, - Yiddish = 137, - Yoruba = 138, - Zhuang = 139, - Zulu = 140, - LastLanguage = Zulu - }; - - enum Country { - AnyCountry = 0, - Afghanistan = 1, - Albania = 2, - Algeria = 3, - AmericanSamoa = 4, - Andorra = 5, - Angola = 6, - Anguilla = 7, - Antarctica = 8, - AntiguaAndBarbuda = 9, - Argentina = 10, - Armenia = 11, - Aruba = 12, - Australia = 13, - Austria = 14, - Azerbaijan = 15, - Bahamas = 16, - Bahrain = 17, - Bangladesh = 18, - Barbados = 19, - Belarus = 20, - Belgium = 21, - Belize = 22, - Benin = 23, - Bermuda = 24, - Bhutan = 25, - Bolivia = 26, - BosniaAndHerzegowina = 27, - Botswana = 28, - BouvetIsland = 29, - Brazil = 30, - BritishIndianOceanTerritory = 31, - BruneiDarussalam = 32, - Bulgaria = 33, - BurkinaFaso = 34, - Burundi = 35, - Cambodia = 36, - Cameroon = 37, - Canada = 38, - CapeVerde = 39, - CaymanIslands = 40, - CentralAfricanRepublic = 41, - Chad = 42, - Chile = 43, - China = 44, - ChristmasIsland = 45, - CocosIslands = 46, - Colombia = 47, - Comoros = 48, - DemocraticRepublicOfCongo = 49, - PeoplesRepublicOfCongo = 50, - CookIslands = 51, - CostaRica = 52, - IvoryCoast = 53, - Croatia = 54, - Cuba = 55, - Cyprus = 56, - CzechRepublic = 57, - Denmark = 58, - Djibouti = 59, - Dominica = 60, - DominicanRepublic = 61, - EastTimor = 62, - Ecuador = 63, - Egypt = 64, - ElSalvador = 65, - EquatorialGuinea = 66, - Eritrea = 67, - Estonia = 68, - Ethiopia = 69, - FalklandIslands = 70, - FaroeIslands = 71, - FijiCountry = 72, - Finland = 73, - France = 74, - MetropolitanFrance = 75, - FrenchGuiana = 76, - FrenchPolynesia = 77, - FrenchSouthernTerritories = 78, - Gabon = 79, - Gambia = 80, - Georgia = 81, - Germany = 82, - Ghana = 83, - Gibraltar = 84, - Greece = 85, - Greenland = 86, - Grenada = 87, - Guadeloupe = 88, - Guam = 89, - Guatemala = 90, - Guinea = 91, - GuineaBissau = 92, - Guyana = 93, - Haiti = 94, - HeardAndMcDonaldIslands = 95, - Honduras = 96, - HongKong = 97, - Hungary = 98, - Iceland = 99, - India = 100, - Indonesia = 101, - Iran = 102, - Iraq = 103, - Ireland = 104, - Israel = 105, - Italy = 106, - Jamaica = 107, - Japan = 108, - Jordan = 109, - Kazakhstan = 110, - Kenya = 111, - Kiribati = 112, - DemocraticRepublicOfKorea = 113, - RepublicOfKorea = 114, - Kuwait = 115, - Kyrgyzstan = 116, - Lao = 117, - Latvia = 118, - Lebanon = 119, - Lesotho = 120, - Liberia = 121, - LibyanArabJamahiriya = 122, - Liechtenstein = 123, - Lithuania = 124, - Luxembourg = 125, - Macau = 126, - Macedonia = 127, - Madagascar = 128, - Malawi = 129, - Malaysia = 130, - Maldives = 131, - Mali = 132, - Malta = 133, - MarshallIslands = 134, - Martinique = 135, - Mauritania = 136, - Mauritius = 137, - Mayotte = 138, - Mexico = 139, - Micronesia = 140, - Moldova = 141, - Monaco = 142, - Mongolia = 143, - Montserrat = 144, - Morocco = 145, - Mozambique = 146, - Myanmar = 147, - Namibia = 148, - NauruCountry = 149, - Nepal = 150, - Netherlands = 151, - NetherlandsAntilles = 152, - NewCaledonia = 153, - NewZealand = 154, - Nicaragua = 155, - Niger = 156, - Nigeria = 157, - Niue = 158, - NorfolkIsland = 159, - NorthernMarianaIslands = 160, - Norway = 161, - Oman = 162, - Pakistan = 163, - Palau = 164, - PalestinianTerritory = 165, - Panama = 166, - PapuaNewGuinea = 167, - Paraguay = 168, - Peru = 169, - Philippines = 170, - Pitcairn = 171, - Poland = 172, - Portugal = 173, - PuertoRico = 174, - Qatar = 175, - Reunion = 176, - Romania = 177, - RussianFederation = 178, - Rwanda = 179, - SaintKittsAndNevis = 180, - StLucia = 181, - StVincentAndTheGrenadines = 182, - Samoa = 183, - SanMarino = 184, - SaoTomeAndPrincipe = 185, - SaudiArabia = 186, - Senegal = 187, - Seychelles = 188, - SierraLeone = 189, - Singapore = 190, - Slovakia = 191, - Slovenia = 192, - SolomonIslands = 193, - Somalia = 194, - SouthAfrica = 195, - SouthGeorgiaAndTheSouthSandwichIslands = 196, - Spain = 197, - SriLanka = 198, - StHelena = 199, - StPierreAndMiquelon = 200, - Sudan = 201, - Suriname = 202, - SvalbardAndJanMayenIslands = 203, - Swaziland = 204, - Sweden = 205, - Switzerland = 206, - SyrianArabRepublic = 207, - Taiwan = 208, - Tajikistan = 209, - Tanzania = 210, - Thailand = 211, - Togo = 212, - Tokelau = 213, - TongaCountry = 214, - TrinidadAndTobago = 215, - Tunisia = 216, - Turkey = 217, - Turkmenistan = 218, - TurksAndCaicosIslands = 219, - Tuvalu = 220, - Uganda = 221, - Ukraine = 222, - UnitedArabEmirates = 223, - UnitedKingdom = 224, - UnitedStates = 225, - UnitedStatesMinorOutlyingIslands = 226, - Uruguay = 227, - Uzbekistan = 228, - Vanuatu = 229, - VaticanCityState = 230, - Venezuela = 231, - VietNam = 232, - BritishVirginIslands = 233, - USVirginIslands = 234, - WallisAndFutunaIslands = 235, - WesternSahara = 236, - Yemen = 237, - Yugoslavia = 238, - Zambia = 239, - Zimbabwe = 240, - LastCountry = Zimbabwe - }; - - TQLocale(); - TQLocale(const TQString &name); - TQLocale(Language language, Country country = AnyCountry); - TQLocale(const TQLocale &other); - - TQLocale &operator=(const TQLocale &other); - - Language language() const; - Country country() const; - TQString name() const; - - short toShort(const TQString &s, bool *ok = 0) const; - ushort toUShort(const TQString &s, bool *ok = 0) const; - int toInt(const TQString &s, bool *ok = 0) const; - uint toUInt(const TQString &s, bool *ok = 0) const; - Q_LONG toLong(const TQString &s, bool *ok = 0) const; - Q_ULONG toULong(const TQString &s, bool *ok = 0) const; - Q_LLONG toLongLong(const TQString &s, bool *ok = 0) const; - Q_ULLONG toULongLong(const TQString &s, bool *ok = 0) const; - float toFloat(const TQString &s, bool *ok = 0) const; - double toDouble(const TQString &s, bool *ok = 0) const; - - TQString toString(short i) const - { return toString((Q_LLONG)i); } - TQString toString(ushort i) const - { return toString((Q_ULLONG)i); } - TQString toString(int i) const - { return toString((Q_LLONG)i); } - TQString toString(uint i) const - { return toString((Q_ULLONG)i); } -#if !defined(Q_OS_WIN64) - TQString toString(Q_LONG i) const - { return toString((Q_LLONG)i); } - TQString toString(Q_ULONG i) const - { return toString((Q_ULLONG)i); } -#endif - TQString toString(Q_LLONG i) const; - TQString toString(Q_ULLONG i) const; - TQString toString(float i, char f = 'g', int prec = 6) const - { return toString((double) i, f, prec); } - TQString toString(double i, char f = 'g', int prec = 6) const; - - static TQString languageToString(Language language); - static TQString countryToString(Country country); - static void setDefault(const TQLocale &locale); - - static TQLocale c() { return TQLocale(C); } - static TQLocale system(); - -private: - const TQLocalePrivate *d; - static const TQLocalePrivate *default_d; -}; - -#endif diff --git a/src/tools/qlocale_p.h b/src/tools/qlocale_p.h index a11c4ec76..1b80a4c8b 100644 --- a/src/tools/qlocale_p.h +++ b/src/tools/qlocale_p.h @@ -51,7 +51,7 @@ // // -#include +#include struct TQLocalePrivate { diff --git a/src/tools/qmap.cpp b/src/tools/qmap.cpp index e74c8ccf7..4c2884501 100644 --- a/src/tools/qmap.cpp +++ b/src/tools/qmap.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qmap.h" +#include "ntqmap.h" typedef TQMapNodeBase* NodePtr; typedef TQMapNodeBase Node; diff --git a/src/tools/qmap.h b/src/tools/qmap.h deleted file mode 100644 index 372e6da68..000000000 --- a/src/tools/qmap.h +++ /dev/null @@ -1,877 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMap class -** -** Created : 990406 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMAP_H -#define TQMAP_H - -#ifndef QT_H -#include "qglobal.h" -#include "qshared.h" -#include "qdatastream.h" -#include "qpair.h" -#include "qvaluelist.h" -#endif // QT_H - -#ifndef QT_NO_STL -#include -#include -#include -#endif - -//#define QT_CHECK_MAP_RANGE - -struct Q_EXPORT TQMapNodeBase -{ - enum Color { Red, Black }; - - TQMapNodeBase* left; - TQMapNodeBase* right; - TQMapNodeBase* parent; - - Color color; - - TQMapNodeBase* minimum() { - TQMapNodeBase* x = this; - while ( x->left ) - x = x->left; - return x; - } - - TQMapNodeBase* maximum() { - TQMapNodeBase* x = this; - while ( x->right ) - x = x->right; - return x; - } -}; - - -template -struct TQMapNode : public TQMapNodeBase -{ - TQMapNode( const K& _key, const T& _data ) { data = _data; key = _key; } - TQMapNode( const K& _key ) { key = _key; } - TQMapNode( const TQMapNode& _n ) { key = _n.key; data = _n.data; } - TQMapNode() { } - T data; - K key; -}; - - -template -class TQMapIterator -{ - public: - /** - * Typedefs - */ - typedef TQMapNode< K, T >* NodePtr; -#ifndef QT_NO_STL - typedef std::bidirectional_iterator_tag iterator_category; -#endif - typedef T value_type; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - typedef T* pointer; - typedef T& reference; - - /** - * Variables - */ - TQMapNode* node; - - /** - * Functions - */ - TQMapIterator() : node( 0 ) {} - TQMapIterator( TQMapNode* p ) : node( p ) {} - TQMapIterator( const TQMapIterator& it ) : node( it.node ) {} - - bool operator==( const TQMapIterator& it ) const { return node == it.node; } - bool operator!=( const TQMapIterator& it ) const { return node != it.node; } - T& operator*() { return node->data; } - const T& operator*() const { return node->data; } - // UDT for T = x* - // T* operator->() const { return &node->data; } - - const K& key() const { return node->key; } - T& data() { return node->data; } - const T& data() const { return node->data; } - -private: - int inc(); - int dec(); - -public: - TQMapIterator& operator++() { - inc(); - return *this; - } - - TQMapIterator operator++(int) { - TQMapIterator tmp = *this; - inc(); - return tmp; - } - - TQMapIterator& operator--() { - dec(); - return *this; - } - - TQMapIterator operator--(int) { - TQMapIterator tmp = *this; - dec(); - return tmp; - } -}; - -template -Q_INLINE_TEMPLATES int TQMapIterator::inc() -{ - TQMapNodeBase* tmp = node; - if ( tmp->right ) { - tmp = tmp->right; - while ( tmp->left ) - tmp = tmp->left; - } else { - TQMapNodeBase* y = tmp->parent; - while (tmp == y->right) { - tmp = y; - y = y->parent; - } - if (tmp->right != y) - tmp = y; - } - node = (NodePtr)tmp; - return 0; -} - -template -Q_INLINE_TEMPLATES int TQMapIterator::dec() -{ - TQMapNodeBase* tmp = node; - if (tmp->color == TQMapNodeBase::Red && - tmp->parent->parent == tmp ) { - tmp = tmp->right; - } else if (tmp->left != 0) { - TQMapNodeBase* y = tmp->left; - while ( y->right ) - y = y->right; - tmp = y; - } else { - TQMapNodeBase* y = tmp->parent; - while (tmp == y->left) { - tmp = y; - y = y->parent; - } - tmp = y; - } - node = (NodePtr)tmp; - return 0; -} - -template -class TQMapConstIterator -{ - public: - /** - * Typedefs - */ - typedef TQMapNode< K, T >* NodePtr; -#ifndef QT_NO_STL - typedef std::bidirectional_iterator_tag iterator_category; -#endif - typedef T value_type; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - typedef const T* pointer; - typedef const T& reference; - - - /** - * Variables - */ - TQMapNode* node; - - /** - * Functions - */ - TQMapConstIterator() : node( 0 ) {} - TQMapConstIterator( TQMapNode* p ) : node( p ) {} - TQMapConstIterator( const TQMapConstIterator& it ) : node( it.node ) {} - TQMapConstIterator( const TQMapIterator& it ) : node( it.node ) {} - - bool operator==( const TQMapConstIterator& it ) const { return node == it.node; } - bool operator!=( const TQMapConstIterator& it ) const { return node != it.node; } - const T& operator*() const { return node->data; } - // UDT for T = x* - // const T* operator->() const { return &node->data; } - - const K& key() const { return node->key; } - const T& data() const { return node->data; } - -private: - int inc(); - int dec(); - -public: - TQMapConstIterator& operator++() { - inc(); - return *this; - } - - TQMapConstIterator operator++(int) { - TQMapConstIterator tmp = *this; - inc(); - return tmp; - } - - TQMapConstIterator& operator--() { - dec(); - return *this; - } - - TQMapConstIterator operator--(int) { - TQMapConstIterator tmp = *this; - dec(); - return tmp; - } -}; - -template -Q_INLINE_TEMPLATES int TQMapConstIterator::inc() -{ - TQMapNodeBase* tmp = node; - if ( tmp->right ) { - tmp = tmp->right; - while ( tmp->left ) - tmp = tmp->left; - } else { - TQMapNodeBase* y = tmp->parent; - while (tmp == y->right) { - tmp = y; - y = y->parent; - } - if (tmp->right != y) - tmp = y; - } - node = (NodePtr)tmp; - return 0; -} - -template -Q_INLINE_TEMPLATES int TQMapConstIterator::dec() -{ - TQMapNodeBase* tmp = node; - if (tmp->color == TQMapNodeBase::Red && - tmp->parent->parent == tmp ) { - tmp = tmp->right; - } else if (tmp->left != 0) { - TQMapNodeBase* y = tmp->left; - while ( y->right ) - y = y->right; - tmp = y; - } else { - TQMapNodeBase* y = tmp->parent; - while (tmp == y->left) { - tmp = y; - y = y->parent; - } - tmp = y; - } - node = (NodePtr)tmp; - return 0; -} - -// ### 4.0: rename to something without Private in it. Not really internal. -class Q_EXPORT TQMapPrivateBase : public TQShared -{ -public: - TQMapPrivateBase() { - node_count = 0; - } - TQMapPrivateBase( const TQMapPrivateBase* _map) { - node_count = _map->node_count; - } - - /** - * Implementations of basic tree algorithms - */ - void rotateLeft( TQMapNodeBase* x, TQMapNodeBase*& root); - void rotateRight( TQMapNodeBase* x, TQMapNodeBase*& root ); - void rebalance( TQMapNodeBase* x, TQMapNodeBase*& root ); - TQMapNodeBase* removeAndRebalance( TQMapNodeBase* z, TQMapNodeBase*& root, - TQMapNodeBase*& leftmost, - TQMapNodeBase*& rightmost ); - - /** - * Variables - */ - int node_count; -}; - - -template -class TQMapPrivate : public TQMapPrivateBase -{ -public: - /** - * Typedefs - */ - typedef TQMapIterator< Key, T > Iterator; - typedef TQMapConstIterator< Key, T > ConstIterator; - typedef TQMapNode< Key, T > Node; - typedef TQMapNode< Key, T >* NodePtr; - - /** - * Functions - */ - TQMapPrivate(); - TQMapPrivate( const TQMapPrivate< Key, T >* _map ); - ~TQMapPrivate() { clear(); delete header; } - - NodePtr copy( NodePtr p ); - void clear(); - void clear( NodePtr p ); - - Iterator begin() { return Iterator( (NodePtr)(header->left ) ); } - Iterator end() { return Iterator( header ); } - ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); } - ConstIterator end() const { return ConstIterator( header ); } - - ConstIterator find(const Key& k) const; - - void remove( Iterator it ) { - NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right ); - delete del; - --node_count; - } - -#ifdef QT_QMAP_DEBUG - void inorder( TQMapNodeBase* x = 0, int level = 0 ){ - if ( !x ) - x = header->parent; - if ( x->left ) - inorder( x->left, level + 1 ); - //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl; - if ( x->right ) - inorder( x->right, level + 1 ); - } -#endif - -#if 0 - Iterator insertMulti(const Key& v){ - TQMapNodeBase* y = header; - TQMapNodeBase* x = header->parent; - while (x != 0){ - y = x; - x = ( v < key(x) ) ? x->left : x->right; - } - return insert(x, y, v); - } -#endif - - Iterator insertSingle( const Key& k ); - Iterator insert( TQMapNodeBase* x, TQMapNodeBase* y, const Key& k ); - -protected: - /** - * Helpers - */ - const Key& key( TQMapNodeBase* b ) const { return ((NodePtr)b)->key; } - - /** - * Variables - */ - NodePtr header; -}; - - -template -Q_INLINE_TEMPLATES TQMapPrivate::TQMapPrivate() { - header = new Node; - header->color = TQMapNodeBase::Red; // Mark the header - header->parent = 0; - header->left = header->right = header; -} -template -Q_INLINE_TEMPLATES TQMapPrivate::TQMapPrivate( const TQMapPrivate< Key, T >* _map ) : TQMapPrivateBase( _map ) { - header = new Node; - header->color = TQMapNodeBase::Red; // Mark the header - if ( _map->header->parent == 0 ) { - header->parent = 0; - header->left = header->right = header; - } else { - header->parent = copy( (NodePtr)(_map->header->parent) ); - header->parent->parent = header; - header->left = header->parent->minimum(); - header->right = header->parent->maximum(); - } -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::NodePtr TQMapPrivate::copy( Q_TYPENAME TQMapPrivate::NodePtr p ) -{ - if ( !p ) - return 0; - NodePtr n = new Node( *p ); - n->color = p->color; - if ( p->left ) { - n->left = copy( (NodePtr)(p->left) ); - n->left->parent = n; - } else { - n->left = 0; - } - if ( p->right ) { - n->right = copy( (NodePtr)(p->right) ); - n->right->parent = n; - } else { - n->right = 0; - } - return n; -} - -template -Q_INLINE_TEMPLATES void TQMapPrivate::clear() -{ - clear( (NodePtr)(header->parent) ); - header->color = TQMapNodeBase::Red; - header->parent = 0; - header->left = header->right = header; - node_count = 0; -} - -template -Q_INLINE_TEMPLATES void TQMapPrivate::clear( Q_TYPENAME TQMapPrivate::NodePtr p ) -{ - while ( p != 0 ) { - clear( (NodePtr)p->right ); - NodePtr y = (NodePtr)p->left; - delete p; - p = y; - } -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::ConstIterator TQMapPrivate::find(const Key& k) const -{ - TQMapNodeBase* y = header; // Last node - TQMapNodeBase* x = header->parent; // Root node. - - while ( x != 0 ) { - // If as k <= key(x) go left - if ( !( key(x) < k ) ) { - y = x; - x = x->left; - } else { - x = x->right; - } - } - - // Was k bigger/smaller then the biggest/smallest - // element of the tree ? Return end() - if ( y == header || k < key(y) ) - return ConstIterator( header ); - return ConstIterator( (NodePtr)y ); -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::Iterator TQMapPrivate::insertSingle( const Key& k ) -{ - // Search correct position in the tree - TQMapNodeBase* y = header; - TQMapNodeBase* x = header->parent; - bool result = TRUE; - while ( x != 0 ) { - result = ( k < key(x) ); - y = x; - x = result ? x->left : x->right; - } - // Get iterator on the last not empty one - Iterator j( (NodePtr)y ); - if ( result ) { - // Smaller then the leftmost one ? - if ( j == begin() ) { - return insert(x, y, k ); - } else { - // Perhaps daddy is the right one ? - --j; - } - } - // Really bigger ? - if ( (j.node->key) < k ) - return insert(x, y, k ); - // We are going to replace a node - return j; -} - - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMapPrivate::Iterator TQMapPrivate::insert( TQMapNodeBase* x, TQMapNodeBase* y, const Key& k ) -{ - NodePtr z = new Node( k ); - if (y == header || x != 0 || k < key(y) ) { - y->left = z; // also makes leftmost = z when y == header - if ( y == header ) { - header->parent = z; - header->right = z; - } else if ( y == header->left ) - header->left = z; // maintain leftmost pointing to min node - } else { - y->right = z; - if ( y == header->right ) - header->right = z; // maintain rightmost pointing to max node - } - z->parent = y; - z->left = 0; - z->right = 0; - rebalance( z, header->parent ); - ++node_count; - return Iterator(z); -} - - -#ifdef QT_CHECK_RANGE -# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_MAP_RANGE ) -# define QT_CHECK_INVALID_MAP_ELEMENT if ( empty() ) qWarning( "TQMap: Warning invalid element" ) -# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL Q_ASSERT( !empty() ); -# else -# define QT_CHECK_INVALID_MAP_ELEMENT -# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL -# endif -#else -# define QT_CHECK_INVALID_MAP_ELEMENT -# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL -#endif - -template class TQDeepCopy; - -template -class TQMap -{ -public: - /** - * Typedefs - */ - typedef Key key_type; - typedef T mapped_type; - typedef TQPair value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - typedef size_t size_type; - typedef TQMapIterator iterator; - typedef TQMapConstIterator const_iterator; - typedef TQPair insert_pair; - - typedef TQMapIterator< Key, T > Iterator; - typedef TQMapConstIterator< Key, T > ConstIterator; - typedef T ValueType; - typedef TQMapPrivate< Key, T > Priv; - - /** - * API - */ - TQMap() - { - sh = new TQMapPrivate< Key, T >; - } - TQMap( const TQMap& m ) - { - sh = m.sh; sh->ref(); - } - -#ifndef QT_NO_STL - TQMap( const std::map& m ) - { - sh = new TQMapPrivate; - Q_TYPENAME std::map::const_iterator it = m.begin(); - for ( ; it != m.end(); ++it ) { - value_type p( (*it).first, (*it).second ); - insert( p ); - } - } -#endif - ~TQMap() - { - if ( sh->deref() ) - delete sh; - } - TQMap& operator= ( const TQMap& m ); -#ifndef QT_NO_STL - TQMap& operator= ( const std::map& m ) - { - clear(); - Q_TYPENAME std::map::const_iterator it = m.begin(); - for ( ; it != m.end(); ++it ) { - value_type p( (*it).first, (*it).second ); - insert( p ); - } - return *this; - } -#endif - - iterator begin() { detach(); return sh->begin(); } - iterator end() { detach(); return sh->end(); } - const_iterator begin() const { return ((const Priv*)sh)->begin(); } - const_iterator end() const { return ((const Priv*)sh)->end(); } - const_iterator constBegin() const { return begin(); } - const_iterator constEnd() const { return end(); } - - iterator replace( const Key& k, const T& v ) - { - remove( k ); - return insert( k, v ); - } - - size_type size() const - { - return sh->node_count; - } - bool empty() const - { - return sh->node_count == 0; - } - TQPair insert( const value_type& x ); - - void erase( iterator it ) - { - detach(); - sh->remove( it ); - } - void erase( const key_type& k ); - size_type count( const key_type& k ) const; - T& operator[] ( const Key& k ); - void clear(); - - iterator find ( const Key& k ) - { - detach(); - return iterator( sh->find( k ).node ); - } - const_iterator find ( const Key& k ) const { return sh->find( k ); } - - const T& operator[] ( const Key& k ) const - { QT_CHECK_INVALID_MAP_ELEMENT; return sh->find( k ).data(); } - bool contains ( const Key& k ) const - { return find( k ) != end(); } - //{ return sh->find( k ) != ((const Priv*)sh)->end(); } - - size_type count() const { return sh->node_count; } - - TQValueList keys() const { - TQValueList r; - for (const_iterator i=begin(); i!=end(); ++i) - r.append(i.key()); - return r; - } - - TQValueList values() const { - TQValueList r; - for (const_iterator i=begin(); i!=end(); ++i) - r.append(*i); - return r; - } - - bool isEmpty() const { return sh->node_count == 0; } - - iterator insert( const Key& key, const T& value, bool overwrite = TRUE ); - void remove( iterator it ) { detach(); sh->remove( it ); } - void remove( const Key& k ); - -#if defined(Q_FULL_TEMPLATE_INSTANTIATION) - bool operator==( const TQMap& ) const { return FALSE; } -#ifndef QT_NO_STL - bool operator==( const std::map& ) const { return FALSE; } -#endif -#endif - -protected: - /** - * Helpers - */ - void detach() { if ( sh->count > 1 ) detachInternal(); } - - Priv* sh; -private: - void detachInternal(); - - friend class TQDeepCopy< TQMap >; -}; - -template -Q_INLINE_TEMPLATES TQMap& TQMap::operator= ( const TQMap& m ) -{ - m.sh->ref(); - if ( sh->deref() ) - delete sh; - sh = m.sh; - return *this; -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMap::insert_pair TQMap::insert( const Q_TYPENAME TQMap::value_type& x ) -{ - detach(); - size_type n = size(); - iterator it = sh->insertSingle( x.first ); - bool inserted = FALSE; - if ( n < size() ) { - inserted = TRUE; - it.data() = x.second; - } - return TQPair( it, inserted ); -} - -template -Q_INLINE_TEMPLATES void TQMap::erase( const Key& k ) -{ - detach(); - iterator it( sh->find( k ).node ); - if ( it != end() ) - sh->remove( it ); -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMap::size_type TQMap::count( const Key& k ) const -{ - const_iterator it( sh->find( k ).node ); - if ( it != end() ) { - size_type c = 0; - while ( it != end() ) { - ++it; - ++c; - } - return c; - } - return 0; -} - -template -Q_INLINE_TEMPLATES T& TQMap::operator[] ( const Key& k ) -{ - detach(); - TQMapNode* p = sh->find( k ).node; - if ( p != sh->end().node ) - return p->data; - return insert( k, T() ).data(); -} - -template -Q_INLINE_TEMPLATES void TQMap::clear() -{ - if ( sh->count == 1 ) - sh->clear(); - else { - sh->deref(); - sh = new TQMapPrivate; - } -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQMap::iterator TQMap::insert( const Key& key, const T& value, bool overwrite ) -{ - detach(); - size_type n = size(); - iterator it = sh->insertSingle( key ); - if ( overwrite || n < size() ) - it.data() = value; - return it; -} - -template -Q_INLINE_TEMPLATES void TQMap::remove( const Key& k ) -{ - detach(); - iterator it( sh->find( k ).node ); - if ( it != end() ) - sh->remove( it ); -} - -template -Q_INLINE_TEMPLATES void TQMap::detachInternal() -{ - sh->deref(); sh = new TQMapPrivate( sh ); -} - - -#ifndef QT_NO_DATASTREAM -template -Q_INLINE_TEMPLATES TQDataStream& operator>>( TQDataStream& s, TQMap& m ) { - m.clear(); - Q_UINT32 c; - s >> c; - for( Q_UINT32 i = 0; i < c; ++i ) { - Key k; T t; - s >> k >> t; - m.insert( k, t ); - if ( s.atEnd() ) - break; - } - return s; -} - - -template -Q_INLINE_TEMPLATES TQDataStream& operator<<( TQDataStream& s, const TQMap& m ) { - s << (Q_UINT32)m.size(); - TQMapConstIterator it = m.begin(); - for( ; it != m.end(); ++it ) - s << it.key() << it.data(); - return s; -} -#endif - -#define Q_DEFINED_QMAP -#include "qwinexport.h" -#endif // TQMAP_H diff --git a/src/tools/qmemarray.h b/src/tools/qmemarray.h deleted file mode 100644 index 81414fd9c..000000000 --- a/src/tools/qmemarray.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMemArray template/macro class -** -** Created : 930906 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMEMARRAY_H -#define TQMEMARRAY_H - -#ifndef QT_H -#include "qgarray.h" -#endif // QT_H - - -template -class TQMemArray : public TQGArray -{ -public: - typedef type* Iterator; - typedef const type* ConstIterator; - typedef type ValueType; - -protected: - TQMemArray( int, int ) : TQGArray( 0, 0 ) {} - -public: - TQMemArray() {} - TQMemArray( int size ) : TQGArray(size*sizeof(type)) {} // ### 4.0 Q_EXPLICIT - TQMemArray( const TQMemArray &a ) : TQGArray(a) {} - ~TQMemArray() {} - TQMemArray &operator=(const TQMemArray &a) - { return (TQMemArray&)TQGArray::assign(a); } - type *data() const { return (type *)TQGArray::data(); } - uint nrefs() const { return TQGArray::nrefs(); } - uint size() const { return TQGArray::size()/sizeof(type); } - uint count() const { return size(); } - bool isEmpty() const { return TQGArray::size() == 0; } - bool isNull() const { return TQGArray::data() == 0; } - bool resize( uint size ) { return TQGArray::resize(size*sizeof(type)); } - bool resize( uint size, Optimization optim ) { return TQGArray::resize(size*sizeof(type), optim); } - bool truncate( uint pos ) { return TQGArray::resize(pos*sizeof(type)); } - bool fill( const type &d, int size = -1 ) - { return TQGArray::fill((char*)&d,size,sizeof(type) ); } - void detach() { TQGArray::detach(); } - TQMemArray copy() const - { TQMemArray tmp; return tmp.duplicate(*this); } - TQMemArray& assign( const TQMemArray& a ) - { return (TQMemArray&)TQGArray::assign(a); } - TQMemArray& assign( const type *a, uint n ) - { return (TQMemArray&)TQGArray::assign((char*)a,n*sizeof(type)); } - TQMemArray& duplicate( const TQMemArray& a ) - { return (TQMemArray&)TQGArray::duplicate(a); } - TQMemArray& duplicate( const type *a, uint n ) - { return (TQMemArray&)TQGArray::duplicate((char*)a,n*sizeof(type)); } - TQMemArray& setRawData( const type *a, uint n ) - { return (TQMemArray&)TQGArray::setRawData((char*)a, - n*sizeof(type)); } - void resetRawData( const type *a, uint n ) - { TQGArray::resetRawData((char*)a,n*sizeof(type)); } - int find( const type &d, uint i=0 ) const - { return TQGArray::find((char*)&d,i,sizeof(type)); } - int contains( const type &d ) const - { return TQGArray::contains((char*)&d,sizeof(type)); } - void sort() { TQGArray::sort(sizeof(type)); } - int bsearch( const type &d ) const - { return TQGArray::bsearch((const char*)&d,sizeof(type)); } - // ### TQt 4.0: maybe provide uint overload as work-around for MSVC bug - type& operator[]( int i ) const - { return (type &)(*(type *)TQGArray::at(i*sizeof(type))); } - type& at( uint i ) const - { return (type &)(*(type *)TQGArray::at(i*sizeof(type))); } - operator const type*() const { return (const type *)TQGArray::data(); } - bool operator==( const TQMemArray &a ) const { return isEqual(a); } - bool operator!=( const TQMemArray &a ) const { return !isEqual(a); } - Iterator begin() { return data(); } - Iterator end() { return data() + size(); } - ConstIterator begin() const { return data(); } - ConstIterator end() const { return data() + size(); } -}; - -#ifndef QT_NO_COMPAT -#define TQArray TQMemArray -#endif - -#define Q_DEFINED_QMEMARRAY -#include "qwinexport.h" -#endif // TQARRAY_H diff --git a/src/tools/qmutex.h b/src/tools/qmutex.h deleted file mode 100644 index f5c4ed22a..000000000 --- a/src/tools/qmutex.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMutex class -** -** Created : 931107 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMUTEX_H -#define TQMUTEX_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#if defined(QT_THREAD_SUPPORT) - -class TQMutexPrivate; - -const int Q_MUTEX_NORMAL = 0; -const int Q_MUTEX_RECURSIVE = 1; - -class Q_EXPORT TQMutex -{ - friend class TQThread; - friend class TQWaitCondition; - friend class TQWaitConditionPrivate; - -public: - TQMutex(bool recursive = FALSE); - virtual ~TQMutex(); - - void lock(); - void unlock(); - bool locked(); - bool tryLock(); - -private: - TQMutexPrivate * d; - -#if defined(Q_DISABLE_COPY) - TQMutex( const TQMutex & ); - TQMutex &operator=( const TQMutex & ); -#endif -}; - -class Q_EXPORT TQMutexLocker -{ -public: - TQMutexLocker( TQMutex * ); - ~TQMutexLocker(); - - TQMutex *mutex() const; - -private: - TQMutex *mtx; - -#if defined(Q_DISABLE_COPY) - TQMutexLocker( const TQMutexLocker & ); - TQMutexLocker &operator=( const TQMutexLocker & ); -#endif -}; - -inline TQMutexLocker::TQMutexLocker( TQMutex *m ) - : mtx( m ) -{ - if ( mtx ) mtx->lock(); -} - -inline TQMutexLocker::~TQMutexLocker() -{ - if ( mtx ) mtx->unlock(); -} - -inline TQMutex *TQMutexLocker::mutex() const -{ - return mtx; -} - -#endif - -#endif diff --git a/src/tools/qmutex_unix.cpp b/src/tools/qmutex_unix.cpp index 71e8530d0..146edbec9 100644 --- a/src/tools/qmutex_unix.cpp +++ b/src/tools/qmutex_unix.cpp @@ -68,7 +68,7 @@ typedef pthread_mutex_t Q_MUTEX_T; # undef Q_RECURSIVE_MUTEX_TYPE #endif -#include "qmutex.h" +#include "ntqmutex.h" #include "qmutex_p.h" #include @@ -334,7 +334,7 @@ int TQRecursiveMutexPrivate::type() const /*! - \class TQMutex qmutex.h + \class TQMutex ntqmutex.h \threadsafe \brief The TQMutex class provides access serialization between threads. @@ -512,7 +512,7 @@ bool TQMutex::tryLock() } /*! - \class TQMutexLocker qmutex.h + \class TQMutexLocker ntqmutex.h \brief The TQMutexLocker class simplifies locking and unlocking TQMutexes. \threadsafe diff --git a/src/tools/qmutexpool.cpp b/src/tools/qmutexpool.cpp index f0250ef28..48f1beeb4 100644 --- a/src/tools/qmutexpool.cpp +++ b/src/tools/qmutexpool.cpp @@ -40,7 +40,7 @@ #ifdef QT_THREAD_SUPPORT -#include +#include Q_EXPORT TQMutexPool *qt_global_mutexpool = 0; diff --git a/src/tools/qmutexpool_p.h b/src/tools/qmutexpool_p.h index 0981cf821..67bd23c03 100644 --- a/src/tools/qmutexpool_p.h +++ b/src/tools/qmutexpool_p.h @@ -54,8 +54,8 @@ #ifdef QT_THREAD_SUPPORT #ifndef QT_H -#include "qmutex.h" -#include "qmemarray.h" +#include "ntqmutex.h" +#include "ntqmemarray.h" #endif // QT_H class Q_EXPORT TQMutexPool diff --git a/src/tools/qpair.h b/src/tools/qpair.h deleted file mode 100644 index 38f6598d0..000000000 --- a/src/tools/qpair.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPair class -** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPAIR_H -#define TQPAIR_H - -#ifndef QT_H -#include "qglobal.h" -#include "qdatastream.h" -#endif // QT_H - -template -struct TQPair -{ - typedef T1 first_type; - typedef T2 second_type; - - TQPair() - : first( T1() ), second( T2() ) - {} - TQPair( const T1& t1, const T2& t2 ) - : first( t1 ), second( t2 ) - {} - - TQPair& operator=(const TQPair& other) - { - if (this != &other) { - first = other.first; - second = other.second; - } - return *this; - } - - T1 first; - T2 second; -}; - -template -Q_INLINE_TEMPLATES bool operator==( const TQPair& x, const TQPair& y ) -{ - return x.first == y.first && x.second == y.second; -} - -template -Q_INLINE_TEMPLATES bool operator<( const TQPair& x, const TQPair& y ) -{ - return x.first < y.first || - ( !( y.first < x.first ) && x.second < y.second ); -} - -template -Q_INLINE_TEMPLATES TQPair qMakePair( const T1& x, const T2& y ) -{ - return TQPair( x, y ); -} - -#ifndef QT_NO_DATASTREAM -template -inline TQDataStream& operator>>( TQDataStream& s, TQPair& p ) -{ - s >> p.first >> p.second; - return s; -} - -template -inline TQDataStream& operator<<( TQDataStream& s, const TQPair& p ) -{ - s << p.first << p.second; - return s; -} -#endif - -#endif diff --git a/src/tools/qptrcollection.cpp b/src/tools/qptrcollection.cpp index bc6e94540..718a739d1 100644 --- a/src/tools/qptrcollection.cpp +++ b/src/tools/qptrcollection.cpp @@ -38,10 +38,10 @@ ** **********************************************************************/ -#include "qptrcollection.h" +#include "ntqptrcollection.h" /*! - \class TQPtrCollection qptrcollection.h + \class TQPtrCollection ntqptrcollection.h \reentrant \brief The TQPtrCollection class is the base class of most pointer-based TQt collections. diff --git a/src/tools/qptrcollection.h b/src/tools/qptrcollection.h deleted file mode 100644 index bf20091e6..000000000 --- a/src/tools/qptrcollection.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Definition of base class for all pointer based collection classes -** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPTRCOLLECTION_H -#define TQPTRCOLLECTION_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - - -class TQGVector; -class TQGList; -class TQGDict; - - -class Q_EXPORT TQPtrCollection // inherited by all collections -{ -public: - bool autoDelete() const { return del_item; } - void setAutoDelete( bool enable ) { del_item = enable; } - - virtual uint count() const = 0; - virtual void clear() = 0; // delete all objects - - typedef void *Item; // generic collection item - -protected: - TQPtrCollection() { del_item = FALSE; } // no deletion of objects - TQPtrCollection(const TQPtrCollection &) { del_item = FALSE; } - virtual ~TQPtrCollection() {} - - bool del_item; // default FALSE - - virtual Item newItem( Item ); // create object - virtual void deleteItem( Item ) = 0; // delete object -}; - - -#ifndef QT_NO_COMPAT -#define TQCollection TQPtrCollection -#endif - -#endif // TQPTRCOLLECTION_H diff --git a/src/tools/qptrdict.h b/src/tools/qptrdict.h deleted file mode 100644 index 510caa89d..000000000 --- a/src/tools/qptrdict.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPtrDict template class -** -** Created : 970415 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPTRDICT_H -#define TQPTRDICT_H - -#ifndef QT_H -#include "qgdict.h" -#endif // QT_H - -template -class TQPtrDict -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGDict -#endif -{ -public: - TQPtrDict(int size=17) : TQGDict(size,PtrKey,0,0) {} - TQPtrDict( const TQPtrDict &d ) : TQGDict(d) {} - ~TQPtrDict() { clear(); } - TQPtrDict &operator=(const TQPtrDict &d) - { return (TQPtrDict&)TQGDict::operator=(d); } - uint count() const { return TQGDict::count(); } - uint size() const { return TQGDict::size(); } - bool isEmpty() const { return TQGDict::count() == 0; } - void insert( void *k, const type *d ) - { TQGDict::look_ptr(k,(Item)d,1); } - void replace( void *k, const type *d ) - { TQGDict::look_ptr(k,(Item)d,2); } - bool remove( void *k ) { return TQGDict::remove_ptr(k); } - type *take( void *k ) { return (type*)TQGDict::take_ptr(k); } - type *find( void *k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_ptr(k,0,0); } - type *operator[]( void *k ) const - { return (type *)((TQGDict*)this)->TQGDict::look_ptr(k,0,0); } - void clear() { TQGDict::clear(); } - void resize( uint n ) { TQGDict::resize(n); } - void statistics() const { TQGDict::statistics(); } - -#ifdef Q_QDOC -protected: - virtual TQDataStream& read( TQDataStream &, TQPtrCollection::Item & ); - virtual TQDataStream& write( TQDataStream &, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQPtrDict::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template -inline void TQPtrDict::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -template -class TQPtrDictIterator : public TQGDictIterator -{ -public: - TQPtrDictIterator(const TQPtrDict &d) :TQGDictIterator((TQGDict &)d) {} - ~TQPtrDictIterator() {} - uint count() const { return dict->count(); } - bool isEmpty() const { return dict->count() == 0; } - type *toFirst() { return (type *)TQGDictIterator::toFirst(); } - operator type *() const { return (type *)TQGDictIterator::get(); } - type *current() const { return (type *)TQGDictIterator::get(); } - void *currentKey() const { return TQGDictIterator::getKeyPtr(); } - type *operator()() { return (type *)TQGDictIterator::operator()(); } - type *operator++() { return (type *)TQGDictIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGDictIterator::operator+=(j);} -}; - -#endif // TQPTRDICT_H diff --git a/src/tools/qptrlist.h b/src/tools/qptrlist.h deleted file mode 100644 index 6e741e8b5..000000000 --- a/src/tools/qptrlist.h +++ /dev/null @@ -1,195 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPtrList template/macro class -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPTRLIST_H -#define TQPTRLIST_H - -#ifndef QT_H -#include "qglist.h" -#endif // QT_H - -template -class TQPtrListStdIterator : public TQGListStdIterator -{ -public: - inline TQPtrListStdIterator( TQLNode* n ): TQGListStdIterator(n) {} - type *operator*() { return node ? (type *)node->getData() : 0; } - inline TQPtrListStdIterator operator++() - { node = next(); return *this; } - inline TQPtrListStdIterator operator++(int) - { TQLNode* n = node; node = next(); return TQPtrListStdIterator( n ); } - inline bool operator==( const TQPtrListStdIterator& it ) const { return node == it.node; } - inline bool operator!=( const TQPtrListStdIterator& it ) const { return node != it.node; } -}; - - -template -class TQPtrList -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGList -#endif -{ -public: - - TQPtrList() {} - TQPtrList( const TQPtrList &l ) : TQGList(l) {} - ~TQPtrList() { clear(); } - TQPtrList &operator=(const TQPtrList &l) - { return (TQPtrList&)TQGList::operator=(l); } - bool operator==( const TQPtrList &list ) const - { return TQGList::operator==( list ); } - bool operator!=( const TQPtrList &list ) const - { return !TQGList::operator==( list ); } - uint count() const { return TQGList::count(); } - bool isEmpty() const { return TQGList::count() == 0; } - bool insert( uint i, const type *d){ return TQGList::insertAt(i,(TQPtrCollection::Item)d); } - void inSort( const type *d ) { TQGList::inSort((TQPtrCollection::Item)d); } - void prepend( const type *d ) { TQGList::insertAt(0,(TQPtrCollection::Item)d); } - void append( const type *d ) { TQGList::append((TQPtrCollection::Item)d); } - bool remove( uint i ) { return TQGList::removeAt(i); } - bool remove() { return TQGList::remove((TQPtrCollection::Item)0); } - bool remove( const type *d ) { return TQGList::remove((TQPtrCollection::Item)d); } - bool removeRef( const type *d ) { return TQGList::removeRef((TQPtrCollection::Item)d); } - void removeNode( TQLNode *n ) { TQGList::removeNode(n); } - bool removeFirst() { return TQGList::removeFirst(); } - bool removeLast() { return TQGList::removeLast(); } - type *take( uint i ) { return (type *)TQGList::takeAt(i); } - type *take() { return (type *)TQGList::take(); } - type *takeNode( TQLNode *n ) { return (type *)TQGList::takeNode(n); } - void clear() { TQGList::clear(); } - void sort() { TQGList::sort(); } - int find( const type *d ) { return TQGList::find((TQPtrCollection::Item)d); } - int findNext( const type *d ) { return TQGList::find((TQPtrCollection::Item)d,FALSE); } - int findRef( const type *d ) { return TQGList::findRef((TQPtrCollection::Item)d); } - int findNextRef( const type *d ){ return TQGList::findRef((TQPtrCollection::Item)d,FALSE);} - uint contains( const type *d ) const { return TQGList::contains((TQPtrCollection::Item)d); } - uint containsRef( const type *d ) const - { return TQGList::containsRef((TQPtrCollection::Item)d); } - bool replace( uint i, const type *d ) { return TQGList::replaceAt( i, (TQPtrCollection::Item)d ); } - type *at( uint i ) { return (type *)TQGList::at(i); } - int at() const { return TQGList::at(); } - type *current() const { return (type *)TQGList::get(); } - TQLNode *currentNode() const { return TQGList::currentNode(); } - type *getFirst() const { return (type *)TQGList::cfirst(); } - type *getLast() const { return (type *)TQGList::clast(); } - type *first() { return (type *)TQGList::first(); } - type *last() { return (type *)TQGList::last(); } - type *next() { return (type *)TQGList::next(); } - type *prev() { return (type *)TQGList::prev(); } - void toVector( TQGVector *vec )const{ TQGList::toVector(vec); } - - - // standard iterators - typedef TQPtrListStdIterator Iterator; - typedef TQPtrListStdIterator ConstIterator; - inline Iterator begin() { return TQGList::begin(); } - inline ConstIterator begin() const { return TQGList::begin(); } - inline ConstIterator constBegin() const { return TQGList::begin(); } - inline Iterator end() { return TQGList::end(); } - inline ConstIterator end() const { return TQGList::end(); } - inline ConstIterator constEnd() const { return TQGList::end(); } - inline Iterator erase( Iterator it ) { return TQGList::erase( it ); } - // stl syntax compatibility - typedef Iterator iterator; - typedef ConstIterator const_iterator; - - -#ifdef Q_QDOC -protected: - virtual int compareItems( TQPtrCollection::Item, TQPtrCollection::Item ); - virtual TQDataStream& read( TQDataStream&, TQPtrCollection::Item& ); - virtual TQDataStream& write( TQDataStream&, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQPtrList::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQPtrList::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -template -class TQPtrListIterator : public TQGListIterator -{ -public: - TQPtrListIterator(const TQPtrList &l) :TQGListIterator((TQGList &)l) {} - ~TQPtrListIterator() {} - uint count() const { return list->count(); } - bool isEmpty() const { return list->count() == 0; } - bool atFirst() const { return TQGListIterator::atFirst(); } - bool atLast() const { return TQGListIterator::atLast(); } - type *toFirst() { return (type *)TQGListIterator::toFirst(); } - type *toLast() { return (type *)TQGListIterator::toLast(); } - operator type *() const { return (type *)TQGListIterator::get(); } - type *operator*() { return (type *)TQGListIterator::get(); } - - // No good, since TQPtrList (ie. TQStrList fails... - // - // MSVC++ gives warning - // Sunpro C++ 4.1 gives error - // type *operator->() { return (type *)TQGListIterator::get(); } - - type *current() const { return (type *)TQGListIterator::get(); } - type *operator()() { return (type *)TQGListIterator::operator()();} - type *operator++() { return (type *)TQGListIterator::operator++(); } - type *operator+=(uint j) { return (type *)TQGListIterator::operator+=(j);} - type *operator--() { return (type *)TQGListIterator::operator--(); } - type *operator-=(uint j) { return (type *)TQGListIterator::operator-=(j);} - TQPtrListIterator& operator=(const TQPtrListIterator&it) - { TQGListIterator::operator=(it); return *this; } -}; - -#ifndef QT_NO_COMPAT -#define TQList TQPtrList -#define TQListIterator TQPtrListIterator -#endif - -#define Q_DEFINED_QPTRLIST -#include "qwinexport.h" - -#endif // TQPTRLIST_H diff --git a/src/tools/qptrqueue.h b/src/tools/qptrqueue.h deleted file mode 100644 index 68b2a0b80..000000000 --- a/src/tools/qptrqueue.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPtrQueue template/macro class -** -** Created : 920917 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPTRTQUEUE_H -#define TQPTRTQUEUE_H - -#ifndef QT_H -#include "qglist.h" -#endif // QT_H - -template -class TQPtrQueue : protected TQGList -{ -public: - TQPtrQueue() {} - TQPtrQueue( const TQPtrQueue &q ) : TQGList(q) {} - ~TQPtrQueue() { clear(); } - TQPtrQueue& operator=(const TQPtrQueue &q) - { return (TQPtrQueue&)TQGList::operator=(q); } - bool autoDelete() const { return TQPtrCollection::autoDelete(); } - void setAutoDelete( bool del ) { TQPtrCollection::setAutoDelete(del); } - uint count() const { return TQGList::count(); } - bool isEmpty() const { return TQGList::count() == 0; } - void enqueue( const type *d ) { TQGList::append(Item(d)); } - type *dequeue() { return (type *)TQGList::takeFirst();} - bool remove() { return TQGList::removeFirst(); } - void clear() { TQGList::clear(); } - type *head() const { return (type *)TQGList::cfirst(); } - operator type *() const { return (type *)TQGList::cfirst(); } - type *current() const { return (type *)TQGList::cfirst(); } - -#ifdef Q_QDOC -protected: - virtual TQDataStream& read( TQDataStream&, TQPtrCollection::Item& ); - virtual TQDataStream& write( TQDataStream&, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQPtrQueue::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQPtrQueue::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -#ifndef QT_NO_COMPAT -#define TQQueue TQPtrQueue -#endif - -#endif // TQPTRTQUEUE_H diff --git a/src/tools/qptrstack.h b/src/tools/qptrstack.h deleted file mode 100644 index 75245407c..000000000 --- a/src/tools/qptrstack.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPtrStack pointer based template class -** -** Created : 920917 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPTRSTACK_H -#define TQPTRSTACK_H - -#ifndef QT_H -#include "qglist.h" -#endif // QT_H - -template -class TQPtrStack : protected TQGList -{ -public: - TQPtrStack() { } - TQPtrStack( const TQPtrStack &s ) : TQGList( s ) { } - ~TQPtrStack() { clear(); } - TQPtrStack &operator=(const TQPtrStack &s) - { return (TQPtrStack&)TQGList::operator=(s); } - bool autoDelete() const { return TQPtrCollection::autoDelete(); } - void setAutoDelete( bool del ) { TQPtrCollection::setAutoDelete(del); } - uint count() const { return TQGList::count(); } - bool isEmpty() const { return TQGList::count() == 0; } - void push( const type *d ) { TQGList::insertAt(0,Item(d)); } - type *pop() { return (type *)TQGList::takeFirst(); } - bool remove() { return TQGList::removeFirst(); } - void clear() { TQGList::clear(); } - type *top() const { return (type *)TQGList::cfirst(); } - operator type *() const { return (type *)TQGList::cfirst(); } - type *current() const { return (type *)TQGList::cfirst(); } - -#ifdef Q_QDOC -protected: - virtual TQDataStream& read( TQDataStream&, TQPtrCollection::Item& ); - virtual TQDataStream& write( TQDataStream&, TQPtrCollection::Item ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQPtrStack::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQPtrStack::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -#ifndef QT_NO_COMPAT -#define TQStack TQPtrStack -#endif - -#endif // TQPTRSTACK_H diff --git a/src/tools/qptrvector.h b/src/tools/qptrvector.h deleted file mode 100644 index c05db8ae9..000000000 --- a/src/tools/qptrvector.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPtrVector pointer based template class -** -** Created : 930907 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPTRVECTOR_H -#define TQPTRVECTOR_H - -#ifndef QT_H -#include "qgvector.h" -#endif // QT_H - -template -class TQPtrVector -#ifdef Q_QDOC - : public TQPtrCollection -#else - : public TQGVector -#endif -{ -public: - TQPtrVector() { } - TQPtrVector( uint size ) : TQGVector(size) { } - TQPtrVector( const TQPtrVector &v ) : TQGVector( v ) { } - ~TQPtrVector() { clear(); } - TQPtrVector &operator=(const TQPtrVector &v) - { return (TQPtrVector&)TQGVector::operator=(v); } - bool operator==( const TQPtrVector &v ) const { return TQGVector::operator==(v); } - type **data() const { return (type **)TQGVector::data(); } - uint size() const { return TQGVector::size(); } - uint count() const { return TQGVector::count(); } - bool isEmpty() const { return TQGVector::count() == 0; } - bool isNull() const { return TQGVector::size() == 0; } - bool resize( uint size ) { return TQGVector::resize(size); } - bool insert( uint i, const type *d){ return TQGVector::insert(i,(Item)d); } - bool remove( uint i ) { return TQGVector::remove(i); } - type *take( uint i ) { return (type *)TQGVector::take(i); } - void clear() { TQGVector::clear(); } - bool fill( const type *d, int size=-1 ) - { return TQGVector::fill((Item)d,size);} - void sort() { TQGVector::sort(); } - int bsearch( const type *d ) const{ return TQGVector::bsearch((Item)d); } - int findRef( const type *d, uint i=0 ) const - { return TQGVector::findRef((Item)d,i);} - int find( const type *d, uint i= 0 ) const - { return TQGVector::find((Item)d,i); } - uint containsRef( const type *d ) const - { return TQGVector::containsRef((Item)d); } - uint contains( const type *d ) const - { return TQGVector::contains((Item)d); } - type *operator[]( int i ) const { return (type *)TQGVector::at(i); } - type *at( uint i ) const { return (type *)TQGVector::at(i); } - void toList( TQGList *list ) const { TQGVector::toList(list); } - -#ifdef Q_QDOC -protected: - virtual int compareItems( TQPtrCollection::Item d1, TQPtrCollection::Item d2 ); - virtual TQDataStream& read( TQDataStream &s, TQPtrCollection::Item &d ); - virtual TQDataStream& write( TQDataStream &s, TQPtrCollection::Item d ) const; -#endif - -private: - void deleteItem( Item d ); -}; - -#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) -template<> inline void TQPtrVector::deleteItem( TQPtrCollection::Item ) -{ -} -#endif - -template inline void TQPtrVector::deleteItem( TQPtrCollection::Item d ) -{ - if ( del_item ) delete (type *)d; -} - -#ifndef QT_NO_COMPAT -#define TQVector TQPtrVector -#endif - -#define Q_DEFINED_QPTRVECTOR -#include "qwinexport.h" -#endif // TQVECTOR_H diff --git a/src/tools/qregexp.cpp b/src/tools/qregexp.cpp index 133e04eb7..81e160136 100644 --- a/src/tools/qregexp.cpp +++ b/src/tools/qregexp.cpp @@ -38,22 +38,22 @@ ** **********************************************************************/ -#include "qregexp.h" +#include "ntqregexp.h" #ifndef QT_NO_REGEXP -#include "qmemarray.h" -#include "qbitarray.h" -#include "qcache.h" -#include "qcleanuphandler.h" -#include "qintdict.h" -#include "qmap.h" -#include "qptrvector.h" -#include "qstring.h" -#include "qtl.h" +#include "ntqmemarray.h" +#include "ntqbitarray.h" +#include "ntqcache.h" +#include "ntqcleanuphandler.h" +#include "ntqintdict.h" +#include "ntqmap.h" +#include "ntqptrvector.h" +#include "ntqstring.h" +#include "ntqtl.h" #ifdef QT_THREAD_SUPPORT -#include "qthreadstorage.h" +#include "ntqthreadstorage.h" #include #endif // QT_THREAD_SUPPORT @@ -78,7 +78,7 @@ */ /*! - \class TQRegExp qregexp.h + \class TQRegExp ntqregexp.h \reentrant \brief The TQRegExp class provides pattern matching using regular expressions. diff --git a/src/tools/qregexp.h b/src/tools/qregexp.h deleted file mode 100644 index 4276a5f37..000000000 --- a/src/tools/qregexp.h +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Definition of TQRegExp class -** -** Created : 950126 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQREGEXP_H -#define TQREGEXP_H - -#ifndef QT_H -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_REGEXP -class TQRegExpEngine; -struct TQRegExpPrivate; - -class Q_EXPORT TQRegExp -{ -public: - enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch }; - - TQRegExp(); - TQRegExp( const TQString& pattern, bool caseSensitive = TRUE, - bool wildcard = FALSE ); - TQRegExp( const TQRegExp& rx ); - ~TQRegExp(); - TQRegExp& operator=( const TQRegExp& rx ); - - bool operator==( const TQRegExp& rx ) const; - bool operator!=( const TQRegExp& rx ) const { return !operator==( rx ); } - - bool isEmpty() const; - bool isValid() const; - TQString pattern() const; - void setPattern( const TQString& pattern ); - bool caseSensitive() const; - void setCaseSensitive( bool sensitive ); -#ifndef QT_NO_REGEXP_WILDCARD - bool wildcard() const; - void setWildcard( bool wildcard ); -#endif - bool minimal() const; - void setMinimal( bool minimal ); - - bool exactMatch( const TQString& str ) const; -#ifndef QT_NO_COMPAT - int match( const TQString& str, int index = 0, int *len = 0, - bool indexIsStart = TRUE ) const; -#endif - -#if defined(Q_QDOC) - int search( const TQString& str, int offset = 0, - CaretMode caretMode = CaretAtZero ) const; - int searchRev( const TQString& str, int offset = -1, - CaretMode caretMode = CaretAtZero ) const; -#else - // ### TQt 4.0: reduce these four to two functions - int search( const TQString& str, int offset = 0 ) const; - int search( const TQString& str, int offset, CaretMode caretMode ) const; - int searchRev( const TQString& str, int offset = -1 ) const; - int searchRev( const TQString& str, int offset, CaretMode caretMode ) const; -#endif - int matchedLength() const; -#ifndef QT_NO_REGEXP_CAPTURE - int numCaptures() const; - TQStringList capturedTexts(); - TQString cap( int nth = 0 ); - int pos( int nth = 0 ); - TQString errorString(); -#endif - - static TQString escape( const TQString& str ); - -private: - void prepareEngine() const; - void prepareEngineForMatch( const TQString& str ) const; - void invalidateEngine(); - - static int caretIndex( int offset, CaretMode caretMode ); - - TQRegExpEngine *eng; - TQRegExpPrivate *priv; -}; -#endif // QT_NO_REGEXP -#endif // TQREGEXP_H diff --git a/src/tools/qsemaphore.cpp b/src/tools/qsemaphore.cpp index a5eb62795..52fbd2765 100644 --- a/src/tools/qsemaphore.cpp +++ b/src/tools/qsemaphore.cpp @@ -40,13 +40,13 @@ #if defined(QT_THREAD_SUPPORT) -#include "qsemaphore.h" -#include "qmutex.h" -#include "qwaitcondition.h" +#include "ntqsemaphore.h" +#include "ntqmutex.h" +#include "ntqwaitcondition.h" /*! - \class TQSemaphore qsemaphore.h + \class TQSemaphore ntqsemaphore.h \threadsafe \brief The TQSemaphore class provides a robust integer semaphore. diff --git a/src/tools/qsemaphore.h b/src/tools/qsemaphore.h deleted file mode 100644 index c27768348..000000000 --- a/src/tools/qsemaphore.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSemaphore class -** -** Created : 931107 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSEMAPHORE_H -#define TQSEMAPHORE_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#if defined(QT_THREAD_SUPPORT) - -class TQSemaphorePrivate; - -class Q_EXPORT TQSemaphore -{ -public: - TQSemaphore( int ); - virtual ~TQSemaphore(); - - int available() const; - int total() const; - - // postfix operators - int operator++(int); - int operator--(int); - - int operator+=(int); - int operator-=(int); - - bool tryAccess(int); - -private: - TQSemaphorePrivate *d; - -#if defined(Q_DISABLE_COPY) - TQSemaphore(const TQSemaphore &); - TQSemaphore &operator=(const TQSemaphore &); -#endif -}; - -#endif - -#endif diff --git a/src/tools/qsettings.cpp b/src/tools/qsettings.cpp index 902c5d0c4..9d582d7e1 100644 --- a/src/tools/qsettings.cpp +++ b/src/tools/qsettings.cpp @@ -52,16 +52,16 @@ static inline int qt_open( const char *pathname, int flags, mode_t mode ) # undef truncate #endif -#include "qsettings.h" +#include "ntqsettings.h" #ifndef QT_NO_SETTINGS -#include "qdir.h" -#include "qfile.h" -#include "qfileinfo.h" -#include "qmap.h" -#include "qtextstream.h" -#include "qregexp.h" +#include "ntqdir.h" +#include "ntqfile.h" +#include "ntqfileinfo.h" +#include "ntqmap.h" +#include "ntqtextstream.h" +#include "ntqregexp.h" #include #ifndef NO_ERRNO_H #include @@ -447,7 +447,7 @@ void TQSettingsHeading::parseLine(TQTextStream &stream) #ifdef Q_WS_WIN // for homedirpath reading from registry #include "qt_windows.h" -#include "qlibrary.h" +#include "ntqlibrary.h" #ifndef CSIDL_APPDATA #define CSIDL_APPDATA 0x001a // \Application Data diff --git a/src/tools/qsettings.h b/src/tools/qsettings.h deleted file mode 100644 index 25158f2f9..000000000 --- a/src/tools/qsettings.h +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSettings class -** -** Created : 000626 -** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSETTINGS_H -#define TQSETTINGS_H - -#ifndef QT_H -#include "qdatetime.h" -#include "qstringlist.h" -#endif // QT_H - -#ifndef QT_NO_SETTINGS - -class TQSettingsPrivate; - - -class Q_EXPORT TQSettings -{ -public: - enum Format { - Native = 0, - Ini - }; - enum System { - Unix = 0, - Windows, - Mac - }; - enum Scope { - User, - Global - }; - - TQSettings(); - TQSettings( Format format ); - - ~TQSettings(); - -#if !defined(Q_NO_BOOL_TYPE) - bool writeEntry( const TQString &, bool ); -#endif - bool writeEntry( const TQString &, double ); - bool writeEntry( const TQString &, int ); - 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& sep ); - - TQStringList entryList(const TQString &) const; - TQStringList subkeyList(const TQString &) const; - - //### remove non const versions in 4.0 - TQStringList readListEntry( const TQString &, bool * = 0 ); - TQStringList readListEntry( const TQString &, const TQChar& sep, bool * = 0 ); - TQString readEntry( const TQString &, const TQString &def = TQString::null, bool * = 0 ); - int readNumEntry( const TQString &, int def = 0, bool * = 0 ); - double readDoubleEntry( const TQString &, double def = 0, bool * = 0 ); - bool readBoolEntry( const TQString &, bool def = FALSE, bool * = 0 ); - - //### make those non-inlined in 4.0 - TQStringList readListEntry( const TQString &key, bool *ok = 0 ) const - { - TQSettings *that = (TQSettings*)this; - return that->readListEntry( key, ok ); - } - TQStringList readListEntry( const TQString &key, const TQChar& sep, bool *ok = 0 ) const - { - TQSettings *that = (TQSettings*)this; - return that->readListEntry( key, sep, ok ); - } - TQString readEntry( const TQString &key, const TQString &def = TQString::null, - bool *ok = 0 ) const - { - TQSettings *that = (TQSettings*)this; - return that->readEntry( key, def, ok ); - } - int readNumEntry( const TQString &key, int def = 0, bool *ok = 0 ) const - { - TQSettings *that = (TQSettings*)this; - return that->readNumEntry( key, def, ok ); - } - - double readDoubleEntry( const TQString &key, double def = 0, bool *ok = 0 ) const - { - TQSettings *that = (TQSettings*)this; - return that->readDoubleEntry( key, def, ok ); - } - bool readBoolEntry( const TQString &key, bool def = FALSE, bool *ok = 0 ) const - { - TQSettings *that = (TQSettings*)this; - return that->readBoolEntry( key, def, ok ); - } - - bool removeEntry( const TQString & ); - - void insertSearchPath( System, const TQString & ); - void removeSearchPath( System, const TQString & ); - - void setPath( const TQString &domain, const TQString &product, Scope = Global ); - - void beginGroup( const TQString &group ); - void endGroup(); - void resetGroup(); - TQString group() const; - - bool sync(); - -private: - TQSettingsPrivate *d; - -#if defined(Q_DISABLE_COPY) - TQSettings(const TQSettings &); - TQSettings &operator=(const TQSettings &); -#endif - - TQDateTime lastModificationTime( const TQString & ); - - friend class TQApplication; -}; - -#endif // QT_NO_SETTINGS -#endif // TQSETTINGS_H diff --git a/src/tools/qsettings_p.h b/src/tools/qsettings_p.h index 965792c94..73c92ff3b 100644 --- a/src/tools/qsettings_p.h +++ b/src/tools/qsettings_p.h @@ -54,9 +54,9 @@ // #ifndef QT_H -#include "qstringlist.h" -#include "qmap.h" -#include "qvaluestack.h" +#include "ntqstringlist.h" +#include "ntqmap.h" +#include "ntqvaluestack.h" #endif // QT_H #ifndef QT_NO_SETTINGS diff --git a/src/tools/qshared.h b/src/tools/qshared.h deleted file mode 100644 index 90bbbf94a..000000000 --- a/src/tools/qshared.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Definition of TQShared struct -** -** Created : 940112 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSHARED_H -#define TQSHARED_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - - -struct Q_EXPORT TQShared -{ - TQShared() : count( 1 ) { } - void ref() { count++; } - bool deref() { return !--count; } - uint count; -}; - - -#endif // TQSHARED_H diff --git a/src/tools/qsortedlist.h b/src/tools/qsortedlist.h deleted file mode 100644 index da0ecaed8..000000000 --- a/src/tools/qsortedlist.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSortedList template/macro class -** -** Created : 920701 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSORTEDLIST_H -#define TQSORTEDLIST_H - -#ifndef QT_H -#include "qptrlist.h" -#endif // QT_H - - -template -class TQSortedList : public TQPtrList -{ -public: - TQSortedList() {} - TQSortedList( const TQSortedList &l ) : TQPtrList(l) {} - ~TQSortedList() { this->clear(); } - TQSortedList &operator=(const TQSortedList &l) - { return (TQSortedList&)TQPtrList::operator=(l); } - - virtual int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) - { if ( *((type*)s1) == *((type*)s2) ) return 0; return ( *((type*)s1) < *((type*)s2) ? -1 : 1 ); } -}; - -#endif diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index ae582e34c..f4946a01a 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -44,13 +44,13 @@ #undef QT_NO_CAST_ASCII #endif -#include "qstring.h" -#include "qregexp.h" -#include "qdatastream.h" +#include "ntqstring.h" +#include "ntqregexp.h" +#include "ntqdatastream.h" #ifndef QT_NO_TEXTCODEC -#include "qtextcodec.h" +#include "ntqtextcodec.h" #endif -#include "qlocale.h" +#include "ntqlocale.h" #include "qlocale_p.h" #include "qunicodetables_p.h" @@ -66,7 +66,7 @@ #include "qt_windows.h" #endif #if !defined( QT_NO_COMPONENT ) && !defined( QT_LITE_COMPONENT ) -#include "qcleanuphandler.h" +#include "ntqcleanuphandler.h" #endif #ifndef LLONG_MAX @@ -148,7 +148,7 @@ static char qToLower(char c) } /*! - \class TQCharRef qstring.h + \class TQCharRef ntqstring.h \reentrant \brief The TQCharRef class is a helper class for TQString. @@ -167,7 +167,7 @@ static char qToLower(char c) */ /*! - \class TQChar qstring.h + \class TQChar ntqstring.h \reentrant \brief The TQChar class provides a lightweight Unicode character. @@ -1092,7 +1092,7 @@ void TQString::compose() // These macros are used for efficient allocation of TQChar strings. // IMPORTANT! If you change these, make sure you also change the -// "delete unicode" statement in ~TQStringData() in qstring.h correspondingly! +// "delete unicode" statement in ~TQStringData() in ntqstring.h correspondingly! #define QT_ALLOC_QCHAR_VEC( N ) (TQChar*) new char[ sizeof(TQChar)*( N ) ] #define QT_DELETE_QCHAR_VEC( P ) delete[] ((char*)( P )) @@ -1229,7 +1229,7 @@ char* TQString::unicodeToLatin1(const TQChar *uc, uint l) *****************************************************************************/ /*! - \class TQString qstring.h + \class TQString ntqstring.h \reentrant \brief The TQString class provides an abstraction of Unicode text @@ -1278,7 +1278,7 @@ char* TQString::unicodeToLatin1(const TQChar *uc, uint l) and join a list of strings into a single string with an optional separator using TQStringList::join(). You can obtain a list of strings from a string list that contain a particular substring or - that match a particular \link qregexp.html regex\endlink using + that match a particular \link ntqregexp.html regex\endlink using TQStringList::grep(). Note for C programmers @@ -4442,7 +4442,7 @@ TQString &TQString::replace( const TQString & before, const TQString & after ) // s == "ba" \endcode - For regexps containing \link qregexp.html#capturing-text capturing + For regexps containing \link ntqregexp.html#capturing-text capturing parentheses \endlink, occurrences of \\1, \\2, ..., in \a after are replaced with \a{rx}.cap(1), cap(2), ... @@ -6914,7 +6914,7 @@ TQDataStream &operator>>( TQDataStream &s, TQString &str ) *****************************************************************************/ /*! - \class TQConstString qstring.h + \class TQConstString ntqstring.h \reentrant \ingroup text \brief The TQConstString class provides string objects using constant Unicode data. diff --git a/src/tools/qstring.h b/src/tools/qstring.h deleted file mode 100644 index 20056e663..000000000 --- a/src/tools/qstring.h +++ /dev/null @@ -1,1115 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQString class, and related Unicode functions. -** -** Created : 920609 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTRING_H -#define TQSTRING_H - -#ifndef QT_H -#include "qcstring.h" -#endif // QT_H - -#ifndef QT_NO_CAST_ASCII -#include -#endif - -#ifndef QT_NO_STL -#if defined ( Q_CC_MSVC_NET ) && _MSC_VER < 1310 // Avoids nasty warning for xlocale, line 450 -# pragma warning ( push ) -# pragma warning ( disable : 4189 ) -# include -# pragma warning ( pop ) -#else -# include -#endif -#if defined(Q_WRONG_SB_CTYPE_MACROS) && defined(_SB_CTYPE_MACROS) -#undef _SB_CTYPE_MACROS -#endif -#endif - - -/***************************************************************************** - TQString class - *****************************************************************************/ - -class TQRegExp; -class TQString; -class TQCharRef; -template class TQDeepCopy; - -class Q_EXPORT TQChar { -public: - TQChar(); - TQChar( char c ); - TQChar( uchar c ); - TQChar( uchar c, uchar r ); - TQChar( const TQChar& c ); // ### remove in 4.0 to allow compiler optimization - TQChar( ushort rc ); - TQChar( short rc ); - TQChar( uint rc ); - TQChar( int rc ); - - QT_STATIC_CONST TQChar null; // 0000 - QT_STATIC_CONST TQChar replacement; // FFFD - QT_STATIC_CONST TQChar byteOrderMark; // FEFF - QT_STATIC_CONST TQChar byteOrderSwapped; // FFFE - QT_STATIC_CONST TQChar nbsp; // 00A0 - - // Unicode information - - enum Category - { - NoCategory, - - Mark_NonSpacing, // Mn - Mark_SpacingCombining, // Mc - Mark_Enclosing, // Me - - Number_DecimalDigit, // Nd - Number_Letter, // Nl - Number_Other, // No - - Separator_Space, // Zs - Separator_Line, // Zl - Separator_Paragraph, // Zp - - Other_Control, // Cc - Other_Format, // Cf - Other_Surrogate, // Cs - Other_PrivateUse, // Co - Other_NotAssigned, // Cn - - Letter_Uppercase, // Lu - Letter_Lowercase, // Ll - Letter_Titlecase, // Lt - Letter_Modifier, // Lm - Letter_Other, // Lo - - Punctuation_Connector, // Pc - Punctuation_Dash, // Pd - Punctuation_Dask = Punctuation_Dash, // oops - Punctuation_Open, // Ps - Punctuation_Close, // Pe - Punctuation_InitialQuote, // Pi - Punctuation_FinalQuote, // Pf - Punctuation_Other, // Po - - Symbol_Math, // Sm - Symbol_Currency, // Sc - Symbol_Modifier, // Sk - Symbol_Other // So - }; - - 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 = 200, - Combining_BelowAttached = 202, - Combining_BelowRightAttached = 204, - Combining_LeftAttached = 208, - Combining_RightAttached = 210, - Combining_AboveLeftAttached = 212, - Combining_AboveAttached = 214, - Combining_AboveRightAttached = 216, - - Combining_BelowLeft = 218, - Combining_Below = 220, - Combining_BelowRight = 222, - Combining_Left = 224, - Combining_Right = 226, - Combining_AboveLeft = 228, - Combining_Above = 230, - Combining_AboveRight = 232, - - Combining_DoubleBelow = 233, - Combining_DoubleAbove = 234, - Combining_IotaSubscript = 240 - }; - - // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO TQCharRef TOO - - 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; // ### return just TQString in 4.0 - Decomposition decompositionTag() const; - unsigned char combiningClass() const; - - char latin1() const { return ucs > 0xff ? 0 : (char) ucs; } - ushort unicode() const { return ucs; } -#ifdef Q_NO_PACKED_REFERENCE - ushort &unicode() { return *((ushort*)&ucs); } -#else - ushort &unicode() { return ucs; } -#endif -#ifndef QT_NO_CAST_ASCII - // like all ifdef'd code this is undocumented - operator char() const { return latin1(); } -#endif - - bool isNull() const { return unicode()==0; } - 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() const { return ((uchar) ucs & 0xff); } - uchar row() const { return ((uchar) (ucs>>8)&0xff); } - void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; } - void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); } - - static bool networkOrdered() { - int wordSize; - bool bigEndian = FALSE; - qSysInfo( &wordSize, &bigEndian ); - return bigEndian; - } - - friend inline bool operator==( char ch, TQChar c ); - friend inline bool operator==( TQChar c, char ch ); - friend inline bool operator==( TQChar c1, TQChar c2 ); - friend inline bool operator!=( TQChar c1, TQChar c2 ); - friend inline bool operator!=( char ch, TQChar c ); - friend inline bool operator!=( TQChar c, char ch ); - friend inline bool operator<=( TQChar c, char ch ); - friend inline bool operator<=( char ch, TQChar c ); - friend inline bool operator<=( TQChar c1, TQChar c2 ); - -private: - ushort ucs; -#if defined(QT_QSTRING_UCS_4) - ushort grp; -#endif -} Q_PACKED; - -inline TQChar::TQChar() : ucs( 0 ) -#ifdef QT_QSTRING_UCS_4 - , grp( 0 ) -#endif -{ -} -inline TQChar::TQChar( char c ) : ucs( (uchar)c ) -#ifdef QT_QSTRING_UCS_4 - , grp( 0 ) -#endif -{ -} -inline TQChar::TQChar( uchar c ) : ucs( c ) -#ifdef QT_QSTRING_UCS_4 - , grp( 0 ) -#endif -{ -} -inline TQChar::TQChar( uchar c, uchar r ) : ucs( (r << 8) | c ) -#ifdef QT_QSTRING_UCS_4 - , grp( 0 ) -#endif -{ -} -inline TQChar::TQChar( const TQChar& c ) : ucs( c.ucs ) -#ifdef QT_QSTRING_UCS_4 - , grp( c.grp ) -#endif -{ -} - -inline TQChar::TQChar( ushort rc ) : ucs( rc ) -#ifdef QT_QSTRING_UCS_4 - , grp( 0 ) -#endif -{ -} -inline TQChar::TQChar( short rc ) : ucs( (ushort) rc ) -#ifdef QT_QSTRING_UCS_4 - , grp( 0 ) -#endif -{ -} -inline TQChar::TQChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) ) -#ifdef QT_QSTRING_UCS_4 - , grp( (ushort) ((rc >> 16) & 0xffff) ) -#endif -{ -} -inline TQChar::TQChar( int rc ) : ucs( (ushort) (rc & 0xffff) ) -#ifdef QT_QSTRING_UCS_4 - , grp( (ushort) ((rc >> 16) & 0xffff) ) -#endif -{ -} - -inline bool operator==( char ch, TQChar c ) -{ - return ((uchar) ch) == c.ucs; -} - -inline bool operator==( TQChar c, char ch ) -{ - return ((uchar) ch) == c.ucs; -} - -inline bool operator==( TQChar c1, TQChar c2 ) -{ - return c1.ucs == c2.ucs; -} - -inline bool operator!=( TQChar c1, TQChar c2 ) -{ - return c1.ucs != c2.ucs; -} - -inline bool operator!=( char ch, TQChar c ) -{ - return ((uchar)ch) != c.ucs; -} - -inline bool operator!=( TQChar c, char ch ) -{ - return ((uchar) ch) != c.ucs; -} - -inline bool operator<=( TQChar c, char ch ) -{ - return c.ucs <= ((uchar) ch); -} - -inline bool operator<=( char ch, TQChar c ) -{ - return ((uchar) ch) <= c.ucs; -} - -inline bool operator<=( TQChar c1, TQChar c2 ) -{ - return c1.ucs <= c2.ucs; -} - -inline bool operator>=( TQChar c, char ch ) { return ch <= c; } -inline bool operator>=( char ch, TQChar c ) { return c <= ch; } -inline bool operator>=( TQChar c1, TQChar c2 ) { return c2 <= c1; } -inline bool operator<( TQChar c, char ch ) { return !(ch<=c); } -inline bool operator<( char ch, TQChar c ) { return !(c<=ch); } -inline bool operator<( TQChar c1, TQChar c2 ) { return !(c2<=c1); } -inline bool operator>( TQChar c, char ch ) { return !(ch>=c); } -inline bool operator>( char ch, TQChar c ) { return !(c>=ch); } -inline bool operator>( TQChar c1, TQChar c2 ) { return !(c2>=c1); } - -// internal -struct Q_EXPORT TQStringData : public TQShared { - TQStringData() : - TQShared(), unicode(0), ascii(0), len(0), issimpletext(TRUE), maxl(0), islatin1(FALSE) { ref(); } - TQStringData(TQChar *u, uint l, uint m) : - TQShared(), unicode(u), ascii(0), len(l), issimpletext(FALSE), maxl(m), islatin1(FALSE) { } - ~TQStringData() { if ( unicode ) delete[] ((char*)unicode); - if ( ascii ) delete[] ascii; } - - void deleteSelf(); - TQChar *unicode; - char *ascii; - void setDirty() { - if ( ascii ) { - delete [] ascii; - ascii = 0; - } - issimpletext = FALSE; - } -#ifdef Q_OS_MAC9 - uint len; -#else - uint len : 30; -#endif - uint issimpletext : 1; -#ifdef Q_OS_MAC9 - uint maxl; -#else - uint maxl : 30; -#endif - uint islatin1 : 1; - -private: -#if defined(Q_DISABLE_COPY) - TQStringData( const TQStringData& ); - TQStringData& operator=( const TQStringData& ); -#endif -}; - - -class Q_EXPORT TQString -{ -public: - TQString(); // make null string - TQString( TQChar ); // one-char string - TQString( const TQString & ); // impl-shared copy - TQString( const TQByteArray& ); // deep copy - TQString( const TQChar* unicode, uint length ); // deep copy -#ifndef QT_NO_CAST_ASCII - TQString( const char *str ); // deep copy -#endif -#ifndef QT_NO_STL - TQString( const std::string& ); // deep copy -#endif - ~TQString(); - - TQString &operator=( const TQString & ); // impl-shared copy - TQString &operator=( const char * ); // deep copy -#ifndef QT_NO_STL - TQString &operator=( const std::string& ); // deep copy -#endif - TQString &operator=( const TQCString& ); // deep copy - TQString &operator=( TQChar c ); - TQString &operator=( char c ); - - QT_STATIC_CONST TQString null; - - bool isNull() const; - bool isEmpty() const; - uint length() const; - void truncate( uint pos ); - - TQString & fill( TQChar c, int len = -1 ); - - TQString copy() const; - - TQString arg( long a, int fieldWidth = 0, int base = 10 ) const; - TQString arg( ulong a, int fieldWidth = 0, int base = 10 ) const; - TQString arg( Q_LLONG a, int fieldwidth=0, int base=10 ) const; - TQString arg( Q_ULLONG a, int fieldwidth=0, int base=10 ) const; - TQString arg( int a, int fieldWidth = 0, int base = 10 ) const; - TQString arg( uint a, int fieldWidth = 0, int base = 10 ) const; - TQString arg( short a, int fieldWidth = 0, int base = 10 ) const; - TQString arg( ushort a, int fieldWidth = 0, int base = 10 ) const; - TQString arg( double a, int fieldWidth = 0, char fmt = 'g', - int prec = -1 ) const; - TQString arg( char a, int fieldWidth = 0 ) const; - TQString arg( TQChar a, int fieldWidth = 0 ) const; - TQString arg( const TQString& a, int fieldWidth = 0 ) const; - TQString arg( const TQString& a1, const TQString& a2 ) const; - TQString arg( const TQString& a1, const TQString& a2, - const TQString& a3 ) const; - TQString arg( const TQString& a1, const TQString& a2, const TQString& a3, - const TQString& a4 ) const; - -#ifndef QT_NO_SPRINTF - TQString &sprintf( const char* format, ... ) -#if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 2, 3))) -#endif - ; -#endif - - int find( TQChar c, int index=0, bool cs=TRUE ) const; - int find( char c, int index=0, bool cs=TRUE ) const; - int find( const TQString &str, int index=0, bool cs=TRUE ) const; -#ifndef QT_NO_REGEXP - int find( const TQRegExp &, int index=0 ) const; -#endif -#ifndef QT_NO_CAST_ASCII - int find( const char* str, int index=0 ) const; -#endif - int findRev( TQChar c, int index=-1, bool cs=TRUE) const; - int findRev( char c, int index=-1, bool cs=TRUE) const; - int findRev( const TQString &str, int index=-1, bool cs=TRUE) const; -#ifndef QT_NO_REGEXP - int findRev( const TQRegExp &, int index=-1 ) const; -#endif -#ifndef QT_NO_CAST_ASCII - int findRev( const char* str, int index=-1 ) const; -#endif - int contains( TQChar c, bool cs=TRUE ) const; - int contains( char c, bool cs=TRUE ) const - { return contains(TQChar(c), cs); } -#ifndef QT_NO_CAST_ASCII - int contains( const char* str, bool cs=TRUE ) const; -#endif - int contains( const TQString &str, bool cs=TRUE ) const; -#ifndef QT_NO_REGEXP - int contains( const TQRegExp & ) const; -#endif - - enum SectionFlags { - SectionDefault = 0x00, - SectionSkipEmpty = 0x01, - SectionIncludeLeadingSep = 0x02, - SectionIncludeTrailingSep = 0x04, - SectionCaseInsensitiveSeps = 0x08 - }; - TQString section( TQChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; - TQString section( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; -#ifndef QT_NO_CAST_ASCII - TQString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; -#endif - TQString section( const TQString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; -#ifndef QT_NO_REGEXP - TQString section( const TQRegExp ®, int start, int end = 0xffffffff, int flags = SectionDefault ) const; -#endif - - TQString left( uint len ) const; - TQString right( uint len ) const; - TQString mid( uint index, uint len=0xffffffff) const; - - TQString leftJustify( uint width, TQChar fill=' ', bool trunc=FALSE)const; - TQString rightJustify( uint width, TQChar fill=' ',bool trunc=FALSE)const; - - TQString lower() const; - TQString upper() const; - - TQString stripWhiteSpace() const; - TQString simplifyWhiteSpace() const; - - TQString &insert( uint index, const TQString & ); -#ifndef QT_NO_CAST_ASCII - TQString &insert( uint index, const TQByteArray & ); - TQString &insert( uint index, const char * ); -#endif - TQString &insert( uint index, const TQChar*, uint len ); - TQString &insert( uint index, TQChar ); - TQString &insert( uint index, char c ) { return insert(index,TQChar(c)); } - TQString &append( char ); - TQString &append( TQChar ); - TQString &append( const TQString & ); -#ifndef QT_NO_CAST_ASCII - TQString &append( const TQByteArray & ); - TQString &append( const char * ); -#endif -#if !defined(QT_NO_STL) && !defined(QT_NO_CAST_ASCII) - TQString &append( const std::string& ); -#endif - TQString &prepend( char ); - TQString &prepend( TQChar ); - TQString &prepend( const TQString & ); -#ifndef QT_NO_CAST_ASCII - TQString &prepend( const TQByteArray & ); - TQString &prepend( const char * ); -#endif -#if !defined(QT_NO_STL) && !defined(QT_NO_CAST_ASCII) - TQString &prepend( const std::string& ); -#endif - TQString &remove( uint index, uint len ); -#if defined(Q_QDOC) - TQString &remove( const TQString & str, bool cs = TRUE ); -#else - // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack - TQString &remove( const TQString & ); - TQString &remove( const TQString &, bool cs ); -#endif - TQString &remove( TQChar c ); - TQString &remove( char c ) - { return remove( TQChar(c) ); } -#ifndef QT_NO_CAST_ASCII - TQString &remove( const char * ); -#endif -#ifndef QT_NO_REGEXP - TQString &remove( const TQRegExp & ); -#endif - TQString &replace( uint index, uint len, const TQString & ); - TQString &replace( uint index, uint len, const TQChar*, uint clen ); - TQString &replace( uint index, uint len, TQChar ); - TQString &replace( uint index, uint len, char c ) - { return replace( index, len, TQChar(c) ); } -#if defined(Q_QDOC) - TQString &replace( TQChar c, const TQString & after, bool cs = TRUE ); - TQString &replace( char c, const TQString & after, bool cs = TRUE ); - TQString &replace( const TQString & before, const TQString & after, - bool cs = TRUE ); -#else - // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack - TQString &replace( TQChar c, const TQString & ); - TQString &replace( TQChar c, const TQString &, bool ); - - // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack - TQString &replace( char c, const TQString & after ) - { return replace( TQChar(c), after, TRUE ); } - TQString &replace( char c, const TQString & after, bool cs ) - { return replace( TQChar(c), after, cs ); } - - // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack - TQString &replace( const TQString &, const TQString & ); - TQString &replace( const TQString &, const TQString &, bool ); -#endif -#ifndef QT_NO_REGEXP_CAPTURE - TQString &replace( const TQRegExp &, const TQString & ); -#endif - TQString &replace( TQChar, TQChar ); - - short toShort( bool *ok=0, int base=10 ) const; - ushort toUShort( bool *ok=0, int base=10 ) const; - int toInt( bool *ok=0, int base=10 ) const; - uint toUInt( bool *ok=0, int base=10 ) const; - long toLong( bool *ok=0, int base=10 ) const; - ulong toULong( bool *ok=0, int base=10 ) const; - Q_LLONG toLongLong( bool *ok=0, int base=10 ) const; - Q_ULLONG toULongLong( bool *ok=0, int base=10 ) const; - float toFloat( bool *ok=0 ) const; - double toDouble( bool *ok=0 ) const; - - TQString &setNum( short, int base=10 ); - TQString &setNum( ushort, int base=10 ); - TQString &setNum( int, int base=10 ); - TQString &setNum( uint, int base=10 ); - TQString &setNum( long, int base=10 ); - TQString &setNum( ulong, int base=10 ); - TQString &setNum( Q_LLONG, int base=10 ); - TQString &setNum( Q_ULLONG, int base=10 ); - TQString &setNum( float, char f='g', int prec=6 ); - TQString &setNum( double, char f='g', int prec=6 ); - - static TQString number( long, int base=10 ); - static TQString number( ulong, int base=10); - static TQString number( Q_LLONG, int base=10 ); - static TQString number( Q_ULLONG, int base=10); - static TQString number( int, int base=10 ); - static TQString number( uint, int base=10); - static TQString number( double, char f='g', int prec=6 ); - - void setExpand( uint index, TQChar c ); - - TQString &operator+=( const TQString &str ); -#ifndef QT_NO_CAST_ASCII - TQString &operator+=( const TQByteArray &str ); - TQString &operator+=( const char *str ); -#endif -#if !defined(QT_NO_STL) && !defined(QT_NO_CAST_ASCII) - TQString &operator+=( const std::string& ); -#endif - TQString &operator+=( TQChar c ); - TQString &operator+=( char c ); - - TQChar at( uint i ) const - { return i < d->len ? d->unicode[i] : TQChar::null; } - TQChar operator[]( int i ) const { return at((uint)i); } - TQCharRef at( uint i ); - TQCharRef operator[]( int i ); - - TQChar constref(uint i) const - { return at(i); } - TQChar& ref(uint i) - { // Optimized for easy-inlining by simple compilers. - if ( d->count != 1 || i >= d->len ) - subat( i ); - d->setDirty(); - return d->unicode[i]; - } - - const TQChar* unicode() const { return d->unicode; } - const char* ascii() const; - static TQString fromAscii(const char*, int len=-1); - const char* latin1() const; - static TQString fromLatin1(const char*, int len=-1); - TQCString utf8() const; - static TQString fromUtf8(const char*, int len=-1); - TQCString local8Bit() const; - static TQString fromLocal8Bit(const char*, int len=-1); - bool operator!() const; -#ifndef QT_NO_ASCII_CAST - operator const char *() const { return ascii(); } -#endif -#ifndef QT_NO_STL - operator std::string() const { return ascii() ? ascii() : ""; } -#endif - - static TQString fromUcs2( const unsigned short *ucs2 ); - const unsigned short *ucs2() const; - - TQString &setUnicode( const TQChar* unicode, uint len ); - TQString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len ); - TQString &setAscii( const char*, int len=-1 ); - TQString &setLatin1( const char*, int len=-1 ); - - int compare( const TQString& s ) const; - static int compare( const TQString& s1, const TQString& s2 ) - { return s1.compare( s2 ); } - - int localeAwareCompare( const TQString& s ) const; - static int localeAwareCompare( const TQString& s1, const TQString& s2 ) - { return s1.localeAwareCompare( s2 ); } - -#ifndef QT_NO_DATASTREAM - friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQString & ); -#endif - - void compose(); - -#ifndef QT_NO_COMPAT - const char* data() const { return ascii(); } -#endif - -#if defined(Q_QDOC) - bool startsWith( const TQString& str, bool cs = TRUE ) const; - bool endsWith( const TQString& str, bool cs = TRUE ) const; -#else - // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack - bool startsWith( const TQString& str ) const; - bool startsWith( const TQString& str, bool cs ) const; - - // ### TQt 4.0: merge these two into one, and remove Q_QDOC hack - bool endsWith( const TQString& str ) const; - bool endsWith( const TQString& str, bool cs ) const; -#endif - - void setLength( uint newLength ); - - uint capacity() const; - void reserve( uint minCapacity ); - void squeeze(); - - bool simpleText() const { if ( !d->issimpletext ) checkSimpleText(); return (bool)d->issimpletext; } - bool isRightToLeft() const; - - -private: - TQString( int size, bool /* dummy */ ); // allocate size incl. \0 - - void deref(); - void real_detach(); - void subat( uint ); - TQString multiArg( int numArgs, const TQString& a1, const TQString& a2, - const TQString& a3 = TQString::null, - const TQString& a4 = TQString::null ) const; - - void checkSimpleText() const; - void grow( uint newLength ); -#ifndef QT_NO_CAST_ASCII - TQString &insertHelper( uint index, const char *s, uint len=UINT_MAX ); - TQString &operatorPlusEqHelper( const char *s, uint len2=UINT_MAX ); -#endif - - static TQChar* latin1ToUnicode( const char*, uint * len, uint maxlen=(uint)-1 ); - static TQChar* latin1ToUnicode( const TQByteArray&, uint * len ); - static char* unicodeToLatin1( const TQChar*, uint len ); - - TQStringData *d; - static TQStringData* shared_null; - static TQStringData* makeSharedNull(); - - friend class TQConstString; - friend class TQTextStream; - TQString( TQStringData* dd, bool /* dummy */ ) : d(dd) { } - - // needed for TQDeepCopy - void detach(); - friend class TQDeepCopy; -}; - -class Q_EXPORT TQCharRef { - friend class TQString; - TQString& s; - uint p; - TQCharRef(TQString* str, uint pos) : s(*str), p(pos) { } - -public: - // most TQChar operations repeated here - - // all this is not documented: We just say "like TQChar" and let it be. -#ifndef Q_QDOC - ushort unicode() const { return s.constref(p).unicode(); } - char latin1() const { return s.constref(p).latin1(); } - - // An operator= for each TQChar cast constructors - TQCharRef operator=(char c ) { s.ref(p)=c; return *this; } - TQCharRef operator=(uchar c ) { s.ref(p)=c; return *this; } - TQCharRef operator=(TQChar c ) { s.ref(p)=c; return *this; } - TQCharRef operator=(const TQCharRef& c ) { s.ref(p)=c.unicode(); return *this; } - TQCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; } - TQCharRef operator=(short rc ) { s.ref(p)=rc; return *this; } - TQCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; } - TQCharRef operator=(int rc ) { s.ref(p)=rc; return *this; } - - operator TQChar () const { return s.constref(p); } - - // each function... - bool isNull() const { return unicode()==0; } - bool isPrint() const { return s.constref(p).isPrint(); } - bool isPunct() const { return s.constref(p).isPunct(); } - bool isSpace() const { return s.constref(p).isSpace(); } - bool isMark() const { return s.constref(p).isMark(); } - bool isLetter() const { return s.constref(p).isLetter(); } - bool isNumber() const { return s.constref(p).isNumber(); } - bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); } - bool isDigit() const { return s.constref(p).isDigit(); } - - int digitValue() const { return s.constref(p).digitValue(); } - TQChar lower() const { return s.constref(p).lower(); } - TQChar upper() const { return s.constref(p).upper(); } - - TQChar::Category category() const { return s.constref(p).category(); } - TQChar::Direction direction() const { return s.constref(p).direction(); } - TQChar::Joining joining() const { return s.constref(p).joining(); } - bool mirrored() const { return s.constref(p).mirrored(); } - TQChar mirroredChar() const { return s.constref(p).mirroredChar(); } - const TQString &decomposition() const { return s.constref(p).decomposition(); } - TQChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); } - unsigned char combiningClass() const { return s.constref(p).combiningClass(); } - - // Not the non-const ones of these. - uchar cell() const { return s.constref(p).cell(); } - uchar row() const { return s.constref(p).row(); } -#endif -}; - -inline TQCharRef TQString::at( uint i ) { return TQCharRef(this,i); } -inline TQCharRef TQString::operator[]( int i ) { return at((uint)i); } - - -class Q_EXPORT TQConstString : private TQString { -public: - TQConstString( const TQChar* unicode, uint length ); - ~TQConstString(); - const TQString& string() const { return *this; } -}; - - -/***************************************************************************** - TQString stream functions - *****************************************************************************/ -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQString & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQString & ); -#endif - -/***************************************************************************** - TQString inline functions - *****************************************************************************/ - -// These two move code into makeSharedNull() and deletesData() -// to improve cache-coherence (and reduce code bloat), while -// keeping the common cases fast. -// -// No safe way to pre-init shared_null on ALL compilers/linkers. -inline TQString::TQString() : - d(shared_null ? shared_null : makeSharedNull()) -{ - d->ref(); -} -// -inline TQString::~TQString() -{ - if ( d->deref() ) { - if ( d != shared_null ) - d->deleteSelf(); - } -} - -// needed for TQDeepCopy -inline void TQString::detach() -{ real_detach(); } - -inline TQString TQString::section( TQChar sep, int start, int end, int flags ) const -{ return section(TQString(sep), start, end, flags); } - -inline TQString TQString::section( char sep, int start, int end, int flags ) const -{ return section(TQChar(sep), start, end, flags); } - -#ifndef QT_NO_CAST_ASCII -inline TQString TQString::section( const char *in_sep, int start, int end, int flags ) const -{ return section(TQString(in_sep), start, end, flags); } -#endif - -inline TQString &TQString::operator=( TQChar c ) -{ *this = TQString(c); return *this; } - -inline TQString &TQString::operator=( char c ) -{ *this = TQString(TQChar(c)); return *this; } - -inline bool TQString::isNull() const -{ return unicode() == 0; } - -inline bool TQString::operator!() const -{ return isNull(); } - -inline uint TQString::length() const -{ return d->len; } - -inline uint TQString::capacity() const -{ return d->maxl; } - -inline bool TQString::isEmpty() const -{ return length() == 0; } - -inline TQString TQString::copy() const -{ return TQString( *this ); } - -#ifndef QT_NO_CAST_ASCII -inline TQString &TQString::insert( uint index, const char *s ) -{ return insertHelper( index, s ); } - -inline TQString &TQString::insert( uint index, const TQByteArray &s ) -{ - int pos = s.find( 0 ); - return insertHelper( index, s, pos==-1 ? s.size() : pos ); -} -#endif - -inline TQString &TQString::prepend( const TQString & s ) -{ return insert(0,s); } - -inline TQString &TQString::prepend( TQChar c ) -{ return insert(0,c); } - -inline TQString &TQString::prepend( char c ) -{ return insert(0,c); } - -#ifndef QT_NO_CAST_ASCII -inline TQString &TQString::prepend( const TQByteArray & s ) -{ return insert(0,s); } -#endif - -#ifndef QT_NO_CAST_ASCII -inline TQString &TQString::operator+=( const TQByteArray &s ) -{ - int pos = s.find( 0 ); - return operatorPlusEqHelper( s, pos==-1 ? s.size() : pos ); -} -#endif - -inline TQString &TQString::append( const TQString & s ) -{ return operator+=(s); } - -#ifndef QT_NO_CAST_ASCII -inline TQString &TQString::append( const TQByteArray &s ) -{ return operator+=(s); } - -inline TQString &TQString::append( const char * s ) -{ return operator+=(s); } -#endif - -inline TQString &TQString::append( TQChar c ) -{ return operator+=(c); } - -inline TQString &TQString::append( char c ) -{ return operator+=(c); } - -#ifndef QT_NO_STL -inline TQString &TQString::operator=( const std::string& str ) -{ return operator=(str.c_str()); } -#ifndef QT_NO_CAST_ASCII -inline TQString &TQString::operator+=( const std::string& s ) -{ return operator+=(s.c_str()); } -inline TQString &TQString::append( const std::string& s ) -{ return operator+=(s); } -inline TQString &TQString::prepend( const std::string& s ) -{ return insert(0, s); } -#endif -#endif - -inline TQString &TQString::setNum( short n, int base ) -{ return setNum((Q_LLONG)n, base); } - -inline TQString &TQString::setNum( ushort n, int base ) -{ return setNum((Q_ULLONG)n, base); } - -inline TQString &TQString::setNum( int n, int base ) -{ return setNum((Q_LLONG)n, base); } - -inline TQString &TQString::setNum( uint n, int base ) -{ return setNum((Q_ULLONG)n, base); } - -inline TQString &TQString::setNum( float n, char f, int prec ) -{ return setNum((double)n,f,prec); } - -inline TQString TQString::arg( int a, int fieldWidth, int base ) const -{ return arg( (Q_LLONG)a, fieldWidth, base ); } - -inline TQString TQString::arg( uint a, int fieldWidth, int base ) const -{ return arg( (Q_ULLONG)a, fieldWidth, base ); } - -inline TQString TQString::arg( short a, int fieldWidth, int base ) const -{ return arg( (Q_LLONG)a, fieldWidth, base ); } - -inline TQString TQString::arg( ushort a, int fieldWidth, int base ) const -{ return arg( (Q_ULLONG)a, fieldWidth, base ); } - -inline TQString TQString::arg( const TQString& a1, const TQString& a2 ) const { - return multiArg( 2, a1, a2 ); -} - -inline TQString TQString::arg( const TQString& a1, const TQString& a2, - const TQString& a3 ) const { - return multiArg( 3, a1, a2, a3 ); -} - -inline TQString TQString::arg( const TQString& a1, const TQString& a2, - const TQString& a3, const TQString& a4 ) const { - return multiArg( 4, a1, a2, a3, a4 ); -} - -inline int TQString::find( char c, int index, bool cs ) const -{ return find(TQChar(c), index, cs); } - -inline int TQString::findRev( char c, int index, bool cs ) const -{ return findRev( TQChar(c), index, cs ); } - -#ifndef QT_NO_CAST_ASCII -inline int TQString::find( const char* str, int index ) const -{ return find(TQString::fromAscii(str), index); } - -inline int TQString::findRev( const char* str, int index ) const -{ return findRev(TQString::fromAscii(str), index); } -#endif - - -/***************************************************************************** - TQString non-member operators - *****************************************************************************/ - -Q_EXPORT bool operator!=( const TQString &s1, const TQString &s2 ); -Q_EXPORT bool operator<( const TQString &s1, const TQString &s2 ); -Q_EXPORT bool operator<=( const TQString &s1, const TQString &s2 ); -Q_EXPORT bool operator==( const TQString &s1, const TQString &s2 ); -Q_EXPORT bool operator>( const TQString &s1, const TQString &s2 ); -Q_EXPORT bool operator>=( const TQString &s1, const TQString &s2 ); -#ifndef QT_NO_CAST_ASCII -Q_EXPORT bool operator!=( const TQString &s1, const char *s2 ); -Q_EXPORT bool operator<( const TQString &s1, const char *s2 ); -Q_EXPORT bool operator<=( const TQString &s1, const char *s2 ); -Q_EXPORT bool operator==( const TQString &s1, const char *s2 ); -Q_EXPORT bool operator>( const TQString &s1, const char *s2 ); -Q_EXPORT bool operator>=( const TQString &s1, const char *s2 ); -Q_EXPORT bool operator!=( const char *s1, const TQString &s2 ); -Q_EXPORT bool operator<( const char *s1, const TQString &s2 ); -Q_EXPORT bool operator<=( const char *s1, const TQString &s2 ); -Q_EXPORT bool operator==( const char *s1, const TQString &s2 ); -//Q_EXPORT bool operator>( const char *s1, const TQString &s2 ); // MSVC++ -Q_EXPORT bool operator>=( const char *s1, const TQString &s2 ); -#endif - -Q_EXPORT inline const TQString operator+( const TQString &s1, const TQString &s2 ) -{ - TQString tmp( s1 ); - tmp += s2; - return tmp; -} - -#ifndef QT_NO_CAST_ASCII -Q_EXPORT inline const TQString operator+( const TQString &s1, const char *s2 ) -{ - TQString tmp( s1 ); - tmp += TQString::fromAscii(s2); - return tmp; -} - -Q_EXPORT inline const TQString operator+( const char *s1, const TQString &s2 ) -{ - TQString tmp = TQString::fromAscii( s1 ); - tmp += s2; - return tmp; -} -#endif - -Q_EXPORT inline const TQString operator+( const TQString &s1, TQChar c2 ) -{ - TQString tmp( s1 ); - tmp += c2; - return tmp; -} - -Q_EXPORT inline const TQString operator+( const TQString &s1, char c2 ) -{ - TQString tmp( s1 ); - tmp += c2; - return tmp; -} - -Q_EXPORT inline const TQString operator+( TQChar c1, const TQString &s2 ) -{ - TQString tmp; - tmp += c1; - tmp += s2; - return tmp; -} - -Q_EXPORT inline const TQString operator+( char c1, const TQString &s2 ) -{ - TQString tmp; - tmp += c1; - tmp += s2; - return tmp; -} - -#ifndef QT_NO_STL -Q_EXPORT inline const TQString operator+(const TQString& s1, const std::string& s2) -{ - return s1 + TQString(s2); -} - -Q_EXPORT inline const TQString operator+(const std::string& s1, const TQString& s2) -{ - TQString tmp(s2); - return TQString(tmp.prepend(s1)); -} -#endif - - -#if defined(Q_OS_WIN32) -extern Q_EXPORT TQString qt_winTQString(void*); -extern Q_EXPORT const void* qt_winTchar(const TQString& str, bool addnul); -extern Q_EXPORT void* qt_winTchar_new(const TQString& str); -extern Q_EXPORT TQCString qt_winTQString2MB( const TQString& s, int len=-1 ); -extern Q_EXPORT TQString qt_winMB2TQString( const char* mb, int len=-1 ); -#endif - -#define Q_DEFINED_QSTRING -#include "qwinexport.h" -#endif // TQSTRING_H diff --git a/src/tools/qstringlist.cpp b/src/tools/qstringlist.cpp index 7234cc40f..3f77cc52d 100644 --- a/src/tools/qstringlist.cpp +++ b/src/tools/qstringlist.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qstringlist.h" +#include "ntqstringlist.h" #ifndef QT_NO_STRINGLIST -#include "qregexp.h" -#include "qstrlist.h" -#include "qdatastream.h" -#include "qtl.h" +#include "ntqregexp.h" +#include "ntqstrlist.h" +#include "ntqdatastream.h" +#include "ntqtl.h" /*! - \class TQStringList qstringlist.h + \class TQStringList ntqstringlist.h \reentrant \brief The TQStringList class provides a list of strings. @@ -61,7 +61,7 @@ objects. Unlike TQStrList, which stores pointers to characters, TQStringList holds real TQString objects. It is the class of choice whenever you work with Unicode strings. TQStringList is part of the - \link qtl.html TQt Template Library\endlink. + \link ntqtl.html TQt Template Library\endlink. Like TQString itself, TQStringList objects are implicitly shared, so passing them around as value-parameters is both fast and safe. @@ -171,7 +171,7 @@ /*! Sorts the list of strings in ascending case-sensitive order. - Sorting is very fast. It uses the \link qtl.html TQt Template + Sorting is very fast. It uses the \link ntqtl.html TQt Template Library's\endlink efficient HeapSort implementation that has a time complexity of O(n*log n). @@ -388,7 +388,7 @@ TQStringList& TQStringList::gres( const TQString &before, const TQString &after, // list == ["olpha", "beta", "gamma", "epsilon"] \endcode - For regexps containing \link qregexp.html#capturing-text + For regexps containing \link ntqregexp.html#capturing-text capturing parentheses \endlink, occurrences of \\1, \\2, ..., in \a after are replaced with \a{rx}.cap(1), cap(2), ... diff --git a/src/tools/qstringlist.h b/src/tools/qstringlist.h deleted file mode 100644 index a25c24a26..000000000 --- a/src/tools/qstringlist.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Definition of TQStringList class -** -** Created : 990406 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTRINGLIST_H -#define TQSTRINGLIST_H - -#ifndef QT_H -#include "qvaluelist.h" -#include "qstring.h" -#include "qstrlist.h" -#endif // QT_H - -#ifndef QT_NO_STRINGLIST - -class TQRegExp; -template class TQDeepCopy; - -#if defined(Q_TEMPLATEDLL) -// MOC_SKIP_BEGIN -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -// MOC_SKIP_END -#endif - -class Q_EXPORT TQStringList : public TQValueList -{ -public: - TQStringList() { } - TQStringList( const TQStringList& l ) : TQValueList(l) { } - TQStringList( const TQValueList& l ) : TQValueList(l) { } - TQStringList( const TQString& i ) { append(i); } -#ifndef QT_NO_CAST_ASCII - TQStringList( const char* i ) { append(i); } -#endif - - static TQStringList fromStrList(const TQStrList&); - - void sort(); - - static TQStringList split( const TQString &sep, const TQString &str, bool allowEmptyEntries = FALSE ); - static TQStringList split( const TQChar &sep, const TQString &str, bool allowEmptyEntries = FALSE ); -#ifndef QT_NO_REGEXP - static TQStringList split( const TQRegExp &sep, const TQString &str, bool allowEmptyEntries = FALSE ); -#endif - TQString join( const TQString &sep ) const; - - TQStringList grep( const TQString &str, bool cs = TRUE ) const; -#ifndef QT_NO_REGEXP - TQStringList grep( const TQRegExp &expr ) const; -#endif - - TQStringList& gres( const TQString &before, const TQString &after, - bool cs = TRUE ); -#ifndef QT_NO_REGEXP_CAPTURE - TQStringList& gres( const TQRegExp &expr, const TQString &after ); -#endif - -protected: - void detach() { TQValueList::detach(); } - friend class TQDeepCopy< TQStringList >; -}; - -#ifndef QT_NO_DATASTREAM -class TQDataStream; -extern Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQStringList& ); -extern Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQStringList& ); -#endif - -#endif // QT_NO_STRINGLIST -#endif // TQSTRINGLIST_H diff --git a/src/tools/qstrlist.h b/src/tools/qstrlist.h deleted file mode 100644 index dfbcb303d..000000000 --- a/src/tools/qstrlist.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Definition of TQStrList, TQStrIList and TQStrListIterator classes -** -** Created : 920730 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTRLIST_H -#define TQSTRLIST_H - -#ifndef QT_H -#include "qstring.h" -#include "qptrlist.h" -#include "qdatastream.h" -#endif // QT_H - -#if defined(Q_QDOC) -class TQStrListIterator : public TQPtrListIterator -{ -}; -#else -typedef TQPtrListIterator TQStrListIterator; -#endif - -class Q_EXPORT TQStrList : public TQPtrList -{ -public: - TQStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; } - TQStrList( const TQStrList & ); - ~TQStrList() { clear(); } - TQStrList& operator=( const TQStrList & ); - -private: - TQPtrCollection::Item newItem( TQPtrCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; } - void deleteItem( TQPtrCollection::Item d ) { if ( del_item ) delete[] (char*)d; } - int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) { return qstrcmp((const char*)s1, - (const char*)s2); } -#ifndef QT_NO_DATASTREAM - TQDataStream &read( TQDataStream &s, TQPtrCollection::Item &d ) - { s >> (char *&)d; return s; } - TQDataStream &write( TQDataStream &s, TQPtrCollection::Item d ) const - { return s << (const char *)d; } -#endif - bool dc; -}; - - -class Q_EXPORT TQStrIList : public TQStrList // case insensitive string list -{ -public: - TQStrIList( bool deepCopies=TRUE ) : TQStrList( deepCopies ) {} - ~TQStrIList() { clear(); } -private: - int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) - { return qstricmp((const char*)s1, - (const char*)s2); } -}; - - -inline TQStrList & TQStrList::operator=( const TQStrList &strList ) -{ - clear(); - dc = strList.dc; - del_item = dc; - TQPtrList::operator=( strList ); - return *this; -} - -inline TQStrList::TQStrList( const TQStrList &strList ) - : TQPtrList( strList ) -{ - dc = FALSE; - operator=( strList ); -} - -#endif // TQSTRLIST_H diff --git a/src/tools/qstrvec.h b/src/tools/qstrvec.h deleted file mode 100644 index 4b9ff24a0..000000000 --- a/src/tools/qstrvec.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Definition of TQStrVec and TQStrIVec classes -** -** Created : 931203 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTRVEC_H -#define TQSTRVEC_H - -#ifndef QT_H -#include "qstring.h" -#include "qptrvector.h" -#include "qdatastream.h" -#endif // QT_H - -class Q_EXPORT TQStrVec : public TQPtrVector -{ -public: - TQStrVec() { dc = TRUE; } - TQStrVec( uint size, bool deepc = TRUE ) : TQPtrVector(size) {dc=deepc;} - ~TQStrVec() { clear(); } -private: - Item newItem( Item d ) { return dc ? qstrdup( (const char*)d ) : d; } - void deleteItem( Item d ) { if ( dc ) delete[] (char*)d; } - int compareItems( Item s1, Item s2 ) - { return qstrcmp((const char*)s1, - (const char*)s2); } -#ifndef QT_NO_DATASTREAM - TQDataStream &read( TQDataStream &s, Item &d ) - { s >> (char *&)d; return s; } - TQDataStream &write( TQDataStream &s, Item d ) const - { return s << (const char*)d; } -#endif - bool dc; -}; - - -class Q_EXPORT TQStrIVec : public TQStrVec // case insensitive string vec -{ -public: - TQStrIVec() {} - TQStrIVec( uint size, bool dc = TRUE ) : TQStrVec( size, dc ) {} - ~TQStrIVec() { clear(); } -private: - int compareItems( Item s1, Item s2 ) - { return qstricmp((const char*)s1, - (const char*)s2); } -}; - - -#endif // TQSTRVEC_H diff --git a/src/tools/qt_tools.pri b/src/tools/qt_tools.pri index 9b37b3b5e..4f4ba4676 100644 --- a/src/tools/qt_tools.pri +++ b/src/tools/qt_tools.pri @@ -2,72 +2,72 @@ tools { TOOLS_P = tools - HEADERS += $$TOOLS_H/qmemarray.h \ - $$TOOLS_H/qasciicache.h \ - $$TOOLS_H/qasciidict.h \ - $$TOOLS_H/qbitarray.h \ - $$TOOLS_H/qbuffer.h \ - $$TOOLS_H/qcache.h \ - $$TOOLS_H/qcleanuphandler.h \ + HEADERS += $$TOOLS_H/ntqmemarray.h \ + $$TOOLS_H/ntqasciicache.h \ + $$TOOLS_H/ntqasciidict.h \ + $$TOOLS_H/ntqbitarray.h \ + $$TOOLS_H/ntqbuffer.h \ + $$TOOLS_H/ntqcache.h \ + $$TOOLS_H/ntqcleanuphandler.h \ $$TOOLS_P/qcomponentfactory_p.h \ $$TOOLS_P/qcomlibrary_p.h \ - $$TOOLS_H/qcstring.h \ - $$TOOLS_H/qdatastream.h \ - $$TOOLS_H/qdatetime.h \ - $$TOOLS_H/qdeepcopy.h \ - $$TOOLS_H/qdict.h \ - $$TOOLS_H/qdir.h \ + $$TOOLS_H/ntqcstring.h \ + $$TOOLS_H/ntqdatastream.h \ + $$TOOLS_H/ntqdatetime.h \ + $$TOOLS_H/ntqdeepcopy.h \ + $$TOOLS_H/ntqdict.h \ + $$TOOLS_H/ntqdir.h \ $$TOOLS_P/qdir_p.h \ - $$TOOLS_H/qfile.h \ + $$TOOLS_H/ntqfile.h \ $$TOOLS_P/qfiledefs_p.h \ - $$TOOLS_H/qfileinfo.h \ - $$TOOLS_H/qgarray.h \ - $$TOOLS_H/qgcache.h \ - $$TOOLS_H/qgdict.h \ - $$TOOLS_H/qgeneric.h \ - $$TOOLS_H/qglist.h \ - $$TOOLS_H/qglobal.h \ + $$TOOLS_H/ntqfileinfo.h \ + $$TOOLS_H/ntqgarray.h \ + $$TOOLS_H/ntqgcache.h \ + $$TOOLS_H/ntqgdict.h \ + $$TOOLS_H/ntqgeneric.h \ + $$TOOLS_H/ntqglist.h \ + $$TOOLS_H/ntqglobal.h \ $$TOOLS_P/qgpluginmanager_p.h \ - $$TOOLS_H/qgvector.h \ - $$TOOLS_H/qintcache.h \ - $$TOOLS_H/qintdict.h \ - $$TOOLS_H/qiodevice.h \ - $$TOOLS_H/qlibrary.h \ + $$TOOLS_H/ntqgvector.h \ + $$TOOLS_H/ntqintcache.h \ + $$TOOLS_H/ntqintdict.h \ + $$TOOLS_H/ntqiodevice.h \ + $$TOOLS_H/ntqlibrary.h \ $$TOOLS_P/qlibrary_p.h \ - $$TOOLS_H/qlocale.h \ + $$TOOLS_H/ntqlocale.h \ $$TOOLS_P/qlocale_p.h \ - $$TOOLS_H/qptrlist.h \ - $$TOOLS_H/qmap.h \ - $$TOOLS_H/qmutex.h \ + $$TOOLS_H/ntqptrlist.h \ + $$TOOLS_H/ntqmap.h \ + $$TOOLS_H/ntqmutex.h \ $$TOOLS_P/qmutex_p.h \ $$TOOLS_P/qmutexpool_p.h \ $$TOOLS_P/qpluginmanager_p.h \ - $$TOOLS_H/qptrcollection.h \ - $$TOOLS_H/qptrdict.h \ - $$TOOLS_H/qptrqueue.h \ - $$TOOLS_H/qregexp.h \ - $$TOOLS_H/qsemaphore.h \ - $$TOOLS_H/qsettings.h \ + $$TOOLS_H/ntqptrcollection.h \ + $$TOOLS_H/ntqptrdict.h \ + $$TOOLS_H/ntqptrqueue.h \ + $$TOOLS_H/ntqregexp.h \ + $$TOOLS_H/ntqsemaphore.h \ + $$TOOLS_H/ntqsettings.h \ $$TOOLS_P/qsettings_p.h \ - $$TOOLS_H/qshared.h \ - $$TOOLS_H/qsortedlist.h \ - $$TOOLS_H/qptrstack.h \ - $$TOOLS_H/qstring.h \ - $$TOOLS_H/qstringlist.h \ - $$TOOLS_H/qstrlist.h \ - $$TOOLS_H/qstrvec.h \ - $$TOOLS_H/qtextstream.h \ + $$TOOLS_H/ntqshared.h \ + $$TOOLS_H/ntqsortedlist.h \ + $$TOOLS_H/ntqptrstack.h \ + $$TOOLS_H/ntqstring.h \ + $$TOOLS_H/ntqstringlist.h \ + $$TOOLS_H/ntqstrlist.h \ + $$TOOLS_H/ntqstrvec.h \ + $$TOOLS_H/ntqtextstream.h \ $$TOOLS_P/qthreadinstance_p.h \ - $$TOOLS_H/qthreadstorage.h\ + $$TOOLS_H/ntqthreadstorage.h\ $$TOOLS_P/qunicodetables_p.h \ - $$TOOLS_H/qptrvector.h \ - $$TOOLS_H/qvaluelist.h \ - $$TOOLS_H/qvaluestack.h \ - $$TOOLS_H/qvaluevector.h \ - $$TOOLS_H/qwaitcondition.h \ + $$TOOLS_H/ntqptrvector.h \ + $$TOOLS_H/ntqvaluelist.h \ + $$TOOLS_H/ntqvaluestack.h \ + $$TOOLS_H/ntqvaluevector.h \ + $$TOOLS_H/ntqwaitcondition.h \ $$TOOLS_P/qcom_p.h \ $$TOOLS_P/qucom_p.h \ - $$TOOLS_H/quuid.h + $$TOOLS_H/ntquuid.h win32:SOURCES += $$TOOLS_CPP/qdir_win.cpp \ $$TOOLS_CPP/qfile_win.cpp \ diff --git a/src/tools/qtextstream.cpp b/src/tools/qtextstream.cpp index 55c9005cb..9c2d0dfb8 100644 --- a/src/tools/qtextstream.cpp +++ b/src/tools/qtextstream.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qtextstream.h" +#include "ntqtextstream.h" #ifndef QT_NO_TEXTSTREAM -#include "qtextcodec.h" -#include "qregexp.h" -#include "qbuffer.h" -#include "qfile.h" +#include "ntqtextcodec.h" +#include "ntqregexp.h" +#include "ntqbuffer.h" +#include "ntqfile.h" #include #include #include @@ -57,7 +57,7 @@ #endif /*! - \class TQTextStream qtextstream.h + \class TQTextStream ntqtextstream.h \reentrant \brief The TQTextStream class provides basic functions for reading and writing text using a TQIODevice. @@ -2374,7 +2374,7 @@ TQTextStream &reset( TQTextStream &s ) /*! - \class TQTextIStream qtextstream.h + \class TQTextIStream ntqtextstream.h \reentrant \brief The TQTextIStream class is a convenience class for input streams. diff --git a/src/tools/qtextstream.h b/src/tools/qtextstream.h deleted file mode 100644 index fcc8baad8..000000000 --- a/src/tools/qtextstream.h +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTextStream class -** -** Created : 940922 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTSTREAM_H -#define TQTEXTSTREAM_H - -#ifndef QT_H -#include "qiodevice.h" -#include "qstring.h" -#include -#endif // QT_H - -#ifndef QT_NO_TEXTSTREAM -class TQTextCodec; -class TQTextDecoder; - -class TQTextStreamPrivate; - -class Q_EXPORT TQTextStream // text stream class -{ -public: - enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder, - UnicodeReverse, RawUnicode, UnicodeUTF8 }; - - void setEncoding( Encoding ); -#ifndef QT_NO_TEXTCODEC - void setCodec( TQTextCodec* ); - TQTextCodec *codec(); -#endif - - TQTextStream(); - TQTextStream( TQIODevice * ); - TQTextStream( TQString*, int mode ); - TQTextStream( TQString&, int mode ); // obsolete - TQTextStream( TQByteArray, int mode ); - TQTextStream( FILE *, int mode ); - virtual ~TQTextStream(); - - TQIODevice *device() const; - void setDevice( TQIODevice * ); - void unsetDevice(); - - bool atEnd() const; - bool eof() const; - - TQTextStream &operator>>( TQChar & ); - TQTextStream &operator>>( char & ); - TQTextStream &operator>>( signed short & ); - TQTextStream &operator>>( unsigned short & ); - TQTextStream &operator>>( signed int & ); - TQTextStream &operator>>( unsigned int & ); - TQTextStream &operator>>( signed long & ); - TQTextStream &operator>>( unsigned long & ); - TQTextStream &operator>>( float & ); - TQTextStream &operator>>( double & ); - TQTextStream &operator>>( char * ); - TQTextStream &operator>>( TQString & ); - TQTextStream &operator>>( TQCString & ); - - TQTextStream &operator<<( TQChar ); - TQTextStream &operator<<( char ); - TQTextStream &operator<<( signed short ); - TQTextStream &operator<<( unsigned short ); - TQTextStream &operator<<( signed int ); - TQTextStream &operator<<( unsigned int ); - TQTextStream &operator<<( signed long ); - TQTextStream &operator<<( unsigned long ); - TQTextStream &operator<<( float ); - TQTextStream &operator<<( double ); - TQTextStream &operator<<( const char* ); - TQTextStream &operator<<( const TQString & ); - TQTextStream &operator<<( const TQCString & ); - TQTextStream &operator<<( void * ); // any pointer - - TQTextStream &readRawBytes( char *, uint len ); - TQTextStream &writeRawBytes( const char* , uint len ); - - TQString readLine(); - TQString read(); - void skipWhiteSpace(); - - enum { - skipws = 0x0001, // skip whitespace on input - left = 0x0002, // left-adjust output - right = 0x0004, // right-adjust output - internal = 0x0008, // pad after sign - bin = 0x0010, // binary format integer - oct = 0x0020, // octal format integer - dec = 0x0040, // decimal format integer - hex = 0x0080, // hex format integer - showbase = 0x0100, // show base indicator - showpoint = 0x0200, // force decimal point (float) - uppercase = 0x0400, // upper-case hex output - showpos = 0x0800, // add '+' to positive integers - scientific= 0x1000, // scientific float output - fixed = 0x2000 // fixed float output - }; - - static const int basefield; // bin | oct | dec | hex - static const int adjustfield; // left | right | internal - static const int floatfield; // scientific | fixed - - int flags() const; - int flags( int f ); - int setf( int bits ); - int setf( int bits, int mask ); - int unsetf( int bits ); - - void reset(); - - int width() const; - int width( int ); - int fill() const; - int fill( int ); - int precision() const; - int precision( int ); - -private: - long input_int(); - void init(); - TQTextStream &output_int( int, ulong, bool ); - TQIODevice *dev; - - int fflags; - int fwidth; - int fillchar; - int fprec; - bool doUnicodeHeader; - bool owndev; - TQTextCodec *mapper; - TQTextStreamPrivate * d; - TQChar unused1; // ### remove in TQt 4.0 - bool latin1; - bool internalOrder; - bool networkOrder; - void *unused2; // ### remove in TQt 4.0 - - TQChar eat_ws(); - uint ts_getline( TQChar* ); - void ts_ungetc( TQChar ); - TQChar ts_getc(); - uint ts_getbuf( TQChar*, uint ); - void ts_putc(int); - void ts_putc(TQChar); - bool ts_isspace(TQChar); - bool ts_isdigit(TQChar); - ulong input_bin(); - ulong input_oct(); - ulong input_dec(); - ulong input_hex(); - double input_double(); - TQTextStream &writeBlock( const char* p, uint len ); - TQTextStream &writeBlock( const TQChar* p, uint len ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTextStream( const TQTextStream & ); - TQTextStream &operator=( const TQTextStream & ); -#endif -}; - -typedef TQTextStream TQTS; - -class Q_EXPORT TQTextIStream : public TQTextStream { -public: - TQTextIStream( const TQString* s ) : - TQTextStream((TQString*)s,IO_ReadOnly) { } - TQTextIStream( TQByteArray ba ) : - TQTextStream(ba,IO_ReadOnly) { } - TQTextIStream( FILE *f ) : - TQTextStream(f,IO_ReadOnly) { } - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTextIStream( const TQTextIStream & ); - TQTextIStream &operator=( const TQTextIStream & ); -#endif -}; - -class Q_EXPORT TQTextOStream : public TQTextStream { -public: - TQTextOStream( TQString* s ) : - TQTextStream(s,IO_WriteOnly) { } - TQTextOStream( TQByteArray ba ) : - TQTextStream(ba,IO_WriteOnly) { } - TQTextOStream( FILE *f ) : - TQTextStream(f,IO_WriteOnly) { } - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTextOStream( const TQTextOStream & ); - TQTextOStream &operator=( const TQTextOStream & ); -#endif -}; - -/***************************************************************************** - TQTextStream inline functions - *****************************************************************************/ - -inline TQIODevice *TQTextStream::device() const -{ return dev; } - -inline bool TQTextStream::atEnd() const -{ return dev ? dev->atEnd() : FALSE; } - -inline bool TQTextStream::eof() const -{ return atEnd(); } - -inline int TQTextStream::flags() const -{ return fflags; } - -inline int TQTextStream::flags( int f ) -{ int oldf = fflags; fflags = f; return oldf; } - -inline int TQTextStream::setf( int bits ) -{ int oldf = fflags; fflags |= bits; return oldf; } - -inline int TQTextStream::setf( int bits, int mask ) -{ int oldf = fflags; fflags = (fflags & ~mask) | (bits & mask); return oldf; } - -inline int TQTextStream::unsetf( int bits ) -{ int oldf = fflags; fflags &= ~bits; return oldf; } - -inline int TQTextStream::width() const -{ return fwidth; } - -inline int TQTextStream::width( int w ) -{ int oldw = fwidth; fwidth = w; return oldw; } - -inline int TQTextStream::fill() const -{ return fillchar; } - -inline int TQTextStream::fill( int f ) -{ int oldc = fillchar; fillchar = f; return oldc; } - -inline int TQTextStream::precision() const -{ return fprec; } - -inline int TQTextStream::precision( int p ) -{ int oldp = fprec; fprec = p; return oldp; } - -/*! - Returns one character from the stream, or EOF. -*/ -inline TQChar TQTextStream::ts_getc() -{ TQChar r; return ( ts_getbuf( &r,1 ) == 1 ? r : TQChar((ushort)0xffff) ); } - -/***************************************************************************** - TQTextStream manipulators - *****************************************************************************/ - -typedef TQTextStream & (*TQTSFUNC)(TQTextStream &);// manipulator function -typedef int (TQTextStream::*TQTSMFI)(int); // manipulator w/int argument - -class Q_EXPORT TQTSManip { // text stream manipulator -public: - TQTSManip( TQTSMFI m, int a ) { mf=m; arg=a; } - void exec( TQTextStream &s ) { (s.*mf)(arg); } -private: - TQTSMFI mf; // TQTextStream member function - int arg; // member function argument -}; - -Q_EXPORT inline TQTextStream &operator>>( TQTextStream &s, TQTSFUNC f ) -{ return (*f)( s ); } - -Q_EXPORT inline TQTextStream &operator<<( TQTextStream &s, TQTSFUNC f ) -{ return (*f)( s ); } - -Q_EXPORT inline TQTextStream &operator<<( TQTextStream &s, TQTSManip m ) -{ m.exec(s); return s; } - -Q_EXPORT TQTextStream &bin( TQTextStream &s ); // set bin notation -Q_EXPORT TQTextStream &oct( TQTextStream &s ); // set oct notation -Q_EXPORT TQTextStream &dec( TQTextStream &s ); // set dec notation -Q_EXPORT TQTextStream &hex( TQTextStream &s ); // set hex notation -Q_EXPORT TQTextStream &endl( TQTextStream &s ); // insert EOL ('\n') -Q_EXPORT TQTextStream &flush( TQTextStream &s ); // flush output -Q_EXPORT TQTextStream &ws( TQTextStream &s ); // eat whitespace on input -Q_EXPORT TQTextStream &reset( TQTextStream &s ); // set default flags - -Q_EXPORT inline TQTSManip qSetW( int w ) -{ - TQTSMFI func = &TQTextStream::width; - return TQTSManip(func,w); -} - -Q_EXPORT inline TQTSManip qSetFill( int f ) -{ - TQTSMFI func = &TQTextStream::fill; - return TQTSManip(func,f); -} - -Q_EXPORT inline TQTSManip qSetPrecision( int p ) -{ - TQTSMFI func = &TQTextStream::precision; - return TQTSManip(func,p); -} - -#endif // QT_NO_TEXTSTREAM -#endif // TQTEXTSTREAM_H diff --git a/src/tools/qthreadinstance_p.h b/src/tools/qthreadinstance_p.h index 59ce53fd2..62c569c42 100644 --- a/src/tools/qthreadinstance_p.h +++ b/src/tools/qthreadinstance_p.h @@ -54,8 +54,8 @@ #ifdef QT_THREAD_SUPPORT #ifndef QT_H -#include "qmutex.h" -#include "qwindowdefs.h" +#include "ntqmutex.h" +#include "ntqwindowdefs.h" #endif // QT_H #ifdef Q_OS_UNIX diff --git a/src/tools/qthreadstorage.h b/src/tools/qthreadstorage.h deleted file mode 100644 index 3fdcaa9e8..000000000 --- a/src/tools/qthreadstorage.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** ... -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTHREADSTORAGE_H -#define TQTHREADSTORAGE_H - -#ifdef QT_THREAD_SUPPORT - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -class Q_EXPORT TQThreadStorageData -{ -public: - TQThreadStorageData( void (*func)(void *) ); - ~TQThreadStorageData(); - - void** get() const; - void** set( void* p ); - - static void finish( void** ); - int id; -}; - - -template -class TQThreadStorage -{ -private: - TQThreadStorageData d; - -#if defined(Q_DISABLE_COPY) - // disable copy constructor and operator= - TQThreadStorage( const TQThreadStorage & ); - TQThreadStorage &operator=( const TQThreadStorage & ); -#endif // Q_DISABLE_COPY - - static void deleteData( void *x ) { delete (T)x; } - -public: - inline TQThreadStorage() : d( deleteData ) { } - inline ~TQThreadStorage() { } - - inline bool hasLocalData() const - { return d.get() != 0; } - - inline T& localData() - { void **v = d.get(); if ( !v ) v = d.set( 0 ); return *(T*)v; } - - inline T localData() const - { void **v = d.get(); return ( v ? *(T*)v : 0 ); } - - inline void setLocalData( T t ) - { (void) d.set( t ); } -}; - -#endif // QT_THREAD_SUPPORT - -#endif // TQTHREADSTORAGE_H diff --git a/src/tools/qthreadstorage_unix.cpp b/src/tools/qthreadstorage_unix.cpp index d2c488a2b..05b86b954 100644 --- a/src/tools/qthreadstorage_unix.cpp +++ b/src/tools/qthreadstorage_unix.cpp @@ -40,7 +40,7 @@ #include "qplatformdefs.h" -#include "qthreadstorage.h" +#include "ntqthreadstorage.h" #include #include diff --git a/src/tools/qtl.h b/src/tools/qtl.h deleted file mode 100644 index 2cdf10e96..000000000 --- a/src/tools/qtl.h +++ /dev/null @@ -1,325 +0,0 @@ -/**************************************************************************** -** -** Definition of TQt template library classes -** -** Created : 990128 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTL_H -#define TQTL_H - -#ifndef QT_H -#include "qglobal.h" -#include "qtextstream.h" -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_TEXTSTREAM -template -class TQTextOStreamIterator -{ -protected: - TQTextOStream& stream; - TQString separator; - -public: - TQTextOStreamIterator( TQTextOStream& s) : stream( s ) {} - TQTextOStreamIterator( TQTextOStream& s, const TQString& sep ) - : stream( s ), separator( sep ) {} - TQTextOStreamIterator& operator= ( const T& x ) { - stream << x; - if ( !separator.isEmpty() ) - stream << separator; - return *this; - } - TQTextOStreamIterator& operator*() { return *this; } - TQTextOStreamIterator& operator++() { return *this; } - TQTextOStreamIterator& operator++(int) { return *this; } -}; -#endif //QT_NO_TEXTSTREAM - -template -inline OutputIterator qCopy( InputIterator _begin, InputIterator _end, - OutputIterator _dest ) -{ - while( _begin != _end ) - *_dest++ = *_begin++; - return _dest; -} - -template -inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end, - BiOutputIterator _dest ) -{ - while ( _begin != _end ) - *--_dest = *--_end; - return _dest; -} - -template -inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 ) -{ - // ### compare using !(*first1 == *first2) in TQt 4.0 - for ( ; first1 != last1; ++first1, ++first2 ) - if ( *first1 != *first2 ) - return FALSE; - return TRUE; -} - -template -inline void qFill( ForwardIterator first, ForwardIterator last, const T& val ) -{ - for ( ; first != last; ++first ) - *first = val; -} - -#if 0 -template -inline OutputIterator qReverseCopy( BiIterator _begin, BiIterator _end, - OutputIterator _dest ) -{ - while ( _begin != _end ) { - --_end; - *_dest = *_end; - ++_dest; - } - return _dest; -} -#endif - - -template -inline InputIterator qFind( InputIterator first, InputIterator last, - const T& val ) -{ - while ( first != last && *first != val ) - ++first; - return first; -} - -template -inline void qCount( InputIterator first, InputIterator last, const T& value, - Size& n ) -{ - for ( ; first != last; ++first ) - if ( *first == value ) - ++n; -} - -template -inline void qSwap( T& _value1, T& _value2 ) -{ - T tmp = _value1; - _value1 = _value2; - _value2 = tmp; -} - - -template -Q_INLINE_TEMPLATES void qBubbleSort( InputIterator b, InputIterator e ) -{ - // Goto last element; - InputIterator last = e; - --last; - // only one element or no elements ? - if ( last == b ) - return; - - // So we have at least two elements in here - while( b != last ) { - bool swapped = FALSE; - InputIterator swap_pos = b; - InputIterator x = e; - InputIterator y = x; - y--; - do { - --x; - --y; - if ( *x < *y ) { - swapped = TRUE; - qSwap( *x, *y ); - swap_pos = y; - } - } while( y != b ); - if ( !swapped ) - return; - b = swap_pos; - b++; - } -} - - -template -inline void qBubbleSort( Container &c ) -{ - qBubbleSort( c.begin(), c.end() ); -} - - -template -Q_INLINE_TEMPLATES void qHeapSortPushDown( Value* heap, int first, int last ) -{ - int r = first; - while ( r <= last / 2 ) { - if ( last == 2 * r ) { - // node r has only one child - if ( heap[2 * r] < heap[r] ) - qSwap( heap[r], heap[2 * r] ); - r = last; - } else { - // node r has two children - if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) { - // swap with left child - qSwap( heap[r], heap[2 * r] ); - r *= 2; - } else if ( heap[2 * r + 1] < heap[r] - && heap[2 * r + 1] < heap[2 * r] ) { - // swap with right child - qSwap( heap[r], heap[2 * r + 1] ); - r = 2 * r + 1; - } else { - r = last; - } - } - } -} - - -template -Q_INLINE_TEMPLATES void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n ) -{ - // Create the heap - InputIterator insert = b; - Value* realheap = new Value[n]; - // Wow, what a fake. But I want the heap to be indexed as 1...n - Value* heap = realheap - 1; - int size = 0; - for( ; insert != e; ++insert ) { - heap[++size] = *insert; - int i = size; - while( i > 1 && heap[i] < heap[i / 2] ) { - qSwap( heap[i], heap[i / 2] ); - i /= 2; - } - } - - // Now do the sorting - for( uint i = n; i > 0; i-- ) { - *b++ = heap[1]; - if ( i > 1 ) { - heap[1] = heap[i]; - qHeapSortPushDown( heap, 1, (int)i - 1 ); - } - } - - delete[] realheap; -} - - -template -Q_INLINE_TEMPLATES void qHeapSort( InputIterator b, InputIterator e ) -{ - // Empty ? - if ( b == e ) - return; - - // How many entries have to be sorted ? - InputIterator it = b; - uint n = 0; - while ( it != e ) { - ++n; - ++it; - } - - // The second last parameter is a hack to retrieve the value type - // Do the real sorting here - qHeapSortHelper( b, e, *b, n ); -} - - -template -Q_INLINE_TEMPLATES void qHeapSort( Container &c ) -{ - if ( c.begin() == c.end() ) - return; - - // The second last parameter is a hack to retrieve the value type - // Do the real sorting here - qHeapSortHelper( c.begin(), c.end(), *(c.begin()), (uint)c.count() ); -} - -template -class TQBackInsertIterator -{ -public: - Q_EXPLICIT TQBackInsertIterator( Container &c ) - : container( &c ) - { - } - - TQBackInsertIterator& - operator=( const Q_TYPENAME Container::value_type &value ) - { - container->push_back( value ); - return *this; - } - - TQBackInsertIterator& operator*() - { - return *this; - } - - TQBackInsertIterator& operator++() - { - return *this; - } - - TQBackInsertIterator& operator++(int) - { - return *this; - } - -protected: - Container *container; -}; - -template -inline TQBackInsertIterator qBackInserter( Container &c ) -{ - return TQBackInsertIterator( c ); -} - -#endif diff --git a/src/tools/qucom_p.h b/src/tools/qucom_p.h index 678d3d5f3..0814e18d7 100644 --- a/src/tools/qucom_p.h +++ b/src/tools/qucom_p.h @@ -54,8 +54,8 @@ // #ifndef QT_H -#include "qstring.h" -#include "quuid.h" +#include "ntqstring.h" +#include "ntquuid.h" #endif // QT_H #ifdef check diff --git a/src/tools/qunicodetables.cpp b/src/tools/qunicodetables.cpp index 5c64d2317..abcfadf7a 100644 --- a/src/tools/qunicodetables.cpp +++ b/src/tools/qunicodetables.cpp @@ -13112,8 +13112,8 @@ enum Script { UnknownScript = NScripts }; -// copied form qfont.h, as we can't include it in tools. Do not modify without -// changing the script enum in qfont.h aswell. +// copied form ntqfont.h, as we can't include it in tools. Do not modify without +// changing the script enum in ntqfont.h aswell. const unsigned char TQUnicodeTables::otherScripts [128] = { #define SCRIPTS_02 0 0xaf, Latin, 0xff, SpacingModifiers, // row 0x02, index 0 diff --git a/src/tools/qunicodetables_p.h b/src/tools/qunicodetables_p.h index 4e079dc56..07d4a599e 100644 --- a/src/tools/qunicodetables_p.h +++ b/src/tools/qunicodetables_p.h @@ -52,7 +52,7 @@ // #ifndef QT_H -#include "qstring.h" +#include "ntqstring.h" #endif // QT_H #ifdef QT_NO_UNICODETABLES diff --git a/src/tools/quuid.cpp b/src/tools/quuid.cpp index 220ff4962..64ec7a3bd 100644 --- a/src/tools/quuid.cpp +++ b/src/tools/quuid.cpp @@ -36,12 +36,12 @@ ** **********************************************************************/ -#include "quuid.h" +#include "ntquuid.h" -#include "qdatastream.h" +#include "ntqdatastream.h" /*! - \class TQUuid quuid.h + \class TQUuid ntquuid.h \brief The TQUuid class defines a Universally Unique Identifier (UUID). \reentrant @@ -389,7 +389,7 @@ TQUuid TQUuid::createUuid() return result; } #else // !Q_OS_WIN32 -#include "qdatetime.h" +#include "ntqdatetime.h" #include "stdlib.h" // For srand/rand TQUuid TQUuid::createUuid() { diff --git a/src/tools/quuid.h b/src/tools/quuid.h deleted file mode 100644 index 0ea4ccf62..000000000 --- a/src/tools/quuid.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -** -** Definition of TQUuid class -** -** Created : 010523 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQUUID_H -#define TQUUID_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#include - -#if defined(Q_OS_WIN32) -#ifndef GUID_DEFINED -#define GUID_DEFINED -typedef struct _GUID -{ - ulong Data1; - ushort Data2; - ushort Data3; - uchar Data4[ 8 ]; -} GUID, *REFGUID, *LPGUID; -#endif -#endif - - -struct Q_EXPORT TQUuid -{ - enum Variant { - VarUnknown =-1, - NCS = 0, // 0 - - - DCE = 2, // 1 0 - - Microsoft = 6, // 1 1 0 - Reserved = 7 // 1 1 1 - }; - - enum Version { - VerUnknown =-1, - Time = 1, // 0 0 0 1 - EmbeddedPOSIX = 2, // 0 0 1 0 - Name = 3, // 0 0 1 1 - Random = 4 // 0 1 0 0 - }; - - TQUuid() - { - memset( this, 0, sizeof(TQUuid) ); - } - TQUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) - { - data1 = l; - data2 = w1; - data3 = w2; - data4[0] = b1; - data4[1] = b2; - data4[2] = b3; - data4[3] = b4; - data4[4] = b5; - data4[5] = b6; - data4[6] = b7; - data4[7] = b8; - } - TQUuid( const TQUuid &uuid ) - { - memcpy( this, &uuid, sizeof(TQUuid) ); - } -#ifndef QT_NO_QUUID_STRING - TQUuid( const TQString & ); - TQUuid( const char * ); - TQString toString() const; - operator TQString() const { return toString(); } -#endif - bool isNull() const; - - TQUuid &operator=(const TQUuid &orig ) - { - memcpy( this, &orig, sizeof(TQUuid) ); - return *this; - } - - bool operator==(const TQUuid &orig ) const - { - uint i; - if ( data1 != orig.data1 || data2 != orig.data2 || - data3 != orig.data3 ) - return FALSE; - - for( i = 0; i < 8; i++ ) - if ( data4[i] != orig.data4[i] ) - return FALSE; - - return TRUE; - } - - bool operator!=(const TQUuid &orig ) const - { - return !( *this == orig ); - } - - bool operator<(const TQUuid &other ) const; - bool operator>(const TQUuid &other ) const; - -#if defined(Q_OS_WIN32) - // On Windows we have a type GUID that is used by the platform API, so we - // provide convenience operators to cast from and to this type. - TQUuid( const GUID &guid ) - { - memcpy( this, &guid, sizeof(GUID) ); - } - - TQUuid &operator=(const GUID &orig ) - { - memcpy( this, &orig, sizeof(TQUuid) ); - return *this; - } - - operator GUID() const - { - GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } }; - return guid; - } - - bool operator==( const GUID &guid ) const - { - uint i; - if ( data1 != guid.Data1 || data2 != guid.Data2 || - data3 != guid.Data3 ) - return FALSE; - - for( i = 0; i < 8; i++ ) - if ( data4[i] != guid.Data4[i] ) - return FALSE; - - return TRUE; - } - - bool operator!=( const GUID &guid ) const - { - return !( *this == guid ); - } -#endif - static TQUuid createUuid(); - TQUuid::Variant variant() const; - TQUuid::Version version() const; - - uint data1; - ushort data2; - ushort data3; - uchar data4[ 8 ]; -}; - -#ifndef QT_NO_DATASTREAM -Q_EXPORT TQDataStream &operator<<( TQDataStream &, const TQUuid & ); -Q_EXPORT TQDataStream &operator>>( TQDataStream &, TQUuid & ); -#endif - -#endif //TQUUID_H diff --git a/src/tools/qvaluelist.h b/src/tools/qvaluelist.h deleted file mode 100644 index f47bc8743..000000000 --- a/src/tools/qvaluelist.h +++ /dev/null @@ -1,670 +0,0 @@ -/**************************************************************************** -** -** Definition of TQValueList class -** -** Created : 990406 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVALUELIST_H -#define TQVALUELIST_H - -#ifndef QT_H -#include "qtl.h" -#include "qshared.h" -#include "qdatastream.h" -#endif // QT_H - -#ifndef QT_NO_STL -#include -#include -#include -#endif - -//#define QT_CHECK_VALUELIST_RANGE - -#if defined(Q_CC_MSVC) -#pragma warning(disable:4284) // "return type for operator -> is not a UDT" -#endif - -template -class TQValueListNode -{ -public: - TQValueListNode( const T& t ) : data( t ) { } - TQValueListNode() { } -#if defined(Q_TEMPLATEDLL) - // Workaround MS bug in memory de/allocation in DLL vs. EXE - virtual ~TQValueListNode() { } -#endif - - TQValueListNode* next; - TQValueListNode* prev; - T data; -}; - -template -class TQValueListIterator -{ - public: - /** - * Typedefs - */ - typedef TQValueListNode* NodePtr; -#ifndef QT_NO_STL - typedef std::bidirectional_iterator_tag iterator_category; -#endif - typedef T value_type; - typedef size_t size_type; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - typedef T* pointer; - typedef T& reference; - - /** - * Variables - */ - NodePtr node; - - /** - * Functions - */ - TQValueListIterator() : node( 0 ) {} - TQValueListIterator( NodePtr p ) : node( p ) {} - TQValueListIterator( const TQValueListIterator& it ) : node( it.node ) {} - - bool operator==( const TQValueListIterator& it ) const { return node == it.node; } - bool operator!=( const TQValueListIterator& it ) const { return node != it.node; } - const T& operator*() const { return node->data; } - T& operator*() { return node->data; } - // UDT for T = x* - // T* operator->() const { return &node->data; } - - TQValueListIterator& operator++() { - node = node->next; - return *this; - } - - TQValueListIterator operator++(int) { - TQValueListIterator tmp = *this; - node = node->next; - return tmp; - } - - TQValueListIterator& operator--() { - node = node->prev; - return *this; - } - - TQValueListIterator operator--(int) { - TQValueListIterator tmp = *this; - node = node->prev; - return tmp; - } - - TQValueListIterator& operator+=( int j ) { - while ( j-- ) - node = node->next; - return *this; - } - - TQValueListIterator& operator-=( int j ) { - while ( j-- ) - node = node->prev; - return *this; - } - -}; - -template -class TQValueListConstIterator -{ - public: - /** - * Typedefs - */ - typedef TQValueListNode* NodePtr; -#ifndef QT_NO_STL - typedef std::bidirectional_iterator_tag iterator_category; -#endif - typedef T value_type; - typedef size_t size_type; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - typedef const T* pointer; - typedef const T& reference; - - /** - * Variables - */ - NodePtr node; - - /** - * Functions - */ - TQValueListConstIterator() : node( 0 ) {} - TQValueListConstIterator( NodePtr p ) : node( p ) {} - TQValueListConstIterator( const TQValueListConstIterator& it ) : node( it.node ) {} - TQValueListConstIterator( const TQValueListIterator& it ) : node( it.node ) {} - - bool operator==( const TQValueListConstIterator& it ) const { return node == it.node; } - bool operator!=( const TQValueListConstIterator& it ) const { return node != it.node; } - const T& operator*() const { return node->data; } - // UDT for T = x* - // const T* operator->() const { return &node->data; } - - TQValueListConstIterator& operator++() { - node = node->next; - return *this; - } - - TQValueListConstIterator operator++(int) { - TQValueListConstIterator tmp = *this; - node = node->next; - return tmp; - } - - TQValueListConstIterator& operator--() { - node = node->prev; - return *this; - } - - TQValueListConstIterator operator--(int) { - TQValueListConstIterator tmp = *this; - node = node->prev; - return tmp; - } -}; - -template -class TQValueListPrivate : public TQShared -{ -public: - /** - * Typedefs - */ - typedef TQValueListIterator Iterator; - typedef TQValueListConstIterator ConstIterator; - typedef TQValueListNode Node; - typedef TQValueListNode* NodePtr; - typedef size_t size_type; - - /** - * Functions - */ - TQValueListPrivate(); - TQValueListPrivate( const TQValueListPrivate& _p ); - - void derefAndDelete() // ### hack to get around hp-cc brain damage - { - if ( deref() ) - delete this; - } - -#if defined(Q_TEMPLATEDLL) - // Workaround MS bug in memory de/allocation in DLL vs. EXE - virtual -#endif - ~TQValueListPrivate(); - - Iterator insert( Iterator it, const T& x ); - Iterator remove( Iterator it ); - NodePtr find( NodePtr start, const T& x ) const; - int findIndex( NodePtr start, const T& x ) const; - uint contains( const T& x ) const; - uint remove( const T& x ); - NodePtr at( size_type i ) const; - void clear(); - - NodePtr node; - size_type nodes; -}; - -template -Q_INLINE_TEMPLATES TQValueListPrivate::TQValueListPrivate() -{ - node = new Node; node->next = node->prev = node; nodes = 0; -} - -template -Q_INLINE_TEMPLATES TQValueListPrivate::TQValueListPrivate( const TQValueListPrivate& _p ) - : TQShared() -{ - node = new Node; node->next = node->prev = node; nodes = 0; - Iterator b( _p.node->next ); - Iterator e( _p.node ); - Iterator i( node ); - while( b != e ) - insert( i, *b++ ); -} - -template -Q_INLINE_TEMPLATES TQValueListPrivate::~TQValueListPrivate() { - NodePtr p = node->next; - while( p != node ) { - NodePtr x = p->next; - delete p; - p = x; - } - delete node; -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::Iterator TQValueListPrivate::insert( Q_TYPENAME TQValueListPrivate::Iterator it, const T& x ) -{ - NodePtr p = new Node( x ); - p->next = it.node; - p->prev = it.node->prev; - it.node->prev->next = p; - it.node->prev = p; - nodes++; - return p; -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::Iterator TQValueListPrivate::remove( Q_TYPENAME TQValueListPrivate::Iterator it ) -{ - Q_ASSERT ( it.node != node ); - NodePtr next = it.node->next; - NodePtr prev = it.node->prev; - prev->next = next; - next->prev = prev; - delete it.node; - nodes--; - return Iterator( next ); -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::NodePtr TQValueListPrivate::find( Q_TYPENAME TQValueListPrivate::NodePtr start, const T& x ) const -{ - ConstIterator first( start ); - ConstIterator last( node ); - while( first != last) { - if ( *first == x ) - return first.node; - ++first; - } - return last.node; -} - -template -Q_INLINE_TEMPLATES int TQValueListPrivate::findIndex( Q_TYPENAME TQValueListPrivate::NodePtr start, const T& x ) const -{ - ConstIterator first( start ); - ConstIterator last( node ); - int pos = 0; - while( first != last) { - if ( *first == x ) - return pos; - ++first; - ++pos; - } - return -1; -} - -template -Q_INLINE_TEMPLATES uint TQValueListPrivate::contains( const T& x ) const -{ - uint result = 0; - Iterator first = Iterator( node->next ); - Iterator last = Iterator( node ); - while( first != last) { - if ( *first == x ) - ++result; - ++first; - } - return result; -} - -template -Q_INLINE_TEMPLATES uint TQValueListPrivate::remove( const T& _x ) -{ - const T x = _x; - uint result = 0; - Iterator first = Iterator( node->next ); - Iterator last = Iterator( node ); - while( first != last) { - if ( *first == x ) { - first = remove( first ); - ++result; - } else - ++first; - } - return result; -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueListPrivate::NodePtr TQValueListPrivate::at( size_type i ) const -{ - Q_ASSERT( i <= nodes ); - NodePtr p = node->next; - for( size_type x = 0; x < i; ++x ) - p = p->next; - return p; -} - -template -Q_INLINE_TEMPLATES void TQValueListPrivate::clear() -{ - nodes = 0; - NodePtr p = node->next; - while( p != node ) { - NodePtr next = p->next; - delete p; - p = next; - } - node->next = node->prev = node; -} - -#ifdef QT_CHECK_RANGE -# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_VALUELIST_RANGE ) -# define QT_CHECK_INVALID_LIST_ELEMENT if ( empty() ) qWarning( "TQValueList: Warning invalid element" ) -# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL Q_ASSERT( !empty() ); -# else -# define QT_CHECK_INVALID_LIST_ELEMENT -# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL -# endif -#else -# define QT_CHECK_INVALID_LIST_ELEMENT -# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL -#endif - -template class TQDeepCopy; - -template -class TQValueList -{ -public: - /** - * Typedefs - */ - typedef TQValueListIterator iterator; - typedef TQValueListConstIterator const_iterator; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - - /** - * API - */ - TQValueList() { sh = new TQValueListPrivate; } - TQValueList( const TQValueList& l ) { sh = l.sh; sh->ref(); } -#ifndef QT_NO_STL - TQValueList( const std::list& l ) - { - sh = new TQValueListPrivate; - qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); - } -#endif - ~TQValueList() { sh->derefAndDelete(); } - - TQValueList& operator= ( const TQValueList& l ) - { - l.sh->ref(); - sh->derefAndDelete(); - sh = l.sh; - return *this; - } -#ifndef QT_NO_STL - TQValueList& operator= ( const std::list& l ) - { - detach(); - qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); - return *this; - } - bool operator== ( const std::list& l ) const - { - if ( size() != l.size() ) - return FALSE; - const_iterator it2 = begin(); -#if !defined(Q_CC_MIPS) - typename -#endif - std::list::const_iterator it = l.begin(); - for ( ; it2 != end(); ++it2, ++it ) - if ( !((*it2) == (*it)) ) - return FALSE; - return TRUE; - } -#endif - bool operator== ( const TQValueList& l ) const; - bool operator!= ( const TQValueList& l ) const { return !( *this == l ); } - iterator begin() { detach(); return iterator( sh->node->next ); } - const_iterator begin() const { return const_iterator( sh->node->next ); } - const_iterator constBegin() const { return const_iterator( sh->node->next ); } - iterator end() { detach(); return iterator( sh->node ); } - const_iterator end() const { return const_iterator( sh->node ); } - const_iterator constEnd() const { return const_iterator( sh->node ); } - iterator insert( iterator it, const T& x ) { detach(); return sh->insert( it, x ); } - uint remove( const T& x ) { detach(); return sh->remove( x ); } - void clear(); - - // ### 4.0: move out of class - TQValueList& operator<< ( const T& x ) - { - append( x ); - return *this; - } - - size_type size() const { return sh->nodes; } - bool empty() const { return sh->nodes == 0; } - void push_front( const T& x ) { detach(); sh->insert( begin(), x ); } - void push_back( const T& x ) { detach(); sh->insert( end(), x ); } - iterator erase( iterator pos ) { detach(); return sh->remove( pos ); } - iterator erase( iterator first, iterator last ); - reference front() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); } - const_reference front() const { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); } - reference back() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); } - const_reference back() const { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); } - void pop_front() { QT_CHECK_INVALID_LIST_ELEMENT; erase( begin() ); } - void pop_back() { - QT_CHECK_INVALID_LIST_ELEMENT; - iterator tmp = end(); - erase( --tmp ); - } - void insert( iterator pos, size_type n, const T& x ); - // Some compilers (incl. vc++) would instantiate this function even if - // it is not used; this would constrain TQValueList to classes that provide - // an operator< - /* - void sort() - { - qHeapSort( *this ); - } - */ - - TQValueList operator+ ( const TQValueList& l ) const; - TQValueList& operator+= ( const TQValueList& l ); - - iterator fromLast() { detach(); return iterator( sh->node->prev ); } - const_iterator fromLast() const { return const_iterator( sh->node->prev ); } - - bool isEmpty() const { return ( sh->nodes == 0 ); } - - iterator append( const T& x ) { detach(); return sh->insert( end(), x ); } - iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); } - - iterator remove( iterator it ) { detach(); return sh->remove( it ); } - - T& first() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->next->data; } - const T& first() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->next->data; } - T& last() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->prev->data; } - const T& last() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->prev->data; } - - T& operator[] ( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->at(i)->data; } - const T& operator[] ( size_type i ) const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->at(i)->data; } - iterator at( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return iterator( sh->at(i) ); } - const_iterator at( size_type i ) const { QT_CHECK_INVALID_LIST_ELEMENT; return const_iterator( sh->at(i) ); } - iterator find ( const T& x ) { detach(); return iterator( sh->find( sh->node->next, x) ); } - const_iterator find ( const T& x ) const { return const_iterator( sh->find( sh->node->next, x) ); } - iterator find ( iterator it, const T& x ) { detach(); return iterator( sh->find( it.node, x ) ); } - const_iterator find ( const_iterator it, const T& x ) const { return const_iterator( sh->find( it.node, x ) ); } - int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; } - size_type contains( const T& x ) const { return sh->contains( x ); } - - size_type count() const { return sh->nodes; } - - TQValueList& operator+= ( const T& x ) - { - append( x ); - return *this; - } - typedef TQValueListIterator Iterator; - typedef TQValueListConstIterator ConstIterator; - typedef T ValueType; - -protected: - /** - * Helpers - */ - void detach() { if ( sh->count > 1 ) detachInternal(); } - - /** - * Variables - */ - TQValueListPrivate* sh; - -private: - void detachInternal(); - - friend class TQDeepCopy< TQValueList >; -}; - -template -Q_INLINE_TEMPLATES bool TQValueList::operator== ( const TQValueList& l ) const -{ - if ( size() != l.size() ) - return FALSE; - const_iterator it2 = begin(); - const_iterator it = l.begin(); - for( ; it != l.end(); ++it, ++it2 ) - if ( !( *it == *it2 ) ) - return FALSE; - return TRUE; -} - -template -Q_INLINE_TEMPLATES void TQValueList::clear() -{ - if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new TQValueListPrivate; } -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueList::iterator TQValueList::erase( Q_TYPENAME TQValueList::iterator first, Q_TYPENAME TQValueList::iterator last ) -{ - while ( first != last ) - erase( first++ ); - return last; -} - - -template -Q_INLINE_TEMPLATES void TQValueList::insert( Q_TYPENAME TQValueList::iterator pos, size_type n, const T& x ) -{ - for ( ; n > 0; --n ) - insert( pos, x ); -} - -template -Q_INLINE_TEMPLATES TQValueList TQValueList::operator+ ( const TQValueList& l ) const -{ - TQValueList l2( *this ); - for( const_iterator it = l.begin(); it != l.end(); ++it ) - l2.append( *it ); - return l2; -} - -template -Q_INLINE_TEMPLATES TQValueList& TQValueList::operator+= ( const TQValueList& l ) -{ - TQValueList copy = l; - for( const_iterator it = copy.begin(); it != copy.end(); ++it ) - append( *it ); - return *this; -} - -template -Q_INLINE_TEMPLATES void TQValueList::detachInternal() -{ - sh->deref(); sh = new TQValueListPrivate( *sh ); -} - -#ifndef QT_NO_DATASTREAM -template -Q_INLINE_TEMPLATES TQDataStream& operator>>( TQDataStream& s, TQValueList& l ) -{ - l.clear(); - Q_UINT32 c; - s >> c; - for( Q_UINT32 i = 0; i < c; ++i ) - { - T t; - s >> t; - l.append( t ); - if ( s.atEnd() ) - break; - } - return s; -} - -template -Q_INLINE_TEMPLATES TQDataStream& operator<<( TQDataStream& s, const TQValueList& l ) -{ - s << (Q_UINT32)l.size(); - TQValueListConstIterator it = l.begin(); - for( ; it != l.end(); ++it ) - s << *it; - return s; -} -#endif // QT_NO_DATASTREAM - -#define Q_DEFINED_QVALUELIST -#define Q_DEFINED_QVALUELIST -#include "qwinexport.h" -#endif // TQVALUELIST_H diff --git a/src/tools/qvaluestack.h b/src/tools/qvaluestack.h deleted file mode 100644 index 3415750f5..000000000 --- a/src/tools/qvaluestack.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Definition of TQValueStack class -** -** Created : 990925 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVALUESTACK_H -#define TQVALUESTACK_H - -#ifndef QT_H -#include "qvaluelist.h" -#endif // QT_H - - -template -class TQValueStack : public TQValueList -{ -public: - TQValueStack() {} - ~TQValueStack() {} - void push( const T& d ) { this->append(d); } - T pop() - { - T elem( this->last() ); - if ( !this->isEmpty() ) - this->remove( this->fromLast() ); - return elem; - } - T& top() { return this->last(); } - const T& top() const { return this->last(); } -}; - -#endif diff --git a/src/tools/qvaluevector.h b/src/tools/qvaluevector.h deleted file mode 100644 index e2fe25be2..000000000 --- a/src/tools/qvaluevector.h +++ /dev/null @@ -1,577 +0,0 @@ -/**************************************************************************** -** -** Definition of TQValueVector class -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVALUEVECTOR_H -#define TQVALUEVECTOR_H - -#include - -#ifndef QT_H -#include "qtl.h" -#include "qshared.h" -#include "qdatastream.h" -#endif // QT_H - -#ifndef QT_NO_STL -#include -#endif - -template -class TQValueVectorPrivate : public TQShared -{ -public: - typedef T value_type; - typedef T* pointer; - - TQValueVectorPrivate() - : start( 0 ), finish( 0 ), end( 0 ) - { - } - - TQValueVectorPrivate( const TQValueVectorPrivate& x ); - TQValueVectorPrivate( size_t size ); - - void derefAndDelete() // work-around for hp-cc - { - if ( deref() ) - delete this; - } - -#if defined(Q_TEMPLATEDLL) - // Workaround MS bug in memory de/allocation in DLL vs. EXE - virtual -#endif - ~TQValueVectorPrivate() - { - delete[] start; - } - - size_t size() const - { - return finish - start; - } - - bool empty() const - { - return start == finish; - } - - size_t capacity() const - { - return end - start; - } - - void insert( pointer pos, const T& x ); - void insert( pointer pos, size_t n, const T& x ); - void reserve( size_t n ); - - void clear() - { - delete[] start; - start = 0; - finish = 0; - end = 0; - } - - - pointer start; - pointer finish; - pointer end; - -private: - pointer growAndCopy( size_t n, pointer s, pointer f ); - - TQValueVectorPrivate& operator=( const TQValueVectorPrivate& x ); - -}; - -template -Q_INLINE_TEMPLATES TQValueVectorPrivate::TQValueVectorPrivate( const TQValueVectorPrivate& x ) - : TQShared() -{ - size_t i = x.size(); - if ( i > 0 ) { - start = new T[ i ]; - finish = start + i; - end = start + i; -#if defined(__xlC__) && __xlC__ < 0x400 // xlC 3.6 confused by const - qCopy( (pointer)x.start, (pointer)x.finish, start ); -#else - qCopy( x.start, x.finish, start ); -#endif - } else { - start = 0; - finish = 0; - end = 0; - } -} - -template -Q_INLINE_TEMPLATES TQValueVectorPrivate::TQValueVectorPrivate( size_t size ) -{ - if ( size > 0 ) { - start = new T[size]; - finish = start + size; - end = start + size; - } else { - start = 0; - finish = 0; - end = 0; - } -} - -template -Q_INLINE_TEMPLATES void TQValueVectorPrivate::insert( pointer pos, const T& x ) -{ - const size_t lastSize = size(); - const size_t n = lastSize !=0 ? 2*lastSize : 1; - const size_t offset = pos - start; - pointer newStart = new T[n]; - pointer newFinish = newStart + offset; - qCopy( start, pos, newStart ); - *newFinish = x; - qCopy( pos, finish, ++newFinish ); - delete[] start; - start = newStart; - finish = newStart + lastSize + 1; - end = newStart + n; -} - -template -Q_INLINE_TEMPLATES void TQValueVectorPrivate::insert( pointer pos, size_t n, const T& x ) -{ - if ( size_t( end - finish ) >= n ) { - // enough room - const size_t elems_after = finish - pos; - pointer old_finish = finish; - if ( elems_after > n ) { - qCopy( finish - n, finish, finish ); - finish += n; - qCopyBackward( pos, old_finish - n, old_finish ); - qFill( pos, pos + n, x ); - } else { - pointer filler = finish; - size_t i = n - elems_after; - for ( ; i > 0; --i, ++filler ) - *filler = x; - finish += n - elems_after; - qCopy( pos, old_finish, finish ); - finish += elems_after; - qFill( pos, old_finish, x ); - } - } else { - // not enough room - const size_t lastSize = size(); - const size_t len = lastSize + TQMAX( lastSize, n ); - pointer newStart = new T[len]; - pointer newFinish = qCopy( start, pos, newStart ); - // fill up inserted space - size_t i = n; - for ( ; i > 0; --i, ++newFinish ) - *newFinish = x; - newFinish = qCopy( pos, finish, newFinish ); - delete[] start; - start = newStart; - finish = newFinish; - end = newStart + len; - } -} - -template -Q_INLINE_TEMPLATES void TQValueVectorPrivate::reserve( size_t n ) -{ - const size_t lastSize = size(); - pointer tmp = growAndCopy( n, start, finish ); - start = tmp; - finish = tmp + lastSize; - end = start + n; -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueVectorPrivate::pointer TQValueVectorPrivate::growAndCopy( size_t n, pointer s, pointer f ) -{ - pointer newStart = new T[n]; - qCopy( s, f, newStart ); - delete[] start; - return newStart; -} - -template class TQDeepCopy; - -template -class TQValueVector -{ -public: - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type* iterator; - typedef const value_type* const_iterator; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - - TQValueVector() - { - sh = new TQValueVectorPrivate; - } - - TQValueVector( const TQValueVector& v ) - { - sh = v.sh; - sh->ref(); - } - - TQValueVector( size_type n, const T& val = T() ); - -#ifndef QT_NO_STL - TQValueVector( std::vector& v ) // ### remove in 4.0 - { - sh = new TQValueVectorPrivate( v.size() ); - qCopy( v.begin(), v.end(), begin() ); - } - - TQValueVector( const std::vector& v ) - { - sh = new TQValueVectorPrivate( v.size() ); - qCopy( v.begin(), v.end(), begin() ); - } -#endif - - ~TQValueVector() - { - sh->derefAndDelete(); - } - - TQValueVector& operator= ( const TQValueVector& v ) - { - v.sh->ref(); - sh->derefAndDelete(); - sh = v.sh; - return *this; - } - -#ifndef QT_NO_STL - TQValueVector& operator= ( const std::vector& v ) - { - clear(); - resize( v.size() ); - qCopy( v.begin(), v.end(), begin() ); - return *this; - } -#endif - - size_type size() const { return sh->size(); } - - bool empty() const { return sh->empty(); } - - size_type capacity() const - { - return size_type( sh->capacity() ); - } - - iterator begin() - { - detach(); - return sh->start; - } - - const_iterator begin() const - { - return sh->start; - } - - const_iterator constBegin() const - { - return sh->start; - } - - iterator end() - { - detach(); - return sh->finish; - } - - const_iterator end() const - { - return sh->finish; - } - - const_iterator constEnd() const - { - return sh->finish; - } - - reference at( size_type i, bool* ok = 0 ) - { - detach(); - if ( ok ) - *ok = ( i < size() ); - return *( begin() + i ); - } - - const_reference at( size_type i, bool* ok = 0 ) const - { - if ( ok ) - *ok = ( i < size() ); - return *( begin() + i ); - } - - reference operator[]( size_type i ) - { - detach(); - return *( begin() + i ); - } - - const_reference operator[]( size_type i ) const - { - return *( begin() + i ); - } - - reference front() - { - Q_ASSERT( !empty() ); - detach(); - return *begin(); - } - - const_reference front() const - { - Q_ASSERT( !empty() ); - return *begin(); - } - - reference back() - { - Q_ASSERT( !empty() ); - detach(); - return *( end() - 1 ); - } - - const_reference back() const - { - Q_ASSERT( !empty() ); - return *( end() - 1 ); - } - - void push_back( const T& x ) - { - detach(); - if ( sh->finish == sh->end ) { - sh->reserve( size()+size()/2+1 ); - } - *sh->finish = x; - ++sh->finish; - } - - void pop_back() - { - detach(); - if ( empty() ) - return; - --sh->finish; - } - - iterator insert( iterator pos, const T& x ); - iterator insert( iterator pos, size_type n, const T& x ); - - void reserve( size_type n ) - { - if ( capacity() < n ) { - detach(); - sh->reserve( n ); - } - } - - void resize( size_type n, const T& val = T() ) - { - if ( n < size() ) - erase( begin() + n, end() ); - else - insert( end(), n - size(), val ); - } - - void clear() - { - detach(); - sh->clear(); - } - - iterator erase( iterator pos ) - { - detach(); - if ( pos + 1 != end() ) - qCopy( pos + 1, sh->finish, pos ); - --sh->finish; - return pos; - } - - iterator erase( iterator first, iterator last ) - { - detach(); - qCopy( last, sh->finish, first ); - sh->finish = sh->finish - ( last - first ); - return first; - } - - // ### remove in TQt 4.0 - bool operator==( const TQValueVector& x ) - { - return size()==x.size() ? qEqual( constBegin(), constEnd(), x.begin()) : FALSE; - } - - bool operator==( const TQValueVector& x ) const - { - return size()==x.size() ? qEqual( begin(), end(), x.begin() ) : FALSE; - } - - typedef T ValueType; - typedef ValueType *Iterator; - typedef const ValueType *ConstIterator; - - size_type count() const { return size(); } - bool isEmpty() const { return empty(); } - - reference first() { return front(); } - const_reference first() const { return front(); } - reference last() { return back(); } - const_reference last() const { return back(); } - void append( const T& x ) { push_back( x ); } - -protected: - void detach() - { - if ( sh->count > 1 ) { detachInternal(); } - } - void detachInternal(); - TQValueVectorPrivate* sh; - -private: - friend class TQDeepCopy< TQValueVector >; -}; - -template -Q_INLINE_TEMPLATES TQValueVector::TQValueVector( size_type n, const T& val ) -{ - sh = new TQValueVectorPrivate( n ); - qFill( begin(), end(), val ); -} - -template -Q_INLINE_TEMPLATES void TQValueVector::detachInternal() -{ - sh->deref(); - sh = new TQValueVectorPrivate( *sh ); -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueVector::iterator TQValueVector::insert( iterator pos, const T& x ) -{ - size_type offset = pos - sh->start; - detach(); - if ( pos == end() ) { - if ( sh->finish == sh->end ) - push_back( x ); - else { - *sh->finish = x; - ++sh->finish; - } - } else { - if ( sh->finish == sh->end ) { - sh->insert( pos, x ); - } else { - *sh->finish = *(sh->finish - 1); - ++sh->finish; - qCopyBackward( pos, sh->finish - 2, sh->finish - 1 ); - *pos = x; - } - } - return begin() + offset; -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME TQValueVector::iterator TQValueVector::insert( iterator pos, size_type n, const T& x ) -{ - if ( n != 0 ) { - size_type offset = pos - sh->start; - detach(); - pos = begin() + offset; - sh->insert( pos, n, x ); - } - return pos; -} - - -#ifndef QT_NO_DATASTREAM -template -Q_INLINE_TEMPLATES TQDataStream& operator>>( TQDataStream& s, TQValueVector& v ) -{ - v.clear(); - Q_UINT32 c; - s >> c; - v.resize( c ); - for( Q_UINT32 i = 0; i < c; ++i ) - { - T t; - s >> t; - v[i] = t; - } - return s; -} - -template -Q_INLINE_TEMPLATES TQDataStream& operator<<( TQDataStream& s, const TQValueVector& v ) -{ - s << (Q_UINT32)v.size(); - // ### use typename TQValueVector::const_iterator once all supported - // ### compilers know about the 'typename' keyword. - const T* it = v.begin(); - for( ; it != v.end(); ++it ) - s << *it; - return s; -} -#endif // QT_NO_DATASTREAM - -#define Q_DEFINED_QVALUEVECTOR -#include "qwinexport.h" -#endif // TQVALUEVECTOR_H diff --git a/src/tools/qwaitcondition.h b/src/tools/qwaitcondition.h deleted file mode 100644 index 5dc66a7d4..000000000 --- a/src/tools/qwaitcondition.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWaitCondition class -** -** Created : 931107 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWAITCONDITION_H -#define TQWAITCONDITION_H - -#ifndef QT_H -#include "qglobal.h" -#endif // QT_H - -#if defined(QT_THREAD_SUPPORT) - -#include - -class TQWaitConditionPrivate; -class TQMutex; - -class Q_EXPORT TQWaitCondition -{ -public: - TQWaitCondition(); - virtual ~TQWaitCondition(); - - // default argument causes thread to block indefinately - bool wait( unsigned long time = ULONG_MAX ); - bool wait( TQMutex *mutex, unsigned long time = ULONG_MAX ); - - void wakeOne(); - void wakeAll(); - -private: - TQWaitConditionPrivate * d; - -#if defined(Q_DISABLE_COPY) - TQWaitCondition( const TQWaitCondition & ); - TQWaitCondition &operator=( const TQWaitCondition & ); -#endif -}; - -#endif - -#endif diff --git a/src/tools/qwaitcondition_unix.cpp b/src/tools/qwaitcondition_unix.cpp index 5c4e9388d..2f1e5b98a 100644 --- a/src/tools/qwaitcondition_unix.cpp +++ b/src/tools/qwaitcondition_unix.cpp @@ -44,8 +44,8 @@ typedef pthread_mutex_t Q_MUTEX_T; -#include "qwaitcondition.h" -#include "qmutex.h" +#include "ntqwaitcondition.h" +#include "ntqmutex.h" #include "qmutex_p.h" #include @@ -58,7 +58,7 @@ struct TQWaitConditionPrivate { /*! - \class TQWaitCondition qwaitcondition.h + \class TQWaitCondition ntqwaitcondition.h \threadsafe \brief The TQWaitCondition class allows waiting/waking for conditions between threads. diff --git a/src/tools/qwinexport.cpp b/src/tools/qwinexport.cpp index 99126c92e..38592c9bb 100644 --- a/src/tools/qwinexport.cpp +++ b/src/tools/qwinexport.cpp @@ -1,31 +1,31 @@ #define Q_EXPORT_TEMPLATES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/tools/qwinexport.h b/src/tools/qwinexport.h deleted file mode 100644 index 0936ade6c..000000000 --- a/src/tools/qwinexport.h +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** -** -** Global type declarations and definitions -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the tools module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) ) -// MOC_SKIP_BEGIN - -#if defined(Q_DEFINED_QASCIIDICT) && defined(Q_DEFINED_QCONNECTION_LIST) && !defined(Q_EXPORTED_QASCIIDICT_TEMPLATES) -#define Q_EXPORTED_QASCIIDICT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQAsciiDictIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQAsciiDict; -#endif - -#if defined(Q_DEFINED_QSTYLESHEET) && defined(Q_DEFINED_QDICT) && !defined(Q_EXPORTED_QSTYLESHEET_TEMPLATES) -#define Q_EXPORTED_QSTYLESHEET_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQDict; -#endif - -#if defined(Q_DEFINED_QLIBRARY) && defined(Q_DEFINED_QDICT) && !defined(Q_EXPORTED_QDICTLIBRARY_TEMPLATES) -#define Q_EXPORTED_QDICTLIBRARY_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQDict; // for TQtopia -#endif - -#if defined(Q_DEFINED_QGUARDEDPTR) && defined(Q_DEFINED_QOBJECT) && !defined(Q_EXPORTED_QGUARDEDPTROBJECT_TEMPLATES) -#define Q_EXPORTED_QGUARDEDPTROBJECT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQGuardedPtr; -#endif - -// needed for TQtopia -#if defined(Q_DEFINED_QGUARDEDPTR) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED_QGUARDEDPTRTQWIDGET_TEMPLATES) -#define Q_EXPORTED_QGUARDEDPTRTQWIDGET_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQGuardedPtr; -#endif - -#if defined(Q_DEFINED_QGUARDEDPTR) && defined(Q_DEFINED_QACCESSIBLE_OBJECT) && !defined(Q_EXPORTED_QACCESSIBLEOBJECT_TEMPLATES) -#define Q_EXPORTED_QACCESSIBLEOBJECT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQGuardedPtr; -#endif - -#if defined(Q_DEFINED_QINTDICT) && !defined(Q_EXPORTED_QINTDICT_TEMPLATES) -#define Q_EXPORTED_QINTDICT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDict; -#endif - -#if defined(Q_DEFINED_QINTDICT) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED__TEMPLATES) -#define Q_EXPORTED__TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDictIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQIntDict; -#endif - -#if defined(Q_DEFINED_QMAP) && !defined(Q_EXPORTED_QMAPBASIC_TEMPLATES) -#define Q_EXPORTED_QMAPBASIC_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia -#endif - -#if defined(Q_DEFINED_QMAP) && defined(Q_DEFINED_QSTRING) && !defined(Q_EXPORTED_QMAPTQSTRING_TEMPLATES) -#define Q_EXPORTED_QMAPTQSTRING_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMap; // for TQtopia -#endif - -#if defined(Q_DEFINED_QMEMARRAY) && !defined(Q_EXPORTED_QMEMARRAY_BASIC_TEMPLATES) -#define Q_EXPORTED_QMEMARRAY_BASIC_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; -#endif - -#if defined(Q_DEFINED_QMEMARRAY) && defined(Q_DEFINED_QPOINT) && !defined(Q_EXPORTED_QMEMARAYPOINT_TEMPLATES) -#define Q_EXPORTED_QMEMARAYPOINT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQMemArray; -#endif - -#if defined(Q_DEFINED_QPTRLIST) && !defined(Q_EXPORTED_QPTRLIST_BASIC_TEMPLATES) -#define Q_EXPORTED_QPTRLIST_BASIC_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -#endif - -#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED_QPTRLISTWIDGET_TEMPLATES) -#define Q_EXPORTED_QPTRLISTWIDGET_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -#endif - -#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QCONNECTION) && !defined(Q_EXPORTED_QPTRLISTCONNECTION_TEMPLATES) -#define Q_EXPORTED_QPTRLISTCONNECTION_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -#endif - -#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QOBJECT) && !defined(Q_EXPORTED_QPTRLISTOBJECT_TEMPLATES) -#define Q_EXPORTED_QPTRLISTOBJECT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -#endif - -#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QDOCKWINDOW) && !defined(Q_EXPORTED_QPTRLISTDOCWINDOW_TEMPLATES) -#define Q_EXPORTED_QPTRLISTDOCWINDOW_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -#endif - -#if defined(Q_DEFINED_QPTRVECTOR) && !defined(Q_EXPORTED_QPTRVECTOR_BASIC_TEMPLATES) -#define Q_EXPORTED_QPTRVECTOR_BASIC_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -#endif - -#if defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QSTYLESHEET) && !defined(Q_EXPORTED_QPTRVECTORSTYLESHEETITEM_TEMPLATES) -#define Q_EXPORTED_QPTRVECTORSTYLESHEETITEM_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -#endif - -#if defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QWIDGET) && !defined(Q_EXPORTED_QPTRVECTORWIDGET_TEMPLATES) -#define Q_EXPORTED_QPTRVECTORWIDGET_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -#endif - -#if defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QCONNECTION_LIST) && !defined(Q_EXPORTED_QPTRVECTORCONNECTTIONLIST_TEMPLATES) -#define Q_EXPORTED_QPTRVECTORCONNECTTIONLIST_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -#endif - -#if defined(Q_DEFINED_QVALUELIST) && !defined(Q_EXPORTED_QVALUELIST_BASIC_TEMPLATES) -#define Q_EXPORTED_QVALUELIST_BASIC_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -#endif - -#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QRECT) && !defined(Q_EXPORTED_QVALUELISTRECT_TEMPLATES) -#define Q_EXPORTED_QVALUELISTRECT_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -#endif - -#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QSTRING) && !defined(Q_EXPORTED_QVALUELISTSTRING_TEMPLATES) -#define Q_EXPORTED_QVALUELISTSTRING_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueListIterator; -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -#endif - -// TQStylesheet template exports -#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QPTRVECTOR) && defined(Q_DEFINED_QSTYLESHEET) && !defined(Q_EXPORTED_QSTYLESHEETITEM1_TEMPLATES) -#define Q_EXPORTED_QSTYLESHEETITEM1_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList< TQPtrVector< TQStyleSheetItem> >; -#endif - -#if defined(Q_DEFINED_QVALUELIST) && defined(Q_DEFINED_QSTYLESHEET) && !defined(Q_EXPORTED_QSTYLESHEETITEM2_TEMPLATES) -#define Q_EXPORTED_QSTYLESHEETITEM2_TEMPLATES -Q_TEMPLATE_EXTERN template class Q_EXPORT TQValueList; -#endif - -// qcanvas template exports -#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QCANVAS) && !defined(Q_EXPORTED_QCANVAS1_TEMPLATES) -#define Q_EXPORTED_QCANVAS1_TEMPLATES -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrListIterator< TQCanvasItem >; -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrList< TQCanvasItem >; -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrListIterator< TQCanvasView >; -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrList< TQCanvasView >; -#endif - -// qtable template exports -#if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QTABLE_SELECTION) && !defined(Q_EXPORTED_QTABLESELECTION_TEMPLATES) -#define Q_EXPORTED_QTABLESELECTION_TEMPLATES -TQM_TEMPLATE_EXTERN_TABLE template class TQM_EXPORT_TABLE TQPtrList; -#endif - -#if defined(Q_DEFINED_QTABLE_ITEM) && defined(Q_DEFINED_QPTRVECTOR) && !defined(Q_EXPORTED_QTABLEITEM_TEMPLATES) -#define Q_EXPORTED_QTABLEITEM_TEMPLATES -TQM_TEMPLATE_EXTERN_TABLE template class TQM_EXPORT_TABLE TQPtrVector; -#endif - -#if defined(Q_DEFINED_QTABLE) && defined(Q_DEFINED_QPTRVECTOR) -//Q_TEMPLATE_EXTERN template class Q_EXPORT TQPtrVector; -#endif - -// qsqlextension template exports -#if defined(Q_DEFINED_QSQLEXTENSION) && defined(Q_DEFINED_QMAP) && defined(Q_DEFINED_QVALUEVECTOR) && defined(Q_DEFINED_QSTRING) && !defined(Q_EXPORTED_QSQLEXTENSION_TEMPLATES) -#define Q_EXPORTED_QSQLEXTENSION_TEMPLATES -TQM_TEMPLATE_EXTERN_SQL template class TQM_EXPORT_SQL TQMap; -TQM_TEMPLATE_EXTERN_SQL template class TQM_EXPORT_SQL TQValueVector; -#endif - - -// MOC_SKIP_END -#endif // template defined diff --git a/src/widgets/ntqaction.h b/src/widgets/ntqaction.h new file mode 100644 index 000000000..4811d6bfc --- /dev/null +++ b/src/widgets/ntqaction.h @@ -0,0 +1,218 @@ +/**************************************************************************** +** +** Definition of TQAction class +** +** Created : 000000 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQACTION_H +#define TQACTION_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqiconset.h" +#include "ntqstring.h" +#include "ntqkeysequence.h" +#endif // QT_H + +#ifndef QT_NO_ACTION + +class TQActionPrivate; +class TQActionGroupPrivate; +class TQStatusBar; +class TQPopupMenu; +class TQToolTipGroup; + +class Q_EXPORT TQAction : public TQObject +{ + Q_OBJECT + Q_PROPERTY( bool toggleAction READ isToggleAction WRITE setToggleAction) + Q_PROPERTY( bool on READ isOn WRITE setOn ) + Q_PROPERTY( bool enabled READ isEnabled WRITE setEnabled ) + Q_PROPERTY( TQIconSet iconSet READ iconSet WRITE setIconSet ) + Q_PROPERTY( TQString text READ text WRITE setText ) + Q_PROPERTY( TQString menuText READ menuText WRITE setMenuText ) + Q_PROPERTY( TQString toolTip READ toolTip WRITE setToolTip ) + Q_PROPERTY( TQString statusTip READ statusTip WRITE setStatusTip ) + Q_PROPERTY( TQString whatsThis READ whatsThis WRITE setWhatsThis ) +#ifndef QT_NO_ACCEL + Q_PROPERTY( TQKeySequence accel READ accel WRITE setAccel ) +#endif + Q_PROPERTY( bool visible READ isVisible WRITE setVisible ) + +public: + TQAction( TQObject* parent, const char* name = 0 ); +#ifndef QT_NO_ACCEL + TQAction( const TQString& menuText, TQKeySequence accel, + TQObject* parent, const char* name = 0 ); + TQAction( const TQIconSet& icon, const TQString& menuText, TQKeySequence accel, + TQObject* parent, const char* name = 0 ); + + TQAction( const TQString& text, const TQIconSet& icon, const TQString& menuText, TQKeySequence accel, + TQObject* parent, const char* name = 0, bool toggle = FALSE ); // obsolete + TQAction( const TQString& text, const TQString& menuText, TQKeySequence accel, TQObject* parent, + const char* name = 0, bool toggle = FALSE ); // obsolete +#endif + TQAction( TQObject* parent, const char* name , bool toggle ); // obsolete + ~TQAction(); + + 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; +#ifndef QT_NO_ACCEL + virtual void setAccel( const TQKeySequence& key ); + TQKeySequence accel() const; +#endif + 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 *actionWidget, TQWidget *container ); + virtual void addedTo( int index, TQPopupMenu *menu ); + +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 slots: + void internalActivation(); + void toolButtonToggled( bool ); + void objectDestroyed(); + void menuStatusText( int id ); + void showStatusText( const TQString& ); + void clearStatusText(); + +private: + void init(); + + friend class TQActionGroup; + friend class TQActionGroupPrivate; + TQActionPrivate* d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQAction( const TQAction & ); + TQAction &operator=( const TQAction & ); +#endif +}; + +class Q_EXPORT TQActionGroup : public TQAction +{ + Q_OBJECT + Q_PROPERTY( bool exclusive READ isExclusive WRITE setExclusive ) + Q_PROPERTY( bool usesDropDown READ usesDropDown WRITE setUsesDropDown ) + +public: + TQActionGroup( TQObject* parent, const char* name = 0 ); + TQActionGroup( TQObject* parent, const char* name , bool exclusive ); // obsolete + ~TQActionGroup(); + void setExclusive( bool ); + bool isExclusive() const; + void add( TQAction* a); + void addSeparator(); + bool addTo( TQWidget* ); + bool removeFrom( TQWidget* ); + void setEnabled( bool ); + void setToggleAction( bool toggle ); + void setOn( bool on ); + + void setUsesDropDown( bool enable ); + 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 *actionWidget, TQWidget *container, TQAction *a ); + virtual void addedTo( int index, TQPopupMenu *menu, TQAction *a ); + virtual void addedTo( TQWidget *actionWidget, TQWidget *container ); + virtual void addedTo( int index, TQPopupMenu *menu ); + +signals: + void selected( TQAction* ); + +private slots: + void childToggled( bool ); + void childDestroyed(); + void internalComboBoxActivated( int ); + void internalComboBoxHighlighted( int ); + void internalToggle( TQAction* ); + void objectDestroyed(); + +private: + TQActionGroupPrivate* d; + +#ifndef QT_NO_COMPAT +public: + void insert( TQAction* a ) { add( a ); } +#endif + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQActionGroup( const TQActionGroup & ); + TQActionGroup &operator=( const TQActionGroup & ); +#endif +}; + +#endif + +#endif diff --git a/src/widgets/ntqbutton.h b/src/widgets/ntqbutton.h new file mode 100644 index 000000000..17dcdd260 --- /dev/null +++ b/src/widgets/ntqbutton.h @@ -0,0 +1,234 @@ +/**************************************************************************** +** +** Definition of TQButton widget class +** +** Created : 940206 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQBUTTON_H +#define TQBUTTON_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqkeysequence.h" +#endif // QT_H + +#ifndef QT_NO_BUTTON + + +class TQButtonGroup; +class TQToolBar; +class TQButtonData; + +class Q_EXPORT TQButton : public TQWidget +{ + Q_OBJECT + Q_ENUMS( ToggleType ToggleState ) + Q_PROPERTY( TQString text READ text WRITE setText ) + Q_PROPERTY( TQPixmap pixmap READ pixmap WRITE setPixmap ) + Q_PROPERTY( TQKeySequence accel READ accel WRITE setAccel ) + Q_PROPERTY( bool toggleButton READ isToggleButton ) + Q_PROPERTY( ToggleType toggleType READ toggleType ) + Q_PROPERTY( bool down READ isDown WRITE setDown DESIGNABLE false ) + Q_PROPERTY( bool on READ isOn ) + Q_PROPERTY( ToggleState toggleState READ state ) + Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false ) + Q_PROPERTY( bool autoRepeat READ autoRepeat WRITE setAutoRepeat ) + Q_PROPERTY( bool exclusiveToggle READ isExclusiveToggle ) + +public: + TQButton( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + ~TQButton(); + + TQString text() const; + virtual void setText( const TQString &); + const TQPixmap *pixmap() const; + virtual void setPixmap( const TQPixmap & ); + +#ifndef QT_NO_ACCEL + TQKeySequence accel() const; + virtual void setAccel( const TQKeySequence& ); +#endif + + 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; + +#ifndef QT_NO_COMPAT + bool autoResize() const; + void setAutoResize( bool ); +#endif + + 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 &pos ) 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 slots: + void animateTimeout(); + void autoRepeatTimeout(); + void emulateClick(); + +private: + TQString btext; + TQPixmap *bpixmap; + uint toggleTyp : 2; + uint buttonDown : 1; + uint stat : 2; + uint mlbDown : 1; + uint autoresize : 1; + uint animation : 1; + uint repeat : 1; + TQButtonData *d; + + friend class TQButtonGroup; + friend class TQToolBar; + void ensureData(); + virtual void setGroup( TQButtonGroup* ); + TQTimer *timer(); + void nextState(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQButton( const TQButton & ); + TQButton &operator=( const TQButton & ); +#endif +}; + + +inline TQString TQButton::text() const +{ + return btext; +} + +inline const TQPixmap *TQButton::pixmap() const +{ + return bpixmap; +} + +inline bool TQButton::isToggleButton() const +{ + return ToggleType(toggleTyp) != SingleShot; +} + +inline bool TQButton::isDown() const +{ + return buttonDown; +} + +inline bool TQButton::isOn() const +{ + return ToggleState(stat) != Off; +} + +#ifndef QT_NO_COMPAT +inline bool TQButton::autoResize() const +{ + return autoresize; +} +#endif + +inline bool TQButton::autoRepeat() const +{ + return repeat; +} + +inline TQButton::ToggleState TQButton::state() const +{ + return ToggleState(stat); +} + +inline void TQButton::setToggleButton( bool b ) +{ + setToggleType( b ? Toggle : SingleShot ); +} + +inline void TQButton::setOn( bool y ) +{ + setState( y ? On : Off ); +} + +inline TQButton::ToggleType TQButton::toggleType() const +{ + return ToggleType(toggleTyp); +} + + +#endif // QT_NO_BUTTON + +#endif // TQBUTTON_H diff --git a/src/widgets/ntqbuttongroup.h b/src/widgets/ntqbuttongroup.h new file mode 100644 index 000000000..155c6a763 --- /dev/null +++ b/src/widgets/ntqbuttongroup.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Definition of TQButtonGroup class +** +** Created : 950130 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQBUTTONGROUP_H +#define TQBUTTONGROUP_H + +#ifndef QT_H +#include "ntqgroupbox.h" +#endif // QT_H + +#ifndef QT_NO_BUTTONGROUP + + +class TQButton; +class TQButtonList; + + +class Q_EXPORT TQButtonGroup : public TQGroupBox +{ + Q_OBJECT + Q_PROPERTY( bool exclusive READ isExclusive WRITE setExclusive ) + Q_PROPERTY( bool radioButtonExclusive READ isRadioButtonExclusive WRITE setRadioButtonExclusive ) + Q_PROPERTY( int selectedId READ selectedId WRITE setButton ) + +public: + TQButtonGroup( TQWidget* parent=0, const char* name=0 ); + TQButtonGroup( const TQString &title, + TQWidget* parent=0, const char* name=0 ); + TQButtonGroup( int columns, Orientation o, + TQWidget* parent=0, const char* name=0 ); + TQButtonGroup( int columns, Orientation o, const TQString &title, + TQWidget* parent=0, const char* name=0 ); + ~TQButtonGroup(); + + bool isExclusive() const; + bool isRadioButtonExclusive() const { return radio_excl; } + virtual void setExclusive( bool ); + virtual void setRadioButtonExclusive( bool ); + +public: + int insert( TQButton *, int id=-1 ); + void remove( TQButton * ); + TQButton *find( int id ) const; + int id( TQButton * ) const; + int count() const; + + virtual void setButton( int id ); + + virtual void moveFocus( int ); + + TQButton *selected() const; + int selectedId() const; + +signals: + void pressed( int id ); + void released( int id ); + void clicked( int id ); + +protected slots: + void buttonPressed(); + void buttonReleased(); + void buttonClicked(); + void buttonToggled( bool on ); + +protected: + bool event( TQEvent * e ); + +private: + void init(); + bool excl_grp; + bool radio_excl; + TQButtonList *buttons; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQButtonGroup( const TQButtonGroup & ); + TQButtonGroup &operator=( const TQButtonGroup & ); +#endif +}; + + +#endif // QT_NO_BUTTONGROUP + +#endif // TQBUTTONGROUP_H diff --git a/src/widgets/ntqcheckbox.h b/src/widgets/ntqcheckbox.h new file mode 100644 index 000000000..16a2b7a7a --- /dev/null +++ b/src/widgets/ntqcheckbox.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Definition of TQCheckBox class +** +** Created : 940222 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCHECKBOX_H +#define TQCHECKBOX_H + +#ifndef QT_H +#include "ntqbutton.h" +#endif // QT_H + +#ifndef QT_NO_CHECKBOX + +class Q_EXPORT TQCheckBox : public TQButton +{ + Q_OBJECT + Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) + Q_PROPERTY( bool tristate READ isTristate WRITE setTristate ) + Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) + +public: + TQCheckBox( TQWidget *parent, const char* name=0 ); + TQCheckBox( const TQString &text, TQWidget *parent, const char* name=0 ); + + bool isChecked() const; + + void setNoChange(); + + void setTristate(bool y=TRUE); + bool isTristate() const; + + TQSize sizeHint() const; + +public slots: + void setChecked( bool check ); + +protected: + void resizeEvent( TQResizeEvent* ); + void drawButton( TQPainter * ); + void drawButtonLabel( TQPainter * ); + void updateMask(); + bool hitButton( const TQPoint &pos ) const; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQCheckBox( const TQCheckBox & ); + TQCheckBox &operator=( const TQCheckBox & ); +#endif +}; + + +inline bool TQCheckBox::isChecked() const +{ return isOn(); } + +inline void TQCheckBox::setChecked( bool check ) +{ setOn( check ); } + + +#endif // QT_NO_CHECKBOX + +#endif // TQCHECKBOX_H diff --git a/src/widgets/ntqcombobox.h b/src/widgets/ntqcombobox.h new file mode 100644 index 000000000..0b5eb95d7 --- /dev/null +++ b/src/widgets/ntqcombobox.h @@ -0,0 +1,206 @@ +/********************************************************************** +** +** Definition of TQComboBox class +** +** Created : 950426 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCOMBOBOX_H +#define TQCOMBOBOX_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_COMBOBOX + + +class TQStrList; +class TQStringList; +class TQLineEdit; +class TQValidator; +class TQListBox; +class TQComboBoxData; +class TQWheelEvent; + +class Q_EXPORT TQComboBox : public TQWidget +{ + Q_OBJECT + Q_ENUMS( Policy ) + Q_PROPERTY( bool editable READ editable WRITE setEditable ) + Q_PROPERTY( int count READ count ) + Q_PROPERTY( TQString currentText READ currentText WRITE setCurrentText DESIGNABLE false ) + Q_PROPERTY( int currentItem READ currentItem WRITE setCurrentItem ) + Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false ) + Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) + Q_PROPERTY( int maxCount READ maxCount WRITE setMaxCount ) + Q_PROPERTY( Policy insertionPolicy READ insertionPolicy WRITE setInsertionPolicy ) + Q_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion ) + Q_PROPERTY( bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled ) + Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) + +public: + TQComboBox( TQWidget* parent=0, const char* name=0 ); + TQComboBox( bool rw, TQWidget* parent=0, const char* name=0 ); + ~TQComboBox(); + + int count() const; + + void insertStringList( const TQStringList &, int index=-1 ); + void insertStrList( const TQStrList &, int index=-1 ); + void insertStrList( const TQStrList *, int index=-1 ); + void insertStrList( const char **, int numStrings=-1, int index=-1); + + void insertItem( const TQString &text, int index=-1 ); + void insertItem( const TQPixmap &pixmap, int index=-1 ); + void insertItem( const TQPixmap &pixmap, const TQString &text, int index=-1 ); + + void removeItem( int index ); + + int currentItem() const; + virtual void setCurrentItem( int index ); + + TQString currentText() const; + virtual void setCurrentText( const TQString& ); + + TQString text( int index ) const; + const TQPixmap *pixmap( int index ) const; + + void changeItem( const TQString &text, int index ); + void changeItem( const TQPixmap &pixmap, int index ); + void changeItem( const TQPixmap &pixmap, const TQString &text, int index ); + + 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 ); + Policy insertionPolicy() const; + + virtual void setValidator( const TQValidator * ); + const TQValidator * validator() const; + + virtual void setListBox( TQListBox * ); + TQListBox * listBox() const; + + virtual void setLineEdit( TQLineEdit *edit ); + TQLineEdit* lineEdit() const; + + virtual void setAutoCompletion( bool ); + bool autoCompletion() const; + + bool eventFilter( TQObject *object, TQEvent *event ); + + void setDuplicatesEnabled( bool enable ); + 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 index ); + void highlighted( int index ); + void activated( const TQString &); + void highlighted( const TQString &); + void textChanged( const TQString &); + +private slots: + void internalActivate( int ); + void internalHighlight( int ); + void internalClickTimeout(); + void returnPressed(); + +protected: + void paintEvent( TQPaintEvent * ); + void resizeEvent( TQResizeEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void keyPressEvent( TQKeyEvent *e ); + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent *e ); +#endif + void styleChange( TQStyle& ); + + void updateMask(); + +private: + void setUpListBox(); + void setUpLineEdit(); + void popDownListBox(); + void reIndex(); + void currentChanged(); + int completionIndex( const TQString &, int ) const; + + TQComboBoxData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQComboBox( const TQComboBox & ); + TQComboBox &operator=( const TQComboBox & ); +#endif +}; + + +#endif // QT_NO_COMBOBOX + +#endif // TQCOMBOBOX_H diff --git a/src/widgets/ntqdatetimeedit.h b/src/widgets/ntqdatetimeedit.h new file mode 100644 index 000000000..86b8db22b --- /dev/null +++ b/src/widgets/ntqdatetimeedit.h @@ -0,0 +1,293 @@ +/**************************************************************************** +** +** Definition of date and time edit classes +** +** Created : 001103 +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDATETIMEEDIT_H +#define TQDATETIMEEDIT_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqstring.h" +#include "ntqdatetime.h" +#endif // QT_H + +#ifndef QT_NO_DATETIMEEDIT + +class Q_EXPORT TQDateTimeEditBase : public TQWidget +{ + Q_OBJECT +public: + TQDateTimeEditBase( TQWidget* parent=0, const char* name=0 ) + : TQWidget( parent, name ) {} + + virtual bool setFocusSection( int sec ) = 0; + virtual TQString sectionFormattedText( int sec ) = 0; + virtual void addNumber( int sec, int num ) = 0; + virtual void removeLastNumber( int sec ) = 0; + +public slots: + virtual void stepUp() = 0; + virtual void stepDown() = 0; + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDateTimeEditBase( const TQDateTimeEditBase & ); + TQDateTimeEditBase &operator=( const TQDateTimeEditBase & ); +#endif +}; + +class TQDateEditPrivate; + +class Q_EXPORT TQDateEdit : public TQDateTimeEditBase +{ + Q_OBJECT + Q_ENUMS( Order ) + Q_PROPERTY( Order order READ order WRITE setOrder ) + Q_PROPERTY( TQDate date READ date WRITE setDate ) + Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance ) + Q_PROPERTY( TQDate maxValue READ maxValue WRITE setMaxValue ) + Q_PROPERTY( TQDate minValue READ minValue WRITE setMinValue ) + +public: + TQDateEdit( TQWidget* parent=0, const char* name=0 ); + TQDateEdit( const TQDate& date, TQWidget* parent=0, const char* name=0 ); + ~TQDateEdit(); + + enum Order { DMY, MDY, YMD, YDM }; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + +public slots: + virtual void setDate( const TQDate& date ); + +public: + TQDate date() const; + virtual void setOrder( Order order ); + Order order() const; + virtual void setAutoAdvance( bool advance ); + bool autoAdvance() const; + + virtual void setMinValue( const TQDate& d ) { setRange( d, maxValue() ); } + TQDate minValue() const; + virtual void setMaxValue( const TQDate& d ) { setRange( minValue(), d ); } + TQDate maxValue() const; + virtual void setRange( const TQDate& min, const TQDate& max ); + TQString separator() const; + virtual void setSeparator( const TQString& s ); + + // Make removeFirstNumber() virtual in TQDateTimeEditBase in 4.0 + void removeFirstNumber( int sec ); + +signals: + void valueChanged( const TQDate& date ); + +protected: + bool event( TQEvent *e ); + void timerEvent( TQTimerEvent * ); + void resizeEvent( TQResizeEvent * ); + void stepUp(); + void stepDown(); + TQString sectionFormattedText( int sec ); + void addNumber( int sec, int num ); + + void removeLastNumber( int sec ); + bool setFocusSection( int s ); + + virtual void setYear( int year ); + virtual void setMonth( int month ); + virtual void setDay( int day ); + virtual void fix(); + virtual bool outOfRange( int y, int m, int d ) const; + +protected slots: + void updateButtons(); + +private: + void init(); + int sectionOffsetEnd( int sec ) const; + int sectionLength( int sec ) const; + TQString sectionText( int sec ) const; + TQDateEditPrivate* d; + +#if defined(Q_DISABLE_COPY) + TQDateEdit( const TQDateEdit & ); + TQDateEdit &operator=( const TQDateEdit & ); +#endif +}; + +class TQTimeEditPrivate; + +class Q_EXPORT TQTimeEdit : public TQDateTimeEditBase +{ + Q_OBJECT + Q_SETS( Display ) + Q_PROPERTY( TQTime time READ time WRITE setTime ) + Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance ) + Q_PROPERTY( TQTime maxValue READ maxValue WRITE setMaxValue ) + Q_PROPERTY( TQTime minValue READ minValue WRITE setMinValue ) + Q_PROPERTY( Display display READ display WRITE setDisplay ) + +public: + enum Display { + Hours = 0x01, + Minutes = 0x02, + Seconds = 0x04, + /*Reserved = 0x08,*/ + AMPM = 0x10 + }; + + TQTimeEdit( TQWidget* parent=0, const char* name=0 ); + TQTimeEdit( const TQTime& time, TQWidget* parent=0, const char* name=0 ); + ~TQTimeEdit(); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + +public slots: + virtual void setTime( const TQTime& time ); + +public: + TQTime time() const; + virtual void setAutoAdvance( bool advance ); + bool autoAdvance() const; + + virtual void setMinValue( const TQTime& d ) { setRange( d, maxValue() ); } + TQTime minValue() const; + virtual void setMaxValue( const TQTime& d ) { setRange( minValue(), d ); } + TQTime maxValue() const; + virtual void setRange( const TQTime& min, const TQTime& max ); + TQString separator() const; + virtual void setSeparator( const TQString& s ); + + uint display() const; + void setDisplay( uint disp ); + + // Make removeFirstNumber() virtual in TQDateTimeEditBase in 4.0 + void removeFirstNumber( int sec ); + +signals: + void valueChanged( const TQTime& time ); + +protected: + bool event( TQEvent *e ); + void timerEvent( TQTimerEvent *e ); + void resizeEvent( TQResizeEvent * ); + void stepUp(); + void stepDown(); + TQString sectionFormattedText( int sec ); + void addNumber( int sec, int num ); + void removeLastNumber( int sec ); + bool setFocusSection( int s ); + + virtual bool outOfRange( int h, int m, int s ) const; + virtual void setHour( int h ); + virtual void setMinute( int m ); + virtual void setSecond( int s ); + +protected slots: + void updateButtons(); + +private: + void init(); + TQString sectionText( int sec ); + TQTimeEditPrivate* d; + +#if defined(Q_DISABLE_COPY) + TQTimeEdit( const TQTimeEdit & ); + TQTimeEdit &operator=( const TQTimeEdit & ); +#endif +}; + + +class TQDateTimeEditPrivate; + +class Q_EXPORT TQDateTimeEdit : public TQWidget +{ + Q_OBJECT + Q_PROPERTY( TQDateTime dateTime READ dateTime WRITE setDateTime ) + +public: + TQDateTimeEdit( TQWidget* parent=0, const char* name=0 ); + TQDateTimeEdit( const TQDateTime& datetime, TQWidget* parent=0, + const char* name=0 ); + ~TQDateTimeEdit(); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + +public slots: + virtual void setDateTime( const TQDateTime & dt ); + +public: + TQDateTime dateTime() const; + + TQDateEdit* dateEdit() { return de; } + TQTimeEdit* timeEdit() { return te; } + + virtual void setAutoAdvance( bool advance ); + bool autoAdvance() const; + +signals: + void valueChanged( const TQDateTime& datetime ); + +protected: + // ### make init() private in TQt 4.0 + void init(); + void resizeEvent( TQResizeEvent * ); + +protected slots: + // ### make these two functions private in TQt 4.0, + // and merge them into one with no parameter + void newValue( const TQDate& d ); + void newValue( const TQTime& t ); + +private: + TQDateEdit* de; + TQTimeEdit* te; + TQDateTimeEditPrivate* d; + +#if defined(Q_DISABLE_COPY) + TQDateTimeEdit( const TQDateTimeEdit & ); + TQDateTimeEdit &operator=( const TQDateTimeEdit & ); +#endif +}; + +#endif +#endif diff --git a/src/widgets/ntqdial.h b/src/widgets/ntqdial.h new file mode 100644 index 000000000..8fd34772d --- /dev/null +++ b/src/widgets/ntqdial.h @@ -0,0 +1,153 @@ +/**************************************************************************** +** +** Definition of the dial widget +** +** Created : 990104 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + + +#ifndef TQDIAL_H +#define TQDIAL_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#endif // QT_H + +#ifndef QT_NO_DIAL + +class TQDialPrivate; + +class Q_EXPORT TQDial: public TQWidget, public TQRangeControl +{ + Q_OBJECT + Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) + Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping ) + Q_PROPERTY( int notchSize READ notchSize ) + Q_PROPERTY( double notchTarget READ notchTarget WRITE setNotchTarget ) + Q_PROPERTY( bool notchesVisible READ notchesVisible WRITE setNotchesVisible ) + Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) + Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) + Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) + Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep ) + Q_PROPERTY( int value READ value WRITE setValue ) + +public: + TQDial( TQWidget* parent=0, const char* name=0, WFlags f = 0 ); + TQDial( int minValue, int maxValue, int pageStep, int value, + TQWidget* parent=0, const char* name=0 ); + ~TQDial(); + + 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 b ); + virtual void setWrapping( bool on ); + virtual void setTracking( bool enable ); + +signals: + void valueChanged( int value ); + void dialPressed(); + void dialMoved( int value ); + void dialReleased(); + +protected: + void resizeEvent( TQResizeEvent * ); + void paintEvent( TQPaintEvent * ); + + void keyPressEvent( TQKeyEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent * ); +#endif + void focusInEvent( TQFocusEvent * ); + void focusOutEvent( TQFocusEvent * ); + + void valueChange(); + void rangeChange(); + + virtual void repaintScreen( const TQRect *cr = 0 ); + +private: + TQDialPrivate * d; + + int valueFromPoint( const TQPoint & ) const; + double angle( const TQPoint &, const TQPoint & ) const; + TQPointArray calcArrow( double &a ) const; + TQRect calcDial() const; + int calcBigLineSize() const; + void calcLines(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQDial( const TQDial & ); + TQDial &operator=( const TQDial & ); +#endif + +}; + +#endif // QT_NO_DIAL + +#endif diff --git a/src/widgets/ntqdockarea.h b/src/widgets/ntqdockarea.h new file mode 100644 index 000000000..2c68842de --- /dev/null +++ b/src/widgets/ntqdockarea.h @@ -0,0 +1,191 @@ +/**************************************************************************** +** +** Definition of the TQDockArea class +** +** Created : 001010 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the workspace module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDOCKAREA_H +#define TQDOCKAREA_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqptrlist.h" +#include "ntqdockwindow.h" +#include "ntqlayout.h" +#include "ntqvaluelist.h" +#include "ntqguardedptr.h" +#include "ntqtextstream.h" +#endif // QT_H + +#ifndef QT_NO_MAINWINDOW + +class TQSplitter; +class TQBoxLayout; +class TQDockAreaLayout; +class TQMouseEvent; +class TQDockWindowResizeHandle; +class TQDockAreaPrivate; + +class Q_EXPORT TQDockAreaLayout : public TQLayout +{ + Q_OBJECT + friend class TQDockArea; + +public: + TQDockAreaLayout( TQWidget* parent, TQt::Orientation o, TQPtrList *wl, int space = -1, int margin = -1, const char *name = 0 ) + : TQLayout( parent, space, margin, name ), orient( o ), dockWindows( wl ), parentWidget( parent ) { init(); } + ~TQDockAreaLayout() {} + + void addItem( TQLayoutItem * ) {} + bool hasHeightForWidth() const; + int heightForWidth( int ) const; + int widthForHeight( int ) const; + TQSize sizeHint() const; + TQSize minimumSize() const; + TQLayoutIterator iterator(); + TQSizePolicy::ExpandData expanding() const { return TQSizePolicy::NoDirection; } + void invalidate(); + TQt::Orientation orientation() const { return orient; } + TQValueList lineList() const { return lines; } + TQPtrList lineStarts() const { return ls; } + +protected: + void setGeometry( const TQRect& ); + +private: + void init(); + int layoutItems( const TQRect&, bool testonly = FALSE ); + TQt::Orientation orient; + bool dirty; + int cached_width, cached_height; + int cached_hfw, cached_wfh; + TQPtrList *dockWindows; + TQWidget *parentWidget; + TQValueList lines; + TQPtrList ls; +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQDockAreaLayout( const TQDockAreaLayout & ); + TQDockAreaLayout &operator=( const TQDockAreaLayout & ); +#endif +}; + +class Q_EXPORT TQDockArea : public TQWidget +{ + Q_OBJECT + Q_ENUMS( HandlePosition ) + Q_PROPERTY( Orientation orientation READ orientation ) + Q_PROPERTY( int count READ count ) + Q_PROPERTY( bool empty READ isEmpty ) + Q_PROPERTY( HandlePosition handlePosition READ handlePosition ) + + friend class TQDockWindow; + friend class TQDockWindowResizeHandle; + friend class TQDockAreaLayout; + +public: + enum HandlePosition { Normal, Reverse }; + + TQDockArea( Orientation o, HandlePosition h = Normal, TQWidget* parent=0, const char* name=0 ); + ~TQDockArea(); + + void moveDockWindow( TQDockWindow *w, const TQPoint &globalPos, const TQRect &rect, bool swap ); + void removeDockWindow( TQDockWindow *w, bool makeFloating, bool swap, bool fixNewLines = TRUE ); + void moveDockWindow( TQDockWindow *w, int index = -1 ); + bool hasDockWindow( TQDockWindow *w, int *index = 0 ); + + void invalidNextOffset( TQDockWindow *dw ); + + Orientation orientation() const { return orient; } + HandlePosition handlePosition() const { return hPos; } + + bool eventFilter( TQObject *, TQEvent * ); + bool isEmpty() const; + int count() const; + TQPtrList dockWindowList() const; + + bool isDockWindowAccepted( TQDockWindow *dw ); + void setAcceptDockWindow( TQDockWindow *dw, bool accept ); + +public slots: + void lineUp( bool keepNewLines ); + +private: + struct DockWindowData + { + int index; + int offset; + int line; + TQSize fixedExtent; + TQGuardedPtr area; + }; + + int findDockWindow( TQDockWindow *w ); + int lineOf( int index ); + DockWindowData *dockWindowData( TQDockWindow *w ); + void dockWindow( TQDockWindow *dockWindow, DockWindowData *data ); + void updateLayout(); + void invalidateFixedSizes(); + int maxSpace( int hint, TQDockWindow *dw ); + void setFixedExtent( int d, TQDockWindow *dw ); + bool isLastDockWindow( TQDockWindow *dw ); + +private: + Orientation orient; + TQPtrList *dockWindows; + TQDockAreaLayout *layout; + HandlePosition hPos; + TQPtrList forbiddenWidgets; + TQDockAreaPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQDockArea( const TQDockArea & ); + TQDockArea& operator=( const TQDockArea & ); +#endif + +}; + +#ifndef QT_NO_TEXTSTREAM +Q_EXPORT TQTextStream &operator<<( TQTextStream &, const TQDockArea & ); +Q_EXPORT TQTextStream &operator>>( TQTextStream &, TQDockArea & ); +#endif + +#define Q_DEFINED_QDOCKAREA +#include "ntqwinexport.h" +#endif + +#endif //QT_NO_MAINWINDOW diff --git a/src/widgets/ntqdockwindow.h b/src/widgets/ntqdockwindow.h new file mode 100644 index 000000000..405a507d3 --- /dev/null +++ b/src/widgets/ntqdockwindow.h @@ -0,0 +1,237 @@ +/**************************************************************************** +** +** Definition of the TQDockWindow class +** +** Created : 001010 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the workspace module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDOCKWINDOW_H +#define TQDOCKWINDOW_H + +#ifndef QT_H +#include "ntqframe.h" +#endif // QT_H + +#ifndef QT_NO_MAINWINDOW + +class TQDockWindowHandle; +class TQDockWindowTitleBar; +class TQPainter; +class TQDockWindowResizeHandle; +class TQBoxLayout; +class TQHBoxLayout; +class TQVBoxLayout; +class TQDockArea; +class TQWidgetResizeHandler; +class TQMainWindow; +class TQDockAreaLayout; +class TQDockWindowPrivate; +class TQToolBar; +class TQWindowsXPStyle; + +class Q_EXPORT TQDockWindow : public TQFrame +{ + Q_OBJECT + Q_ENUMS( CloseMode Place ) + Q_PROPERTY( int closeMode READ closeMode WRITE setCloseMode ) //### this shouldn't be of type int?! + Q_PROPERTY( bool resizeEnabled READ isResizeEnabled WRITE setResizeEnabled ) + Q_PROPERTY( bool movingEnabled READ isMovingEnabled WRITE setMovingEnabled ) + Q_PROPERTY( bool horizontallyStretchable READ isHorizontallyStretchable WRITE setHorizontallyStretchable ) + Q_PROPERTY( bool verticallyStretchable READ isVerticallyStretchable WRITE setVerticallyStretchable ) + Q_PROPERTY( bool stretchable READ isStretchable ) + Q_PROPERTY( bool newLine READ newLine WRITE setNewLine ) + Q_PROPERTY( bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving ) + Q_PROPERTY( int offset READ offset WRITE setOffset ) + Q_PROPERTY( Place place READ place ) + + friend class TQDockWindowHandle; + friend class TQDockWindowTitleBar; + friend class TQDockArea; + friend class TQDockAreaLayout; + friend class TQMainWindow; + friend class TQCEMainWindow; + friend class TQToolBar; + friend class TQWindowsXPStyle; + +public: + enum Place { InDock, OutsideDock }; + enum CloseMode { Never = 0, Docked = 1, Undocked = 2, Always = Docked | Undocked }; + + TQDockWindow( Place p = InDock, TQWidget* parent=0, const char* name=0, WFlags f = 0 ); + TQDockWindow( TQWidget* parent, const char* name=0, WFlags f = 0 ); + ~TQDockWindow(); + + virtual void setWidget( TQWidget *w ); + TQWidget *widget() const; + + Place place() const { return curPlace; } + + TQDockArea *area() const; + + virtual void setCloseMode( int m ); + bool isCloseEnabled() const; + int closeMode() const; + + virtual void setResizeEnabled( bool b ); + virtual void setMovingEnabled( bool b ); + bool isResizeEnabled() const; + bool isMovingEnabled() const; + + virtual void setHorizontallyStretchable( bool b ); + virtual void setVerticallyStretchable( bool b ); + bool isHorizontallyStretchable() const; + bool isVerticallyStretchable() const; + void setHorizontalStretchable( bool b ) { setHorizontallyStretchable( b ); } + void setVerticalStretchable( bool b ) { setVerticallyStretchable( b ); } + bool isHorizontalStretchable() const { return isHorizontallyStretchable(); } + bool isVerticalStretchable() const { return isVerticallyStretchable(); } + bool isStretchable() const; + + virtual void setOffset( int o ); + int offset() const; + + virtual void setFixedExtentWidth( int w ); + virtual void setFixedExtentHeight( int h ); + TQSize fixedExtent() const; + + virtual void setNewLine( bool b ); + bool newLine() const; + + TQt::Orientation orientation() const; + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize minimumSizeHint() const; + + TQBoxLayout *boxLayout(); + + virtual void setOpaqueMoving( bool b ); + bool opaqueMoving() const; + + bool eventFilter( TQObject *o, TQEvent *e ); + +#ifdef QT_NO_WIDGET_TOPEXTRA + TQString caption() const; +#endif + +signals: + void orientationChanged( Orientation o ); + void placeChanged( TQDockWindow::Place p ); + void visibilityChanged( bool ); + +public slots: + virtual void undock( TQWidget *w ); + virtual void undock() { undock( 0 ); } + virtual void dock(); + virtual void setOrientation( Orientation o ); + void setCaption( const TQString &s ); + +protected: + void resizeEvent( TQResizeEvent *e ); + void showEvent( TQShowEvent *e ); + void hideEvent( TQHideEvent *e ); + void contextMenuEvent( TQContextMenuEvent *e ); + + void drawFrame( TQPainter * ); + void drawContents( TQPainter * ); + + bool event( TQEvent *e ); + +private slots: + void toggleVisible() { if ( !isVisible() ) show(); else hide(); } + +private: + TQDockWindow( Place p, TQWidget* parent, const char* name, WFlags f, bool toolbar ); + + void handleMove( const TQPoint &pos, const TQPoint &gp, bool drawRect ); + void updateGui(); + void updateSplitterVisibility( bool visible ); + + void startRectDraw( const TQPoint &so, bool drawRect ); + void endRectDraw( bool drawRect ); + void updatePosition( const TQPoint &globalPos ); + TQWidget *areaAt( const TQPoint &gp ); + void removeFromDock( bool fixNewLines = TRUE ); + void swapRect( TQRect &r, TQt::Orientation o, const TQPoint &offset, TQDockArea *area ); + void init(); + +private: + TQDockWindowHandle *horHandle, *verHandle; + TQDockWindowTitleBar *titleBar; + TQWidget *wid; + TQPainter *unclippedPainter; + TQDockArea *dockArea, *tmpDockArea; + TQRect currRect; + Place curPlace; + Place state; + bool resizeEnabled : 1; + bool moveEnabled : 1; + bool nl : 1; + bool opaque : 1; + bool isToolbar : 1; + bool stretchable[ 3 ]; + Orientation startOrientation; + int cMode; + TQPoint startOffset; + int offs; + TQSize fExtent; + TQDockWindowResizeHandle *hHandleTop, *hHandleBottom, *vHandleLeft, *vHandleRight; + TQVBoxLayout *hbox; + TQHBoxLayout *vbox; + TQBoxLayout *childBox; + void *dockWindowData; + TQPoint lastPos; + TQSize lastSize; + TQWidgetResizeHandler *widgetResizeHandler; + TQDockWindowPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQDockWindow( const TQDockWindow & ); + TQDockWindow& operator=( const TQDockWindow & ); +#endif +}; + +inline TQDockArea *TQDockWindow::area() const +{ + return dockArea; +} + +#define Q_DEFINED_QDOCKWINDOW +#include "ntqwinexport.h" +#endif + +#endif // TQDOCKWINDOW_H diff --git a/src/widgets/ntqframe.h b/src/widgets/ntqframe.h new file mode 100644 index 000000000..e157ea1ad --- /dev/null +++ b/src/widgets/ntqframe.h @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Definition of TQFrame widget class +** +** Created : 950201 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFRAME_H +#define TQFRAME_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_FRAME + +class Q_EXPORT TQFrame : public TQWidget +{ + Q_OBJECT + Q_ENUMS( Shape Shadow ) + Q_PROPERTY( int frameWidth READ frameWidth ) + Q_PROPERTY( TQRect contentsRect READ contentsRect ) + Q_PROPERTY( Shape frameShape READ frameShape WRITE setFrameShape ) + Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow ) + Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth ) + Q_PROPERTY( int margin READ margin WRITE setMargin ) + Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth ) + Q_PROPERTY( TQRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false ) + +public: + TQFrame( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + + int frameStyle() const; + virtual void setFrameStyle( int ); + + int frameWidth() const; + TQRect contentsRect() const; + +#ifndef Q_QDOC + bool lineShapesOk() const { return TRUE; } +#endif + + TQSize sizeHint() const; + + enum Shape { NoFrame = 0, // no frame + Box = 0x0001, // rectangular box + Panel = 0x0002, // rectangular panel + WinPanel = 0x0003, // rectangular panel (Windows) + HLine = 0x0004, // horizontal line + VLine = 0x0005, // vertical line + StyledPanel = 0x0006, // rectangular panel depending on the GUI style + PopupPanel = 0x0007, // rectangular panel depending on the GUI style + MenuBarPanel = 0x0008, + ToolBarPanel = 0x0009, + LineEditPanel = 0x000a, + TabWidgetPanel = 0x000b, + GroupBoxPanel = 0x000c, + MShape = 0x000f // mask for the shape + }; + enum Shadow { Plain = 0x0010, // plain line + Raised = 0x0020, // raised shadow effect + Sunken = 0x0030, // sunken shadow effect + MShadow = 0x00f0 }; // mask for the shadow + + 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: + void updateFrameWidth(bool=FALSE); + TQRect frect; + int fstyle; + short lwidth; + short mwidth; + short mlwidth; + short fwidth; + + void * d; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQFrame( const TQFrame & ); + TQFrame &operator=( const TQFrame & ); +#endif +}; + + +inline int TQFrame::frameStyle() const +{ return fstyle; } + +inline TQFrame::Shape TQFrame::frameShape() const +{ return (Shape) ( fstyle & MShape ); } + +inline TQFrame::Shadow TQFrame::frameShadow() const +{ return (Shadow) ( fstyle & MShadow ); } + +inline void TQFrame::setFrameShape( TQFrame::Shape s ) +{ setFrameStyle( ( fstyle & MShadow ) | s ); } + +inline void TQFrame::setFrameShadow( TQFrame::Shadow s ) +{ setFrameStyle( ( fstyle & MShape ) | s ); } + +inline int TQFrame::lineWidth() const +{ return lwidth; } + +inline int TQFrame::midLineWidth() const +{ return mlwidth; } + +inline int TQFrame::margin() const +{ return mwidth; } + +inline int TQFrame::frameWidth() const +{ return fwidth; } + + +#endif // QT_NO_FRAME + +#endif // TQFRAME_H diff --git a/src/widgets/ntqgrid.h b/src/widgets/ntqgrid.h new file mode 100644 index 000000000..d28eb6d58 --- /dev/null +++ b/src/widgets/ntqgrid.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGRID_H +#define TQGRID_H + +#ifndef QT_H +#include "ntqframe.h" +#endif // QT_H + +#ifndef QT_NO_GRID + +class TQGridLayout; + +class Q_EXPORT TQGrid : public TQFrame +{ + Q_OBJECT +public: + TQGrid( int n, TQWidget* parent=0, const char* name=0, WFlags f = 0 ); + TQGrid( int n, Orientation orient, TQWidget* parent=0, const char* name=0, + WFlags f = 0 ); + + void setSpacing( int ); + TQSize sizeHint() const; + +#ifndef QT_NO_COMPAT + typedef Orientation Direction; +#endif + +protected: + void frameChanged(); + +private: + TQGridLayout *lay; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQGrid( const TQGrid & ); + TQGrid& operator=( const TQGrid & ); +#endif +}; + +#endif // QT_NO_GRID + +#endif // TQGRID_H diff --git a/src/widgets/ntqgridview.h b/src/widgets/ntqgridview.h new file mode 100644 index 000000000..5e4cd604c --- /dev/null +++ b/src/widgets/ntqgridview.h @@ -0,0 +1,139 @@ +/********************************************************************** +** +** Definition of TQGridView class +** +** Created : 010523 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGRIDVIEW_H +#define TQGRIDVIEW_H + +#ifndef QT_H +#include "ntqscrollview.h" +#endif // QT_H + +#ifndef QT_NO_GRIDVIEW + +class TQGridViewPrivate; + +class Q_EXPORT TQGridView : public TQScrollView +{ + Q_OBJECT + Q_PROPERTY( int numRows READ numRows WRITE setNumRows ) + Q_PROPERTY( int numCols READ numCols WRITE setNumCols ) + Q_PROPERTY( int cellWidth READ cellWidth WRITE setCellWidth ) + Q_PROPERTY( int cellHeight READ cellHeight WRITE setCellHeight ) +public: + + TQGridView( TQWidget *parent=0, const char *name=0, WFlags f=0 ); + ~TQGridView(); + + 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 row, int column ); + TQSize gridSize() const; + + int rowAt( int y ) const; + int columnAt( int x ) const; + + void repaintCell( int row, int column, bool erase=TRUE ); + void updateCell( int row, int column ); + void ensureCellVisible( int row, int column ); + +protected: + virtual void paintCell( TQPainter *, int row, int col ) = 0; + virtual void paintEmptyArea( TQPainter *p, int cx, int cy, int cw, int ch ); + + void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); + + virtual void dimensionChange( int, int ); + +private: + void drawContents( TQPainter* ); + void updateGrid(); + + int nrows; + int ncols; + int cellw; + int cellh; + TQGridViewPrivate* d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQGridView( const TQGridView & ); + TQGridView &operator=( const TQGridView & ); +#endif +}; + +inline int TQGridView::cellWidth() const +{ return cellw; } + +inline int TQGridView::cellHeight() const +{ return cellh; } + +inline int TQGridView::rowAt( int y ) const +{ return y / cellh; } + +inline int TQGridView::columnAt( int x ) const +{ return x / cellw; } + +inline int TQGridView::numRows() const +{ return nrows; } + +inline int TQGridView::numCols() const +{return ncols; } + +inline TQRect TQGridView::cellRect() const +{ return TQRect( 0, 0, cellw, cellh ); } + +inline TQSize TQGridView::gridSize() const +{ return TQSize( ncols * cellw, nrows * cellh ); } + + + +#endif // QT_NO_GRIDVIEW + + +#endif // TQTABLEVIEW_H diff --git a/src/widgets/ntqgroupbox.h b/src/widgets/ntqgroupbox.h new file mode 100644 index 000000000..602788c15 --- /dev/null +++ b/src/widgets/ntqgroupbox.h @@ -0,0 +1,165 @@ +/********************************************************************** +** +** Definition of TQGroupBox widget class +** +** Created : 950203 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGROUPBOX_H +#define TQGROUPBOX_H + +#ifndef QT_H +#include "ntqframe.h" +#endif // QT_H + +#ifndef QT_NO_GROUPBOX + + +class TQAccel; +class TQGroupBoxPrivate; +class TQVBoxLayout; +class TQGridLayout; +class TQSpacerItem; + +class Q_EXPORT TQGroupBox : public TQFrame +{ + Q_OBJECT + Q_PROPERTY( TQString title READ title WRITE setTitle ) + Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) + Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false ) + Q_PROPERTY( int columns READ columns WRITE setColumns DESIGNABLE false ) + Q_PROPERTY( bool flat READ isFlat WRITE setFlat ) +#ifndef QT_NO_CHECKBOX + Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable ) + Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) +#endif +public: + TQGroupBox( TQWidget* parent=0, const char* name=0 ); + TQGroupBox( const TQString &title, + TQWidget* parent=0, const char* name=0 ); + TQGroupBox( int strips, Orientation o, + TQWidget* parent=0, const char* name=0 ); + TQGroupBox( int strips, Orientation o, const TQString &title, + TQWidget* parent=0, const char* name=0 ); + ~TQGroupBox(); + + virtual void setColumnLayout(int strips, Orientation o); + + TQString title() const { return str; } + virtual void setTitle( const TQString &); + + int alignment() const { return align; } + virtual void setAlignment( int ); + + int columns() const; + void setColumns( int ); + + Orientation orientation() const { return dir; } + void setOrientation( Orientation ); + + int insideMargin() const; + int insideSpacing() const; + void setInsideMargin( int m ); + void setInsideSpacing( int s ); + + void addSpace( int ); + TQSize sizeHint() const; + + bool isFlat() const; + void setFlat( bool b ); + bool isCheckable() const; +#ifndef QT_NO_CHECKBOX + void setCheckable( bool b ); +#endif + bool isChecked() const; + void setEnabled(bool on); + +#ifndef QT_NO_CHECKBOX +public slots: + void setChecked( bool b ); + +signals: + void toggled( bool ); +#endif +protected: + bool event( TQEvent * ); + void childEvent( TQChildEvent * ); + void resizeEvent( TQResizeEvent * ); + void paintEvent( TQPaintEvent * ); + void focusInEvent( TQFocusEvent * ); + void fontChange( const TQFont & ); + +private slots: + void fixFocus(); + void setChildrenEnabled( bool b ); + +private: + void skip(); + void init(); + void calculateFrame(); + void insertWid( TQWidget* ); + void setTextSpacer(); +#ifndef QT_NO_CHECKBOX + void updateCheckBoxGeometry(); +#endif + TQString str; + int align; + int lenvisible; +#ifndef QT_NO_ACCEL + TQAccel * accel; +#endif + TQGroupBoxPrivate * d; + + TQVBoxLayout *vbox; + TQGridLayout *grid; + int row; + int col : 30; + uint bFlat : 1; + int nRows, nCols; + Orientation dir; + int spac, marg; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQGroupBox( const TQGroupBox & ); + TQGroupBox &operator=( const TQGroupBox & ); +#endif +}; + + +#endif // QT_NO_GROUPBOX + +#endif // TQGROUPBOX_H diff --git a/src/widgets/ntqhbox.h b/src/widgets/ntqhbox.h new file mode 100644 index 000000000..3d46ee304 --- /dev/null +++ b/src/widgets/ntqhbox.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + + +#ifndef TQHBOX_H +#define TQHBOX_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_HBOX + +#include "ntqframe.h" + +class TQBoxLayout; + +class Q_EXPORT TQHBox : public TQFrame +{ + Q_OBJECT +public: + TQHBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + + void setSpacing( int ); + bool setStretchFactor( TQWidget*, int stretch ); + TQSize sizeHint() const; + +protected: + TQHBox( bool horizontal, TQWidget* parent, const char* name, WFlags f = 0 ); + void frameChanged(); + +private: + TQBoxLayout *lay; + +#if defined(Q_DISABLE_COPY) + TQHBox( const TQHBox & ); + TQHBox &operator=( const TQHBox & ); +#endif +}; + +#endif // QT_NO_HBOX + +#endif // TQHBOX_H diff --git a/src/widgets/ntqhbuttongroup.h b/src/widgets/ntqhbuttongroup.h new file mode 100644 index 000000000..1f0000897 --- /dev/null +++ b/src/widgets/ntqhbuttongroup.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Definition of TQHButtonGroup class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHBUTTONGROUP_H +#define TQHBUTTONGROUP_H + +#ifndef QT_H +#include "ntqbuttongroup.h" +#endif // QT_H + +#ifndef QT_NO_HBUTTONGROUP + +class Q_EXPORT TQHButtonGroup : public TQButtonGroup +{ + Q_OBJECT +public: + TQHButtonGroup( TQWidget* parent=0, const char* name=0 ); + TQHButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); + ~TQHButtonGroup(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQHButtonGroup( const TQHButtonGroup & ); + TQHButtonGroup &operator=( const TQHButtonGroup & ); +#endif +}; + + +#endif // QT_NO_HBUTTONGROUP + +#endif // TQHBUTTONGROUP_H diff --git a/src/widgets/ntqheader.h b/src/widgets/ntqheader.h new file mode 100644 index 000000000..4ebe46c94 --- /dev/null +++ b/src/widgets/ntqheader.h @@ -0,0 +1,219 @@ +/**************************************************************************** +** +** Definition of TQHeader widget class (table header) +** +** Created : 961105 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHEADER_H +#define TQHEADER_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqstring.h" +#include "ntqiconset.h" // conversion TQPixmap->TQIconset +#endif // QT_H + +#ifndef QT_NO_HEADER + +class TQShowEvent; +class TQHeaderData; +class TQTable; + +class Q_EXPORT TQHeader : public TQWidget +{ + friend class TQTable; + friend class TQTableHeader; + friend class TQListView; + + Q_OBJECT + Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) + Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) + Q_PROPERTY( int count READ count ) + Q_PROPERTY( int offset READ offset WRITE setOffset ) + Q_PROPERTY( bool moving READ isMovingEnabled WRITE setMovingEnabled ) + Q_PROPERTY( bool stretching READ isStretchEnabled WRITE setStretchEnabled ) + +public: + TQHeader( TQWidget* parent=0, const char* name=0 ); + TQHeader( int, TQWidget* parent=0, const char* name=0 ); + ~TQHeader(); + + int addLabel( const TQString &, int size = -1 ); + int addLabel( const TQIconSet&, const TQString &, int size = -1 ); + void removeLabel( int section ); + virtual void setLabel( int, const TQString &, int size = -1 ); + virtual void setLabel( int, const TQIconSet&, const TQString &, int size = -1 ); + TQString label( int section ) const; + TQIconSet* iconSet( int section ) const; + + virtual void setOrientation( Orientation ); + Orientation orientation() const; + virtual void setTracking( bool enable ); + bool tracking() const; + + virtual void setClickEnabled( bool, int section = -1 ); + virtual void setResizeEnabled( bool, int section = -1 ); + virtual void setMovingEnabled( bool ); + virtual void setStretchEnabled( bool b, int section ); + void setStretchEnabled( bool b ) { setStretchEnabled( b, -1 ); } + bool isClickEnabled( int section = -1 ) const; + bool isResizeEnabled( int section = -1 ) const; + bool isMovingEnabled() const; + bool isStretchEnabled() const; + bool isStretchEnabled( int section ) const; + + void resizeSection( int section, int s ); + int sectionSize( int section ) const; + int sectionPos( int section ) const; + int sectionAt( int pos ) const; + int count() const; + int headerWidth() const; + TQRect sectionRect( int section ) const; + + virtual void setCellSize( int , int ); // obsolete, do not use + int cellSize( int i ) const { return sectionSize( mapToSection(i) ); } // obsolete, do not use + int cellPos( int ) const; // obsolete, do not use + int cellAt( int pos ) const { return mapToIndex( sectionAt(pos + offset()) ); } // obsolete, do not use + + int offset() const; + + TQSize sizeHint() const; + + int mapToSection( int index ) const; + int mapToIndex( int section ) const; + int mapToLogical( int ) const; // obsolete, do not use + int mapToActual( int ) const; // obsolete, do not use + + void moveSection( int section, int toIndex ); + virtual void moveCell( int, int); // obsolete, do not use + + void setSortIndicator( int section, bool ascending = TRUE ); // obsolete, do not use + inline void setSortIndicator( int section, SortOrder order ) + { setSortIndicator( section, (order == Ascending) ); } + int sortIndicatorSection() const; + SortOrder sortIndicatorOrder() const; + + void adjustHeaderSize() { adjustHeaderSize( -1 ); } + +public slots: + void setUpdatesEnabled( bool enable ); + virtual void setOffset( int pos ); + +signals: + void clicked( int section ); + void pressed( int section ); + void released( int section ); + void sizeChange( int section, int oldSize, int newSize ); + void indexChange( int section, int fromIndex, int toIndex ); + void sectionClicked( int ); // obsolete, do not use + void moved( int, int ); // obsolete, do not use + void sectionHandleDoubleClicked( int section ); + +protected: + void paintEvent( TQPaintEvent * ); + void showEvent( TQShowEvent *e ); + void resizeEvent( TQResizeEvent *e ); + TQRect sRect( int index ); + + virtual void paintSection( TQPainter *p, int index, const TQRect& fr); + virtual void paintSectionLabel( TQPainter* p, int index, const TQRect& fr ); + + void fontChange( const TQFont & ); + + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + + void keyPressEvent( TQKeyEvent * ); + void keyReleaseEvent( TQKeyEvent * ); + +private: + void handleColumnMove( int fromIdx, int toIdx ); + void adjustHeaderSize( int diff ); + void init( int ); + + void paintRect( int p, int s ); + void markLine( int idx ); + void unMarkLine( int idx ); + int pPos( int i ) const; + int pSize( int i ) const; + int findLine( int ); + int handleAt( int p ); + bool reverse() const; + void calculatePositions( bool onlyVisible = FALSE, int start = 0 ); + void handleColumnResize(int, int, bool, bool = TRUE ); + TQSize sectionSizeHint( int section, const TQFontMetrics& fm ) const; + void setSectionSizeAndHeight( int section, int size ); + + void resizeArrays( int size ); + void setIsATableHeader( bool b ); + int offs; + int handleIdx; + int oldHIdxSize; + int moveToIdx; + enum State { Idle, Sliding, Pressed, Moving, Blocked }; + State state; + TQCOORD clickPos; + bool trackingIsOn; + int oldHandleIdx; + int cachedPos; // not used + Orientation orient; + + TQHeaderData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQHeader( const TQHeader & ); + TQHeader &operator=( const TQHeader & ); +#endif +}; + + +inline TQHeader::Orientation TQHeader::orientation() const +{ + return orient; +} + +inline void TQHeader::setTracking( bool enable ) { trackingIsOn = enable; } +inline bool TQHeader::tracking() const { return trackingIsOn; } + +extern Q_EXPORT bool qt_qheader_label_return_null_strings; // needed for professional edition + +#endif // QT_NO_HEADER + +#endif // TQHEADER_H diff --git a/src/widgets/ntqhgroupbox.h b/src/widgets/ntqhgroupbox.h new file mode 100644 index 000000000..401432ba2 --- /dev/null +++ b/src/widgets/ntqhgroupbox.h @@ -0,0 +1,67 @@ +/********************************************************************** +** +** Definition of TQHGroupBox widget class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHGROUPBOX_H +#define TQHGROUPBOX_H + +#ifndef QT_H +#include "ntqgroupbox.h" +#endif // QT_H + +#ifndef QT_NO_HGROUPBOX + +class Q_EXPORT TQHGroupBox : public TQGroupBox +{ + Q_OBJECT +public: + TQHGroupBox( TQWidget* parent=0, const char* name=0 ); + TQHGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); + ~TQHGroupBox(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQHGroupBox( const TQHGroupBox & ); + TQHGroupBox &operator=( const TQHGroupBox & ); +#endif +}; + +#endif // QT_NO_HGROUPBOX + +#endif // TQHGROUPBOX_H diff --git a/src/widgets/ntqlabel.h b/src/widgets/ntqlabel.h new file mode 100644 index 000000000..c2d6ca352 --- /dev/null +++ b/src/widgets/ntqlabel.h @@ -0,0 +1,174 @@ +/********************************************************************** +** +** Definition of TQLabel widget class +** +** Created : 941215 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLABEL_H +#define TQLABEL_H + +#ifndef QT_H +#include "ntqframe.h" +#endif // QT_H + +#ifndef QT_NO_LABEL + +class TQSimpleRichText; +class TQLabelPrivate; + +class Q_EXPORT TQLabel : public TQFrame +{ + Q_OBJECT + Q_PROPERTY( TQString text READ text WRITE setText ) + Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) + Q_PROPERTY( TQPixmap pixmap READ pixmap WRITE setPixmap ) + Q_PROPERTY( bool scaledContents READ hasScaledContents WRITE setScaledContents ) + Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) + Q_PROPERTY( int indent READ indent WRITE setIndent ) + Q_OVERRIDE( BackgroundMode backgroundMode DESIGNABLE true) + +public: + TQLabel( TQWidget *parent, const char* name=0, WFlags f=0 ); + TQLabel( const TQString &text, TQWidget *parent, const char* name=0, + WFlags f=0 ); + TQLabel( TQWidget *buddy, const TQString &, + TQWidget *parent, const char* name=0, WFlags f=0 ); + ~TQLabel(); + + TQString text() const { return ltext; } + TQPixmap *pixmap() const { return lpixmap; } +#ifndef QT_NO_PICTURE + TQPicture *picture() const { return lpicture; } +#endif +#ifndef QT_NO_MOVIE + TQMovie *movie() const; +#endif + + TextFormat textFormat() const; + void setTextFormat( TextFormat ); + + int alignment() const { return align; } + virtual void setAlignment( int ); + int indent() const { return extraMargin; } + void setIndent( int ); + + bool autoResize() const { return autoresize; } + virtual void setAutoResize( bool ); +#ifndef QT_NO_IMAGE_SMOOTHSCALE + bool hasScaledContents() const; + void setScaledContents( bool ); +#endif + TQSize sizeHint() const; + TQSize minimumSizeHint() const; +#ifndef QT_NO_ACCEL + virtual void setBuddy( TQWidget * ); + TQWidget *buddy() const; +#endif + int heightForWidth(int) const; + + void setFont( const TQFont &f ); + +public slots: + virtual void setText( const TQString &); + virtual void setPixmap( const TQPixmap & ); +#ifndef QT_NO_PICTURE + virtual void setPicture( const TQPicture & ); +#endif +#ifndef QT_NO_MOVIE + virtual void setMovie( const TQMovie & ); +#endif + virtual void setNum( int ); + virtual void setNum( double ); + void clear(); + +protected: + void drawContents( TQPainter * ); + void fontChange( const TQFont & ); + void resizeEvent( TQResizeEvent* ); + +private slots: +#ifndef QT_NO_ACCEL + void acceleratorSlot(); + void buddyDied(); +#endif +#ifndef QT_NO_MOVIE + void movieUpdated(const TQRect&); + void movieResized(const TQSize&); +#endif + +private: + void init(); + void clearContents(); + void updateLabel( TQSize oldSizeHint ); + TQSize sizeForWidth( int w ) const; + TQString ltext; + TQPixmap *lpixmap; +#ifndef QT_NO_PICTURE + TQPicture *lpicture; +#endif +#ifndef QT_NO_MOVIE + TQMovie * lmovie; +#endif +#ifndef QT_NO_ACCEL + TQWidget * lbuddy; +#endif + ushort align; + short extraMargin; + uint autoresize:1; + uint scaledcontents :1; + TextFormat textformat; +#ifndef QT_NO_RICHTEXT + TQSimpleRichText* doc; +#endif +#ifndef QT_NO_ACCEL + TQAccel * accel; +#endif + TQLabelPrivate* d; + + friend class TQTipLabel; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQLabel( const TQLabel & ); + TQLabel &operator=( const TQLabel & ); +#endif +}; + + +#endif // QT_NO_LABEL + +#endif // TQLABEL_H diff --git a/src/widgets/ntqlcdnumber.h b/src/widgets/ntqlcdnumber.h new file mode 100644 index 000000000..a936b3e1b --- /dev/null +++ b/src/widgets/ntqlcdnumber.h @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Definition of TQLCDNumber class +** +** Created : 940518 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLCDNUMBER_H +#define TQLCDNUMBER_H + +#ifndef QT_H +#include "ntqframe.h" +#include "ntqbitarray.h" +#endif // QT_H + +#ifndef QT_NO_LCDNUMBER + + +class TQLCDNumberPrivate; + +class Q_EXPORT TQLCDNumber : public TQFrame // LCD number widget +{ + Q_OBJECT + Q_ENUMS( Mode SegmentStyle ) + Q_PROPERTY( bool smallDecimalPoint READ smallDecimalPoint WRITE setSmallDecimalPoint ) + Q_PROPERTY( int numDigits READ numDigits WRITE setNumDigits ) + Q_PROPERTY( Mode mode READ mode WRITE setMode ) + Q_PROPERTY( SegmentStyle segmentStyle READ segmentStyle WRITE setSegmentStyle ) + Q_PROPERTY( double value READ value WRITE display ) + Q_PROPERTY( int intValue READ intValue WRITE display ) + +public: + TQLCDNumber( TQWidget* parent=0, const char* name=0 ); + TQLCDNumber( uint numDigits, TQWidget* parent=0, const char* name=0 ); + ~TQLCDNumber(); + + enum Mode { Hex, Dec, Oct, Bin, HEX = Hex, DEC = Dec, OCT = Oct, + BIN = Bin }; + enum SegmentStyle { Outline, Filled, Flat }; + + bool smallDecimalPoint() const; + + int numDigits() const; + virtual void setNumDigits( int nDigits ); + + bool checkOverflow( double num ) const; + bool checkOverflow( int num ) 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 &str ); + void display( int num ); + void display( double num ); + virtual void setHexMode(); + virtual void setDecMode(); + virtual void setOctMode(); + virtual void setBinMode(); + virtual void setSmallDecimalPoint( bool ); + +signals: + void overflow(); + +protected: + void drawContents( TQPainter * ); + +private: + void init(); + void internalDisplay( const TQString &); + void internalSetString( const TQString& s ); + void drawString( const TQString& s, TQPainter &, TQBitArray * = 0, + bool = TRUE ); + //void drawString( const TQString &, TQPainter &, TQBitArray * = 0 ) const; + void drawDigit( const TQPoint &, TQPainter &, int, char, + char = ' ' ); + void drawSegment( const TQPoint &, char, TQPainter &, int, bool = FALSE ); + + int ndigits; + double val; + uint base : 2; + uint smallPoint : 1; + uint fill : 1; + uint shadow : 1; + TQString digitStr; + TQBitArray points; + TQLCDNumberPrivate * d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQLCDNumber( const TQLCDNumber & ); + TQLCDNumber &operator=( const TQLCDNumber & ); +#endif +}; + +inline bool TQLCDNumber::smallDecimalPoint() const +{ return (bool)smallPoint; } + +inline int TQLCDNumber::numDigits() const +{ return ndigits; } + + +#endif // QT_NO_LCDNUMBER + +#endif // TQLCDNUMBER_H diff --git a/src/widgets/ntqlineedit.h b/src/widgets/ntqlineedit.h new file mode 100644 index 000000000..dad904b7c --- /dev/null +++ b/src/widgets/ntqlineedit.h @@ -0,0 +1,232 @@ +/********************************************************************** +** +** Definition of TQLineEdit widget class +** +** Created : 941011 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLINEEDIT_H +#define TQLINEEDIT_H + +struct TQLineEditPrivate; + +class TQValidator; +class TQPopupMenu; + +#ifndef QT_H +#include "ntqframe.h" +#include "ntqstring.h" +#endif // QT_H + +#ifndef QT_NO_LINEEDIT + +class TQTextParagraph; +class TQTextCursor; + +class Q_EXPORT TQLineEdit : public TQFrame +{ + Q_OBJECT + Q_ENUMS( EchoMode ) + Q_PROPERTY( TQString text READ text WRITE setText ) + Q_PROPERTY( int maxLength READ maxLength WRITE setMaxLength ) + Q_PROPERTY( bool frame READ frame WRITE setFrame ) + Q_PROPERTY( EchoMode echoMode READ echoMode WRITE setEchoMode ) + Q_PROPERTY( TQString displayText READ displayText ) + Q_PROPERTY( int cursorPosition READ cursorPosition WRITE setCursorPosition ) + Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) + Q_PROPERTY( bool edited READ edited WRITE setEdited DESIGNABLE false ) + Q_PROPERTY( bool modified READ isModified ) + Q_PROPERTY( bool hasMarkedText READ hasMarkedText DESIGNABLE false ) + Q_PROPERTY( bool hasSelectedText READ hasSelectedText ) + Q_PROPERTY( TQString markedText READ markedText DESIGNABLE false ) + Q_PROPERTY( TQString selectedText READ selectedText ) + Q_PROPERTY( bool dragEnabled READ dragEnabled WRITE setDragEnabled ) + Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) + Q_PROPERTY( bool undoAvailable READ isUndoAvailable ) + Q_PROPERTY( bool redoAvailable READ isRedoAvailable ) + Q_PROPERTY( TQString inputMask READ inputMask WRITE setInputMask ) + Q_PROPERTY( bool acceptableInput READ hasAcceptableInput ) + +public: + TQLineEdit( TQWidget* parent, const char* name=0 ); + TQLineEdit( const TQString &, TQWidget* parent, const char* name=0 ); + TQLineEdit( const TQString &, const TQString &, TQWidget* parent, const char* name=0 ); + ~TQLineEdit(); + + 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; + bool validateAndSet( const TQString &, int, int, int ); // obsolete + + int alignment() const; + +#ifndef QT_NO_COMPAT + void cursorLeft( bool mark, int steps = 1 ) { cursorForward( mark, -steps ); } + void cursorRight( bool mark, int steps = 1 ) { cursorForward( mark, steps ); } +#endif + void cursorForward( bool mark, int steps = 1 ); + void cursorBackward( bool mark, int steps = 1 ); + void cursorWordForward( bool mark ); + void cursorWordBackward( bool mark ); + void backspace(); + void del(); + void home( bool mark ); + void end( bool mark ); + + bool isModified() const; + void clearModified(); + + bool edited() const; // obsolete, use isModified() + void setEdited( bool ); // obsolete, use clearModified() + + bool hasSelectedText() const; + TQString selectedText() const; + int selectionStart() const; + + bool isUndoAvailable() const; + bool isRedoAvailable() const; + +#ifndef QT_NO_COMPAT + bool hasMarkedText() const { return hasSelectedText(); } + TQString markedText() const { return selectedText(); } +#endif + + bool dragEnabled() const; + + TQString inputMask() const; + void setInputMask( const TQString &inputMask ); + 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 flag ); +#ifndef QT_NO_CLIPBOARD + virtual void cut(); + virtual void copy() const; + virtual void paste(); +#endif + virtual void setDragEnabled( bool b ); + +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 * ); +#ifndef QT_NO_DRAGANDDROP + void dragEnterEvent( TQDragEnterEvent * ); + void dragMoveEvent( TQDragMoveEvent *e ); + void dragLeaveEvent( TQDragLeaveEvent *e ); + void dropEvent( TQDropEvent * ); +#endif + void contextMenuEvent( TQContextMenuEvent * ); + bool sendMouseEventToInputContext( TQMouseEvent *e ); + virtual TQPopupMenu *createPopupMenu(); + void windowActivationChange( bool ); +#ifndef QT_NO_COMPAT + void repaintArea( int, int ) { update(); } +#endif + +private slots: + void clipboardChanged(); + +public: + void setPasswordChar( TQChar c ); // internal obsolete + TQChar passwordChar() const; // obsolete internal + int characterAt( int, TQChar* ) const; // obsolete + bool getSelection( int *, int * ); // obsolete + +private: + friend struct TQLineEditPrivate; + TQLineEditPrivate * d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQLineEdit( const TQLineEdit & ); + TQLineEdit &operator=( const TQLineEdit & ); +#endif +}; + + +#endif // QT_NO_LINEEDIT + +#endif // TQLINEEDIT_H diff --git a/src/widgets/ntqlistbox.h b/src/widgets/ntqlistbox.h new file mode 100644 index 000000000..a7764791d --- /dev/null +++ b/src/widgets/ntqlistbox.h @@ -0,0 +1,435 @@ +/********************************************************************** +** +** Definition of TQListBox widget class +** +** Created : 941121 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLISTBOX_H +#define TQLISTBOX_H + +#ifndef QT_H +#include "ntqscrollview.h" +#include "ntqpixmap.h" +#endif // QT_H + +#ifndef QT_NO_LISTBOX + + +class TQListBoxPrivate; +class TQListBoxItem; +class TQString; +class TQStrList; +class TQStringList; + + +class Q_EXPORT TQListBox : public TQScrollView +{ + friend class TQListBoxItem; + friend class TQListBoxPrivate; + + Q_OBJECT + Q_ENUMS( SelectionMode LayoutMode ) + Q_PROPERTY( uint count READ count ) + Q_PROPERTY( int numItemsVisible READ numItemsVisible ) + Q_PROPERTY( int currentItem READ currentItem WRITE setCurrentItem ) + Q_PROPERTY( TQString currentText READ currentText ) + Q_PROPERTY( int topItem READ topItem WRITE setTopItem DESIGNABLE false ) + Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) + Q_PROPERTY( bool multiSelection READ isMultiSelection WRITE setMultiSelection DESIGNABLE false ) + Q_PROPERTY( LayoutMode columnMode READ columnMode WRITE setColumnMode ) + Q_PROPERTY( LayoutMode rowMode READ rowMode WRITE setRowMode ) + Q_PROPERTY( int numColumns READ numColumns ) + Q_PROPERTY( int numRows READ numRows ) + Q_PROPERTY( bool variableWidth READ variableWidth WRITE setVariableWidth ) + Q_PROPERTY( bool variableHeight READ variableHeight WRITE setVariableHeight ) + +public: + TQListBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + ~TQListBox(); + + virtual void setFont( const TQFont & ); + + uint count() const; + + void insertStringList( const TQStringList&, int index=-1 ); + void insertStrList( const TQStrList *, int index=-1 ); + void insertStrList( const TQStrList &, int index=-1 ); + void insertStrList( const char **, + int numStrings=-1, int index=-1 ); + + void insertItem( const TQListBoxItem *, int index=-1 ); + void insertItem( const TQListBoxItem *, const TQListBoxItem *after ); + void insertItem( const TQString &text, int index=-1 ); + void insertItem( const TQPixmap &pixmap, int index=-1 ); + void insertItem( const TQPixmap &pixmap, const TQString &text, int index=-1 ); + + void removeItem( int index ); + + TQString text( int index ) const; + const TQPixmap *pixmap( int index ) const; + + void changeItem( const TQListBoxItem *, int index ); + void changeItem( const TQString &text, int index ); + void changeItem( const TQPixmap &pixmap, int index ); + void changeItem( const TQPixmap &pixmap, const TQString &text, int index ); + + void takeItem( const TQListBoxItem * ); + + int numItemsVisible() const; + + int currentItem() const; + TQString currentText() const { return text(currentItem()); } + virtual void setCurrentItem( int index ); + virtual void setCurrentItem( TQListBoxItem * ); + void centerCurrentItem() { ensureCurrentVisible(); } + int topItem() const; + virtual void setTopItem( int index ); + virtual void setBottomItem( int index ); + + long maxItemWidth() const; + + enum SelectionMode { Single, Multi, Extended, NoSelection }; + virtual void setSelectionMode( SelectionMode ); + SelectionMode selectionMode() const; + + void setMultiSelection( bool multi ); + bool isMultiSelection() const; + + virtual void setSelected( TQListBoxItem *, bool ); + void setSelected( int, bool ); + bool isSelected( int ) const; + bool isSelected( const TQListBoxItem * ) const; + TQListBoxItem* selectedItem() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + TQListBoxItem *item( int index ) const; + int index( const TQListBoxItem * ) const; + TQListBoxItem *findItem( const TQString &text, ComparisonFlags compare = BeginsWith ) const; + + void triggerUpdate( bool doLayout ); + + bool itemVisible( int index ); + bool itemVisible( const TQListBoxItem * ); + + enum LayoutMode { FixedNumber, + FitToWidth, FitToHeight = FitToWidth, + Variable }; + virtual void setColumnMode( LayoutMode ); + virtual void setColumnMode( int ); + virtual void setRowMode( LayoutMode ); + 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 * ); + +#ifndef QT_NO_COMPAT + bool dragSelect() const { return TRUE; } + void setDragSelect( bool ) {} + bool autoScroll() const { return TRUE; } + void setAutoScroll( bool ) {} + bool autoScrollBar() const { return vScrollBarMode() == Auto; } + void setAutoScrollBar( bool enable ) { setVScrollBarMode( enable ? Auto : AlwaysOff ); } + bool scrollBar() const { return vScrollBarMode() != AlwaysOff; } + void setScrollBar( bool enable ) { setVScrollBarMode( enable ? AlwaysOn : AlwaysOff ); } + bool autoBottomScrollBar() const { return hScrollBarMode() == Auto; } + void setAutoBottomScrollBar( bool enable ) { setHScrollBarMode( enable ? Auto : AlwaysOff ); } + bool bottomScrollBar() const { return hScrollBarMode() != AlwaysOff; } + void setBottomScrollBar( bool enable ) { setHScrollBarMode( enable ? AlwaysOn : AlwaysOff ); } + bool smoothScrolling() const { return FALSE; } + void setSmoothScrolling( bool ) {} + bool autoUpdate() const { return TRUE; } + void setAutoUpdate( bool ) {} + void setFixedVisibleLines( int lines ) { setRowMode( lines ); } + int inSort( const TQListBoxItem * ); + int inSort( const TQString& text ); + int cellHeight( int i ) const { return itemHeight(i); } + int cellHeight() const { return itemHeight(); } + int cellWidth() const { return maxItemWidth(); } + int cellWidth(int i) const { Q_ASSERT(i==0); Q_UNUSED(i) return maxItemWidth(); } + int numCols() const { return numColumns(); } +#endif + + int itemHeight( int index = 0 ) const; + TQListBoxItem * itemAt( const TQPoint & ) const; + + TQRect itemRect( TQListBoxItem *item ) const; + + TQListBoxItem *firstItem() const; + + void sort( bool ascending = TRUE ); + +public slots: + void clear(); + virtual void ensureCurrentVisible(); + virtual void clearSelection(); + virtual void selectAll( bool select ); + virtual void invertSelection(); + +signals: + void highlighted( int index ); + void selected( int index ); + 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 *item ); + void onViewport(); + +protected: + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void contentsContextMenuEvent( TQContextMenuEvent * ); + + void keyPressEvent( TQKeyEvent *e ); + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); + void resizeEvent( TQResizeEvent * ); + void showEvent( TQShowEvent * ); + + bool eventFilter( TQObject *o, TQEvent *e ); + + void updateItem( int index ); + void updateItem( TQListBoxItem * ); + +#ifndef QT_NO_COMPAT + void updateCellWidth() { } + int totalWidth() const { return contentsWidth(); } + int totalHeight() const { return contentsHeight(); } +#endif + + virtual void paintCell( TQPainter *, int row, int col ); + + void toggleCurrentItem(); + bool isRubberSelecting() const; + + void doLayout() const; + + void windowActivationChange( bool ); + +#ifndef QT_NO_COMPAT + bool itemYPos( int index, int *yPos ) const; + int findItem( int yPos ) const { return index(itemAt(TQPoint(0,yPos)) ); } +#endif + +protected slots: + void clearInputString(); + +private slots: + void refreshSlot(); + void doAutoScroll(); + void adjustItems(); + +private: + void mousePressEventEx( TQMouseEvent * ); + void tryGeometry( int, int ) const; + int currentRow() const; + int currentColumn() const; + void updateSelection(); + void repaintSelection(); + void drawRubber(); + void doRubberSelection( const TQRect &old, const TQRect &rubber ); + void handleItemChange( TQListBoxItem *old, bool shift, bool control ); + void selectRange( TQListBoxItem *from, TQListBoxItem *to, bool invert, bool includeFirst, bool clearSel = FALSE ); + + void emitChangedSignal( bool ); + + int columnAt( int ) const; + int rowAt( int ) const; + + TQListBoxPrivate * d; + + static TQListBox * changedListBox; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQListBox( const TQListBox & ); + TQListBox &operator=( const TQListBox & ); +#endif +}; + + +class Q_EXPORT TQListBoxItem +{ +public: + TQListBoxItem( TQListBox* listbox = 0 ); + TQListBoxItem( TQListBox* listbox, TQListBoxItem *after ); + virtual ~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 { return s; } + bool isCurrent() const; + +#ifndef QT_NO_COMPAT + bool selected() const { return isSelected(); } + bool current() const { return isCurrent(); } +#endif + + TQListBox *listBox() const; + + void setSelectable( bool b ); + bool isSelectable() const; + + TQListBoxItem *next() const; + TQListBoxItem *prev() const; + + virtual int rtti() const; + static int RTTI; + +protected: + virtual void paint( TQPainter * ) = 0; + virtual void setText( const TQString &text ) { txt = text; } + void setCustomHighlighting( bool ); + +private: + TQString txt; + uint s:1; + uint dirty:1; + uint custom_highlight : 1; + int x, y; + TQListBoxItem * p, * n; + TQListBox* lbox; + friend class TQListBox; + friend class TQListBoxPrivate; + friend class TQComboBox; + friend class TQComboBoxPopupItem; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQListBoxItem( const TQListBoxItem & ); + TQListBoxItem &operator=( const TQListBoxItem & ); +#endif +}; + + +class Q_EXPORT TQListBoxText : public TQListBoxItem +{ +public: + TQListBoxText( TQListBox* listbox, const TQString & text=TQString::null ); + TQListBoxText( const TQString & text=TQString::null ); + TQListBoxText( TQListBox* listbox, const TQString & text, TQListBoxItem *after ); + ~TQListBoxText(); + + int height( const TQListBox * ) const; + int width( const TQListBox * ) const; + + int rtti() const; + static int RTTI; + +protected: + void paint( TQPainter * ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQListBoxText( const TQListBoxText & ); + TQListBoxText &operator=( const TQListBoxText & ); +#endif +}; + + +class Q_EXPORT TQListBoxPixmap : public TQListBoxItem +{ +public: + TQListBoxPixmap( TQListBox* listbox, const TQPixmap & ); + TQListBoxPixmap( const TQPixmap & ); + TQListBoxPixmap( TQListBox* listbox, const TQPixmap & pix, TQListBoxItem *after ); + TQListBoxPixmap( TQListBox* listbox, const TQPixmap &, const TQString& ); + TQListBoxPixmap( const TQPixmap &, const TQString& ); + TQListBoxPixmap( TQListBox* listbox, const TQPixmap & pix, const TQString&, TQListBoxItem *after ); + ~TQListBoxPixmap(); + + const TQPixmap *pixmap() const { return ± } + + int height( const TQListBox * ) const; + int width( const TQListBox * ) const; + + int rtti() const; + static int RTTI; + +protected: + void paint( TQPainter * ); + +private: + TQPixmap pm; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQListBoxPixmap( const TQListBoxPixmap & ); + TQListBoxPixmap &operator=( const TQListBoxPixmap & ); +#endif +}; + + +#endif // QT_NO_LISTBOX + +#endif // TQLISTBOX_H diff --git a/src/widgets/ntqlistview.h b/src/widgets/ntqlistview.h new file mode 100644 index 000000000..61efac96f --- /dev/null +++ b/src/widgets/ntqlistview.h @@ -0,0 +1,605 @@ +/**************************************************************************** +** +** Definition of TQListView widget class +** +** Created : 970809 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQLISTVIEW_H +#define TQLISTVIEW_H + +#ifndef QT_H +#include "ntqscrollview.h" +#endif // QT_H + +#ifndef QT_NO_LISTVIEW + + +class TQPixmap; +class TQFont; +class TQHeader; +class TQIconSet; + +class TQListView; +struct TQListViewPrivate; +struct TQCheckListItemPrivate; +class TQListViewItemIterator; +struct TQListViewItemIteratorPrivate; +class TQDragObject; +class TQMimeSource; +class TQLineEdit; +class TQListViewToolTip; + +class Q_EXPORT TQListViewItem : public TQt +{ + friend class TQListViewItemIterator; + friend class TQListViewToolTip; + +public: + TQListViewItem( TQListView * parent ); + TQListViewItem( TQListViewItem * parent ); + TQListViewItem( TQListView * parent, TQListViewItem * after ); + TQListViewItem( TQListViewItem * parent, TQListViewItem * after ); + + TQListViewItem( TQListView * parent, + TQString, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null ); + TQListViewItem( TQListViewItem * parent, + TQString, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null ); + + TQListViewItem( TQListView * parent, TQListViewItem * after, + TQString, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null ); + TQListViewItem( TQListViewItem * parent, TQListViewItem * after, + TQString, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null, + TQString = TQString::null, TQString = TQString::null ); + virtual ~TQListViewItem(); + + virtual void insertItem( TQListViewItem * ); + virtual void takeItem( TQListViewItem * ); + virtual void removeItem( TQListViewItem *item ) { takeItem( item ); } //obsolete, use takeItem instead + + int height() const; + virtual void invalidateHeight(); + int totalHeight() const; + virtual int width( const TQFontMetrics&, + const TQListView*, int column) const; + void widthChanged(int column=-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 *i, int col, bool ) const; + virtual void sortChildItems( int, bool ); + + int childCount() const { return nChildren; } + + bool isOpen() const { return open; } + virtual void setOpen( bool ); + virtual void setup(); + + virtual void setSelected( bool ); + bool isSelected() const { return selected; } + + virtual void paintCell( TQPainter *, const TQColorGroup & cg, + int column, int width, int alignment ); + virtual void paintBranches( TQPainter * p, const TQColorGroup & cg, + int w, int y, int h ); + virtual void paintFocus( TQPainter *, const TQColorGroup & cg, + const TQRect & r ); + + TQListViewItem * firstChild() const; + TQListViewItem * nextSibling() const { return siblingItem; } + TQListViewItem * parent() const; + + TQListViewItem * itemAbove(); + TQListViewItem * itemBelow(); + + int itemPos() const; + + TQListView *listView() const; + + virtual void setSelectable( bool enable ); + bool isSelectable() const { return selectable && enabled; } + + virtual void setExpandable( bool ); + bool isExpandable() const { return expandable; } + + void repaint() const; + + virtual void sort(); + void moveItem( TQListViewItem *after ); + + virtual void setDragEnabled( bool allow ); + virtual void setDropEnabled( bool allow ); + bool dragEnabled() const; + bool dropEnabled() const; + virtual bool acceptDrop( const TQMimeSource *mime ) const; + + void setVisible( bool b ); + bool isVisible() const; + + virtual void setRenameEnabled( int col, bool b ); + bool renameEnabled( int col ) const; + virtual void startRename( int col ); + + virtual void setEnabled( bool b ); + bool isEnabled() const; + + virtual int rtti() const; + // ### TQt 4: make const or better use an enum + static int RTTI; + + virtual void setMultiLinesEnabled( bool b ); + bool multiLinesEnabled() const; + +protected: + virtual void enforceSortOrder() const; + virtual void setHeight( int ); + virtual void activate(); + + bool activatedPos( TQPoint & ); +#ifndef QT_NO_DRAGANDDROP + virtual void dropped( TQDropEvent *e ); +#endif + virtual void dragEntered(); + virtual void dragLeft(); + virtual void okRename( int col ); + virtual void cancelRename( int col ); + + void ignoreDoubleClick(); + +private: + void init(); + void moveToJustAfter( TQListViewItem * ); + void enforceSortOrderBackToRoot(); + void removeRenameBox(); + + int ownHeight; + int maybeTotalHeight; + int nChildren; + + uint lsc: 14; + uint lso: 1; + uint open : 1; + uint selected : 1; + uint selectable: 1; + uint configured: 1; + uint expandable: 1; + uint is_root: 1; + uint allow_drag : 1; + uint allow_drop : 1; + uint visible : 1; + uint enabled : 1; + uint mlenabled : 1; + + TQListViewItem * parentItem; + TQListViewItem * siblingItem; + TQListViewItem * childItem; + TQLineEdit *renameBox; + int renameCol; + + void * columns; + + friend class TQListView; +}; + +class TQCheckListItem; + +class Q_EXPORT TQListView: public TQScrollView +{ + friend class TQListViewItemIterator; + friend class TQListViewItem; + friend class TQCheckListItem; + friend class TQListViewToolTip; + + Q_OBJECT + Q_ENUMS( SelectionMode ResizeMode RenameAction ) + Q_PROPERTY( int columns READ columns ) + Q_PROPERTY( bool multiSelection READ isMultiSelection WRITE setMultiSelection DESIGNABLE false ) + Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) + Q_PROPERTY( int childCount READ childCount ) + Q_PROPERTY( bool allColumnsShowFocus READ allColumnsShowFocus WRITE setAllColumnsShowFocus ) + Q_PROPERTY( bool showSortIndicator READ showSortIndicator WRITE setShowSortIndicator ) + Q_PROPERTY( int itemMargin READ itemMargin WRITE setItemMargin ) + Q_PROPERTY( bool rootIsDecorated READ rootIsDecorated WRITE setRootIsDecorated ) + Q_PROPERTY( bool showToolTips READ showToolTips WRITE setShowToolTips ) + Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode ) + Q_PROPERTY( int treeStepSize READ treeStepSize WRITE setTreeStepSize ) + Q_PROPERTY( RenameAction defaultRenameAction READ defaultRenameAction WRITE setDefaultRenameAction ) + +public: + TQListView( TQWidget* parent=0, const char* name=0, WFlags f = 0 ); + ~TQListView(); + + int treeStepSize() const; + virtual void setTreeStepSize( int ); + + virtual void insertItem( TQListViewItem * ); + virtual void takeItem( TQListViewItem * ); + virtual void removeItem( TQListViewItem *item ) { takeItem( item ); } // obsolete, use takeItem instead + + TQHeader * header() const; + + virtual int addColumn( const TQString &label, int size = -1); + virtual int addColumn( const TQIconSet& iconset, const TQString &label, int size = -1); + virtual void removeColumn( int index ); + virtual void setColumnText( int column, const TQString &label ); + virtual void setColumnText( int column, const TQIconSet& iconset, const TQString &label ); + TQString columnText( int column ) const; + virtual void setColumnWidth( int column, int width ); + int columnWidth( int column ) const; + enum WidthMode { Manual, Maximum }; + virtual void setColumnWidthMode( int column, WidthMode ); + WidthMode columnWidthMode( int column ) const; + int columns() const; + + virtual void setColumnAlignment( int, int ); + int columnAlignment( int ) const; + + void show(); + + TQListViewItem * itemAt( const TQPoint & screenPos ) const; + TQRect itemRect( const TQListViewItem * ) const; + int itemPos( const TQListViewItem * ); + + void ensureItemVisible( const TQListViewItem * ); + + void repaintItem( const TQListViewItem * ) const; + + virtual void setMultiSelection( bool enable ); + bool isMultiSelection() const; + + enum SelectionMode { Single, Multi, Extended, NoSelection }; + void setSelectionMode( SelectionMode mode ); + SelectionMode selectionMode() const; + + virtual void clearSelection(); + virtual void setSelected( TQListViewItem *, bool ); + void setSelectionAnchor( TQListViewItem * ); + bool isSelected( const TQListViewItem * ) const; + TQListViewItem * selectedItem() const; + virtual void setOpen( TQListViewItem *, bool ); + bool isOpen( const 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 column, bool ascending = TRUE ); + int sortColumn() const; + void setSortColumn( int column ); + SortOrder sortOrder() const; + void setSortOrder( SortOrder order ); + virtual void sort(); + + virtual void setFont( const TQFont & ); + virtual void setPalette( const TQPalette & ); + + bool eventFilter( TQObject * o, TQEvent * ); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + virtual void setShowSortIndicator( bool show ); + bool showSortIndicator() const; + virtual void setShowToolTips( bool b ); + bool showToolTips() const; + + enum ResizeMode { NoColumn, AllColumns, LastColumn }; + virtual void setResizeMode( ResizeMode m ); + ResizeMode resizeMode() const; + + TQListViewItem * findItem( const TQString& text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const; + + enum RenameAction { Accept, Reject }; + virtual void setDefaultRenameAction( RenameAction a ); + RenameAction defaultRenameAction() const; + bool isRenaming() const; + + void hideColumn( int column ); + +public slots: + virtual void clear(); + virtual void invertSelection(); + virtual void selectAll( bool select ); + void triggerUpdate(); + void setContentsPos( int x, int y ); + void adjustColumn( int col ); + +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 *item ); + void onViewport(); + + void expanded( TQListViewItem *item ); + void collapsed( TQListViewItem *item ); +#ifndef QT_NO_DRAGANDDROP + void dropped( TQDropEvent *e ); +#endif + void itemRenamed( TQListViewItem *item, int col, const TQString & ); + void itemRenamed( TQListViewItem *item, int col ); + +protected: + void contentsMousePressEvent( TQMouseEvent * e ); + void contentsMouseReleaseEvent( TQMouseEvent * e ); + void contentsMouseMoveEvent( TQMouseEvent * e ); + void contentsMouseDoubleClickEvent( TQMouseEvent * e ); + void contentsContextMenuEvent( TQContextMenuEvent * e ); +#ifndef QT_NO_DRAGANDDROP + void contentsDragEnterEvent( TQDragEnterEvent *e ); + void contentsDragMoveEvent( TQDragMoveEvent *e ); + void contentsDragLeaveEvent( TQDragLeaveEvent *e ); + void contentsDropEvent( TQDropEvent *e ); + virtual TQDragObject *dragObject(); + virtual void startDrag(); +#endif + + void focusInEvent( TQFocusEvent * e ); + void focusOutEvent( TQFocusEvent * e ); + + void keyPressEvent( TQKeyEvent *e ); + + void resizeEvent( TQResizeEvent *e ); + void viewportResizeEvent( TQResizeEvent *e ); + + void showEvent( TQShowEvent * ); + + void drawContentsOffset( TQPainter *, int ox, int oy, + int cx, int cy, int cw, int ch ); + + virtual void paintEmptyArea( TQPainter *, const TQRect & ); + void styleChange( TQStyle& ); + void windowActivationChange( bool ); + +protected slots: + void updateContents(); + void doAutoScroll(); + +private slots: + void changeSortColumn( int ); + void handleIndexChange(); + void updateDirtyItems(); + void makeVisible(); + void handleSizeChange( int, int, int ); + void startRename(); + void openFocusItem(); + +private: + void contentsMousePressEventEx( TQMouseEvent * e ); + void contentsMouseReleaseEventEx( TQMouseEvent * e ); + void init(); + void updateGeometries(); + void buildDrawableList() const; + void reconfigureItems(); + void widthChanged(const TQListViewItem*, int c); + void handleItemChange( TQListViewItem *old, bool shift, bool control ); + void selectRange( TQListViewItem *from, TQListViewItem *to, bool invert, bool includeFirst, bool clearSel = FALSE ); + bool selectRange( TQListViewItem *newItem, TQListViewItem *oldItem, TQListViewItem *anchorItem ); + bool clearRange( TQListViewItem *from, TQListViewItem *to, bool includeFirst = TRUE ); + void doAutoScroll( const TQPoint &cursorPos ); + + TQListViewPrivate * d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQListView( const TQListView & ); + TQListView &operator=( const TQListView & ); +#endif +}; + + +class Q_EXPORT TQCheckListItem : public TQListViewItem +{ +public: + enum Type { RadioButton, + CheckBox, + Controller, + RadioButtonController=Controller, + CheckBoxController }; + // ### should be integrated with qbutton in ver4 perhaps + enum ToggleState { Off, NoChange, On }; + + TQCheckListItem( TQCheckListItem *parent, const TQString &text, + Type = RadioButtonController ); + TQCheckListItem( TQCheckListItem *parent, TQListViewItem *after, + const TQString &text, Type = RadioButtonController ); + TQCheckListItem( TQListViewItem *parent, const TQString &text, + Type = RadioButtonController ); + TQCheckListItem( TQListViewItem *parent, TQListViewItem *after, + const TQString &text, Type = RadioButtonController ); + TQCheckListItem( TQListView *parent, const TQString &text, + Type = RadioButtonController ); + TQCheckListItem( TQListView *parent, TQListViewItem *after, + const TQString &text, Type = RadioButtonController ); + TQCheckListItem( TQListViewItem *parent, const TQString &text, + const TQPixmap & ); + TQCheckListItem( TQListView *parent, const TQString &text, + const TQPixmap & ); + ~TQCheckListItem(); + + void paintCell( TQPainter *, const TQColorGroup & cg, + int column, int width, int alignment ); + virtual void paintFocus( TQPainter *, const TQColorGroup & cg, + const TQRect & r ); + int width( const TQFontMetrics&, const TQListView*, int column) const; + void setup(); + + virtual void setOn( bool ); // ### should be replaced by setChecked in ver4 + bool isOn() const { return on; } + Type type() const { return myType; } + TQString text() const { return TQListViewItem::text( 0 ); } + TQString text( int n ) const { return TQListViewItem::text( n ); } + + void setTristate( bool ); + bool isTristate() const; + ToggleState state() const; + void setState( ToggleState s); + + int rtti() const; + static int RTTI; + +protected: + void activate(); + void turnOffChild(); + virtual void stateChange( bool ); + +private: + void init(); + ToggleState internalState() const; + void setStoredState( ToggleState newState, void *key ); + ToggleState storedState( void *key ) const; + void stateChange( ToggleState s ); + void restoreState( void *key, int depth = 0 ); + void updateController( bool update = TRUE , bool store = FALSE ); + void updateStoredState( void *key ); + void setState( ToggleState s, bool update, bool store ); + void setCurrentState( ToggleState s ); + + Type myType; + bool on; // ### remove in ver4 + TQCheckListItemPrivate *d; +}; + +class Q_EXPORT TQListViewItemIterator +{ + friend struct TQListViewPrivate; + friend class TQListView; + friend class TQListViewItem; + +public: + enum IteratorFlag { + Visible = 0x00000001, + Invisible = 0x00000002, + Selected = 0x00000004, + Unselected = 0x00000008, + Selectable = 0x00000010, + NotSelectable = 0x00000020, + DragEnabled = 0x00000040, + DragDisabled = 0x00000080, + DropEnabled = 0x00000100, + DropDisabled = 0x00000200, + Expandable = 0x00000400, + NotExpandable = 0x00000800, + Checked = 0x00001000, + NotChecked = 0x00002000 + }; + + TQListViewItemIterator(); + TQListViewItemIterator( TQListViewItem *item ); + TQListViewItemIterator( TQListViewItem *item, int iteratorFlags ); + + TQListViewItemIterator( const TQListViewItemIterator &it ); + TQListViewItemIterator( TQListView *lv ); + TQListViewItemIterator( TQListView *lv, int iteratorFlags ); + + TQListViewItemIterator &operator=( const TQListViewItemIterator &it ); + + ~TQListViewItemIterator(); + + TQListViewItemIterator &operator++(); + const TQListViewItemIterator operator++( int ); + TQListViewItemIterator &operator+=( int j ); + + TQListViewItemIterator &operator--(); + const TQListViewItemIterator operator--( int ); + TQListViewItemIterator &operator-=( int j ); + + TQListViewItem* operator*(); + TQListViewItem *current() const; + +protected: + TQListViewItem *curr; + TQListView *listView; + +private: + TQListViewItemIteratorPrivate* d() const; + void init( int flags ); + void addToListView(); + void currentRemoved(); + bool matchesFlags( const TQListViewItem* ) const; + bool testPair( TQListViewItemIterator::IteratorFlag, TQListViewItemIterator::IteratorFlag, bool ) const; + bool isChecked( const TQListViewItem* ) const; +}; + +#endif // QT_NO_LISTVIEW + +#endif // TQLISTVIEW_H diff --git a/src/widgets/ntqmainwindow.h b/src/widgets/ntqmainwindow.h new file mode 100644 index 000000000..14ec3b5e4 --- /dev/null +++ b/src/widgets/ntqmainwindow.h @@ -0,0 +1,261 @@ +/**************************************************************************** +** +** Definition of TQMainWindow class +** +** Created : 980316 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMAINWINDOW_H +#define TQMAINWINDOW_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqtoolbar.h" +#include "ntqptrlist.h" +#include "ntqtextstream.h" +#endif // QT_H + +#ifndef QT_NO_MAINWINDOW + +class TQMenuBar; +class TQStatusBar; +class TQToolTipGroup; +class TQMainWindowPrivate; +class TQMainWindowLayout; +class TQPopupMenu; + +class Q_EXPORT TQMainWindow: public TQWidget +{ + Q_OBJECT + Q_PROPERTY( bool rightJustification READ rightJustification WRITE setRightJustification DESIGNABLE false ) + Q_PROPERTY( bool usesBigPixmaps READ usesBigPixmaps WRITE setUsesBigPixmaps ) + Q_PROPERTY( bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel ) + Q_PROPERTY( bool dockWindowsMovable READ dockWindowsMovable WRITE setDockWindowsMovable ) + Q_PROPERTY( bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving ) + +public: + TQMainWindow( TQWidget* parent=0, const char* name=0, WFlags f = WType_TopLevel ); + ~TQMainWindow(); + +#ifndef QT_NO_MENUBAR + TQMenuBar * menuBar() const; +#endif + TQStatusBar * statusBar() const; +#ifndef QT_NO_TOOLTIP + TQToolTipGroup * toolTipGroup() const; +#endif + + virtual void setCentralWidget( TQWidget * ); + TQWidget * centralWidget() const; + + virtual void setDockEnabled( Dock dock, bool enable ); + bool isDockEnabled( Dock dock ) const; + bool isDockEnabled( TQDockArea *area ) const; + virtual void setDockEnabled( TQDockWindow *tb, Dock dock, bool enable ); + bool isDockEnabled( TQDockWindow *tb, Dock dock ) const; + bool isDockEnabled( TQDockWindow *tb, TQDockArea *area ) const; + + virtual void addDockWindow( TQDockWindow *, Dock = DockTop, bool newLine = FALSE ); + virtual void addDockWindow( TQDockWindow *, const TQString &label, + Dock = DockTop, bool newLine = FALSE ); + virtual void moveDockWindow( TQDockWindow *, Dock = DockTop ); + virtual void moveDockWindow( TQDockWindow *, Dock, bool nl, int index, int extraOffset = -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 *tb, Dock &dock, int &index, bool &nl, int &extraOffset ) const; + + TQPtrList dockWindows( Dock dock ) const; + TQPtrList dockWindows() const; + void lineUpDockWindows( bool keepNewLines = FALSE ); + + bool isDockMenuEnabled() const; + + // compatibility stuff + bool hasDockWindow( TQDockWindow *dw ); +#ifndef QT_NO_TOOLBAR + void addToolBar( TQDockWindow *, Dock = DockTop, bool newLine = FALSE ); + void addToolBar( TQDockWindow *, const TQString &label, + Dock = DockTop, bool newLine = FALSE ); + void moveToolBar( TQDockWindow *, Dock = DockTop ); + void moveToolBar( TQDockWindow *, Dock, bool nl, int index, int extraOffset = -1 ); + void removeToolBar( TQDockWindow * ); + + bool toolBarsMovable() const; + TQPtrList toolBars( Dock dock ) const; + void lineUpToolBars( bool keepNewLines = FALSE ); +#endif + + virtual TQDockArea *dockingArea( const TQPoint &p ); + TQDockArea *leftDock() const; + TQDockArea *rightDock() const; + TQDockArea *topDock() const; + TQDockArea *bottomDock() const; + + virtual bool isCustomizable() const; + + bool appropriate( TQDockWindow *dw ) const; + + enum DockWindows { OnlyToolBars, NoToolBars, AllDockWindows }; + TQPopupMenu *createDockWindowMenu( DockWindows 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 *dw, bool a ); + virtual void customize(); + + // compatibility stuff + void setToolBarsMovable( bool ); + +signals: + void pixmapSizeChanged( bool ); + void usesTextLabelChanged( bool ); + void dockWindowPositionChanged( TQDockWindow * ); + +#ifndef QT_NO_TOOLBAR + // compatibility stuff + void toolBarPositionChanged( TQToolBar * ); +#endif + +protected slots: + virtual void setUpLayout(); + virtual bool showDockMenu( const TQPoint &globalPos ); + void menuAboutToShow(); + +protected: + void paintEvent( TQPaintEvent * ); + void childEvent( TQChildEvent * ); + bool event( TQEvent * ); + void styleChange( TQStyle& ); + +private slots: + void slotPlaceChanged(); + void doLineUp() { lineUpDockWindows( TRUE ); } + +private: + TQMainWindowPrivate * d; + void triggerLayout( bool deleteLayout = TRUE); + bool dockMainWindow( TQObject *dock ); + +#ifndef QT_NO_MENUBAR + virtual void setMenuBar( TQMenuBar * ); +#endif + virtual void setStatusBar( TQStatusBar * ); +#ifndef QT_NO_TOOLTIP + virtual void setToolTipGroup( TQToolTipGroup * ); +#endif + + friend class TQDockWindow; + friend class TQMenuBar; + friend class TQHideDock; + friend class TQToolBar; + friend class TQMainWindowLayout; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMainWindow( const TQMainWindow & ); + TQMainWindow& operator=( const TQMainWindow & ); +#endif +}; + +#ifndef QT_NO_TOOLBAR +inline void TQMainWindow::addToolBar( TQDockWindow *w, ToolBarDock dock, bool newLine ) +{ + addDockWindow( w, dock, newLine ); +} + +inline void TQMainWindow::addToolBar( TQDockWindow *w, const TQString &label, + ToolBarDock dock, bool newLine ) +{ + addDockWindow( w, label, dock, newLine ); +} + +inline void TQMainWindow::moveToolBar( TQDockWindow *w, ToolBarDock dock ) +{ + moveDockWindow( w, dock ); +} + +inline void TQMainWindow::moveToolBar( TQDockWindow *w, ToolBarDock dock, bool nl, int index, int extraOffset ) +{ + moveDockWindow( w, dock, nl, index, extraOffset ); +} + +inline void TQMainWindow::removeToolBar( TQDockWindow *w ) +{ + removeDockWindow( w ); +} + +inline bool TQMainWindow::toolBarsMovable() const +{ + return dockWindowsMovable(); +} + +inline void TQMainWindow::lineUpToolBars( bool keepNewLines ) +{ + lineUpDockWindows( keepNewLines ); +} + +inline void TQMainWindow::setToolBarsMovable( bool b ) +{ + setDockWindowsMovable( b ); +} +#endif + +#ifndef QT_NO_TEXTSTREAM +Q_EXPORT TQTextStream &operator<<( TQTextStream &, const TQMainWindow & ); +Q_EXPORT TQTextStream &operator>>( TQTextStream &, TQMainWindow & ); +#endif + +#endif // QT_NO_MAINWINDOW + +#endif // TQMAINWINDOW_H diff --git a/src/widgets/ntqmenubar.h b/src/widgets/ntqmenubar.h new file mode 100644 index 000000000..ae2be8d1e --- /dev/null +++ b/src/widgets/ntqmenubar.h @@ -0,0 +1,205 @@ +/**************************************************************************** +** +** Definition of TQMenuBar class +** +** Created : 941209 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMENUBAR_H +#define TQMENUBAR_H + +#ifndef QT_H +#include "ntqpopupmenu.h" // ### remove or keep for users' convenience? +#include "ntqframe.h" +#include "ntqmenudata.h" +#endif // QT_H + +#ifndef QT_NO_MENUBAR + +class TQPopupMenu; + +class Q_EXPORT TQMenuBar : public TQFrame, public TQMenuData +{ + Q_OBJECT + Q_ENUMS( Separator ) + Q_PROPERTY( Separator separator READ separator WRITE setSeparator DESIGNABLE false ) + Q_PROPERTY( bool defaultUp READ isDefaultUp WRITE setDefaultUp ) + +public: + TQMenuBar( TQWidget* parent=0, const char* name=0 ); + ~TQMenuBar(); + + void updateItem( int id ); + + void show(); // reimplemented show + void hide(); // reimplemented hide + + bool eventFilter( TQObject *, TQEvent * ); + + int heightForWidth(int) const; + + enum Separator { Never=0, InWindowsStyle=1 }; + Separator separator() const; + virtual void setSeparator( Separator when ); + + void setDefaultUp( bool ); + bool isDefaultUp() const; + + bool customWhatsThis() const; + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize minimumSizeHint() const; + + void activateItemAt( int index ); + +#if defined(Q_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE) + static void initialize(); + static void cleanup(); +#endif + +signals: + void activated( int itemId ); + void highlighted( int itemId ); + +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 item ); + +private slots: + void subActivated( int itemId ); + void subHighlighted( int itemId ); +#ifndef QT_NO_ACCEL + void accelActivated( int itemId ); + void accelDestroyed(); +#endif + void popupDestroyed( TQObject* ); + void performDelayedChanges(); + + void languageChange(); + +private: + void performDelayedContentsChanged(); + void performDelayedStateChanged(); + void menuInsPopup( TQPopupMenu * ); + void menuDelPopup( TQPopupMenu * ); + void frameChanged(); + + bool tryMouseEvent( TQPopupMenu *, TQMouseEvent * ); + void tryKeyEvent( TQPopupMenu *, TQKeyEvent * ); + void goodbye( bool cancelled = FALSE ); + void openActPopup(); + + void setActiveItem( int index, bool show = TRUE, bool activate_first_item = TRUE ); + void setAltMode( bool ); + + int calculateRects( int max_width = -1 ); + +#ifndef QT_NO_ACCEL + void setupAccelerators(); + TQAccel *autoaccel; +#endif + TQRect *irects; + int rightSide; + + uint mseparator : 1; + uint waitforalt : 1; + uint popupvisible : 1; + uint hasmouse : 1; + uint defaultup : 1; + uint toggleclose : 1; + uint pendingDelayedContentsChanges : 1; + uint pendingDelayedStateChanges : 1; + + friend class TQPopupMenu; + +#if defined(Q_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE) + friend class TQWidget; + friend class TQApplication; + friend void qt_mac_set_modal_state(bool, TQMenuBar *); + + void macCreateNativeMenubar(); + void macRemoveNativeMenubar(); + void macDirtyNativeMenubar(); + +#if !defined(TQMAC_QMENUBAR_NO_EVENT) + static void qt_mac_install_menubar_event(MenuRef); + static OSStatus qt_mac_menubar_event(EventHandlerCallRef, EventRef, void *); +#endif + virtual void macWidgetChangedWindow(); + bool syncPopups(MenuRef ret, TQPopupMenu *d); + MenuRef createMacPopup(TQPopupMenu *d, int id, bool =FALSE); + bool updateMenuBar(); +#if !defined(TQMAC_QMENUBAR_NO_MERGE) + uint isCommand(TQMenuItem *, bool just_check=FALSE); +#endif + + uint mac_eaten_menubar : 1; + class MacPrivate; + MacPrivate *mac_d; + static bool activate(MenuRef, short, bool highlight=FALSE, bool by_accel=FALSE); + static bool activateCommand(uint cmd); + static bool macUpdateMenuBar(); + static bool macUpdatePopupVisible(MenuRef, bool); + static bool macUpdatePopup(MenuRef); +#endif + +private: // Disabled copy constructor and operator= + +#if defined(Q_DISABLE_COPY) + TQMenuBar( const TQMenuBar & ); + TQMenuBar &operator=( const TQMenuBar & ); +#endif +}; + + +#endif // QT_NO_MENUBAR + +#endif // TQMENUBAR_H diff --git a/src/widgets/ntqmenudata.h b/src/widgets/ntqmenudata.h new file mode 100644 index 000000000..fa6d860ee --- /dev/null +++ b/src/widgets/ntqmenudata.h @@ -0,0 +1,286 @@ +/**************************************************************************** +** +** Definition of TQMenuData class +** +** Created : 941128 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMENUDATA_H +#define TQMENUDATA_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqiconset.h" // conversion TQPixmap->TQIconset +#include "ntqkeysequence.h" +#include "ntqstring.h" +#include "ntqsignal.h" +#include "ntqfont.h" +#endif // QT_H + +#ifndef QT_NO_MENUDATA + +class TQPopupMenu; +class TQMenuDataData; +class TQObject; + +class TQCustomMenuItem; +class TQMenuItemData; + +class Q_EXPORT TQMenuItem // internal menu item class +{ +friend class TQMenuData; +public: + TQMenuItem(); + ~TQMenuItem(); + + int id() const { return ident; } + TQIconSet *iconSet() const { return iconset_data; } + TQString text() const { return text_data; } + TQString whatsThis() const { return whatsthis_data; } + TQPixmap *pixmap() const { return pixmap_data; } + TQPopupMenu *popup() const { return popup_menu; } + TQWidget *widget() const { return widget_item; } + TQCustomMenuItem *custom() const; +#ifndef QT_NO_ACCEL + TQKeySequence key() const { return accel_key; } +#endif + TQSignal *signal() const { return signal_data; } + bool isSeparator() const { return is_separator; } + bool isEnabled() const { return is_enabled; } + bool isChecked() const { return is_checked; } + bool isDirty() const { return is_dirty; } + bool isVisible() const { return is_visible; } + bool isEnabledAndVisible() const { return is_enabled && is_visible; } + + void setText( const TQString &text ) { text_data = text; } + void setDirty( bool dirty ) { is_dirty = dirty; } + void setVisible( bool visible ) { is_visible = visible; } + void setWhatsThis( const TQString &text ) { whatsthis_data = text; } + +private: + int ident; // item identifier + TQIconSet *iconset_data; // icons + TQString text_data; // item text + TQString whatsthis_data; // item Whats This help text + TQPixmap *pixmap_data; // item pixmap + TQPopupMenu *popup_menu; // item popup menu + TQWidget *widget_item; // widget menu item +#ifndef QT_NO_ACCEL + TQKeySequence accel_key; // accelerator key (state|ascii) +#endif + TQSignal *signal_data; // connection + uint is_separator : 1; // separator flag + uint is_enabled : 1; // disabled flag + uint is_checked : 1; // checked flag + uint is_dirty : 1; // dirty (update) flag + uint is_visible : 1; // visibility flag + TQMenuItemData* d; + + TQMenuItemData* extra(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMenuItem( const TQMenuItem & ); + TQMenuItem &operator=( const TQMenuItem & ); +#endif +}; + +#include "ntqptrlist.h" +typedef TQPtrList TQMenuItemList; +typedef TQPtrListIterator TQMenuItemListIt; + + +class Q_EXPORT TQCustomMenuItem : public TQt +{ +public: + TQCustomMenuItem(); + virtual ~TQCustomMenuItem(); + virtual bool fullSpan() const; + virtual bool isSeparator() const; + virtual void setFont( const TQFont& font ); + virtual void paint( TQPainter* p, const TQColorGroup& cg, bool act, + bool enabled, int x, int y, int w, int h ) = 0; + virtual TQSize sizeHint() = 0; +}; + + +class Q_EXPORT TQMenuData // menu data class +{ +friend class TQMenuBar; +friend class TQPopupMenu; +public: + TQMenuData(); + virtual ~TQMenuData(); + + uint count() const; + + + int insertItem( const TQString &text, + const TQObject *receiver, const char* member, + const TQKeySequence& accel = 0, int id = -1, int index = -1 ); + int insertItem( const TQIconSet& icon, + const TQString &text, + const TQObject *receiver, const char* member, + const TQKeySequence& accel = 0, int id = -1, int index = -1 ); + int insertItem( const TQPixmap &pixmap, + const TQObject *receiver, const char* member, + const TQKeySequence& accel = 0, int id = -1, int index = -1 ); + int insertItem( const TQIconSet& icon, + const TQPixmap &pixmap, + const TQObject *receiver, const char* member, + const TQKeySequence& accel = 0, int id = -1, int index = -1 ); + + int insertItem( const TQString &text, int id=-1, int index=-1 ); + int insertItem( const TQIconSet& icon, + const TQString &text, int id=-1, int index=-1 ); + + int insertItem( const TQString &text, TQPopupMenu *popup, + int id=-1, int index=-1 ); + int insertItem( const TQIconSet& icon, + const TQString &text, TQPopupMenu *popup, + int id=-1, int index=-1 ); + + + int insertItem( const TQPixmap &pixmap, int id=-1, int index=-1 ); + int insertItem( const TQIconSet& icon, + const TQPixmap &pixmap, int id=-1, int index=-1 ); + int insertItem( const TQPixmap &pixmap, TQPopupMenu *popup, + int id=-1, int index=-1 ); + int insertItem( const TQIconSet& icon, + const TQPixmap &pixmap, TQPopupMenu *popup, + int id=-1, int index=-1 ); + + int insertItem( TQWidget* widget, int id=-1, int index=-1 ); + + int insertItem( const TQIconSet& icon, TQCustomMenuItem* custom, int id=-1, int index=-1 ); + int insertItem( TQCustomMenuItem* custom, int id=-1, int index=-1 ); + + + int insertSeparator( int index=-1 ); + + void removeItem( int id ); + void removeItemAt( int index ); + void clear(); + +#ifndef QT_NO_ACCEL + TQKeySequence accel( int id ) const; + void setAccel( const TQKeySequence& key, int id ); +#endif + + TQIconSet *iconSet( int id ) const; + TQString text( int id ) const; + TQPixmap *pixmap( int id ) const; + + void setWhatsThis( int id, const TQString& ); + TQString whatsThis( int id ) const; + + + void changeItem( int id, const TQString &text ); + void changeItem( int id, const TQPixmap &pixmap ); + void changeItem( int id, const TQIconSet &icon, const TQString &text ); + void changeItem( int id, const TQIconSet &icon, const TQPixmap &pixmap ); + + void changeItem( const TQString &text, int id ) { changeItem( id, text); } // obsolete + void changeItem( const TQPixmap &pixmap, int id ) { changeItem( id, pixmap ); } // obsolete + void changeItem( const TQIconSet &icon, const TQString &text, int id ) { // obsolete + changeItem( id, icon, text ); + } + + bool isItemActive( int id ) const; + + bool isItemEnabled( int id ) const; + void setItemEnabled( int id, bool enable ); + + bool isItemChecked( int id ) const; + void setItemChecked( int id, bool check ); + + bool isItemVisible( int id ) const; + void setItemVisible( int id, bool visible ); + + virtual void updateItem( int id ); + + int indexOf( int id ) const; + int idAt( int index ) const; + virtual void setId( int index, int id ); + + bool connectItem( int id, + const TQObject *receiver, const char* member ); + bool disconnectItem( int id, + const TQObject *receiver, const char* member ); + + bool setItemParameter( int id, int param ); + int itemParameter( int id ) const; + + TQMenuItem *findItem( int id ) const; + TQMenuItem *findItem( int id, TQMenuData ** parent ) const; + TQMenuItem * findPopup( TQPopupMenu *, int *index = 0 ); + + virtual void activateItemAt( int index ); + +protected: + int actItem; + TQMenuItemList *mitems; + TQMenuData *parentMenu; + uint isPopupMenu : 1; + uint isMenuBar : 1; + uint badSize : 1; + uint mouseBtDn : 1; + uint avoid_circularity : 1; + uint actItemDown : 1; + virtual void menuContentsChanged(); + virtual void menuStateChanged(); + virtual void menuInsPopup( TQPopupMenu * ); + virtual void menuDelPopup( TQPopupMenu * ); + +private: + int insertAny( const TQString *, const TQPixmap *, TQPopupMenu *, + const TQIconSet*, int, int, TQWidget* = 0, TQCustomMenuItem* = 0); + void removePopup( TQPopupMenu * ); + void changeItemIconSet( int id, const TQIconSet &icon ); + + TQMenuDataData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMenuData( const TQMenuData & ); + TQMenuData &operator=( const TQMenuData & ); +#endif +}; + + +#endif // QT_NO_MENUDATA + +#endif // TQMENUDATA_H diff --git a/src/widgets/ntqmultilineedit.h b/src/widgets/ntqmultilineedit.h new file mode 100644 index 000000000..08b0c9519 --- /dev/null +++ b/src/widgets/ntqmultilineedit.h @@ -0,0 +1,141 @@ +/********************************************************************** +** +** Definition of TQMultiLineEdit widget class +** +** Created : 961005 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQMULTILINEEDIT_H +#define TQMULTILINEEDIT_H + +#ifndef QT_H +#include "ntqtextedit.h" +#endif // QT_H + +#ifndef QT_NO_MULTILINEEDIT + +class TQMultiLineEditCommand; +class TQValidator; +class TQMultiLineEditData; + +class Q_EXPORT TQMultiLineEdit : public TQTextEdit +{ + Q_OBJECT + Q_PROPERTY( int numLines READ numLines ) + Q_PROPERTY( bool atBeginning READ atBeginning ) + Q_PROPERTY( bool atEnd READ atEnd ) + Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) + Q_PROPERTY( bool edited READ edited WRITE setEdited DESIGNABLE false ) + +public: + TQMultiLineEdit( TQWidget* parent=0, const char* name=0 ); + ~TQMultiLineEdit(); + + TQString textLine( int line ) const; + int numLines() const; + + virtual void insertLine( const TQString &s, int line = -1 ); + virtual void insertAt( const TQString &s, int line, int col ) { + insertAt( s, line, col, FALSE ); + } + virtual void insertAt( const TQString &s, int line, int col, bool mark ); + virtual void removeLine( int line ); + virtual void setCursorPosition( int line, int col ) { + setCursorPosition( line, col, FALSE ); + } + virtual void setCursorPosition( int line, int col, bool mark ); + bool atBeginning() const; + bool atEnd() const; + + void setAlignment( int flags ); + int alignment() const; + + void setEdited( bool ); + bool edited() const; + + bool hasMarkedText() const; + TQString markedText() const; + + void cursorWordForward( bool mark ); + void cursorWordBackward( bool mark ); + + // noops + bool autoUpdate() const { return TRUE; } + virtual void setAutoUpdate( bool ) {} + + int totalWidth() const { return contentsWidth(); } + int totalHeight() const { return contentsHeight(); } + + int maxLines() const { return TQWIDGETSIZE_MAX; } + void setMaxLines( int ) {} + +public slots: + void deselect() { selectAll( FALSE ); } + +protected: + TQPoint cursorPoint() const; + +protected: + virtual void insertAndMark( const TQString&, bool mark ); + virtual void newLine(); + virtual void killLine(); + virtual void pageUp( bool mark=FALSE ); + virtual void pageDown( bool mark=FALSE ); + virtual void cursorLeft( bool mark=FALSE, bool wrap = TRUE ); + virtual void cursorRight( bool mark=FALSE, bool wrap = TRUE ); + virtual void cursorUp( bool mark=FALSE ); + virtual void cursorDown( bool mark=FALSE ); + virtual void backspace(); + virtual void home( bool mark=FALSE ); + virtual void end( bool mark=FALSE ); + + bool getMarkedRegion( int *line1, int *col1, + int *line2, int *col2 ) const; + int lineLength( int row ) const; + +private: + TQMultiLineEditData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQMultiLineEdit( const TQMultiLineEdit & ); + TQMultiLineEdit &operator=( const TQMultiLineEdit & ); +#endif +}; + +#endif // QT_NO_MULTILINEEDIT + +#endif // TQMULTILINED_H diff --git a/src/widgets/ntqpopupmenu.h b/src/widgets/ntqpopupmenu.h new file mode 100644 index 000000000..d3b114b1a --- /dev/null +++ b/src/widgets/ntqpopupmenu.h @@ -0,0 +1,201 @@ +/**************************************************************************** +** +** Definition of TQPopupMenu class +** +** Created : 941128 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPOPUPMENU_H +#define TQPOPUPMENU_H + +#ifndef QT_H +#include "ntqframe.h" +#include "ntqmenudata.h" +#endif // QT_H + +#ifndef QT_NO_POPUPMENU +class TQPopupMenuPrivate; + +class Q_EXPORT TQPopupMenu : public TQFrame, public TQMenuData +{ + Q_OBJECT + Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable ) +public: + TQPopupMenu( TQWidget* parent=0, const char* name=0 ); + ~TQPopupMenu(); + + void popup( const TQPoint & pos, int indexAtPoint = -1 ); // open + void updateItem( int id ); + + virtual void setCheckable( bool ); + bool isCheckable() const; + + void setFont( const TQFont & ); + void show(); + void hide(); + + int exec(); + int exec( const TQPoint & pos, int indexAtPoint = 0 ); // modal + + virtual void setActiveItem( int ); + TQSize sizeHint() const; + + int idAt( int index ) const { return TQMenuData::idAt( index ); } + int idAt( const TQPoint& pos ) const; + + bool customWhatsThis() const; + + int insertTearOffHandle( int id=-1, int index=-1 ); + + void activateItemAt( int index ); + TQRect itemGeometry( int index ); + + +signals: + void activated( int itemId ); + void highlighted( int itemId ); + void activatedRedirect( int itemId ); // to parent menu + void highlightedRedirect( int itemId ); + void aboutToShow(); + void aboutToHide(); + +protected: + int itemHeight( int ) const; + int itemHeight( TQMenuItem* mi ) const; + void drawItem( TQPainter* p, int tab, TQMenuItem* mi, + bool act, int x, int y, int w, int h); + + void drawContents( TQPainter * ); + + void closeEvent( TQCloseEvent *e ); + 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 next ); + + int itemAtPos( const TQPoint &, bool ignoreSeparator = TRUE ) const; + +private slots: + void subActivated( int itemId ); + void subHighlighted( int itemId ); +#ifndef QT_NO_ACCEL + void accelActivated( int itemId ); + void accelDestroyed(); +#endif + void popupDestroyed( TQObject* ); + void modalActivation( int ); + + void subMenuTimer(); + void subScrollTimer(); + void allowAnimation(); + void toggleTearOff(); + + void performDelayedChanges(); + +private: + void updateScrollerState(); + void menuContentsChanged(); + void menuStateChanged(); + void performDelayedContentsChanged(); + void performDelayedStateChanged(); + void menuInsPopup( TQPopupMenu * ); + void menuDelPopup( TQPopupMenu * ); + void frameChanged(); + + void actSig( int, bool = FALSE ); + void hilitSig( int ); + virtual void setFirstItemActive(); + void hideAllPopups(); + void hidePopups(); + bool tryMenuBar( TQMouseEvent * ); + void byeMenuBar(); + + TQSize updateSize(bool force_recalc=FALSE, bool do_resize=TRUE); + void updateRow( int row ); + TQRect screenRect(const TQPoint& pos); +#ifndef QT_NO_ACCEL + void updateAccel( TQWidget * ); + void enableAccel( bool ); +#endif + TQPopupMenuPrivate *d; +#ifndef QT_NO_ACCEL + TQAccel *autoaccel; +#endif + +#if defined(Q_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE) + bool macPopupMenu(const TQPoint &, int); + uint mac_dirty_popup : 1; +#endif + + int popupActive; + int tab; + uint accelDisabled : 1; + uint checkable : 1; + uint connectModalRecursionSafety : 1; + uint tornOff : 1; + uint pendingDelayedContentsChanges : 1; + uint pendingDelayedStateChanges : 1; + int maxPMWidth; + int ncols; + bool snapToMouse; + bool tryMouseEvent( TQPopupMenu *, TQMouseEvent * ); + + friend class TQMenuData; + friend class TQMenuBar; + + void connectModal(TQPopupMenu* receiver, bool doConnect); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPopupMenu( const TQPopupMenu & ); + TQPopupMenu &operator=( const TQPopupMenu & ); +#endif +}; + + +#endif // QT_NO_POPUPMENU + +#endif // TQPOPUPMENU_H diff --git a/src/widgets/ntqprogressbar.h b/src/widgets/ntqprogressbar.h new file mode 100644 index 000000000..b848235c4 --- /dev/null +++ b/src/widgets/ntqprogressbar.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Definition of TQProgressBar class +** +** Created : 970520 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPROGRESSBAR_H +#define TQPROGRESSBAR_H + +#ifndef QT_H +#include "ntqframe.h" +#endif // QT_H + +#ifndef QT_NO_PROGRESSBAR + + +class TQProgressBarPrivate; + + +class Q_EXPORT TQProgressBar : public TQFrame +{ + Q_OBJECT + Q_PROPERTY( int totalSteps READ totalSteps WRITE setTotalSteps ) + Q_PROPERTY( int progress READ progress WRITE setProgress ) + Q_PROPERTY( TQString progressString READ progressString ) + Q_PROPERTY( bool centerIndicator READ centerIndicator WRITE setCenterIndicator ) + Q_PROPERTY( bool indicatorFollowsStyle READ indicatorFollowsStyle WRITE setIndicatorFollowsStyle ) + Q_PROPERTY( bool percentageVisible READ percentageVisible WRITE setPercentageVisible ) + +public: + TQProgressBar( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + TQProgressBar( int totalSteps, TQWidget* parent=0, const char* name=0, WFlags f=0 ); + + int totalSteps() const; + int progress() const; + const TQString &progressString() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void setCenterIndicator( bool on ); + 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 totalSteps ); + virtual void setProgress( int progress ); + void setProgress( int progress, int totalSteps ); + +protected: + void drawContents( TQPainter * ); + virtual bool setIndicator( TQString & progress_str, int progress, + int totalSteps ); + void styleChange( TQStyle& ); + +private: + int total_steps; + int progress_val; + int percentage; + TQString progress_str; + bool center_indicator : 1; + bool auto_indicator : 1; + bool percentage_visible : 1; + TQProgressBarPrivate * d; + void initFrame(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQProgressBar( const TQProgressBar & ); + TQProgressBar &operator=( const TQProgressBar & ); +#endif +}; + + +inline int TQProgressBar::totalSteps() const +{ + return total_steps; +} + +inline int TQProgressBar::progress() const +{ + return progress_val; +} + +inline const TQString &TQProgressBar::progressString() const +{ + return progress_str; +} + +inline bool TQProgressBar::centerIndicator() const +{ + return center_indicator; +} + +inline bool TQProgressBar::indicatorFollowsStyle() const +{ + return auto_indicator; +} + +inline bool TQProgressBar::percentageVisible() const +{ + return percentage_visible; +} + +#endif // QT_NO_PROGRESSBAR + +#endif // TQPROGRESSBAR_H diff --git a/src/widgets/ntqpushbutton.h b/src/widgets/ntqpushbutton.h new file mode 100644 index 000000000..9f74aae31 --- /dev/null +++ b/src/widgets/ntqpushbutton.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Definition of TQPushButton class +** +** Created : 940221 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQPUSHBUTTON_H +#define TQPUSHBUTTON_H + +#ifndef QT_H +#include "ntqbutton.h" +#include "ntqiconset.h" +#endif // QT_H + +#ifndef QT_NO_PUSHBUTTON +class TQPushButtonPrivate; +class TQPopupMenu; + +class Q_EXPORT TQPushButton : public TQButton +{ + Q_OBJECT + + Q_PROPERTY( bool autoDefault READ autoDefault WRITE setAutoDefault ) + Q_PROPERTY( bool default READ isDefault WRITE setDefault ) + Q_PROPERTY( bool menuButton READ isMenuButton DESIGNABLE false ) + Q_PROPERTY( TQIconSet iconSet READ iconSet WRITE setIconSet ) + Q_OVERRIDE( bool toggleButton WRITE setToggleButton ) + Q_OVERRIDE( bool on WRITE setOn ) + Q_PROPERTY( bool flat READ isFlat WRITE setFlat ) + Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) + +public: + TQPushButton( TQWidget *parent, const char* name=0 ); + TQPushButton( const TQString &text, TQWidget *parent, const char* name=0 ); +#ifndef QT_NO_ICONSET + TQPushButton( const TQIconSet& icon, const TQString &text, TQWidget *parent, const char* name=0 ); +#endif + ~TQPushButton(); + + TQSize sizeHint() const; + + void move( int x, int y ); + void move( const TQPoint &p ); + void resize( int w, int h ); + void resize( const TQSize & ); + void setGeometry( int x, int y, int w, int h ); + + void setGeometry( const TQRect & ); + + void setToggleButton( bool ); + + bool autoDefault() const { return autoDefButton; } + virtual void setAutoDefault( bool autoDef ); + bool isDefault() const { return defButton; } + virtual void setDefault( bool def ); + + virtual void setIsMenuButton( bool enable ) { // obsolete functions + if ( (bool)hasMenuArrow == enable ) + return; + hasMenuArrow = enable ? 1 : 0; + update(); + updateGeometry(); + } + bool isMenuButton() const { return hasMenuArrow; } + +#ifndef QT_NO_POPUPMENU + void setPopup( TQPopupMenu* popup ); + TQPopupMenu* popup() const; +#endif +#ifndef QT_NO_ICONSET + void setIconSet( const TQIconSet& ); + TQIconSet* iconSet() const; +#endif + 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 slots: +#ifndef QT_NO_POPUPMENU + void popupPressed(); +#endif +private: + void init(); + + uint autoDefButton : 1; + uint defButton : 1; + uint flt : 1; + uint reserved : 1; // UNUSED + uint lastEnabled : 1; // UNUSED + uint hasMenuArrow : 1; + + TQPushButtonPrivate* d; + + friend class TQDialog; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQPushButton( const TQPushButton & ); + TQPushButton &operator=( const TQPushButton & ); +#endif +}; + + +#endif // QT_NO_PUSHBUTTON + +#endif // TQPUSHBUTTON_H diff --git a/src/widgets/ntqradiobutton.h b/src/widgets/ntqradiobutton.h new file mode 100644 index 000000000..9ceb30782 --- /dev/null +++ b/src/widgets/ntqradiobutton.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Definition of TQRadioButton class +** +** Created : 940222 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQRADIOBUTTON_H +#define TQRADIOBUTTON_H + +#ifndef QT_H +#include "ntqbutton.h" +#endif // QT_H + +#ifndef QT_NO_RADIOBUTTON + +class Q_EXPORT TQRadioButton : public TQButton +{ + Q_OBJECT + Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) + Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) + +public: + TQRadioButton( TQWidget *parent, const char* name=0 ); + TQRadioButton( const TQString &text, TQWidget *parent, const char* name=0 ); + + bool isChecked() const; + + TQSize sizeHint() const; + +public slots: + virtual void setChecked( bool check ); + +protected: + bool hitButton( const TQPoint & ) const; + void drawButton( TQPainter * ); + void drawButtonLabel( TQPainter * ); + void updateMask(); + + void resizeEvent( TQResizeEvent* ); + +private: + void init(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQRadioButton( const TQRadioButton & ); + TQRadioButton &operator=( const TQRadioButton & ); +#endif +}; + + +inline bool TQRadioButton::isChecked() const +{ return isOn(); } + +#endif // QT_NO_RADIOBUTTON + +#endif // TQRADIOBUTTON_H diff --git a/src/widgets/ntqrangecontrol.h b/src/widgets/ntqrangecontrol.h new file mode 100644 index 000000000..940711cce --- /dev/null +++ b/src/widgets/ntqrangecontrol.h @@ -0,0 +1,194 @@ +/**************************************************************************** +** +** Definition of TQRangeControl class +** +** Created : 940427 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQRANGECONTROL_H +#define TQRANGECONTROL_H + +#ifndef QT_H +#include "ntqglobal.h" +#include "ntqframe.h" +#endif // QT_H + +#ifndef QT_NO_RANGECONTROL + + +class TQRangeControlPrivate; + + +class Q_EXPORT TQRangeControl +{ +public: + TQRangeControl(); + TQRangeControl( int minValue, int maxValue, + int lineStep, int pageStep, int value ); + virtual ~TQRangeControl(); + int value() const; + void setValue( int ); + void addPage(); + void subtractPage(); + void addLine(); + void subtractLine(); + + int minValue() const; + int maxValue() const; + void setRange( int minValue, int maxValue ); + void setMinValue( int minVal ); + void setMaxValue( int minVal ); + + int lineStep() const; + int pageStep() const; + void setSteps( int line, int page ); + + int bound( int ) const; + +protected: + int positionFromValue( int val, int space ) const; + int valueFromPosition( int pos, int space ) const; + void directSetValue( int val ); + int prevValue() const; + + virtual void valueChange(); + virtual void rangeChange(); + virtual void stepChange(); + +private: + int minVal, maxVal; + int line, page; + int val, prevVal; + + TQRangeControlPrivate * d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQRangeControl( const TQRangeControl & ); + TQRangeControl &operator=( const TQRangeControl & ); +#endif +}; + + +inline int TQRangeControl::value() const +{ return val; } + +inline int TQRangeControl::prevValue() const +{ return prevVal; } + +inline int TQRangeControl::minValue() const +{ return minVal; } + +inline int TQRangeControl::maxValue() const +{ return maxVal; } + +inline int TQRangeControl::lineStep() const +{ return line; } + +inline int TQRangeControl::pageStep() const +{ return page; } + + +#endif // QT_NO_RANGECONTROL + +#ifndef QT_NO_SPINWIDGET + +class TQSpinWidgetPrivate; +class Q_EXPORT TQSpinWidget : public TQWidget +{ + Q_OBJECT +public: + TQSpinWidget( TQWidget* parent=0, const char* name=0 ); + ~TQSpinWidget(); + + void setEditWidget( TQWidget * widget ); + TQWidget * editWidget(); + + TQRect upRect() const; + TQRect downRect() const; + + void setUpEnabled( bool on ); + void setDownEnabled( bool on ); + + bool isUpEnabled() const; + bool isDownEnabled() const; + + enum ButtonSymbols { UpDownArrows, PlusMinus }; + virtual void setButtonSymbols( ButtonSymbols bs ); + ButtonSymbols buttonSymbols() const; + + void arrange(); + +signals: + void stepUpPressed(); + void stepDownPressed(); + +public slots: + void stepUp(); + void stepDown(); + +protected: + void mousePressEvent( TQMouseEvent *e ); + void resizeEvent( TQResizeEvent* ev ); + void mouseReleaseEvent( TQMouseEvent *e ); + void mouseMoveEvent( TQMouseEvent *e ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent * ); +#endif + void styleChange( TQStyle& ); + void paintEvent( TQPaintEvent * ); + void enableChanged( bool old ); + void windowActivationChange( bool ); + +private slots: + void timerDone(); + void timerDoneEx(); + +private: + TQSpinWidgetPrivate * d; + + void updateDisplay(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSpinWidget( const TQSpinWidget& ); + TQSpinWidget& operator=( const TQSpinWidget& ); +#endif +}; + +#endif // QT_NO_SPINWIDGET + +#endif // TQRANGECONTROL_H diff --git a/src/widgets/ntqscrollbar.h b/src/widgets/ntqscrollbar.h new file mode 100644 index 000000000..be9229015 --- /dev/null +++ b/src/widgets/ntqscrollbar.h @@ -0,0 +1,197 @@ +/**************************************************************************** +** +** Definition of TQScrollBar class +** +** Created : 940427 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSCROLLBAR_H +#define TQSCROLLBAR_H + +class TQTimer; + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#endif // QT_H + +#ifndef QT_NO_SCROLLBAR + +class Q_EXPORT TQScrollBar : public TQWidget, public TQRangeControl +{ + Q_OBJECT + Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) + Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) + Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) + Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep ) + Q_PROPERTY( int value READ value WRITE setValue ) + Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) + Q_PROPERTY( bool draggingSlider READ draggingSlider ) + Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) + +public: + TQScrollBar( TQWidget *parent, const char* name = 0 ); + TQScrollBar( Orientation, TQWidget *parent, const char* name = 0 ); + TQScrollBar( int minValue, int maxValue, int lineStep, int pageStep, + int value, Orientation, TQWidget *parent, const char* name = 0 ); + ~TQScrollBar(); + + virtual void setOrientation( Orientation ); + Orientation orientation() const; + virtual void setTracking( bool enable ); + bool tracking() const; + bool draggingSlider() const; + + virtual void setPalette( const TQPalette & ); + virtual TQSize sizeHint() const; + virtual void setSizePolicy( TQSizePolicy sp ); + void setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw = FALSE ); + + 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 value ); + void sliderPressed(); + void sliderMoved( int value ); + void sliderReleased(); + void nextLine(); + void prevLine(); + void nextPage(); + void prevPage(); + +protected: +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent * ); +#endif + 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 slots: + void doAutoRepeat(); + +private: + void init(); + void positionSliderFromValue(); + int calculateValueFromSlider() const; + + void startAutoRepeat(); + void stopAutoRepeat(); + + int rangeValueToSliderPos( int val ) const; + int sliderPosToRangeValue( int val ) const; + + void action( int control ); + + void drawControls( uint controls, uint activeControl ) const; + void drawControls( uint controls, uint activeControl, + TQPainter *p ) const; + + uint pressedControl; + bool track; + bool clickedAt; + Orientation orient; + + int slidePrevVal; + TQCOORD sliderPos; + TQCOORD clickOffset; + + TQTimer * repeater; + void * d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQScrollBar( const TQScrollBar & ); + TQScrollBar &operator=( const TQScrollBar & ); +#endif +}; + + +inline void TQScrollBar::setTracking( bool t ) +{ + track = t; +} + +inline bool TQScrollBar::tracking() const +{ + return track; +} + +inline TQScrollBar::Orientation TQScrollBar::orientation() const +{ + return orient; +} + +inline int TQScrollBar::sliderStart() const +{ + return sliderPos; +} + +inline void TQScrollBar::setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw ) +{ + TQWidget::setSizePolicy( hor, ver, hfw ); +} + + +#endif // QT_NO_SCROLLBAR + +#endif // TQSCROLLBAR_H diff --git a/src/widgets/ntqscrollview.h b/src/widgets/ntqscrollview.h new file mode 100644 index 000000000..2de0e6a5b --- /dev/null +++ b/src/widgets/ntqscrollview.h @@ -0,0 +1,269 @@ +/**************************************************************************** +** +** Definition of TQScrollView class +** +** Created : 970523 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ +#ifndef TQSCROLLVIEW_H +#define TQSCROLLVIEW_H + +#ifndef QT_H +#include "ntqframe.h" +#include "ntqscrollbar.h" +#endif // QT_H + +#ifndef QT_NO_SCROLLVIEW + +class TQScrollViewData; + +class Q_EXPORT TQScrollView : public TQFrame +{ + Q_OBJECT + Q_ENUMS( ResizePolicy ScrollBarMode ) + Q_PROPERTY( ResizePolicy resizePolicy READ resizePolicy WRITE setResizePolicy ) + Q_PROPERTY( ScrollBarMode vScrollBarMode READ vScrollBarMode WRITE setVScrollBarMode ) + Q_PROPERTY( ScrollBarMode hScrollBarMode READ hScrollBarMode WRITE setHScrollBarMode ) + Q_PROPERTY( int visibleWidth READ visibleWidth ) + Q_PROPERTY( int visibleHeight READ visibleHeight ) + Q_PROPERTY( int contentsWidth READ contentsWidth ) + Q_PROPERTY( int contentsHeight READ contentsHeight ) + Q_PROPERTY( int contentsX READ contentsX ) + Q_PROPERTY( int contentsY READ contentsY ) +#ifndef QT_NO_DRAGANDDROP + Q_PROPERTY( bool dragAutoScroll READ dragAutoScroll WRITE setDragAutoScroll ) +#endif + +public: + TQScrollView(TQWidget* parent=0, const char* name=0, WFlags f=0); + ~TQScrollView(); + + enum ResizePolicy { Default, Manual, AutoOne, AutoOneFit }; + virtual void setResizePolicy( ResizePolicy ); + ResizePolicy resizePolicy() const; + + void styleChange( TQStyle & ); + void removeChild(TQWidget* child); + virtual void addChild( TQWidget* child, int x=0, int y=0 ); + virtual void moveChild( TQWidget* child, int x, int y ); + int childX(TQWidget* child); + int childY(TQWidget* child); + bool childIsVisible(TQWidget* child) { return child->isVisible(); } // obsolete functions + void showChild(TQWidget* child, bool yes=TRUE) { + if ( yes ) + child->show(); + else + child->hide(); + } + + 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*); + + // ### 4.0: Consider providing a factory function for scrollbars + // (e.g. make the two following functions virtual) + 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 w, int h ); + void resize( const TQSize& ); + void show(); + + void updateContents( int x, int y, int w, int h ); + void updateContents( const TQRect& r ); + void updateContents(); + void repaintContents( int x, int y, int w, int h, bool erase=TRUE ); + void repaintContents( const TQRect& r, bool erase=TRUE ); + void repaintContents( bool erase=TRUE ); + void contentsToViewport( int x, int y, int& vx, int& vy ) const; + void viewportToContents( int vx, int vy, int& x, int& y ) const; + TQPoint contentsToViewport( const TQPoint& ) const; + TQPoint viewportToContents( const TQPoint& ) const; + void enableClipper( bool y ); + + void setStaticBackground( bool y ); + bool hasStaticBackground() const; + + TQSize viewportSize( int, int ) const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void removeChild(TQObject* child); + + bool isHorizontalSliderPressed(); + bool isVerticalSliderPressed(); + +#ifndef QT_NO_DRAGANDDROP + virtual void setDragAutoScroll( bool b ); + bool dragAutoScroll() const; +#endif + +signals: + void contentsMoving(int x, int y); + void horizontalSliderPressed(); + void horizontalSliderReleased(); + void verticalSliderPressed(); + void verticalSliderReleased(); + +public slots: + virtual void resizeContents( int w, int h ); + void scrollBy( int dx, int dy ); + virtual void setContentsPos( int x, int y ); + void ensureVisible(int x, int y); + void ensureVisible(int x, int y, int xmargin, int ymargin); + void center(int x, int y); + void center(int x, int y, float xmargin, float ymargin); + + void updateScrollBars(); // ### virtual in 4.0 + void setEnabled( bool enable ); + +protected: + virtual void drawContents(TQPainter*, int cx, int cy, int cw, int ch); + virtual void drawContentsOffset(TQPainter*, int ox, int oy, + int cx, int cy, int cw, int ch); + + + virtual void contentsMousePressEvent( TQMouseEvent* ); + virtual void contentsMouseReleaseEvent( TQMouseEvent* ); + virtual void contentsMouseDoubleClickEvent( TQMouseEvent* ); + virtual void contentsMouseMoveEvent( TQMouseEvent* ); +#ifndef QT_NO_DRAGANDDROP + virtual void contentsDragEnterEvent( TQDragEnterEvent * ); + virtual void contentsDragMoveEvent( TQDragMoveEvent * ); + virtual void contentsDragLeaveEvent( TQDragLeaveEvent * ); + virtual void contentsDropEvent( TQDropEvent * ); +#endif +#ifndef QT_NO_WHEELEVENT + virtual void contentsWheelEvent( TQWheelEvent * ); +#endif + 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* ); +#ifndef QT_NO_DRAGANDDROP + virtual void viewportDragEnterEvent( TQDragEnterEvent * ); + virtual void viewportDragMoveEvent( TQDragMoveEvent * ); + virtual void viewportDragLeaveEvent( TQDragLeaveEvent * ); + virtual void viewportDropEvent( TQDropEvent * ); +#endif +#ifndef QT_NO_WHEELEVENT + virtual void viewportWheelEvent( TQWheelEvent * ); +#endif + virtual void viewportContextMenuEvent( TQContextMenuEvent * ); + + void frameChanged(); + + virtual void setMargins(int left, int top, int right, int bottom); + int leftMargin() const; + int topMargin() const; + int rightMargin() const; + int bottomMargin() const; + + bool focusNextPrevChild( bool next ); + + virtual void setHBarGeometry(TQScrollBar& hbar, int x, int y, int w, int h); + virtual void setVBarGeometry(TQScrollBar& vbar, int x, int y, int w, int h); + + void resizeEvent(TQResizeEvent*); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent * ); +#endif + void contextMenuEvent( TQContextMenuEvent * ); + bool eventFilter( TQObject *, TQEvent *e ); + + void setCachedSizeHint( const TQSize &sh ) const; + TQSize cachedSizeHint() const; + void fontChange( const TQFont & ); + +private: + void drawContents( TQPainter* ); + void moveContents(int x, int y); + + TQScrollViewData* d; + +private slots: + void hslide(int); + void vslide(int); + void hbarIsPressed(); + void hbarIsReleased(); + void vbarIsPressed(); + void vbarIsReleased(); +#ifndef QT_NO_DRAGANDDROP + void doDragAutoScroll(); + void startDragAutoScroll(); + void stopDragAutoScroll(); +#endif + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQScrollView( const TQScrollView & ); + TQScrollView &operator=( const TQScrollView & ); +#endif + void changeFrameRect(const TQRect&); + +public: + void disableSizeHintCaching(); + +}; + +#endif // QT_NO_SCROLLVIEW + +#endif // TQSCROLLVIEW_H diff --git a/src/widgets/ntqslider.h b/src/widgets/ntqslider.h new file mode 100644 index 000000000..2a87d3bf3 --- /dev/null +++ b/src/widgets/ntqslider.h @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Definition of TQSlider class +** +** Created : 961019 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSLIDER_H +#define TQSLIDER_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#endif // QT_H + +#ifndef QT_NO_SLIDER + +struct TQSliderPrivate; + +class TQTimer; + +class Q_EXPORT TQSlider : public TQWidget, public TQRangeControl +{ + Q_OBJECT + Q_ENUMS( TickSetting ) + Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) + Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) + Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) + Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep ) + Q_PROPERTY( int value READ value WRITE setValue ) + Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) + Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) + Q_PROPERTY( TickSetting tickmarks READ tickmarks WRITE setTickmarks ) + Q_PROPERTY( int tickInterval READ tickInterval WRITE setTickInterval ) + +public: + enum TickSetting { NoMarks = 0, Above = 1, Left = Above, + Below = 2, Right = Below, Both = 3 }; + + TQSlider( TQWidget *parent, const char* name = 0 ); + TQSlider( Orientation, TQWidget *parent, const char* name = 0 ); + TQSlider( int minValue, int maxValue, int pageStep, int value, Orientation, + TQWidget *parent, const char* name = 0 ); + ~TQSlider(); + + virtual void setOrientation( Orientation ); + Orientation orientation() const; + virtual void setTracking( bool enable ); + bool tracking() const; + virtual void setPalette( const TQPalette & ); + + int sliderStart() const; + TQRect sliderRect() const; + TQSize sizeHint() const; + void setSizePolicy( TQSizePolicy sp ); + void setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw = FALSE ); + + TQSizePolicy sizePolicy() const; + TQSize minimumSizeHint() const; + + virtual void setTickmarks( TickSetting ); + TickSetting tickmarks() const { return ticks; } + + virtual void setTickInterval( int ); + int tickInterval() const { return tickInt; } + + 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 value ); + void sliderPressed(); + void sliderMoved( int value ); + void sliderReleased(); + +protected: + void resizeEvent( TQResizeEvent * ); + void paintEvent( TQPaintEvent * ); + + void keyPressEvent( TQKeyEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent * ); +#endif + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); + + void styleChange( TQStyle& ); + + void valueChange(); + void rangeChange(); + +private slots: + void repeatTimeout(); + +private: + enum State { Idle, Dragging, TimingUp, TimingDown }; + + void init(); + int positionFromValue( int ) const; + int valueFromPosition( int ) const; + void moveSlider( int ); + void reallyMoveSlider( int ); + void resetState(); + int available() const; + int goodPart( const TQPoint& ) const; + void initTicks(); + + TQSliderPrivate *d; + TQTimer *timer; + TQCOORD sliderPos; + int sliderVal; + TQCOORD clickOffset; + State state; + bool track; + TQCOORD tickOffset; + TickSetting ticks; + int tickInt; + Orientation orient; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSlider( const TQSlider & ); + TQSlider &operator=( const TQSlider & ); +#endif +}; + +inline bool TQSlider::tracking() const +{ + return track; +} + +inline TQSlider::Orientation TQSlider::orientation() const +{ + return orient; +} + +inline int TQSlider::sliderStart() const +{ + return sliderPos; +} + +inline void TQSlider::setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw ) +{ + TQWidget::setSizePolicy( hor, ver, hfw ); +} + +#endif // QT_NO_SLIDER + +#endif // TQSLIDER_H diff --git a/src/widgets/ntqspinbox.h b/src/widgets/ntqspinbox.h new file mode 100644 index 000000000..df4a15421 --- /dev/null +++ b/src/widgets/ntqspinbox.h @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Definition of TQSpinBox widget class +** +** Created : 970101 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSPINBOX_H +#define TQSPINBOX_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#endif // QT_H + +#ifndef QT_NO_SPINBOX + +class TQLineEdit; +class TQValidator; +class TQSpinBoxPrivate; + +class Q_EXPORT TQSpinBox: public TQWidget, public TQRangeControl +{ + Q_OBJECT + Q_ENUMS( ButtonSymbols ) + Q_PROPERTY( TQString text READ text ) + Q_PROPERTY( TQString prefix READ prefix WRITE setPrefix ) + Q_PROPERTY( TQString suffix READ suffix WRITE setSuffix ) + Q_PROPERTY( TQString cleanText READ cleanText ) + Q_PROPERTY( TQString specialValueText READ specialValueText WRITE setSpecialValueText ) + Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping ) + Q_PROPERTY( ButtonSymbols buttonSymbols READ buttonSymbols WRITE setButtonSymbols ) + Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) + Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) + Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) + Q_PROPERTY( int value READ value WRITE setValue ) + +public: + TQSpinBox( TQWidget* parent=0, const char* name=0 ); + TQSpinBox( int minValue, int maxValue, int step = 1, + TQWidget* parent=0, const char* name=0 ); + ~TQSpinBox(); + + TQString text() const; + + virtual TQString prefix() const; + virtual TQString suffix() const; + virtual TQString cleanText() const; + + virtual void setSpecialValueText( const TQString &text ); + TQString specialValueText() const; + + virtual void setWrapping( bool on ); + bool wrapping() const; + + enum ButtonSymbols { UpDownArrows, PlusMinus }; + virtual void setButtonSymbols( ButtonSymbols ); + ButtonSymbols buttonSymbols() const; + + virtual void setValidator( const TQValidator* v ); + 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 value ); + virtual void setPrefix( const TQString &text ); + virtual void setSuffix( const TQString &text ); + virtual void stepUp(); + virtual void stepDown(); + virtual void setEnabled( bool enabled ); + virtual void selectAll(); + +signals: + void valueChanged( int value ); + void valueChanged( const TQString &valueText ); + +protected: + virtual TQString mapValueToText( int value ); + virtual int mapTextToValue( bool* ok ); + TQString currentValueText(); + + virtual void updateDisplay(); + virtual void interpretText(); + + TQLineEdit* editor() const; + + virtual void valueChange(); + virtual void rangeChange(); + + bool eventFilter( TQObject* obj, TQEvent* ev ); + void resizeEvent( TQResizeEvent* ev ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent * ); +#endif + void leaveEvent( TQEvent* ); + + void styleChange( TQStyle& ); + +protected slots: + void textChanged(); + +private: + void initSpinBox(); + TQSpinBoxPrivate* d; + TQLineEdit* vi; + TQValidator* validate; + TQString pfix; + TQString sfix; + TQString specText; + + uint wrap : 1; + uint edited : 1; + + void arrangeWidgets(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQSpinBox( const TQSpinBox& ); + TQSpinBox& operator=( const TQSpinBox& ); +#endif + +}; + +#endif // QT_NO_SPINBOX + +#endif // TQSPINBOX_H diff --git a/src/widgets/ntqsplashscreen.h b/src/widgets/ntqsplashscreen.h new file mode 100644 index 000000000..10c4e5c6d --- /dev/null +++ b/src/widgets/ntqsplashscreen.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Definition of TQSplashScreen class +** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSPLASHSCREEN_H +#define TQSPLASHSCREEN_H + +#ifndef QT_H +#include "ntqpixmap.h" +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_SPLASHSCREEN +class TQSplashScreenPrivate; + +class Q_EXPORT TQSplashScreen : public TQWidget +{ + Q_OBJECT +public: + TQSplashScreen( const TQPixmap &pixmap = TQPixmap(), WFlags f = 0 ); + virtual ~TQSplashScreen(); + + void setPixmap( const TQPixmap &pixmap ); + TQPixmap* pixmap() const; + void finish( TQWidget *w ); + void repaint(); + +public slots: + void message( const TQString &str, int flags = AlignLeft, + const TQColor &color = black ); + void clear(); + +signals: + void messageChanged( const TQString &str ); + +protected: + virtual void drawContents( TQPainter *painter ); + void mousePressEvent( TQMouseEvent * ); + +private: + void drawContents(); + + TQSplashScreenPrivate *d; +}; +#endif //QT_NO_SPLASHSCREEN +#endif diff --git a/src/widgets/ntqsplitter.h b/src/widgets/ntqsplitter.h new file mode 100644 index 000000000..8e05120e1 --- /dev/null +++ b/src/widgets/ntqsplitter.h @@ -0,0 +1,225 @@ +/**************************************************************************** +** +** Definition of TQSplitter class +** +** Created : 980105 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSPLITTER_H +#define TQSPLITTER_H + +#ifndef QT_H +#include "ntqframe.h" +#include "ntqvaluelist.h" +#endif // QT_H + +#ifndef QT_NO_SPLITTER + +#define QT_QSPLITTER_DEFAULT 2 + +class TQSplitterHandle; +class TQSplitterPrivate; +class TQSplitterLayoutStruct; +class TQTextStream; + +class TQSplitterPrivate +{ +public: + TQSplitterPrivate() + : opaque( FALSE ), firstShow( TRUE ), childrenCollapsible( TRUE ), + handleWidth( 0 ) { } + + TQPtrList list; + bool opaque; + bool firstShow; + bool childrenCollapsible; + int handleWidth; +}; + +class TQSplitterLayoutStruct : public TQt +{ +public: + TQCOORD sizer; + uint isHandle; + uint collapsible; + uint resizeMode; + TQWidget *wid; + + TQSplitterLayoutStruct() + : sizer( -1 ), collapsible( QT_QSPLITTER_DEFAULT ) { } + TQCOORD getSizer( Orientation orient ); +}; + +class Q_EXPORT TQSplitter : public TQFrame +{ + Q_OBJECT + Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) + Q_PROPERTY( bool opaqueResize READ opaqueResize WRITE setOpaqueResize ) + Q_PROPERTY( int handleWidth READ handleWidth WRITE setHandleWidth ) + Q_PROPERTY( bool childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible ) + +public: + // ### TQt 4.0: remove Auto from public API + enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }; + + TQSplitter( TQWidget* parent = 0, const char* name = 0 ); + TQSplitter( Orientation, TQWidget* parent = 0, const char* name = 0 ); + ~TQSplitter(); + + virtual void setOrientation( Orientation ); + Orientation orientation() const { return orient; } + + // ### TQt 4.0: make setChildrenCollapsible() and setCollapsible() virtual + + void setChildrenCollapsible( bool ); + bool childrenCollapsible() const; + + void setCollapsible( TQWidget *w, bool ); + virtual void setResizeMode( TQWidget *w, ResizeMode ); + virtual void setOpaqueResize( bool = TRUE ); + bool opaqueResize() const; + + void moveToFirst( TQWidget * ); + void moveToLast( TQWidget * ); + + void refresh() { recalc( TRUE ); } + 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 pos, int id ); + virtual void drawSplitter( TQPainter*, TQCOORD x, TQCOORD y, + TQCOORD w, TQCOORD h ); + void styleChange( TQStyle& ); + int adjustPos( int, int ); + virtual void setRubberband( int ); + void getRange( int id, int *, int * ); + +public: //private: + enum { DefaultResizeMode = 3 }; + + void init(); + void recalc( bool update = FALSE ); + void doResize(); + void storeSizes(); + void getRange( int id, int *, int *, int *, int * ); + void addContribution( int, int *, int *, bool ); + int adjustPos( int, int, int *, int *, int *, int * ); + bool collapsible( TQSplitterLayoutStruct * ); + void processChildEvents(); + TQSplitterLayoutStruct *findWidget( TQWidget * ); + TQSplitterLayoutStruct *addWidget( TQWidget *, bool prepend = FALSE ); + void recalcId(); + void doMove( bool backwards, int pos, int id, int delta, bool upLeft, + bool mayCollapse ); + void setGeo( TQWidget *w, int pos, int size, bool splitterMoved ); + int findWidgetJustBeforeOrJustAfter( int id, int delta, int &collapsibleSize ); + void updateHandles(); + + inline TQCOORD pick( const TQPoint &p ) const + { return orient == Horizontal ? p.x() : p.y(); } + inline TQCOORD pick( const TQSize &s ) const + { return orient == Horizontal ? s.width() : s.height(); } + + inline TQCOORD trans( const TQPoint &p ) const + { return orient == Vertical ? p.x() : p.y(); } + inline TQCOORD trans( const TQSize &s ) const + { return orient == Vertical ? s.width() : s.height(); } + + TQSplitterPrivate *d; + + Orientation orient; + friend class TQSplitterHandle; + friend class TQTextStream; + +private: +#if defined(Q_DISABLE_COPY) + TQSplitter( const TQSplitter & ); + TQSplitter& operator=( const TQSplitter & ); +#endif +}; + +#ifndef QT_NO_TEXTSTREAM +Q_EXPORT TQTextStream& operator<<( TQTextStream&, const TQSplitter& ); +Q_EXPORT TQTextStream& operator>>( TQTextStream&, TQSplitter& ); +#endif + +class TQSplitterHandle : public TQWidget +{ + Q_OBJECT +public: + TQSplitterHandle( Orientation o, + TQSplitter *parent, const char* name=0 ); + void setOrientation( Orientation o ); + Orientation orientation() const { return orient; } + + bool opaque() const { return s->opaqueResize(); } + + TQSize sizeHint() const; + + int id() const { return myId; } // d->list.at(id())->wid == this + void setId( int i ) { myId = i; } + +protected: + void paintEvent( TQPaintEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + +public: // private: + Orientation orient; + bool opaq; + int myId; + + TQSplitter *s; +}; + +#endif // QT_NO_SPLITTER + +#endif // TQSPLITTER_H diff --git a/src/widgets/ntqstatusbar.h b/src/widgets/ntqstatusbar.h new file mode 100644 index 000000000..1402b2ff7 --- /dev/null +++ b/src/widgets/ntqstatusbar.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Definition of TQStatusBar class +** +** Created : 980316 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSTATUSBAR_H +#define TQSTATUSBAR_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_STATUSBAR + + +class TQStatusBarPrivate; + + +class Q_EXPORT TQStatusBar: public TQWidget +{ + Q_OBJECT + Q_PROPERTY( bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled ) + +public: + TQStatusBar( TQWidget* parent=0, const char* name=0 ); + virtual ~TQStatusBar(); + + virtual void addWidget( TQWidget *, int stretch = 0, bool = FALSE ); + virtual void removeWidget( TQWidget * ); + + void setSizeGripEnabled(bool); + bool isSizeGripEnabled() const; + +public slots: + void message( const TQString &); + void message( const TQString &, int ); + void clear(); + +signals: + void messageChanged( const TQString &text ); + +protected: + void paintEvent( TQPaintEvent * ); + void resizeEvent( TQResizeEvent * ); + + void reformat(); + void hideOrShow(); + bool event( TQEvent *); + +private: + TQStatusBarPrivate * d; +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQStatusBar( const TQStatusBar & ); + TQStatusBar& operator=( const TQStatusBar & ); +#endif +}; + +#endif // QT_NO_STATUSBAR + +#endif // TQSTATUSBAR_H diff --git a/src/widgets/ntqsyntaxhighlighter.h b/src/widgets/ntqsyntaxhighlighter.h new file mode 100644 index 000000000..344211008 --- /dev/null +++ b/src/widgets/ntqsyntaxhighlighter.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Definition of the TQSyntaxHighlighter class +** +** Created : 022407 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQSYNTAXHIGHLIGHTER_H +#define TQSYNTAXHIGHLIGHTER_H + +#ifndef QT_H +#include "ntqfont.h" +#include "ntqcolor.h" +#include "ntqstring.h" +#endif // QT_H + +class TQTextEdit; +class TQSyntaxHighlighterInternal; +class TQSyntaxHighlighterPrivate; +class TQTextParagraph; + +class Q_EXPORT TQSyntaxHighlighter : public TQt +{ + friend class TQSyntaxHighlighterInternal; + +public: + TQSyntaxHighlighter( TQTextEdit *textEdit ); + virtual ~TQSyntaxHighlighter(); + + virtual int highlightParagraph( const TQString &text, int endStateOfLastPara ) = 0; + + void setFormat( int start, int count, const TQFont &font, const TQColor &color ); + void setFormat( int start, int count, const TQColor &color ); + void setFormat( int start, int count, const TQFont &font ); + TQTextEdit *textEdit() const { return edit; } + + void rehighlight(); + + int currentParagraph() const; + +private: + TQTextParagraph *para; + TQTextEdit *edit; + TQSyntaxHighlighterPrivate *d; + +}; + +#endif diff --git a/src/widgets/ntqtabbar.h b/src/widgets/ntqtabbar.h new file mode 100644 index 000000000..5428e4c92 --- /dev/null +++ b/src/widgets/ntqtabbar.h @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Definition of TQTab and TQTabBar classes +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTABBAR_H +#define TQTABBAR_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqptrlist.h" +#endif // QT_H + +#ifndef QT_NO_TABBAR + +class TQTabBar; +class TQIconSet; + +class Q_EXPORT TQTab : public TQt +{ + friend class TQTabBar; + friend class TQTabWidget; + +public: + TQTab(); + virtual ~TQTab(); + TQTab( const TQString& text ); + TQTab( const TQIconSet& icon, const TQString& text = TQString::null ); + + void setText( const TQString& text); + TQString text() const { return label; } + void setIconSet( const TQIconSet& icon ); + TQIconSet* iconSet() const { return iconset; } + void setRect( const TQRect& rect ) { r = rect; } + TQRect rect() const { return r; } + void setEnabled( bool enable ) { enabled = enable; } + bool isEnabled() const { return enabled; } + void setIdentifier( int i ) { id = i; } + int identifier() const { return id; } + +private: + void setTabBar( TQTabBar *tb ); + TQString label; + TQRect r; // the bounding rectangle of this (may overlap with others) + bool enabled; + int id; + TQIconSet* iconset; // optional iconset + TQTabBar *tb; +}; + + +struct TQTabPrivate; +//class *TQAccel; + +class Q_EXPORT TQTabBar: public TQWidget +{ + Q_OBJECT + Q_ENUMS( Shape ) + Q_PROPERTY( Shape shape READ shape WRITE setShape ) + Q_PROPERTY( int currentTab READ currentTab WRITE setCurrentTab ) + Q_PROPERTY( int count READ count ) + Q_PROPERTY( int keyboardFocusTab READ keyboardFocusTab ) + +public: + TQTabBar( TQWidget* parent=0, const char* name=0 ); + ~TQTabBar(); + + enum Shape { RoundedAbove, RoundedBelow, + TriangularAbove, TriangularBelow }; + + Shape shape() const; + virtual void setShape( Shape ); + + void show(); + + virtual int addTab( TQTab * ); + virtual int insertTab( TQTab *, int index = -1 ); + virtual void removeTab( TQTab * ); + + virtual void setTabEnabled( int, bool ); + bool isTabEnabled( int ) const; + + + TQSize sizeHint() const; + TQSize minimumSizeHint() 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 & p ) const; + + void removeToolTip( int index ); + void setToolTip( int index, const TQString & tip ); + TQString toolTip( int index ) 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; // ### not const + virtual void paintLabel( TQPainter*, const TQRect&, TQTab*, bool ) const; + + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); + + 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 *e ); + + TQPtrList * tabList(); + +private slots: + void scrollTabs(); + +private: + TQPtrList * l; + TQPtrList * lstatic; + void makeVisible( TQTab* t = 0 ); + void updateArrowButtons(); + TQTabPrivate * d; + + friend class TQTabBarToolTip; + friend class TQTab; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTabBar( const TQTabBar & ); + TQTabBar& operator=( const TQTabBar & ); +#endif +}; + + +#endif // QT_NO_TABBAR + +#endif // TQTABBAR_H diff --git a/src/widgets/ntqtabwidget.h b/src/widgets/ntqtabwidget.h new file mode 100644 index 000000000..439eadf0a --- /dev/null +++ b/src/widgets/ntqtabwidget.h @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Definition of TQTabWidget class +** +** Created : 990318 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTABWIDGET_H +#define TQTABWIDGET_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqiconset.h" +#endif // QT_H + +#ifndef QT_NO_TABWIDGET + +class TQTabBar; +class TQTabWidgetData; +class TQTab; +class TQWidgetStack; + + +class Q_EXPORT TQTabWidget : public TQWidget +{ + Q_OBJECT + Q_ENUMS( TabPosition ) + Q_ENUMS( TabShape ) + Q_PROPERTY( TabPosition tabPosition READ tabPosition WRITE setTabPosition ) + Q_PROPERTY( TabShape tabShape READ tabShape WRITE setTabShape ) + Q_PROPERTY( int margin READ margin WRITE setMargin ) + Q_PROPERTY( int currentPage READ currentPageIndex WRITE setCurrentPage ) + Q_PROPERTY( int count READ count ) + Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) + +public: + TQTabWidget( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + ~TQTabWidget(); + + virtual void addTab( TQWidget *, const TQString & ); // ### make these inline in 4.0 + virtual void addTab( TQWidget *child, const TQIconSet& iconset, + const TQString &label ); + virtual void addTab( TQWidget *, TQTab* ); + + virtual void insertTab( TQWidget *, const TQString &, int index = -1 ); + virtual void insertTab( TQWidget *child, const TQIconSet& iconset, + const TQString &label, int index = -1 ); + virtual void insertTab( TQWidget *, TQTab*, int index = -1 ); + + void changeTab( TQWidget *, const TQString &); + void changeTab( TQWidget *child, const TQIconSet& iconset, + const TQString &label ); + + bool isTabEnabled( TQWidget * ) const; + void setTabEnabled( TQWidget *, bool ); + + void setCornerWidget( TQWidget * w, TQt::Corner corner = TQt::TopRight ); + TQWidget * cornerWidget( TQt::Corner corner = TQt::TopRight ) const; + + TQString tabLabel( TQWidget * ) const; + void setTabLabel( TQWidget *p, const TQString &l ); + + TQIconSet tabIconSet( TQWidget * w ) const; + void setTabIconSet( TQWidget * w, const TQIconSet & iconset ); + + void removeTabToolTip( TQWidget * w ); + void setTabToolTip( TQWidget * w, const TQString & tip ); + TQString tabToolTip( TQWidget * w ) 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 s ); + + 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 * ); +#ifndef Q_QDOC + void selected( const TQString& ); +#endif + +private slots: + void showTab( int ); + +private: + TQTabWidgetData *d; + void setUpLayout( bool = FALSE ); + friend class TQTabDialog; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTabWidget( const TQTabWidget & ); + TQTabWidget& operator=( const TQTabWidget & ); +#endif +}; + +#endif // QT_NO_TABWIDGET + +#endif // TQTABWIDGET_H diff --git a/src/widgets/ntqtextbrowser.h b/src/widgets/ntqtextbrowser.h new file mode 100644 index 000000000..c9a3e5f58 --- /dev/null +++ b/src/widgets/ntqtextbrowser.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Definition of the TQTextBrowser class +** +** Created : 990101 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTBROWSER_H +#define TQTEXTBROWSER_H + +#ifndef QT_H +#include "ntqptrlist.h" +#include "ntqpixmap.h" +#include "ntqcolor.h" +#include "ntqtextedit.h" +#endif // QT_H + +#ifndef QT_NO_TEXTBROWSER + +class TQTextBrowserData; + +class Q_EXPORT TQTextBrowser : public TQTextEdit +{ + Q_OBJECT + Q_PROPERTY( TQString source READ source WRITE setSource ) + Q_OVERRIDE( int undoDepth DESIGNABLE false SCRIPTABLE false ) + Q_OVERRIDE( bool overwriteMode DESIGNABLE false SCRIPTABLE false ) + Q_OVERRIDE( bool modified SCRIPTABLE false) + Q_OVERRIDE( bool readOnly DESIGNABLE false SCRIPTABLE false ) + Q_OVERRIDE( bool undoRedoEnabled DESIGNABLE false SCRIPTABLE false ) + +public: + TQTextBrowser( TQWidget* parent=0, const char* name=0 ); + ~TQTextBrowser(); + + TQString source() const; + +public slots: + virtual void setSource(const TQString& name); + virtual void backward(); + virtual void forward(); + virtual void home(); + virtual void reload(); + void setText( const TQString &txt ) { setText( txt, TQString::null ); } + virtual void setText( const TQString &txt, const TQString &context ); + +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 * e); + +private: + void popupDetail( const TQString& contents, const TQPoint& pos ); + bool linksEnabled() const { return TRUE; } + void emitHighlighted( const TQString &s ); + void emitLinkClicked( const TQString &s ); + TQTextBrowserData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTextBrowser( const TQTextBrowser & ); + TQTextBrowser& operator=( const TQTextBrowser & ); +#endif +}; + +#endif // QT_NO_TEXTBROWSER + +#endif // TQTEXTBROWSER_H diff --git a/src/widgets/ntqtextedit.h b/src/widgets/ntqtextedit.h new file mode 100644 index 000000000..b3e28463d --- /dev/null +++ b/src/widgets/ntqtextedit.h @@ -0,0 +1,616 @@ +/**************************************************************************** +** +** Definition of the TQTextEdit class +** +** Created : 990101 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTEDIT_H +#define TQTEXTEDIT_H + +#ifndef QT_H +#include "ntqscrollview.h" +#include "ntqstylesheet.h" +#include "ntqptrvector.h" +#include "ntqvaluelist.h" +#include "ntqptrlist.h" +#endif // QT_H + +#ifndef QT_NO_TEXTEDIT +// uncomment below to enable optimization mode - also uncomment the +// optimDoAutoScroll() private slot since moc ignores #ifdefs.. +#define QT_TEXTEDIT_OPTIMIZATION + +class TQPainter; +class TQTextDocument; +class TQTextCursor; +class TQKeyEvent; +class TQResizeEvent; +class TQMouseEvent; +class TQTimer; +class TQTextString; +class TQTextCommand; +class TQTextParagraph; +class TQTextFormat; +class TQFont; +class TQColor; +class TQTextEdit; +class TQTextBrowser; +class TQTextString; +struct TQUndoRedoInfoPrivate; +class TQPopupMenu; +class TQTextEditPrivate; +class TQSyntaxHighlighter; + +#ifdef QT_TEXTEDIT_OPTIMIZATION +class TQTextEditOptimPrivate +{ +public: + // Note: no left-tag has any value for leftTag or parent, and + // no right-tag has any formatting flags set. + enum TagType { Color = 0, Format = 1 }; + struct Tag { + TagType type:2; + bool bold:1; + bool italic:1; + bool underline:1; + int line; + int index; + Tag * leftTag; // ptr to left-tag in a left-right tag pair + Tag * parent; // ptr to parent left-tag in a nested tag + Tag * prev; + Tag * next; + TQString tag; + }; + TQTextEditOptimPrivate() + { + len = numLines = maxLineWidth = 0; + selStart.line = selStart.index = -1; + selEnd.line = selEnd.index = -1; + search.line = search.index = 0; + tags = lastTag = 0; + } + void clearTags() + { + Tag * itr = tags; + while ( tags ) { + itr = tags; + tags = tags->next; + delete itr; + } + tags = lastTag = 0; + tagIndex.clear(); + } + ~TQTextEditOptimPrivate() + { + clearTags(); + } + int len; + int numLines; + int maxLineWidth; + struct Selection { + int line; + int index; + }; + Selection selStart, selEnd, search; + Tag * tags, * lastTag; + TQMap lines; + TQMap tagIndex; +}; +#endif + +class Q_EXPORT TQTextEdit : public TQScrollView +{ + friend class TQTextBrowser; + friend class TQSyntaxHighlighter; + + Q_OBJECT + Q_ENUMS( WordWrap WrapPolicy ) + Q_SETS( AutoFormatting ) + Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) + Q_PROPERTY( TQString text READ text WRITE setText ) + Q_PROPERTY( TQBrush paper READ paper WRITE setPaper ) + Q_PROPERTY( bool linkUnderline READ linkUnderline WRITE setLinkUnderline ) + Q_PROPERTY( TQString documentTitle READ documentTitle ) + Q_PROPERTY( int length READ length ) + Q_PROPERTY( WordWrap wordWrap READ wordWrap WRITE setWordWrap ) + Q_PROPERTY( int wrapColumnOrWidth READ wrapColumnOrWidth WRITE setWrapColumnOrWidth ) + Q_PROPERTY( WrapPolicy wrapPolicy READ wrapPolicy WRITE setWrapPolicy ) + Q_PROPERTY( bool hasSelectedText READ hasSelectedText ) + Q_PROPERTY( TQString selectedText READ selectedText ) + Q_PROPERTY( int undoDepth READ undoDepth WRITE setUndoDepth ) + Q_PROPERTY( bool overwriteMode READ isOverwriteMode WRITE setOverwriteMode ) + Q_PROPERTY( bool modified READ isModified WRITE setModified DESIGNABLE false ) + Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) + Q_PROPERTY( bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled ) + Q_PROPERTY( int tabStopWidth READ tabStopWidth WRITE setTabStopWidth ) + Q_PROPERTY( bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus ) + Q_PROPERTY( AutoFormatting autoFormatting READ autoFormatting WRITE setAutoFormatting ) + +public: + enum WordWrap { + NoWrap, + WidgetWidth, + FixedPixelWidth, + FixedColumnWidth + }; + + enum WrapPolicy { + AtWordBoundary, + AtWhiteSpace = AtWordBoundary, // AtWhiteSpace is deprecated + Anywhere, + AtWordOrDocumentBoundary + }; + + enum AutoFormatting { + AutoNone = 0, + AutoBulletList = 0x00000001, + AutoAll = 0xffffffff + }; + + 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 = 0x0001, + CheckNewLines = 0x0002, + RemoveSelected = 0x0004, + AsIMCompositionText = 0x0008, // internal use + WithIMSelection = 0x0010 // internal use + }; + + TQTextEdit( const TQString& text, const TQString& context = TQString::null, + TQWidget* parent=0, const char* name=0); + TQTextEdit( TQWidget* parent=0, const char* name=0 ); + virtual ~TQTextEdit(); + void setPalette( const TQPalette & ); + + TQString text() const; + TQString text( int para ) const; + TextFormat textFormat() const; + TQString context() const; + TQString documentTitle() const; + + void getSelection( int *paraFrom, int *indexFrom, + int *paraTo, int *indexTo, int selNum = 0 ) const; + virtual bool find( const TQString &expr, bool cs, bool wo, bool forward = TRUE, + int *para = 0, int *index = 0 ); + + int paragraphs() const; + int lines() const; + int linesOfParagraph( int para ) const; + int lineOfChar( int para, int chr ); + int length() const; + TQRect paragraphRect( int para ) const; + int paragraphAt( const TQPoint &pos ) const; + int charAt( const TQPoint &pos, int *para ) const; + int paragraphLength( int para ) const; + + TQStyleSheet* styleSheet() const; +#ifndef QT_NO_MIME + TQMimeSourceFactory* mimeSourceFactory() const; +#endif + TQBrush paper() const; + bool linkUnderline() const; + + int heightForWidth( int w ) 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& pos ); + TQString anchorAt( const TQPoint& pos, AnchorAttribute a ); + + TQSize sizeHint() const; + + bool isReadOnly() const { return readonly; } + + void getCursorPosition( int *parag, int *index ) 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; + + // do not use, will go away + virtual bool getFormat( int para, int index, TQFont *font, TQColor *color, VerticalAlignment *verticalAlignment ); + // do not use, will go away + virtual bool getParagraphFormat( int para, TQFont *font, TQColor *color, + VerticalAlignment *verticalAlignment, int *alignment, + TQStyleSheetItem::DisplayMode *displayMode, + TQStyleSheetItem::ListStyle *listStyle, + int *listDepth ); + + + bool isOverwriteMode() const { return overWrite; } + TQColor paragraphBackgroundColor( int para ) const; + + bool isUndoRedoEnabled() const; + bool eventFilter( TQObject *o, TQEvent *e ); + bool tabChangesFocus() const; + + void setAutoFormatting( uint features ); + uint autoFormatting() const; + TQSyntaxHighlighter *syntaxHighlighter() const; + +public slots: + void setEnabled( bool ); +#ifndef QT_NO_MIME + virtual void setMimeSourceFactory( TQMimeSourceFactory* factory ); +#endif + virtual void setStyleSheet( TQStyleSheet* styleSheet ); + virtual void scrollToAnchor( const TQString& name ); + virtual void setPaper( const TQBrush& pap ); + virtual void setLinkUnderline( bool ); + + virtual void setWordWrap( WordWrap mode ); + virtual void setWrapColumnOrWidth( int ); + virtual void setWrapPolicy( WrapPolicy policy ); + + virtual void copy(); + virtual void append( const TQString& text ); + + void setText( const TQString &txt ) { setText( txt, TQString::null ); } + virtual void setText( const TQString &txt, const TQString &context ); + virtual void setTextFormat( TextFormat f ); + + virtual void selectAll( bool select = TRUE ); + virtual void setTabStopWidth( int ts ); + virtual void zoomIn( int range ); + virtual void zoomIn() { zoomIn( 1 ); } + virtual void zoomOut( int range ); + virtual void zoomOut() { zoomOut( 1 ); } + virtual void zoomTo( int size ); + + virtual void sync(); + virtual void setReadOnly( bool b ); + + virtual void undo(); + virtual void redo(); + virtual void cut(); + virtual void paste(); +#ifndef QT_NO_CLIPBOARD + virtual void pasteSubType( const TQCString &subtype ); +#endif + virtual void clear(); + virtual void del(); + virtual void indent(); + virtual void setItalic( bool b ); + virtual void setBold( bool b ); + virtual void setUnderline( bool b ); + virtual void setFamily( const TQString &f ); + virtual void setPointSize( int s ); + virtual void setColor( const TQColor &c ); + virtual void setFont( const TQFont &f ); + virtual void setVerticalAlignment( VerticalAlignment a ); + virtual void setAlignment( int a ); + + // do not use, will go away + virtual void setParagType( TQStyleSheetItem::DisplayMode dm, TQStyleSheetItem::ListStyle listStyle ); + + virtual void setCursorPosition( int parag, int index ); + virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 ); + virtual void setSelectionAttributes( int selNum, const TQColor &back, bool invertText ); + virtual void setModified( bool m ); + virtual void resetFormat(); + virtual void setUndoDepth( int d ); + virtual void setFormat( TQTextFormat *f, int flags ); + virtual void ensureCursorVisible(); + virtual void placeCursor( const TQPoint &pos, TQTextCursor *c = 0 ); + virtual void moveCursor( CursorAction action, bool select ); + virtual void doKeyboardAction( KeyboardAction action ); + virtual void removeSelectedText( int selNum = 0 ); + virtual void removeSelection( int selNum = 0 ); + virtual void setCurrentFont( const TQFont &f ); + virtual void setOverwriteMode( bool b ) { overWrite = b; } + + virtual void scrollToBottom(); + + void insert( const TQString &text, uint insertionFlags = CheckNewLines | RemoveSelected ); // ## virtual in 4.0 + + // obsolete + virtual void insert( const TQString &text, bool, bool = TRUE, bool = TRUE ); + + virtual void insertAt( const TQString &text, int para, int index ); + virtual void removeParagraph( int para ); + virtual void insertParagraph( const TQString &text, int para ); + + virtual void setParagraphBackgroundColor( int para, const TQColor &bg ); + virtual void clearParagraphBackground( int para ); + + virtual void setUndoRedoEnabled( bool b ); + void setTabChangesFocus( bool b ); // ### make virtual in 4.0 + +#ifdef QT_TEXTEDIT_OPTIMIZATION + void polish(); + void setMaxLogLines( int numLines ); + int maxLogLines(); +#endif + +signals: + void textChanged(); + void selectionChanged(); + void copyAvailable( bool ); + void undoAvailable( bool yes ); + void redoAvailable( bool yes ); + void currentFontChanged( const TQFont &f ); + void currentColorChanged( const TQColor &c ); + void currentAlignmentChanged( int a ); + void currentVerticalAlignmentChanged( VerticalAlignment a ); + void cursorPositionChanged( TQTextCursor *c ); + void cursorPositionChanged( int para, int pos ); + void returnPressed(); + void modificationChanged( bool m ); + void clicked( int parag, int index ); + void doubleClicked( int parag, int index ); + +protected: + void repaintChanged(); + void updateStyles(); + void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); + bool event( TQEvent *e ); + void keyPressEvent( TQKeyEvent *e ); + void resizeEvent( TQResizeEvent *e ); + void viewportResizeEvent( TQResizeEvent* ); + void contentsMousePressEvent( TQMouseEvent *e ); + void contentsMouseMoveEvent( TQMouseEvent *e ); + void contentsMouseReleaseEvent( TQMouseEvent *e ); + void contentsMouseDoubleClickEvent( TQMouseEvent *e ); +#ifndef QT_NO_WHEELEVENT + void contentsWheelEvent( TQWheelEvent *e ); +#endif + void imStartEvent( TQIMEvent * ); + void imComposeEvent( TQIMEvent * ); + void imEndEvent( TQIMEvent * ); +#ifndef QT_NO_DRAGANDDROP + void contentsDragEnterEvent( TQDragEnterEvent *e ); + void contentsDragMoveEvent( TQDragMoveEvent *e ); + void contentsDragLeaveEvent( TQDragLeaveEvent *e ); + void contentsDropEvent( TQDropEvent *e ); +#endif + void contentsContextMenuEvent( TQContextMenuEvent *e ); + bool sendMouseEventToInputContext( TQMouseEvent *e ); + bool focusNextPrevChild( bool next ); + TQTextDocument *document() const; + TQTextCursor *textCursor() const; + void setDocument( TQTextDocument *doc ); + virtual TQPopupMenu *createPopupMenu( const TQPoint& pos ); + virtual TQPopupMenu *createPopupMenu(); + void drawCursor( bool visible ); + + void windowActivationChange( bool ); + +protected slots: + virtual void doChangeInterval(); + void sliderReleased(); // ### make virtual in 4.0 +#if (QT_VERSION >= 0x040000) +#error "Some functions need to be changed to virtual for TQt 4.0" +#endif + +private slots: + void formatMore(); + void doResize(); + void autoScrollTimerDone(); + void blinkCursor(); + void setModified(); + void startDrag(); + void documentWidthChanged( int w ); + void clipboardChanged(); + +private: + struct Q_EXPORT UndoRedoInfo { + enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style, IME }; + + UndoRedoInfo( TQTextDocument *dc ); + ~UndoRedoInfo(); + void clear(); + bool valid() const; + + TQUndoRedoInfoPrivate *d; + int id; + int index; + int eid; + int eindex; + TQTextFormat *format; + int flags; + Type type; + TQTextDocument *doc; + TQByteArray styleInformation; + }; + +private: + void updateCursor( const TQPoint & pos ); + void handleMouseMove( const TQPoint& pos ); + void drawContents( TQPainter * ); + virtual bool linksEnabled() const { return FALSE; } + void init(); + void checkUndoRedoInfo( UndoRedoInfo::Type t ); + void updateCurrentFormat(); + bool handleReadOnlyKeyEvent( TQKeyEvent *e ); + void makeParagVisible( TQTextParagraph *p ); + void normalCopy(); + void copyToClipboard(); +#ifndef QT_NO_MIME + TQCString pickSpecial(TQMimeSource* ms, bool always_ask, const TQPoint&); + TQTextDrag *dragObject( TQWidget *parent = 0 ) const; +#endif +#ifndef QT_NO_MIMECLIPBOARD + void pasteSpecial(const TQPoint&); +#endif + void setFontInternal( const TQFont &f ); + + virtual void emitHighlighted( const TQString & ) {} + virtual void emitLinkClicked( const TQString & ) {} + + void readFormats( TQTextCursor &c1, TQTextCursor &c2, TQTextString &text, bool fillStyles = FALSE ); + void clearUndoRedo(); + void paintDocument( bool drawAll, TQPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 ); + void moveCursor( CursorAction action ); + void ensureFormatted( TQTextParagraph *p ); + void placeCursor( const TQPoint &pos, TQTextCursor *c, bool link ); + void updateMicroFocusHint(); + +#ifdef QT_TEXTEDIT_OPTIMIZATION + bool checkOptimMode(); + TQString optimText() const; + void optimSetText( const TQString &str ); + void optimAppend( const TQString &str ); + void optimInsert( const TQString &str, int line, int index ); + void optimDrawContents( TQPainter * p, int cx, int cy, int cw, int ch ); + void optimMousePressEvent( TQMouseEvent * e ); + void optimMouseReleaseEvent( TQMouseEvent * e ); + void optimMouseMoveEvent( TQMouseEvent * e ); + int optimCharIndex( const TQString &str, int mx ) const; + void optimSelectAll(); + void optimRemoveSelection(); + void optimSetSelection( int startLine, int startIdx, int endLine, + int endIdx ); + bool optimHasSelection() const; + TQString optimSelectedText() const; + bool optimFind( const TQString & str, bool, bool, bool, int *, int * ); + void optimParseTags( TQString * str, int lineNo = -1, int indexOffset = 0 ); + TQTextEditOptimPrivate::Tag * optimPreviousLeftTag( int line ); + void optimSetTextFormat( TQTextDocument *, TQTextCursor *, TQTextFormat * f, + int, int, TQTextEditOptimPrivate::Tag * t ); + TQTextEditOptimPrivate::Tag * optimAppendTag( int index, const TQString & tag ); + TQTextEditOptimPrivate::Tag * optimInsertTag( int line, int index, const TQString & tag ); + void optimCheckLimit( const TQString& str ); + bool optimHasBoldMetrics( int line ); + +private slots: + void optimDoAutoScroll(); +#endif // QT_TEXTEDIT_OPTIMIZATION + +private: +#ifndef QT_NO_CLIPBOARD + void pasteSubType( const TQCString &subtype, TQMimeSource *m ); +#endif + +private: + TQTextDocument *doc; + TQTextCursor *cursor; + TQTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer; + TQTextParagraph *lastFormatted; + int interval; + UndoRedoInfo undoRedoInfo; + TQTextFormat *currentFormat; + int currentAlignment; + TQPoint oldMousePos, mousePos; + TQPoint dragStartPos; + TQString onLink; + WordWrap wrapMode; + WrapPolicy wPolicy; + int wrapWidth; + TQString pressedLink; + TQTextEditPrivate *d; + bool inDoubleClick : 1; + bool mousePressed : 1; + bool cursorVisible : 1; + bool blinkCursorVisible : 1; + bool readOnly : 1; + bool modified : 1; + bool mightStartDrag : 1; + bool inDnD : 1; + bool readonly : 1; + bool undoEnabled : 1; + bool overWrite : 1; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQTextEdit( const TQTextEdit & ); + TQTextEdit &operator=( const TQTextEdit & ); +#endif +}; + +inline TQTextDocument *TQTextEdit::document() const +{ + return doc; +} + +inline TQTextCursor *TQTextEdit::textCursor() const +{ + return cursor; +} + +inline void TQTextEdit::setCurrentFont( const TQFont &f ) +{ + TQTextEdit::setFontInternal( f ); +} + +#endif //QT_NO_TEXTEDIT +#endif //TQTEXTVIEW_H diff --git a/src/widgets/ntqtextview.h b/src/widgets/ntqtextview.h new file mode 100644 index 000000000..71c568564 --- /dev/null +++ b/src/widgets/ntqtextview.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Definition of the TQTextView class +** +** Created : 990101 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTEXTVIEW_H +#define TQTEXTVIEW_H + +#ifndef QT_H +#include "ntqtextedit.h" +#endif // QT_H + +#ifndef QT_NO_TEXTVIEW + +class Q_EXPORT TQTextView : public TQTextEdit +{ + Q_OBJECT + Q_OVERRIDE( int undoDepth DESIGNABLE false SCRIPTABLE false ) + Q_OVERRIDE( bool overwriteMode DESIGNABLE false SCRIPTABLE false ) + Q_OVERRIDE( bool modified SCRIPTABLE false) + Q_OVERRIDE( bool readOnly DESIGNABLE false SCRIPTABLE false ) + Q_OVERRIDE( bool undoRedoEnabled DESIGNABLE false SCRIPTABLE false ) + +public: + TQTextView( const TQString& text, const TQString& context = TQString::null, + TQWidget* parent=0, const char* name=0); + TQTextView( TQWidget* parent=0, const char* name=0 ); + + virtual ~TQTextView(); + +private: +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + TQTextView( const TQTextView & ); + TQTextView &operator=( const TQTextView & ); +#endif +}; + +#endif //QT_NO_TEXTVIEW +#endif //TQTEXTVIEW_H diff --git a/src/widgets/ntqtoolbar.h b/src/widgets/ntqtoolbar.h new file mode 100644 index 000000000..f8237f3af --- /dev/null +++ b/src/widgets/ntqtoolbar.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Definition of TQToolBar class +** +** Created : 980306 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTOOLBAR_H +#define TQTOOLBAR_H + +#ifndef QT_H +#include "ntqdockwindow.h" +#endif // QT_H + +#ifndef QT_NO_TOOLBAR + +class TQMainWindow; +class TQButton; +class TQBoxLayout; +class TQToolBarPrivate; + +class Q_EXPORT TQToolBar: public TQDockWindow +{ + Q_OBJECT + Q_PROPERTY( TQString label READ label WRITE setLabel ) + +public: + TQToolBar( const TQString &label, + TQMainWindow *, ToolBarDock = DockTop, + bool newLine = FALSE, const char* name=0 ); + TQToolBar( const TQString &label, TQMainWindow *, TQWidget *, + bool newLine = FALSE, const char* name=0, WFlags f = 0 ); + TQToolBar( TQMainWindow* parent=0, const char* name=0 ); + ~TQToolBar(); + + void addSeparator(); + + void show(); + void hide(); + + TQMainWindow * mainWindow() const; + + virtual void setStretchableWidget( TQWidget * ); + + bool event( TQEvent * e ); + + virtual void setLabel( const TQString & ); + TQString label() const; + + virtual void clear(); + + TQSize minimumSize() const; + TQSize minimumSizeHint() const; + + void setOrientation( Orientation o ); + void setMinimumSize( int minw, int minh ); + +protected: + void resizeEvent( TQResizeEvent *e ); + void styleChange( TQStyle & ); + +private slots: + void createPopup(); + +private: + void init(); + void checkForExtension( const TQSize &sz ); + TQToolBarPrivate * d; + TQMainWindow * mw; + TQWidget * sw; + TQString l; + + friend class TQMainWindow; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQToolBar( const TQToolBar & ); + TQToolBar& operator=( const TQToolBar & ); +#endif +}; + +#endif // QT_NO_TOOLBAR + +#endif // TQTOOLBAR_H diff --git a/src/widgets/ntqtoolbox.h b/src/widgets/ntqtoolbox.h new file mode 100644 index 000000000..07e128e16 --- /dev/null +++ b/src/widgets/ntqtoolbox.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Definition of TQToolBox widget class +** +** Created : 961105 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTOOLBOX_H +#define TQTOOLBOX_H + +#ifndef QT_H +#include +#include +#endif // QT_H + +#ifndef QT_NO_TOOLBOX + +class TQToolBoxPrivate; +class TQWidgetList; + +class Q_EXPORT TQToolBox : public TQFrame +{ + Q_OBJECT + Q_PROPERTY( int currentIndex READ currentIndex WRITE setCurrentIndex ) + Q_PROPERTY( int count READ count ) + +public: + TQToolBox( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + ~TQToolBox(); + + int addItem( TQWidget *item, const TQString &label ); + int addItem( TQWidget *item, const TQIconSet &iconSet, const TQString &label ); + int insertItem( int index, TQWidget *item, const TQString &label ); + int insertItem( int index, TQWidget *item, const TQIconSet &iconSet, const TQString &label ); + + int removeItem( TQWidget *item ); + + void setItemEnabled( int index, bool enabled ); + bool isItemEnabled( int index ) const; + + void setItemLabel( int index, const TQString &label ); + TQString itemLabel( int index ) const; + + void setItemIconSet( int index, const TQIconSet &iconSet ); + TQIconSet itemIconSet( int index ) const; + + void setItemToolTip( int index, const TQString &toolTip ); + TQString itemToolTip( int index ) const; + + TQWidget *currentItem() const; + void setCurrentItem( TQWidget *item ); + + int currentIndex() const; + TQWidget *item( int index ) const; + int indexOf( TQWidget *item ) const; + int count() const; + +public slots: + void setCurrentIndex( int index ); + +signals: + void currentChanged( int index ); + +private slots: + void buttonClicked(); + void itemDestroyed(TQObject*); + +protected: + virtual void itemInserted( int index ); + virtual void itemRemoved( int index ); + void showEvent( TQShowEvent *e ); + void frameChanged(); + void styleChange(TQStyle&); + +private: + void relayout(); + +private: + TQToolBoxPrivate *d; + +}; + + +inline int TQToolBox::addItem( TQWidget *item, const TQString &label ) +{ return insertItem( -1, item, TQIconSet(), label ); } +inline int TQToolBox::addItem( TQWidget *item, const TQIconSet &iconSet, + const TQString &label ) +{ return insertItem( -1, item, iconSet, label ); } +inline int TQToolBox::insertItem( int index, TQWidget *item, const TQString &label ) +{ return insertItem( index, item, TQIconSet(), label ); } + +#endif // QT_NO_TOOLBOX +#endif diff --git a/src/widgets/ntqtoolbutton.h b/src/widgets/ntqtoolbutton.h new file mode 100644 index 000000000..ac2c2df45 --- /dev/null +++ b/src/widgets/ntqtoolbutton.h @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Definition of TQToolButton class +** +** Created : 979899 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTOOLBUTTON_H +#define TQTOOLBUTTON_H + +#ifndef QT_H +#include "ntqbutton.h" +#include "ntqstring.h" +#include "ntqpixmap.h" +#include "ntqiconset.h" +#endif // QT_H + +#ifndef QT_NO_TOOLBUTTON + +class TQToolButtonPrivate; +class TQToolBar; +class TQPopupMenu; + +class Q_EXPORT TQToolButton : public TQButton +{ + Q_OBJECT + Q_ENUMS( TextPosition ) + + Q_PROPERTY( TQIconSet iconSet READ iconSet WRITE setIconSet ) + Q_PROPERTY( TQIconSet onIconSet READ onIconSet WRITE setOnIconSet DESIGNABLE false STORED false ) + Q_PROPERTY( TQIconSet offIconSet READ offIconSet WRITE setOffIconSet DESIGNABLE false STORED false ) + Q_PROPERTY( bool usesBigPixmap READ usesBigPixmap WRITE setUsesBigPixmap ) + Q_PROPERTY( bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel ) + Q_PROPERTY( TQString textLabel READ textLabel WRITE setTextLabel ) + Q_PROPERTY( int popupDelay READ popupDelay WRITE setPopupDelay ) + Q_PROPERTY( bool autoRaise READ autoRaise WRITE setAutoRaise ) + Q_PROPERTY( TextPosition textPosition READ textPosition WRITE setTextPosition ) + + Q_OVERRIDE( bool toggleButton WRITE setToggleButton ) + Q_OVERRIDE( bool on WRITE setOn ) + Q_OVERRIDE( TQPixmap pixmap DESIGNABLE false STORED false ) + Q_OVERRIDE( BackgroundMode backgroundMode DESIGNABLE true) + +public: + enum TextPosition { + BesideIcon, + BelowIcon, + Right = BesideIcon, // obsolete + Under = BelowIcon // obsolete + }; + TQToolButton( TQWidget * parent, const char* name=0 ); +#ifndef QT_NO_TOOLBAR + TQToolButton( const TQIconSet& s, const TQString &textLabel, + const TQString& grouptext, + TQObject * receiver, const char* slot, + TQToolBar * parent, const char* name=0 ); +#endif + TQToolButton( ArrowType type, TQWidget *parent, const char* name=0 ); + ~TQToolButton(); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + +#ifndef QT_NO_COMPAT + void setOnIconSet( const TQIconSet& ); + void setOffIconSet( const TQIconSet& ); + void setIconSet( const TQIconSet &, bool on ); + TQIconSet onIconSet() const; + TQIconSet offIconSet( ) const; + TQIconSet iconSet( bool on ) const; +#endif + virtual void setIconSet( const TQIconSet & ); + TQIconSet iconSet() const; + + bool usesBigPixmap() const { return ubp; } + bool usesTextLabel() const { return utl; } + TQString textLabel() const { return tl; } + +#ifndef QT_NO_POPUPMENU + void setPopup( TQPopupMenu* popup ); + TQPopupMenu* popup() const; + + void setPopupDelay( int delay ); + int popupDelay() const; + + void openPopup(); +#endif + + void setAutoRaise( bool enable ); + bool autoRaise() const; + TextPosition textPosition() const; + + void setText( const TQString &txt ); + +public slots: + virtual void setUsesBigPixmap( bool enable ); + virtual void setUsesTextLabel( bool enable ); + virtual void setTextLabel( const TQString &, bool ); + + virtual void setToggleButton( bool enable ); + + virtual void setOn( bool enable ); + void toggle(); + void setTextLabel( const TQString & ); + void setTextPosition( TextPosition pos ); + +protected: + void mousePressEvent( TQMouseEvent * ); + void drawButton( TQPainter * ); + void drawButtonLabel(TQPainter *); + + void enterEvent( TQEvent * ); + void leaveEvent( TQEvent * ); + void moveEvent( TQMoveEvent * ); + + // ### Make virtual in 4.0, maybe act like TQPushButton with + // regards to setFlat() instead? Andy + bool uses3D() const; +#if (QT_VERSION >= 0x040000) +#error "Some functions need to be changed to virtual for TQt 4.0" +#endif + + bool eventFilter( TQObject *o, TQEvent *e ); + +#ifndef QT_NO_PALETTE + void paletteChange( const TQPalette & ); +#endif + +private slots: + void popupTimerDone(); + void popupPressed(); + +private: + void init(); + + TQPixmap bp; + int bpID; + TQPixmap sp; + int spID; + + TQString tl; + + TQToolButtonPrivate *d; + TQIconSet *s; + + uint utl : 1; + uint ubp : 1; + uint hasArrow : 1; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQToolButton( const TQToolButton & ); + TQToolButton& operator=( const TQToolButton & ); +#endif +}; + +#endif // QT_NO_TOOLBUTTON + +#endif // TQTOOLBUTTON_H diff --git a/src/widgets/ntqtooltip.h b/src/widgets/ntqtooltip.h new file mode 100644 index 000000000..55b3817b1 --- /dev/null +++ b/src/widgets/ntqtooltip.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Definition of Tool Tips (or Balloon Help) for any widget or rectangle +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQTOOLTIP_H +#define TQTOOLTIP_H + +#ifndef QT_H +#include "ntqwidget.h" +#endif // QT_H + +#ifndef QT_NO_TOOLTIP + +#if __GNUC__ - 0 > 3 +#pragma GCC system_header +#endif + +class TQTipManager; +class TQIconViewToolTip; +class TQListViewToolTip; + +class Q_EXPORT TQToolTipGroup: public TQObject +{ + Q_OBJECT + Q_PROPERTY( bool delay READ delay WRITE setDelay ) + Q_PROPERTY( bool enabled READ enabled WRITE setEnabled ) + +public: + TQToolTipGroup( TQObject *parent, const char *name = 0 ); + ~TQToolTipGroup(); + + bool delay() const; + bool enabled() const; + +public slots: + void setDelay( bool ); + void setEnabled( bool ); + +signals: + void showTip( const TQString &); + void removeTip(); + +private: + uint del:1; + uint ena:1; + + friend class TQTipManager; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQToolTipGroup( const TQToolTipGroup & ); + TQToolTipGroup& operator=( const TQToolTipGroup & ); +#endif +}; + + +class Q_EXPORT TQToolTip: public TQt +{ +public: + TQToolTip( TQWidget *, TQToolTipGroup * = 0 ); + //### add virtual d'tor for 4.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 & pos = TQPoint() ); + + static void hide(); + + static TQFont font(); + static void setFont( const TQFont & ); + static TQPalette palette(); + static void setPalette( const TQPalette & ); + +#ifndef QT_NO_COMPAT + static void setEnabled( bool enable ) { setGloballyEnabled( enable ); } + static bool enabled() { return isGloballyEnabled(); } +#endif + static void setGloballyEnabled( bool ); + static bool isGloballyEnabled(); + static void setWakeUpDelay(int); + +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(); + +public: + TQWidget *parentWidget() const { return p; } + TQToolTipGroup *group() const { return g; } + +private: + TQWidget *p; + TQToolTipGroup *g; + static TQFont *ttFont; + static TQPalette *ttPalette; + + friend class TQTipManager; +}; + + +#endif // QT_NO_TOOLTIP + +#endif // TQTOOLTIP_H diff --git a/src/widgets/ntqvalidator.h b/src/widgets/ntqvalidator.h new file mode 100644 index 000000000..04902acd4 --- /dev/null +++ b/src/widgets/ntqvalidator.h @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** Definition of validator classes +** +** Created : 970610 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVALIDATOR_H +#define TQVALIDATOR_H + +#ifndef QT_H +#include "ntqobject.h" +#include "ntqstring.h" // char*->TQString conversion +#include "ntqregexp.h" // TQString->TQRegExp conversion +#endif // QT_H + +#ifndef QT_NO_VALIDATOR + + +class Q_EXPORT TQValidator : public TQObject +{ + Q_OBJECT +public: + TQValidator( TQObject * parent, const char *name = 0 ); + ~TQValidator(); + + enum State { Invalid, Intermediate, Valid=Intermediate, Acceptable }; + + virtual State validate( TQString &, int & ) const = 0; + virtual void fixup( TQString & ) const; + +private: +#if defined(Q_DISABLE_COPY) + TQValidator( const TQValidator & ); + TQValidator& operator=( const TQValidator & ); +#endif +}; + + +class Q_EXPORT TQIntValidator : public TQValidator +{ + Q_OBJECT + Q_PROPERTY( int bottom READ bottom WRITE setBottom ) + Q_PROPERTY( int top READ top WRITE setTop ) + +public: + TQIntValidator( TQObject * parent, const char *name = 0 ); + TQIntValidator( int bottom, int top, + TQObject * parent, const char *name = 0 ); + ~TQIntValidator(); + + TQValidator::State validate( TQString &, int & ) const; + + void setBottom( int ); + void setTop( int ); + virtual void setRange( int bottom, int top ); + + int bottom() const { return b; } + int top() const { return t; } + +private: +#if defined(Q_DISABLE_COPY) + TQIntValidator( const TQIntValidator & ); + TQIntValidator& operator=( const TQIntValidator & ); +#endif + + int b, t; +}; + +#ifndef QT_NO_REGEXP + +class Q_EXPORT TQDoubleValidator : public TQValidator +{ + Q_OBJECT + Q_PROPERTY( double bottom READ bottom WRITE setBottom ) + Q_PROPERTY( double top READ top WRITE setTop ) + Q_PROPERTY( int decimals READ decimals WRITE setDecimals ) + +public: + TQDoubleValidator( TQObject * parent, const char *name = 0 ); + TQDoubleValidator( double bottom, double top, int decimals, + TQObject * parent, const char *name = 0 ); + ~TQDoubleValidator(); + + TQValidator::State validate( TQString &, int & ) const; + + virtual void setRange( double bottom, double top, int decimals = 0 ); + void setBottom( double ); + void setTop( double ); + void setDecimals( int ); + + double bottom() const { return b; } + double top() const { return t; } + int decimals() const { return d; } + +private: +#if defined(Q_DISABLE_COPY) + TQDoubleValidator( const TQDoubleValidator & ); + TQDoubleValidator& operator=( const TQDoubleValidator & ); +#endif + + double b, t; + int d; +}; + + +class Q_EXPORT TQRegExpValidator : public TQValidator +{ + Q_OBJECT + // Q_PROPERTY( TQRegExp regExp READ regExp WRITE setRegExp ) + +public: + TQRegExpValidator( TQObject *parent, const char *name = 0 ); + TQRegExpValidator( const TQRegExp& rx, TQObject *parent, + const char *name = 0 ); + ~TQRegExpValidator(); + + virtual TQValidator::State validate( TQString& input, int& pos ) const; + + void setRegExp( const TQRegExp& rx ); + const TQRegExp& regExp() const { return r; } + +private: +#if defined(Q_DISABLE_COPY) + TQRegExpValidator( const TQRegExpValidator& ); + TQRegExpValidator& operator=( const TQRegExpValidator& ); +#endif + + TQRegExp r; +}; +#endif // QT_NO_REGEXP + + +#endif // QT_NO_VALIDATOR + +#endif // TQVALIDATOR_H diff --git a/src/widgets/ntqvbox.h b/src/widgets/ntqvbox.h new file mode 100644 index 000000000..740a2811c --- /dev/null +++ b/src/widgets/ntqvbox.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Definition of vertical box layout widget class +** +** Created : 990124 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVBOX_H +#define TQVBOX_H + +#ifndef QT_H +#include "ntqhbox.h" +#endif // QT_H + +#ifndef QT_NO_VBOX + +class Q_EXPORT TQVBox : public TQHBox +{ + Q_OBJECT +public: + TQVBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQVBox( const TQVBox & ); + TQVBox& operator=( const TQVBox & ); +#endif +}; + +#endif // QT_NO_VBOX + +#endif // TQVBOX_H diff --git a/src/widgets/ntqvbuttongroup.h b/src/widgets/ntqvbuttongroup.h new file mode 100644 index 000000000..41d3c263c --- /dev/null +++ b/src/widgets/ntqvbuttongroup.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Definition of TQVButtonGroup class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVBUTTONGROUP_H +#define TQVBUTTONGROUP_H + +#ifndef QT_H +#include "ntqbuttongroup.h" +#endif // QT_H + +#ifndef QT_NO_VBUTTONGROUP + +class Q_EXPORT TQVButtonGroup : public TQButtonGroup +{ + Q_OBJECT +public: + TQVButtonGroup( TQWidget* parent=0, const char* name=0 ); + TQVButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); + + ~TQVButtonGroup(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQVButtonGroup( const TQVButtonGroup & ); + TQVButtonGroup &operator=( const TQVButtonGroup & ); +#endif +}; + + +#endif // QT_NO_VBUTTONGROUP + +#endif // TQVBUTTONGROUP_H diff --git a/src/widgets/ntqvgroupbox.h b/src/widgets/ntqvgroupbox.h new file mode 100644 index 000000000..f93158af4 --- /dev/null +++ b/src/widgets/ntqvgroupbox.h @@ -0,0 +1,68 @@ +/********************************************************************** +** +** Definition of TQVGroupBox widget class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVGROUPBOX_H +#define TQVGROUPBOX_H + +#ifndef QT_H +#include "ntqgroupbox.h" +#endif // QT_H + +#ifndef QT_NO_VGROUPBOX + +class Q_EXPORT TQVGroupBox : public TQGroupBox +{ + Q_OBJECT +public: + TQVGroupBox( TQWidget* parent=0, const char* name=0 ); + TQVGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); + + ~TQVGroupBox(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQVGroupBox( const TQVGroupBox & ); + TQVGroupBox &operator=( const TQVGroupBox & ); +#endif +}; + +#endif // QT_NO_VGROUPBOX + +#endif // TQVGROUPBOX_H diff --git a/src/widgets/ntqwhatsthis.h b/src/widgets/ntqwhatsthis.h new file mode 100644 index 000000000..e4cda6c1d --- /dev/null +++ b/src/widgets/ntqwhatsthis.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Definition of TQWhatsThis class +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWHATSTHIS_H +#define TQWHATSTHIS_H + +#ifndef QT_H +#include "ntqobject.h" +#endif // QT_H + +#ifndef QT_NO_WHATSTHIS + +#include "ntqcursor.h" + +class TQToolButton; +class TQPopupMenu; +class TQStyleSheet; + +class Q_EXPORT TQWhatsThis: public TQt +{ +public: + TQWhatsThis( TQWidget *); + virtual ~TQWhatsThis(); + + virtual TQString text( const TQPoint & ); + virtual bool clicked( const TQString& href ); + + // the common static functions + static void setFont( const TQFont &font ); + + static void add( TQWidget *, const TQString &); + static void remove( TQWidget * ); + static TQString textFor( TQWidget *, const TQPoint & pos = TQPoint(), bool includeParents = FALSE ); + + static TQToolButton * whatsThisButton( TQWidget * parent ); + + static void enterWhatsThisMode(); + static bool inWhatsThisMode(); + static void leaveWhatsThisMode( const TQString& = TQString::null, const TQPoint& pos = TQCursor::pos(), TQWidget* w = 0 ); + + static void display( const TQString& text, const TQPoint& pos = TQCursor::pos(), TQWidget* w = 0 ); +}; + +#endif // QT_NO_WHATSTHIS + +#endif // TQWHATSTHIS_H diff --git a/src/widgets/ntqwidgetplugin.h b/src/widgets/ntqwidgetplugin.h new file mode 100644 index 000000000..d53bdd962 --- /dev/null +++ b/src/widgets/ntqwidgetplugin.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Definition of TQWidgetPlugin class +** +** Created : 010920 +** +** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWIDGETPLUGIN_H +#define TQWIDGETPLUGIN_H + +#ifndef QT_H +#include "ntqgplugin.h" +#include "ntqstringlist.h" +#include "ntqiconset.h" +#endif // QT_H +#ifndef QT_NO_WIDGETPLUGIN + +#ifdef Q_WS_WIN +#ifdef QT_PLUGIN +#define QT_WIDGET_PLUGIN_EXPORT __declspec(dllexport) +#else +#define QT_WIDGET_PLUGIN_EXPORT __declspec(dllimport) +#endif +#else +#define QT_WIDGET_PLUGIN_EXPORT +#endif + +class TQWidgetPluginPrivate; +class TQWidget; + +class Q_EXPORT TQWidgetPlugin : public TQGPlugin +{ + Q_OBJECT +public: + TQWidgetPlugin(); + ~TQWidgetPlugin(); + + virtual TQStringList keys() const = 0; + virtual TQWidget *create( const TQString &key, TQWidget *parent = 0, const char *name = 0 ) = 0; + + virtual TQString group( const TQString &key ) const; + virtual TQIconSet iconSet( const TQString &key ) const; + virtual TQString includeFile( const TQString &key ) const; + virtual TQString toolTip( const TQString &key ) const; + virtual TQString whatsThis( const TQString &key ) const; + virtual bool isContainer( const TQString &key ) const; + +private: + TQWidgetPluginPrivate *d; +}; + +#ifdef QT_CONTAINER_CUSTOM_WIDGETS + +class TQWidgetContainerPluginPrivate; + +class Q_EXPORT TQWidgetContainerPlugin : public TQWidgetPlugin +{ + +public: + TQWidgetContainerPlugin(); + ~TQWidgetContainerPlugin(); + + virtual TQWidget* containerOfWidget( const TQString &key, TQWidget *container ) const; + virtual bool isPassiveInteractor( const TQString &key, TQWidget *container ) const; + + virtual bool supportsPages( const TQString &key ) const; + + virtual TQWidget *addPage( const TQString &key, TQWidget *container, + const TQString &name, int index ) const; + virtual void insertPage( const TQString &key, TQWidget *container, + const TQString &name, int index, TQWidget *page ) const; + virtual void removePage( const TQString &key, TQWidget *container, int index ) const; + virtual void movePage( const TQString &key, TQWidget *container, int fromIndex, int toIndex ) const; + virtual int count( const TQString &key, TQWidget *container ) const; + virtual int currentIndex( const TQString &key, TQWidget *container ) const; + virtual TQString pageLabel( const TQString &key, TQWidget *container, int index ) const; + virtual TQWidget *page( const TQString &key, TQWidget *container, int index ) const; + virtual void renamePage( const TQString &key, TQWidget *container, + int index, const TQString &newName ) const; + virtual TQWidgetList pages( const TQString &key, TQWidget *container ) const; + virtual TQString createCode( const TQString &key, const TQString &container, + const TQString &page, const TQString &pageName ) const; +}; + +#endif // QT_CONTAINER_CUSTOM_WIDGETS +#endif // QT_NO_WIDGETPLUGIN +#endif // TQWIDGETPLUGIN_H diff --git a/src/widgets/ntqwidgetstack.h b/src/widgets/ntqwidgetstack.h new file mode 100644 index 000000000..bbb4275fb --- /dev/null +++ b/src/widgets/ntqwidgetstack.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Definition of TQWidgetStack class +** +** Created : 980306 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWIDGETSTACK_H +#define TQWIDGETSTACK_H + +#ifndef QT_H +#include "ntqframe.h" +#include "ntqintdict.h" +#include "ntqptrdict.h" +#endif // QT_H + +#ifndef QT_NO_WIDGETSTACK + + +class TQWidgetStackPrivate; + + +class Q_EXPORT TQWidgetStack: public TQFrame +{ + Q_OBJECT +public: + TQWidgetStack( TQWidget* parent=0, const char* name=0 ); + TQWidgetStack( TQWidget* parent, const char* name, WFlags f); + + ~TQWidgetStack(); + + int addWidget( TQWidget *, 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: + void init(); + + TQWidgetStackPrivate * d; + TQIntDict * dict; + TQPtrDict * focusWidgets; + TQWidget * topWidget; + TQWidget * invisible; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQWidgetStack( const TQWidgetStack & ); + TQWidgetStack& operator=( const TQWidgetStack & ); +#endif +}; + +#endif // QT_NO_WIDGETSTACK + +#endif // TQWIDGETSTACK_H diff --git a/src/widgets/qaction.cpp b/src/widgets/qaction.cpp index 645e8e581..54eb894a1 100644 --- a/src/widgets/qaction.cpp +++ b/src/widgets/qaction.cpp @@ -36,24 +36,24 @@ ** **********************************************************************/ -#include "qaction.h" +#include "ntqaction.h" #ifndef QT_NO_ACTION -#include "qtoolbar.h" -#include "qptrlist.h" -#include "qpopupmenu.h" -#include "qaccel.h" -#include "qtoolbutton.h" -#include "qcombobox.h" -#include "qtooltip.h" -#include "qwhatsthis.h" -#include "qstatusbar.h" -#include "qobjectlist.h" +#include "ntqtoolbar.h" +#include "ntqptrlist.h" +#include "ntqpopupmenu.h" +#include "ntqaccel.h" +#include "ntqtoolbutton.h" +#include "ntqcombobox.h" +#include "ntqtooltip.h" +#include "ntqwhatsthis.h" +#include "ntqstatusbar.h" +#include "ntqobjectlist.h" /*! - \class TQAction qaction.h + \class TQAction ntqaction.h \brief The TQAction class provides an abstract user interface action that can appear both in menus and tool bars. @@ -1376,7 +1376,7 @@ void TQActionGroupPrivate::update( const TQActionGroup* that ) } /*! - \class TQActionGroup qaction.h + \class TQActionGroup ntqaction.h \brief The TQActionGroup class groups actions together. \ingroup basic diff --git a/src/widgets/qaction.h b/src/widgets/qaction.h deleted file mode 100644 index 6b227b3af..000000000 --- a/src/widgets/qaction.h +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** -** -** Definition of TQAction class -** -** Created : 000000 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQACTION_H -#define TQACTION_H - -#ifndef QT_H -#include "qobject.h" -#include "qiconset.h" -#include "qstring.h" -#include "qkeysequence.h" -#endif // QT_H - -#ifndef QT_NO_ACTION - -class TQActionPrivate; -class TQActionGroupPrivate; -class TQStatusBar; -class TQPopupMenu; -class TQToolTipGroup; - -class Q_EXPORT TQAction : public TQObject -{ - Q_OBJECT - Q_PROPERTY( bool toggleAction READ isToggleAction WRITE setToggleAction) - Q_PROPERTY( bool on READ isOn WRITE setOn ) - Q_PROPERTY( bool enabled READ isEnabled WRITE setEnabled ) - Q_PROPERTY( TQIconSet iconSet READ iconSet WRITE setIconSet ) - Q_PROPERTY( TQString text READ text WRITE setText ) - Q_PROPERTY( TQString menuText READ menuText WRITE setMenuText ) - Q_PROPERTY( TQString toolTip READ toolTip WRITE setToolTip ) - Q_PROPERTY( TQString statusTip READ statusTip WRITE setStatusTip ) - Q_PROPERTY( TQString whatsThis READ whatsThis WRITE setWhatsThis ) -#ifndef QT_NO_ACCEL - Q_PROPERTY( TQKeySequence accel READ accel WRITE setAccel ) -#endif - Q_PROPERTY( bool visible READ isVisible WRITE setVisible ) - -public: - TQAction( TQObject* parent, const char* name = 0 ); -#ifndef QT_NO_ACCEL - TQAction( const TQString& menuText, TQKeySequence accel, - TQObject* parent, const char* name = 0 ); - TQAction( const TQIconSet& icon, const TQString& menuText, TQKeySequence accel, - TQObject* parent, const char* name = 0 ); - - TQAction( const TQString& text, const TQIconSet& icon, const TQString& menuText, TQKeySequence accel, - TQObject* parent, const char* name = 0, bool toggle = FALSE ); // obsolete - TQAction( const TQString& text, const TQString& menuText, TQKeySequence accel, TQObject* parent, - const char* name = 0, bool toggle = FALSE ); // obsolete -#endif - TQAction( TQObject* parent, const char* name , bool toggle ); // obsolete - ~TQAction(); - - 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; -#ifndef QT_NO_ACCEL - virtual void setAccel( const TQKeySequence& key ); - TQKeySequence accel() const; -#endif - 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 *actionWidget, TQWidget *container ); - virtual void addedTo( int index, TQPopupMenu *menu ); - -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 slots: - void internalActivation(); - void toolButtonToggled( bool ); - void objectDestroyed(); - void menuStatusText( int id ); - void showStatusText( const TQString& ); - void clearStatusText(); - -private: - void init(); - - friend class TQActionGroup; - friend class TQActionGroupPrivate; - TQActionPrivate* d; - -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQAction( const TQAction & ); - TQAction &operator=( const TQAction & ); -#endif -}; - -class Q_EXPORT TQActionGroup : public TQAction -{ - Q_OBJECT - Q_PROPERTY( bool exclusive READ isExclusive WRITE setExclusive ) - Q_PROPERTY( bool usesDropDown READ usesDropDown WRITE setUsesDropDown ) - -public: - TQActionGroup( TQObject* parent, const char* name = 0 ); - TQActionGroup( TQObject* parent, const char* name , bool exclusive ); // obsolete - ~TQActionGroup(); - void setExclusive( bool ); - bool isExclusive() const; - void add( TQAction* a); - void addSeparator(); - bool addTo( TQWidget* ); - bool removeFrom( TQWidget* ); - void setEnabled( bool ); - void setToggleAction( bool toggle ); - void setOn( bool on ); - - void setUsesDropDown( bool enable ); - 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 *actionWidget, TQWidget *container, TQAction *a ); - virtual void addedTo( int index, TQPopupMenu *menu, TQAction *a ); - virtual void addedTo( TQWidget *actionWidget, TQWidget *container ); - virtual void addedTo( int index, TQPopupMenu *menu ); - -signals: - void selected( TQAction* ); - -private slots: - void childToggled( bool ); - void childDestroyed(); - void internalComboBoxActivated( int ); - void internalComboBoxHighlighted( int ); - void internalToggle( TQAction* ); - void objectDestroyed(); - -private: - TQActionGroupPrivate* d; - -#ifndef QT_NO_COMPAT -public: - void insert( TQAction* a ) { add( a ); } -#endif - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQActionGroup( const TQActionGroup & ); - TQActionGroup &operator=( const TQActionGroup & ); -#endif -}; - -#endif - -#endif diff --git a/src/widgets/qbutton.cpp b/src/widgets/qbutton.cpp index 220dba2fe..a34486808 100644 --- a/src/widgets/qbutton.cpp +++ b/src/widgets/qbutton.cpp @@ -39,22 +39,22 @@ **********************************************************************/ #undef QT_NO_COMPAT -#include "qbutton.h" +#include "ntqbutton.h" #ifndef QT_NO_BUTTON -#include "qbuttongroup.h" -#include "qbitmap.h" -#include "qpainter.h" -#include "qtimer.h" -#include "qaccel.h" -#include "qpixmapcache.h" -#include "qapplication.h" -#include "qpushbutton.h" -#include "qradiobutton.h" -#include "qguardedptr.h" +#include "ntqbuttongroup.h" +#include "ntqbitmap.h" +#include "ntqpainter.h" +#include "ntqtimer.h" +#include "ntqaccel.h" +#include "ntqpixmapcache.h" +#include "ntqapplication.h" +#include "ntqpushbutton.h" +#include "ntqradiobutton.h" +#include "ntqguardedptr.h" #include "../kernel/qinternal_p.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #define AUTO_REPEAT_DELAY 300 @@ -127,7 +127,7 @@ TQTimer *TQButton::timer() /*! - \class TQButton qbutton.h + \class TQButton ntqbutton.h \brief The TQButton class is the abstract base class of button widgets, providing functionality common to buttons. diff --git a/src/widgets/qbutton.h b/src/widgets/qbutton.h deleted file mode 100644 index dceaa0f8d..000000000 --- a/src/widgets/qbutton.h +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** -** -** Definition of TQButton widget class -** -** Created : 940206 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQBUTTON_H -#define TQBUTTON_H - -#ifndef QT_H -#include "qwidget.h" -#include "qkeysequence.h" -#endif // QT_H - -#ifndef QT_NO_BUTTON - - -class TQButtonGroup; -class TQToolBar; -class TQButtonData; - -class Q_EXPORT TQButton : public TQWidget -{ - Q_OBJECT - Q_ENUMS( ToggleType ToggleState ) - Q_PROPERTY( TQString text READ text WRITE setText ) - Q_PROPERTY( TQPixmap pixmap READ pixmap WRITE setPixmap ) - Q_PROPERTY( TQKeySequence accel READ accel WRITE setAccel ) - Q_PROPERTY( bool toggleButton READ isToggleButton ) - Q_PROPERTY( ToggleType toggleType READ toggleType ) - Q_PROPERTY( bool down READ isDown WRITE setDown DESIGNABLE false ) - Q_PROPERTY( bool on READ isOn ) - Q_PROPERTY( ToggleState toggleState READ state ) - Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false ) - Q_PROPERTY( bool autoRepeat READ autoRepeat WRITE setAutoRepeat ) - Q_PROPERTY( bool exclusiveToggle READ isExclusiveToggle ) - -public: - TQButton( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - ~TQButton(); - - TQString text() const; - virtual void setText( const TQString &); - const TQPixmap *pixmap() const; - virtual void setPixmap( const TQPixmap & ); - -#ifndef QT_NO_ACCEL - TQKeySequence accel() const; - virtual void setAccel( const TQKeySequence& ); -#endif - - 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; - -#ifndef QT_NO_COMPAT - bool autoResize() const; - void setAutoResize( bool ); -#endif - - 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 &pos ) 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 slots: - void animateTimeout(); - void autoRepeatTimeout(); - void emulateClick(); - -private: - TQString btext; - TQPixmap *bpixmap; - uint toggleTyp : 2; - uint buttonDown : 1; - uint stat : 2; - uint mlbDown : 1; - uint autoresize : 1; - uint animation : 1; - uint repeat : 1; - TQButtonData *d; - - friend class TQButtonGroup; - friend class TQToolBar; - void ensureData(); - virtual void setGroup( TQButtonGroup* ); - TQTimer *timer(); - void nextState(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQButton( const TQButton & ); - TQButton &operator=( const TQButton & ); -#endif -}; - - -inline TQString TQButton::text() const -{ - return btext; -} - -inline const TQPixmap *TQButton::pixmap() const -{ - return bpixmap; -} - -inline bool TQButton::isToggleButton() const -{ - return ToggleType(toggleTyp) != SingleShot; -} - -inline bool TQButton::isDown() const -{ - return buttonDown; -} - -inline bool TQButton::isOn() const -{ - return ToggleState(stat) != Off; -} - -#ifndef QT_NO_COMPAT -inline bool TQButton::autoResize() const -{ - return autoresize; -} -#endif - -inline bool TQButton::autoRepeat() const -{ - return repeat; -} - -inline TQButton::ToggleState TQButton::state() const -{ - return ToggleState(stat); -} - -inline void TQButton::setToggleButton( bool b ) -{ - setToggleType( b ? Toggle : SingleShot ); -} - -inline void TQButton::setOn( bool y ) -{ - setState( y ? On : Off ); -} - -inline TQButton::ToggleType TQButton::toggleType() const -{ - return ToggleType(toggleTyp); -} - - -#endif // QT_NO_BUTTON - -#endif // TQBUTTON_H diff --git a/src/widgets/qbuttongroup.cpp b/src/widgets/qbuttongroup.cpp index b8aa7c85c..17bcd200b 100644 --- a/src/widgets/qbuttongroup.cpp +++ b/src/widgets/qbuttongroup.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qbuttongroup.h" +#include "ntqbuttongroup.h" #ifndef QT_NO_BUTTONGROUP -#include "qbutton.h" -#include "qptrlist.h" -#include "qapplication.h" -#include "qradiobutton.h" +#include "ntqbutton.h" +#include "ntqptrlist.h" +#include "ntqapplication.h" +#include "ntqradiobutton.h" /*! - \class TQButtonGroup qbuttongroup.h + \class TQButtonGroup ntqbuttongroup.h \brief The TQButtonGroup widget organizes TQButton widgets in a group. \ingroup organizers diff --git a/src/widgets/qbuttongroup.h b/src/widgets/qbuttongroup.h deleted file mode 100644 index edb28aeb7..000000000 --- a/src/widgets/qbuttongroup.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Definition of TQButtonGroup class -** -** Created : 950130 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQBUTTONGROUP_H -#define TQBUTTONGROUP_H - -#ifndef QT_H -#include "qgroupbox.h" -#endif // QT_H - -#ifndef QT_NO_BUTTONGROUP - - -class TQButton; -class TQButtonList; - - -class Q_EXPORT TQButtonGroup : public TQGroupBox -{ - Q_OBJECT - Q_PROPERTY( bool exclusive READ isExclusive WRITE setExclusive ) - Q_PROPERTY( bool radioButtonExclusive READ isRadioButtonExclusive WRITE setRadioButtonExclusive ) - Q_PROPERTY( int selectedId READ selectedId WRITE setButton ) - -public: - TQButtonGroup( TQWidget* parent=0, const char* name=0 ); - TQButtonGroup( const TQString &title, - TQWidget* parent=0, const char* name=0 ); - TQButtonGroup( int columns, Orientation o, - TQWidget* parent=0, const char* name=0 ); - TQButtonGroup( int columns, Orientation o, const TQString &title, - TQWidget* parent=0, const char* name=0 ); - ~TQButtonGroup(); - - bool isExclusive() const; - bool isRadioButtonExclusive() const { return radio_excl; } - virtual void setExclusive( bool ); - virtual void setRadioButtonExclusive( bool ); - -public: - int insert( TQButton *, int id=-1 ); - void remove( TQButton * ); - TQButton *find( int id ) const; - int id( TQButton * ) const; - int count() const; - - virtual void setButton( int id ); - - virtual void moveFocus( int ); - - TQButton *selected() const; - int selectedId() const; - -signals: - void pressed( int id ); - void released( int id ); - void clicked( int id ); - -protected slots: - void buttonPressed(); - void buttonReleased(); - void buttonClicked(); - void buttonToggled( bool on ); - -protected: - bool event( TQEvent * e ); - -private: - void init(); - bool excl_grp; - bool radio_excl; - TQButtonList *buttons; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQButtonGroup( const TQButtonGroup & ); - TQButtonGroup &operator=( const TQButtonGroup & ); -#endif -}; - - -#endif // QT_NO_BUTTONGROUP - -#endif // TQBUTTONGROUP_H diff --git a/src/widgets/qcheckbox.cpp b/src/widgets/qcheckbox.cpp index 7b63674fd..b4982a167 100644 --- a/src/widgets/qcheckbox.cpp +++ b/src/widgets/qcheckbox.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qcheckbox.h" +#include "ntqcheckbox.h" #ifndef QT_NO_CHECKBOX -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qpixmapcache.h" -#include "qbitmap.h" -#include "qtextstream.h" -#include "qapplication.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqpixmapcache.h" +#include "ntqbitmap.h" +#include "ntqtextstream.h" +#include "ntqapplication.h" +#include "ntqstyle.h" /*! - \class TQCheckBox qcheckbox.h + \class TQCheckBox ntqcheckbox.h \brief The TQCheckBox widget provides a checkbox with a text label. \ingroup basic diff --git a/src/widgets/qcheckbox.h b/src/widgets/qcheckbox.h deleted file mode 100644 index 7c0dc9dfb..000000000 --- a/src/widgets/qcheckbox.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Definition of TQCheckBox class -** -** Created : 940222 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCHECKBOX_H -#define TQCHECKBOX_H - -#ifndef QT_H -#include "qbutton.h" -#endif // QT_H - -#ifndef QT_NO_CHECKBOX - -class Q_EXPORT TQCheckBox : public TQButton -{ - Q_OBJECT - Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) - Q_PROPERTY( bool tristate READ isTristate WRITE setTristate ) - Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) - -public: - TQCheckBox( TQWidget *parent, const char* name=0 ); - TQCheckBox( const TQString &text, TQWidget *parent, const char* name=0 ); - - bool isChecked() const; - - void setNoChange(); - - void setTristate(bool y=TRUE); - bool isTristate() const; - - TQSize sizeHint() const; - -public slots: - void setChecked( bool check ); - -protected: - void resizeEvent( TQResizeEvent* ); - void drawButton( TQPainter * ); - void drawButtonLabel( TQPainter * ); - void updateMask(); - bool hitButton( const TQPoint &pos ) const; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQCheckBox( const TQCheckBox & ); - TQCheckBox &operator=( const TQCheckBox & ); -#endif -}; - - -inline bool TQCheckBox::isChecked() const -{ return isOn(); } - -inline void TQCheckBox::setChecked( bool check ) -{ setOn( check ); } - - -#endif // QT_NO_CHECKBOX - -#endif // TQCHECKBOX_H diff --git a/src/widgets/qcombobox.cpp b/src/widgets/qcombobox.cpp index 1e12906f4..59fa0244b 100644 --- a/src/widgets/qcombobox.cpp +++ b/src/widgets/qcombobox.cpp @@ -38,29 +38,29 @@ ** **********************************************************************/ -#include "qcombobox.h" +#include "ntqcombobox.h" #ifndef QT_NO_COMBOBOX -#include "qpopupmenu.h" -#include "qlistbox.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qstrlist.h" -#include "qpixmap.h" -#include "qtimer.h" -#include "qapplication.h" -#include "qlineedit.h" -#include "qbitmap.h" +#include "ntqpopupmenu.h" +#include "ntqlistbox.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqstrlist.h" +#include "ntqpixmap.h" +#include "ntqtimer.h" +#include "ntqapplication.h" +#include "ntqlineedit.h" +#include "ntqbitmap.h" #include "qeffects_p.h" -#include "qstringlist.h" -#include "qcombobox.h" -#include "qstyle.h" +#include "ntqstringlist.h" +#include "ntqcombobox.h" +#include "ntqstyle.h" #include #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif /*! - \class TQComboBox qcombobox.h + \class TQComboBox ntqcombobox.h \brief The TQComboBox widget is a combined button and popup list. \ingroup basic diff --git a/src/widgets/qcombobox.h b/src/widgets/qcombobox.h deleted file mode 100644 index f3f073f61..000000000 --- a/src/widgets/qcombobox.h +++ /dev/null @@ -1,206 +0,0 @@ -/********************************************************************** -** -** Definition of TQComboBox class -** -** Created : 950426 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCOMBOBOX_H -#define TQCOMBOBOX_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_COMBOBOX - - -class TQStrList; -class TQStringList; -class TQLineEdit; -class TQValidator; -class TQListBox; -class TQComboBoxData; -class TQWheelEvent; - -class Q_EXPORT TQComboBox : public TQWidget -{ - Q_OBJECT - Q_ENUMS( Policy ) - Q_PROPERTY( bool editable READ editable WRITE setEditable ) - Q_PROPERTY( int count READ count ) - Q_PROPERTY( TQString currentText READ currentText WRITE setCurrentText DESIGNABLE false ) - Q_PROPERTY( int currentItem READ currentItem WRITE setCurrentItem ) - Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false ) - Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) - Q_PROPERTY( int maxCount READ maxCount WRITE setMaxCount ) - Q_PROPERTY( Policy insertionPolicy READ insertionPolicy WRITE setInsertionPolicy ) - Q_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion ) - Q_PROPERTY( bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled ) - Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) - -public: - TQComboBox( TQWidget* parent=0, const char* name=0 ); - TQComboBox( bool rw, TQWidget* parent=0, const char* name=0 ); - ~TQComboBox(); - - int count() const; - - void insertStringList( const TQStringList &, int index=-1 ); - void insertStrList( const TQStrList &, int index=-1 ); - void insertStrList( const TQStrList *, int index=-1 ); - void insertStrList( const char **, int numStrings=-1, int index=-1); - - void insertItem( const TQString &text, int index=-1 ); - void insertItem( const TQPixmap &pixmap, int index=-1 ); - void insertItem( const TQPixmap &pixmap, const TQString &text, int index=-1 ); - - void removeItem( int index ); - - int currentItem() const; - virtual void setCurrentItem( int index ); - - TQString currentText() const; - virtual void setCurrentText( const TQString& ); - - TQString text( int index ) const; - const TQPixmap *pixmap( int index ) const; - - void changeItem( const TQString &text, int index ); - void changeItem( const TQPixmap &pixmap, int index ); - void changeItem( const TQPixmap &pixmap, const TQString &text, int index ); - - 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 ); - Policy insertionPolicy() const; - - virtual void setValidator( const TQValidator * ); - const TQValidator * validator() const; - - virtual void setListBox( TQListBox * ); - TQListBox * listBox() const; - - virtual void setLineEdit( TQLineEdit *edit ); - TQLineEdit* lineEdit() const; - - virtual void setAutoCompletion( bool ); - bool autoCompletion() const; - - bool eventFilter( TQObject *object, TQEvent *event ); - - void setDuplicatesEnabled( bool enable ); - 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 index ); - void highlighted( int index ); - void activated( const TQString &); - void highlighted( const TQString &); - void textChanged( const TQString &); - -private slots: - void internalActivate( int ); - void internalHighlight( int ); - void internalClickTimeout(); - void returnPressed(); - -protected: - void paintEvent( TQPaintEvent * ); - void resizeEvent( TQResizeEvent * ); - void mousePressEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - void mouseDoubleClickEvent( TQMouseEvent * ); - void keyPressEvent( TQKeyEvent *e ); - void focusInEvent( TQFocusEvent *e ); - void focusOutEvent( TQFocusEvent *e ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent *e ); -#endif - void styleChange( TQStyle& ); - - void updateMask(); - -private: - void setUpListBox(); - void setUpLineEdit(); - void popDownListBox(); - void reIndex(); - void currentChanged(); - int completionIndex( const TQString &, int ) const; - - TQComboBoxData *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQComboBox( const TQComboBox & ); - TQComboBox &operator=( const TQComboBox & ); -#endif -}; - - -#endif // QT_NO_COMBOBOX - -#endif // TQCOMBOBOX_H diff --git a/src/widgets/qdatetimeedit.cpp b/src/widgets/qdatetimeedit.cpp index 9f82aa519..6a8d274c6 100644 --- a/src/widgets/qdatetimeedit.cpp +++ b/src/widgets/qdatetimeedit.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qdatetimeedit.h" +#include "ntqdatetimeedit.h" #ifndef QT_NO_DATETIMEEDIT #include "../kernel/qinternal_p.h" #include "../kernel/qrichtext_p.h" -#include "qrangecontrol.h" -#include "qapplication.h" -#include "qpixmap.h" -#include "qapplication.h" -#include "qvaluelist.h" -#include "qstring.h" -#include "qstyle.h" +#include "ntqrangecontrol.h" +#include "ntqapplication.h" +#include "ntqpixmap.h" +#include "ntqapplication.h" +#include "ntqvaluelist.h" +#include "ntqstring.h" +#include "ntqstyle.h" #if defined(Q_WS_WIN) #include "qt_windows.h" @@ -845,7 +845,7 @@ public: /*! - \class TQDateEdit qdatetimeedit.h + \class TQDateEdit ntqdatetimeedit.h \brief The TQDateEdit class provides a date editor. \ingroup advanced @@ -1781,7 +1781,7 @@ public: }; /*! - \class TQTimeEdit qdatetimeedit.h + \class TQTimeEdit ntqdatetimeedit.h \brief The TQTimeEdit class provides a time editor. \ingroup advanced @@ -2600,7 +2600,7 @@ public: }; /*! - \class TQDateTimeEdit qdatetimeedit.h + \class TQDateTimeEdit ntqdatetimeedit.h \brief The TQDateTimeEdit class combines a TQDateEdit and TQTimeEdit widget into a single widget for editing datetimes. diff --git a/src/widgets/qdatetimeedit.h b/src/widgets/qdatetimeedit.h deleted file mode 100644 index f725149e7..000000000 --- a/src/widgets/qdatetimeedit.h +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** -** -** Definition of date and time edit classes -** -** Created : 001103 -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDATETIMEEDIT_H -#define TQDATETIMEEDIT_H - -#ifndef QT_H -#include "qwidget.h" -#include "qstring.h" -#include "qdatetime.h" -#endif // QT_H - -#ifndef QT_NO_DATETIMEEDIT - -class Q_EXPORT TQDateTimeEditBase : public TQWidget -{ - Q_OBJECT -public: - TQDateTimeEditBase( TQWidget* parent=0, const char* name=0 ) - : TQWidget( parent, name ) {} - - virtual bool setFocusSection( int sec ) = 0; - virtual TQString sectionFormattedText( int sec ) = 0; - virtual void addNumber( int sec, int num ) = 0; - virtual void removeLastNumber( int sec ) = 0; - -public slots: - virtual void stepUp() = 0; - virtual void stepDown() = 0; - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDateTimeEditBase( const TQDateTimeEditBase & ); - TQDateTimeEditBase &operator=( const TQDateTimeEditBase & ); -#endif -}; - -class TQDateEditPrivate; - -class Q_EXPORT TQDateEdit : public TQDateTimeEditBase -{ - Q_OBJECT - Q_ENUMS( Order ) - Q_PROPERTY( Order order READ order WRITE setOrder ) - Q_PROPERTY( TQDate date READ date WRITE setDate ) - Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance ) - Q_PROPERTY( TQDate maxValue READ maxValue WRITE setMaxValue ) - Q_PROPERTY( TQDate minValue READ minValue WRITE setMinValue ) - -public: - TQDateEdit( TQWidget* parent=0, const char* name=0 ); - TQDateEdit( const TQDate& date, TQWidget* parent=0, const char* name=0 ); - ~TQDateEdit(); - - enum Order { DMY, MDY, YMD, YDM }; - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - -public slots: - virtual void setDate( const TQDate& date ); - -public: - TQDate date() const; - virtual void setOrder( Order order ); - Order order() const; - virtual void setAutoAdvance( bool advance ); - bool autoAdvance() const; - - virtual void setMinValue( const TQDate& d ) { setRange( d, maxValue() ); } - TQDate minValue() const; - virtual void setMaxValue( const TQDate& d ) { setRange( minValue(), d ); } - TQDate maxValue() const; - virtual void setRange( const TQDate& min, const TQDate& max ); - TQString separator() const; - virtual void setSeparator( const TQString& s ); - - // Make removeFirstNumber() virtual in TQDateTimeEditBase in 4.0 - void removeFirstNumber( int sec ); - -signals: - void valueChanged( const TQDate& date ); - -protected: - bool event( TQEvent *e ); - void timerEvent( TQTimerEvent * ); - void resizeEvent( TQResizeEvent * ); - void stepUp(); - void stepDown(); - TQString sectionFormattedText( int sec ); - void addNumber( int sec, int num ); - - void removeLastNumber( int sec ); - bool setFocusSection( int s ); - - virtual void setYear( int year ); - virtual void setMonth( int month ); - virtual void setDay( int day ); - virtual void fix(); - virtual bool outOfRange( int y, int m, int d ) const; - -protected slots: - void updateButtons(); - -private: - void init(); - int sectionOffsetEnd( int sec ) const; - int sectionLength( int sec ) const; - TQString sectionText( int sec ) const; - TQDateEditPrivate* d; - -#if defined(Q_DISABLE_COPY) - TQDateEdit( const TQDateEdit & ); - TQDateEdit &operator=( const TQDateEdit & ); -#endif -}; - -class TQTimeEditPrivate; - -class Q_EXPORT TQTimeEdit : public TQDateTimeEditBase -{ - Q_OBJECT - Q_SETS( Display ) - Q_PROPERTY( TQTime time READ time WRITE setTime ) - Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance ) - Q_PROPERTY( TQTime maxValue READ maxValue WRITE setMaxValue ) - Q_PROPERTY( TQTime minValue READ minValue WRITE setMinValue ) - Q_PROPERTY( Display display READ display WRITE setDisplay ) - -public: - enum Display { - Hours = 0x01, - Minutes = 0x02, - Seconds = 0x04, - /*Reserved = 0x08,*/ - AMPM = 0x10 - }; - - TQTimeEdit( TQWidget* parent=0, const char* name=0 ); - TQTimeEdit( const TQTime& time, TQWidget* parent=0, const char* name=0 ); - ~TQTimeEdit(); - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - -public slots: - virtual void setTime( const TQTime& time ); - -public: - TQTime time() const; - virtual void setAutoAdvance( bool advance ); - bool autoAdvance() const; - - virtual void setMinValue( const TQTime& d ) { setRange( d, maxValue() ); } - TQTime minValue() const; - virtual void setMaxValue( const TQTime& d ) { setRange( minValue(), d ); } - TQTime maxValue() const; - virtual void setRange( const TQTime& min, const TQTime& max ); - TQString separator() const; - virtual void setSeparator( const TQString& s ); - - uint display() const; - void setDisplay( uint disp ); - - // Make removeFirstNumber() virtual in TQDateTimeEditBase in 4.0 - void removeFirstNumber( int sec ); - -signals: - void valueChanged( const TQTime& time ); - -protected: - bool event( TQEvent *e ); - void timerEvent( TQTimerEvent *e ); - void resizeEvent( TQResizeEvent * ); - void stepUp(); - void stepDown(); - TQString sectionFormattedText( int sec ); - void addNumber( int sec, int num ); - void removeLastNumber( int sec ); - bool setFocusSection( int s ); - - virtual bool outOfRange( int h, int m, int s ) const; - virtual void setHour( int h ); - virtual void setMinute( int m ); - virtual void setSecond( int s ); - -protected slots: - void updateButtons(); - -private: - void init(); - TQString sectionText( int sec ); - TQTimeEditPrivate* d; - -#if defined(Q_DISABLE_COPY) - TQTimeEdit( const TQTimeEdit & ); - TQTimeEdit &operator=( const TQTimeEdit & ); -#endif -}; - - -class TQDateTimeEditPrivate; - -class Q_EXPORT TQDateTimeEdit : public TQWidget -{ - Q_OBJECT - Q_PROPERTY( TQDateTime dateTime READ dateTime WRITE setDateTime ) - -public: - TQDateTimeEdit( TQWidget* parent=0, const char* name=0 ); - TQDateTimeEdit( const TQDateTime& datetime, TQWidget* parent=0, - const char* name=0 ); - ~TQDateTimeEdit(); - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - -public slots: - virtual void setDateTime( const TQDateTime & dt ); - -public: - TQDateTime dateTime() const; - - TQDateEdit* dateEdit() { return de; } - TQTimeEdit* timeEdit() { return te; } - - virtual void setAutoAdvance( bool advance ); - bool autoAdvance() const; - -signals: - void valueChanged( const TQDateTime& datetime ); - -protected: - // ### make init() private in TQt 4.0 - void init(); - void resizeEvent( TQResizeEvent * ); - -protected slots: - // ### make these two functions private in TQt 4.0, - // and merge them into one with no parameter - void newValue( const TQDate& d ); - void newValue( const TQTime& t ); - -private: - TQDateEdit* de; - TQTimeEdit* te; - TQDateTimeEditPrivate* d; - -#if defined(Q_DISABLE_COPY) - TQDateTimeEdit( const TQDateTimeEdit & ); - TQDateTimeEdit &operator=( const TQDateTimeEdit & ); -#endif -}; - -#endif -#endif diff --git a/src/widgets/qdial.cpp b/src/widgets/qdial.cpp index b7736f5eb..683a634f7 100644 --- a/src/widgets/qdial.cpp +++ b/src/widgets/qdial.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qdial.h" +#include "ntqdial.h" #ifndef QT_NO_DIAL -#include "qpainter.h" -#include "qpointarray.h" -#include "qcolor.h" -#include "qapplication.h" -#include "qregion.h" -#include "qbitmap.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqpointarray.h" +#include "ntqcolor.h" +#include "ntqapplication.h" +#include "ntqregion.h" +#include "ntqbitmap.h" +#include "ntqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #include // sin(), cos(), atan() @@ -87,7 +87,7 @@ public: /*! - \class TQDial qdial.h + \class TQDial ntqdial.h \brief The TQDial class provides a rounded range control (like a speedometer or potentiometer). diff --git a/src/widgets/qdial.h b/src/widgets/qdial.h deleted file mode 100644 index e171a6b07..000000000 --- a/src/widgets/qdial.h +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Definition of the dial widget -** -** Created : 990104 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - - -#ifndef TQDIAL_H -#define TQDIAL_H - -#ifndef QT_H -#include "qwidget.h" -#include "qrangecontrol.h" -#endif // QT_H - -#ifndef QT_NO_DIAL - -class TQDialPrivate; - -class Q_EXPORT TQDial: public TQWidget, public TQRangeControl -{ - Q_OBJECT - Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) - Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping ) - Q_PROPERTY( int notchSize READ notchSize ) - Q_PROPERTY( double notchTarget READ notchTarget WRITE setNotchTarget ) - Q_PROPERTY( bool notchesVisible READ notchesVisible WRITE setNotchesVisible ) - Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) - Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) - Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) - Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep ) - Q_PROPERTY( int value READ value WRITE setValue ) - -public: - TQDial( TQWidget* parent=0, const char* name=0, WFlags f = 0 ); - TQDial( int minValue, int maxValue, int pageStep, int value, - TQWidget* parent=0, const char* name=0 ); - ~TQDial(); - - 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 b ); - virtual void setWrapping( bool on ); - virtual void setTracking( bool enable ); - -signals: - void valueChanged( int value ); - void dialPressed(); - void dialMoved( int value ); - void dialReleased(); - -protected: - void resizeEvent( TQResizeEvent * ); - void paintEvent( TQPaintEvent * ); - - void keyPressEvent( TQKeyEvent * ); - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent * ); -#endif - void focusInEvent( TQFocusEvent * ); - void focusOutEvent( TQFocusEvent * ); - - void valueChange(); - void rangeChange(); - - virtual void repaintScreen( const TQRect *cr = 0 ); - -private: - TQDialPrivate * d; - - int valueFromPoint( const TQPoint & ) const; - double angle( const TQPoint &, const TQPoint & ) const; - TQPointArray calcArrow( double &a ) const; - TQRect calcDial() const; - int calcBigLineSize() const; - void calcLines(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQDial( const TQDial & ); - TQDial &operator=( const TQDial & ); -#endif - -}; - -#endif // QT_NO_DIAL - -#endif diff --git a/src/widgets/qdialogbuttons.cpp b/src/widgets/qdialogbuttons.cpp index d87288dc8..2aad8a193 100644 --- a/src/widgets/qdialogbuttons.cpp +++ b/src/widgets/qdialogbuttons.cpp @@ -39,17 +39,17 @@ #include "qdialogbuttons_p.h" #ifndef QT_NO_DIALOGBUTTONS -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifndef QT_NO_DIALOG -#include +#include #endif // QT_NO_DIALOG -#include -#include -#include +#include +#include +#include struct TQDialogButtonsPrivate { diff --git a/src/widgets/qdialogbuttons_p.h b/src/widgets/qdialogbuttons_p.h index 6422eed9d..f6ecb3784 100644 --- a/src/widgets/qdialogbuttons_p.h +++ b/src/widgets/qdialogbuttons_p.h @@ -41,7 +41,7 @@ #ifndef QT_H #ifndef QT_H -#include "qwidget.h" +#include "ntqwidget.h" #endif // QT_H #endif diff --git a/src/widgets/qdockarea.cpp b/src/widgets/qdockarea.cpp index 767214c7e..cd56be0b3 100644 --- a/src/widgets/qdockarea.cpp +++ b/src/widgets/qdockarea.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qdockarea.h" +#include "ntqdockarea.h" #ifndef QT_NO_MAINWINDOW -#include "qsplitter.h" -#include "qlayout.h" -#include "qptrvector.h" -#include "qapplication.h" -#include "qpainter.h" -#include "qwidgetlist.h" -#include "qmap.h" -#include "qmainwindow.h" +#include "ntqsplitter.h" +#include "ntqlayout.h" +#include "ntqptrvector.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqwidgetlist.h" +#include "ntqmap.h" +#include "ntqmainwindow.h" //#define TQDOCKAREA_DEBUG @@ -451,7 +451,7 @@ int TQDockAreaLayout::widthForHeight( int h ) const /*! - \class TQDockArea qdockarea.h + \class TQDockArea ntqdockarea.h \brief The TQDockArea class manages and lays out TQDockWindows. \ingroup application diff --git a/src/widgets/qdockarea.h b/src/widgets/qdockarea.h deleted file mode 100644 index ca6391d78..000000000 --- a/src/widgets/qdockarea.h +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQDockArea class -** -** Created : 001010 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the workspace module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDOCKAREA_H -#define TQDOCKAREA_H - -#ifndef QT_H -#include "qwidget.h" -#include "qptrlist.h" -#include "qdockwindow.h" -#include "qlayout.h" -#include "qvaluelist.h" -#include "qguardedptr.h" -#include "qtextstream.h" -#endif // QT_H - -#ifndef QT_NO_MAINWINDOW - -class TQSplitter; -class TQBoxLayout; -class TQDockAreaLayout; -class TQMouseEvent; -class TQDockWindowResizeHandle; -class TQDockAreaPrivate; - -class Q_EXPORT TQDockAreaLayout : public TQLayout -{ - Q_OBJECT - friend class TQDockArea; - -public: - TQDockAreaLayout( TQWidget* parent, TQt::Orientation o, TQPtrList *wl, int space = -1, int margin = -1, const char *name = 0 ) - : TQLayout( parent, space, margin, name ), orient( o ), dockWindows( wl ), parentWidget( parent ) { init(); } - ~TQDockAreaLayout() {} - - void addItem( TQLayoutItem * ) {} - bool hasHeightForWidth() const; - int heightForWidth( int ) const; - int widthForHeight( int ) const; - TQSize sizeHint() const; - TQSize minimumSize() const; - TQLayoutIterator iterator(); - TQSizePolicy::ExpandData expanding() const { return TQSizePolicy::NoDirection; } - void invalidate(); - TQt::Orientation orientation() const { return orient; } - TQValueList lineList() const { return lines; } - TQPtrList lineStarts() const { return ls; } - -protected: - void setGeometry( const TQRect& ); - -private: - void init(); - int layoutItems( const TQRect&, bool testonly = FALSE ); - TQt::Orientation orient; - bool dirty; - int cached_width, cached_height; - int cached_hfw, cached_wfh; - TQPtrList *dockWindows; - TQWidget *parentWidget; - TQValueList lines; - TQPtrList ls; -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQDockAreaLayout( const TQDockAreaLayout & ); - TQDockAreaLayout &operator=( const TQDockAreaLayout & ); -#endif -}; - -class Q_EXPORT TQDockArea : public TQWidget -{ - Q_OBJECT - Q_ENUMS( HandlePosition ) - Q_PROPERTY( Orientation orientation READ orientation ) - Q_PROPERTY( int count READ count ) - Q_PROPERTY( bool empty READ isEmpty ) - Q_PROPERTY( HandlePosition handlePosition READ handlePosition ) - - friend class TQDockWindow; - friend class TQDockWindowResizeHandle; - friend class TQDockAreaLayout; - -public: - enum HandlePosition { Normal, Reverse }; - - TQDockArea( Orientation o, HandlePosition h = Normal, TQWidget* parent=0, const char* name=0 ); - ~TQDockArea(); - - void moveDockWindow( TQDockWindow *w, const TQPoint &globalPos, const TQRect &rect, bool swap ); - void removeDockWindow( TQDockWindow *w, bool makeFloating, bool swap, bool fixNewLines = TRUE ); - void moveDockWindow( TQDockWindow *w, int index = -1 ); - bool hasDockWindow( TQDockWindow *w, int *index = 0 ); - - void invalidNextOffset( TQDockWindow *dw ); - - Orientation orientation() const { return orient; } - HandlePosition handlePosition() const { return hPos; } - - bool eventFilter( TQObject *, TQEvent * ); - bool isEmpty() const; - int count() const; - TQPtrList dockWindowList() const; - - bool isDockWindowAccepted( TQDockWindow *dw ); - void setAcceptDockWindow( TQDockWindow *dw, bool accept ); - -public slots: - void lineUp( bool keepNewLines ); - -private: - struct DockWindowData - { - int index; - int offset; - int line; - TQSize fixedExtent; - TQGuardedPtr area; - }; - - int findDockWindow( TQDockWindow *w ); - int lineOf( int index ); - DockWindowData *dockWindowData( TQDockWindow *w ); - void dockWindow( TQDockWindow *dockWindow, DockWindowData *data ); - void updateLayout(); - void invalidateFixedSizes(); - int maxSpace( int hint, TQDockWindow *dw ); - void setFixedExtent( int d, TQDockWindow *dw ); - bool isLastDockWindow( TQDockWindow *dw ); - -private: - Orientation orient; - TQPtrList *dockWindows; - TQDockAreaLayout *layout; - HandlePosition hPos; - TQPtrList forbiddenWidgets; - TQDockAreaPrivate *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQDockArea( const TQDockArea & ); - TQDockArea& operator=( const TQDockArea & ); -#endif - -}; - -#ifndef QT_NO_TEXTSTREAM -Q_EXPORT TQTextStream &operator<<( TQTextStream &, const TQDockArea & ); -Q_EXPORT TQTextStream &operator>>( TQTextStream &, TQDockArea & ); -#endif - -#define Q_DEFINED_QDOCKAREA -#include "qwinexport.h" -#endif - -#endif //QT_NO_MAINWINDOW diff --git a/src/widgets/qdockwindow.cpp b/src/widgets/qdockwindow.cpp index 82fba58a7..867d64a7b 100644 --- a/src/widgets/qdockwindow.cpp +++ b/src/widgets/qdockwindow.cpp @@ -38,24 +38,24 @@ ** **********************************************************************/ -#include "qdockwindow.h" +#include "ntqdockwindow.h" #ifndef QT_NO_MAINWINDOW -#include "qdesktopwidget.h" -#include "qdockarea.h" +#include "ntqdesktopwidget.h" +#include "ntqdockarea.h" #include "qwidgetresizehandler_p.h" #include "qtitlebar_p.h" -#include "qpainter.h" -#include "qapplication.h" -#include "qtoolbutton.h" -#include "qtoolbar.h" -#include "qlayout.h" -#include "qmainwindow.h" -#include "qtimer.h" -#include "qtooltip.h" -#include "qguardedptr.h" -#include "qcursor.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqapplication.h" +#include "ntqtoolbutton.h" +#include "ntqtoolbar.h" +#include "ntqlayout.h" +#include "ntqmainwindow.h" +#include "ntqtimer.h" +#include "ntqtooltip.h" +#include "ntqguardedptr.h" +#include "ntqcursor.h" +#include "ntqstyle.h" #if defined(Q_WS_MAC9) #define MAC_DRAG_HACK @@ -702,7 +702,7 @@ void TQDockWindowTitleBar::mouseDoubleClickEvent( TQMouseEvent * ) } /*! - \class TQDockWindow qdockwindow.h + \class TQDockWindow ntqdockwindow.h \brief The TQDockWindow class provides a widget which can be docked inside a TQDockArea or floated as a top level window on the desktop. @@ -793,7 +793,7 @@ void TQDockWindowTitleBar::mouseDoubleClickEvent( TQMouseEvent * ) A dock window can have some preferred settings, for example, you can set a preferred offset from the left edge (or top edge for vertical dock areas) of the dock area using setOffset(). If you'd - prefer a dock window to start on a new \link qdockarea.html#lines + prefer a dock window to start on a new \link ntqdockarea.html#lines line\endlink when it is docked use setNewLine(). The setFixedExtentWidth() and setFixedExtentHeight() functions can be used to define the dock window's preferred size, and the diff --git a/src/widgets/qdockwindow.h b/src/widgets/qdockwindow.h deleted file mode 100644 index 57c66bc71..000000000 --- a/src/widgets/qdockwindow.h +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQDockWindow class -** -** Created : 001010 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the workspace module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDOCKWINDOW_H -#define TQDOCKWINDOW_H - -#ifndef QT_H -#include "qframe.h" -#endif // QT_H - -#ifndef QT_NO_MAINWINDOW - -class TQDockWindowHandle; -class TQDockWindowTitleBar; -class TQPainter; -class TQDockWindowResizeHandle; -class TQBoxLayout; -class TQHBoxLayout; -class TQVBoxLayout; -class TQDockArea; -class TQWidgetResizeHandler; -class TQMainWindow; -class TQDockAreaLayout; -class TQDockWindowPrivate; -class TQToolBar; -class TQWindowsXPStyle; - -class Q_EXPORT TQDockWindow : public TQFrame -{ - Q_OBJECT - Q_ENUMS( CloseMode Place ) - Q_PROPERTY( int closeMode READ closeMode WRITE setCloseMode ) //### this shouldn't be of type int?! - Q_PROPERTY( bool resizeEnabled READ isResizeEnabled WRITE setResizeEnabled ) - Q_PROPERTY( bool movingEnabled READ isMovingEnabled WRITE setMovingEnabled ) - Q_PROPERTY( bool horizontallyStretchable READ isHorizontallyStretchable WRITE setHorizontallyStretchable ) - Q_PROPERTY( bool verticallyStretchable READ isVerticallyStretchable WRITE setVerticallyStretchable ) - Q_PROPERTY( bool stretchable READ isStretchable ) - Q_PROPERTY( bool newLine READ newLine WRITE setNewLine ) - Q_PROPERTY( bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving ) - Q_PROPERTY( int offset READ offset WRITE setOffset ) - Q_PROPERTY( Place place READ place ) - - friend class TQDockWindowHandle; - friend class TQDockWindowTitleBar; - friend class TQDockArea; - friend class TQDockAreaLayout; - friend class TQMainWindow; - friend class TQCEMainWindow; - friend class TQToolBar; - friend class TQWindowsXPStyle; - -public: - enum Place { InDock, OutsideDock }; - enum CloseMode { Never = 0, Docked = 1, Undocked = 2, Always = Docked | Undocked }; - - TQDockWindow( Place p = InDock, TQWidget* parent=0, const char* name=0, WFlags f = 0 ); - TQDockWindow( TQWidget* parent, const char* name=0, WFlags f = 0 ); - ~TQDockWindow(); - - virtual void setWidget( TQWidget *w ); - TQWidget *widget() const; - - Place place() const { return curPlace; } - - TQDockArea *area() const; - - virtual void setCloseMode( int m ); - bool isCloseEnabled() const; - int closeMode() const; - - virtual void setResizeEnabled( bool b ); - virtual void setMovingEnabled( bool b ); - bool isResizeEnabled() const; - bool isMovingEnabled() const; - - virtual void setHorizontallyStretchable( bool b ); - virtual void setVerticallyStretchable( bool b ); - bool isHorizontallyStretchable() const; - bool isVerticallyStretchable() const; - void setHorizontalStretchable( bool b ) { setHorizontallyStretchable( b ); } - void setVerticalStretchable( bool b ) { setVerticallyStretchable( b ); } - bool isHorizontalStretchable() const { return isHorizontallyStretchable(); } - bool isVerticalStretchable() const { return isVerticallyStretchable(); } - bool isStretchable() const; - - virtual void setOffset( int o ); - int offset() const; - - virtual void setFixedExtentWidth( int w ); - virtual void setFixedExtentHeight( int h ); - TQSize fixedExtent() const; - - virtual void setNewLine( bool b ); - bool newLine() const; - - TQt::Orientation orientation() const; - - TQSize sizeHint() const; - TQSize minimumSize() const; - TQSize minimumSizeHint() const; - - TQBoxLayout *boxLayout(); - - virtual void setOpaqueMoving( bool b ); - bool opaqueMoving() const; - - bool eventFilter( TQObject *o, TQEvent *e ); - -#ifdef QT_NO_WIDGET_TOPEXTRA - TQString caption() const; -#endif - -signals: - void orientationChanged( Orientation o ); - void placeChanged( TQDockWindow::Place p ); - void visibilityChanged( bool ); - -public slots: - virtual void undock( TQWidget *w ); - virtual void undock() { undock( 0 ); } - virtual void dock(); - virtual void setOrientation( Orientation o ); - void setCaption( const TQString &s ); - -protected: - void resizeEvent( TQResizeEvent *e ); - void showEvent( TQShowEvent *e ); - void hideEvent( TQHideEvent *e ); - void contextMenuEvent( TQContextMenuEvent *e ); - - void drawFrame( TQPainter * ); - void drawContents( TQPainter * ); - - bool event( TQEvent *e ); - -private slots: - void toggleVisible() { if ( !isVisible() ) show(); else hide(); } - -private: - TQDockWindow( Place p, TQWidget* parent, const char* name, WFlags f, bool toolbar ); - - void handleMove( const TQPoint &pos, const TQPoint &gp, bool drawRect ); - void updateGui(); - void updateSplitterVisibility( bool visible ); - - void startRectDraw( const TQPoint &so, bool drawRect ); - void endRectDraw( bool drawRect ); - void updatePosition( const TQPoint &globalPos ); - TQWidget *areaAt( const TQPoint &gp ); - void removeFromDock( bool fixNewLines = TRUE ); - void swapRect( TQRect &r, TQt::Orientation o, const TQPoint &offset, TQDockArea *area ); - void init(); - -private: - TQDockWindowHandle *horHandle, *verHandle; - TQDockWindowTitleBar *titleBar; - TQWidget *wid; - TQPainter *unclippedPainter; - TQDockArea *dockArea, *tmpDockArea; - TQRect currRect; - Place curPlace; - Place state; - bool resizeEnabled : 1; - bool moveEnabled : 1; - bool nl : 1; - bool opaque : 1; - bool isToolbar : 1; - bool stretchable[ 3 ]; - Orientation startOrientation; - int cMode; - TQPoint startOffset; - int offs; - TQSize fExtent; - TQDockWindowResizeHandle *hHandleTop, *hHandleBottom, *vHandleLeft, *vHandleRight; - TQVBoxLayout *hbox; - TQHBoxLayout *vbox; - TQBoxLayout *childBox; - void *dockWindowData; - TQPoint lastPos; - TQSize lastSize; - TQWidgetResizeHandler *widgetResizeHandler; - TQDockWindowPrivate *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQDockWindow( const TQDockWindow & ); - TQDockWindow& operator=( const TQDockWindow & ); -#endif -}; - -inline TQDockArea *TQDockWindow::area() const -{ - return dockArea; -} - -#define Q_DEFINED_QDOCKWINDOW -#include "qwinexport.h" -#endif - -#endif // TQDOCKWINDOW_H diff --git a/src/widgets/qeffects.cpp b/src/widgets/qeffects.cpp index 47393ac56..0e5cf7846 100644 --- a/src/widgets/qeffects.cpp +++ b/src/widgets/qeffects.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qapplication.h" +#include "ntqapplication.h" #ifndef QT_NO_EFFECTS -#include "qwidget.h" +#include "ntqwidget.h" #include "qeffects_p.h" -#include "qpixmap.h" -#include "qimage.h" -#include "qtimer.h" -#include "qdatetime.h" -#include "qguardedptr.h" -#include "qscrollview.h" +#include "ntqpixmap.h" +#include "ntqimage.h" +#include "ntqtimer.h" +#include "ntqdatetime.h" +#include "ntqguardedptr.h" +#include "ntqscrollview.h" /* Internal class to get access to protected TQWidget-members diff --git a/src/widgets/qeffects_p.h b/src/widgets/qeffects_p.h index 41de77214..aecfe423d 100644 --- a/src/widgets/qeffects_p.h +++ b/src/widgets/qeffects_p.h @@ -56,7 +56,7 @@ // #ifndef QT_H -#include "qnamespace.h" +#include "ntqnamespace.h" #endif // QT_H #ifndef QT_NO_EFFECTS diff --git a/src/widgets/qframe.cpp b/src/widgets/qframe.cpp index a820f6cb6..2af74737c 100644 --- a/src/widgets/qframe.cpp +++ b/src/widgets/qframe.cpp @@ -38,13 +38,13 @@ ** **********************************************************************/ -#include "qframe.h" +#include "ntqframe.h" #ifndef QT_NO_FRAME -#include "qpainter.h" -#include "qdrawutil.h" -#include "qframe.h" -#include "qbitmap.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqframe.h" +#include "ntqbitmap.h" +#include "ntqstyle.h" /*! \class TQFrame diff --git a/src/widgets/qframe.h b/src/widgets/qframe.h deleted file mode 100644 index ae174974f..000000000 --- a/src/widgets/qframe.h +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Definition of TQFrame widget class -** -** Created : 950201 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFRAME_H -#define TQFRAME_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_FRAME - -class Q_EXPORT TQFrame : public TQWidget -{ - Q_OBJECT - Q_ENUMS( Shape Shadow ) - Q_PROPERTY( int frameWidth READ frameWidth ) - Q_PROPERTY( TQRect contentsRect READ contentsRect ) - Q_PROPERTY( Shape frameShape READ frameShape WRITE setFrameShape ) - Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow ) - Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth ) - Q_PROPERTY( int margin READ margin WRITE setMargin ) - Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth ) - Q_PROPERTY( TQRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false ) - -public: - TQFrame( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - - int frameStyle() const; - virtual void setFrameStyle( int ); - - int frameWidth() const; - TQRect contentsRect() const; - -#ifndef Q_QDOC - bool lineShapesOk() const { return TRUE; } -#endif - - TQSize sizeHint() const; - - enum Shape { NoFrame = 0, // no frame - Box = 0x0001, // rectangular box - Panel = 0x0002, // rectangular panel - WinPanel = 0x0003, // rectangular panel (Windows) - HLine = 0x0004, // horizontal line - VLine = 0x0005, // vertical line - StyledPanel = 0x0006, // rectangular panel depending on the GUI style - PopupPanel = 0x0007, // rectangular panel depending on the GUI style - MenuBarPanel = 0x0008, - ToolBarPanel = 0x0009, - LineEditPanel = 0x000a, - TabWidgetPanel = 0x000b, - GroupBoxPanel = 0x000c, - MShape = 0x000f // mask for the shape - }; - enum Shadow { Plain = 0x0010, // plain line - Raised = 0x0020, // raised shadow effect - Sunken = 0x0030, // sunken shadow effect - MShadow = 0x00f0 }; // mask for the shadow - - 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: - void updateFrameWidth(bool=FALSE); - TQRect frect; - int fstyle; - short lwidth; - short mwidth; - short mlwidth; - short fwidth; - - void * d; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQFrame( const TQFrame & ); - TQFrame &operator=( const TQFrame & ); -#endif -}; - - -inline int TQFrame::frameStyle() const -{ return fstyle; } - -inline TQFrame::Shape TQFrame::frameShape() const -{ return (Shape) ( fstyle & MShape ); } - -inline TQFrame::Shadow TQFrame::frameShadow() const -{ return (Shadow) ( fstyle & MShadow ); } - -inline void TQFrame::setFrameShape( TQFrame::Shape s ) -{ setFrameStyle( ( fstyle & MShadow ) | s ); } - -inline void TQFrame::setFrameShadow( TQFrame::Shadow s ) -{ setFrameStyle( ( fstyle & MShape ) | s ); } - -inline int TQFrame::lineWidth() const -{ return lwidth; } - -inline int TQFrame::midLineWidth() const -{ return mlwidth; } - -inline int TQFrame::margin() const -{ return mwidth; } - -inline int TQFrame::frameWidth() const -{ return fwidth; } - - -#endif // QT_NO_FRAME - -#endif // TQFRAME_H diff --git a/src/widgets/qgrid.cpp b/src/widgets/qgrid.cpp index d0584418c..97ab089e0 100644 --- a/src/widgets/qgrid.cpp +++ b/src/widgets/qgrid.cpp @@ -35,13 +35,13 @@ **********************************************************************/ -#include "qgrid.h" +#include "ntqgrid.h" #ifndef QT_NO_GRID -#include "qlayout.h" -#include "qapplication.h" +#include "ntqlayout.h" +#include "ntqapplication.h" /*! - \class TQGrid qgrid.h + \class TQGrid ntqgrid.h \brief The TQGrid widget provides simple geometry management of its children. \ingroup geomanagement diff --git a/src/widgets/qgrid.h b/src/widgets/qgrid.h deleted file mode 100644 index a1a6508c6..000000000 --- a/src/widgets/qgrid.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGRID_H -#define TQGRID_H - -#ifndef QT_H -#include "qframe.h" -#endif // QT_H - -#ifndef QT_NO_GRID - -class TQGridLayout; - -class Q_EXPORT TQGrid : public TQFrame -{ - Q_OBJECT -public: - TQGrid( int n, TQWidget* parent=0, const char* name=0, WFlags f = 0 ); - TQGrid( int n, Orientation orient, TQWidget* parent=0, const char* name=0, - WFlags f = 0 ); - - void setSpacing( int ); - TQSize sizeHint() const; - -#ifndef QT_NO_COMPAT - typedef Orientation Direction; -#endif - -protected: - void frameChanged(); - -private: - TQGridLayout *lay; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQGrid( const TQGrid & ); - TQGrid& operator=( const TQGrid & ); -#endif -}; - -#endif // QT_NO_GRID - -#endif // TQGRID_H diff --git a/src/widgets/qgridview.cpp b/src/widgets/qgridview.cpp index 146c31b97..e854d3dfe 100644 --- a/src/widgets/qgridview.cpp +++ b/src/widgets/qgridview.cpp @@ -39,14 +39,14 @@ **********************************************************************/ -#include "qgridview.h" +#include "ntqgridview.h" #ifndef QT_NO_GRIDVIEW -#include "qpainter.h" +#include "ntqpainter.h" /*! - \class TQGridView qgridview.h + \class TQGridView ntqgridview.h \brief The TQGridView class provides an abstract base for fixed-size grids. diff --git a/src/widgets/qgridview.h b/src/widgets/qgridview.h deleted file mode 100644 index d3f3f8c54..000000000 --- a/src/widgets/qgridview.h +++ /dev/null @@ -1,139 +0,0 @@ -/********************************************************************** -** -** Definition of TQGridView class -** -** Created : 010523 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGRIDVIEW_H -#define TQGRIDVIEW_H - -#ifndef QT_H -#include "qscrollview.h" -#endif // QT_H - -#ifndef QT_NO_GRIDVIEW - -class TQGridViewPrivate; - -class Q_EXPORT TQGridView : public TQScrollView -{ - Q_OBJECT - Q_PROPERTY( int numRows READ numRows WRITE setNumRows ) - Q_PROPERTY( int numCols READ numCols WRITE setNumCols ) - Q_PROPERTY( int cellWidth READ cellWidth WRITE setCellWidth ) - Q_PROPERTY( int cellHeight READ cellHeight WRITE setCellHeight ) -public: - - TQGridView( TQWidget *parent=0, const char *name=0, WFlags f=0 ); - ~TQGridView(); - - 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 row, int column ); - TQSize gridSize() const; - - int rowAt( int y ) const; - int columnAt( int x ) const; - - void repaintCell( int row, int column, bool erase=TRUE ); - void updateCell( int row, int column ); - void ensureCellVisible( int row, int column ); - -protected: - virtual void paintCell( TQPainter *, int row, int col ) = 0; - virtual void paintEmptyArea( TQPainter *p, int cx, int cy, int cw, int ch ); - - void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); - - virtual void dimensionChange( int, int ); - -private: - void drawContents( TQPainter* ); - void updateGrid(); - - int nrows; - int ncols; - int cellw; - int cellh; - TQGridViewPrivate* d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQGridView( const TQGridView & ); - TQGridView &operator=( const TQGridView & ); -#endif -}; - -inline int TQGridView::cellWidth() const -{ return cellw; } - -inline int TQGridView::cellHeight() const -{ return cellh; } - -inline int TQGridView::rowAt( int y ) const -{ return y / cellh; } - -inline int TQGridView::columnAt( int x ) const -{ return x / cellw; } - -inline int TQGridView::numRows() const -{ return nrows; } - -inline int TQGridView::numCols() const -{return ncols; } - -inline TQRect TQGridView::cellRect() const -{ return TQRect( 0, 0, cellw, cellh ); } - -inline TQSize TQGridView::gridSize() const -{ return TQSize( ncols * cellw, nrows * cellh ); } - - - -#endif // QT_NO_GRIDVIEW - - -#endif // TQTABLEVIEW_H diff --git a/src/widgets/qgroupbox.cpp b/src/widgets/qgroupbox.cpp index 05f88387f..e6d2ad583 100644 --- a/src/widgets/qgroupbox.cpp +++ b/src/widgets/qgroupbox.cpp @@ -38,26 +38,26 @@ ** **********************************************************************/ -#include "qgroupbox.h" +#include "ntqgroupbox.h" #ifndef QT_NO_GROUPBOX -#include "qlayout.h" -#include "qpainter.h" -#include "qbitmap.h" -#include "qaccel.h" -#include "qradiobutton.h" -#include "qfocusdata.h" -#include "qobjectlist.h" -#include "qdrawutil.h" -#include "qapplication.h" -#include "qstyle.h" -#include "qcheckbox.h" -#include "qbuttongroup.h" +#include "ntqlayout.h" +#include "ntqpainter.h" +#include "ntqbitmap.h" +#include "ntqaccel.h" +#include "ntqradiobutton.h" +#include "ntqfocusdata.h" +#include "ntqobjectlist.h" +#include "ntqdrawutil.h" +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqcheckbox.h" +#include "ntqbuttongroup.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif /*! - \class TQGroupBox qgroupbox.h + \class TQGroupBox ntqgroupbox.h \brief The TQGroupBox widget provides a group box frame with a title. \ingroup organizers diff --git a/src/widgets/qgroupbox.h b/src/widgets/qgroupbox.h deleted file mode 100644 index ed95c5c69..000000000 --- a/src/widgets/qgroupbox.h +++ /dev/null @@ -1,165 +0,0 @@ -/********************************************************************** -** -** Definition of TQGroupBox widget class -** -** Created : 950203 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGROUPBOX_H -#define TQGROUPBOX_H - -#ifndef QT_H -#include "qframe.h" -#endif // QT_H - -#ifndef QT_NO_GROUPBOX - - -class TQAccel; -class TQGroupBoxPrivate; -class TQVBoxLayout; -class TQGridLayout; -class TQSpacerItem; - -class Q_EXPORT TQGroupBox : public TQFrame -{ - Q_OBJECT - Q_PROPERTY( TQString title READ title WRITE setTitle ) - Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false ) - Q_PROPERTY( int columns READ columns WRITE setColumns DESIGNABLE false ) - Q_PROPERTY( bool flat READ isFlat WRITE setFlat ) -#ifndef QT_NO_CHECKBOX - Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable ) - Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) -#endif -public: - TQGroupBox( TQWidget* parent=0, const char* name=0 ); - TQGroupBox( const TQString &title, - TQWidget* parent=0, const char* name=0 ); - TQGroupBox( int strips, Orientation o, - TQWidget* parent=0, const char* name=0 ); - TQGroupBox( int strips, Orientation o, const TQString &title, - TQWidget* parent=0, const char* name=0 ); - ~TQGroupBox(); - - virtual void setColumnLayout(int strips, Orientation o); - - TQString title() const { return str; } - virtual void setTitle( const TQString &); - - int alignment() const { return align; } - virtual void setAlignment( int ); - - int columns() const; - void setColumns( int ); - - Orientation orientation() const { return dir; } - void setOrientation( Orientation ); - - int insideMargin() const; - int insideSpacing() const; - void setInsideMargin( int m ); - void setInsideSpacing( int s ); - - void addSpace( int ); - TQSize sizeHint() const; - - bool isFlat() const; - void setFlat( bool b ); - bool isCheckable() const; -#ifndef QT_NO_CHECKBOX - void setCheckable( bool b ); -#endif - bool isChecked() const; - void setEnabled(bool on); - -#ifndef QT_NO_CHECKBOX -public slots: - void setChecked( bool b ); - -signals: - void toggled( bool ); -#endif -protected: - bool event( TQEvent * ); - void childEvent( TQChildEvent * ); - void resizeEvent( TQResizeEvent * ); - void paintEvent( TQPaintEvent * ); - void focusInEvent( TQFocusEvent * ); - void fontChange( const TQFont & ); - -private slots: - void fixFocus(); - void setChildrenEnabled( bool b ); - -private: - void skip(); - void init(); - void calculateFrame(); - void insertWid( TQWidget* ); - void setTextSpacer(); -#ifndef QT_NO_CHECKBOX - void updateCheckBoxGeometry(); -#endif - TQString str; - int align; - int lenvisible; -#ifndef QT_NO_ACCEL - TQAccel * accel; -#endif - TQGroupBoxPrivate * d; - - TQVBoxLayout *vbox; - TQGridLayout *grid; - int row; - int col : 30; - uint bFlat : 1; - int nRows, nCols; - Orientation dir; - int spac, marg; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQGroupBox( const TQGroupBox & ); - TQGroupBox &operator=( const TQGroupBox & ); -#endif -}; - - -#endif // QT_NO_GROUPBOX - -#endif // TQGROUPBOX_H diff --git a/src/widgets/qhbox.cpp b/src/widgets/qhbox.cpp index cda81fd90..89465fd4f 100644 --- a/src/widgets/qhbox.cpp +++ b/src/widgets/qhbox.cpp @@ -34,15 +34,15 @@ ** **********************************************************************/ -#include "qhbox.h" +#include "ntqhbox.h" #ifndef QT_NO_HBOX -#include "qlayout.h" -#include "qapplication.h" -#include "qobjectlist.h" +#include "ntqlayout.h" +#include "ntqapplication.h" +#include "ntqobjectlist.h" /*! - \class TQHBox qhbox.h + \class TQHBox ntqhbox.h \brief The TQHBox widget provides horizontal geometry management for its child widgets. diff --git a/src/widgets/qhbox.h b/src/widgets/qhbox.h deleted file mode 100644 index 162fa3e61..000000000 --- a/src/widgets/qhbox.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - - -#ifndef TQHBOX_H -#define TQHBOX_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_HBOX - -#include "qframe.h" - -class TQBoxLayout; - -class Q_EXPORT TQHBox : public TQFrame -{ - Q_OBJECT -public: - TQHBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - - void setSpacing( int ); - bool setStretchFactor( TQWidget*, int stretch ); - TQSize sizeHint() const; - -protected: - TQHBox( bool horizontal, TQWidget* parent, const char* name, WFlags f = 0 ); - void frameChanged(); - -private: - TQBoxLayout *lay; - -#if defined(Q_DISABLE_COPY) - TQHBox( const TQHBox & ); - TQHBox &operator=( const TQHBox & ); -#endif -}; - -#endif // QT_NO_HBOX - -#endif // TQHBOX_H diff --git a/src/widgets/qhbuttongroup.cpp b/src/widgets/qhbuttongroup.cpp index f8f48d95b..2a72f76e3 100644 --- a/src/widgets/qhbuttongroup.cpp +++ b/src/widgets/qhbuttongroup.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qhbuttongroup.h" +#include "ntqhbuttongroup.h" #ifndef QT_NO_HBUTTONGROUP /*! - \class TQHButtonGroup qhbuttongroup.h + \class TQHButtonGroup ntqhbuttongroup.h \brief The TQHButtonGroup widget organizes TQButton widgets in a group with one horizontal row. diff --git a/src/widgets/qhbuttongroup.h b/src/widgets/qhbuttongroup.h deleted file mode 100644 index 8a6caff78..000000000 --- a/src/widgets/qhbuttongroup.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Definition of TQHButtonGroup class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHBUTTONGROUP_H -#define TQHBUTTONGROUP_H - -#ifndef QT_H -#include "qbuttongroup.h" -#endif // QT_H - -#ifndef QT_NO_HBUTTONGROUP - -class Q_EXPORT TQHButtonGroup : public TQButtonGroup -{ - Q_OBJECT -public: - TQHButtonGroup( TQWidget* parent=0, const char* name=0 ); - TQHButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); - ~TQHButtonGroup(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQHButtonGroup( const TQHButtonGroup & ); - TQHButtonGroup &operator=( const TQHButtonGroup & ); -#endif -}; - - -#endif // QT_NO_HBUTTONGROUP - -#endif // TQHBUTTONGROUP_H diff --git a/src/widgets/qheader.cpp b/src/widgets/qheader.cpp index 6925d10d4..e20fd3349 100644 --- a/src/widgets/qheader.cpp +++ b/src/widgets/qheader.cpp @@ -38,15 +38,15 @@ ** **********************************************************************/ -#include "qheader.h" +#include "ntqheader.h" #ifndef QT_NO_HEADER -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qbitarray.h" -#include "qptrvector.h" -#include "qapplication.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqbitarray.h" +#include "ntqptrvector.h" +#include "ntqapplication.h" +#include "ntqstyle.h" class TQHeaderData { @@ -136,7 +136,7 @@ public: /*! - \class TQHeader qheader.h + \class TQHeader ntqheader.h \brief The TQHeader class provides a header row or column, e.g. for tables and listviews. diff --git a/src/widgets/qheader.h b/src/widgets/qheader.h deleted file mode 100644 index 2f5d000e6..000000000 --- a/src/widgets/qheader.h +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** -** -** Definition of TQHeader widget class (table header) -** -** Created : 961105 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHEADER_H -#define TQHEADER_H - -#ifndef QT_H -#include "qwidget.h" -#include "qstring.h" -#include "qiconset.h" // conversion TQPixmap->TQIconset -#endif // QT_H - -#ifndef QT_NO_HEADER - -class TQShowEvent; -class TQHeaderData; -class TQTable; - -class Q_EXPORT TQHeader : public TQWidget -{ - friend class TQTable; - friend class TQTableHeader; - friend class TQListView; - - Q_OBJECT - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) - Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) - Q_PROPERTY( int count READ count ) - Q_PROPERTY( int offset READ offset WRITE setOffset ) - Q_PROPERTY( bool moving READ isMovingEnabled WRITE setMovingEnabled ) - Q_PROPERTY( bool stretching READ isStretchEnabled WRITE setStretchEnabled ) - -public: - TQHeader( TQWidget* parent=0, const char* name=0 ); - TQHeader( int, TQWidget* parent=0, const char* name=0 ); - ~TQHeader(); - - int addLabel( const TQString &, int size = -1 ); - int addLabel( const TQIconSet&, const TQString &, int size = -1 ); - void removeLabel( int section ); - virtual void setLabel( int, const TQString &, int size = -1 ); - virtual void setLabel( int, const TQIconSet&, const TQString &, int size = -1 ); - TQString label( int section ) const; - TQIconSet* iconSet( int section ) const; - - virtual void setOrientation( Orientation ); - Orientation orientation() const; - virtual void setTracking( bool enable ); - bool tracking() const; - - virtual void setClickEnabled( bool, int section = -1 ); - virtual void setResizeEnabled( bool, int section = -1 ); - virtual void setMovingEnabled( bool ); - virtual void setStretchEnabled( bool b, int section ); - void setStretchEnabled( bool b ) { setStretchEnabled( b, -1 ); } - bool isClickEnabled( int section = -1 ) const; - bool isResizeEnabled( int section = -1 ) const; - bool isMovingEnabled() const; - bool isStretchEnabled() const; - bool isStretchEnabled( int section ) const; - - void resizeSection( int section, int s ); - int sectionSize( int section ) const; - int sectionPos( int section ) const; - int sectionAt( int pos ) const; - int count() const; - int headerWidth() const; - TQRect sectionRect( int section ) const; - - virtual void setCellSize( int , int ); // obsolete, do not use - int cellSize( int i ) const { return sectionSize( mapToSection(i) ); } // obsolete, do not use - int cellPos( int ) const; // obsolete, do not use - int cellAt( int pos ) const { return mapToIndex( sectionAt(pos + offset()) ); } // obsolete, do not use - - int offset() const; - - TQSize sizeHint() const; - - int mapToSection( int index ) const; - int mapToIndex( int section ) const; - int mapToLogical( int ) const; // obsolete, do not use - int mapToActual( int ) const; // obsolete, do not use - - void moveSection( int section, int toIndex ); - virtual void moveCell( int, int); // obsolete, do not use - - void setSortIndicator( int section, bool ascending = TRUE ); // obsolete, do not use - inline void setSortIndicator( int section, SortOrder order ) - { setSortIndicator( section, (order == Ascending) ); } - int sortIndicatorSection() const; - SortOrder sortIndicatorOrder() const; - - void adjustHeaderSize() { adjustHeaderSize( -1 ); } - -public slots: - void setUpdatesEnabled( bool enable ); - virtual void setOffset( int pos ); - -signals: - void clicked( int section ); - void pressed( int section ); - void released( int section ); - void sizeChange( int section, int oldSize, int newSize ); - void indexChange( int section, int fromIndex, int toIndex ); - void sectionClicked( int ); // obsolete, do not use - void moved( int, int ); // obsolete, do not use - void sectionHandleDoubleClicked( int section ); - -protected: - void paintEvent( TQPaintEvent * ); - void showEvent( TQShowEvent *e ); - void resizeEvent( TQResizeEvent *e ); - TQRect sRect( int index ); - - virtual void paintSection( TQPainter *p, int index, const TQRect& fr); - virtual void paintSectionLabel( TQPainter* p, int index, const TQRect& fr ); - - void fontChange( const TQFont & ); - - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); - void mouseDoubleClickEvent( TQMouseEvent * ); - - void keyPressEvent( TQKeyEvent * ); - void keyReleaseEvent( TQKeyEvent * ); - -private: - void handleColumnMove( int fromIdx, int toIdx ); - void adjustHeaderSize( int diff ); - void init( int ); - - void paintRect( int p, int s ); - void markLine( int idx ); - void unMarkLine( int idx ); - int pPos( int i ) const; - int pSize( int i ) const; - int findLine( int ); - int handleAt( int p ); - bool reverse() const; - void calculatePositions( bool onlyVisible = FALSE, int start = 0 ); - void handleColumnResize(int, int, bool, bool = TRUE ); - TQSize sectionSizeHint( int section, const TQFontMetrics& fm ) const; - void setSectionSizeAndHeight( int section, int size ); - - void resizeArrays( int size ); - void setIsATableHeader( bool b ); - int offs; - int handleIdx; - int oldHIdxSize; - int moveToIdx; - enum State { Idle, Sliding, Pressed, Moving, Blocked }; - State state; - TQCOORD clickPos; - bool trackingIsOn; - int oldHandleIdx; - int cachedPos; // not used - Orientation orient; - - TQHeaderData *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQHeader( const TQHeader & ); - TQHeader &operator=( const TQHeader & ); -#endif -}; - - -inline TQHeader::Orientation TQHeader::orientation() const -{ - return orient; -} - -inline void TQHeader::setTracking( bool enable ) { trackingIsOn = enable; } -inline bool TQHeader::tracking() const { return trackingIsOn; } - -extern Q_EXPORT bool qt_qheader_label_return_null_strings; // needed for professional edition - -#endif // QT_NO_HEADER - -#endif // TQHEADER_H diff --git a/src/widgets/qhgroupbox.cpp b/src/widgets/qhgroupbox.cpp index b06061e06..79324ee58 100644 --- a/src/widgets/qhgroupbox.cpp +++ b/src/widgets/qhgroupbox.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qhgroupbox.h" +#include "ntqhgroupbox.h" #ifndef QT_NO_HGROUPBOX /*! - \class TQHGroupBox qhgroupbox.h + \class TQHGroupBox ntqhgroupbox.h \brief The TQHGroupBox widget organizes widgets in a group with one horizontal row. diff --git a/src/widgets/qhgroupbox.h b/src/widgets/qhgroupbox.h deleted file mode 100644 index 9f61a4a34..000000000 --- a/src/widgets/qhgroupbox.h +++ /dev/null @@ -1,67 +0,0 @@ -/********************************************************************** -** -** Definition of TQHGroupBox widget class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHGROUPBOX_H -#define TQHGROUPBOX_H - -#ifndef QT_H -#include "qgroupbox.h" -#endif // QT_H - -#ifndef QT_NO_HGROUPBOX - -class Q_EXPORT TQHGroupBox : public TQGroupBox -{ - Q_OBJECT -public: - TQHGroupBox( TQWidget* parent=0, const char* name=0 ); - TQHGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); - ~TQHGroupBox(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQHGroupBox( const TQHGroupBox & ); - TQHGroupBox &operator=( const TQHGroupBox & ); -#endif -}; - -#endif // QT_NO_HGROUPBOX - -#endif // TQHGROUPBOX_H diff --git a/src/widgets/qlabel.cpp b/src/widgets/qlabel.cpp index 73e913dfe..c78b99104 100644 --- a/src/widgets/qlabel.cpp +++ b/src/widgets/qlabel.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qlabel.h" +#include "ntqlabel.h" #ifndef QT_NO_LABEL -#include "qpainter.h" -#include "qdrawutil.h" -#include "qaccel.h" -#include "qmovie.h" -#include "qimage.h" -#include "qbitmap.h" -#include "qpicture.h" -#include "qapplication.h" -#include "qsimplerichtext.h" -#include "qstylesheet.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqaccel.h" +#include "ntqmovie.h" +#include "ntqimage.h" +#include "ntqbitmap.h" +#include "ntqpicture.h" +#include "ntqapplication.h" +#include "ntqsimplerichtext.h" +#include "ntqstylesheet.h" +#include "ntqstyle.h" class TQLabelPrivate { @@ -67,7 +67,7 @@ public: /*! - \class TQLabel qlabel.h + \class TQLabel ntqlabel.h \brief The TQLabel widget provides a text or image display. \ingroup basic diff --git a/src/widgets/qlabel.h b/src/widgets/qlabel.h deleted file mode 100644 index 8e1ba94f7..000000000 --- a/src/widgets/qlabel.h +++ /dev/null @@ -1,174 +0,0 @@ -/********************************************************************** -** -** Definition of TQLabel widget class -** -** Created : 941215 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLABEL_H -#define TQLABEL_H - -#ifndef QT_H -#include "qframe.h" -#endif // QT_H - -#ifndef QT_NO_LABEL - -class TQSimpleRichText; -class TQLabelPrivate; - -class Q_EXPORT TQLabel : public TQFrame -{ - Q_OBJECT - Q_PROPERTY( TQString text READ text WRITE setText ) - Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) - Q_PROPERTY( TQPixmap pixmap READ pixmap WRITE setPixmap ) - Q_PROPERTY( bool scaledContents READ hasScaledContents WRITE setScaledContents ) - Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) - Q_PROPERTY( int indent READ indent WRITE setIndent ) - Q_OVERRIDE( BackgroundMode backgroundMode DESIGNABLE true) - -public: - TQLabel( TQWidget *parent, const char* name=0, WFlags f=0 ); - TQLabel( const TQString &text, TQWidget *parent, const char* name=0, - WFlags f=0 ); - TQLabel( TQWidget *buddy, const TQString &, - TQWidget *parent, const char* name=0, WFlags f=0 ); - ~TQLabel(); - - TQString text() const { return ltext; } - TQPixmap *pixmap() const { return lpixmap; } -#ifndef QT_NO_PICTURE - TQPicture *picture() const { return lpicture; } -#endif -#ifndef QT_NO_MOVIE - TQMovie *movie() const; -#endif - - TextFormat textFormat() const; - void setTextFormat( TextFormat ); - - int alignment() const { return align; } - virtual void setAlignment( int ); - int indent() const { return extraMargin; } - void setIndent( int ); - - bool autoResize() const { return autoresize; } - virtual void setAutoResize( bool ); -#ifndef QT_NO_IMAGE_SMOOTHSCALE - bool hasScaledContents() const; - void setScaledContents( bool ); -#endif - TQSize sizeHint() const; - TQSize minimumSizeHint() const; -#ifndef QT_NO_ACCEL - virtual void setBuddy( TQWidget * ); - TQWidget *buddy() const; -#endif - int heightForWidth(int) const; - - void setFont( const TQFont &f ); - -public slots: - virtual void setText( const TQString &); - virtual void setPixmap( const TQPixmap & ); -#ifndef QT_NO_PICTURE - virtual void setPicture( const TQPicture & ); -#endif -#ifndef QT_NO_MOVIE - virtual void setMovie( const TQMovie & ); -#endif - virtual void setNum( int ); - virtual void setNum( double ); - void clear(); - -protected: - void drawContents( TQPainter * ); - void fontChange( const TQFont & ); - void resizeEvent( TQResizeEvent* ); - -private slots: -#ifndef QT_NO_ACCEL - void acceleratorSlot(); - void buddyDied(); -#endif -#ifndef QT_NO_MOVIE - void movieUpdated(const TQRect&); - void movieResized(const TQSize&); -#endif - -private: - void init(); - void clearContents(); - void updateLabel( TQSize oldSizeHint ); - TQSize sizeForWidth( int w ) const; - TQString ltext; - TQPixmap *lpixmap; -#ifndef QT_NO_PICTURE - TQPicture *lpicture; -#endif -#ifndef QT_NO_MOVIE - TQMovie * lmovie; -#endif -#ifndef QT_NO_ACCEL - TQWidget * lbuddy; -#endif - ushort align; - short extraMargin; - uint autoresize:1; - uint scaledcontents :1; - TextFormat textformat; -#ifndef QT_NO_RICHTEXT - TQSimpleRichText* doc; -#endif -#ifndef QT_NO_ACCEL - TQAccel * accel; -#endif - TQLabelPrivate* d; - - friend class TQTipLabel; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQLabel( const TQLabel & ); - TQLabel &operator=( const TQLabel & ); -#endif -}; - - -#endif // QT_NO_LABEL - -#endif // TQLABEL_H diff --git a/src/widgets/qlcdnumber.cpp b/src/widgets/qlcdnumber.cpp index 4937c907c..99eddf56d 100644 --- a/src/widgets/qlcdnumber.cpp +++ b/src/widgets/qlcdnumber.cpp @@ -38,14 +38,14 @@ ** **********************************************************************/ -#include "qlcdnumber.h" +#include "ntqlcdnumber.h" #ifndef QT_NO_LCDNUMBER -#include "qbitarray.h" -#include "qpainter.h" +#include "ntqbitarray.h" +#include "ntqpainter.h" /*! - \class TQLCDNumber qlcdnumber.h + \class TQLCDNumber ntqlcdnumber.h \brief The TQLCDNumber widget displays a number with LCD-like digits. diff --git a/src/widgets/qlcdnumber.h b/src/widgets/qlcdnumber.h deleted file mode 100644 index a872703bc..000000000 --- a/src/widgets/qlcdnumber.h +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Definition of TQLCDNumber class -** -** Created : 940518 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLCDNUMBER_H -#define TQLCDNUMBER_H - -#ifndef QT_H -#include "qframe.h" -#include "qbitarray.h" -#endif // QT_H - -#ifndef QT_NO_LCDNUMBER - - -class TQLCDNumberPrivate; - -class Q_EXPORT TQLCDNumber : public TQFrame // LCD number widget -{ - Q_OBJECT - Q_ENUMS( Mode SegmentStyle ) - Q_PROPERTY( bool smallDecimalPoint READ smallDecimalPoint WRITE setSmallDecimalPoint ) - Q_PROPERTY( int numDigits READ numDigits WRITE setNumDigits ) - Q_PROPERTY( Mode mode READ mode WRITE setMode ) - Q_PROPERTY( SegmentStyle segmentStyle READ segmentStyle WRITE setSegmentStyle ) - Q_PROPERTY( double value READ value WRITE display ) - Q_PROPERTY( int intValue READ intValue WRITE display ) - -public: - TQLCDNumber( TQWidget* parent=0, const char* name=0 ); - TQLCDNumber( uint numDigits, TQWidget* parent=0, const char* name=0 ); - ~TQLCDNumber(); - - enum Mode { Hex, Dec, Oct, Bin, HEX = Hex, DEC = Dec, OCT = Oct, - BIN = Bin }; - enum SegmentStyle { Outline, Filled, Flat }; - - bool smallDecimalPoint() const; - - int numDigits() const; - virtual void setNumDigits( int nDigits ); - - bool checkOverflow( double num ) const; - bool checkOverflow( int num ) 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 &str ); - void display( int num ); - void display( double num ); - virtual void setHexMode(); - virtual void setDecMode(); - virtual void setOctMode(); - virtual void setBinMode(); - virtual void setSmallDecimalPoint( bool ); - -signals: - void overflow(); - -protected: - void drawContents( TQPainter * ); - -private: - void init(); - void internalDisplay( const TQString &); - void internalSetString( const TQString& s ); - void drawString( const TQString& s, TQPainter &, TQBitArray * = 0, - bool = TRUE ); - //void drawString( const TQString &, TQPainter &, TQBitArray * = 0 ) const; - void drawDigit( const TQPoint &, TQPainter &, int, char, - char = ' ' ); - void drawSegment( const TQPoint &, char, TQPainter &, int, bool = FALSE ); - - int ndigits; - double val; - uint base : 2; - uint smallPoint : 1; - uint fill : 1; - uint shadow : 1; - TQString digitStr; - TQBitArray points; - TQLCDNumberPrivate * d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQLCDNumber( const TQLCDNumber & ); - TQLCDNumber &operator=( const TQLCDNumber & ); -#endif -}; - -inline bool TQLCDNumber::smallDecimalPoint() const -{ return (bool)smallPoint; } - -inline int TQLCDNumber::numDigits() const -{ return ndigits; } - - -#endif // QT_NO_LCDNUMBER - -#endif // TQLCDNUMBER_H diff --git a/src/widgets/qlineedit.cpp b/src/widgets/qlineedit.cpp index 2a4ef1c47..74976e2ef 100644 --- a/src/widgets/qlineedit.cpp +++ b/src/widgets/qlineedit.cpp @@ -38,37 +38,37 @@ ** **********************************************************************/ -#include "qlineedit.h" +#include "ntqlineedit.h" #ifndef QT_NO_LINEEDIT // Keep this position to avoid patch rejection #ifndef QT_NO_IM -#include "qinputcontext.h" +#include "ntqinputcontext.h" #endif -#include "qpainter.h" -#include "qdrawutil.h" -#include "qfontmetrics.h" -#include "qpixmap.h" -#include "qclipboard.h" -#include "qapplication.h" -#include "qvalidator.h" -#include "qdragobject.h" -#include "qtimer.h" -#include "qpopupmenu.h" -#include "qstringlist.h" -#include "qguardedptr.h" -#include "qstyle.h" -#include "qwhatsthis.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqfontmetrics.h" +#include "ntqpixmap.h" +#include "ntqclipboard.h" +#include "ntqapplication.h" +#include "ntqvalidator.h" +#include "ntqdragobject.h" +#include "ntqtimer.h" +#include "ntqpopupmenu.h" +#include "ntqstringlist.h" +#include "ntqguardedptr.h" +#include "ntqstyle.h" +#include "ntqwhatsthis.h" #include "../kernel/qinternal_p.h" #include "private/qtextlayout_p.h" -#include "qvaluevector.h" +#include "ntqvaluevector.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #ifndef QT_NO_ACCEL -#include "qkeysequence.h" +#include "ntqkeysequence.h" #define ACCEL_KEY(k) "\t" + TQString(TQKeySequence( TQt::CTRL | TQt::Key_ ## k )) #else #define ACCEL_KEY(k) "\t" + TQString("Ctrl+" #k) diff --git a/src/widgets/qlineedit.h b/src/widgets/qlineedit.h deleted file mode 100644 index 73db03d36..000000000 --- a/src/widgets/qlineedit.h +++ /dev/null @@ -1,232 +0,0 @@ -/********************************************************************** -** -** Definition of TQLineEdit widget class -** -** Created : 941011 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLINEEDIT_H -#define TQLINEEDIT_H - -struct TQLineEditPrivate; - -class TQValidator; -class TQPopupMenu; - -#ifndef QT_H -#include "qframe.h" -#include "qstring.h" -#endif // QT_H - -#ifndef QT_NO_LINEEDIT - -class TQTextParagraph; -class TQTextCursor; - -class Q_EXPORT TQLineEdit : public TQFrame -{ - Q_OBJECT - Q_ENUMS( EchoMode ) - Q_PROPERTY( TQString text READ text WRITE setText ) - Q_PROPERTY( int maxLength READ maxLength WRITE setMaxLength ) - Q_PROPERTY( bool frame READ frame WRITE setFrame ) - Q_PROPERTY( EchoMode echoMode READ echoMode WRITE setEchoMode ) - Q_PROPERTY( TQString displayText READ displayText ) - Q_PROPERTY( int cursorPosition READ cursorPosition WRITE setCursorPosition ) - Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) - Q_PROPERTY( bool edited READ edited WRITE setEdited DESIGNABLE false ) - Q_PROPERTY( bool modified READ isModified ) - Q_PROPERTY( bool hasMarkedText READ hasMarkedText DESIGNABLE false ) - Q_PROPERTY( bool hasSelectedText READ hasSelectedText ) - Q_PROPERTY( TQString markedText READ markedText DESIGNABLE false ) - Q_PROPERTY( TQString selectedText READ selectedText ) - Q_PROPERTY( bool dragEnabled READ dragEnabled WRITE setDragEnabled ) - Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) - Q_PROPERTY( bool undoAvailable READ isUndoAvailable ) - Q_PROPERTY( bool redoAvailable READ isRedoAvailable ) - Q_PROPERTY( TQString inputMask READ inputMask WRITE setInputMask ) - Q_PROPERTY( bool acceptableInput READ hasAcceptableInput ) - -public: - TQLineEdit( TQWidget* parent, const char* name=0 ); - TQLineEdit( const TQString &, TQWidget* parent, const char* name=0 ); - TQLineEdit( const TQString &, const TQString &, TQWidget* parent, const char* name=0 ); - ~TQLineEdit(); - - 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; - bool validateAndSet( const TQString &, int, int, int ); // obsolete - - int alignment() const; - -#ifndef QT_NO_COMPAT - void cursorLeft( bool mark, int steps = 1 ) { cursorForward( mark, -steps ); } - void cursorRight( bool mark, int steps = 1 ) { cursorForward( mark, steps ); } -#endif - void cursorForward( bool mark, int steps = 1 ); - void cursorBackward( bool mark, int steps = 1 ); - void cursorWordForward( bool mark ); - void cursorWordBackward( bool mark ); - void backspace(); - void del(); - void home( bool mark ); - void end( bool mark ); - - bool isModified() const; - void clearModified(); - - bool edited() const; // obsolete, use isModified() - void setEdited( bool ); // obsolete, use clearModified() - - bool hasSelectedText() const; - TQString selectedText() const; - int selectionStart() const; - - bool isUndoAvailable() const; - bool isRedoAvailable() const; - -#ifndef QT_NO_COMPAT - bool hasMarkedText() const { return hasSelectedText(); } - TQString markedText() const { return selectedText(); } -#endif - - bool dragEnabled() const; - - TQString inputMask() const; - void setInputMask( const TQString &inputMask ); - 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 flag ); -#ifndef QT_NO_CLIPBOARD - virtual void cut(); - virtual void copy() const; - virtual void paste(); -#endif - virtual void setDragEnabled( bool b ); - -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 * ); -#ifndef QT_NO_DRAGANDDROP - void dragEnterEvent( TQDragEnterEvent * ); - void dragMoveEvent( TQDragMoveEvent *e ); - void dragLeaveEvent( TQDragLeaveEvent *e ); - void dropEvent( TQDropEvent * ); -#endif - void contextMenuEvent( TQContextMenuEvent * ); - bool sendMouseEventToInputContext( TQMouseEvent *e ); - virtual TQPopupMenu *createPopupMenu(); - void windowActivationChange( bool ); -#ifndef QT_NO_COMPAT - void repaintArea( int, int ) { update(); } -#endif - -private slots: - void clipboardChanged(); - -public: - void setPasswordChar( TQChar c ); // internal obsolete - TQChar passwordChar() const; // obsolete internal - int characterAt( int, TQChar* ) const; // obsolete - bool getSelection( int *, int * ); // obsolete - -private: - friend struct TQLineEditPrivate; - TQLineEditPrivate * d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQLineEdit( const TQLineEdit & ); - TQLineEdit &operator=( const TQLineEdit & ); -#endif -}; - - -#endif // QT_NO_LINEEDIT - -#endif // TQLINEEDIT_H diff --git a/src/widgets/qlistbox.cpp b/src/widgets/qlistbox.cpp index c8ca44c91..2dc526655 100644 --- a/src/widgets/qlistbox.cpp +++ b/src/widgets/qlistbox.cpp @@ -38,28 +38,28 @@ ** **********************************************************************/ -#include "qglobal.h" +#include "ntqglobal.h" #if defined(Q_CC_BOR) // needed for qsort() because of a std namespace problem on Borland #include "qplatformdefs.h" #endif -#include "qlistbox.h" +#include "ntqlistbox.h" #ifndef QT_NO_LISTBOX -#include "qmemarray.h" -#include "qfontmetrics.h" -#include "qpainter.h" -#include "qstrlist.h" -#include "qpixmap.h" -#include "qapplication.h" -#include "qptrdict.h" -#include "qtimer.h" -#include "qstringlist.h" -#include "qstyle.h" -#include "qpopupmenu.h" -#include "qguardedptr.h" +#include "ntqmemarray.h" +#include "ntqfontmetrics.h" +#include "ntqpainter.h" +#include "ntqstrlist.h" +#include "ntqpixmap.h" +#include "ntqapplication.h" +#include "ntqptrdict.h" +#include "ntqtimer.h" +#include "ntqstringlist.h" +#include "ntqstyle.h" +#include "ntqpopupmenu.h" +#include "ntqguardedptr.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #include @@ -161,7 +161,7 @@ TQListBoxPrivate::~TQListBoxPrivate() /*! - \class TQListBoxItem qlistbox.h + \class TQListBoxItem ntqlistbox.h \brief The TQListBoxItem class is the base class of all list box items. This class is an abstract base class used for all list box items. @@ -525,7 +525,7 @@ bool TQListBoxItem::isSelectable() const /*! - \class TQListBoxText qlistbox.h + \class TQListBoxText ntqlistbox.h \brief The TQListBoxText class provides list box items that display text. \ingroup advanced @@ -635,7 +635,7 @@ int TQListBoxText::rtti() const } /*! - \class TQListBoxPixmap qlistbox.h + \class TQListBoxPixmap ntqlistbox.h \brief The TQListBoxPixmap class provides list box items with a pixmap and optional text. @@ -806,7 +806,7 @@ int TQListBoxPixmap::rtti() const } /*! - \class TQListBox qlistbox.h + \class TQListBox ntqlistbox.h \brief The TQListBox widget provides a list of selectable, read-only items. \ingroup advanced diff --git a/src/widgets/qlistbox.h b/src/widgets/qlistbox.h deleted file mode 100644 index 385e92b37..000000000 --- a/src/widgets/qlistbox.h +++ /dev/null @@ -1,435 +0,0 @@ -/********************************************************************** -** -** Definition of TQListBox widget class -** -** Created : 941121 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLISTBOX_H -#define TQLISTBOX_H - -#ifndef QT_H -#include "qscrollview.h" -#include "qpixmap.h" -#endif // QT_H - -#ifndef QT_NO_LISTBOX - - -class TQListBoxPrivate; -class TQListBoxItem; -class TQString; -class TQStrList; -class TQStringList; - - -class Q_EXPORT TQListBox : public TQScrollView -{ - friend class TQListBoxItem; - friend class TQListBoxPrivate; - - Q_OBJECT - Q_ENUMS( SelectionMode LayoutMode ) - Q_PROPERTY( uint count READ count ) - Q_PROPERTY( int numItemsVisible READ numItemsVisible ) - Q_PROPERTY( int currentItem READ currentItem WRITE setCurrentItem ) - Q_PROPERTY( TQString currentText READ currentText ) - Q_PROPERTY( int topItem READ topItem WRITE setTopItem DESIGNABLE false ) - Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) - Q_PROPERTY( bool multiSelection READ isMultiSelection WRITE setMultiSelection DESIGNABLE false ) - Q_PROPERTY( LayoutMode columnMode READ columnMode WRITE setColumnMode ) - Q_PROPERTY( LayoutMode rowMode READ rowMode WRITE setRowMode ) - Q_PROPERTY( int numColumns READ numColumns ) - Q_PROPERTY( int numRows READ numRows ) - Q_PROPERTY( bool variableWidth READ variableWidth WRITE setVariableWidth ) - Q_PROPERTY( bool variableHeight READ variableHeight WRITE setVariableHeight ) - -public: - TQListBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - ~TQListBox(); - - virtual void setFont( const TQFont & ); - - uint count() const; - - void insertStringList( const TQStringList&, int index=-1 ); - void insertStrList( const TQStrList *, int index=-1 ); - void insertStrList( const TQStrList &, int index=-1 ); - void insertStrList( const char **, - int numStrings=-1, int index=-1 ); - - void insertItem( const TQListBoxItem *, int index=-1 ); - void insertItem( const TQListBoxItem *, const TQListBoxItem *after ); - void insertItem( const TQString &text, int index=-1 ); - void insertItem( const TQPixmap &pixmap, int index=-1 ); - void insertItem( const TQPixmap &pixmap, const TQString &text, int index=-1 ); - - void removeItem( int index ); - - TQString text( int index ) const; - const TQPixmap *pixmap( int index ) const; - - void changeItem( const TQListBoxItem *, int index ); - void changeItem( const TQString &text, int index ); - void changeItem( const TQPixmap &pixmap, int index ); - void changeItem( const TQPixmap &pixmap, const TQString &text, int index ); - - void takeItem( const TQListBoxItem * ); - - int numItemsVisible() const; - - int currentItem() const; - TQString currentText() const { return text(currentItem()); } - virtual void setCurrentItem( int index ); - virtual void setCurrentItem( TQListBoxItem * ); - void centerCurrentItem() { ensureCurrentVisible(); } - int topItem() const; - virtual void setTopItem( int index ); - virtual void setBottomItem( int index ); - - long maxItemWidth() const; - - enum SelectionMode { Single, Multi, Extended, NoSelection }; - virtual void setSelectionMode( SelectionMode ); - SelectionMode selectionMode() const; - - void setMultiSelection( bool multi ); - bool isMultiSelection() const; - - virtual void setSelected( TQListBoxItem *, bool ); - void setSelected( int, bool ); - bool isSelected( int ) const; - bool isSelected( const TQListBoxItem * ) const; - TQListBoxItem* selectedItem() const; - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - - TQListBoxItem *item( int index ) const; - int index( const TQListBoxItem * ) const; - TQListBoxItem *findItem( const TQString &text, ComparisonFlags compare = BeginsWith ) const; - - void triggerUpdate( bool doLayout ); - - bool itemVisible( int index ); - bool itemVisible( const TQListBoxItem * ); - - enum LayoutMode { FixedNumber, - FitToWidth, FitToHeight = FitToWidth, - Variable }; - virtual void setColumnMode( LayoutMode ); - virtual void setColumnMode( int ); - virtual void setRowMode( LayoutMode ); - 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 * ); - -#ifndef QT_NO_COMPAT - bool dragSelect() const { return TRUE; } - void setDragSelect( bool ) {} - bool autoScroll() const { return TRUE; } - void setAutoScroll( bool ) {} - bool autoScrollBar() const { return vScrollBarMode() == Auto; } - void setAutoScrollBar( bool enable ) { setVScrollBarMode( enable ? Auto : AlwaysOff ); } - bool scrollBar() const { return vScrollBarMode() != AlwaysOff; } - void setScrollBar( bool enable ) { setVScrollBarMode( enable ? AlwaysOn : AlwaysOff ); } - bool autoBottomScrollBar() const { return hScrollBarMode() == Auto; } - void setAutoBottomScrollBar( bool enable ) { setHScrollBarMode( enable ? Auto : AlwaysOff ); } - bool bottomScrollBar() const { return hScrollBarMode() != AlwaysOff; } - void setBottomScrollBar( bool enable ) { setHScrollBarMode( enable ? AlwaysOn : AlwaysOff ); } - bool smoothScrolling() const { return FALSE; } - void setSmoothScrolling( bool ) {} - bool autoUpdate() const { return TRUE; } - void setAutoUpdate( bool ) {} - void setFixedVisibleLines( int lines ) { setRowMode( lines ); } - int inSort( const TQListBoxItem * ); - int inSort( const TQString& text ); - int cellHeight( int i ) const { return itemHeight(i); } - int cellHeight() const { return itemHeight(); } - int cellWidth() const { return maxItemWidth(); } - int cellWidth(int i) const { Q_ASSERT(i==0); Q_UNUSED(i) return maxItemWidth(); } - int numCols() const { return numColumns(); } -#endif - - int itemHeight( int index = 0 ) const; - TQListBoxItem * itemAt( const TQPoint & ) const; - - TQRect itemRect( TQListBoxItem *item ) const; - - TQListBoxItem *firstItem() const; - - void sort( bool ascending = TRUE ); - -public slots: - void clear(); - virtual void ensureCurrentVisible(); - virtual void clearSelection(); - virtual void selectAll( bool select ); - virtual void invertSelection(); - -signals: - void highlighted( int index ); - void selected( int index ); - 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 *item ); - void onViewport(); - -protected: - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - void mouseDoubleClickEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); - void contentsContextMenuEvent( TQContextMenuEvent * ); - - void keyPressEvent( TQKeyEvent *e ); - void focusInEvent( TQFocusEvent *e ); - void focusOutEvent( TQFocusEvent *e ); - void resizeEvent( TQResizeEvent * ); - void showEvent( TQShowEvent * ); - - bool eventFilter( TQObject *o, TQEvent *e ); - - void updateItem( int index ); - void updateItem( TQListBoxItem * ); - -#ifndef QT_NO_COMPAT - void updateCellWidth() { } - int totalWidth() const { return contentsWidth(); } - int totalHeight() const { return contentsHeight(); } -#endif - - virtual void paintCell( TQPainter *, int row, int col ); - - void toggleCurrentItem(); - bool isRubberSelecting() const; - - void doLayout() const; - - void windowActivationChange( bool ); - -#ifndef QT_NO_COMPAT - bool itemYPos( int index, int *yPos ) const; - int findItem( int yPos ) const { return index(itemAt(TQPoint(0,yPos)) ); } -#endif - -protected slots: - void clearInputString(); - -private slots: - void refreshSlot(); - void doAutoScroll(); - void adjustItems(); - -private: - void mousePressEventEx( TQMouseEvent * ); - void tryGeometry( int, int ) const; - int currentRow() const; - int currentColumn() const; - void updateSelection(); - void repaintSelection(); - void drawRubber(); - void doRubberSelection( const TQRect &old, const TQRect &rubber ); - void handleItemChange( TQListBoxItem *old, bool shift, bool control ); - void selectRange( TQListBoxItem *from, TQListBoxItem *to, bool invert, bool includeFirst, bool clearSel = FALSE ); - - void emitChangedSignal( bool ); - - int columnAt( int ) const; - int rowAt( int ) const; - - TQListBoxPrivate * d; - - static TQListBox * changedListBox; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQListBox( const TQListBox & ); - TQListBox &operator=( const TQListBox & ); -#endif -}; - - -class Q_EXPORT TQListBoxItem -{ -public: - TQListBoxItem( TQListBox* listbox = 0 ); - TQListBoxItem( TQListBox* listbox, TQListBoxItem *after ); - virtual ~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 { return s; } - bool isCurrent() const; - -#ifndef QT_NO_COMPAT - bool selected() const { return isSelected(); } - bool current() const { return isCurrent(); } -#endif - - TQListBox *listBox() const; - - void setSelectable( bool b ); - bool isSelectable() const; - - TQListBoxItem *next() const; - TQListBoxItem *prev() const; - - virtual int rtti() const; - static int RTTI; - -protected: - virtual void paint( TQPainter * ) = 0; - virtual void setText( const TQString &text ) { txt = text; } - void setCustomHighlighting( bool ); - -private: - TQString txt; - uint s:1; - uint dirty:1; - uint custom_highlight : 1; - int x, y; - TQListBoxItem * p, * n; - TQListBox* lbox; - friend class TQListBox; - friend class TQListBoxPrivate; - friend class TQComboBox; - friend class TQComboBoxPopupItem; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQListBoxItem( const TQListBoxItem & ); - TQListBoxItem &operator=( const TQListBoxItem & ); -#endif -}; - - -class Q_EXPORT TQListBoxText : public TQListBoxItem -{ -public: - TQListBoxText( TQListBox* listbox, const TQString & text=TQString::null ); - TQListBoxText( const TQString & text=TQString::null ); - TQListBoxText( TQListBox* listbox, const TQString & text, TQListBoxItem *after ); - ~TQListBoxText(); - - int height( const TQListBox * ) const; - int width( const TQListBox * ) const; - - int rtti() const; - static int RTTI; - -protected: - void paint( TQPainter * ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQListBoxText( const TQListBoxText & ); - TQListBoxText &operator=( const TQListBoxText & ); -#endif -}; - - -class Q_EXPORT TQListBoxPixmap : public TQListBoxItem -{ -public: - TQListBoxPixmap( TQListBox* listbox, const TQPixmap & ); - TQListBoxPixmap( const TQPixmap & ); - TQListBoxPixmap( TQListBox* listbox, const TQPixmap & pix, TQListBoxItem *after ); - TQListBoxPixmap( TQListBox* listbox, const TQPixmap &, const TQString& ); - TQListBoxPixmap( const TQPixmap &, const TQString& ); - TQListBoxPixmap( TQListBox* listbox, const TQPixmap & pix, const TQString&, TQListBoxItem *after ); - ~TQListBoxPixmap(); - - const TQPixmap *pixmap() const { return ± } - - int height( const TQListBox * ) const; - int width( const TQListBox * ) const; - - int rtti() const; - static int RTTI; - -protected: - void paint( TQPainter * ); - -private: - TQPixmap pm; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQListBoxPixmap( const TQListBoxPixmap & ); - TQListBoxPixmap &operator=( const TQListBoxPixmap & ); -#endif -}; - - -#endif // QT_NO_LISTBOX - -#endif // TQLISTBOX_H diff --git a/src/widgets/qlistview.cpp b/src/widgets/qlistview.cpp index 7340bf35b..18d87f624 100644 --- a/src/widgets/qlistview.cpp +++ b/src/widgets/qlistview.cpp @@ -38,34 +38,34 @@ ** **********************************************************************/ -#include "qlistview.h" +#include "ntqlistview.h" #ifndef QT_NO_LISTVIEW -#include "qtimer.h" -#include "qheader.h" -#include "qpainter.h" -#include "qcursor.h" -#include "qptrstack.h" -#include "qptrlist.h" -#include "qstrlist.h" -#include "qapplication.h" -#include "qbitmap.h" -#include "qdatetime.h" -#include "qptrdict.h" -#include "qptrvector.h" -#include "qiconset.h" -#include "qcleanuphandler.h" -#include "qpixmapcache.h" -#include "qpopupmenu.h" -#include "qtl.h" -#include "qdragobject.h" -#include "qlineedit.h" -#include "qvbox.h" -#include "qtooltip.h" -#include "qstyle.h" -#include "qstylesheet.h" +#include "ntqtimer.h" +#include "ntqheader.h" +#include "ntqpainter.h" +#include "ntqcursor.h" +#include "ntqptrstack.h" +#include "ntqptrlist.h" +#include "ntqstrlist.h" +#include "ntqapplication.h" +#include "ntqbitmap.h" +#include "ntqdatetime.h" +#include "ntqptrdict.h" +#include "ntqptrvector.h" +#include "ntqiconset.h" +#include "ntqcleanuphandler.h" +#include "ntqpixmapcache.h" +#include "ntqpopupmenu.h" +#include "ntqtl.h" +#include "ntqdragobject.h" +#include "ntqlineedit.h" +#include "ntqvbox.h" +#include "ntqtooltip.h" +#include "ntqstyle.h" +#include "ntqstylesheet.h" #include "../kernel/qinternal_p.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif const int Unsorted = 16383; diff --git a/src/widgets/qlistview.h b/src/widgets/qlistview.h deleted file mode 100644 index 02abb51ec..000000000 --- a/src/widgets/qlistview.h +++ /dev/null @@ -1,605 +0,0 @@ -/**************************************************************************** -** -** Definition of TQListView widget class -** -** Created : 970809 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQLISTVIEW_H -#define TQLISTVIEW_H - -#ifndef QT_H -#include "qscrollview.h" -#endif // QT_H - -#ifndef QT_NO_LISTVIEW - - -class TQPixmap; -class TQFont; -class TQHeader; -class TQIconSet; - -class TQListView; -struct TQListViewPrivate; -struct TQCheckListItemPrivate; -class TQListViewItemIterator; -struct TQListViewItemIteratorPrivate; -class TQDragObject; -class TQMimeSource; -class TQLineEdit; -class TQListViewToolTip; - -class Q_EXPORT TQListViewItem : public TQt -{ - friend class TQListViewItemIterator; - friend class TQListViewToolTip; - -public: - TQListViewItem( TQListView * parent ); - TQListViewItem( TQListViewItem * parent ); - TQListViewItem( TQListView * parent, TQListViewItem * after ); - TQListViewItem( TQListViewItem * parent, TQListViewItem * after ); - - TQListViewItem( TQListView * parent, - TQString, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null ); - TQListViewItem( TQListViewItem * parent, - TQString, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null ); - - TQListViewItem( TQListView * parent, TQListViewItem * after, - TQString, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null ); - TQListViewItem( TQListViewItem * parent, TQListViewItem * after, - TQString, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null, - TQString = TQString::null, TQString = TQString::null ); - virtual ~TQListViewItem(); - - virtual void insertItem( TQListViewItem * ); - virtual void takeItem( TQListViewItem * ); - virtual void removeItem( TQListViewItem *item ) { takeItem( item ); } //obsolete, use takeItem instead - - int height() const; - virtual void invalidateHeight(); - int totalHeight() const; - virtual int width( const TQFontMetrics&, - const TQListView*, int column) const; - void widthChanged(int column=-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 *i, int col, bool ) const; - virtual void sortChildItems( int, bool ); - - int childCount() const { return nChildren; } - - bool isOpen() const { return open; } - virtual void setOpen( bool ); - virtual void setup(); - - virtual void setSelected( bool ); - bool isSelected() const { return selected; } - - virtual void paintCell( TQPainter *, const TQColorGroup & cg, - int column, int width, int alignment ); - virtual void paintBranches( TQPainter * p, const TQColorGroup & cg, - int w, int y, int h ); - virtual void paintFocus( TQPainter *, const TQColorGroup & cg, - const TQRect & r ); - - TQListViewItem * firstChild() const; - TQListViewItem * nextSibling() const { return siblingItem; } - TQListViewItem * parent() const; - - TQListViewItem * itemAbove(); - TQListViewItem * itemBelow(); - - int itemPos() const; - - TQListView *listView() const; - - virtual void setSelectable( bool enable ); - bool isSelectable() const { return selectable && enabled; } - - virtual void setExpandable( bool ); - bool isExpandable() const { return expandable; } - - void repaint() const; - - virtual void sort(); - void moveItem( TQListViewItem *after ); - - virtual void setDragEnabled( bool allow ); - virtual void setDropEnabled( bool allow ); - bool dragEnabled() const; - bool dropEnabled() const; - virtual bool acceptDrop( const TQMimeSource *mime ) const; - - void setVisible( bool b ); - bool isVisible() const; - - virtual void setRenameEnabled( int col, bool b ); - bool renameEnabled( int col ) const; - virtual void startRename( int col ); - - virtual void setEnabled( bool b ); - bool isEnabled() const; - - virtual int rtti() const; - // ### TQt 4: make const or better use an enum - static int RTTI; - - virtual void setMultiLinesEnabled( bool b ); - bool multiLinesEnabled() const; - -protected: - virtual void enforceSortOrder() const; - virtual void setHeight( int ); - virtual void activate(); - - bool activatedPos( TQPoint & ); -#ifndef QT_NO_DRAGANDDROP - virtual void dropped( TQDropEvent *e ); -#endif - virtual void dragEntered(); - virtual void dragLeft(); - virtual void okRename( int col ); - virtual void cancelRename( int col ); - - void ignoreDoubleClick(); - -private: - void init(); - void moveToJustAfter( TQListViewItem * ); - void enforceSortOrderBackToRoot(); - void removeRenameBox(); - - int ownHeight; - int maybeTotalHeight; - int nChildren; - - uint lsc: 14; - uint lso: 1; - uint open : 1; - uint selected : 1; - uint selectable: 1; - uint configured: 1; - uint expandable: 1; - uint is_root: 1; - uint allow_drag : 1; - uint allow_drop : 1; - uint visible : 1; - uint enabled : 1; - uint mlenabled : 1; - - TQListViewItem * parentItem; - TQListViewItem * siblingItem; - TQListViewItem * childItem; - TQLineEdit *renameBox; - int renameCol; - - void * columns; - - friend class TQListView; -}; - -class TQCheckListItem; - -class Q_EXPORT TQListView: public TQScrollView -{ - friend class TQListViewItemIterator; - friend class TQListViewItem; - friend class TQCheckListItem; - friend class TQListViewToolTip; - - Q_OBJECT - Q_ENUMS( SelectionMode ResizeMode RenameAction ) - Q_PROPERTY( int columns READ columns ) - Q_PROPERTY( bool multiSelection READ isMultiSelection WRITE setMultiSelection DESIGNABLE false ) - Q_PROPERTY( SelectionMode selectionMode READ selectionMode WRITE setSelectionMode ) - Q_PROPERTY( int childCount READ childCount ) - Q_PROPERTY( bool allColumnsShowFocus READ allColumnsShowFocus WRITE setAllColumnsShowFocus ) - Q_PROPERTY( bool showSortIndicator READ showSortIndicator WRITE setShowSortIndicator ) - Q_PROPERTY( int itemMargin READ itemMargin WRITE setItemMargin ) - Q_PROPERTY( bool rootIsDecorated READ rootIsDecorated WRITE setRootIsDecorated ) - Q_PROPERTY( bool showToolTips READ showToolTips WRITE setShowToolTips ) - Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode ) - Q_PROPERTY( int treeStepSize READ treeStepSize WRITE setTreeStepSize ) - Q_PROPERTY( RenameAction defaultRenameAction READ defaultRenameAction WRITE setDefaultRenameAction ) - -public: - TQListView( TQWidget* parent=0, const char* name=0, WFlags f = 0 ); - ~TQListView(); - - int treeStepSize() const; - virtual void setTreeStepSize( int ); - - virtual void insertItem( TQListViewItem * ); - virtual void takeItem( TQListViewItem * ); - virtual void removeItem( TQListViewItem *item ) { takeItem( item ); } // obsolete, use takeItem instead - - TQHeader * header() const; - - virtual int addColumn( const TQString &label, int size = -1); - virtual int addColumn( const TQIconSet& iconset, const TQString &label, int size = -1); - virtual void removeColumn( int index ); - virtual void setColumnText( int column, const TQString &label ); - virtual void setColumnText( int column, const TQIconSet& iconset, const TQString &label ); - TQString columnText( int column ) const; - virtual void setColumnWidth( int column, int width ); - int columnWidth( int column ) const; - enum WidthMode { Manual, Maximum }; - virtual void setColumnWidthMode( int column, WidthMode ); - WidthMode columnWidthMode( int column ) const; - int columns() const; - - virtual void setColumnAlignment( int, int ); - int columnAlignment( int ) const; - - void show(); - - TQListViewItem * itemAt( const TQPoint & screenPos ) const; - TQRect itemRect( const TQListViewItem * ) const; - int itemPos( const TQListViewItem * ); - - void ensureItemVisible( const TQListViewItem * ); - - void repaintItem( const TQListViewItem * ) const; - - virtual void setMultiSelection( bool enable ); - bool isMultiSelection() const; - - enum SelectionMode { Single, Multi, Extended, NoSelection }; - void setSelectionMode( SelectionMode mode ); - SelectionMode selectionMode() const; - - virtual void clearSelection(); - virtual void setSelected( TQListViewItem *, bool ); - void setSelectionAnchor( TQListViewItem * ); - bool isSelected( const TQListViewItem * ) const; - TQListViewItem * selectedItem() const; - virtual void setOpen( TQListViewItem *, bool ); - bool isOpen( const 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 column, bool ascending = TRUE ); - int sortColumn() const; - void setSortColumn( int column ); - SortOrder sortOrder() const; - void setSortOrder( SortOrder order ); - virtual void sort(); - - virtual void setFont( const TQFont & ); - virtual void setPalette( const TQPalette & ); - - bool eventFilter( TQObject * o, TQEvent * ); - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - - virtual void setShowSortIndicator( bool show ); - bool showSortIndicator() const; - virtual void setShowToolTips( bool b ); - bool showToolTips() const; - - enum ResizeMode { NoColumn, AllColumns, LastColumn }; - virtual void setResizeMode( ResizeMode m ); - ResizeMode resizeMode() const; - - TQListViewItem * findItem( const TQString& text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const; - - enum RenameAction { Accept, Reject }; - virtual void setDefaultRenameAction( RenameAction a ); - RenameAction defaultRenameAction() const; - bool isRenaming() const; - - void hideColumn( int column ); - -public slots: - virtual void clear(); - virtual void invertSelection(); - virtual void selectAll( bool select ); - void triggerUpdate(); - void setContentsPos( int x, int y ); - void adjustColumn( int col ); - -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 *item ); - void onViewport(); - - void expanded( TQListViewItem *item ); - void collapsed( TQListViewItem *item ); -#ifndef QT_NO_DRAGANDDROP - void dropped( TQDropEvent *e ); -#endif - void itemRenamed( TQListViewItem *item, int col, const TQString & ); - void itemRenamed( TQListViewItem *item, int col ); - -protected: - void contentsMousePressEvent( TQMouseEvent * e ); - void contentsMouseReleaseEvent( TQMouseEvent * e ); - void contentsMouseMoveEvent( TQMouseEvent * e ); - void contentsMouseDoubleClickEvent( TQMouseEvent * e ); - void contentsContextMenuEvent( TQContextMenuEvent * e ); -#ifndef QT_NO_DRAGANDDROP - void contentsDragEnterEvent( TQDragEnterEvent *e ); - void contentsDragMoveEvent( TQDragMoveEvent *e ); - void contentsDragLeaveEvent( TQDragLeaveEvent *e ); - void contentsDropEvent( TQDropEvent *e ); - virtual TQDragObject *dragObject(); - virtual void startDrag(); -#endif - - void focusInEvent( TQFocusEvent * e ); - void focusOutEvent( TQFocusEvent * e ); - - void keyPressEvent( TQKeyEvent *e ); - - void resizeEvent( TQResizeEvent *e ); - void viewportResizeEvent( TQResizeEvent *e ); - - void showEvent( TQShowEvent * ); - - void drawContentsOffset( TQPainter *, int ox, int oy, - int cx, int cy, int cw, int ch ); - - virtual void paintEmptyArea( TQPainter *, const TQRect & ); - void styleChange( TQStyle& ); - void windowActivationChange( bool ); - -protected slots: - void updateContents(); - void doAutoScroll(); - -private slots: - void changeSortColumn( int ); - void handleIndexChange(); - void updateDirtyItems(); - void makeVisible(); - void handleSizeChange( int, int, int ); - void startRename(); - void openFocusItem(); - -private: - void contentsMousePressEventEx( TQMouseEvent * e ); - void contentsMouseReleaseEventEx( TQMouseEvent * e ); - void init(); - void updateGeometries(); - void buildDrawableList() const; - void reconfigureItems(); - void widthChanged(const TQListViewItem*, int c); - void handleItemChange( TQListViewItem *old, bool shift, bool control ); - void selectRange( TQListViewItem *from, TQListViewItem *to, bool invert, bool includeFirst, bool clearSel = FALSE ); - bool selectRange( TQListViewItem *newItem, TQListViewItem *oldItem, TQListViewItem *anchorItem ); - bool clearRange( TQListViewItem *from, TQListViewItem *to, bool includeFirst = TRUE ); - void doAutoScroll( const TQPoint &cursorPos ); - - TQListViewPrivate * d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQListView( const TQListView & ); - TQListView &operator=( const TQListView & ); -#endif -}; - - -class Q_EXPORT TQCheckListItem : public TQListViewItem -{ -public: - enum Type { RadioButton, - CheckBox, - Controller, - RadioButtonController=Controller, - CheckBoxController }; - // ### should be integrated with qbutton in ver4 perhaps - enum ToggleState { Off, NoChange, On }; - - TQCheckListItem( TQCheckListItem *parent, const TQString &text, - Type = RadioButtonController ); - TQCheckListItem( TQCheckListItem *parent, TQListViewItem *after, - const TQString &text, Type = RadioButtonController ); - TQCheckListItem( TQListViewItem *parent, const TQString &text, - Type = RadioButtonController ); - TQCheckListItem( TQListViewItem *parent, TQListViewItem *after, - const TQString &text, Type = RadioButtonController ); - TQCheckListItem( TQListView *parent, const TQString &text, - Type = RadioButtonController ); - TQCheckListItem( TQListView *parent, TQListViewItem *after, - const TQString &text, Type = RadioButtonController ); - TQCheckListItem( TQListViewItem *parent, const TQString &text, - const TQPixmap & ); - TQCheckListItem( TQListView *parent, const TQString &text, - const TQPixmap & ); - ~TQCheckListItem(); - - void paintCell( TQPainter *, const TQColorGroup & cg, - int column, int width, int alignment ); - virtual void paintFocus( TQPainter *, const TQColorGroup & cg, - const TQRect & r ); - int width( const TQFontMetrics&, const TQListView*, int column) const; - void setup(); - - virtual void setOn( bool ); // ### should be replaced by setChecked in ver4 - bool isOn() const { return on; } - Type type() const { return myType; } - TQString text() const { return TQListViewItem::text( 0 ); } - TQString text( int n ) const { return TQListViewItem::text( n ); } - - void setTristate( bool ); - bool isTristate() const; - ToggleState state() const; - void setState( ToggleState s); - - int rtti() const; - static int RTTI; - -protected: - void activate(); - void turnOffChild(); - virtual void stateChange( bool ); - -private: - void init(); - ToggleState internalState() const; - void setStoredState( ToggleState newState, void *key ); - ToggleState storedState( void *key ) const; - void stateChange( ToggleState s ); - void restoreState( void *key, int depth = 0 ); - void updateController( bool update = TRUE , bool store = FALSE ); - void updateStoredState( void *key ); - void setState( ToggleState s, bool update, bool store ); - void setCurrentState( ToggleState s ); - - Type myType; - bool on; // ### remove in ver4 - TQCheckListItemPrivate *d; -}; - -class Q_EXPORT TQListViewItemIterator -{ - friend struct TQListViewPrivate; - friend class TQListView; - friend class TQListViewItem; - -public: - enum IteratorFlag { - Visible = 0x00000001, - Invisible = 0x00000002, - Selected = 0x00000004, - Unselected = 0x00000008, - Selectable = 0x00000010, - NotSelectable = 0x00000020, - DragEnabled = 0x00000040, - DragDisabled = 0x00000080, - DropEnabled = 0x00000100, - DropDisabled = 0x00000200, - Expandable = 0x00000400, - NotExpandable = 0x00000800, - Checked = 0x00001000, - NotChecked = 0x00002000 - }; - - TQListViewItemIterator(); - TQListViewItemIterator( TQListViewItem *item ); - TQListViewItemIterator( TQListViewItem *item, int iteratorFlags ); - - TQListViewItemIterator( const TQListViewItemIterator &it ); - TQListViewItemIterator( TQListView *lv ); - TQListViewItemIterator( TQListView *lv, int iteratorFlags ); - - TQListViewItemIterator &operator=( const TQListViewItemIterator &it ); - - ~TQListViewItemIterator(); - - TQListViewItemIterator &operator++(); - const TQListViewItemIterator operator++( int ); - TQListViewItemIterator &operator+=( int j ); - - TQListViewItemIterator &operator--(); - const TQListViewItemIterator operator--( int ); - TQListViewItemIterator &operator-=( int j ); - - TQListViewItem* operator*(); - TQListViewItem *current() const; - -protected: - TQListViewItem *curr; - TQListView *listView; - -private: - TQListViewItemIteratorPrivate* d() const; - void init( int flags ); - void addToListView(); - void currentRemoved(); - bool matchesFlags( const TQListViewItem* ) const; - bool testPair( TQListViewItemIterator::IteratorFlag, TQListViewItemIterator::IteratorFlag, bool ) const; - bool isChecked( const TQListViewItem* ) const; -}; - -#endif // QT_NO_LISTVIEW - -#endif // TQLISTVIEW_H diff --git a/src/widgets/qmainwindow.cpp b/src/widgets/qmainwindow.cpp index 3da52b6f7..26a96dbeb 100644 --- a/src/widgets/qmainwindow.cpp +++ b/src/widgets/qmainwindow.cpp @@ -38,30 +38,30 @@ ** **********************************************************************/ -#include "qmainwindow.h" +#include "ntqmainwindow.h" #ifndef QT_NO_MAINWINDOW -#include "qtimer.h" -#include "qlayout.h" -#include "qobjectlist.h" -#include "qintdict.h" -#include "qapplication.h" -#include "qptrlist.h" -#include "qmap.h" -#include "qcursor.h" -#include "qpainter.h" -#include "qmenubar.h" -#include "qpopupmenu.h" -#include "qtoolbar.h" -#include "qstatusbar.h" -#include "qscrollview.h" -#include "qtooltip.h" -#include "qdatetime.h" -#include "qwhatsthis.h" -#include "qbitmap.h" -#include "qdockarea.h" -#include "qstringlist.h" -#include "qstyle.h" +#include "ntqtimer.h" +#include "ntqlayout.h" +#include "ntqobjectlist.h" +#include "ntqintdict.h" +#include "ntqapplication.h" +#include "ntqptrlist.h" +#include "ntqmap.h" +#include "ntqcursor.h" +#include "ntqpainter.h" +#include "ntqmenubar.h" +#include "ntqpopupmenu.h" +#include "ntqtoolbar.h" +#include "ntqstatusbar.h" +#include "ntqscrollview.h" +#include "ntqtooltip.h" +#include "ntqdatetime.h" +#include "ntqwhatsthis.h" +#include "ntqbitmap.h" +#include "ntqdockarea.h" +#include "ntqstringlist.h" +#include "ntqstyle.h" #ifdef Q_WS_MACX # include "qt_mac.h" #endif @@ -507,7 +507,7 @@ void TQHideToolTip::maybeTip( const TQPoint &pos ) #endif /*! - \class TQMainWindow qmainwindow.h + \class TQMainWindow ntqmainwindow.h \brief The TQMainWindow class provides a main application window, with a menu bar, dock windows (e.g. for toolbars), and a status bar. diff --git a/src/widgets/qmainwindow.h b/src/widgets/qmainwindow.h deleted file mode 100644 index 055259371..000000000 --- a/src/widgets/qmainwindow.h +++ /dev/null @@ -1,261 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMainWindow class -** -** Created : 980316 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMAINWINDOW_H -#define TQMAINWINDOW_H - -#ifndef QT_H -#include "qwidget.h" -#include "qtoolbar.h" -#include "qptrlist.h" -#include "qtextstream.h" -#endif // QT_H - -#ifndef QT_NO_MAINWINDOW - -class TQMenuBar; -class TQStatusBar; -class TQToolTipGroup; -class TQMainWindowPrivate; -class TQMainWindowLayout; -class TQPopupMenu; - -class Q_EXPORT TQMainWindow: public TQWidget -{ - Q_OBJECT - Q_PROPERTY( bool rightJustification READ rightJustification WRITE setRightJustification DESIGNABLE false ) - Q_PROPERTY( bool usesBigPixmaps READ usesBigPixmaps WRITE setUsesBigPixmaps ) - Q_PROPERTY( bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel ) - Q_PROPERTY( bool dockWindowsMovable READ dockWindowsMovable WRITE setDockWindowsMovable ) - Q_PROPERTY( bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving ) - -public: - TQMainWindow( TQWidget* parent=0, const char* name=0, WFlags f = WType_TopLevel ); - ~TQMainWindow(); - -#ifndef QT_NO_MENUBAR - TQMenuBar * menuBar() const; -#endif - TQStatusBar * statusBar() const; -#ifndef QT_NO_TOOLTIP - TQToolTipGroup * toolTipGroup() const; -#endif - - virtual void setCentralWidget( TQWidget * ); - TQWidget * centralWidget() const; - - virtual void setDockEnabled( Dock dock, bool enable ); - bool isDockEnabled( Dock dock ) const; - bool isDockEnabled( TQDockArea *area ) const; - virtual void setDockEnabled( TQDockWindow *tb, Dock dock, bool enable ); - bool isDockEnabled( TQDockWindow *tb, Dock dock ) const; - bool isDockEnabled( TQDockWindow *tb, TQDockArea *area ) const; - - virtual void addDockWindow( TQDockWindow *, Dock = DockTop, bool newLine = FALSE ); - virtual void addDockWindow( TQDockWindow *, const TQString &label, - Dock = DockTop, bool newLine = FALSE ); - virtual void moveDockWindow( TQDockWindow *, Dock = DockTop ); - virtual void moveDockWindow( TQDockWindow *, Dock, bool nl, int index, int extraOffset = -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 *tb, Dock &dock, int &index, bool &nl, int &extraOffset ) const; - - TQPtrList dockWindows( Dock dock ) const; - TQPtrList dockWindows() const; - void lineUpDockWindows( bool keepNewLines = FALSE ); - - bool isDockMenuEnabled() const; - - // compatibility stuff - bool hasDockWindow( TQDockWindow *dw ); -#ifndef QT_NO_TOOLBAR - void addToolBar( TQDockWindow *, Dock = DockTop, bool newLine = FALSE ); - void addToolBar( TQDockWindow *, const TQString &label, - Dock = DockTop, bool newLine = FALSE ); - void moveToolBar( TQDockWindow *, Dock = DockTop ); - void moveToolBar( TQDockWindow *, Dock, bool nl, int index, int extraOffset = -1 ); - void removeToolBar( TQDockWindow * ); - - bool toolBarsMovable() const; - TQPtrList toolBars( Dock dock ) const; - void lineUpToolBars( bool keepNewLines = FALSE ); -#endif - - virtual TQDockArea *dockingArea( const TQPoint &p ); - TQDockArea *leftDock() const; - TQDockArea *rightDock() const; - TQDockArea *topDock() const; - TQDockArea *bottomDock() const; - - virtual bool isCustomizable() const; - - bool appropriate( TQDockWindow *dw ) const; - - enum DockWindows { OnlyToolBars, NoToolBars, AllDockWindows }; - TQPopupMenu *createDockWindowMenu( DockWindows 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 *dw, bool a ); - virtual void customize(); - - // compatibility stuff - void setToolBarsMovable( bool ); - -signals: - void pixmapSizeChanged( bool ); - void usesTextLabelChanged( bool ); - void dockWindowPositionChanged( TQDockWindow * ); - -#ifndef QT_NO_TOOLBAR - // compatibility stuff - void toolBarPositionChanged( TQToolBar * ); -#endif - -protected slots: - virtual void setUpLayout(); - virtual bool showDockMenu( const TQPoint &globalPos ); - void menuAboutToShow(); - -protected: - void paintEvent( TQPaintEvent * ); - void childEvent( TQChildEvent * ); - bool event( TQEvent * ); - void styleChange( TQStyle& ); - -private slots: - void slotPlaceChanged(); - void doLineUp() { lineUpDockWindows( TRUE ); } - -private: - TQMainWindowPrivate * d; - void triggerLayout( bool deleteLayout = TRUE); - bool dockMainWindow( TQObject *dock ); - -#ifndef QT_NO_MENUBAR - virtual void setMenuBar( TQMenuBar * ); -#endif - virtual void setStatusBar( TQStatusBar * ); -#ifndef QT_NO_TOOLTIP - virtual void setToolTipGroup( TQToolTipGroup * ); -#endif - - friend class TQDockWindow; - friend class TQMenuBar; - friend class TQHideDock; - friend class TQToolBar; - friend class TQMainWindowLayout; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMainWindow( const TQMainWindow & ); - TQMainWindow& operator=( const TQMainWindow & ); -#endif -}; - -#ifndef QT_NO_TOOLBAR -inline void TQMainWindow::addToolBar( TQDockWindow *w, ToolBarDock dock, bool newLine ) -{ - addDockWindow( w, dock, newLine ); -} - -inline void TQMainWindow::addToolBar( TQDockWindow *w, const TQString &label, - ToolBarDock dock, bool newLine ) -{ - addDockWindow( w, label, dock, newLine ); -} - -inline void TQMainWindow::moveToolBar( TQDockWindow *w, ToolBarDock dock ) -{ - moveDockWindow( w, dock ); -} - -inline void TQMainWindow::moveToolBar( TQDockWindow *w, ToolBarDock dock, bool nl, int index, int extraOffset ) -{ - moveDockWindow( w, dock, nl, index, extraOffset ); -} - -inline void TQMainWindow::removeToolBar( TQDockWindow *w ) -{ - removeDockWindow( w ); -} - -inline bool TQMainWindow::toolBarsMovable() const -{ - return dockWindowsMovable(); -} - -inline void TQMainWindow::lineUpToolBars( bool keepNewLines ) -{ - lineUpDockWindows( keepNewLines ); -} - -inline void TQMainWindow::setToolBarsMovable( bool b ) -{ - setDockWindowsMovable( b ); -} -#endif - -#ifndef QT_NO_TEXTSTREAM -Q_EXPORT TQTextStream &operator<<( TQTextStream &, const TQMainWindow & ); -Q_EXPORT TQTextStream &operator>>( TQTextStream &, TQMainWindow & ); -#endif - -#endif // QT_NO_MAINWINDOW - -#endif // TQMAINWINDOW_H diff --git a/src/widgets/qmenubar.cpp b/src/widgets/qmenubar.cpp index ebe231853..96a111b49 100644 --- a/src/widgets/qmenubar.cpp +++ b/src/widgets/qmenubar.cpp @@ -38,25 +38,25 @@ ** **********************************************************************/ -// qmainwindow.h before qmenubar.h because of GCC-2.7.* compatibility +// ntqmainwindow.h before ntqmenubar.h because of GCC-2.7.* compatibility // ### could be reorganised by discarding INCLUDE_MENUITEM_DEF and put // the relevant declarations in a private header? -#include "qmainwindow.h" +#include "ntqmainwindow.h" #ifndef QT_NO_MENUBAR -#include "qmenubar.h" -#include "qpopupmenu.h" -#include "qaccel.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qapplication.h" -#include "qguardedptr.h" -#include "qlayout.h" -#include "qcleanuphandler.h" +#include "ntqmenubar.h" +#include "ntqpopupmenu.h" +#include "ntqaccel.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqapplication.h" +#include "ntqguardedptr.h" +#include "ntqlayout.h" +#include "ntqcleanuphandler.h" #include "../kernel/qinternal_p.h" -#include "qstyle.h" -#include "qtimer.h" +#include "ntqstyle.h" +#include "ntqtimer.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif class TQMenuDataData { @@ -76,7 +76,7 @@ extern int qt_xfocusout_grab_counter; // defined in qapplication_x11.cpp #endif /*! - \class TQMenuBar qmenubar.h + \class TQMenuBar ntqmenubar.h \brief The TQMenuBar class provides a horizontal menu bar. \ingroup application diff --git a/src/widgets/qmenubar.h b/src/widgets/qmenubar.h deleted file mode 100644 index 2878c3dd5..000000000 --- a/src/widgets/qmenubar.h +++ /dev/null @@ -1,205 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMenuBar class -** -** Created : 941209 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMENUBAR_H -#define TQMENUBAR_H - -#ifndef QT_H -#include "qpopupmenu.h" // ### remove or keep for users' convenience? -#include "qframe.h" -#include "qmenudata.h" -#endif // QT_H - -#ifndef QT_NO_MENUBAR - -class TQPopupMenu; - -class Q_EXPORT TQMenuBar : public TQFrame, public TQMenuData -{ - Q_OBJECT - Q_ENUMS( Separator ) - Q_PROPERTY( Separator separator READ separator WRITE setSeparator DESIGNABLE false ) - Q_PROPERTY( bool defaultUp READ isDefaultUp WRITE setDefaultUp ) - -public: - TQMenuBar( TQWidget* parent=0, const char* name=0 ); - ~TQMenuBar(); - - void updateItem( int id ); - - void show(); // reimplemented show - void hide(); // reimplemented hide - - bool eventFilter( TQObject *, TQEvent * ); - - int heightForWidth(int) const; - - enum Separator { Never=0, InWindowsStyle=1 }; - Separator separator() const; - virtual void setSeparator( Separator when ); - - void setDefaultUp( bool ); - bool isDefaultUp() const; - - bool customWhatsThis() const; - - TQSize sizeHint() const; - TQSize minimumSize() const; - TQSize minimumSizeHint() const; - - void activateItemAt( int index ); - -#if defined(Q_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE) - static void initialize(); - static void cleanup(); -#endif - -signals: - void activated( int itemId ); - void highlighted( int itemId ); - -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 item ); - -private slots: - void subActivated( int itemId ); - void subHighlighted( int itemId ); -#ifndef QT_NO_ACCEL - void accelActivated( int itemId ); - void accelDestroyed(); -#endif - void popupDestroyed( TQObject* ); - void performDelayedChanges(); - - void languageChange(); - -private: - void performDelayedContentsChanged(); - void performDelayedStateChanged(); - void menuInsPopup( TQPopupMenu * ); - void menuDelPopup( TQPopupMenu * ); - void frameChanged(); - - bool tryMouseEvent( TQPopupMenu *, TQMouseEvent * ); - void tryKeyEvent( TQPopupMenu *, TQKeyEvent * ); - void goodbye( bool cancelled = FALSE ); - void openActPopup(); - - void setActiveItem( int index, bool show = TRUE, bool activate_first_item = TRUE ); - void setAltMode( bool ); - - int calculateRects( int max_width = -1 ); - -#ifndef QT_NO_ACCEL - void setupAccelerators(); - TQAccel *autoaccel; -#endif - TQRect *irects; - int rightSide; - - uint mseparator : 1; - uint waitforalt : 1; - uint popupvisible : 1; - uint hasmouse : 1; - uint defaultup : 1; - uint toggleclose : 1; - uint pendingDelayedContentsChanges : 1; - uint pendingDelayedStateChanges : 1; - - friend class TQPopupMenu; - -#if defined(Q_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE) - friend class TQWidget; - friend class TQApplication; - friend void qt_mac_set_modal_state(bool, TQMenuBar *); - - void macCreateNativeMenubar(); - void macRemoveNativeMenubar(); - void macDirtyNativeMenubar(); - -#if !defined(TQMAC_QMENUBAR_NO_EVENT) - static void qt_mac_install_menubar_event(MenuRef); - static OSStatus qt_mac_menubar_event(EventHandlerCallRef, EventRef, void *); -#endif - virtual void macWidgetChangedWindow(); - bool syncPopups(MenuRef ret, TQPopupMenu *d); - MenuRef createMacPopup(TQPopupMenu *d, int id, bool =FALSE); - bool updateMenuBar(); -#if !defined(TQMAC_QMENUBAR_NO_MERGE) - uint isCommand(TQMenuItem *, bool just_check=FALSE); -#endif - - uint mac_eaten_menubar : 1; - class MacPrivate; - MacPrivate *mac_d; - static bool activate(MenuRef, short, bool highlight=FALSE, bool by_accel=FALSE); - static bool activateCommand(uint cmd); - static bool macUpdateMenuBar(); - static bool macUpdatePopupVisible(MenuRef, bool); - static bool macUpdatePopup(MenuRef); -#endif - -private: // Disabled copy constructor and operator= - -#if defined(Q_DISABLE_COPY) - TQMenuBar( const TQMenuBar & ); - TQMenuBar &operator=( const TQMenuBar & ); -#endif -}; - - -#endif // QT_NO_MENUBAR - -#endif // TQMENUBAR_H diff --git a/src/widgets/qmenudata.cpp b/src/widgets/qmenudata.cpp index a5c2c8b09..4bacd22f8 100644 --- a/src/widgets/qmenudata.cpp +++ b/src/widgets/qmenudata.cpp @@ -38,12 +38,12 @@ ** **********************************************************************/ -#include "qmenudata.h" +#include "ntqmenudata.h" #ifndef QT_NO_MENUDATA -#include "qpopupmenu.h" -#include "qmenubar.h" -#include "qapplication.h" -#include "qguardedptr.h" +#include "ntqpopupmenu.h" +#include "ntqmenubar.h" +#include "ntqapplication.h" +#include "ntqguardedptr.h" class TQMenuItemData { public: @@ -62,7 +62,7 @@ TQMenuDataData::TQMenuDataData() {} /*! - \class TQMenuData qmenudata.h + \class TQMenuData ntqmenudata.h \brief The TQMenuData class is a base class for TQMenuBar and TQPopupMenu. \ingroup misc @@ -415,7 +415,7 @@ void TQMenuData::removePopup( TQPopupMenu *popup ) Returns the allocated menu identifier number (\a id if \a id >= 0). \sa removeItem(), changeItem(), setAccel(), connectItem(), TQAccel, - qnamespace.h + ntqnamespace.h */ int TQMenuData::insertItem( const TQString &text, @@ -442,7 +442,7 @@ int TQMenuData::insertItem( const TQString &text, Returns the allocated menu identifier number (\a id if \a id >= 0). \sa removeItem(), changeItem(), setAccel(), connectItem(), TQAccel, - qnamespace.h + ntqnamespace.h */ int TQMenuData::insertItem( const TQIconSet& icon, @@ -504,7 +504,7 @@ int TQMenuData::insertItem( const TQPixmap &pixmap, Returns the allocated menu identifier number (\a id if \a id >= 0). \sa removeItem(), changeItem(), setAccel(), connectItem(), TQAccel, - qnamespace.h + ntqnamespace.h */ int TQMenuData::insertItem( const TQIconSet& icon, @@ -864,7 +864,7 @@ void TQMenuData::clear() item \a id, or 0 if it has no accelerator key or if there is no such menu item. - \sa setAccel(), TQAccel, qnamespace.h + \sa setAccel(), TQAccel, ntqnamespace.h */ TQKeySequence TQMenuData::accel( int id ) const @@ -880,7 +880,7 @@ TQKeySequence TQMenuData::accel( int id ) const An accelerator key consists of a key code and a combination of the modifiers \c SHIFT, \c CTRL, \c ALT or \c UNICODE_ACCEL (OR'ed or - added). The header file \c qnamespace.h contains a list of key + added). The header file \c ntqnamespace.h contains a list of key codes. Defining an accelerator key produces a text that is added to the @@ -1462,7 +1462,7 @@ TQString TQMenuData::whatsThis( int id ) const /*! - \class TQCustomMenuItem qmenudata.h + \class TQCustomMenuItem ntqmenudata.h \brief The TQCustomMenuItem class is an abstract base class for custom menu items in popup menus. \ingroup misc diff --git a/src/widgets/qmenudata.h b/src/widgets/qmenudata.h deleted file mode 100644 index 71f9a6cfe..000000000 --- a/src/widgets/qmenudata.h +++ /dev/null @@ -1,286 +0,0 @@ -/**************************************************************************** -** -** Definition of TQMenuData class -** -** Created : 941128 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMENUDATA_H -#define TQMENUDATA_H - -#ifndef QT_H -#include "qglobal.h" -#include "qiconset.h" // conversion TQPixmap->TQIconset -#include "qkeysequence.h" -#include "qstring.h" -#include "qsignal.h" -#include "qfont.h" -#endif // QT_H - -#ifndef QT_NO_MENUDATA - -class TQPopupMenu; -class TQMenuDataData; -class TQObject; - -class TQCustomMenuItem; -class TQMenuItemData; - -class Q_EXPORT TQMenuItem // internal menu item class -{ -friend class TQMenuData; -public: - TQMenuItem(); - ~TQMenuItem(); - - int id() const { return ident; } - TQIconSet *iconSet() const { return iconset_data; } - TQString text() const { return text_data; } - TQString whatsThis() const { return whatsthis_data; } - TQPixmap *pixmap() const { return pixmap_data; } - TQPopupMenu *popup() const { return popup_menu; } - TQWidget *widget() const { return widget_item; } - TQCustomMenuItem *custom() const; -#ifndef QT_NO_ACCEL - TQKeySequence key() const { return accel_key; } -#endif - TQSignal *signal() const { return signal_data; } - bool isSeparator() const { return is_separator; } - bool isEnabled() const { return is_enabled; } - bool isChecked() const { return is_checked; } - bool isDirty() const { return is_dirty; } - bool isVisible() const { return is_visible; } - bool isEnabledAndVisible() const { return is_enabled && is_visible; } - - void setText( const TQString &text ) { text_data = text; } - void setDirty( bool dirty ) { is_dirty = dirty; } - void setVisible( bool visible ) { is_visible = visible; } - void setWhatsThis( const TQString &text ) { whatsthis_data = text; } - -private: - int ident; // item identifier - TQIconSet *iconset_data; // icons - TQString text_data; // item text - TQString whatsthis_data; // item Whats This help text - TQPixmap *pixmap_data; // item pixmap - TQPopupMenu *popup_menu; // item popup menu - TQWidget *widget_item; // widget menu item -#ifndef QT_NO_ACCEL - TQKeySequence accel_key; // accelerator key (state|ascii) -#endif - TQSignal *signal_data; // connection - uint is_separator : 1; // separator flag - uint is_enabled : 1; // disabled flag - uint is_checked : 1; // checked flag - uint is_dirty : 1; // dirty (update) flag - uint is_visible : 1; // visibility flag - TQMenuItemData* d; - - TQMenuItemData* extra(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMenuItem( const TQMenuItem & ); - TQMenuItem &operator=( const TQMenuItem & ); -#endif -}; - -#include "qptrlist.h" -typedef TQPtrList TQMenuItemList; -typedef TQPtrListIterator TQMenuItemListIt; - - -class Q_EXPORT TQCustomMenuItem : public TQt -{ -public: - TQCustomMenuItem(); - virtual ~TQCustomMenuItem(); - virtual bool fullSpan() const; - virtual bool isSeparator() const; - virtual void setFont( const TQFont& font ); - virtual void paint( TQPainter* p, const TQColorGroup& cg, bool act, - bool enabled, int x, int y, int w, int h ) = 0; - virtual TQSize sizeHint() = 0; -}; - - -class Q_EXPORT TQMenuData // menu data class -{ -friend class TQMenuBar; -friend class TQPopupMenu; -public: - TQMenuData(); - virtual ~TQMenuData(); - - uint count() const; - - - int insertItem( const TQString &text, - const TQObject *receiver, const char* member, - const TQKeySequence& accel = 0, int id = -1, int index = -1 ); - int insertItem( const TQIconSet& icon, - const TQString &text, - const TQObject *receiver, const char* member, - const TQKeySequence& accel = 0, int id = -1, int index = -1 ); - int insertItem( const TQPixmap &pixmap, - const TQObject *receiver, const char* member, - const TQKeySequence& accel = 0, int id = -1, int index = -1 ); - int insertItem( const TQIconSet& icon, - const TQPixmap &pixmap, - const TQObject *receiver, const char* member, - const TQKeySequence& accel = 0, int id = -1, int index = -1 ); - - int insertItem( const TQString &text, int id=-1, int index=-1 ); - int insertItem( const TQIconSet& icon, - const TQString &text, int id=-1, int index=-1 ); - - int insertItem( const TQString &text, TQPopupMenu *popup, - int id=-1, int index=-1 ); - int insertItem( const TQIconSet& icon, - const TQString &text, TQPopupMenu *popup, - int id=-1, int index=-1 ); - - - int insertItem( const TQPixmap &pixmap, int id=-1, int index=-1 ); - int insertItem( const TQIconSet& icon, - const TQPixmap &pixmap, int id=-1, int index=-1 ); - int insertItem( const TQPixmap &pixmap, TQPopupMenu *popup, - int id=-1, int index=-1 ); - int insertItem( const TQIconSet& icon, - const TQPixmap &pixmap, TQPopupMenu *popup, - int id=-1, int index=-1 ); - - int insertItem( TQWidget* widget, int id=-1, int index=-1 ); - - int insertItem( const TQIconSet& icon, TQCustomMenuItem* custom, int id=-1, int index=-1 ); - int insertItem( TQCustomMenuItem* custom, int id=-1, int index=-1 ); - - - int insertSeparator( int index=-1 ); - - void removeItem( int id ); - void removeItemAt( int index ); - void clear(); - -#ifndef QT_NO_ACCEL - TQKeySequence accel( int id ) const; - void setAccel( const TQKeySequence& key, int id ); -#endif - - TQIconSet *iconSet( int id ) const; - TQString text( int id ) const; - TQPixmap *pixmap( int id ) const; - - void setWhatsThis( int id, const TQString& ); - TQString whatsThis( int id ) const; - - - void changeItem( int id, const TQString &text ); - void changeItem( int id, const TQPixmap &pixmap ); - void changeItem( int id, const TQIconSet &icon, const TQString &text ); - void changeItem( int id, const TQIconSet &icon, const TQPixmap &pixmap ); - - void changeItem( const TQString &text, int id ) { changeItem( id, text); } // obsolete - void changeItem( const TQPixmap &pixmap, int id ) { changeItem( id, pixmap ); } // obsolete - void changeItem( const TQIconSet &icon, const TQString &text, int id ) { // obsolete - changeItem( id, icon, text ); - } - - bool isItemActive( int id ) const; - - bool isItemEnabled( int id ) const; - void setItemEnabled( int id, bool enable ); - - bool isItemChecked( int id ) const; - void setItemChecked( int id, bool check ); - - bool isItemVisible( int id ) const; - void setItemVisible( int id, bool visible ); - - virtual void updateItem( int id ); - - int indexOf( int id ) const; - int idAt( int index ) const; - virtual void setId( int index, int id ); - - bool connectItem( int id, - const TQObject *receiver, const char* member ); - bool disconnectItem( int id, - const TQObject *receiver, const char* member ); - - bool setItemParameter( int id, int param ); - int itemParameter( int id ) const; - - TQMenuItem *findItem( int id ) const; - TQMenuItem *findItem( int id, TQMenuData ** parent ) const; - TQMenuItem * findPopup( TQPopupMenu *, int *index = 0 ); - - virtual void activateItemAt( int index ); - -protected: - int actItem; - TQMenuItemList *mitems; - TQMenuData *parentMenu; - uint isPopupMenu : 1; - uint isMenuBar : 1; - uint badSize : 1; - uint mouseBtDn : 1; - uint avoid_circularity : 1; - uint actItemDown : 1; - virtual void menuContentsChanged(); - virtual void menuStateChanged(); - virtual void menuInsPopup( TQPopupMenu * ); - virtual void menuDelPopup( TQPopupMenu * ); - -private: - int insertAny( const TQString *, const TQPixmap *, TQPopupMenu *, - const TQIconSet*, int, int, TQWidget* = 0, TQCustomMenuItem* = 0); - void removePopup( TQPopupMenu * ); - void changeItemIconSet( int id, const TQIconSet &icon ); - - TQMenuDataData *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMenuData( const TQMenuData & ); - TQMenuData &operator=( const TQMenuData & ); -#endif -}; - - -#endif // QT_NO_MENUDATA - -#endif // TQMENUDATA_H diff --git a/src/widgets/qmultilineedit.cpp b/src/widgets/qmultilineedit.cpp index affe2febe..e34d3f9b3 100644 --- a/src/widgets/qmultilineedit.cpp +++ b/src/widgets/qmultilineedit.cpp @@ -38,24 +38,24 @@ ** **********************************************************************/ -#include "qmultilineedit.h" +#include "ntqmultilineedit.h" #ifndef QT_NO_MULTILINEEDIT -#include "qpainter.h" -#include "qscrollbar.h" -#include "qcursor.h" -#include "qclipboard.h" -#include "qpixmap.h" -#include "qregexp.h" -#include "qapplication.h" -#include "qdragobject.h" -#include "qpopupmenu.h" -#include "qtimer.h" -#include "qdict.h" +#include "ntqpainter.h" +#include "ntqscrollbar.h" +#include "ntqcursor.h" +#include "ntqclipboard.h" +#include "ntqpixmap.h" +#include "ntqregexp.h" +#include "ntqapplication.h" +#include "ntqdragobject.h" +#include "ntqpopupmenu.h" +#include "ntqtimer.h" +#include "ntqdict.h" #include "../kernel/qrichtext_p.h" /*! - \class TQMultiLineEdit qmultilineedit.h + \class TQMultiLineEdit ntqmultilineedit.h \obsolete \brief The TQMultiLineEdit widget is a simple editor for inputting text. diff --git a/src/widgets/qmultilineedit.h b/src/widgets/qmultilineedit.h deleted file mode 100644 index 16f36abd1..000000000 --- a/src/widgets/qmultilineedit.h +++ /dev/null @@ -1,141 +0,0 @@ -/********************************************************************** -** -** Definition of TQMultiLineEdit widget class -** -** Created : 961005 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQMULTILINEEDIT_H -#define TQMULTILINEEDIT_H - -#ifndef QT_H -#include "qtextedit.h" -#endif // QT_H - -#ifndef QT_NO_MULTILINEEDIT - -class TQMultiLineEditCommand; -class TQValidator; -class TQMultiLineEditData; - -class Q_EXPORT TQMultiLineEdit : public TQTextEdit -{ - Q_OBJECT - Q_PROPERTY( int numLines READ numLines ) - Q_PROPERTY( bool atBeginning READ atBeginning ) - Q_PROPERTY( bool atEnd READ atEnd ) - Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) - Q_PROPERTY( bool edited READ edited WRITE setEdited DESIGNABLE false ) - -public: - TQMultiLineEdit( TQWidget* parent=0, const char* name=0 ); - ~TQMultiLineEdit(); - - TQString textLine( int line ) const; - int numLines() const; - - virtual void insertLine( const TQString &s, int line = -1 ); - virtual void insertAt( const TQString &s, int line, int col ) { - insertAt( s, line, col, FALSE ); - } - virtual void insertAt( const TQString &s, int line, int col, bool mark ); - virtual void removeLine( int line ); - virtual void setCursorPosition( int line, int col ) { - setCursorPosition( line, col, FALSE ); - } - virtual void setCursorPosition( int line, int col, bool mark ); - bool atBeginning() const; - bool atEnd() const; - - void setAlignment( int flags ); - int alignment() const; - - void setEdited( bool ); - bool edited() const; - - bool hasMarkedText() const; - TQString markedText() const; - - void cursorWordForward( bool mark ); - void cursorWordBackward( bool mark ); - - // noops - bool autoUpdate() const { return TRUE; } - virtual void setAutoUpdate( bool ) {} - - int totalWidth() const { return contentsWidth(); } - int totalHeight() const { return contentsHeight(); } - - int maxLines() const { return TQWIDGETSIZE_MAX; } - void setMaxLines( int ) {} - -public slots: - void deselect() { selectAll( FALSE ); } - -protected: - TQPoint cursorPoint() const; - -protected: - virtual void insertAndMark( const TQString&, bool mark ); - virtual void newLine(); - virtual void killLine(); - virtual void pageUp( bool mark=FALSE ); - virtual void pageDown( bool mark=FALSE ); - virtual void cursorLeft( bool mark=FALSE, bool wrap = TRUE ); - virtual void cursorRight( bool mark=FALSE, bool wrap = TRUE ); - virtual void cursorUp( bool mark=FALSE ); - virtual void cursorDown( bool mark=FALSE ); - virtual void backspace(); - virtual void home( bool mark=FALSE ); - virtual void end( bool mark=FALSE ); - - bool getMarkedRegion( int *line1, int *col1, - int *line2, int *col2 ) const; - int lineLength( int row ) const; - -private: - TQMultiLineEditData *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQMultiLineEdit( const TQMultiLineEdit & ); - TQMultiLineEdit &operator=( const TQMultiLineEdit & ); -#endif -}; - -#endif // QT_NO_MULTILINEEDIT - -#endif // TQMULTILINED_H diff --git a/src/widgets/qpopupmenu.cpp b/src/widgets/qpopupmenu.cpp index 77d7b9947..9c03b0319 100644 --- a/src/widgets/qpopupmenu.cpp +++ b/src/widgets/qpopupmenu.cpp @@ -38,26 +38,26 @@ ** **********************************************************************/ -#include "qpopupmenu.h" +#include "ntqpopupmenu.h" #ifndef QT_NO_POPUPMENU -#include "qmenubar.h" -#include "qaccel.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qapplication.h" -#include "qpixmap.h" -#include "qpixmapcache.h" -#include "qtimer.h" -#include "qwhatsthis.h" -#include "qobjectlist.h" -#include "qguardedptr.h" +#include "ntqmenubar.h" +#include "ntqaccel.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqapplication.h" +#include "ntqpixmap.h" +#include "ntqpixmapcache.h" +#include "ntqtimer.h" +#include "ntqwhatsthis.h" +#include "ntqobjectlist.h" +#include "ntqguardedptr.h" #include "qeffects_p.h" -#include "qcursor.h" -#include "qstyle.h" -#include "qtimer.h" -#include "qdatetime.h" +#include "ntqcursor.h" +#include "ntqstyle.h" +#include "ntqtimer.h" +#include "ntqdatetime.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif //#define ANIMATED_POPUP @@ -129,7 +129,7 @@ static TQMenuItem* whatsThisItem = 0; #endif /*! - \class TQPopupMenu qpopupmenu.h + \class TQPopupMenu ntqpopupmenu.h \brief The TQPopupMenu class provides a popup menu widget. \ingroup application diff --git a/src/widgets/qpopupmenu.h b/src/widgets/qpopupmenu.h deleted file mode 100644 index 5e7d10f9c..000000000 --- a/src/widgets/qpopupmenu.h +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPopupMenu class -** -** Created : 941128 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPOPUPMENU_H -#define TQPOPUPMENU_H - -#ifndef QT_H -#include "qframe.h" -#include "qmenudata.h" -#endif // QT_H - -#ifndef QT_NO_POPUPMENU -class TQPopupMenuPrivate; - -class Q_EXPORT TQPopupMenu : public TQFrame, public TQMenuData -{ - Q_OBJECT - Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable ) -public: - TQPopupMenu( TQWidget* parent=0, const char* name=0 ); - ~TQPopupMenu(); - - void popup( const TQPoint & pos, int indexAtPoint = -1 ); // open - void updateItem( int id ); - - virtual void setCheckable( bool ); - bool isCheckable() const; - - void setFont( const TQFont & ); - void show(); - void hide(); - - int exec(); - int exec( const TQPoint & pos, int indexAtPoint = 0 ); // modal - - virtual void setActiveItem( int ); - TQSize sizeHint() const; - - int idAt( int index ) const { return TQMenuData::idAt( index ); } - int idAt( const TQPoint& pos ) const; - - bool customWhatsThis() const; - - int insertTearOffHandle( int id=-1, int index=-1 ); - - void activateItemAt( int index ); - TQRect itemGeometry( int index ); - - -signals: - void activated( int itemId ); - void highlighted( int itemId ); - void activatedRedirect( int itemId ); // to parent menu - void highlightedRedirect( int itemId ); - void aboutToShow(); - void aboutToHide(); - -protected: - int itemHeight( int ) const; - int itemHeight( TQMenuItem* mi ) const; - void drawItem( TQPainter* p, int tab, TQMenuItem* mi, - bool act, int x, int y, int w, int h); - - void drawContents( TQPainter * ); - - void closeEvent( TQCloseEvent *e ); - 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 next ); - - int itemAtPos( const TQPoint &, bool ignoreSeparator = TRUE ) const; - -private slots: - void subActivated( int itemId ); - void subHighlighted( int itemId ); -#ifndef QT_NO_ACCEL - void accelActivated( int itemId ); - void accelDestroyed(); -#endif - void popupDestroyed( TQObject* ); - void modalActivation( int ); - - void subMenuTimer(); - void subScrollTimer(); - void allowAnimation(); - void toggleTearOff(); - - void performDelayedChanges(); - -private: - void updateScrollerState(); - void menuContentsChanged(); - void menuStateChanged(); - void performDelayedContentsChanged(); - void performDelayedStateChanged(); - void menuInsPopup( TQPopupMenu * ); - void menuDelPopup( TQPopupMenu * ); - void frameChanged(); - - void actSig( int, bool = FALSE ); - void hilitSig( int ); - virtual void setFirstItemActive(); - void hideAllPopups(); - void hidePopups(); - bool tryMenuBar( TQMouseEvent * ); - void byeMenuBar(); - - TQSize updateSize(bool force_recalc=FALSE, bool do_resize=TRUE); - void updateRow( int row ); - TQRect screenRect(const TQPoint& pos); -#ifndef QT_NO_ACCEL - void updateAccel( TQWidget * ); - void enableAccel( bool ); -#endif - TQPopupMenuPrivate *d; -#ifndef QT_NO_ACCEL - TQAccel *autoaccel; -#endif - -#if defined(Q_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE) - bool macPopupMenu(const TQPoint &, int); - uint mac_dirty_popup : 1; -#endif - - int popupActive; - int tab; - uint accelDisabled : 1; - uint checkable : 1; - uint connectModalRecursionSafety : 1; - uint tornOff : 1; - uint pendingDelayedContentsChanges : 1; - uint pendingDelayedStateChanges : 1; - int maxPMWidth; - int ncols; - bool snapToMouse; - bool tryMouseEvent( TQPopupMenu *, TQMouseEvent * ); - - friend class TQMenuData; - friend class TQMenuBar; - - void connectModal(TQPopupMenu* receiver, bool doConnect); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPopupMenu( const TQPopupMenu & ); - TQPopupMenu &operator=( const TQPopupMenu & ); -#endif -}; - - -#endif // QT_NO_POPUPMENU - -#endif // TQPOPUPMENU_H diff --git a/src/widgets/qprogressbar.cpp b/src/widgets/qprogressbar.cpp index 345038e8b..09d6befd7 100644 --- a/src/widgets/qprogressbar.cpp +++ b/src/widgets/qprogressbar.cpp @@ -38,20 +38,20 @@ ** **********************************************************************/ -#include "qprogressbar.h" +#include "ntqprogressbar.h" #ifndef QT_NO_PROGRESSBAR -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqstyle.h" #include "../kernel/qinternal_p.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #include /*! - \class TQProgressBar qprogressbar.h + \class TQProgressBar ntqprogressbar.h \brief The TQProgressBar widget provides a horizontal progress bar. \ingroup advanced diff --git a/src/widgets/qprogressbar.h b/src/widgets/qprogressbar.h deleted file mode 100644 index 76463f1e7..000000000 --- a/src/widgets/qprogressbar.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Definition of TQProgressBar class -** -** Created : 970520 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPROGRESSBAR_H -#define TQPROGRESSBAR_H - -#ifndef QT_H -#include "qframe.h" -#endif // QT_H - -#ifndef QT_NO_PROGRESSBAR - - -class TQProgressBarPrivate; - - -class Q_EXPORT TQProgressBar : public TQFrame -{ - Q_OBJECT - Q_PROPERTY( int totalSteps READ totalSteps WRITE setTotalSteps ) - Q_PROPERTY( int progress READ progress WRITE setProgress ) - Q_PROPERTY( TQString progressString READ progressString ) - Q_PROPERTY( bool centerIndicator READ centerIndicator WRITE setCenterIndicator ) - Q_PROPERTY( bool indicatorFollowsStyle READ indicatorFollowsStyle WRITE setIndicatorFollowsStyle ) - Q_PROPERTY( bool percentageVisible READ percentageVisible WRITE setPercentageVisible ) - -public: - TQProgressBar( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - TQProgressBar( int totalSteps, TQWidget* parent=0, const char* name=0, WFlags f=0 ); - - int totalSteps() const; - int progress() const; - const TQString &progressString() const; - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - - void setCenterIndicator( bool on ); - 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 totalSteps ); - virtual void setProgress( int progress ); - void setProgress( int progress, int totalSteps ); - -protected: - void drawContents( TQPainter * ); - virtual bool setIndicator( TQString & progress_str, int progress, - int totalSteps ); - void styleChange( TQStyle& ); - -private: - int total_steps; - int progress_val; - int percentage; - TQString progress_str; - bool center_indicator : 1; - bool auto_indicator : 1; - bool percentage_visible : 1; - TQProgressBarPrivate * d; - void initFrame(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQProgressBar( const TQProgressBar & ); - TQProgressBar &operator=( const TQProgressBar & ); -#endif -}; - - -inline int TQProgressBar::totalSteps() const -{ - return total_steps; -} - -inline int TQProgressBar::progress() const -{ - return progress_val; -} - -inline const TQString &TQProgressBar::progressString() const -{ - return progress_str; -} - -inline bool TQProgressBar::centerIndicator() const -{ - return center_indicator; -} - -inline bool TQProgressBar::indicatorFollowsStyle() const -{ - return auto_indicator; -} - -inline bool TQProgressBar::percentageVisible() const -{ - return percentage_visible; -} - -#endif // QT_NO_PROGRESSBAR - -#endif // TQPROGRESSBAR_H diff --git a/src/widgets/qpushbutton.cpp b/src/widgets/qpushbutton.cpp index 31641161e..cbb45e443 100644 --- a/src/widgets/qpushbutton.cpp +++ b/src/widgets/qpushbutton.cpp @@ -38,25 +38,25 @@ ** **********************************************************************/ -#include "qpushbutton.h" +#include "ntqpushbutton.h" #ifndef QT_NO_PUSHBUTTON -#include "qdialog.h" -#include "qfontmetrics.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qbitmap.h" -#include "qpopupmenu.h" -#include "qguardedptr.h" -#include "qapplication.h" -#include "qtoolbar.h" -#include "qstyle.h" +#include "ntqdialog.h" +#include "ntqfontmetrics.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqbitmap.h" +#include "ntqpopupmenu.h" +#include "ntqguardedptr.h" +#include "ntqapplication.h" +#include "ntqtoolbar.h" +#include "ntqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif /*! - \class TQPushButton qpushbutton.h + \class TQPushButton ntqpushbutton.h \brief The TQPushButton widget provides a command button. \ingroup basic diff --git a/src/widgets/qpushbutton.h b/src/widgets/qpushbutton.h deleted file mode 100644 index 5824802e7..000000000 --- a/src/widgets/qpushbutton.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Definition of TQPushButton class -** -** Created : 940221 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQPUSHBUTTON_H -#define TQPUSHBUTTON_H - -#ifndef QT_H -#include "qbutton.h" -#include "qiconset.h" -#endif // QT_H - -#ifndef QT_NO_PUSHBUTTON -class TQPushButtonPrivate; -class TQPopupMenu; - -class Q_EXPORT TQPushButton : public TQButton -{ - Q_OBJECT - - Q_PROPERTY( bool autoDefault READ autoDefault WRITE setAutoDefault ) - Q_PROPERTY( bool default READ isDefault WRITE setDefault ) - Q_PROPERTY( bool menuButton READ isMenuButton DESIGNABLE false ) - Q_PROPERTY( TQIconSet iconSet READ iconSet WRITE setIconSet ) - Q_OVERRIDE( bool toggleButton WRITE setToggleButton ) - Q_OVERRIDE( bool on WRITE setOn ) - Q_PROPERTY( bool flat READ isFlat WRITE setFlat ) - Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) - -public: - TQPushButton( TQWidget *parent, const char* name=0 ); - TQPushButton( const TQString &text, TQWidget *parent, const char* name=0 ); -#ifndef QT_NO_ICONSET - TQPushButton( const TQIconSet& icon, const TQString &text, TQWidget *parent, const char* name=0 ); -#endif - ~TQPushButton(); - - TQSize sizeHint() const; - - void move( int x, int y ); - void move( const TQPoint &p ); - void resize( int w, int h ); - void resize( const TQSize & ); - void setGeometry( int x, int y, int w, int h ); - - void setGeometry( const TQRect & ); - - void setToggleButton( bool ); - - bool autoDefault() const { return autoDefButton; } - virtual void setAutoDefault( bool autoDef ); - bool isDefault() const { return defButton; } - virtual void setDefault( bool def ); - - virtual void setIsMenuButton( bool enable ) { // obsolete functions - if ( (bool)hasMenuArrow == enable ) - return; - hasMenuArrow = enable ? 1 : 0; - update(); - updateGeometry(); - } - bool isMenuButton() const { return hasMenuArrow; } - -#ifndef QT_NO_POPUPMENU - void setPopup( TQPopupMenu* popup ); - TQPopupMenu* popup() const; -#endif -#ifndef QT_NO_ICONSET - void setIconSet( const TQIconSet& ); - TQIconSet* iconSet() const; -#endif - 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 slots: -#ifndef QT_NO_POPUPMENU - void popupPressed(); -#endif -private: - void init(); - - uint autoDefButton : 1; - uint defButton : 1; - uint flt : 1; - uint reserved : 1; // UNUSED - uint lastEnabled : 1; // UNUSED - uint hasMenuArrow : 1; - - TQPushButtonPrivate* d; - - friend class TQDialog; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQPushButton( const TQPushButton & ); - TQPushButton &operator=( const TQPushButton & ); -#endif -}; - - -#endif // QT_NO_PUSHBUTTON - -#endif // TQPUSHBUTTON_H diff --git a/src/widgets/qradiobutton.cpp b/src/widgets/qradiobutton.cpp index 39f0e9740..e4c343f90 100644 --- a/src/widgets/qradiobutton.cpp +++ b/src/widgets/qradiobutton.cpp @@ -38,20 +38,20 @@ ** **********************************************************************/ -#include "qradiobutton.h" +#include "ntqradiobutton.h" #ifndef QT_NO_RADIOBUTTON -#include "qbuttongroup.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qpixmap.h" -#include "qpixmapcache.h" -#include "qbitmap.h" -#include "qtextstream.h" -#include "qapplication.h" -#include "qstyle.h" +#include "ntqbuttongroup.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqpixmap.h" +#include "ntqpixmapcache.h" +#include "ntqbitmap.h" +#include "ntqtextstream.h" +#include "ntqapplication.h" +#include "ntqstyle.h" /*! - \class TQRadioButton qradiobutton.h + \class TQRadioButton ntqradiobutton.h \brief The TQRadioButton widget provides a radio button with a text or pixmap label. \ingroup basic diff --git a/src/widgets/qradiobutton.h b/src/widgets/qradiobutton.h deleted file mode 100644 index 6c9546314..000000000 --- a/src/widgets/qradiobutton.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Definition of TQRadioButton class -** -** Created : 940222 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQRADIOBUTTON_H -#define TQRADIOBUTTON_H - -#ifndef QT_H -#include "qbutton.h" -#endif // QT_H - -#ifndef QT_NO_RADIOBUTTON - -class Q_EXPORT TQRadioButton : public TQButton -{ - Q_OBJECT - Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) - Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) - -public: - TQRadioButton( TQWidget *parent, const char* name=0 ); - TQRadioButton( const TQString &text, TQWidget *parent, const char* name=0 ); - - bool isChecked() const; - - TQSize sizeHint() const; - -public slots: - virtual void setChecked( bool check ); - -protected: - bool hitButton( const TQPoint & ) const; - void drawButton( TQPainter * ); - void drawButtonLabel( TQPainter * ); - void updateMask(); - - void resizeEvent( TQResizeEvent* ); - -private: - void init(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQRadioButton( const TQRadioButton & ); - TQRadioButton &operator=( const TQRadioButton & ); -#endif -}; - - -inline bool TQRadioButton::isChecked() const -{ return isOn(); } - -#endif // QT_NO_RADIOBUTTON - -#endif // TQRADIOBUTTON_H diff --git a/src/widgets/qrangecontrol.cpp b/src/widgets/qrangecontrol.cpp index a561b3d77..036f8c7b6 100644 --- a/src/widgets/qrangecontrol.cpp +++ b/src/widgets/qrangecontrol.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qrangecontrol.h" +#include "ntqrangecontrol.h" #ifndef QT_NO_RANGECONTROL -#include "qglobal.h" +#include "ntqglobal.h" #include static bool sumOutOfRange(int current, int add); /*! - \class TQRangeControl qrangecontrol.h + \class TQRangeControl ntqrangecontrol.h \brief The TQRangeControl class provides an integer value within a range. \ingroup misc diff --git a/src/widgets/qrangecontrol.h b/src/widgets/qrangecontrol.h deleted file mode 100644 index f438ca7aa..000000000 --- a/src/widgets/qrangecontrol.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -** -** Definition of TQRangeControl class -** -** Created : 940427 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQRANGECONTROL_H -#define TQRANGECONTROL_H - -#ifndef QT_H -#include "qglobal.h" -#include "qframe.h" -#endif // QT_H - -#ifndef QT_NO_RANGECONTROL - - -class TQRangeControlPrivate; - - -class Q_EXPORT TQRangeControl -{ -public: - TQRangeControl(); - TQRangeControl( int minValue, int maxValue, - int lineStep, int pageStep, int value ); - virtual ~TQRangeControl(); - int value() const; - void setValue( int ); - void addPage(); - void subtractPage(); - void addLine(); - void subtractLine(); - - int minValue() const; - int maxValue() const; - void setRange( int minValue, int maxValue ); - void setMinValue( int minVal ); - void setMaxValue( int minVal ); - - int lineStep() const; - int pageStep() const; - void setSteps( int line, int page ); - - int bound( int ) const; - -protected: - int positionFromValue( int val, int space ) const; - int valueFromPosition( int pos, int space ) const; - void directSetValue( int val ); - int prevValue() const; - - virtual void valueChange(); - virtual void rangeChange(); - virtual void stepChange(); - -private: - int minVal, maxVal; - int line, page; - int val, prevVal; - - TQRangeControlPrivate * d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQRangeControl( const TQRangeControl & ); - TQRangeControl &operator=( const TQRangeControl & ); -#endif -}; - - -inline int TQRangeControl::value() const -{ return val; } - -inline int TQRangeControl::prevValue() const -{ return prevVal; } - -inline int TQRangeControl::minValue() const -{ return minVal; } - -inline int TQRangeControl::maxValue() const -{ return maxVal; } - -inline int TQRangeControl::lineStep() const -{ return line; } - -inline int TQRangeControl::pageStep() const -{ return page; } - - -#endif // QT_NO_RANGECONTROL - -#ifndef QT_NO_SPINWIDGET - -class TQSpinWidgetPrivate; -class Q_EXPORT TQSpinWidget : public TQWidget -{ - Q_OBJECT -public: - TQSpinWidget( TQWidget* parent=0, const char* name=0 ); - ~TQSpinWidget(); - - void setEditWidget( TQWidget * widget ); - TQWidget * editWidget(); - - TQRect upRect() const; - TQRect downRect() const; - - void setUpEnabled( bool on ); - void setDownEnabled( bool on ); - - bool isUpEnabled() const; - bool isDownEnabled() const; - - enum ButtonSymbols { UpDownArrows, PlusMinus }; - virtual void setButtonSymbols( ButtonSymbols bs ); - ButtonSymbols buttonSymbols() const; - - void arrange(); - -signals: - void stepUpPressed(); - void stepDownPressed(); - -public slots: - void stepUp(); - void stepDown(); - -protected: - void mousePressEvent( TQMouseEvent *e ); - void resizeEvent( TQResizeEvent* ev ); - void mouseReleaseEvent( TQMouseEvent *e ); - void mouseMoveEvent( TQMouseEvent *e ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent * ); -#endif - void styleChange( TQStyle& ); - void paintEvent( TQPaintEvent * ); - void enableChanged( bool old ); - void windowActivationChange( bool ); - -private slots: - void timerDone(); - void timerDoneEx(); - -private: - TQSpinWidgetPrivate * d; - - void updateDisplay(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSpinWidget( const TQSpinWidget& ); - TQSpinWidget& operator=( const TQSpinWidget& ); -#endif -}; - -#endif // QT_NO_SPINWIDGET - -#endif // TQRANGECONTROL_H diff --git a/src/widgets/qscrollbar.cpp b/src/widgets/qscrollbar.cpp index e73dc2ed5..cd5b73f29 100644 --- a/src/widgets/qscrollbar.cpp +++ b/src/widgets/qscrollbar.cpp @@ -38,18 +38,18 @@ ** **********************************************************************/ -#include "qscrollbar.h" +#include "ntqscrollbar.h" #ifndef QT_NO_SCROLLBAR -#include "qpainter.h" -#include "qbitmap.h" -#include "qapplication.h" -#include "qtimer.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqbitmap.h" +#include "ntqapplication.h" +#include "ntqtimer.h" +#include "ntqstyle.h" #ifndef QT_NO_CURSOR -#include +#include #endif #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #include diff --git a/src/widgets/qscrollbar.h b/src/widgets/qscrollbar.h deleted file mode 100644 index c3552cf41..000000000 --- a/src/widgets/qscrollbar.h +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Definition of TQScrollBar class -** -** Created : 940427 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSCROLLBAR_H -#define TQSCROLLBAR_H - -class TQTimer; - -#ifndef QT_H -#include "qwidget.h" -#include "qrangecontrol.h" -#endif // QT_H - -#ifndef QT_NO_SCROLLBAR - -class Q_EXPORT TQScrollBar : public TQWidget, public TQRangeControl -{ - Q_OBJECT - Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) - Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) - Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) - Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep ) - Q_PROPERTY( int value READ value WRITE setValue ) - Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) - Q_PROPERTY( bool draggingSlider READ draggingSlider ) - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) - -public: - TQScrollBar( TQWidget *parent, const char* name = 0 ); - TQScrollBar( Orientation, TQWidget *parent, const char* name = 0 ); - TQScrollBar( int minValue, int maxValue, int lineStep, int pageStep, - int value, Orientation, TQWidget *parent, const char* name = 0 ); - ~TQScrollBar(); - - virtual void setOrientation( Orientation ); - Orientation orientation() const; - virtual void setTracking( bool enable ); - bool tracking() const; - bool draggingSlider() const; - - virtual void setPalette( const TQPalette & ); - virtual TQSize sizeHint() const; - virtual void setSizePolicy( TQSizePolicy sp ); - void setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw = FALSE ); - - 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 value ); - void sliderPressed(); - void sliderMoved( int value ); - void sliderReleased(); - void nextLine(); - void prevLine(); - void nextPage(); - void prevPage(); - -protected: -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent * ); -#endif - 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 slots: - void doAutoRepeat(); - -private: - void init(); - void positionSliderFromValue(); - int calculateValueFromSlider() const; - - void startAutoRepeat(); - void stopAutoRepeat(); - - int rangeValueToSliderPos( int val ) const; - int sliderPosToRangeValue( int val ) const; - - void action( int control ); - - void drawControls( uint controls, uint activeControl ) const; - void drawControls( uint controls, uint activeControl, - TQPainter *p ) const; - - uint pressedControl; - bool track; - bool clickedAt; - Orientation orient; - - int slidePrevVal; - TQCOORD sliderPos; - TQCOORD clickOffset; - - TQTimer * repeater; - void * d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQScrollBar( const TQScrollBar & ); - TQScrollBar &operator=( const TQScrollBar & ); -#endif -}; - - -inline void TQScrollBar::setTracking( bool t ) -{ - track = t; -} - -inline bool TQScrollBar::tracking() const -{ - return track; -} - -inline TQScrollBar::Orientation TQScrollBar::orientation() const -{ - return orient; -} - -inline int TQScrollBar::sliderStart() const -{ - return sliderPos; -} - -inline void TQScrollBar::setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw ) -{ - TQWidget::setSizePolicy( hor, ver, hfw ); -} - - -#endif // QT_NO_SCROLLBAR - -#endif // TQSCROLLBAR_H diff --git a/src/widgets/qscrollview.cpp b/src/widgets/qscrollview.cpp index 03cf1ae17..484e67da4 100644 --- a/src/widgets/qscrollview.cpp +++ b/src/widgets/qscrollview.cpp @@ -38,20 +38,20 @@ ** **********************************************************************/ -#include "qwidget.h" +#include "ntqwidget.h" #ifndef QT_NO_SCROLLVIEW -#include "qscrollbar.h" -#include "qobjectlist.h" -#include "qpainter.h" -#include "qpixmap.h" -#include "qcursor.h" -#include "qfocusdata.h" -#include "qscrollview.h" -#include "qptrdict.h" -#include "qapplication.h" -#include "qtimer.h" -#include "qstyle.h" -#include "qlistview.h" +#include "ntqscrollbar.h" +#include "ntqobjectlist.h" +#include "ntqpainter.h" +#include "ntqpixmap.h" +#include "ntqcursor.h" +#include "ntqfocusdata.h" +#include "ntqscrollview.h" +#include "ntqptrdict.h" +#include "ntqapplication.h" +#include "ntqtimer.h" +#include "ntqstyle.h" +#include "ntqlistview.h" #ifdef Q_WS_MAC # include "qt_mac.h" #endif @@ -348,7 +348,7 @@ void TQScrollViewData::viewportResized( int w, int h ) /*! - \class TQScrollView qscrollview.h + \class TQScrollView ntqscrollview.h \brief The TQScrollView widget provides a scrolling area with on-demand scroll bars. \ingroup abstractwidgets diff --git a/src/widgets/qscrollview.h b/src/widgets/qscrollview.h deleted file mode 100644 index a935f8e3c..000000000 --- a/src/widgets/qscrollview.h +++ /dev/null @@ -1,269 +0,0 @@ -/**************************************************************************** -** -** Definition of TQScrollView class -** -** Created : 970523 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ -#ifndef TQSCROLLVIEW_H -#define TQSCROLLVIEW_H - -#ifndef QT_H -#include "qframe.h" -#include "qscrollbar.h" -#endif // QT_H - -#ifndef QT_NO_SCROLLVIEW - -class TQScrollViewData; - -class Q_EXPORT TQScrollView : public TQFrame -{ - Q_OBJECT - Q_ENUMS( ResizePolicy ScrollBarMode ) - Q_PROPERTY( ResizePolicy resizePolicy READ resizePolicy WRITE setResizePolicy ) - Q_PROPERTY( ScrollBarMode vScrollBarMode READ vScrollBarMode WRITE setVScrollBarMode ) - Q_PROPERTY( ScrollBarMode hScrollBarMode READ hScrollBarMode WRITE setHScrollBarMode ) - Q_PROPERTY( int visibleWidth READ visibleWidth ) - Q_PROPERTY( int visibleHeight READ visibleHeight ) - Q_PROPERTY( int contentsWidth READ contentsWidth ) - Q_PROPERTY( int contentsHeight READ contentsHeight ) - Q_PROPERTY( int contentsX READ contentsX ) - Q_PROPERTY( int contentsY READ contentsY ) -#ifndef QT_NO_DRAGANDDROP - Q_PROPERTY( bool dragAutoScroll READ dragAutoScroll WRITE setDragAutoScroll ) -#endif - -public: - TQScrollView(TQWidget* parent=0, const char* name=0, WFlags f=0); - ~TQScrollView(); - - enum ResizePolicy { Default, Manual, AutoOne, AutoOneFit }; - virtual void setResizePolicy( ResizePolicy ); - ResizePolicy resizePolicy() const; - - void styleChange( TQStyle & ); - void removeChild(TQWidget* child); - virtual void addChild( TQWidget* child, int x=0, int y=0 ); - virtual void moveChild( TQWidget* child, int x, int y ); - int childX(TQWidget* child); - int childY(TQWidget* child); - bool childIsVisible(TQWidget* child) { return child->isVisible(); } // obsolete functions - void showChild(TQWidget* child, bool yes=TRUE) { - if ( yes ) - child->show(); - else - child->hide(); - } - - 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*); - - // ### 4.0: Consider providing a factory function for scrollbars - // (e.g. make the two following functions virtual) - 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 w, int h ); - void resize( const TQSize& ); - void show(); - - void updateContents( int x, int y, int w, int h ); - void updateContents( const TQRect& r ); - void updateContents(); - void repaintContents( int x, int y, int w, int h, bool erase=TRUE ); - void repaintContents( const TQRect& r, bool erase=TRUE ); - void repaintContents( bool erase=TRUE ); - void contentsToViewport( int x, int y, int& vx, int& vy ) const; - void viewportToContents( int vx, int vy, int& x, int& y ) const; - TQPoint contentsToViewport( const TQPoint& ) const; - TQPoint viewportToContents( const TQPoint& ) const; - void enableClipper( bool y ); - - void setStaticBackground( bool y ); - bool hasStaticBackground() const; - - TQSize viewportSize( int, int ) const; - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - - void removeChild(TQObject* child); - - bool isHorizontalSliderPressed(); - bool isVerticalSliderPressed(); - -#ifndef QT_NO_DRAGANDDROP - virtual void setDragAutoScroll( bool b ); - bool dragAutoScroll() const; -#endif - -signals: - void contentsMoving(int x, int y); - void horizontalSliderPressed(); - void horizontalSliderReleased(); - void verticalSliderPressed(); - void verticalSliderReleased(); - -public slots: - virtual void resizeContents( int w, int h ); - void scrollBy( int dx, int dy ); - virtual void setContentsPos( int x, int y ); - void ensureVisible(int x, int y); - void ensureVisible(int x, int y, int xmargin, int ymargin); - void center(int x, int y); - void center(int x, int y, float xmargin, float ymargin); - - void updateScrollBars(); // ### virtual in 4.0 - void setEnabled( bool enable ); - -protected: - virtual void drawContents(TQPainter*, int cx, int cy, int cw, int ch); - virtual void drawContentsOffset(TQPainter*, int ox, int oy, - int cx, int cy, int cw, int ch); - - - virtual void contentsMousePressEvent( TQMouseEvent* ); - virtual void contentsMouseReleaseEvent( TQMouseEvent* ); - virtual void contentsMouseDoubleClickEvent( TQMouseEvent* ); - virtual void contentsMouseMoveEvent( TQMouseEvent* ); -#ifndef QT_NO_DRAGANDDROP - virtual void contentsDragEnterEvent( TQDragEnterEvent * ); - virtual void contentsDragMoveEvent( TQDragMoveEvent * ); - virtual void contentsDragLeaveEvent( TQDragLeaveEvent * ); - virtual void contentsDropEvent( TQDropEvent * ); -#endif -#ifndef QT_NO_WHEELEVENT - virtual void contentsWheelEvent( TQWheelEvent * ); -#endif - 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* ); -#ifndef QT_NO_DRAGANDDROP - virtual void viewportDragEnterEvent( TQDragEnterEvent * ); - virtual void viewportDragMoveEvent( TQDragMoveEvent * ); - virtual void viewportDragLeaveEvent( TQDragLeaveEvent * ); - virtual void viewportDropEvent( TQDropEvent * ); -#endif -#ifndef QT_NO_WHEELEVENT - virtual void viewportWheelEvent( TQWheelEvent * ); -#endif - virtual void viewportContextMenuEvent( TQContextMenuEvent * ); - - void frameChanged(); - - virtual void setMargins(int left, int top, int right, int bottom); - int leftMargin() const; - int topMargin() const; - int rightMargin() const; - int bottomMargin() const; - - bool focusNextPrevChild( bool next ); - - virtual void setHBarGeometry(TQScrollBar& hbar, int x, int y, int w, int h); - virtual void setVBarGeometry(TQScrollBar& vbar, int x, int y, int w, int h); - - void resizeEvent(TQResizeEvent*); - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - void mouseDoubleClickEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent * ); -#endif - void contextMenuEvent( TQContextMenuEvent * ); - bool eventFilter( TQObject *, TQEvent *e ); - - void setCachedSizeHint( const TQSize &sh ) const; - TQSize cachedSizeHint() const; - void fontChange( const TQFont & ); - -private: - void drawContents( TQPainter* ); - void moveContents(int x, int y); - - TQScrollViewData* d; - -private slots: - void hslide(int); - void vslide(int); - void hbarIsPressed(); - void hbarIsReleased(); - void vbarIsPressed(); - void vbarIsReleased(); -#ifndef QT_NO_DRAGANDDROP - void doDragAutoScroll(); - void startDragAutoScroll(); - void stopDragAutoScroll(); -#endif - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQScrollView( const TQScrollView & ); - TQScrollView &operator=( const TQScrollView & ); -#endif - void changeFrameRect(const TQRect&); - -public: - void disableSizeHintCaching(); - -}; - -#endif // QT_NO_SCROLLVIEW - -#endif // TQSCROLLVIEW_H diff --git a/src/widgets/qslider.cpp b/src/widgets/qslider.cpp index 6c1349b71..e6b555a18 100644 --- a/src/widgets/qslider.cpp +++ b/src/widgets/qslider.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qslider.h" +#include "ntqslider.h" #ifndef QT_NO_SLIDER -#include "qpainter.h" -#include "qdrawutil.h" -#include "qtimer.h" -#include "qbitmap.h" -#include "qapplication.h" -#include "qstyle.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqtimer.h" +#include "ntqbitmap.h" +#include "ntqapplication.h" +#include "ntqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif static const int thresholdTime = 300; diff --git a/src/widgets/qslider.h b/src/widgets/qslider.h deleted file mode 100644 index 4d80b4fab..000000000 --- a/src/widgets/qslider.h +++ /dev/null @@ -1,199 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSlider class -** -** Created : 961019 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSLIDER_H -#define TQSLIDER_H - -#ifndef QT_H -#include "qwidget.h" -#include "qrangecontrol.h" -#endif // QT_H - -#ifndef QT_NO_SLIDER - -struct TQSliderPrivate; - -class TQTimer; - -class Q_EXPORT TQSlider : public TQWidget, public TQRangeControl -{ - Q_OBJECT - Q_ENUMS( TickSetting ) - Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) - Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) - Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) - Q_PROPERTY( int pageStep READ pageStep WRITE setPageStep ) - Q_PROPERTY( int value READ value WRITE setValue ) - Q_PROPERTY( bool tracking READ tracking WRITE setTracking ) - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) - Q_PROPERTY( TickSetting tickmarks READ tickmarks WRITE setTickmarks ) - Q_PROPERTY( int tickInterval READ tickInterval WRITE setTickInterval ) - -public: - enum TickSetting { NoMarks = 0, Above = 1, Left = Above, - Below = 2, Right = Below, Both = 3 }; - - TQSlider( TQWidget *parent, const char* name = 0 ); - TQSlider( Orientation, TQWidget *parent, const char* name = 0 ); - TQSlider( int minValue, int maxValue, int pageStep, int value, Orientation, - TQWidget *parent, const char* name = 0 ); - ~TQSlider(); - - virtual void setOrientation( Orientation ); - Orientation orientation() const; - virtual void setTracking( bool enable ); - bool tracking() const; - virtual void setPalette( const TQPalette & ); - - int sliderStart() const; - TQRect sliderRect() const; - TQSize sizeHint() const; - void setSizePolicy( TQSizePolicy sp ); - void setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw = FALSE ); - - TQSizePolicy sizePolicy() const; - TQSize minimumSizeHint() const; - - virtual void setTickmarks( TickSetting ); - TickSetting tickmarks() const { return ticks; } - - virtual void setTickInterval( int ); - int tickInterval() const { return tickInt; } - - 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 value ); - void sliderPressed(); - void sliderMoved( int value ); - void sliderReleased(); - -protected: - void resizeEvent( TQResizeEvent * ); - void paintEvent( TQPaintEvent * ); - - void keyPressEvent( TQKeyEvent * ); - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - void mouseMoveEvent( TQMouseEvent * ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent * ); -#endif - void focusInEvent( TQFocusEvent *e ); - void focusOutEvent( TQFocusEvent *e ); - - void styleChange( TQStyle& ); - - void valueChange(); - void rangeChange(); - -private slots: - void repeatTimeout(); - -private: - enum State { Idle, Dragging, TimingUp, TimingDown }; - - void init(); - int positionFromValue( int ) const; - int valueFromPosition( int ) const; - void moveSlider( int ); - void reallyMoveSlider( int ); - void resetState(); - int available() const; - int goodPart( const TQPoint& ) const; - void initTicks(); - - TQSliderPrivate *d; - TQTimer *timer; - TQCOORD sliderPos; - int sliderVal; - TQCOORD clickOffset; - State state; - bool track; - TQCOORD tickOffset; - TickSetting ticks; - int tickInt; - Orientation orient; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSlider( const TQSlider & ); - TQSlider &operator=( const TQSlider & ); -#endif -}; - -inline bool TQSlider::tracking() const -{ - return track; -} - -inline TQSlider::Orientation TQSlider::orientation() const -{ - return orient; -} - -inline int TQSlider::sliderStart() const -{ - return sliderPos; -} - -inline void TQSlider::setSizePolicy( TQSizePolicy::SizeType hor, TQSizePolicy::SizeType ver, bool hfw ) -{ - TQWidget::setSizePolicy( hor, ver, hfw ); -} - -#endif // QT_NO_SLIDER - -#endif // TQSLIDER_H diff --git a/src/widgets/qspinbox.cpp b/src/widgets/qspinbox.cpp index f92b3ac49..c4419cee2 100644 --- a/src/widgets/qspinbox.cpp +++ b/src/widgets/qspinbox.cpp @@ -38,20 +38,20 @@ ** **********************************************************************/ -#include "qspinbox.h" +#include "ntqspinbox.h" #ifndef QT_NO_SPINBOX -#include "qcursor.h" -#include "qpushbutton.h" -#include "qpainter.h" -#include "qbitmap.h" -#include "qlineedit.h" -#include "qvalidator.h" -#include "qpixmapcache.h" -#include "qapplication.h" -#include "qstyle.h" +#include "ntqcursor.h" +#include "ntqpushbutton.h" +#include "ntqpainter.h" +#include "ntqbitmap.h" +#include "ntqlineedit.h" +#include "ntqvalidator.h" +#include "ntqpixmapcache.h" +#include "ntqapplication.h" +#include "ntqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif static bool sumOutOfRange(int current, int add) diff --git a/src/widgets/qspinbox.h b/src/widgets/qspinbox.h deleted file mode 100644 index 8bb8dc9aa..000000000 --- a/src/widgets/qspinbox.h +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSpinBox widget class -** -** Created : 970101 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSPINBOX_H -#define TQSPINBOX_H - -#ifndef QT_H -#include "qwidget.h" -#include "qrangecontrol.h" -#endif // QT_H - -#ifndef QT_NO_SPINBOX - -class TQLineEdit; -class TQValidator; -class TQSpinBoxPrivate; - -class Q_EXPORT TQSpinBox: public TQWidget, public TQRangeControl -{ - Q_OBJECT - Q_ENUMS( ButtonSymbols ) - Q_PROPERTY( TQString text READ text ) - Q_PROPERTY( TQString prefix READ prefix WRITE setPrefix ) - Q_PROPERTY( TQString suffix READ suffix WRITE setSuffix ) - Q_PROPERTY( TQString cleanText READ cleanText ) - Q_PROPERTY( TQString specialValueText READ specialValueText WRITE setSpecialValueText ) - Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping ) - Q_PROPERTY( ButtonSymbols buttonSymbols READ buttonSymbols WRITE setButtonSymbols ) - Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue ) - Q_PROPERTY( int minValue READ minValue WRITE setMinValue ) - Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep ) - Q_PROPERTY( int value READ value WRITE setValue ) - -public: - TQSpinBox( TQWidget* parent=0, const char* name=0 ); - TQSpinBox( int minValue, int maxValue, int step = 1, - TQWidget* parent=0, const char* name=0 ); - ~TQSpinBox(); - - TQString text() const; - - virtual TQString prefix() const; - virtual TQString suffix() const; - virtual TQString cleanText() const; - - virtual void setSpecialValueText( const TQString &text ); - TQString specialValueText() const; - - virtual void setWrapping( bool on ); - bool wrapping() const; - - enum ButtonSymbols { UpDownArrows, PlusMinus }; - virtual void setButtonSymbols( ButtonSymbols ); - ButtonSymbols buttonSymbols() const; - - virtual void setValidator( const TQValidator* v ); - 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 value ); - virtual void setPrefix( const TQString &text ); - virtual void setSuffix( const TQString &text ); - virtual void stepUp(); - virtual void stepDown(); - virtual void setEnabled( bool enabled ); - virtual void selectAll(); - -signals: - void valueChanged( int value ); - void valueChanged( const TQString &valueText ); - -protected: - virtual TQString mapValueToText( int value ); - virtual int mapTextToValue( bool* ok ); - TQString currentValueText(); - - virtual void updateDisplay(); - virtual void interpretText(); - - TQLineEdit* editor() const; - - virtual void valueChange(); - virtual void rangeChange(); - - bool eventFilter( TQObject* obj, TQEvent* ev ); - void resizeEvent( TQResizeEvent* ev ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent * ); -#endif - void leaveEvent( TQEvent* ); - - void styleChange( TQStyle& ); - -protected slots: - void textChanged(); - -private: - void initSpinBox(); - TQSpinBoxPrivate* d; - TQLineEdit* vi; - TQValidator* validate; - TQString pfix; - TQString sfix; - TQString specText; - - uint wrap : 1; - uint edited : 1; - - void arrangeWidgets(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQSpinBox( const TQSpinBox& ); - TQSpinBox& operator=( const TQSpinBox& ); -#endif - -}; - -#endif // QT_NO_SPINBOX - -#endif // TQSPINBOX_H diff --git a/src/widgets/qspinwidget.cpp b/src/widgets/qspinwidget.cpp index 080f2ee34..f0b6b7809 100644 --- a/src/widgets/qspinwidget.cpp +++ b/src/widgets/qspinwidget.cpp @@ -36,14 +36,14 @@ ** **********************************************************************/ -#include "qrangecontrol.h" +#include "ntqrangecontrol.h" #ifndef QT_NO_SPINWIDGET -#include "qrect.h" -#include "qtimer.h" -#include "qstyle.h" -#include "qpainter.h" +#include "ntqrect.h" +#include "ntqtimer.h" +#include "ntqstyle.h" +#include "ntqpainter.h" class TQSpinWidgetPrivate { diff --git a/src/widgets/qsplashscreen.cpp b/src/widgets/qsplashscreen.cpp index fe18ebe27..6be1506be 100644 --- a/src/widgets/qsplashscreen.cpp +++ b/src/widgets/qsplashscreen.cpp @@ -36,13 +36,13 @@ ** **********************************************************************/ -#include "qsplashscreen.h" +#include "ntqsplashscreen.h" #ifndef QT_NO_SPLASHSCREEN -#include "qapplication.h" -#include "qpainter.h" -#include "qpixmap.h" +#include "ntqapplication.h" +#include "ntqpainter.h" +#include "ntqpixmap.h" class TQSplashScreenPrivate { @@ -54,7 +54,7 @@ public: }; /*! - \class TQSplashScreen qsplashscreen.h + \class TQSplashScreen ntqsplashscreen.h \brief The TQSplashScreen widget provides a splash screen that can be shown during application startup. diff --git a/src/widgets/qsplashscreen.h b/src/widgets/qsplashscreen.h deleted file mode 100644 index 9c4660e20..000000000 --- a/src/widgets/qsplashscreen.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSplashScreen class -** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSPLASHSCREEN_H -#define TQSPLASHSCREEN_H - -#ifndef QT_H -#include "qpixmap.h" -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_SPLASHSCREEN -class TQSplashScreenPrivate; - -class Q_EXPORT TQSplashScreen : public TQWidget -{ - Q_OBJECT -public: - TQSplashScreen( const TQPixmap &pixmap = TQPixmap(), WFlags f = 0 ); - virtual ~TQSplashScreen(); - - void setPixmap( const TQPixmap &pixmap ); - TQPixmap* pixmap() const; - void finish( TQWidget *w ); - void repaint(); - -public slots: - void message( const TQString &str, int flags = AlignLeft, - const TQColor &color = black ); - void clear(); - -signals: - void messageChanged( const TQString &str ); - -protected: - virtual void drawContents( TQPainter *painter ); - void mousePressEvent( TQMouseEvent * ); - -private: - void drawContents(); - - TQSplashScreenPrivate *d; -}; -#endif //QT_NO_SPLASHSCREEN -#endif diff --git a/src/widgets/qsplitter.cpp b/src/widgets/qsplitter.cpp index 7dd3f75e9..95ec5d5ae 100644 --- a/src/widgets/qsplitter.cpp +++ b/src/widgets/qsplitter.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qsplitter.h" +#include "ntqsplitter.h" #ifndef QT_NO_SPLITTER -#include "qlayout.h" +#include "ntqlayout.h" #include "../kernel/qlayoutengine_p.h" -#include "qapplication.h" -#include "qbitmap.h" -#include "qdrawutil.h" -#include "qmemarray.h" -#include "qobjectlist.h" -#include "qpainter.h" -#include "qptrlist.h" -#include "qstyle.h" +#include "ntqapplication.h" +#include "ntqbitmap.h" +#include "ntqdrawutil.h" +#include "ntqmemarray.h" +#include "ntqobjectlist.h" +#include "ntqpainter.h" +#include "ntqptrlist.h" +#include "ntqstyle.h" const uint Default = QT_QSPLITTER_DEFAULT; diff --git a/src/widgets/qsplitter.h b/src/widgets/qsplitter.h deleted file mode 100644 index d614bbbec..000000000 --- a/src/widgets/qsplitter.h +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************** -** -** Definition of TQSplitter class -** -** Created : 980105 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSPLITTER_H -#define TQSPLITTER_H - -#ifndef QT_H -#include "qframe.h" -#include "qvaluelist.h" -#endif // QT_H - -#ifndef QT_NO_SPLITTER - -#define QT_QSPLITTER_DEFAULT 2 - -class TQSplitterHandle; -class TQSplitterPrivate; -class TQSplitterLayoutStruct; -class TQTextStream; - -class TQSplitterPrivate -{ -public: - TQSplitterPrivate() - : opaque( FALSE ), firstShow( TRUE ), childrenCollapsible( TRUE ), - handleWidth( 0 ) { } - - TQPtrList list; - bool opaque; - bool firstShow; - bool childrenCollapsible; - int handleWidth; -}; - -class TQSplitterLayoutStruct : public TQt -{ -public: - TQCOORD sizer; - uint isHandle; - uint collapsible; - uint resizeMode; - TQWidget *wid; - - TQSplitterLayoutStruct() - : sizer( -1 ), collapsible( QT_QSPLITTER_DEFAULT ) { } - TQCOORD getSizer( Orientation orient ); -}; - -class Q_EXPORT TQSplitter : public TQFrame -{ - Q_OBJECT - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) - Q_PROPERTY( bool opaqueResize READ opaqueResize WRITE setOpaqueResize ) - Q_PROPERTY( int handleWidth READ handleWidth WRITE setHandleWidth ) - Q_PROPERTY( bool childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible ) - -public: - // ### TQt 4.0: remove Auto from public API - enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }; - - TQSplitter( TQWidget* parent = 0, const char* name = 0 ); - TQSplitter( Orientation, TQWidget* parent = 0, const char* name = 0 ); - ~TQSplitter(); - - virtual void setOrientation( Orientation ); - Orientation orientation() const { return orient; } - - // ### TQt 4.0: make setChildrenCollapsible() and setCollapsible() virtual - - void setChildrenCollapsible( bool ); - bool childrenCollapsible() const; - - void setCollapsible( TQWidget *w, bool ); - virtual void setResizeMode( TQWidget *w, ResizeMode ); - virtual void setOpaqueResize( bool = TRUE ); - bool opaqueResize() const; - - void moveToFirst( TQWidget * ); - void moveToLast( TQWidget * ); - - void refresh() { recalc( TRUE ); } - 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 pos, int id ); - virtual void drawSplitter( TQPainter*, TQCOORD x, TQCOORD y, - TQCOORD w, TQCOORD h ); - void styleChange( TQStyle& ); - int adjustPos( int, int ); - virtual void setRubberband( int ); - void getRange( int id, int *, int * ); - -public: //private: - enum { DefaultResizeMode = 3 }; - - void init(); - void recalc( bool update = FALSE ); - void doResize(); - void storeSizes(); - void getRange( int id, int *, int *, int *, int * ); - void addContribution( int, int *, int *, bool ); - int adjustPos( int, int, int *, int *, int *, int * ); - bool collapsible( TQSplitterLayoutStruct * ); - void processChildEvents(); - TQSplitterLayoutStruct *findWidget( TQWidget * ); - TQSplitterLayoutStruct *addWidget( TQWidget *, bool prepend = FALSE ); - void recalcId(); - void doMove( bool backwards, int pos, int id, int delta, bool upLeft, - bool mayCollapse ); - void setGeo( TQWidget *w, int pos, int size, bool splitterMoved ); - int findWidgetJustBeforeOrJustAfter( int id, int delta, int &collapsibleSize ); - void updateHandles(); - - inline TQCOORD pick( const TQPoint &p ) const - { return orient == Horizontal ? p.x() : p.y(); } - inline TQCOORD pick( const TQSize &s ) const - { return orient == Horizontal ? s.width() : s.height(); } - - inline TQCOORD trans( const TQPoint &p ) const - { return orient == Vertical ? p.x() : p.y(); } - inline TQCOORD trans( const TQSize &s ) const - { return orient == Vertical ? s.width() : s.height(); } - - TQSplitterPrivate *d; - - Orientation orient; - friend class TQSplitterHandle; - friend class TQTextStream; - -private: -#if defined(Q_DISABLE_COPY) - TQSplitter( const TQSplitter & ); - TQSplitter& operator=( const TQSplitter & ); -#endif -}; - -#ifndef QT_NO_TEXTSTREAM -Q_EXPORT TQTextStream& operator<<( TQTextStream&, const TQSplitter& ); -Q_EXPORT TQTextStream& operator>>( TQTextStream&, TQSplitter& ); -#endif - -class TQSplitterHandle : public TQWidget -{ - Q_OBJECT -public: - TQSplitterHandle( Orientation o, - TQSplitter *parent, const char* name=0 ); - void setOrientation( Orientation o ); - Orientation orientation() const { return orient; } - - bool opaque() const { return s->opaqueResize(); } - - TQSize sizeHint() const; - - int id() const { return myId; } // d->list.at(id())->wid == this - void setId( int i ) { myId = i; } - -protected: - void paintEvent( TQPaintEvent * ); - void mouseMoveEvent( TQMouseEvent * ); - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - -public: // private: - Orientation orient; - bool opaq; - int myId; - - TQSplitter *s; -}; - -#endif // QT_NO_SPLITTER - -#endif // TQSPLITTER_H diff --git a/src/widgets/qstatusbar.cpp b/src/widgets/qstatusbar.cpp index c2c8a1570..ea4172e29 100644 --- a/src/widgets/qstatusbar.cpp +++ b/src/widgets/qstatusbar.cpp @@ -38,19 +38,19 @@ ** **********************************************************************/ -#include "qstatusbar.h" +#include "ntqstatusbar.h" #ifndef QT_NO_STATUSBAR -#include "qptrlist.h" -#include "qlayout.h" -#include "qpainter.h" -#include "qtimer.h" -#include "qdrawutil.h" -#include "qstyle.h" -#include "qsizegrip.h" +#include "ntqptrlist.h" +#include "ntqlayout.h" +#include "ntqpainter.h" +#include "ntqtimer.h" +#include "ntqdrawutil.h" +#include "ntqstyle.h" +#include "ntqsizegrip.h" /*! - \class TQStatusBar qstatusbar.h + \class TQStatusBar ntqstatusbar.h \brief The TQStatusBar class provides a horizontal bar suitable for presenting status information. diff --git a/src/widgets/qstatusbar.h b/src/widgets/qstatusbar.h deleted file mode 100644 index 9591892f0..000000000 --- a/src/widgets/qstatusbar.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Definition of TQStatusBar class -** -** Created : 980316 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSTATUSBAR_H -#define TQSTATUSBAR_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_STATUSBAR - - -class TQStatusBarPrivate; - - -class Q_EXPORT TQStatusBar: public TQWidget -{ - Q_OBJECT - Q_PROPERTY( bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled ) - -public: - TQStatusBar( TQWidget* parent=0, const char* name=0 ); - virtual ~TQStatusBar(); - - virtual void addWidget( TQWidget *, int stretch = 0, bool = FALSE ); - virtual void removeWidget( TQWidget * ); - - void setSizeGripEnabled(bool); - bool isSizeGripEnabled() const; - -public slots: - void message( const TQString &); - void message( const TQString &, int ); - void clear(); - -signals: - void messageChanged( const TQString &text ); - -protected: - void paintEvent( TQPaintEvent * ); - void resizeEvent( TQResizeEvent * ); - - void reformat(); - void hideOrShow(); - bool event( TQEvent *); - -private: - TQStatusBarPrivate * d; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQStatusBar( const TQStatusBar & ); - TQStatusBar& operator=( const TQStatusBar & ); -#endif -}; - -#endif // QT_NO_STATUSBAR - -#endif // TQSTATUSBAR_H diff --git a/src/widgets/qsyntaxhighlighter.cpp b/src/widgets/qsyntaxhighlighter.cpp index bf8938bbc..6c97ac517 100644 --- a/src/widgets/qsyntaxhighlighter.cpp +++ b/src/widgets/qsyntaxhighlighter.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qsyntaxhighlighter.h" +#include "ntqsyntaxhighlighter.h" #include "private/qsyntaxhighlighter_p.h" #ifndef QT_NO_SYNTAXHIGHLIGHTER #include "../kernel/qrichtext_p.h" -#include "qtextedit.h" -#include "qtimer.h" +#include "ntqtextedit.h" +#include "ntqtimer.h" /*! - \class TQSyntaxHighlighter qsyntaxhighlighter.h + \class TQSyntaxHighlighter ntqsyntaxhighlighter.h \brief The TQSyntaxHighlighter class is a base class for implementing TQTextEdit syntax highlighters. diff --git a/src/widgets/qsyntaxhighlighter.h b/src/widgets/qsyntaxhighlighter.h deleted file mode 100644 index 19d16f7c4..000000000 --- a/src/widgets/qsyntaxhighlighter.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQSyntaxHighlighter class -** -** Created : 022407 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQSYNTAXHIGHLIGHTER_H -#define TQSYNTAXHIGHLIGHTER_H - -#ifndef QT_H -#include "qfont.h" -#include "qcolor.h" -#include "qstring.h" -#endif // QT_H - -class TQTextEdit; -class TQSyntaxHighlighterInternal; -class TQSyntaxHighlighterPrivate; -class TQTextParagraph; - -class Q_EXPORT TQSyntaxHighlighter : public TQt -{ - friend class TQSyntaxHighlighterInternal; - -public: - TQSyntaxHighlighter( TQTextEdit *textEdit ); - virtual ~TQSyntaxHighlighter(); - - virtual int highlightParagraph( const TQString &text, int endStateOfLastPara ) = 0; - - void setFormat( int start, int count, const TQFont &font, const TQColor &color ); - void setFormat( int start, int count, const TQColor &color ); - void setFormat( int start, int count, const TQFont &font ); - TQTextEdit *textEdit() const { return edit; } - - void rehighlight(); - - int currentParagraph() const; - -private: - TQTextParagraph *para; - TQTextEdit *edit; - TQSyntaxHighlighterPrivate *d; - -}; - -#endif diff --git a/src/widgets/qsyntaxhighlighter_p.h b/src/widgets/qsyntaxhighlighter_p.h index 28f7fa844..594a73e57 100644 --- a/src/widgets/qsyntaxhighlighter_p.h +++ b/src/widgets/qsyntaxhighlighter_p.h @@ -42,7 +42,7 @@ #define TQSYNTAXHIGHLIGHTER_P_H #ifndef QT_NO_SYNTAXHIGHLIGHTER -#include "qsyntaxhighlighter.h" +#include "ntqsyntaxhighlighter.h" #include "private/qrichtext_p.h" class TQSyntaxHighlighterPrivate diff --git a/src/widgets/qt_widgets.pri b/src/widgets/qt_widgets.pri index a4917e9bf..9410e3e4a 100644 --- a/src/widgets/qt_widgets.pri +++ b/src/widgets/qt_widgets.pri @@ -3,66 +3,66 @@ widgets { WIDGETS_P = widgets - HEADERS += $$WIDGETS_H/qbuttongroup.h \ - $$WIDGETS_H/qbutton.h \ + HEADERS += $$WIDGETS_H/ntqbuttongroup.h \ + $$WIDGETS_H/ntqbutton.h \ $$WIDGETS_P/qdialogbuttons_p.h \ - $$WIDGETS_H/qcheckbox.h \ - $$WIDGETS_H/qcombobox.h \ + $$WIDGETS_H/ntqcheckbox.h \ + $$WIDGETS_H/ntqcombobox.h \ $$WIDGETS_P/qwidgetresizehandler_p.h \ - $$WIDGETS_H/qdial.h \ - $$WIDGETS_H/qdockarea.h \ - $$WIDGETS_H/qdockwindow.h \ - $$WIDGETS_H/qframe.h \ - $$WIDGETS_H/qgrid.h \ - $$WIDGETS_H/qgridview.h \ - $$WIDGETS_H/qgroupbox.h \ - $$WIDGETS_H/qhbuttongroup.h \ - $$WIDGETS_H/qheader.h \ - $$WIDGETS_H/qhgroupbox.h \ - $$WIDGETS_H/qhbox.h \ - $$WIDGETS_H/qlabel.h \ - $$WIDGETS_H/qlcdnumber.h \ - $$WIDGETS_H/qlineedit.h \ - $$WIDGETS_H/qlistbox.h \ - $$WIDGETS_H/qlistview.h \ - $$WIDGETS_H/qmainwindow.h \ - $$WIDGETS_H/qmenubar.h \ - $$WIDGETS_H/qmenudata.h \ - $$WIDGETS_H/qmultilineedit.h \ - $$WIDGETS_H/qpopupmenu.h \ - $$WIDGETS_H/qprogressbar.h \ - $$WIDGETS_H/qpushbutton.h \ - $$WIDGETS_H/qradiobutton.h \ - $$WIDGETS_H/qrangecontrol.h \ - $$WIDGETS_H/qscrollbar.h \ - $$WIDGETS_H/qscrollview.h \ - $$WIDGETS_H/qslider.h \ - $$WIDGETS_H/qsplashscreen.h \ - $$WIDGETS_H/qspinbox.h \ - $$WIDGETS_H/qsplitter.h \ - $$WIDGETS_H/qstatusbar.h \ - $$WIDGETS_H/qtabbar.h \ - $$WIDGETS_H/qsyntaxhighlighter.h \ + $$WIDGETS_H/ntqdial.h \ + $$WIDGETS_H/ntqdockarea.h \ + $$WIDGETS_H/ntqdockwindow.h \ + $$WIDGETS_H/ntqframe.h \ + $$WIDGETS_H/ntqgrid.h \ + $$WIDGETS_H/ntqgridview.h \ + $$WIDGETS_H/ntqgroupbox.h \ + $$WIDGETS_H/ntqhbuttongroup.h \ + $$WIDGETS_H/ntqheader.h \ + $$WIDGETS_H/ntqhgroupbox.h \ + $$WIDGETS_H/ntqhbox.h \ + $$WIDGETS_H/ntqlabel.h \ + $$WIDGETS_H/ntqlcdnumber.h \ + $$WIDGETS_H/ntqlineedit.h \ + $$WIDGETS_H/ntqlistbox.h \ + $$WIDGETS_H/ntqlistview.h \ + $$WIDGETS_H/ntqmainwindow.h \ + $$WIDGETS_H/ntqmenubar.h \ + $$WIDGETS_H/ntqmenudata.h \ + $$WIDGETS_H/ntqmultilineedit.h \ + $$WIDGETS_H/ntqpopupmenu.h \ + $$WIDGETS_H/ntqprogressbar.h \ + $$WIDGETS_H/ntqpushbutton.h \ + $$WIDGETS_H/ntqradiobutton.h \ + $$WIDGETS_H/ntqrangecontrol.h \ + $$WIDGETS_H/ntqscrollbar.h \ + $$WIDGETS_H/ntqscrollview.h \ + $$WIDGETS_H/ntqslider.h \ + $$WIDGETS_H/ntqsplashscreen.h \ + $$WIDGETS_H/ntqspinbox.h \ + $$WIDGETS_H/ntqsplitter.h \ + $$WIDGETS_H/ntqstatusbar.h \ + $$WIDGETS_H/ntqtabbar.h \ + $$WIDGETS_H/ntqsyntaxhighlighter.h \ $$WIDGETS_P/qsyntaxhighlighter_p.h \ - $$WIDGETS_H/qtabwidget.h \ + $$WIDGETS_H/ntqtabwidget.h \ $$WIDGETS_P/qtitlebar_p.h \ - $$WIDGETS_H/qtoolbar.h \ - $$WIDGETS_H/qtoolbox.h \ - $$WIDGETS_H/qtoolbutton.h \ - $$WIDGETS_H/qtooltip.h \ - $$WIDGETS_H/qvalidator.h \ - $$WIDGETS_H/qvbox.h \ - $$WIDGETS_H/qvbuttongroup.h \ - $$WIDGETS_H/qvgroupbox.h \ - $$WIDGETS_H/qwhatsthis.h \ - $$WIDGETS_H/qwidgetstack.h \ - $$WIDGETS_H/qaction.h \ - $$WIDGETS_H/qdatetimeedit.h \ - $$WIDGETS_H/qtextview.h \ - $$WIDGETS_H/qtextbrowser.h \ - $$WIDGETS_H/qtextedit.h \ + $$WIDGETS_H/ntqtoolbar.h \ + $$WIDGETS_H/ntqtoolbox.h \ + $$WIDGETS_H/ntqtoolbutton.h \ + $$WIDGETS_H/ntqtooltip.h \ + $$WIDGETS_H/ntqvalidator.h \ + $$WIDGETS_H/ntqvbox.h \ + $$WIDGETS_H/ntqvbuttongroup.h \ + $$WIDGETS_H/ntqvgroupbox.h \ + $$WIDGETS_H/ntqwhatsthis.h \ + $$WIDGETS_H/ntqwidgetstack.h \ + $$WIDGETS_H/ntqaction.h \ + $$WIDGETS_H/ntqdatetimeedit.h \ + $$WIDGETS_H/ntqtextview.h \ + $$WIDGETS_H/ntqtextbrowser.h \ + $$WIDGETS_H/ntqtextedit.h \ $$WIDGETS_P/qwidgetinterface_p.h \ - $$WIDGETS_H/qwidgetplugin.h + $$WIDGETS_H/ntqwidgetplugin.h SOURCES += $$WIDGETS_CPP/qbuttongroup.cpp \ $$WIDGETS_CPP/qbutton.cpp \ @@ -134,6 +134,6 @@ wince-* { SOURCES -= $$WIDGETS_CPP/qsyntaxhighlighter.cpp \ $$WIDGETS_CPP/qsplashscreen.cpp - HEADERS -= $$WIDGETS_H/qsyntaxhighlighter.h \ - $$WIDGETS_H/qsplashscreen.h + HEADERS -= $$WIDGETS_H/ntqsyntaxhighlighter.h \ + $$WIDGETS_H/ntqsplashscreen.h } diff --git a/src/widgets/qtabbar.cpp b/src/widgets/qtabbar.cpp index e86ff041c..b141de8d4 100644 --- a/src/widgets/qtabbar.cpp +++ b/src/widgets/qtabbar.cpp @@ -36,20 +36,20 @@ ** **********************************************************************/ -#include "qtabbar.h" +#include "ntqtabbar.h" #ifndef QT_NO_TABBAR -#include "qaccel.h" -#include "qbitmap.h" -#include "qtoolbutton.h" -#include "qtooltip.h" -#include "qapplication.h" -#include "qstyle.h" -#include "qpainter.h" -#include "qiconset.h" -#include "qcursor.h" +#include "ntqaccel.h" +#include "ntqbitmap.h" +#include "ntqtoolbutton.h" +#include "ntqtooltip.h" +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqpainter.h" +#include "ntqiconset.h" +#include "ntqcursor.h" #include "../kernel/qinternal_p.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #ifdef Q_WS_MACX @@ -58,7 +58,7 @@ /*! - \class TQTab qtabbar.h + \class TQTab ntqtabbar.h \brief The TQTab class provides the structures in a TQTabBar. \ingroup advanced @@ -169,7 +169,7 @@ TQTab::~TQTab() } /*! - \class TQTabBar qtabbar.h + \class TQTabBar ntqtabbar.h \brief The TQTabBar class provides a tab bar, e.g. for use in tabbed dialogs. \ingroup advanced diff --git a/src/widgets/qtabbar.h b/src/widgets/qtabbar.h deleted file mode 100644 index 408632a17..000000000 --- a/src/widgets/qtabbar.h +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTab and TQTabBar classes -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTABBAR_H -#define TQTABBAR_H - -#ifndef QT_H -#include "qwidget.h" -#include "qptrlist.h" -#endif // QT_H - -#ifndef QT_NO_TABBAR - -class TQTabBar; -class TQIconSet; - -class Q_EXPORT TQTab : public TQt -{ - friend class TQTabBar; - friend class TQTabWidget; - -public: - TQTab(); - virtual ~TQTab(); - TQTab( const TQString& text ); - TQTab( const TQIconSet& icon, const TQString& text = TQString::null ); - - void setText( const TQString& text); - TQString text() const { return label; } - void setIconSet( const TQIconSet& icon ); - TQIconSet* iconSet() const { return iconset; } - void setRect( const TQRect& rect ) { r = rect; } - TQRect rect() const { return r; } - void setEnabled( bool enable ) { enabled = enable; } - bool isEnabled() const { return enabled; } - void setIdentifier( int i ) { id = i; } - int identifier() const { return id; } - -private: - void setTabBar( TQTabBar *tb ); - TQString label; - TQRect r; // the bounding rectangle of this (may overlap with others) - bool enabled; - int id; - TQIconSet* iconset; // optional iconset - TQTabBar *tb; -}; - - -struct TQTabPrivate; -//class *TQAccel; - -class Q_EXPORT TQTabBar: public TQWidget -{ - Q_OBJECT - Q_ENUMS( Shape ) - Q_PROPERTY( Shape shape READ shape WRITE setShape ) - Q_PROPERTY( int currentTab READ currentTab WRITE setCurrentTab ) - Q_PROPERTY( int count READ count ) - Q_PROPERTY( int keyboardFocusTab READ keyboardFocusTab ) - -public: - TQTabBar( TQWidget* parent=0, const char* name=0 ); - ~TQTabBar(); - - enum Shape { RoundedAbove, RoundedBelow, - TriangularAbove, TriangularBelow }; - - Shape shape() const; - virtual void setShape( Shape ); - - void show(); - - virtual int addTab( TQTab * ); - virtual int insertTab( TQTab *, int index = -1 ); - virtual void removeTab( TQTab * ); - - virtual void setTabEnabled( int, bool ); - bool isTabEnabled( int ) const; - - - TQSize sizeHint() const; - TQSize minimumSizeHint() 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 & p ) const; - - void removeToolTip( int index ); - void setToolTip( int index, const TQString & tip ); - TQString toolTip( int index ) 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; // ### not const - virtual void paintLabel( TQPainter*, const TQRect&, TQTab*, bool ) const; - - void focusInEvent( TQFocusEvent *e ); - void focusOutEvent( TQFocusEvent *e ); - - 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 *e ); - - TQPtrList * tabList(); - -private slots: - void scrollTabs(); - -private: - TQPtrList * l; - TQPtrList * lstatic; - void makeVisible( TQTab* t = 0 ); - void updateArrowButtons(); - TQTabPrivate * d; - - friend class TQTabBarToolTip; - friend class TQTab; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTabBar( const TQTabBar & ); - TQTabBar& operator=( const TQTabBar & ); -#endif -}; - - -#endif // QT_NO_TABBAR - -#endif // TQTABBAR_H diff --git a/src/widgets/qtabwidget.cpp b/src/widgets/qtabwidget.cpp index 0621f0e38..9da69d02e 100644 --- a/src/widgets/qtabwidget.cpp +++ b/src/widgets/qtabwidget.cpp @@ -38,24 +38,24 @@ ** **********************************************************************/ -#include "qtabwidget.h" +#include "ntqtabwidget.h" #ifndef QT_NO_TABWIDGET -#include "qobjectlist.h" -#include "qtabbar.h" -#include "qapplication.h" -#include "qwidgetstack.h" -#include "qbitmap.h" -#include "qaccel.h" -#include "qstyle.h" -#include "qpainter.h" -#include "qtoolbutton.h" +#include "ntqobjectlist.h" +#include "ntqtabbar.h" +#include "ntqapplication.h" +#include "ntqwidgetstack.h" +#include "ntqbitmap.h" +#include "ntqaccel.h" +#include "ntqstyle.h" +#include "ntqpainter.h" +#include "ntqtoolbutton.h" #ifdef Q_OS_MACX #include #endif /*! - \class TQTabWidget qtabwidget.h + \class TQTabWidget ntqtabwidget.h \brief The TQTabWidget class provides a stack of tabbed widgets. \ingroup organizers diff --git a/src/widgets/qtabwidget.h b/src/widgets/qtabwidget.h deleted file mode 100644 index 9110af889..000000000 --- a/src/widgets/qtabwidget.h +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Definition of TQTabWidget class -** -** Created : 990318 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTABWIDGET_H -#define TQTABWIDGET_H - -#ifndef QT_H -#include "qwidget.h" -#include "qiconset.h" -#endif // QT_H - -#ifndef QT_NO_TABWIDGET - -class TQTabBar; -class TQTabWidgetData; -class TQTab; -class TQWidgetStack; - - -class Q_EXPORT TQTabWidget : public TQWidget -{ - Q_OBJECT - Q_ENUMS( TabPosition ) - Q_ENUMS( TabShape ) - Q_PROPERTY( TabPosition tabPosition READ tabPosition WRITE setTabPosition ) - Q_PROPERTY( TabShape tabShape READ tabShape WRITE setTabShape ) - Q_PROPERTY( int margin READ margin WRITE setMargin ) - Q_PROPERTY( int currentPage READ currentPageIndex WRITE setCurrentPage ) - Q_PROPERTY( int count READ count ) - Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true ) - -public: - TQTabWidget( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 ); - ~TQTabWidget(); - - virtual void addTab( TQWidget *, const TQString & ); // ### make these inline in 4.0 - virtual void addTab( TQWidget *child, const TQIconSet& iconset, - const TQString &label ); - virtual void addTab( TQWidget *, TQTab* ); - - virtual void insertTab( TQWidget *, const TQString &, int index = -1 ); - virtual void insertTab( TQWidget *child, const TQIconSet& iconset, - const TQString &label, int index = -1 ); - virtual void insertTab( TQWidget *, TQTab*, int index = -1 ); - - void changeTab( TQWidget *, const TQString &); - void changeTab( TQWidget *child, const TQIconSet& iconset, - const TQString &label ); - - bool isTabEnabled( TQWidget * ) const; - void setTabEnabled( TQWidget *, bool ); - - void setCornerWidget( TQWidget * w, TQt::Corner corner = TQt::TopRight ); - TQWidget * cornerWidget( TQt::Corner corner = TQt::TopRight ) const; - - TQString tabLabel( TQWidget * ) const; - void setTabLabel( TQWidget *p, const TQString &l ); - - TQIconSet tabIconSet( TQWidget * w ) const; - void setTabIconSet( TQWidget * w, const TQIconSet & iconset ); - - void removeTabToolTip( TQWidget * w ); - void setTabToolTip( TQWidget * w, const TQString & tip ); - TQString tabToolTip( TQWidget * w ) 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 s ); - - 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 * ); -#ifndef Q_QDOC - void selected( const TQString& ); -#endif - -private slots: - void showTab( int ); - -private: - TQTabWidgetData *d; - void setUpLayout( bool = FALSE ); - friend class TQTabDialog; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTabWidget( const TQTabWidget & ); - TQTabWidget& operator=( const TQTabWidget & ); -#endif -}; - -#endif // QT_NO_TABWIDGET - -#endif // TQTABWIDGET_H diff --git a/src/widgets/qtextbrowser.cpp b/src/widgets/qtextbrowser.cpp index 984f66751..d8d9b8a27 100644 --- a/src/widgets/qtextbrowser.cpp +++ b/src/widgets/qtextbrowser.cpp @@ -38,29 +38,29 @@ ** **********************************************************************/ -#include "qtextbrowser.h" +#include "ntqtextbrowser.h" #ifndef QT_NO_TEXTBROWSER #include "../kernel/qrichtext_p.h" -#include "qapplication.h" -#include "qlayout.h" -#include "qpainter.h" +#include "ntqapplication.h" +#include "ntqlayout.h" +#include "ntqpainter.h" -#include "qvaluestack.h" +#include "ntqvaluestack.h" #include "stdio.h" -#include "qfile.h" -#include "qtextstream.h" -#include "qlayout.h" -#include "qbitmap.h" -#include "qtimer.h" -#include "qimage.h" -#include "qsimplerichtext.h" -#include "qdragobject.h" -#include "qurl.h" -#include "qcursor.h" +#include "ntqfile.h" +#include "ntqtextstream.h" +#include "ntqlayout.h" +#include "ntqbitmap.h" +#include "ntqtimer.h" +#include "ntqimage.h" +#include "ntqsimplerichtext.h" +#include "ntqdragobject.h" +#include "ntqurl.h" +#include "ntqcursor.h" /*! - \class TQTextBrowser qtextbrowser.h + \class TQTextBrowser ntqtextbrowser.h \brief The TQTextBrowser class provides a rich text browser with hypertext navigation. \ingroup advanced diff --git a/src/widgets/qtextbrowser.h b/src/widgets/qtextbrowser.h deleted file mode 100644 index 12f8fb833..000000000 --- a/src/widgets/qtextbrowser.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQTextBrowser class -** -** Created : 990101 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTBROWSER_H -#define TQTEXTBROWSER_H - -#ifndef QT_H -#include "qptrlist.h" -#include "qpixmap.h" -#include "qcolor.h" -#include "qtextedit.h" -#endif // QT_H - -#ifndef QT_NO_TEXTBROWSER - -class TQTextBrowserData; - -class Q_EXPORT TQTextBrowser : public TQTextEdit -{ - Q_OBJECT - Q_PROPERTY( TQString source READ source WRITE setSource ) - Q_OVERRIDE( int undoDepth DESIGNABLE false SCRIPTABLE false ) - Q_OVERRIDE( bool overwriteMode DESIGNABLE false SCRIPTABLE false ) - Q_OVERRIDE( bool modified SCRIPTABLE false) - Q_OVERRIDE( bool readOnly DESIGNABLE false SCRIPTABLE false ) - Q_OVERRIDE( bool undoRedoEnabled DESIGNABLE false SCRIPTABLE false ) - -public: - TQTextBrowser( TQWidget* parent=0, const char* name=0 ); - ~TQTextBrowser(); - - TQString source() const; - -public slots: - virtual void setSource(const TQString& name); - virtual void backward(); - virtual void forward(); - virtual void home(); - virtual void reload(); - void setText( const TQString &txt ) { setText( txt, TQString::null ); } - virtual void setText( const TQString &txt, const TQString &context ); - -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 * e); - -private: - void popupDetail( const TQString& contents, const TQPoint& pos ); - bool linksEnabled() const { return TRUE; } - void emitHighlighted( const TQString &s ); - void emitLinkClicked( const TQString &s ); - TQTextBrowserData *d; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTextBrowser( const TQTextBrowser & ); - TQTextBrowser& operator=( const TQTextBrowser & ); -#endif -}; - -#endif // QT_NO_TEXTBROWSER - -#endif // TQTEXTBROWSER_H diff --git a/src/widgets/qtextedit.cpp b/src/widgets/qtextedit.cpp index e2a78743d..561903ab1 100644 --- a/src/widgets/qtextedit.cpp +++ b/src/widgets/qtextedit.cpp @@ -38,48 +38,48 @@ ** **********************************************************************/ -#include "qtextedit.h" +#include "ntqtextedit.h" #ifndef QT_NO_TEXTEDIT // Keep this position to avoid patch rejection #ifndef QT_NO_IM -#include "qinputcontext.h" +#include "ntqinputcontext.h" #endif #include "../kernel/qrichtext_p.h" -#include "qpainter.h" -#include "qpen.h" -#include "qbrush.h" -#include "qpixmap.h" -#include "qfont.h" -#include "qcolor.h" -#include "qstyle.h" -#include "qsize.h" -#include "qevent.h" -#include "qtimer.h" -#include "qapplication.h" -#include "qlistbox.h" -#include "qvbox.h" -#include "qapplication.h" -#include "qclipboard.h" -#include "qcolordialog.h" -#include "qfontdialog.h" -#include "qstylesheet.h" -#include "qdragobject.h" -#include "qurl.h" -#include "qcursor.h" -#include "qregexp.h" -#include "qpopupmenu.h" -#include "qptrstack.h" -#include "qmetaobject.h" -#include "qtextbrowser.h" +#include "ntqpainter.h" +#include "ntqpen.h" +#include "ntqbrush.h" +#include "ntqpixmap.h" +#include "ntqfont.h" +#include "ntqcolor.h" +#include "ntqstyle.h" +#include "ntqsize.h" +#include "ntqevent.h" +#include "ntqtimer.h" +#include "ntqapplication.h" +#include "ntqlistbox.h" +#include "ntqvbox.h" +#include "ntqapplication.h" +#include "ntqclipboard.h" +#include "ntqcolordialog.h" +#include "ntqfontdialog.h" +#include "ntqstylesheet.h" +#include "ntqdragobject.h" +#include "ntqurl.h" +#include "ntqcursor.h" +#include "ntqregexp.h" +#include "ntqpopupmenu.h" +#include "ntqptrstack.h" +#include "ntqmetaobject.h" +#include "ntqtextbrowser.h" #include #include "private/qsyntaxhighlighter_p.h" -#include +#include #ifndef QT_NO_ACCEL -#include +#include #define ACCEL_KEY(k) "\t" + TQString(TQKeySequence( TQt::CTRL | TQt::Key_ ## k )) #else #define ACCEL_KEY(k) "\t" + TQString("Ctrl+" #k) @@ -213,7 +213,7 @@ const char* TQRichTextDrag::format( int i ) const static bool block_set_alignment = FALSE; /*! - \class TQTextEdit qtextedit.h + \class TQTextEdit ntqtextedit.h \brief The TQTextEdit widget provides a powerful single-page rich text editor. \ingroup basic diff --git a/src/widgets/qtextedit.h b/src/widgets/qtextedit.h deleted file mode 100644 index ac334a58e..000000000 --- a/src/widgets/qtextedit.h +++ /dev/null @@ -1,616 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQTextEdit class -** -** Created : 990101 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTEDIT_H -#define TQTEXTEDIT_H - -#ifndef QT_H -#include "qscrollview.h" -#include "qstylesheet.h" -#include "qptrvector.h" -#include "qvaluelist.h" -#include "qptrlist.h" -#endif // QT_H - -#ifndef QT_NO_TEXTEDIT -// uncomment below to enable optimization mode - also uncomment the -// optimDoAutoScroll() private slot since moc ignores #ifdefs.. -#define QT_TEXTEDIT_OPTIMIZATION - -class TQPainter; -class TQTextDocument; -class TQTextCursor; -class TQKeyEvent; -class TQResizeEvent; -class TQMouseEvent; -class TQTimer; -class TQTextString; -class TQTextCommand; -class TQTextParagraph; -class TQTextFormat; -class TQFont; -class TQColor; -class TQTextEdit; -class TQTextBrowser; -class TQTextString; -struct TQUndoRedoInfoPrivate; -class TQPopupMenu; -class TQTextEditPrivate; -class TQSyntaxHighlighter; - -#ifdef QT_TEXTEDIT_OPTIMIZATION -class TQTextEditOptimPrivate -{ -public: - // Note: no left-tag has any value for leftTag or parent, and - // no right-tag has any formatting flags set. - enum TagType { Color = 0, Format = 1 }; - struct Tag { - TagType type:2; - bool bold:1; - bool italic:1; - bool underline:1; - int line; - int index; - Tag * leftTag; // ptr to left-tag in a left-right tag pair - Tag * parent; // ptr to parent left-tag in a nested tag - Tag * prev; - Tag * next; - TQString tag; - }; - TQTextEditOptimPrivate() - { - len = numLines = maxLineWidth = 0; - selStart.line = selStart.index = -1; - selEnd.line = selEnd.index = -1; - search.line = search.index = 0; - tags = lastTag = 0; - } - void clearTags() - { - Tag * itr = tags; - while ( tags ) { - itr = tags; - tags = tags->next; - delete itr; - } - tags = lastTag = 0; - tagIndex.clear(); - } - ~TQTextEditOptimPrivate() - { - clearTags(); - } - int len; - int numLines; - int maxLineWidth; - struct Selection { - int line; - int index; - }; - Selection selStart, selEnd, search; - Tag * tags, * lastTag; - TQMap lines; - TQMap tagIndex; -}; -#endif - -class Q_EXPORT TQTextEdit : public TQScrollView -{ - friend class TQTextBrowser; - friend class TQSyntaxHighlighter; - - Q_OBJECT - Q_ENUMS( WordWrap WrapPolicy ) - Q_SETS( AutoFormatting ) - Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) - Q_PROPERTY( TQString text READ text WRITE setText ) - Q_PROPERTY( TQBrush paper READ paper WRITE setPaper ) - Q_PROPERTY( bool linkUnderline READ linkUnderline WRITE setLinkUnderline ) - Q_PROPERTY( TQString documentTitle READ documentTitle ) - Q_PROPERTY( int length READ length ) - Q_PROPERTY( WordWrap wordWrap READ wordWrap WRITE setWordWrap ) - Q_PROPERTY( int wrapColumnOrWidth READ wrapColumnOrWidth WRITE setWrapColumnOrWidth ) - Q_PROPERTY( WrapPolicy wrapPolicy READ wrapPolicy WRITE setWrapPolicy ) - Q_PROPERTY( bool hasSelectedText READ hasSelectedText ) - Q_PROPERTY( TQString selectedText READ selectedText ) - Q_PROPERTY( int undoDepth READ undoDepth WRITE setUndoDepth ) - Q_PROPERTY( bool overwriteMode READ isOverwriteMode WRITE setOverwriteMode ) - Q_PROPERTY( bool modified READ isModified WRITE setModified DESIGNABLE false ) - Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly ) - Q_PROPERTY( bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled ) - Q_PROPERTY( int tabStopWidth READ tabStopWidth WRITE setTabStopWidth ) - Q_PROPERTY( bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus ) - Q_PROPERTY( AutoFormatting autoFormatting READ autoFormatting WRITE setAutoFormatting ) - -public: - enum WordWrap { - NoWrap, - WidgetWidth, - FixedPixelWidth, - FixedColumnWidth - }; - - enum WrapPolicy { - AtWordBoundary, - AtWhiteSpace = AtWordBoundary, // AtWhiteSpace is deprecated - Anywhere, - AtWordOrDocumentBoundary - }; - - enum AutoFormatting { - AutoNone = 0, - AutoBulletList = 0x00000001, - AutoAll = 0xffffffff - }; - - 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 = 0x0001, - CheckNewLines = 0x0002, - RemoveSelected = 0x0004, - AsIMCompositionText = 0x0008, // internal use - WithIMSelection = 0x0010 // internal use - }; - - TQTextEdit( const TQString& text, const TQString& context = TQString::null, - TQWidget* parent=0, const char* name=0); - TQTextEdit( TQWidget* parent=0, const char* name=0 ); - virtual ~TQTextEdit(); - void setPalette( const TQPalette & ); - - TQString text() const; - TQString text( int para ) const; - TextFormat textFormat() const; - TQString context() const; - TQString documentTitle() const; - - void getSelection( int *paraFrom, int *indexFrom, - int *paraTo, int *indexTo, int selNum = 0 ) const; - virtual bool find( const TQString &expr, bool cs, bool wo, bool forward = TRUE, - int *para = 0, int *index = 0 ); - - int paragraphs() const; - int lines() const; - int linesOfParagraph( int para ) const; - int lineOfChar( int para, int chr ); - int length() const; - TQRect paragraphRect( int para ) const; - int paragraphAt( const TQPoint &pos ) const; - int charAt( const TQPoint &pos, int *para ) const; - int paragraphLength( int para ) const; - - TQStyleSheet* styleSheet() const; -#ifndef QT_NO_MIME - TQMimeSourceFactory* mimeSourceFactory() const; -#endif - TQBrush paper() const; - bool linkUnderline() const; - - int heightForWidth( int w ) 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& pos ); - TQString anchorAt( const TQPoint& pos, AnchorAttribute a ); - - TQSize sizeHint() const; - - bool isReadOnly() const { return readonly; } - - void getCursorPosition( int *parag, int *index ) 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; - - // do not use, will go away - virtual bool getFormat( int para, int index, TQFont *font, TQColor *color, VerticalAlignment *verticalAlignment ); - // do not use, will go away - virtual bool getParagraphFormat( int para, TQFont *font, TQColor *color, - VerticalAlignment *verticalAlignment, int *alignment, - TQStyleSheetItem::DisplayMode *displayMode, - TQStyleSheetItem::ListStyle *listStyle, - int *listDepth ); - - - bool isOverwriteMode() const { return overWrite; } - TQColor paragraphBackgroundColor( int para ) const; - - bool isUndoRedoEnabled() const; - bool eventFilter( TQObject *o, TQEvent *e ); - bool tabChangesFocus() const; - - void setAutoFormatting( uint features ); - uint autoFormatting() const; - TQSyntaxHighlighter *syntaxHighlighter() const; - -public slots: - void setEnabled( bool ); -#ifndef QT_NO_MIME - virtual void setMimeSourceFactory( TQMimeSourceFactory* factory ); -#endif - virtual void setStyleSheet( TQStyleSheet* styleSheet ); - virtual void scrollToAnchor( const TQString& name ); - virtual void setPaper( const TQBrush& pap ); - virtual void setLinkUnderline( bool ); - - virtual void setWordWrap( WordWrap mode ); - virtual void setWrapColumnOrWidth( int ); - virtual void setWrapPolicy( WrapPolicy policy ); - - virtual void copy(); - virtual void append( const TQString& text ); - - void setText( const TQString &txt ) { setText( txt, TQString::null ); } - virtual void setText( const TQString &txt, const TQString &context ); - virtual void setTextFormat( TextFormat f ); - - virtual void selectAll( bool select = TRUE ); - virtual void setTabStopWidth( int ts ); - virtual void zoomIn( int range ); - virtual void zoomIn() { zoomIn( 1 ); } - virtual void zoomOut( int range ); - virtual void zoomOut() { zoomOut( 1 ); } - virtual void zoomTo( int size ); - - virtual void sync(); - virtual void setReadOnly( bool b ); - - virtual void undo(); - virtual void redo(); - virtual void cut(); - virtual void paste(); -#ifndef QT_NO_CLIPBOARD - virtual void pasteSubType( const TQCString &subtype ); -#endif - virtual void clear(); - virtual void del(); - virtual void indent(); - virtual void setItalic( bool b ); - virtual void setBold( bool b ); - virtual void setUnderline( bool b ); - virtual void setFamily( const TQString &f ); - virtual void setPointSize( int s ); - virtual void setColor( const TQColor &c ); - virtual void setFont( const TQFont &f ); - virtual void setVerticalAlignment( VerticalAlignment a ); - virtual void setAlignment( int a ); - - // do not use, will go away - virtual void setParagType( TQStyleSheetItem::DisplayMode dm, TQStyleSheetItem::ListStyle listStyle ); - - virtual void setCursorPosition( int parag, int index ); - virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 ); - virtual void setSelectionAttributes( int selNum, const TQColor &back, bool invertText ); - virtual void setModified( bool m ); - virtual void resetFormat(); - virtual void setUndoDepth( int d ); - virtual void setFormat( TQTextFormat *f, int flags ); - virtual void ensureCursorVisible(); - virtual void placeCursor( const TQPoint &pos, TQTextCursor *c = 0 ); - virtual void moveCursor( CursorAction action, bool select ); - virtual void doKeyboardAction( KeyboardAction action ); - virtual void removeSelectedText( int selNum = 0 ); - virtual void removeSelection( int selNum = 0 ); - virtual void setCurrentFont( const TQFont &f ); - virtual void setOverwriteMode( bool b ) { overWrite = b; } - - virtual void scrollToBottom(); - - void insert( const TQString &text, uint insertionFlags = CheckNewLines | RemoveSelected ); // ## virtual in 4.0 - - // obsolete - virtual void insert( const TQString &text, bool, bool = TRUE, bool = TRUE ); - - virtual void insertAt( const TQString &text, int para, int index ); - virtual void removeParagraph( int para ); - virtual void insertParagraph( const TQString &text, int para ); - - virtual void setParagraphBackgroundColor( int para, const TQColor &bg ); - virtual void clearParagraphBackground( int para ); - - virtual void setUndoRedoEnabled( bool b ); - void setTabChangesFocus( bool b ); // ### make virtual in 4.0 - -#ifdef QT_TEXTEDIT_OPTIMIZATION - void polish(); - void setMaxLogLines( int numLines ); - int maxLogLines(); -#endif - -signals: - void textChanged(); - void selectionChanged(); - void copyAvailable( bool ); - void undoAvailable( bool yes ); - void redoAvailable( bool yes ); - void currentFontChanged( const TQFont &f ); - void currentColorChanged( const TQColor &c ); - void currentAlignmentChanged( int a ); - void currentVerticalAlignmentChanged( VerticalAlignment a ); - void cursorPositionChanged( TQTextCursor *c ); - void cursorPositionChanged( int para, int pos ); - void returnPressed(); - void modificationChanged( bool m ); - void clicked( int parag, int index ); - void doubleClicked( int parag, int index ); - -protected: - void repaintChanged(); - void updateStyles(); - void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); - bool event( TQEvent *e ); - void keyPressEvent( TQKeyEvent *e ); - void resizeEvent( TQResizeEvent *e ); - void viewportResizeEvent( TQResizeEvent* ); - void contentsMousePressEvent( TQMouseEvent *e ); - void contentsMouseMoveEvent( TQMouseEvent *e ); - void contentsMouseReleaseEvent( TQMouseEvent *e ); - void contentsMouseDoubleClickEvent( TQMouseEvent *e ); -#ifndef QT_NO_WHEELEVENT - void contentsWheelEvent( TQWheelEvent *e ); -#endif - void imStartEvent( TQIMEvent * ); - void imComposeEvent( TQIMEvent * ); - void imEndEvent( TQIMEvent * ); -#ifndef QT_NO_DRAGANDDROP - void contentsDragEnterEvent( TQDragEnterEvent *e ); - void contentsDragMoveEvent( TQDragMoveEvent *e ); - void contentsDragLeaveEvent( TQDragLeaveEvent *e ); - void contentsDropEvent( TQDropEvent *e ); -#endif - void contentsContextMenuEvent( TQContextMenuEvent *e ); - bool sendMouseEventToInputContext( TQMouseEvent *e ); - bool focusNextPrevChild( bool next ); - TQTextDocument *document() const; - TQTextCursor *textCursor() const; - void setDocument( TQTextDocument *doc ); - virtual TQPopupMenu *createPopupMenu( const TQPoint& pos ); - virtual TQPopupMenu *createPopupMenu(); - void drawCursor( bool visible ); - - void windowActivationChange( bool ); - -protected slots: - virtual void doChangeInterval(); - void sliderReleased(); // ### make virtual in 4.0 -#if (QT_VERSION >= 0x040000) -#error "Some functions need to be changed to virtual for TQt 4.0" -#endif - -private slots: - void formatMore(); - void doResize(); - void autoScrollTimerDone(); - void blinkCursor(); - void setModified(); - void startDrag(); - void documentWidthChanged( int w ); - void clipboardChanged(); - -private: - struct Q_EXPORT UndoRedoInfo { - enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style, IME }; - - UndoRedoInfo( TQTextDocument *dc ); - ~UndoRedoInfo(); - void clear(); - bool valid() const; - - TQUndoRedoInfoPrivate *d; - int id; - int index; - int eid; - int eindex; - TQTextFormat *format; - int flags; - Type type; - TQTextDocument *doc; - TQByteArray styleInformation; - }; - -private: - void updateCursor( const TQPoint & pos ); - void handleMouseMove( const TQPoint& pos ); - void drawContents( TQPainter * ); - virtual bool linksEnabled() const { return FALSE; } - void init(); - void checkUndoRedoInfo( UndoRedoInfo::Type t ); - void updateCurrentFormat(); - bool handleReadOnlyKeyEvent( TQKeyEvent *e ); - void makeParagVisible( TQTextParagraph *p ); - void normalCopy(); - void copyToClipboard(); -#ifndef QT_NO_MIME - TQCString pickSpecial(TQMimeSource* ms, bool always_ask, const TQPoint&); - TQTextDrag *dragObject( TQWidget *parent = 0 ) const; -#endif -#ifndef QT_NO_MIMECLIPBOARD - void pasteSpecial(const TQPoint&); -#endif - void setFontInternal( const TQFont &f ); - - virtual void emitHighlighted( const TQString & ) {} - virtual void emitLinkClicked( const TQString & ) {} - - void readFormats( TQTextCursor &c1, TQTextCursor &c2, TQTextString &text, bool fillStyles = FALSE ); - void clearUndoRedo(); - void paintDocument( bool drawAll, TQPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 ); - void moveCursor( CursorAction action ); - void ensureFormatted( TQTextParagraph *p ); - void placeCursor( const TQPoint &pos, TQTextCursor *c, bool link ); - void updateMicroFocusHint(); - -#ifdef QT_TEXTEDIT_OPTIMIZATION - bool checkOptimMode(); - TQString optimText() const; - void optimSetText( const TQString &str ); - void optimAppend( const TQString &str ); - void optimInsert( const TQString &str, int line, int index ); - void optimDrawContents( TQPainter * p, int cx, int cy, int cw, int ch ); - void optimMousePressEvent( TQMouseEvent * e ); - void optimMouseReleaseEvent( TQMouseEvent * e ); - void optimMouseMoveEvent( TQMouseEvent * e ); - int optimCharIndex( const TQString &str, int mx ) const; - void optimSelectAll(); - void optimRemoveSelection(); - void optimSetSelection( int startLine, int startIdx, int endLine, - int endIdx ); - bool optimHasSelection() const; - TQString optimSelectedText() const; - bool optimFind( const TQString & str, bool, bool, bool, int *, int * ); - void optimParseTags( TQString * str, int lineNo = -1, int indexOffset = 0 ); - TQTextEditOptimPrivate::Tag * optimPreviousLeftTag( int line ); - void optimSetTextFormat( TQTextDocument *, TQTextCursor *, TQTextFormat * f, - int, int, TQTextEditOptimPrivate::Tag * t ); - TQTextEditOptimPrivate::Tag * optimAppendTag( int index, const TQString & tag ); - TQTextEditOptimPrivate::Tag * optimInsertTag( int line, int index, const TQString & tag ); - void optimCheckLimit( const TQString& str ); - bool optimHasBoldMetrics( int line ); - -private slots: - void optimDoAutoScroll(); -#endif // QT_TEXTEDIT_OPTIMIZATION - -private: -#ifndef QT_NO_CLIPBOARD - void pasteSubType( const TQCString &subtype, TQMimeSource *m ); -#endif - -private: - TQTextDocument *doc; - TQTextCursor *cursor; - TQTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer; - TQTextParagraph *lastFormatted; - int interval; - UndoRedoInfo undoRedoInfo; - TQTextFormat *currentFormat; - int currentAlignment; - TQPoint oldMousePos, mousePos; - TQPoint dragStartPos; - TQString onLink; - WordWrap wrapMode; - WrapPolicy wPolicy; - int wrapWidth; - TQString pressedLink; - TQTextEditPrivate *d; - bool inDoubleClick : 1; - bool mousePressed : 1; - bool cursorVisible : 1; - bool blinkCursorVisible : 1; - bool readOnly : 1; - bool modified : 1; - bool mightStartDrag : 1; - bool inDnD : 1; - bool readonly : 1; - bool undoEnabled : 1; - bool overWrite : 1; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQTextEdit( const TQTextEdit & ); - TQTextEdit &operator=( const TQTextEdit & ); -#endif -}; - -inline TQTextDocument *TQTextEdit::document() const -{ - return doc; -} - -inline TQTextCursor *TQTextEdit::textCursor() const -{ - return cursor; -} - -inline void TQTextEdit::setCurrentFont( const TQFont &f ) -{ - TQTextEdit::setFontInternal( f ); -} - -#endif //QT_NO_TEXTEDIT -#endif //TQTEXTVIEW_H diff --git a/src/widgets/qtextview.cpp b/src/widgets/qtextview.cpp index 3aa444524..475236dc8 100644 --- a/src/widgets/qtextview.cpp +++ b/src/widgets/qtextview.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qtextview.h" +#include "ntqtextview.h" #ifndef QT_NO_TEXTVIEW diff --git a/src/widgets/qtextview.h b/src/widgets/qtextview.h deleted file mode 100644 index 75c7c3a1d..000000000 --- a/src/widgets/qtextview.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQTextView class -** -** Created : 990101 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTEXTVIEW_H -#define TQTEXTVIEW_H - -#ifndef QT_H -#include "qtextedit.h" -#endif // QT_H - -#ifndef QT_NO_TEXTVIEW - -class Q_EXPORT TQTextView : public TQTextEdit -{ - Q_OBJECT - Q_OVERRIDE( int undoDepth DESIGNABLE false SCRIPTABLE false ) - Q_OVERRIDE( bool overwriteMode DESIGNABLE false SCRIPTABLE false ) - Q_OVERRIDE( bool modified SCRIPTABLE false) - Q_OVERRIDE( bool readOnly DESIGNABLE false SCRIPTABLE false ) - Q_OVERRIDE( bool undoRedoEnabled DESIGNABLE false SCRIPTABLE false ) - -public: - TQTextView( const TQString& text, const TQString& context = TQString::null, - TQWidget* parent=0, const char* name=0); - TQTextView( TQWidget* parent=0, const char* name=0 ); - - virtual ~TQTextView(); - -private: -#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= - TQTextView( const TQTextView & ); - TQTextView &operator=( const TQTextView & ); -#endif -}; - -#endif //QT_NO_TEXTVIEW -#endif //TQTEXTVIEW_H diff --git a/src/widgets/qtitlebar.cpp b/src/widgets/qtitlebar.cpp index fc607b080..1bf94d6d6 100644 --- a/src/widgets/qtitlebar.cpp +++ b/src/widgets/qtitlebar.cpp @@ -44,19 +44,19 @@ #ifndef QT_NO_TITLEBAR -#include -#include "qapplication.h" -#include "qstyle.h" -#include "qdatetime.h" +#include +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqdatetime.h" #include "private/qapplication_p.h" -#include "qtooltip.h" -#include "qimage.h" -#include "qtimer.h" -#include "qpainter.h" -#include "qstyle.h" +#include "ntqtooltip.h" +#include "ntqimage.h" +#include "ntqtimer.h" +#include "ntqpainter.h" +#include "ntqstyle.h" #include "private/qinternal_p.h" #ifndef QT_NO_WORKSPACE -#include "qworkspace.h" +#include "ntqworkspace.h" #endif #if defined(Q_WS_WIN) #include "qt_windows.h" diff --git a/src/widgets/qtitlebar_p.h b/src/widgets/qtitlebar_p.h index 27a9871e1..e50315804 100644 --- a/src/widgets/qtitlebar_p.h +++ b/src/widgets/qtitlebar_p.h @@ -56,8 +56,8 @@ #ifndef QT_H -#include "qbutton.h" -#include "qlabel.h" +#include "ntqbutton.h" +#include "ntqlabel.h" #endif // QT_H #if !defined(QT_NO_TITLEBAR) diff --git a/src/widgets/qtoolbar.cpp b/src/widgets/qtoolbar.cpp index 103c3b429..024ad323d 100644 --- a/src/widgets/qtoolbar.cpp +++ b/src/widgets/qtoolbar.cpp @@ -38,23 +38,23 @@ ** **********************************************************************/ -#include "qtoolbar.h" +#include "ntqtoolbar.h" #ifndef QT_NO_TOOLBAR -#include "qmainwindow.h" -#include "qtooltip.h" -#include "qcursor.h" -#include "qlayout.h" -#include "qframe.h" -#include "qobjectlist.h" -#include "qpainter.h" -#include "qdrawutil.h" -#include "qtoolbutton.h" -#include "qpopupmenu.h" -#include "qcombobox.h" -#include "qtimer.h" -#include "qwidgetlist.h" -#include "qstyle.h" +#include "ntqmainwindow.h" +#include "ntqtooltip.h" +#include "ntqcursor.h" +#include "ntqlayout.h" +#include "ntqframe.h" +#include "ntqobjectlist.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" +#include "ntqtoolbutton.h" +#include "ntqpopupmenu.h" +#include "ntqcombobox.h" +#include "ntqtimer.h" +#include "ntqwidgetlist.h" +#include "ntqstyle.h" static const char * const arrow_v_xpm[] = { "7 9 3 1", @@ -211,7 +211,7 @@ void TQToolBarSeparator::paintEvent( TQPaintEvent * ) /*! - \class TQToolBar qtoolbar.h + \class TQToolBar ntqtoolbar.h \brief The TQToolBar class provides a movable panel containing widgets such as tool buttons. @@ -258,7 +258,7 @@ void TQToolBarSeparator::paintEvent( TQPaintEvent * ) in the example above) as a child of a TQMainWindow the toolbar will be added to the top dock area. You can move it to another dock area (or float it) by calling TQMainWindow::moveDockWindow(). TQDock - areas lay out their windows in \link qdockarea.html#lines + areas lay out their windows in \link ntqdockarea.html#lines Lines\endlink. If the main window is resized so that the area occupied by the diff --git a/src/widgets/qtoolbar.h b/src/widgets/qtoolbar.h deleted file mode 100644 index 894f2afab..000000000 --- a/src/widgets/qtoolbar.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Definition of TQToolBar class -** -** Created : 980306 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTOOLBAR_H -#define TQTOOLBAR_H - -#ifndef QT_H -#include "qdockwindow.h" -#endif // QT_H - -#ifndef QT_NO_TOOLBAR - -class TQMainWindow; -class TQButton; -class TQBoxLayout; -class TQToolBarPrivate; - -class Q_EXPORT TQToolBar: public TQDockWindow -{ - Q_OBJECT - Q_PROPERTY( TQString label READ label WRITE setLabel ) - -public: - TQToolBar( const TQString &label, - TQMainWindow *, ToolBarDock = DockTop, - bool newLine = FALSE, const char* name=0 ); - TQToolBar( const TQString &label, TQMainWindow *, TQWidget *, - bool newLine = FALSE, const char* name=0, WFlags f = 0 ); - TQToolBar( TQMainWindow* parent=0, const char* name=0 ); - ~TQToolBar(); - - void addSeparator(); - - void show(); - void hide(); - - TQMainWindow * mainWindow() const; - - virtual void setStretchableWidget( TQWidget * ); - - bool event( TQEvent * e ); - - virtual void setLabel( const TQString & ); - TQString label() const; - - virtual void clear(); - - TQSize minimumSize() const; - TQSize minimumSizeHint() const; - - void setOrientation( Orientation o ); - void setMinimumSize( int minw, int minh ); - -protected: - void resizeEvent( TQResizeEvent *e ); - void styleChange( TQStyle & ); - -private slots: - void createPopup(); - -private: - void init(); - void checkForExtension( const TQSize &sz ); - TQToolBarPrivate * d; - TQMainWindow * mw; - TQWidget * sw; - TQString l; - - friend class TQMainWindow; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQToolBar( const TQToolBar & ); - TQToolBar& operator=( const TQToolBar & ); -#endif -}; - -#endif // QT_NO_TOOLBAR - -#endif // TQTOOLBAR_H diff --git a/src/widgets/qtoolbox.cpp b/src/widgets/qtoolbox.cpp index dd7d59e8c..05793a7de 100644 --- a/src/widgets/qtoolbox.cpp +++ b/src/widgets/qtoolbox.cpp @@ -38,23 +38,23 @@ ** **********************************************************************/ -#include "qtoolbox.h" +#include "ntqtoolbox.h" #ifndef QT_NO_TOOLBOX -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include class TQToolBoxButton : public TQButton { diff --git a/src/widgets/qtoolbox.h b/src/widgets/qtoolbox.h deleted file mode 100644 index 717200be5..000000000 --- a/src/widgets/qtoolbox.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Definition of TQToolBox widget class -** -** Created : 961105 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTOOLBOX_H -#define TQTOOLBOX_H - -#ifndef QT_H -#include -#include -#endif // QT_H - -#ifndef QT_NO_TOOLBOX - -class TQToolBoxPrivate; -class TQWidgetList; - -class Q_EXPORT TQToolBox : public TQFrame -{ - Q_OBJECT - Q_PROPERTY( int currentIndex READ currentIndex WRITE setCurrentIndex ) - Q_PROPERTY( int count READ count ) - -public: - TQToolBox( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 ); - ~TQToolBox(); - - int addItem( TQWidget *item, const TQString &label ); - int addItem( TQWidget *item, const TQIconSet &iconSet, const TQString &label ); - int insertItem( int index, TQWidget *item, const TQString &label ); - int insertItem( int index, TQWidget *item, const TQIconSet &iconSet, const TQString &label ); - - int removeItem( TQWidget *item ); - - void setItemEnabled( int index, bool enabled ); - bool isItemEnabled( int index ) const; - - void setItemLabel( int index, const TQString &label ); - TQString itemLabel( int index ) const; - - void setItemIconSet( int index, const TQIconSet &iconSet ); - TQIconSet itemIconSet( int index ) const; - - void setItemToolTip( int index, const TQString &toolTip ); - TQString itemToolTip( int index ) const; - - TQWidget *currentItem() const; - void setCurrentItem( TQWidget *item ); - - int currentIndex() const; - TQWidget *item( int index ) const; - int indexOf( TQWidget *item ) const; - int count() const; - -public slots: - void setCurrentIndex( int index ); - -signals: - void currentChanged( int index ); - -private slots: - void buttonClicked(); - void itemDestroyed(TQObject*); - -protected: - virtual void itemInserted( int index ); - virtual void itemRemoved( int index ); - void showEvent( TQShowEvent *e ); - void frameChanged(); - void styleChange(TQStyle&); - -private: - void relayout(); - -private: - TQToolBoxPrivate *d; - -}; - - -inline int TQToolBox::addItem( TQWidget *item, const TQString &label ) -{ return insertItem( -1, item, TQIconSet(), label ); } -inline int TQToolBox::addItem( TQWidget *item, const TQIconSet &iconSet, - const TQString &label ) -{ return insertItem( -1, item, iconSet, label ); } -inline int TQToolBox::insertItem( int index, TQWidget *item, const TQString &label ) -{ return insertItem( index, item, TQIconSet(), label ); } - -#endif // QT_NO_TOOLBOX -#endif diff --git a/src/widgets/qtoolbutton.cpp b/src/widgets/qtoolbutton.cpp index 7243e8e8f..eac653d99 100644 --- a/src/widgets/qtoolbutton.cpp +++ b/src/widgets/qtoolbutton.cpp @@ -39,23 +39,23 @@ **********************************************************************/ #undef QT_NO_COMPAT -#include "qtoolbutton.h" +#include "ntqtoolbutton.h" #ifndef QT_NO_TOOLBUTTON -#include "qdrawutil.h" -#include "qpainter.h" -#include "qpixmap.h" -#include "qwmatrix.h" -#include "qapplication.h" -#include "qstyle.h" -#include "qmainwindow.h" -#include "qtooltip.h" -#include "qtoolbar.h" -#include "qimage.h" -#include "qiconset.h" -#include "qtimer.h" -#include "qpopupmenu.h" -#include "qguardedptr.h" +#include "ntqdrawutil.h" +#include "ntqpainter.h" +#include "ntqpixmap.h" +#include "ntqwmatrix.h" +#include "ntqapplication.h" +#include "ntqstyle.h" +#include "ntqmainwindow.h" +#include "ntqtooltip.h" +#include "ntqtoolbar.h" +#include "ntqimage.h" +#include "ntqiconset.h" +#include "ntqtimer.h" +#include "ntqpopupmenu.h" +#include "ntqguardedptr.h" class TQToolButtonPrivate { @@ -76,7 +76,7 @@ public: /*! - \class TQToolButton qtoolbutton.h + \class TQToolButton ntqtoolbutton.h \brief The TQToolButton class provides a tquick-access button to commands or options, usually used inside a TQToolBar. diff --git a/src/widgets/qtoolbutton.h b/src/widgets/qtoolbutton.h deleted file mode 100644 index ce187e8a5..000000000 --- a/src/widgets/qtoolbutton.h +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** -** -** Definition of TQToolButton class -** -** Created : 979899 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTOOLBUTTON_H -#define TQTOOLBUTTON_H - -#ifndef QT_H -#include "qbutton.h" -#include "qstring.h" -#include "qpixmap.h" -#include "qiconset.h" -#endif // QT_H - -#ifndef QT_NO_TOOLBUTTON - -class TQToolButtonPrivate; -class TQToolBar; -class TQPopupMenu; - -class Q_EXPORT TQToolButton : public TQButton -{ - Q_OBJECT - Q_ENUMS( TextPosition ) - - Q_PROPERTY( TQIconSet iconSet READ iconSet WRITE setIconSet ) - Q_PROPERTY( TQIconSet onIconSet READ onIconSet WRITE setOnIconSet DESIGNABLE false STORED false ) - Q_PROPERTY( TQIconSet offIconSet READ offIconSet WRITE setOffIconSet DESIGNABLE false STORED false ) - Q_PROPERTY( bool usesBigPixmap READ usesBigPixmap WRITE setUsesBigPixmap ) - Q_PROPERTY( bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel ) - Q_PROPERTY( TQString textLabel READ textLabel WRITE setTextLabel ) - Q_PROPERTY( int popupDelay READ popupDelay WRITE setPopupDelay ) - Q_PROPERTY( bool autoRaise READ autoRaise WRITE setAutoRaise ) - Q_PROPERTY( TextPosition textPosition READ textPosition WRITE setTextPosition ) - - Q_OVERRIDE( bool toggleButton WRITE setToggleButton ) - Q_OVERRIDE( bool on WRITE setOn ) - Q_OVERRIDE( TQPixmap pixmap DESIGNABLE false STORED false ) - Q_OVERRIDE( BackgroundMode backgroundMode DESIGNABLE true) - -public: - enum TextPosition { - BesideIcon, - BelowIcon, - Right = BesideIcon, // obsolete - Under = BelowIcon // obsolete - }; - TQToolButton( TQWidget * parent, const char* name=0 ); -#ifndef QT_NO_TOOLBAR - TQToolButton( const TQIconSet& s, const TQString &textLabel, - const TQString& grouptext, - TQObject * receiver, const char* slot, - TQToolBar * parent, const char* name=0 ); -#endif - TQToolButton( ArrowType type, TQWidget *parent, const char* name=0 ); - ~TQToolButton(); - - TQSize sizeHint() const; - TQSize minimumSizeHint() const; - -#ifndef QT_NO_COMPAT - void setOnIconSet( const TQIconSet& ); - void setOffIconSet( const TQIconSet& ); - void setIconSet( const TQIconSet &, bool on ); - TQIconSet onIconSet() const; - TQIconSet offIconSet( ) const; - TQIconSet iconSet( bool on ) const; -#endif - virtual void setIconSet( const TQIconSet & ); - TQIconSet iconSet() const; - - bool usesBigPixmap() const { return ubp; } - bool usesTextLabel() const { return utl; } - TQString textLabel() const { return tl; } - -#ifndef QT_NO_POPUPMENU - void setPopup( TQPopupMenu* popup ); - TQPopupMenu* popup() const; - - void setPopupDelay( int delay ); - int popupDelay() const; - - void openPopup(); -#endif - - void setAutoRaise( bool enable ); - bool autoRaise() const; - TextPosition textPosition() const; - - void setText( const TQString &txt ); - -public slots: - virtual void setUsesBigPixmap( bool enable ); - virtual void setUsesTextLabel( bool enable ); - virtual void setTextLabel( const TQString &, bool ); - - virtual void setToggleButton( bool enable ); - - virtual void setOn( bool enable ); - void toggle(); - void setTextLabel( const TQString & ); - void setTextPosition( TextPosition pos ); - -protected: - void mousePressEvent( TQMouseEvent * ); - void drawButton( TQPainter * ); - void drawButtonLabel(TQPainter *); - - void enterEvent( TQEvent * ); - void leaveEvent( TQEvent * ); - void moveEvent( TQMoveEvent * ); - - // ### Make virtual in 4.0, maybe act like TQPushButton with - // regards to setFlat() instead? Andy - bool uses3D() const; -#if (QT_VERSION >= 0x040000) -#error "Some functions need to be changed to virtual for TQt 4.0" -#endif - - bool eventFilter( TQObject *o, TQEvent *e ); - -#ifndef QT_NO_PALETTE - void paletteChange( const TQPalette & ); -#endif - -private slots: - void popupTimerDone(); - void popupPressed(); - -private: - void init(); - - TQPixmap bp; - int bpID; - TQPixmap sp; - int spID; - - TQString tl; - - TQToolButtonPrivate *d; - TQIconSet *s; - - uint utl : 1; - uint ubp : 1; - uint hasArrow : 1; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQToolButton( const TQToolButton & ); - TQToolButton& operator=( const TQToolButton & ); -#endif -}; - -#endif // QT_NO_TOOLBUTTON - -#endif // TQTOOLBUTTON_H diff --git a/src/widgets/qtooltip.cpp b/src/widgets/qtooltip.cpp index e61707f58..ace4fd317 100644 --- a/src/widgets/qtooltip.cpp +++ b/src/widgets/qtooltip.cpp @@ -36,13 +36,13 @@ ** **********************************************************************/ -#include "qtooltip.h" +#include "ntqtooltip.h" #ifndef QT_NO_TOOLTIP -#include "qlabel.h" -#include "qptrdict.h" -#include "qapplication.h" -#include "qguardedptr.h" -#include "qtimer.h" +#include "ntqlabel.h" +#include "ntqptrdict.h" +#include "ntqapplication.h" +#include "ntqguardedptr.h" +#include "ntqtimer.h" #include "qeffects_p.h" static bool globally_enabled = TRUE; @@ -649,7 +649,7 @@ void TQTipManager::setWakeUpDelay ( int i ) } /*! - \class TQToolTip qtooltip.h + \class TQToolTip ntqtooltip.h \brief The TQToolTip class provides tool tips (balloon help) for any widget or rectangular part of a widget. @@ -1102,7 +1102,7 @@ void TQToolTip::clear() /*! - \class TQToolTipGroup qtooltip.h + \class TQToolTipGroup ntqtooltip.h \brief The TQToolTipGroup class collects tool tips into related groups. \ingroup helpsystem diff --git a/src/widgets/qtooltip.h b/src/widgets/qtooltip.h deleted file mode 100644 index 37f91e5f2..000000000 --- a/src/widgets/qtooltip.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Definition of Tool Tips (or Balloon Help) for any widget or rectangle -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQTOOLTIP_H -#define TQTOOLTIP_H - -#ifndef QT_H -#include "qwidget.h" -#endif // QT_H - -#ifndef QT_NO_TOOLTIP - -#if __GNUC__ - 0 > 3 -#pragma GCC system_header -#endif - -class TQTipManager; -class TQIconViewToolTip; -class TQListViewToolTip; - -class Q_EXPORT TQToolTipGroup: public TQObject -{ - Q_OBJECT - Q_PROPERTY( bool delay READ delay WRITE setDelay ) - Q_PROPERTY( bool enabled READ enabled WRITE setEnabled ) - -public: - TQToolTipGroup( TQObject *parent, const char *name = 0 ); - ~TQToolTipGroup(); - - bool delay() const; - bool enabled() const; - -public slots: - void setDelay( bool ); - void setEnabled( bool ); - -signals: - void showTip( const TQString &); - void removeTip(); - -private: - uint del:1; - uint ena:1; - - friend class TQTipManager; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQToolTipGroup( const TQToolTipGroup & ); - TQToolTipGroup& operator=( const TQToolTipGroup & ); -#endif -}; - - -class Q_EXPORT TQToolTip: public TQt -{ -public: - TQToolTip( TQWidget *, TQToolTipGroup * = 0 ); - //### add virtual d'tor for 4.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 & pos = TQPoint() ); - - static void hide(); - - static TQFont font(); - static void setFont( const TQFont & ); - static TQPalette palette(); - static void setPalette( const TQPalette & ); - -#ifndef QT_NO_COMPAT - static void setEnabled( bool enable ) { setGloballyEnabled( enable ); } - static bool enabled() { return isGloballyEnabled(); } -#endif - static void setGloballyEnabled( bool ); - static bool isGloballyEnabled(); - static void setWakeUpDelay(int); - -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(); - -public: - TQWidget *parentWidget() const { return p; } - TQToolTipGroup *group() const { return g; } - -private: - TQWidget *p; - TQToolTipGroup *g; - static TQFont *ttFont; - static TQPalette *ttPalette; - - friend class TQTipManager; -}; - - -#endif // QT_NO_TOOLTIP - -#endif // TQTOOLTIP_H diff --git a/src/widgets/qvalidator.cpp b/src/widgets/qvalidator.cpp index b5df08e9a..20c86bfc3 100644 --- a/src/widgets/qvalidator.cpp +++ b/src/widgets/qvalidator.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "qvalidator.h" +#include "ntqvalidator.h" #ifndef QT_NO_VALIDATOR #include diff --git a/src/widgets/qvalidator.h b/src/widgets/qvalidator.h deleted file mode 100644 index b24c94989..000000000 --- a/src/widgets/qvalidator.h +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** -** -** Definition of validator classes -** -** Created : 970610 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVALIDATOR_H -#define TQVALIDATOR_H - -#ifndef QT_H -#include "qobject.h" -#include "qstring.h" // char*->TQString conversion -#include "qregexp.h" // TQString->TQRegExp conversion -#endif // QT_H - -#ifndef QT_NO_VALIDATOR - - -class Q_EXPORT TQValidator : public TQObject -{ - Q_OBJECT -public: - TQValidator( TQObject * parent, const char *name = 0 ); - ~TQValidator(); - - enum State { Invalid, Intermediate, Valid=Intermediate, Acceptable }; - - virtual State validate( TQString &, int & ) const = 0; - virtual void fixup( TQString & ) const; - -private: -#if defined(Q_DISABLE_COPY) - TQValidator( const TQValidator & ); - TQValidator& operator=( const TQValidator & ); -#endif -}; - - -class Q_EXPORT TQIntValidator : public TQValidator -{ - Q_OBJECT - Q_PROPERTY( int bottom READ bottom WRITE setBottom ) - Q_PROPERTY( int top READ top WRITE setTop ) - -public: - TQIntValidator( TQObject * parent, const char *name = 0 ); - TQIntValidator( int bottom, int top, - TQObject * parent, const char *name = 0 ); - ~TQIntValidator(); - - TQValidator::State validate( TQString &, int & ) const; - - void setBottom( int ); - void setTop( int ); - virtual void setRange( int bottom, int top ); - - int bottom() const { return b; } - int top() const { return t; } - -private: -#if defined(Q_DISABLE_COPY) - TQIntValidator( const TQIntValidator & ); - TQIntValidator& operator=( const TQIntValidator & ); -#endif - - int b, t; -}; - -#ifndef QT_NO_REGEXP - -class Q_EXPORT TQDoubleValidator : public TQValidator -{ - Q_OBJECT - Q_PROPERTY( double bottom READ bottom WRITE setBottom ) - Q_PROPERTY( double top READ top WRITE setTop ) - Q_PROPERTY( int decimals READ decimals WRITE setDecimals ) - -public: - TQDoubleValidator( TQObject * parent, const char *name = 0 ); - TQDoubleValidator( double bottom, double top, int decimals, - TQObject * parent, const char *name = 0 ); - ~TQDoubleValidator(); - - TQValidator::State validate( TQString &, int & ) const; - - virtual void setRange( double bottom, double top, int decimals = 0 ); - void setBottom( double ); - void setTop( double ); - void setDecimals( int ); - - double bottom() const { return b; } - double top() const { return t; } - int decimals() const { return d; } - -private: -#if defined(Q_DISABLE_COPY) - TQDoubleValidator( const TQDoubleValidator & ); - TQDoubleValidator& operator=( const TQDoubleValidator & ); -#endif - - double b, t; - int d; -}; - - -class Q_EXPORT TQRegExpValidator : public TQValidator -{ - Q_OBJECT - // Q_PROPERTY( TQRegExp regExp READ regExp WRITE setRegExp ) - -public: - TQRegExpValidator( TQObject *parent, const char *name = 0 ); - TQRegExpValidator( const TQRegExp& rx, TQObject *parent, - const char *name = 0 ); - ~TQRegExpValidator(); - - virtual TQValidator::State validate( TQString& input, int& pos ) const; - - void setRegExp( const TQRegExp& rx ); - const TQRegExp& regExp() const { return r; } - -private: -#if defined(Q_DISABLE_COPY) - TQRegExpValidator( const TQRegExpValidator& ); - TQRegExpValidator& operator=( const TQRegExpValidator& ); -#endif - - TQRegExp r; -}; -#endif // QT_NO_REGEXP - - -#endif // QT_NO_VALIDATOR - -#endif // TQVALIDATOR_H diff --git a/src/widgets/qvbox.cpp b/src/widgets/qvbox.cpp index a80e952db..975c2416a 100644 --- a/src/widgets/qvbox.cpp +++ b/src/widgets/qvbox.cpp @@ -39,11 +39,11 @@ **********************************************************************/ -#include "qvbox.h" +#include "ntqvbox.h" #ifndef QT_NO_VBOX /*! - \class TQVBox qvbox.h + \class TQVBox ntqvbox.h \brief The TQVBox widget provides vertical geometry management of its child widgets. diff --git a/src/widgets/qvbox.h b/src/widgets/qvbox.h deleted file mode 100644 index 3558997c1..000000000 --- a/src/widgets/qvbox.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Definition of vertical box layout widget class -** -** Created : 990124 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVBOX_H -#define TQVBOX_H - -#ifndef QT_H -#include "qhbox.h" -#endif // QT_H - -#ifndef QT_NO_VBOX - -class Q_EXPORT TQVBox : public TQHBox -{ - Q_OBJECT -public: - TQVBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQVBox( const TQVBox & ); - TQVBox& operator=( const TQVBox & ); -#endif -}; - -#endif // QT_NO_VBOX - -#endif // TQVBOX_H diff --git a/src/widgets/qvbuttongroup.cpp b/src/widgets/qvbuttongroup.cpp index 79dc9ea2b..c817d3c97 100644 --- a/src/widgets/qvbuttongroup.cpp +++ b/src/widgets/qvbuttongroup.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qvbuttongroup.h" +#include "ntqvbuttongroup.h" #ifndef QT_NO_VBUTTONGROUP /*! - \class TQVButtonGroup qvbuttongroup.h + \class TQVButtonGroup ntqvbuttongroup.h \brief The TQVButtonGroup widget organizes TQButton widgets in a vertical column. diff --git a/src/widgets/qvbuttongroup.h b/src/widgets/qvbuttongroup.h deleted file mode 100644 index 8f17ce1c4..000000000 --- a/src/widgets/qvbuttongroup.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Definition of TQVButtonGroup class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVBUTTONGROUP_H -#define TQVBUTTONGROUP_H - -#ifndef QT_H -#include "qbuttongroup.h" -#endif // QT_H - -#ifndef QT_NO_VBUTTONGROUP - -class Q_EXPORT TQVButtonGroup : public TQButtonGroup -{ - Q_OBJECT -public: - TQVButtonGroup( TQWidget* parent=0, const char* name=0 ); - TQVButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); - - ~TQVButtonGroup(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQVButtonGroup( const TQVButtonGroup & ); - TQVButtonGroup &operator=( const TQVButtonGroup & ); -#endif -}; - - -#endif // QT_NO_VBUTTONGROUP - -#endif // TQVBUTTONGROUP_H diff --git a/src/widgets/qvgroupbox.cpp b/src/widgets/qvgroupbox.cpp index 5f8b235e4..5ae77babb 100644 --- a/src/widgets/qvgroupbox.cpp +++ b/src/widgets/qvgroupbox.cpp @@ -38,11 +38,11 @@ ** **********************************************************************/ -#include "qvgroupbox.h" +#include "ntqvgroupbox.h" #ifndef QT_NO_VGROUPBOX /*! - \class TQVGroupBox qvgroupbox.h + \class TQVGroupBox ntqvgroupbox.h \brief The TQVGroupBox widget organizes a group of widgets in a vertical column. diff --git a/src/widgets/qvgroupbox.h b/src/widgets/qvgroupbox.h deleted file mode 100644 index e00db426e..000000000 --- a/src/widgets/qvgroupbox.h +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** -** -** Definition of TQVGroupBox widget class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVGROUPBOX_H -#define TQVGROUPBOX_H - -#ifndef QT_H -#include "qgroupbox.h" -#endif // QT_H - -#ifndef QT_NO_VGROUPBOX - -class Q_EXPORT TQVGroupBox : public TQGroupBox -{ - Q_OBJECT -public: - TQVGroupBox( TQWidget* parent=0, const char* name=0 ); - TQVGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); - - ~TQVGroupBox(); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQVGroupBox( const TQVGroupBox & ); - TQVGroupBox &operator=( const TQVGroupBox & ); -#endif -}; - -#endif // QT_NO_VGROUPBOX - -#endif // TQVGROUPBOX_H diff --git a/src/widgets/qwhatsthis.cpp b/src/widgets/qwhatsthis.cpp index 50c75fff6..55d653e92 100644 --- a/src/widgets/qwhatsthis.cpp +++ b/src/widgets/qwhatsthis.cpp @@ -36,23 +36,23 @@ ** **********************************************************************/ -#include "qwhatsthis.h" +#include "ntqwhatsthis.h" #ifndef QT_NO_WHATSTHIS -#include "qapplication.h" -#include "qpaintdevicemetrics.h" -#include "qpixmap.h" -#include "qpainter.h" -#include "qtimer.h" -#include "qptrdict.h" -#include "qtoolbutton.h" -#include "qshared.h" -#include "qcursor.h" -#include "qbitmap.h" -#include "qtooltip.h" -#include "qsimplerichtext.h" -#include "qstylesheet.h" +#include "ntqapplication.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqpixmap.h" +#include "ntqpainter.h" +#include "ntqtimer.h" +#include "ntqptrdict.h" +#include "ntqtoolbutton.h" +#include "ntqshared.h" +#include "ntqcursor.h" +#include "ntqbitmap.h" +#include "ntqtooltip.h" +#include "ntqsimplerichtext.h" +#include "ntqstylesheet.h" #if defined(QT_ACCESSIBILITY_SUPPORT) -#include "qaccessible.h" +#include "ntqaccessible.h" #endif #if defined(Q_WS_WIN) #include "qt_windows.h" @@ -62,7 +62,7 @@ #endif /*! - \class TQWhatsThis qwhatsthis.h + \class TQWhatsThis ntqwhatsthis.h \brief The TQWhatsThis class provides a simple description of any widget, i.e. answering the question "What's this?". diff --git a/src/widgets/qwhatsthis.h b/src/widgets/qwhatsthis.h deleted file mode 100644 index 365e673c6..000000000 --- a/src/widgets/qwhatsthis.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWhatsThis class -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWHATSTHIS_H -#define TQWHATSTHIS_H - -#ifndef QT_H -#include "qobject.h" -#endif // QT_H - -#ifndef QT_NO_WHATSTHIS - -#include "qcursor.h" - -class TQToolButton; -class TQPopupMenu; -class TQStyleSheet; - -class Q_EXPORT TQWhatsThis: public TQt -{ -public: - TQWhatsThis( TQWidget *); - virtual ~TQWhatsThis(); - - virtual TQString text( const TQPoint & ); - virtual bool clicked( const TQString& href ); - - // the common static functions - static void setFont( const TQFont &font ); - - static void add( TQWidget *, const TQString &); - static void remove( TQWidget * ); - static TQString textFor( TQWidget *, const TQPoint & pos = TQPoint(), bool includeParents = FALSE ); - - static TQToolButton * whatsThisButton( TQWidget * parent ); - - static void enterWhatsThisMode(); - static bool inWhatsThisMode(); - static void leaveWhatsThisMode( const TQString& = TQString::null, const TQPoint& pos = TQCursor::pos(), TQWidget* w = 0 ); - - static void display( const TQString& text, const TQPoint& pos = TQCursor::pos(), TQWidget* w = 0 ); -}; - -#endif // QT_NO_WHATSTHIS - -#endif // TQWHATSTHIS_H diff --git a/src/widgets/qwidgetinterface_p.h b/src/widgets/qwidgetinterface_p.h index 128a2771f..38505841e 100644 --- a/src/widgets/qwidgetinterface_p.h +++ b/src/widgets/qwidgetinterface_p.h @@ -53,7 +53,7 @@ #ifndef QT_H #include -#include "qiconset.h" +#include "ntqiconset.h" #endif // QT_H #ifndef QT_NO_WIDGETPLUGIN diff --git a/src/widgets/qwidgetplugin.cpp b/src/widgets/qwidgetplugin.cpp index 1cd2434d2..37b5156bb 100644 --- a/src/widgets/qwidgetplugin.cpp +++ b/src/widgets/qwidgetplugin.cpp @@ -38,18 +38,18 @@ ** **********************************************************************/ -#include "qwidgetplugin.h" +#include "ntqwidgetplugin.h" #ifndef QT_NO_WIDGETPLUGIN #include "qwidgetinterface_p.h" -#include "qobjectcleanuphandler.h" -#include "qwidget.h" +#include "ntqobjectcleanuphandler.h" +#include "ntqwidget.h" #ifdef QT_CONTAINER_CUSTOM_WIDGETS -#include "qwidgetlist.h" +#include "ntqwidgetlist.h" #endif /*! - \class TQWidgetPlugin qwidgetplugin.h + \class TQWidgetPlugin ntqwidgetplugin.h \brief The TQWidgetPlugin class provides an abstract base for custom TQWidget plugins. \ingroup plugins @@ -440,7 +440,7 @@ bool TQWidgetPlugin::isContainer( const TQString & ) const #ifdef QT_CONTAINER_CUSTOM_WIDGETS /*! - \class TQWidgetContainerPlugin qwidgetplugin.h + \class TQWidgetContainerPlugin ntqwidgetplugin.h \brief The TQWidgetContainerPlugin class provides an abstract base for complex custom container TQWidget plugins. diff --git a/src/widgets/qwidgetplugin.h b/src/widgets/qwidgetplugin.h deleted file mode 100644 index 0163e00fd..000000000 --- a/src/widgets/qwidgetplugin.h +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWidgetPlugin class -** -** Created : 010920 -** -** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWIDGETPLUGIN_H -#define TQWIDGETPLUGIN_H - -#ifndef QT_H -#include "qgplugin.h" -#include "qstringlist.h" -#include "qiconset.h" -#endif // QT_H -#ifndef QT_NO_WIDGETPLUGIN - -#ifdef Q_WS_WIN -#ifdef QT_PLUGIN -#define QT_WIDGET_PLUGIN_EXPORT __declspec(dllexport) -#else -#define QT_WIDGET_PLUGIN_EXPORT __declspec(dllimport) -#endif -#else -#define QT_WIDGET_PLUGIN_EXPORT -#endif - -class TQWidgetPluginPrivate; -class TQWidget; - -class Q_EXPORT TQWidgetPlugin : public TQGPlugin -{ - Q_OBJECT -public: - TQWidgetPlugin(); - ~TQWidgetPlugin(); - - virtual TQStringList keys() const = 0; - virtual TQWidget *create( const TQString &key, TQWidget *parent = 0, const char *name = 0 ) = 0; - - virtual TQString group( const TQString &key ) const; - virtual TQIconSet iconSet( const TQString &key ) const; - virtual TQString includeFile( const TQString &key ) const; - virtual TQString toolTip( const TQString &key ) const; - virtual TQString whatsThis( const TQString &key ) const; - virtual bool isContainer( const TQString &key ) const; - -private: - TQWidgetPluginPrivate *d; -}; - -#ifdef QT_CONTAINER_CUSTOM_WIDGETS - -class TQWidgetContainerPluginPrivate; - -class Q_EXPORT TQWidgetContainerPlugin : public TQWidgetPlugin -{ - -public: - TQWidgetContainerPlugin(); - ~TQWidgetContainerPlugin(); - - virtual TQWidget* containerOfWidget( const TQString &key, TQWidget *container ) const; - virtual bool isPassiveInteractor( const TQString &key, TQWidget *container ) const; - - virtual bool supportsPages( const TQString &key ) const; - - virtual TQWidget *addPage( const TQString &key, TQWidget *container, - const TQString &name, int index ) const; - virtual void insertPage( const TQString &key, TQWidget *container, - const TQString &name, int index, TQWidget *page ) const; - virtual void removePage( const TQString &key, TQWidget *container, int index ) const; - virtual void movePage( const TQString &key, TQWidget *container, int fromIndex, int toIndex ) const; - virtual int count( const TQString &key, TQWidget *container ) const; - virtual int currentIndex( const TQString &key, TQWidget *container ) const; - virtual TQString pageLabel( const TQString &key, TQWidget *container, int index ) const; - virtual TQWidget *page( const TQString &key, TQWidget *container, int index ) const; - virtual void renamePage( const TQString &key, TQWidget *container, - int index, const TQString &newName ) const; - virtual TQWidgetList pages( const TQString &key, TQWidget *container ) const; - virtual TQString createCode( const TQString &key, const TQString &container, - const TQString &page, const TQString &pageName ) const; -}; - -#endif // QT_CONTAINER_CUSTOM_WIDGETS -#endif // QT_NO_WIDGETPLUGIN -#endif // TQWIDGETPLUGIN_H diff --git a/src/widgets/qwidgetresizehandler.cpp b/src/widgets/qwidgetresizehandler.cpp index 2dd5383e6..ff964b12c 100644 --- a/src/widgets/qwidgetresizehandler.cpp +++ b/src/widgets/qwidgetresizehandler.cpp @@ -41,10 +41,10 @@ #include "qwidgetresizehandler_p.h" #ifndef QT_NO_RESIZEHANDLER -#include "qframe.h" -#include "qapplication.h" -#include "qcursor.h" -#include "qsizegrip.h" +#include "ntqframe.h" +#include "ntqapplication.h" +#include "ntqcursor.h" +#include "ntqsizegrip.h" #if defined(Q_WS_WIN) #include "qt_windows.h" #endif diff --git a/src/widgets/qwidgetresizehandler_p.h b/src/widgets/qwidgetresizehandler_p.h index 676b53658..395e3d1eb 100644 --- a/src/widgets/qwidgetresizehandler_p.h +++ b/src/widgets/qwidgetresizehandler_p.h @@ -54,7 +54,7 @@ // #ifndef QT_H -#include "qobject.h" +#include "ntqobject.h" #endif // QT_H #ifndef QT_NO_RESIZEHANDLER class TQMouseEvent; diff --git a/src/widgets/qwidgetstack.cpp b/src/widgets/qwidgetstack.cpp index 72d9e1e1a..9b80a2fdb 100644 --- a/src/widgets/qwidgetstack.cpp +++ b/src/widgets/qwidgetstack.cpp @@ -38,17 +38,17 @@ ** **********************************************************************/ -#include "qwidgetstack.h" -#include "qlayout.h" +#include "ntqwidgetstack.h" +#include "ntqlayout.h" #include "../kernel/qlayoutengine_p.h" #ifndef QT_NO_WIDGETSTACK -#include "qobjectlist.h" -#include "qfocusdata.h" -#include "qbutton.h" -#include "qbuttongroup.h" +#include "ntqobjectlist.h" +#include "ntqfocusdata.h" +#include "ntqbutton.h" +#include "ntqbuttongroup.h" -#include "qapplication.h" +#include "ntqapplication.h" class TQWidgetStackPrivate { public: diff --git a/src/widgets/qwidgetstack.h b/src/widgets/qwidgetstack.h deleted file mode 100644 index 466ce2cb3..000000000 --- a/src/widgets/qwidgetstack.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Definition of TQWidgetStack class -** -** Created : 980306 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWIDGETSTACK_H -#define TQWIDGETSTACK_H - -#ifndef QT_H -#include "qframe.h" -#include "qintdict.h" -#include "qptrdict.h" -#endif // QT_H - -#ifndef QT_NO_WIDGETSTACK - - -class TQWidgetStackPrivate; - - -class Q_EXPORT TQWidgetStack: public TQFrame -{ - Q_OBJECT -public: - TQWidgetStack( TQWidget* parent=0, const char* name=0 ); - TQWidgetStack( TQWidget* parent, const char* name, WFlags f); - - ~TQWidgetStack(); - - int addWidget( TQWidget *, 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: - void init(); - - TQWidgetStackPrivate * d; - TQIntDict * dict; - TQPtrDict * focusWidgets; - TQWidget * topWidget; - TQWidget * invisible; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQWidgetStack( const TQWidgetStack & ); - TQWidgetStack& operator=( const TQWidgetStack & ); -#endif -}; - -#endif // QT_NO_WIDGETSTACK - -#endif // TQWIDGETSTACK_H diff --git a/src/workspace/ntqworkspace.h b/src/workspace/ntqworkspace.h new file mode 100644 index 000000000..7a29e975d --- /dev/null +++ b/src/workspace/ntqworkspace.h @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** Definition of the TQWorkspace class +** +** Created : 990210 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the workspace module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQWORKSPACE_H +#define TQWORKSPACE_H + +#ifndef QT_H +#include "ntqwidget.h" +#include "ntqwidgetlist.h" +#endif // QT_H + +#ifndef QT_NO_WORKSPACE + +#if !defined( QT_MODULE_WORKSPACE ) || defined( QT_INTERNAL_WORKSPACE ) +#define TQM_EXPORT_WORKSPACE +#else +#define TQM_EXPORT_WORKSPACE Q_EXPORT +#endif + +class TQWorkspaceChild; +class TQShowEvent; +class TQWorkspacePrivate; +class TQPopupMenu; +class TQDockWindow; + +class TQM_EXPORT_WORKSPACE TQWorkspace : public TQWidget +{ + Q_OBJECT + Q_PROPERTY( bool scrollBarsEnabled READ scrollBarsEnabled WRITE setScrollBarsEnabled ) + +#ifdef QT_WORKSPACE_WINDOWMODE +public: +#endif + enum WindowMode { TopLevel, MDI, AutoDetect }; + WindowMode windowMode() const; +#ifdef QT_WORKSPACE_WINDOWMODE +private: +#endif + +public: +#ifdef QT_WORKSPACE_WINDOWMODE + TQWorkspace( WindowMode mode, TQWidget* parent=0, const char* name=0 ); +#endif + TQWorkspace( TQWidget* parent=0, const char* name=0 ); + + ~TQWorkspace(); + + enum WindowOrder { CreationOrder, StackingOrder }; + + TQWidget* activeWindow() const; + TQWidgetList windowList() const; // ### merge with below in 4.0 + TQWidgetList windowList( WindowOrder order ) const; + + TQSize sizeHint() const; + + bool scrollBarsEnabled() const; + void setScrollBarsEnabled( bool enable ); + + void setPaletteBackgroundColor( const TQColor & ); + void setPaletteBackgroundPixmap( const TQPixmap & ); + +signals: + void windowActivated( TQWidget* w); + +public slots: + void cascade(); + void tile(); + void closeActiveWindow(); + void closeAllWindows(); + void activateNextWindow(); + void activatePrevWindow(); + +protected: +#ifndef QT_NO_STYLE + void styleChange( TQStyle& ); +#endif + void childEvent( TQChildEvent * ); + void resizeEvent( TQResizeEvent * ); + bool eventFilter( TQObject *, TQEvent * ); + void showEvent( TQShowEvent *e ); + void hideEvent( TQHideEvent *e ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( TQWheelEvent *e ); +#endif + +private slots: + void normalizeActiveWindow(); + void minimizeActiveWindow(); + void showOperationMenu(); + void popupOperationMenu( const TQPoint& ); + void operationMenuActivated( int ); + void operationMenuAboutToShow(); + void toolMenuAboutToShow(); + void activatePreviousWindow(); // ### remove in TQt 4.0 + void dockWindowsShow(); + void scrollBarChanged(); + +private: + void init(); + void handleUndock( TQDockWindow* w); + void insertIcon( TQWidget* w); + void removeIcon( TQWidget* w); + void place( TQWidget* ); + + TQWorkspaceChild* findChild( TQWidget* w); + void showMaximizeControls(); + void hideMaximizeControls(); + void activateWindow( TQWidget* w, bool change_focus = TRUE ); + void showWindow( TQWidget* w); + void maximizeWindow( TQWidget* w); + void minimizeWindow( TQWidget* w); + void normalizeWindow( TQWidget* w); + + TQRect updateWorkspace(); + + TQPopupMenu* popup; + TQWorkspacePrivate* d; + + friend class TQWorkspacePrivate; + friend class TQWorkspaceChild; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + TQWorkspace( const TQWorkspace & ); + TQWorkspace& operator=( const TQWorkspace & ); +#endif +}; + + +#endif // QT_NO_WORKSPACE + +#endif // TQWORKSPACE_H diff --git a/src/workspace/qt_workspace.pri b/src/workspace/qt_workspace.pri index d5d4288d7..629d27aee 100644 --- a/src/workspace/qt_workspace.pri +++ b/src/workspace/qt_workspace.pri @@ -1,6 +1,6 @@ # Qt workspace module workspace { - HEADERS += $$WORKSPACE_H/qworkspace.h + HEADERS += $$WORKSPACE_H/ntqworkspace.h SOURCES += $$WORKSPACE_CPP/qworkspace.cpp } diff --git a/src/workspace/qworkspace.cpp b/src/workspace/qworkspace.cpp index e11d5cc35..d37f25737 100644 --- a/src/workspace/qworkspace.cpp +++ b/src/workspace/qworkspace.cpp @@ -38,44 +38,44 @@ ** **********************************************************************/ -#include "qworkspace.h" +#include "ntqworkspace.h" #ifndef QT_NO_WORKSPACE -#include "qapplication.h" +#include "ntqapplication.h" #include "../widgets/qtitlebar_p.h" -#include "qobjectlist.h" -#include "qlayout.h" -#include "qtoolbutton.h" -#include "qlabel.h" -#include "qvbox.h" -#include "qaccel.h" -#include "qcursor.h" -#include "qpopupmenu.h" -#include "qmenubar.h" -#include "qguardedptr.h" -#include "qiconset.h" +#include "ntqobjectlist.h" +#include "ntqlayout.h" +#include "ntqtoolbutton.h" +#include "ntqlabel.h" +#include "ntqvbox.h" +#include "ntqaccel.h" +#include "ntqcursor.h" +#include "ntqpopupmenu.h" +#include "ntqmenubar.h" +#include "ntqguardedptr.h" +#include "ntqiconset.h" #include "../widgets/qwidgetresizehandler_p.h" -#include "qfocusdata.h" -#include "qdatetime.h" -#include "qtooltip.h" -#include "qwmatrix.h" -#include "qimage.h" -#include "qscrollbar.h" -#include "qstyle.h" -#include "qbitmap.h" +#include "ntqfocusdata.h" +#include "ntqdatetime.h" +#include "ntqtooltip.h" +#include "ntqwmatrix.h" +#include "ntqimage.h" +#include "ntqscrollbar.h" +#include "ntqstyle.h" +#include "ntqbitmap.h" // magic non-mdi things -#include "qtimer.h" -#include "qdockarea.h" -#include "qstatusbar.h" -#include "qmainwindow.h" -#include "qdockwindow.h" -#include "qtoolbar.h" +#include "ntqtimer.h" +#include "ntqdockarea.h" +#include "ntqstatusbar.h" +#include "ntqmainwindow.h" +#include "ntqdockwindow.h" +#include "ntqtoolbar.h" #define BUTTON_WIDTH 16 #define BUTTON_HEIGHT 14 /*! - \class TQWorkspace qworkspace.h + \class TQWorkspace ntqworkspace.h \brief The TQWorkspace widget provides a workspace window that can contain decorated windows, e.g. for MDI. diff --git a/src/workspace/qworkspace.h b/src/workspace/qworkspace.h deleted file mode 100644 index 96cc83ff2..000000000 --- a/src/workspace/qworkspace.h +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** -** -** Definition of the TQWorkspace class -** -** Created : 990210 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the workspace module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQWORKSPACE_H -#define TQWORKSPACE_H - -#ifndef QT_H -#include "qwidget.h" -#include "qwidgetlist.h" -#endif // QT_H - -#ifndef QT_NO_WORKSPACE - -#if !defined( QT_MODULE_WORKSPACE ) || defined( QT_INTERNAL_WORKSPACE ) -#define TQM_EXPORT_WORKSPACE -#else -#define TQM_EXPORT_WORKSPACE Q_EXPORT -#endif - -class TQWorkspaceChild; -class TQShowEvent; -class TQWorkspacePrivate; -class TQPopupMenu; -class TQDockWindow; - -class TQM_EXPORT_WORKSPACE TQWorkspace : public TQWidget -{ - Q_OBJECT - Q_PROPERTY( bool scrollBarsEnabled READ scrollBarsEnabled WRITE setScrollBarsEnabled ) - -#ifdef QT_WORKSPACE_WINDOWMODE -public: -#endif - enum WindowMode { TopLevel, MDI, AutoDetect }; - WindowMode windowMode() const; -#ifdef QT_WORKSPACE_WINDOWMODE -private: -#endif - -public: -#ifdef QT_WORKSPACE_WINDOWMODE - TQWorkspace( WindowMode mode, TQWidget* parent=0, const char* name=0 ); -#endif - TQWorkspace( TQWidget* parent=0, const char* name=0 ); - - ~TQWorkspace(); - - enum WindowOrder { CreationOrder, StackingOrder }; - - TQWidget* activeWindow() const; - TQWidgetList windowList() const; // ### merge with below in 4.0 - TQWidgetList windowList( WindowOrder order ) const; - - TQSize sizeHint() const; - - bool scrollBarsEnabled() const; - void setScrollBarsEnabled( bool enable ); - - void setPaletteBackgroundColor( const TQColor & ); - void setPaletteBackgroundPixmap( const TQPixmap & ); - -signals: - void windowActivated( TQWidget* w); - -public slots: - void cascade(); - void tile(); - void closeActiveWindow(); - void closeAllWindows(); - void activateNextWindow(); - void activatePrevWindow(); - -protected: -#ifndef QT_NO_STYLE - void styleChange( TQStyle& ); -#endif - void childEvent( TQChildEvent * ); - void resizeEvent( TQResizeEvent * ); - bool eventFilter( TQObject *, TQEvent * ); - void showEvent( TQShowEvent *e ); - void hideEvent( TQHideEvent *e ); -#ifndef QT_NO_WHEELEVENT - void wheelEvent( TQWheelEvent *e ); -#endif - -private slots: - void normalizeActiveWindow(); - void minimizeActiveWindow(); - void showOperationMenu(); - void popupOperationMenu( const TQPoint& ); - void operationMenuActivated( int ); - void operationMenuAboutToShow(); - void toolMenuAboutToShow(); - void activatePreviousWindow(); // ### remove in TQt 4.0 - void dockWindowsShow(); - void scrollBarChanged(); - -private: - void init(); - void handleUndock( TQDockWindow* w); - void insertIcon( TQWidget* w); - void removeIcon( TQWidget* w); - void place( TQWidget* ); - - TQWorkspaceChild* findChild( TQWidget* w); - void showMaximizeControls(); - void hideMaximizeControls(); - void activateWindow( TQWidget* w, bool change_focus = TRUE ); - void showWindow( TQWidget* w); - void maximizeWindow( TQWidget* w); - void minimizeWindow( TQWidget* w); - void normalizeWindow( TQWidget* w); - - TQRect updateWorkspace(); - - TQPopupMenu* popup; - TQWorkspacePrivate* d; - - friend class TQWorkspacePrivate; - friend class TQWorkspaceChild; - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - TQWorkspace( const TQWorkspace & ); - TQWorkspace& operator=( const TQWorkspace & ); -#endif -}; - - -#endif // QT_NO_WORKSPACE - -#endif // TQWORKSPACE_H diff --git a/src/xml/ntqdom.h b/src/xml/ntqdom.h new file mode 100644 index 000000000..47d11b181 --- /dev/null +++ b/src/xml/ntqdom.h @@ -0,0 +1,677 @@ +/**************************************************************************** +** +** Definition of TQDomDocument and related classes. +** +** Created : 000518 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the xml module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDOM_H +#define TQDOM_H + +#ifndef QT_H +#include "ntqstring.h" +#endif // QT_H + +#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) +#define TQM_EXPORT_DOM +#else +#define TQM_EXPORT_DOM Q_EXPORT +#endif + +#ifndef QT_NO_DOM + +class TQIODevice; +class TQTextStream; + +class TQXmlInputSource; +class TQXmlReader; + +class TQDomDocumentPrivate; +class TQDomDocumentTypePrivate; +class TQDomDocumentFragmentPrivate; +class TQDomNodePrivate; +class TQDomNodeListPrivate; +class TQDomImplementationPrivate; +class TQDomElementPrivate; +class TQDomNotationPrivate; +class TQDomEntityPrivate; +class TQDomEntityReferencePrivate; +class TQDomProcessingInstructionPrivate; +class TQDomAttrPrivate; +class TQDomCharacterDataPrivate; +class TQDomTextPrivate; +class TQDomCommentPrivate; +class TQDomCDATASectionPrivate; +class TQDomNamedNodeMapPrivate; +class TQDomImplementationPrivate; + +class TQDomNodeList; +class TQDomElement; +class TQDomText; +class TQDomComment; +class TQDomCDATASection; +class TQDomProcessingInstruction; +class TQDomAttr; +class TQDomEntityReference; +class TQDomDocument; +class TQDomNamedNodeMap; +class TQDomDocument; +class TQDomDocumentFragment; +class TQDomDocumentType; +class TQDomImplementation; +class TQDomNode; +class TQDomEntity; +class TQDomNotation; +class TQDomCharacterData; + +class TQM_EXPORT_DOM TQDomImplementation +{ +public: + TQDomImplementation(); + TQDomImplementation( const TQDomImplementation& ); + virtual ~TQDomImplementation(); + TQDomImplementation& operator= ( const TQDomImplementation& ); + bool operator== ( const TQDomImplementation& ) const; + bool operator!= ( const TQDomImplementation& ) const; + + // functions + virtual bool hasFeature( const TQString& feature, const TQString& version ); + virtual TQDomDocumentType createDocumentType( const TQString& qName, const TQString& publicId, const TQString& systemId ); + virtual TQDomDocument createDocument( const TQString& nsURI, const TQString& qName, const TQDomDocumentType& doctype ); + + // TQt extension + bool isNull(); + +private: + TQDomImplementationPrivate* impl; + TQDomImplementation( TQDomImplementationPrivate* ); + + friend class TQDomDocument; +}; + +class TQM_EXPORT_DOM TQDomNode +{ +public: + enum NodeType { + ElementNode = 1, + AttributeNode = 2, + TextNode = 3, + CDATASectionNode = 4, + EntityReferenceNode = 5, + EntityNode = 6, + ProcessingInstructionNode = 7, + CommentNode = 8, + DocumentNode = 9, + DocumentTypeNode = 10, + DocumentFragmentNode = 11, + NotationNode = 12, + BaseNode = 21,// this is not in the standard + CharacterDataNode = 22 // this is not in the standard + }; + + TQDomNode(); + TQDomNode( const TQDomNode& ); + TQDomNode& operator= ( const TQDomNode& ); + bool operator== ( const TQDomNode& ) const; + bool operator!= ( const TQDomNode& ) const; + virtual ~TQDomNode(); + + // DOM functions + virtual TQDomNode insertBefore( const TQDomNode& newChild, const TQDomNode& refChild ); + virtual TQDomNode insertAfter( const TQDomNode& newChild, const TQDomNode& refChild ); + virtual TQDomNode replaceChild( const TQDomNode& newChild, const TQDomNode& oldChild ); + virtual TQDomNode removeChild( const TQDomNode& oldChild ); + virtual TQDomNode appendChild( const TQDomNode& newChild ); + virtual bool hasChildNodes() const; + virtual TQDomNode cloneNode( bool deep = TRUE ) const; + virtual void normalize(); + virtual bool isSupported( const TQString& feature, const TQString& version ) const; + + // DOM read only attributes + virtual TQString nodeName() const; + virtual TQDomNode::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; + + // DOM attributes + virtual TQString nodeValue() const; + virtual void setNodeValue( const TQString& ); + virtual TQString prefix() const; + virtual void setPrefix( const TQString& pre ); + + // TQt extensions + 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; + + /** + * Shortcut to avoid dealing with TQDomNodeList + * all the time. + */ + TQDomNode namedItem( const TQString& name ) 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; + +protected: + TQDomNodePrivate* impl; + TQDomNode( TQDomNodePrivate* ); + +private: + friend class TQDomDocument; + friend class TQDomDocumentType; + friend class TQDomNodeList; + friend class TQDomNamedNodeMap; +}; + +class TQM_EXPORT_DOM TQDomNodeList +{ +public: + TQDomNodeList(); + TQDomNodeList( const TQDomNodeList& ); + TQDomNodeList& operator= ( const TQDomNodeList& ); + bool operator== ( const TQDomNodeList& ) const; + bool operator!= ( const TQDomNodeList& ) const; + virtual ~TQDomNodeList(); + + // DOM functions + virtual TQDomNode item( int index ) const; + + // DOM read only attributes + virtual uint length() const; + uint count() const { return length(); } // TQt API consitancy + +private: + TQDomNodeListPrivate* impl; + TQDomNodeList( TQDomNodeListPrivate* ); + + friend class TQDomNode; + friend class TQDomElement; + friend class TQDomDocument; +}; + +class TQM_EXPORT_DOM TQDomDocumentType : public TQDomNode +{ +public: + TQDomDocumentType(); + TQDomDocumentType( const TQDomDocumentType& x ); + TQDomDocumentType& operator= ( const TQDomDocumentType& ); + ~TQDomDocumentType(); + + // DOM read only attributes + virtual TQString name() const; + virtual TQDomNamedNodeMap entities() const; + virtual TQDomNamedNodeMap notations() const; + virtual TQString publicId() const; + virtual TQString systemId() const; + virtual TQString internalSubset() const; + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isDocumentType() const; + +private: + TQDomDocumentType( TQDomDocumentTypePrivate* ); + + friend class TQDomImplementation; + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomDocument : public TQDomNode +{ +public: + TQDomDocument(); + Q_EXPLICIT TQDomDocument( const TQString& name ); + Q_EXPLICIT TQDomDocument( const TQDomDocumentType& doctype ); + TQDomDocument( const TQDomDocument& x ); + TQDomDocument& operator= ( const TQDomDocument& ); + ~TQDomDocument(); + + // DOM functions + TQDomElement createElement( const TQString& tagName ); + TQDomDocumentFragment createDocumentFragment(); + TQDomText createTextNode( const TQString& data ); + TQDomComment createComment( const TQString& data ); + TQDomCDATASection createCDATASection( const TQString& data ); + TQDomProcessingInstruction createProcessingInstruction( const TQString& target, const TQString& data ); + TQDomAttr createAttribute( const TQString& name ); + TQDomEntityReference createEntityReference( const TQString& name ); + TQDomNodeList elementsByTagName( const TQString& tagname ) const; + TQDomNode importNode( const TQDomNode& importedNode, bool deep ); + TQDomElement createElementNS( const TQString& nsURI, const TQString& qName ); + TQDomAttr createAttributeNS( const TQString& nsURI, const TQString& qName ); + TQDomNodeList elementsByTagNameNS( const TQString& nsURI, const TQString& localName ); + TQDomElement elementById( const TQString& elementId ); + + // DOM read only attributes + TQDomDocumentType doctype() const; + TQDomImplementation implementation() const; + TQDomElement documentElement() const; + + // TQt extensions + bool setContent( const TQCString& text, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( const TQByteArray& text, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( const TQString& text, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( TQIODevice* dev, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( const TQCString& text, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( const TQByteArray& text, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( const TQString& text, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + bool setContent( TQIODevice* dev, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + + bool setContent( TQXmlInputSource *source, TQXmlReader *reader, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isDocument() const; + + // TQt extensions + TQString toString() const; // ### TQt 4: merge the two overloads + TQString toString( int ) const; + TQCString toCString() const; // ### TQt 4: merge the two overloads + TQCString toCString( int ) const; + +private: + TQDomDocument( TQDomDocumentPrivate* ); + + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomNamedNodeMap +{ +public: + TQDomNamedNodeMap(); + TQDomNamedNodeMap( const TQDomNamedNodeMap& ); + TQDomNamedNodeMap& operator= ( const TQDomNamedNodeMap& ); + bool operator== ( const TQDomNamedNodeMap& ) const; + bool operator!= ( const TQDomNamedNodeMap& ) const; + ~TQDomNamedNodeMap(); + + // DOM functions + TQDomNode namedItem( const TQString& name ) const; + TQDomNode setNamedItem( const TQDomNode& newNode ); + TQDomNode removeNamedItem( const TQString& name ); + TQDomNode item( int index ) const; + TQDomNode namedItemNS( const TQString& nsURI, const TQString& localName ) const; + TQDomNode setNamedItemNS( const TQDomNode& newNode ); + TQDomNode removeNamedItemNS( const TQString& nsURI, const TQString& localName ); + + // DOM read only attributes + uint length() const; + uint count() const { return length(); } // TQt API consitancy + + // TQt extension + bool contains( const TQString& name ) const; + +private: + TQDomNamedNodeMapPrivate* impl; + TQDomNamedNodeMap( TQDomNamedNodeMapPrivate* ); + + friend class TQDomNode; + friend class TQDomDocumentType; + friend class TQDomElement; +}; + +class TQM_EXPORT_DOM TQDomDocumentFragment : public TQDomNode +{ +public: + TQDomDocumentFragment(); + TQDomDocumentFragment( const TQDomDocumentFragment& x ); + TQDomDocumentFragment& operator= ( const TQDomDocumentFragment& ); + ~TQDomDocumentFragment(); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isDocumentFragment() const; + +private: + TQDomDocumentFragment( TQDomDocumentFragmentPrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomCharacterData : public TQDomNode +{ +public: + TQDomCharacterData(); + TQDomCharacterData( const TQDomCharacterData& x ); + TQDomCharacterData& operator= ( const TQDomCharacterData& ); + ~TQDomCharacterData(); + + // DOM functions + virtual TQString substringData( unsigned long offset, unsigned long count ); + virtual void appendData( const TQString& arg ); + virtual void insertData( unsigned long offset, const TQString& arg ); + virtual void deleteData( unsigned long offset, unsigned long count ); + virtual void replaceData( unsigned long offset, unsigned long count, const TQString& arg ); + + // DOM read only attributes + virtual uint length() const; + + // DOM attributes + virtual TQString data() const; + virtual void setData( const TQString& ); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isCharacterData() const; + +private: + TQDomCharacterData( TQDomCharacterDataPrivate* ); + + friend class TQDomDocument; + friend class TQDomText; + friend class TQDomComment; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomAttr : public TQDomNode +{ +public: + TQDomAttr(); + TQDomAttr( const TQDomAttr& x ); + TQDomAttr& operator= ( const TQDomAttr& ); + ~TQDomAttr(); + + // DOM read only attributes + virtual TQString name() const; + virtual bool specified() const; + virtual TQDomElement ownerElement() const; + + // DOM attributes + virtual TQString value() const; + virtual void setValue( const TQString& ); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isAttr() const; + +private: + TQDomAttr( TQDomAttrPrivate* ); + + friend class TQDomDocument; + friend class TQDomElement; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomElement : public TQDomNode +{ +public: + TQDomElement(); + TQDomElement( const TQDomElement& x ); + TQDomElement& operator= ( const TQDomElement& ); + ~TQDomElement(); + + // DOM functions + TQString attribute( const TQString& name, const TQString& defValue = TQString::null ) const; + void setAttribute( const TQString& name, const TQString& value ); + void setAttribute( const TQString& name, int value ); + void setAttribute( const TQString& name, uint value ); + void setAttribute( const TQString& name, long value ); + void setAttribute( const TQString& name, ulong value ); + void setAttribute( const TQString& name, double value ); + void removeAttribute( const TQString& name ); + TQDomAttr attributeNode( const TQString& name); + TQDomAttr setAttributeNode( const TQDomAttr& newAttr ); + TQDomAttr removeAttributeNode( const TQDomAttr& oldAttr ); + virtual TQDomNodeList elementsByTagName( const TQString& tagname ) const; + bool hasAttribute( const TQString& name ) const; + + TQString attributeNS( const TQString nsURI, const TQString& localName, const TQString& defValue ) const; + void setAttributeNS( const TQString nsURI, const TQString& qName, const TQString& value ); + void setAttributeNS( const TQString nsURI, const TQString& qName, int value ); + void setAttributeNS( const TQString nsURI, const TQString& qName, uint value ); + void setAttributeNS( const TQString nsURI, const TQString& qName, long value ); + void setAttributeNS( const TQString nsURI, const TQString& qName, ulong value ); + void setAttributeNS( const TQString nsURI, const TQString& qName, double value ); + void removeAttributeNS( const TQString& nsURI, const TQString& localName ); + TQDomAttr attributeNodeNS( const TQString& nsURI, const TQString& localName ); + TQDomAttr setAttributeNodeNS( const TQDomAttr& newAttr ); + virtual TQDomNodeList elementsByTagNameNS( const TQString& nsURI, const TQString& localName ) const; + bool hasAttributeNS( const TQString& nsURI, const TQString& localName ) const; + + // DOM read only attributes + TQString tagName() const; + void setTagName( const TQString& name ); // TQt extension + + // Reimplemented from TQDomNode + TQDomNamedNodeMap attributes() const; + TQDomNode::NodeType nodeType() const; + bool isElement() const; + + TQString text() const; + +private: + TQDomElement( TQDomElementPrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; + friend class TQDomAttr; +}; + +class TQM_EXPORT_DOM TQDomText : public TQDomCharacterData +{ +public: + TQDomText(); + TQDomText( const TQDomText& x ); + TQDomText& operator= ( const TQDomText& ); + ~TQDomText(); + + // DOM functions + TQDomText splitText( int offset ); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isText() const; + +private: + TQDomText( TQDomTextPrivate* ); + + friend class TQDomCDATASection; + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomComment : public TQDomCharacterData +{ +public: + TQDomComment(); + TQDomComment( const TQDomComment& x ); + TQDomComment& operator= ( const TQDomComment& ); + ~TQDomComment(); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isComment() const; + +private: + TQDomComment( TQDomCommentPrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomCDATASection : public TQDomText +{ +public: + TQDomCDATASection(); + TQDomCDATASection( const TQDomCDATASection& x ); + TQDomCDATASection& operator= ( const TQDomCDATASection& ); + ~TQDomCDATASection(); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isCDATASection() const; + +private: + TQDomCDATASection( TQDomCDATASectionPrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomNotation : public TQDomNode +{ +public: + TQDomNotation(); + TQDomNotation( const TQDomNotation& x ); + TQDomNotation& operator= ( const TQDomNotation& ); + ~TQDomNotation(); + + // DOM read only attributes + TQString publicId() const; + TQString systemId() const; + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isNotation() const; + +private: + TQDomNotation( TQDomNotationPrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomEntity : public TQDomNode +{ +public: + TQDomEntity(); + TQDomEntity( const TQDomEntity& x ); + TQDomEntity& operator= ( const TQDomEntity& ); + ~TQDomEntity(); + + // DOM read only attributes + virtual TQString publicId() const; + virtual TQString systemId() const; + virtual TQString notationName() const; + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isEntity() const; + +private: + TQDomEntity( TQDomEntityPrivate* ); + + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomEntityReference : public TQDomNode +{ +public: + TQDomEntityReference(); + TQDomEntityReference( const TQDomEntityReference& x ); + TQDomEntityReference& operator= ( const TQDomEntityReference& ); + ~TQDomEntityReference(); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isEntityReference() const; + +private: + TQDomEntityReference( TQDomEntityReferencePrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; +}; + +class TQM_EXPORT_DOM TQDomProcessingInstruction : public TQDomNode +{ +public: + TQDomProcessingInstruction(); + TQDomProcessingInstruction( const TQDomProcessingInstruction& x ); + TQDomProcessingInstruction& operator= ( const TQDomProcessingInstruction& ); + ~TQDomProcessingInstruction(); + + // DOM read only attributes + virtual TQString target() const; + + // DOM attributes + virtual TQString data() const; + virtual void setData( const TQString& d ); + + // Reimplemented from TQDomNode + TQDomNode::NodeType nodeType() const; + bool isProcessingInstruction() const; + +private: + TQDomProcessingInstruction( TQDomProcessingInstructionPrivate* ); + + friend class TQDomDocument; + friend class TQDomNode; +}; + + +TQM_EXPORT_DOM TQTextStream& operator<<( TQTextStream&, const TQDomNode& ); + +#endif //QT_NO_DOM +#endif // TQDOM_H diff --git a/src/xml/ntqxml.h b/src/xml/ntqxml.h new file mode 100644 index 000000000..f69147d29 --- /dev/null +++ b/src/xml/ntqxml.h @@ -0,0 +1,531 @@ +/**************************************************************************** +** +** Definition of TQXmlSimpleReader and related classes. +** +** Created : 000518 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the xml module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQXML_H +#define TQXML_H + +#ifndef QT_H +#include "ntqtextstream.h" +#include "ntqfile.h" +#include "ntqstring.h" +#include "ntqstringlist.h" +#include "ntqvaluevector.h" +#endif // QT_H + +#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) +#define TQM_EXPORT_XML +#else +#define TQM_EXPORT_XML Q_EXPORT +#endif + +#ifndef QT_NO_XML + +class TQXmlNamespaceSupport; +class TQXmlAttributes; +class TQXmlContentHandler; +class TQXmlDefaultHandler; +class TQXmlDTDHandler; +class TQXmlEntityResolver; +class TQXmlErrorHandler; +class TQXmlLexicalHandler; +class TQXmlDeclHandler; +class TQXmlInputSource; +class TQXmlLocator; +class TQXmlNamespaceSupport; +class TQXmlParseException; + +class TQXmlReader; +class TQXmlSimpleReader; + +class TQXmlSimpleReaderPrivate; +class TQXmlNamespaceSupportPrivate; +class TQXmlAttributesPrivate; +class TQXmlInputSourcePrivate; +class TQXmlParseExceptionPrivate; +class TQXmlLocatorPrivate; +class TQXmlDefaultHandlerPrivate; + + +// +// SAX Namespace Support +// + +class TQM_EXPORT_XML TQXmlNamespaceSupport +{ +public: + TQXmlNamespaceSupport(); + ~TQXmlNamespaceSupport(); + + void setPrefix( const TQString&, const TQString& ); + + TQString prefix( const TQString& ) const; + TQString uri( const TQString& ) const; + void splitName( const TQString&, TQString&, TQString& ) const; + void processName( const TQString&, bool, TQString&, TQString& ) const; + TQStringList prefixes() const; + TQStringList prefixes( const TQString& ) const; + + void pushContext(); + void popContext(); + void reset(); + +private: + TQXmlNamespaceSupportPrivate *d; + + friend class TQXmlSimpleReader; +}; + + +// +// SAX Attributes +// + +class TQM_EXPORT_XML TQXmlAttributes +{ +public: + TQXmlAttributes() {} + virtual ~TQXmlAttributes() {} + + int index( const TQString& qName ) const; + int index( const TQString& uri, const TQString& localPart ) const; + int length() const; + int count() const; + TQString localName( int index ) const; + TQString qName( int index ) const; + TQString uri( int index ) const; + TQString type( int index ) const; + TQString type( const TQString& qName ) const; + TQString type( const TQString& uri, const TQString& localName ) const; + TQString value( int index ) const; + TQString value( const TQString& qName ) const; + TQString value( const TQString& uri, const TQString& localName ) const; + + void clear(); + void append( const TQString &qName, const TQString &uri, const TQString &localPart, const TQString &value ); + +private: + TQStringList qnameList; + TQStringList uriList; + TQStringList localnameList; + TQStringList valueList; + + TQXmlAttributesPrivate *d; +}; + +// +// SAX Input Source +// + +class TQM_EXPORT_XML TQXmlInputSource +{ +public: + TQXmlInputSource(); + TQXmlInputSource( TQIODevice *dev ); + TQXmlInputSource( TQFile& file ); // obsolete + TQXmlInputSource( TQTextStream& stream ); // obsolete + virtual ~TQXmlInputSource(); + + virtual void setData( const TQString& dat ); + virtual void setData( const TQByteArray& dat ); + virtual void fetchData(); + virtual TQString data(); + virtual TQChar next(); + virtual void reset(); + + static const TQChar EndOfData; + static const TQChar EndOfDocument; + +protected: + virtual TQString fromRawData( const TQByteArray &data, bool beginning = FALSE ); + +private: + void init(); + + TQIODevice *inputDevice; + TQTextStream *inputStream; + + TQString str; + const TQChar *unicode; + int pos; + int length; + bool nextReturnedEndOfData; + TQTextDecoder *encMapper; + + TQXmlInputSourcePrivate *d; +}; + +// +// SAX Exception Classes +// + +class TQM_EXPORT_XML TQXmlParseException +{ +public: + TQXmlParseException( const TQString& name="", int c=-1, int l=-1, const TQString& p="", const TQString& s="" ) + : msg( name ), column( c ), line( l ), pub( p ), sys( s ) + { } + + int columnNumber() const; + int lineNumber() const; + TQString publicId() const; + TQString systemId() const; + TQString message() const; + +private: + TQString msg; + int column; + int line; + TQString pub; + TQString sys; + + TQXmlParseExceptionPrivate *d; +}; + + +// +// XML Reader +// + +class TQM_EXPORT_XML TQXmlReader +{ +public: + virtual bool feature( const TQString& name, bool *ok = 0 ) const = 0; + virtual void setFeature( const TQString& name, bool value ) = 0; + virtual bool hasFeature( const TQString& name ) const = 0; + virtual void* property( const TQString& name, bool *ok = 0 ) const = 0; + virtual void setProperty( const TQString& name, void* value ) = 0; + virtual bool hasProperty( const TQString& name ) const = 0; + virtual void setEntityResolver( TQXmlEntityResolver* handler ) = 0; + virtual TQXmlEntityResolver* entityResolver() const = 0; + virtual void setDTDHandler( TQXmlDTDHandler* handler ) = 0; + virtual TQXmlDTDHandler* DTDHandler() const = 0; + virtual void setContentHandler( TQXmlContentHandler* handler ) = 0; + virtual TQXmlContentHandler* contentHandler() const = 0; + virtual void setErrorHandler( TQXmlErrorHandler* handler ) = 0; + virtual TQXmlErrorHandler* errorHandler() const = 0; + virtual void setLexicalHandler( TQXmlLexicalHandler* handler ) = 0; + virtual TQXmlLexicalHandler* lexicalHandler() const = 0; + virtual void setDeclHandler( TQXmlDeclHandler* handler ) = 0; + virtual TQXmlDeclHandler* declHandler() const = 0; + virtual bool parse( const TQXmlInputSource& input ) = 0; + virtual bool parse( const TQXmlInputSource* input ) = 0; +}; + +class TQM_EXPORT_XML TQXmlSimpleReader : public TQXmlReader +{ +public: + TQXmlSimpleReader(); + virtual ~TQXmlSimpleReader(); + + bool feature( const TQString& name, bool *ok = 0 ) const; + void setFeature( const TQString& name, bool value ); + bool hasFeature( const TQString& name ) const; + + void* property( const TQString& name, bool *ok = 0 ) const; + void setProperty( const TQString& name, void* value ); + bool hasProperty( const TQString& name ) const; + + void setEntityResolver( TQXmlEntityResolver* handler ); + TQXmlEntityResolver* entityResolver() const; + void setDTDHandler( TQXmlDTDHandler* handler ); + TQXmlDTDHandler* DTDHandler() const; + void setContentHandler( TQXmlContentHandler* handler ); + TQXmlContentHandler* contentHandler() const; + void setErrorHandler( TQXmlErrorHandler* handler ); + TQXmlErrorHandler* errorHandler() const; + void setLexicalHandler( TQXmlLexicalHandler* handler ); + TQXmlLexicalHandler* lexicalHandler() const; + void setDeclHandler( TQXmlDeclHandler* handler ); + TQXmlDeclHandler* declHandler() const; + + bool parse( const TQXmlInputSource& input ); + bool parse( const TQXmlInputSource* input ); + virtual bool parse( const TQXmlInputSource* input, bool incremental ); + virtual bool parseContinue(); + +private: + // variables + TQXmlContentHandler *contentHnd; + TQXmlErrorHandler *errorHnd; + TQXmlDTDHandler *dtdHnd; + TQXmlEntityResolver *entityRes; + TQXmlLexicalHandler *lexicalHnd; + TQXmlDeclHandler *declHnd; + + TQXmlInputSource *inputSource; + + TQChar c; // the character at reading position + int lineNr; // number of line + int columnNr; // position in line + + int nameArrayPos; + TQChar nameArray[256]; // only used for names + TQString nameValue; // only used for names + int refArrayPos; + TQChar refArray[256]; // only used for references + TQString refValue; // only used for references + int stringArrayPos; + TQChar stringArray[256]; // used for any other strings that are parsed + TQString stringValue; // used for any other strings that are parsed + + TQXmlSimpleReaderPrivate* d; + + const TQString &string(); + void stringClear(); + inline void stringAddC() { stringAddC(c); } + void stringAddC(const TQChar&); + const TQString& name(); + void nameClear(); + inline void nameAddC() { nameAddC(c); } + void nameAddC(const TQChar&); + const TQString& ref(); + void refClear(); + inline void refAddC() { refAddC(c); } + void refAddC(const TQChar&); + + // used by parseReference() and parsePEReference() + enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; + + // private functions + bool eat_ws(); + bool next_eat_ws(); + + void next(); + bool atEnd(); + + void init( const TQXmlInputSource* i ); + void initData(); + + bool entityExist( const TQString& ) const; + + bool parseBeginOrContinue( int state, bool incremental ); + + bool parseProlog(); + bool parseElement(); + bool processElementEmptyTag(); + bool processElementETagBegin2(); + bool processElementAttribute(); + bool parseMisc(); + bool parseContent(); + + bool parsePI(); + bool parseDoctype(); + bool parseComment(); + + bool parseName(); + bool parseNmtoken(); + bool parseAttribute(); + bool parseReference(); + bool processReference(); + + bool parseExternalID(); + bool parsePEReference(); + bool parseMarkupdecl(); + bool parseAttlistDecl(); + bool parseAttType(); + bool parseAttValue(); + bool parseElementDecl(); + bool parseNotationDecl(); + bool parseChoiceSeq(); + bool parseEntityDecl(); + bool parseEntityValue(); + + bool parseString(); + + bool insertXmlRef( const TQString&, const TQString&, bool ); + + bool reportEndEntities(); + void reportParseError( const TQString& error ); + + typedef bool (TQXmlSimpleReader::*ParseFunction) (); + void unexpectedEof( ParseFunction where, int state ); + void parseFailed( ParseFunction where, int state ); + void pushParseState( ParseFunction function, int state ); + + void setUndefEntityInAttrHack(bool b); + + friend class TQXmlSimpleReaderPrivate; + friend class TQXmlSimpleReaderLocator; + friend class TQDomDocumentPrivate; +}; + +// +// SAX Locator +// + +class TQM_EXPORT_XML TQXmlLocator +{ +public: + TQXmlLocator(); + virtual ~TQXmlLocator(); + + virtual int columnNumber() = 0; + virtual int lineNumber() = 0; +// TQString getPublicId() +// TQString getSystemId() +}; + +// +// SAX handler classes +// + +class TQM_EXPORT_XML TQXmlContentHandler +{ +public: + virtual void setDocumentLocator( TQXmlLocator* locator ) = 0; + virtual bool startDocument() = 0; + virtual bool endDocument() = 0; + virtual bool startPrefixMapping( const TQString& prefix, const TQString& uri ) = 0; + virtual bool endPrefixMapping( const TQString& prefix ) = 0; + virtual bool startElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName, const TQXmlAttributes& atts ) = 0; + virtual bool endElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName ) = 0; + virtual bool characters( const TQString& ch ) = 0; + virtual bool ignorableWhitespace( const TQString& ch ) = 0; + virtual bool processingInstruction( const TQString& target, const TQString& data ) = 0; + virtual bool skippedEntity( const TQString& name ) = 0; + virtual TQString errorString() = 0; +}; + +class TQM_EXPORT_XML TQXmlErrorHandler +{ +public: + virtual bool warning( const TQXmlParseException& exception ) = 0; + virtual bool error( const TQXmlParseException& exception ) = 0; + virtual bool fatalError( const TQXmlParseException& exception ) = 0; + virtual TQString errorString() = 0; +}; + +class TQM_EXPORT_XML TQXmlDTDHandler +{ +public: + virtual bool notationDecl( const TQString& name, const TQString& publicId, const TQString& systemId ) = 0; + virtual bool unparsedEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId, const TQString& notationName ) = 0; + virtual TQString errorString() = 0; +}; + +class TQM_EXPORT_XML TQXmlEntityResolver +{ +public: + virtual bool resolveEntity( const TQString& publicId, const TQString& systemId, TQXmlInputSource*& ret ) = 0; + virtual TQString errorString() = 0; +}; + +class TQM_EXPORT_XML TQXmlLexicalHandler +{ +public: + virtual bool startDTD( const TQString& name, const TQString& publicId, const TQString& systemId ) = 0; + virtual bool endDTD() = 0; + virtual bool startEntity( const TQString& name ) = 0; + virtual bool endEntity( const TQString& name ) = 0; + virtual bool startCDATA() = 0; + virtual bool endCDATA() = 0; + virtual bool comment( const TQString& ch ) = 0; + virtual TQString errorString() = 0; +}; + +class TQM_EXPORT_XML TQXmlDeclHandler +{ +public: + virtual bool attributeDecl( const TQString& eName, const TQString& aName, const TQString& type, const TQString& valueDefault, const TQString& value ) = 0; + virtual bool internalEntityDecl( const TQString& name, const TQString& value ) = 0; + virtual bool externalEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId ) = 0; + virtual TQString errorString() = 0; +}; + + +class TQM_EXPORT_XML TQXmlDefaultHandler : public TQXmlContentHandler, public TQXmlErrorHandler, public TQXmlDTDHandler, public TQXmlEntityResolver, public TQXmlLexicalHandler, public TQXmlDeclHandler +{ +public: + TQXmlDefaultHandler() { } + virtual ~TQXmlDefaultHandler() { } + + void setDocumentLocator( TQXmlLocator* locator ); + bool startDocument(); + bool endDocument(); + bool startPrefixMapping( const TQString& prefix, const TQString& uri ); + bool endPrefixMapping( const TQString& prefix ); + bool startElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName, const TQXmlAttributes& atts ); + bool endElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName ); + bool characters( const TQString& ch ); + bool ignorableWhitespace( const TQString& ch ); + bool processingInstruction( const TQString& target, const TQString& data ); + bool skippedEntity( const TQString& name ); + + bool warning( const TQXmlParseException& exception ); + bool error( const TQXmlParseException& exception ); + bool fatalError( const TQXmlParseException& exception ); + + bool notationDecl( const TQString& name, const TQString& publicId, const TQString& systemId ); + bool unparsedEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId, const TQString& notationName ); + + bool resolveEntity( const TQString& publicId, const TQString& systemId, TQXmlInputSource*& ret ); + + bool startDTD( const TQString& name, const TQString& publicId, const TQString& systemId ); + bool endDTD(); + bool startEntity( const TQString& name ); + bool endEntity( const TQString& name ); + bool startCDATA(); + bool endCDATA(); + bool comment( const TQString& ch ); + + bool attributeDecl( const TQString& eName, const TQString& aName, const TQString& type, const TQString& valueDefault, const TQString& value ); + bool internalEntityDecl( const TQString& name, const TQString& value ); + bool externalEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId ); + + TQString errorString(); + +private: + TQXmlDefaultHandlerPrivate *d; +}; + + +// +// inlines +// + +inline bool TQXmlSimpleReader::atEnd() +{ return (c.unicode()|0x0001) == 0xffff; } +inline int TQXmlAttributes::count() const +{ return length(); } + + +#endif //QT_NO_XML + +#endif diff --git a/src/xml/qdom.cpp b/src/xml/qdom.cpp index b4d891a97..954321c48 100644 --- a/src/xml/qdom.cpp +++ b/src/xml/qdom.cpp @@ -38,18 +38,18 @@ ** **********************************************************************/ -#include "qdom.h" +#include "ntqdom.h" #ifndef QT_NO_DOM -#include "qxml.h" -#include "qptrlist.h" -#include "qdict.h" -#include "qtextstream.h" -#include "qtextcodec.h" -#include "qiodevice.h" -#include "qregexp.h" -#include "qbuffer.h" +#include "ntqxml.h" +#include "ntqptrlist.h" +#include "ntqdict.h" +#include "ntqtextstream.h" +#include "ntqtextcodec.h" +#include "ntqiodevice.h" +#include "ntqregexp.h" +#include "ntqbuffer.h" /* ### old todo comments -- I don't know if they still apply... @@ -610,7 +610,7 @@ TQDomImplementationPrivate* TQDomImplementationPrivate::clone() **************************************************************/ /*! - \class TQDomImplementation qdom.h + \class TQDomImplementation ntqdom.h \reentrant \brief The TQDomImplementation class provides information about the features of the DOM implementation. @@ -914,7 +914,7 @@ uint TQDomNodeListPrivate::length() const **************************************************************/ /*! - \class TQDomNodeList qdom.h + \class TQDomNodeList ntqdom.h \reentrant \brief The TQDomNodeList class is a list of TQDomNode objects. \if defined(commercial) @@ -1529,7 +1529,7 @@ void TQDomNodePrivate::save( TQTextStream& s, int depth, int indent ) const #define IMPL ((TQDomNodePrivate*)impl) /*! - \class TQDomNode qdom.h + \class TQDomNode ntqdom.h \reentrant \brief The TQDomNode class is the base class for all the nodes in a DOM tree. \if defined(commercial) @@ -2640,7 +2640,7 @@ bool TQDomNamedNodeMapPrivate::containsNS( const TQString& nsURI, const TQString #define IMPL ((TQDomNamedNodeMapPrivate*)impl) /*! - \class TQDomNamedNodeMap qdom.h + \class TQDomNamedNodeMap ntqdom.h \reentrant \brief The TQDomNamedNodeMap class contains a collection of nodes that can be accessed by name. @@ -3056,7 +3056,7 @@ void TQDomDocumentTypePrivate::save( TQTextStream& s, int, int indent ) const #define IMPL ((TQDomDocumentTypePrivate*)impl) /*! - \class TQDomDocumentType qdom.h + \class TQDomDocumentType ntqdom.h \reentrant \brief The TQDomDocumentType class is the representation of the DTD in the document tree. @@ -3253,7 +3253,7 @@ TQDomNodePrivate* TQDomDocumentFragmentPrivate::cloneNode( bool deep) #define IMPL ((TQDomDocumentFragmentPrivate*)impl) /*! - \class TQDomDocumentFragment qdom.h + \class TQDomDocumentFragment ntqdom.h \reentrant \brief The TQDomDocumentFragment class is a tree of TQDomNodes which is not usually a complete TQDomDocument. \if defined(commercial) @@ -3416,7 +3416,7 @@ void TQDomCharacterDataPrivate::appendData( const TQString& arg ) #define IMPL ((TQDomCharacterDataPrivate*)impl) /*! - \class TQDomCharacterData qdom.h + \class TQDomCharacterData ntqdom.h \reentrant \brief The TQDomCharacterData class represents a generic string in the DOM. \if defined(commercial) @@ -3718,7 +3718,7 @@ void TQDomAttrPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomAttrPrivate*)impl) /*! - \class TQDomAttr qdom.h + \class TQDomAttr ntqdom.h \reentrant \brief The TQDomAttr class represents one attribute of a TQDomElement. \if defined(commercial) @@ -4119,7 +4119,7 @@ void TQDomElementPrivate::save( TQTextStream& s, int depth, int indent ) const #define IMPL ((TQDomElementPrivate*)impl) /*! - \class TQDomElement qdom.h + \class TQDomElement ntqdom.h \reentrant \brief The TQDomElement class represents one element in the DOM tree. \if defined(commercial) @@ -4677,7 +4677,7 @@ void TQDomTextPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomTextPrivate*)impl) /*! - \class TQDomText qdom.h + \class TQDomText ntqdom.h \reentrant \brief The TQDomText class represents text data in the parsed XML document. \if defined(commercial) @@ -4821,7 +4821,7 @@ void TQDomCommentPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomCommentPrivate*)impl) /*! - \class TQDomComment qdom.h + \class TQDomComment ntqdom.h \reentrant \brief The TQDomComment class represents an XML comment. \if defined(commercial) @@ -4953,7 +4953,7 @@ void TQDomCDATASectionPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomCDATASectionPrivate*)impl) /*! - \class TQDomCDATASection qdom.h + \class TQDomCDATASection ntqdom.h \reentrant \brief The TQDomCDATASection class represents an XML CDATA section. \if defined(commercial) @@ -5100,7 +5100,7 @@ void TQDomNotationPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomNotationPrivate*)impl) /*! - \class TQDomNotation qdom.h + \class TQDomNotation ntqdom.h \reentrant \brief The TQDomNotation class represents an XML notation. \if defined(commercial) @@ -5313,7 +5313,7 @@ void TQDomEntityPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomEntityPrivate*)impl) /*! - \class TQDomEntity qdom.h + \class TQDomEntity ntqdom.h \reentrant \brief The TQDomEntity class represents an XML entity. \if defined(commercial) @@ -5487,7 +5487,7 @@ void TQDomEntityReferencePrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomEntityReferencePrivate*)impl) /*! - \class TQDomEntityReference qdom.h + \class TQDomEntityReference ntqdom.h \reentrant \brief The TQDomEntityReference class represents an XML entity reference. \if defined(commercial) @@ -5633,7 +5633,7 @@ void TQDomProcessingInstructionPrivate::save( TQTextStream& s, int, int ) const #define IMPL ((TQDomProcessingInstructionPrivate*)impl) /*! - \class TQDomProcessingInstruction qdom.h + \class TQDomProcessingInstruction ntqdom.h \reentrant \brief The TQDomProcessingInstruction class represents an XML processing instruction. @@ -6044,7 +6044,7 @@ void TQDomDocumentPrivate::save( TQTextStream& s, int, int indent ) const #define IMPL ((TQDomDocumentPrivate*)impl) /*! - \class TQDomDocument qdom.h + \class TQDomDocument ntqdom.h \reentrant \brief The TQDomDocument class represents an XML document. \if defined(commercial) diff --git a/src/xml/qdom.h b/src/xml/qdom.h deleted file mode 100644 index 2cd1e3f5d..000000000 --- a/src/xml/qdom.h +++ /dev/null @@ -1,677 +0,0 @@ -/**************************************************************************** -** -** Definition of TQDomDocument and related classes. -** -** Created : 000518 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the xml module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDOM_H -#define TQDOM_H - -#ifndef QT_H -#include "qstring.h" -#endif // QT_H - -#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) -#define TQM_EXPORT_DOM -#else -#define TQM_EXPORT_DOM Q_EXPORT -#endif - -#ifndef QT_NO_DOM - -class TQIODevice; -class TQTextStream; - -class TQXmlInputSource; -class TQXmlReader; - -class TQDomDocumentPrivate; -class TQDomDocumentTypePrivate; -class TQDomDocumentFragmentPrivate; -class TQDomNodePrivate; -class TQDomNodeListPrivate; -class TQDomImplementationPrivate; -class TQDomElementPrivate; -class TQDomNotationPrivate; -class TQDomEntityPrivate; -class TQDomEntityReferencePrivate; -class TQDomProcessingInstructionPrivate; -class TQDomAttrPrivate; -class TQDomCharacterDataPrivate; -class TQDomTextPrivate; -class TQDomCommentPrivate; -class TQDomCDATASectionPrivate; -class TQDomNamedNodeMapPrivate; -class TQDomImplementationPrivate; - -class TQDomNodeList; -class TQDomElement; -class TQDomText; -class TQDomComment; -class TQDomCDATASection; -class TQDomProcessingInstruction; -class TQDomAttr; -class TQDomEntityReference; -class TQDomDocument; -class TQDomNamedNodeMap; -class TQDomDocument; -class TQDomDocumentFragment; -class TQDomDocumentType; -class TQDomImplementation; -class TQDomNode; -class TQDomEntity; -class TQDomNotation; -class TQDomCharacterData; - -class TQM_EXPORT_DOM TQDomImplementation -{ -public: - TQDomImplementation(); - TQDomImplementation( const TQDomImplementation& ); - virtual ~TQDomImplementation(); - TQDomImplementation& operator= ( const TQDomImplementation& ); - bool operator== ( const TQDomImplementation& ) const; - bool operator!= ( const TQDomImplementation& ) const; - - // functions - virtual bool hasFeature( const TQString& feature, const TQString& version ); - virtual TQDomDocumentType createDocumentType( const TQString& qName, const TQString& publicId, const TQString& systemId ); - virtual TQDomDocument createDocument( const TQString& nsURI, const TQString& qName, const TQDomDocumentType& doctype ); - - // TQt extension - bool isNull(); - -private: - TQDomImplementationPrivate* impl; - TQDomImplementation( TQDomImplementationPrivate* ); - - friend class TQDomDocument; -}; - -class TQM_EXPORT_DOM TQDomNode -{ -public: - enum NodeType { - ElementNode = 1, - AttributeNode = 2, - TextNode = 3, - CDATASectionNode = 4, - EntityReferenceNode = 5, - EntityNode = 6, - ProcessingInstructionNode = 7, - CommentNode = 8, - DocumentNode = 9, - DocumentTypeNode = 10, - DocumentFragmentNode = 11, - NotationNode = 12, - BaseNode = 21,// this is not in the standard - CharacterDataNode = 22 // this is not in the standard - }; - - TQDomNode(); - TQDomNode( const TQDomNode& ); - TQDomNode& operator= ( const TQDomNode& ); - bool operator== ( const TQDomNode& ) const; - bool operator!= ( const TQDomNode& ) const; - virtual ~TQDomNode(); - - // DOM functions - virtual TQDomNode insertBefore( const TQDomNode& newChild, const TQDomNode& refChild ); - virtual TQDomNode insertAfter( const TQDomNode& newChild, const TQDomNode& refChild ); - virtual TQDomNode replaceChild( const TQDomNode& newChild, const TQDomNode& oldChild ); - virtual TQDomNode removeChild( const TQDomNode& oldChild ); - virtual TQDomNode appendChild( const TQDomNode& newChild ); - virtual bool hasChildNodes() const; - virtual TQDomNode cloneNode( bool deep = TRUE ) const; - virtual void normalize(); - virtual bool isSupported( const TQString& feature, const TQString& version ) const; - - // DOM read only attributes - virtual TQString nodeName() const; - virtual TQDomNode::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; - - // DOM attributes - virtual TQString nodeValue() const; - virtual void setNodeValue( const TQString& ); - virtual TQString prefix() const; - virtual void setPrefix( const TQString& pre ); - - // TQt extensions - 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; - - /** - * Shortcut to avoid dealing with TQDomNodeList - * all the time. - */ - TQDomNode namedItem( const TQString& name ) 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; - -protected: - TQDomNodePrivate* impl; - TQDomNode( TQDomNodePrivate* ); - -private: - friend class TQDomDocument; - friend class TQDomDocumentType; - friend class TQDomNodeList; - friend class TQDomNamedNodeMap; -}; - -class TQM_EXPORT_DOM TQDomNodeList -{ -public: - TQDomNodeList(); - TQDomNodeList( const TQDomNodeList& ); - TQDomNodeList& operator= ( const TQDomNodeList& ); - bool operator== ( const TQDomNodeList& ) const; - bool operator!= ( const TQDomNodeList& ) const; - virtual ~TQDomNodeList(); - - // DOM functions - virtual TQDomNode item( int index ) const; - - // DOM read only attributes - virtual uint length() const; - uint count() const { return length(); } // TQt API consitancy - -private: - TQDomNodeListPrivate* impl; - TQDomNodeList( TQDomNodeListPrivate* ); - - friend class TQDomNode; - friend class TQDomElement; - friend class TQDomDocument; -}; - -class TQM_EXPORT_DOM TQDomDocumentType : public TQDomNode -{ -public: - TQDomDocumentType(); - TQDomDocumentType( const TQDomDocumentType& x ); - TQDomDocumentType& operator= ( const TQDomDocumentType& ); - ~TQDomDocumentType(); - - // DOM read only attributes - virtual TQString name() const; - virtual TQDomNamedNodeMap entities() const; - virtual TQDomNamedNodeMap notations() const; - virtual TQString publicId() const; - virtual TQString systemId() const; - virtual TQString internalSubset() const; - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isDocumentType() const; - -private: - TQDomDocumentType( TQDomDocumentTypePrivate* ); - - friend class TQDomImplementation; - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomDocument : public TQDomNode -{ -public: - TQDomDocument(); - Q_EXPLICIT TQDomDocument( const TQString& name ); - Q_EXPLICIT TQDomDocument( const TQDomDocumentType& doctype ); - TQDomDocument( const TQDomDocument& x ); - TQDomDocument& operator= ( const TQDomDocument& ); - ~TQDomDocument(); - - // DOM functions - TQDomElement createElement( const TQString& tagName ); - TQDomDocumentFragment createDocumentFragment(); - TQDomText createTextNode( const TQString& data ); - TQDomComment createComment( const TQString& data ); - TQDomCDATASection createCDATASection( const TQString& data ); - TQDomProcessingInstruction createProcessingInstruction( const TQString& target, const TQString& data ); - TQDomAttr createAttribute( const TQString& name ); - TQDomEntityReference createEntityReference( const TQString& name ); - TQDomNodeList elementsByTagName( const TQString& tagname ) const; - TQDomNode importNode( const TQDomNode& importedNode, bool deep ); - TQDomElement createElementNS( const TQString& nsURI, const TQString& qName ); - TQDomAttr createAttributeNS( const TQString& nsURI, const TQString& qName ); - TQDomNodeList elementsByTagNameNS( const TQString& nsURI, const TQString& localName ); - TQDomElement elementById( const TQString& elementId ); - - // DOM read only attributes - TQDomDocumentType doctype() const; - TQDomImplementation implementation() const; - TQDomElement documentElement() const; - - // TQt extensions - bool setContent( const TQCString& text, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( const TQByteArray& text, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( const TQString& text, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( TQIODevice* dev, bool namespaceProcessing, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( const TQCString& text, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( const TQByteArray& text, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( const TQString& text, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - bool setContent( TQIODevice* dev, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - - bool setContent( TQXmlInputSource *source, TQXmlReader *reader, TQString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isDocument() const; - - // TQt extensions - TQString toString() const; // ### TQt 4: merge the two overloads - TQString toString( int ) const; - TQCString toCString() const; // ### TQt 4: merge the two overloads - TQCString toCString( int ) const; - -private: - TQDomDocument( TQDomDocumentPrivate* ); - - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomNamedNodeMap -{ -public: - TQDomNamedNodeMap(); - TQDomNamedNodeMap( const TQDomNamedNodeMap& ); - TQDomNamedNodeMap& operator= ( const TQDomNamedNodeMap& ); - bool operator== ( const TQDomNamedNodeMap& ) const; - bool operator!= ( const TQDomNamedNodeMap& ) const; - ~TQDomNamedNodeMap(); - - // DOM functions - TQDomNode namedItem( const TQString& name ) const; - TQDomNode setNamedItem( const TQDomNode& newNode ); - TQDomNode removeNamedItem( const TQString& name ); - TQDomNode item( int index ) const; - TQDomNode namedItemNS( const TQString& nsURI, const TQString& localName ) const; - TQDomNode setNamedItemNS( const TQDomNode& newNode ); - TQDomNode removeNamedItemNS( const TQString& nsURI, const TQString& localName ); - - // DOM read only attributes - uint length() const; - uint count() const { return length(); } // TQt API consitancy - - // TQt extension - bool contains( const TQString& name ) const; - -private: - TQDomNamedNodeMapPrivate* impl; - TQDomNamedNodeMap( TQDomNamedNodeMapPrivate* ); - - friend class TQDomNode; - friend class TQDomDocumentType; - friend class TQDomElement; -}; - -class TQM_EXPORT_DOM TQDomDocumentFragment : public TQDomNode -{ -public: - TQDomDocumentFragment(); - TQDomDocumentFragment( const TQDomDocumentFragment& x ); - TQDomDocumentFragment& operator= ( const TQDomDocumentFragment& ); - ~TQDomDocumentFragment(); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isDocumentFragment() const; - -private: - TQDomDocumentFragment( TQDomDocumentFragmentPrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomCharacterData : public TQDomNode -{ -public: - TQDomCharacterData(); - TQDomCharacterData( const TQDomCharacterData& x ); - TQDomCharacterData& operator= ( const TQDomCharacterData& ); - ~TQDomCharacterData(); - - // DOM functions - virtual TQString substringData( unsigned long offset, unsigned long count ); - virtual void appendData( const TQString& arg ); - virtual void insertData( unsigned long offset, const TQString& arg ); - virtual void deleteData( unsigned long offset, unsigned long count ); - virtual void replaceData( unsigned long offset, unsigned long count, const TQString& arg ); - - // DOM read only attributes - virtual uint length() const; - - // DOM attributes - virtual TQString data() const; - virtual void setData( const TQString& ); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isCharacterData() const; - -private: - TQDomCharacterData( TQDomCharacterDataPrivate* ); - - friend class TQDomDocument; - friend class TQDomText; - friend class TQDomComment; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomAttr : public TQDomNode -{ -public: - TQDomAttr(); - TQDomAttr( const TQDomAttr& x ); - TQDomAttr& operator= ( const TQDomAttr& ); - ~TQDomAttr(); - - // DOM read only attributes - virtual TQString name() const; - virtual bool specified() const; - virtual TQDomElement ownerElement() const; - - // DOM attributes - virtual TQString value() const; - virtual void setValue( const TQString& ); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isAttr() const; - -private: - TQDomAttr( TQDomAttrPrivate* ); - - friend class TQDomDocument; - friend class TQDomElement; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomElement : public TQDomNode -{ -public: - TQDomElement(); - TQDomElement( const TQDomElement& x ); - TQDomElement& operator= ( const TQDomElement& ); - ~TQDomElement(); - - // DOM functions - TQString attribute( const TQString& name, const TQString& defValue = TQString::null ) const; - void setAttribute( const TQString& name, const TQString& value ); - void setAttribute( const TQString& name, int value ); - void setAttribute( const TQString& name, uint value ); - void setAttribute( const TQString& name, long value ); - void setAttribute( const TQString& name, ulong value ); - void setAttribute( const TQString& name, double value ); - void removeAttribute( const TQString& name ); - TQDomAttr attributeNode( const TQString& name); - TQDomAttr setAttributeNode( const TQDomAttr& newAttr ); - TQDomAttr removeAttributeNode( const TQDomAttr& oldAttr ); - virtual TQDomNodeList elementsByTagName( const TQString& tagname ) const; - bool hasAttribute( const TQString& name ) const; - - TQString attributeNS( const TQString nsURI, const TQString& localName, const TQString& defValue ) const; - void setAttributeNS( const TQString nsURI, const TQString& qName, const TQString& value ); - void setAttributeNS( const TQString nsURI, const TQString& qName, int value ); - void setAttributeNS( const TQString nsURI, const TQString& qName, uint value ); - void setAttributeNS( const TQString nsURI, const TQString& qName, long value ); - void setAttributeNS( const TQString nsURI, const TQString& qName, ulong value ); - void setAttributeNS( const TQString nsURI, const TQString& qName, double value ); - void removeAttributeNS( const TQString& nsURI, const TQString& localName ); - TQDomAttr attributeNodeNS( const TQString& nsURI, const TQString& localName ); - TQDomAttr setAttributeNodeNS( const TQDomAttr& newAttr ); - virtual TQDomNodeList elementsByTagNameNS( const TQString& nsURI, const TQString& localName ) const; - bool hasAttributeNS( const TQString& nsURI, const TQString& localName ) const; - - // DOM read only attributes - TQString tagName() const; - void setTagName( const TQString& name ); // TQt extension - - // Reimplemented from TQDomNode - TQDomNamedNodeMap attributes() const; - TQDomNode::NodeType nodeType() const; - bool isElement() const; - - TQString text() const; - -private: - TQDomElement( TQDomElementPrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; - friend class TQDomAttr; -}; - -class TQM_EXPORT_DOM TQDomText : public TQDomCharacterData -{ -public: - TQDomText(); - TQDomText( const TQDomText& x ); - TQDomText& operator= ( const TQDomText& ); - ~TQDomText(); - - // DOM functions - TQDomText splitText( int offset ); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isText() const; - -private: - TQDomText( TQDomTextPrivate* ); - - friend class TQDomCDATASection; - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomComment : public TQDomCharacterData -{ -public: - TQDomComment(); - TQDomComment( const TQDomComment& x ); - TQDomComment& operator= ( const TQDomComment& ); - ~TQDomComment(); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isComment() const; - -private: - TQDomComment( TQDomCommentPrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomCDATASection : public TQDomText -{ -public: - TQDomCDATASection(); - TQDomCDATASection( const TQDomCDATASection& x ); - TQDomCDATASection& operator= ( const TQDomCDATASection& ); - ~TQDomCDATASection(); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isCDATASection() const; - -private: - TQDomCDATASection( TQDomCDATASectionPrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomNotation : public TQDomNode -{ -public: - TQDomNotation(); - TQDomNotation( const TQDomNotation& x ); - TQDomNotation& operator= ( const TQDomNotation& ); - ~TQDomNotation(); - - // DOM read only attributes - TQString publicId() const; - TQString systemId() const; - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isNotation() const; - -private: - TQDomNotation( TQDomNotationPrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomEntity : public TQDomNode -{ -public: - TQDomEntity(); - TQDomEntity( const TQDomEntity& x ); - TQDomEntity& operator= ( const TQDomEntity& ); - ~TQDomEntity(); - - // DOM read only attributes - virtual TQString publicId() const; - virtual TQString systemId() const; - virtual TQString notationName() const; - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isEntity() const; - -private: - TQDomEntity( TQDomEntityPrivate* ); - - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomEntityReference : public TQDomNode -{ -public: - TQDomEntityReference(); - TQDomEntityReference( const TQDomEntityReference& x ); - TQDomEntityReference& operator= ( const TQDomEntityReference& ); - ~TQDomEntityReference(); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isEntityReference() const; - -private: - TQDomEntityReference( TQDomEntityReferencePrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; -}; - -class TQM_EXPORT_DOM TQDomProcessingInstruction : public TQDomNode -{ -public: - TQDomProcessingInstruction(); - TQDomProcessingInstruction( const TQDomProcessingInstruction& x ); - TQDomProcessingInstruction& operator= ( const TQDomProcessingInstruction& ); - ~TQDomProcessingInstruction(); - - // DOM read only attributes - virtual TQString target() const; - - // DOM attributes - virtual TQString data() const; - virtual void setData( const TQString& d ); - - // Reimplemented from TQDomNode - TQDomNode::NodeType nodeType() const; - bool isProcessingInstruction() const; - -private: - TQDomProcessingInstruction( TQDomProcessingInstructionPrivate* ); - - friend class TQDomDocument; - friend class TQDomNode; -}; - - -TQM_EXPORT_DOM TQTextStream& operator<<( TQTextStream&, const TQDomNode& ); - -#endif //QT_NO_DOM -#endif // TQDOM_H diff --git a/src/xml/qsvgdevice.cpp b/src/xml/qsvgdevice.cpp index df9b55100..dac7ff80c 100644 --- a/src/xml/qsvgdevice.cpp +++ b/src/xml/qsvgdevice.cpp @@ -40,15 +40,15 @@ #ifndef QT_NO_SVG -#include "qpainter.h" -#include "qpaintdevicemetrics.h" -#include "qfile.h" -#include "qmap.h" -#include "qregexp.h" -#include "qvaluelist.h" -#include "qtextstream.h" -#include "qimage.h" -#include "qpixmap.h" +#include "ntqpainter.h" +#include "ntqpaintdevicemetrics.h" +#include "ntqfile.h" +#include "ntqmap.h" +#include "ntqregexp.h" +#include "ntqvaluelist.h" +#include "ntqtextstream.h" +#include "ntqimage.h" +#include "ntqpixmap.h" #include diff --git a/src/xml/qsvgdevice_p.h b/src/xml/qsvgdevice_p.h index 1dd58f28a..bc717c5cc 100644 --- a/src/xml/qsvgdevice_p.h +++ b/src/xml/qsvgdevice_p.h @@ -54,9 +54,9 @@ // #ifndef QT_H -#include "qpaintdevice.h" -#include "qrect.h" -#include "qdom.h" +#include "ntqpaintdevice.h" +#include "ntqrect.h" +#include "ntqdom.h" #endif // QT_H #if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) diff --git a/src/xml/qt_xml.pri b/src/xml/qt_xml.pri index 4edd51e30..b8fe7099a 100644 --- a/src/xml/qt_xml.pri +++ b/src/xml/qt_xml.pri @@ -1,7 +1,7 @@ # Qt xml module xml { - HEADERS += $$XML_H/qxml.h $$XML_H/qdom.h $$XML_CPP/qsvgdevice_p.h + HEADERS += $$XML_H/ntqxml.h $$XML_H/ntqdom.h $$XML_CPP/qsvgdevice_p.h SOURCES += $$XML_CPP/qxml.cpp $$XML_CPP/qdom.cpp $$XML_CPP/qsvgdevice.cpp win32-borland { QMAKE_CFLAGS_WARN_ON += -w-use diff --git a/src/xml/qxml.cpp b/src/xml/qxml.cpp index 34dbeeb20..ccc3498d7 100644 --- a/src/xml/qxml.cpp +++ b/src/xml/qxml.cpp @@ -38,16 +38,16 @@ ** **********************************************************************/ -#include "qxml.h" -#include "qtextcodec.h" -#include "qbuffer.h" -#include "qregexp.h" -#include "qptrstack.h" -#include "qmap.h" -#include "qvaluestack.h" +#include "ntqxml.h" +#include "ntqtextcodec.h" +#include "ntqbuffer.h" +#include "ntqregexp.h" +#include "ntqptrstack.h" +#include "ntqmap.h" +#include "ntqvaluestack.h" // needed for QT_TRANSLATE_NOOP: -#include "qobject.h" +#include "ntqobject.h" #ifndef QT_NO_XML @@ -216,7 +216,7 @@ class TQXmlDefaultHandlerPrivate }; /*! - \class TQXmlParseException qxml.h + \class TQXmlParseException ntqxml.h \reentrant \brief The TQXmlParseException class is used to report errors with the TQXmlErrorHandler interface. @@ -281,7 +281,7 @@ TQString TQXmlParseException::systemId() const /*! - \class TQXmlLocator qxml.h + \class TQXmlLocator ntqxml.h \reentrant \brief The TQXmlLocator class provides the XML handler classes with information about the parsing position within a file. @@ -378,7 +378,7 @@ public: }; /*! - \class TQXmlNamespaceSupport qxml.h + \class TQXmlNamespaceSupport ntqxml.h \reentrant \brief The TQXmlNamespaceSupport class is a helper class for XML readers which want to include namespace support. @@ -648,7 +648,7 @@ void TQXmlNamespaceSupport::reset() *********************************************/ /*! - \class TQXmlAttributes qxml.h + \class TQXmlAttributes ntqxml.h \reentrant \brief The TQXmlAttributes class provides XML attributes. \if defined(commercial) @@ -893,7 +893,7 @@ void TQXmlAttributes::append( const TQString &qName, const TQString &uri, const *********************************************/ /*! - \class TQXmlInputSource qxml.h + \class TQXmlInputSource ntqxml.h \reentrant \brief The TQXmlInputSource class provides the input data for the TQXmlReader subclasses. @@ -1208,7 +1208,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning *********************************************/ /*! - \class TQXmlContentHandler qxml.h + \class TQXmlContentHandler ntqxml.h \reentrant \brief The TQXmlContentHandler class provides an interface to report the logical content of XML data. @@ -1457,7 +1457,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning /*! - \class TQXmlErrorHandler qxml.h + \class TQXmlErrorHandler ntqxml.h \reentrant \brief The TQXmlErrorHandler class provides an interface to report errors in XML data. @@ -1531,7 +1531,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning /*! - \class TQXmlDTDHandler qxml.h + \class TQXmlDTDHandler ntqxml.h \reentrant \brief The TQXmlDTDHandler class provides an interface to report DTD content of XML data. @@ -1597,7 +1597,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning /*! - \class TQXmlEntityResolver qxml.h + \class TQXmlEntityResolver ntqxml.h \reentrant \brief The TQXmlEntityResolver class provides an interface to resolve external entities contained in XML data. @@ -1652,7 +1652,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning /*! - \class TQXmlLexicalHandler qxml.h + \class TQXmlLexicalHandler ntqxml.h \reentrant \brief The TQXmlLexicalHandler class provides an interface to report the lexical content of XML data. @@ -1802,7 +1802,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning /*! - \class TQXmlDeclHandler qxml.h + \class TQXmlDeclHandler ntqxml.h \reentrant \brief The TQXmlDeclHandler class provides an interface to report declaration content of XML data. @@ -1888,7 +1888,7 @@ TQString TQXmlInputSource::fromRawData( const TQByteArray &data, bool beginning /*! - \class TQXmlDefaultHandler qxml.h + \class TQXmlDefaultHandler ntqxml.h \reentrant \brief The TQXmlDefaultHandler class provides a default implementation of all the XML handler classes. @@ -2349,7 +2349,7 @@ private: *********************************************/ /*! - \class TQXmlReader qxml.h + \class TQXmlReader ntqxml.h \reentrant \brief The TQXmlReader class provides an interface for XML readers (i.e. parsers). @@ -2569,7 +2569,7 @@ private: /*! - \class TQXmlSimpleReader qxml.h + \class TQXmlSimpleReader ntqxml.h \reentrant \brief The TQXmlSimpleReader class provides an implementation of a simple XML reader (parser). diff --git a/src/xml/qxml.h b/src/xml/qxml.h deleted file mode 100644 index 4bdceeea1..000000000 --- a/src/xml/qxml.h +++ /dev/null @@ -1,531 +0,0 @@ -/**************************************************************************** -** -** Definition of TQXmlSimpleReader and related classes. -** -** Created : 000518 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the xml module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial 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 WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQXML_H -#define TQXML_H - -#ifndef QT_H -#include "qtextstream.h" -#include "qfile.h" -#include "qstring.h" -#include "qstringlist.h" -#include "qvaluevector.h" -#endif // QT_H - -#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) -#define TQM_EXPORT_XML -#else -#define TQM_EXPORT_XML Q_EXPORT -#endif - -#ifndef QT_NO_XML - -class TQXmlNamespaceSupport; -class TQXmlAttributes; -class TQXmlContentHandler; -class TQXmlDefaultHandler; -class TQXmlDTDHandler; -class TQXmlEntityResolver; -class TQXmlErrorHandler; -class TQXmlLexicalHandler; -class TQXmlDeclHandler; -class TQXmlInputSource; -class TQXmlLocator; -class TQXmlNamespaceSupport; -class TQXmlParseException; - -class TQXmlReader; -class TQXmlSimpleReader; - -class TQXmlSimpleReaderPrivate; -class TQXmlNamespaceSupportPrivate; -class TQXmlAttributesPrivate; -class TQXmlInputSourcePrivate; -class TQXmlParseExceptionPrivate; -class TQXmlLocatorPrivate; -class TQXmlDefaultHandlerPrivate; - - -// -// SAX Namespace Support -// - -class TQM_EXPORT_XML TQXmlNamespaceSupport -{ -public: - TQXmlNamespaceSupport(); - ~TQXmlNamespaceSupport(); - - void setPrefix( const TQString&, const TQString& ); - - TQString prefix( const TQString& ) const; - TQString uri( const TQString& ) const; - void splitName( const TQString&, TQString&, TQString& ) const; - void processName( const TQString&, bool, TQString&, TQString& ) const; - TQStringList prefixes() const; - TQStringList prefixes( const TQString& ) const; - - void pushContext(); - void popContext(); - void reset(); - -private: - TQXmlNamespaceSupportPrivate *d; - - friend class TQXmlSimpleReader; -}; - - -// -// SAX Attributes -// - -class TQM_EXPORT_XML TQXmlAttributes -{ -public: - TQXmlAttributes() {} - virtual ~TQXmlAttributes() {} - - int index( const TQString& qName ) const; - int index( const TQString& uri, const TQString& localPart ) const; - int length() const; - int count() const; - TQString localName( int index ) const; - TQString qName( int index ) const; - TQString uri( int index ) const; - TQString type( int index ) const; - TQString type( const TQString& qName ) const; - TQString type( const TQString& uri, const TQString& localName ) const; - TQString value( int index ) const; - TQString value( const TQString& qName ) const; - TQString value( const TQString& uri, const TQString& localName ) const; - - void clear(); - void append( const TQString &qName, const TQString &uri, const TQString &localPart, const TQString &value ); - -private: - TQStringList qnameList; - TQStringList uriList; - TQStringList localnameList; - TQStringList valueList; - - TQXmlAttributesPrivate *d; -}; - -// -// SAX Input Source -// - -class TQM_EXPORT_XML TQXmlInputSource -{ -public: - TQXmlInputSource(); - TQXmlInputSource( TQIODevice *dev ); - TQXmlInputSource( TQFile& file ); // obsolete - TQXmlInputSource( TQTextStream& stream ); // obsolete - virtual ~TQXmlInputSource(); - - virtual void setData( const TQString& dat ); - virtual void setData( const TQByteArray& dat ); - virtual void fetchData(); - virtual TQString data(); - virtual TQChar next(); - virtual void reset(); - - static const TQChar EndOfData; - static const TQChar EndOfDocument; - -protected: - virtual TQString fromRawData( const TQByteArray &data, bool beginning = FALSE ); - -private: - void init(); - - TQIODevice *inputDevice; - TQTextStream *inputStream; - - TQString str; - const TQChar *unicode; - int pos; - int length; - bool nextReturnedEndOfData; - TQTextDecoder *encMapper; - - TQXmlInputSourcePrivate *d; -}; - -// -// SAX Exception Classes -// - -class TQM_EXPORT_XML TQXmlParseException -{ -public: - TQXmlParseException( const TQString& name="", int c=-1, int l=-1, const TQString& p="", const TQString& s="" ) - : msg( name ), column( c ), line( l ), pub( p ), sys( s ) - { } - - int columnNumber() const; - int lineNumber() const; - TQString publicId() const; - TQString systemId() const; - TQString message() const; - -private: - TQString msg; - int column; - int line; - TQString pub; - TQString sys; - - TQXmlParseExceptionPrivate *d; -}; - - -// -// XML Reader -// - -class TQM_EXPORT_XML TQXmlReader -{ -public: - virtual bool feature( const TQString& name, bool *ok = 0 ) const = 0; - virtual void setFeature( const TQString& name, bool value ) = 0; - virtual bool hasFeature( const TQString& name ) const = 0; - virtual void* property( const TQString& name, bool *ok = 0 ) const = 0; - virtual void setProperty( const TQString& name, void* value ) = 0; - virtual bool hasProperty( const TQString& name ) const = 0; - virtual void setEntityResolver( TQXmlEntityResolver* handler ) = 0; - virtual TQXmlEntityResolver* entityResolver() const = 0; - virtual void setDTDHandler( TQXmlDTDHandler* handler ) = 0; - virtual TQXmlDTDHandler* DTDHandler() const = 0; - virtual void setContentHandler( TQXmlContentHandler* handler ) = 0; - virtual TQXmlContentHandler* contentHandler() const = 0; - virtual void setErrorHandler( TQXmlErrorHandler* handler ) = 0; - virtual TQXmlErrorHandler* errorHandler() const = 0; - virtual void setLexicalHandler( TQXmlLexicalHandler* handler ) = 0; - virtual TQXmlLexicalHandler* lexicalHandler() const = 0; - virtual void setDeclHandler( TQXmlDeclHandler* handler ) = 0; - virtual TQXmlDeclHandler* declHandler() const = 0; - virtual bool parse( const TQXmlInputSource& input ) = 0; - virtual bool parse( const TQXmlInputSource* input ) = 0; -}; - -class TQM_EXPORT_XML TQXmlSimpleReader : public TQXmlReader -{ -public: - TQXmlSimpleReader(); - virtual ~TQXmlSimpleReader(); - - bool feature( const TQString& name, bool *ok = 0 ) const; - void setFeature( const TQString& name, bool value ); - bool hasFeature( const TQString& name ) const; - - void* property( const TQString& name, bool *ok = 0 ) const; - void setProperty( const TQString& name, void* value ); - bool hasProperty( const TQString& name ) const; - - void setEntityResolver( TQXmlEntityResolver* handler ); - TQXmlEntityResolver* entityResolver() const; - void setDTDHandler( TQXmlDTDHandler* handler ); - TQXmlDTDHandler* DTDHandler() const; - void setContentHandler( TQXmlContentHandler* handler ); - TQXmlContentHandler* contentHandler() const; - void setErrorHandler( TQXmlErrorHandler* handler ); - TQXmlErrorHandler* errorHandler() const; - void setLexicalHandler( TQXmlLexicalHandler* handler ); - TQXmlLexicalHandler* lexicalHandler() const; - void setDeclHandler( TQXmlDeclHandler* handler ); - TQXmlDeclHandler* declHandler() const; - - bool parse( const TQXmlInputSource& input ); - bool parse( const TQXmlInputSource* input ); - virtual bool parse( const TQXmlInputSource* input, bool incremental ); - virtual bool parseContinue(); - -private: - // variables - TQXmlContentHandler *contentHnd; - TQXmlErrorHandler *errorHnd; - TQXmlDTDHandler *dtdHnd; - TQXmlEntityResolver *entityRes; - TQXmlLexicalHandler *lexicalHnd; - TQXmlDeclHandler *declHnd; - - TQXmlInputSource *inputSource; - - TQChar c; // the character at reading position - int lineNr; // number of line - int columnNr; // position in line - - int nameArrayPos; - TQChar nameArray[256]; // only used for names - TQString nameValue; // only used for names - int refArrayPos; - TQChar refArray[256]; // only used for references - TQString refValue; // only used for references - int stringArrayPos; - TQChar stringArray[256]; // used for any other strings that are parsed - TQString stringValue; // used for any other strings that are parsed - - TQXmlSimpleReaderPrivate* d; - - const TQString &string(); - void stringClear(); - inline void stringAddC() { stringAddC(c); } - void stringAddC(const TQChar&); - const TQString& name(); - void nameClear(); - inline void nameAddC() { nameAddC(c); } - void nameAddC(const TQChar&); - const TQString& ref(); - void refClear(); - inline void refAddC() { refAddC(c); } - void refAddC(const TQChar&); - - // used by parseReference() and parsePEReference() - enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; - - // private functions - bool eat_ws(); - bool next_eat_ws(); - - void next(); - bool atEnd(); - - void init( const TQXmlInputSource* i ); - void initData(); - - bool entityExist( const TQString& ) const; - - bool parseBeginOrContinue( int state, bool incremental ); - - bool parseProlog(); - bool parseElement(); - bool processElementEmptyTag(); - bool processElementETagBegin2(); - bool processElementAttribute(); - bool parseMisc(); - bool parseContent(); - - bool parsePI(); - bool parseDoctype(); - bool parseComment(); - - bool parseName(); - bool parseNmtoken(); - bool parseAttribute(); - bool parseReference(); - bool processReference(); - - bool parseExternalID(); - bool parsePEReference(); - bool parseMarkupdecl(); - bool parseAttlistDecl(); - bool parseAttType(); - bool parseAttValue(); - bool parseElementDecl(); - bool parseNotationDecl(); - bool parseChoiceSeq(); - bool parseEntityDecl(); - bool parseEntityValue(); - - bool parseString(); - - bool insertXmlRef( const TQString&, const TQString&, bool ); - - bool reportEndEntities(); - void reportParseError( const TQString& error ); - - typedef bool (TQXmlSimpleReader::*ParseFunction) (); - void unexpectedEof( ParseFunction where, int state ); - void parseFailed( ParseFunction where, int state ); - void pushParseState( ParseFunction function, int state ); - - void setUndefEntityInAttrHack(bool b); - - friend class TQXmlSimpleReaderPrivate; - friend class TQXmlSimpleReaderLocator; - friend class TQDomDocumentPrivate; -}; - -// -// SAX Locator -// - -class TQM_EXPORT_XML TQXmlLocator -{ -public: - TQXmlLocator(); - virtual ~TQXmlLocator(); - - virtual int columnNumber() = 0; - virtual int lineNumber() = 0; -// TQString getPublicId() -// TQString getSystemId() -}; - -// -// SAX handler classes -// - -class TQM_EXPORT_XML TQXmlContentHandler -{ -public: - virtual void setDocumentLocator( TQXmlLocator* locator ) = 0; - virtual bool startDocument() = 0; - virtual bool endDocument() = 0; - virtual bool startPrefixMapping( const TQString& prefix, const TQString& uri ) = 0; - virtual bool endPrefixMapping( const TQString& prefix ) = 0; - virtual bool startElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName, const TQXmlAttributes& atts ) = 0; - virtual bool endElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName ) = 0; - virtual bool characters( const TQString& ch ) = 0; - virtual bool ignorableWhitespace( const TQString& ch ) = 0; - virtual bool processingInstruction( const TQString& target, const TQString& data ) = 0; - virtual bool skippedEntity( const TQString& name ) = 0; - virtual TQString errorString() = 0; -}; - -class TQM_EXPORT_XML TQXmlErrorHandler -{ -public: - virtual bool warning( const TQXmlParseException& exception ) = 0; - virtual bool error( const TQXmlParseException& exception ) = 0; - virtual bool fatalError( const TQXmlParseException& exception ) = 0; - virtual TQString errorString() = 0; -}; - -class TQM_EXPORT_XML TQXmlDTDHandler -{ -public: - virtual bool notationDecl( const TQString& name, const TQString& publicId, const TQString& systemId ) = 0; - virtual bool unparsedEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId, const TQString& notationName ) = 0; - virtual TQString errorString() = 0; -}; - -class TQM_EXPORT_XML TQXmlEntityResolver -{ -public: - virtual bool resolveEntity( const TQString& publicId, const TQString& systemId, TQXmlInputSource*& ret ) = 0; - virtual TQString errorString() = 0; -}; - -class TQM_EXPORT_XML TQXmlLexicalHandler -{ -public: - virtual bool startDTD( const TQString& name, const TQString& publicId, const TQString& systemId ) = 0; - virtual bool endDTD() = 0; - virtual bool startEntity( const TQString& name ) = 0; - virtual bool endEntity( const TQString& name ) = 0; - virtual bool startCDATA() = 0; - virtual bool endCDATA() = 0; - virtual bool comment( const TQString& ch ) = 0; - virtual TQString errorString() = 0; -}; - -class TQM_EXPORT_XML TQXmlDeclHandler -{ -public: - virtual bool attributeDecl( const TQString& eName, const TQString& aName, const TQString& type, const TQString& valueDefault, const TQString& value ) = 0; - virtual bool internalEntityDecl( const TQString& name, const TQString& value ) = 0; - virtual bool externalEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId ) = 0; - virtual TQString errorString() = 0; -}; - - -class TQM_EXPORT_XML TQXmlDefaultHandler : public TQXmlContentHandler, public TQXmlErrorHandler, public TQXmlDTDHandler, public TQXmlEntityResolver, public TQXmlLexicalHandler, public TQXmlDeclHandler -{ -public: - TQXmlDefaultHandler() { } - virtual ~TQXmlDefaultHandler() { } - - void setDocumentLocator( TQXmlLocator* locator ); - bool startDocument(); - bool endDocument(); - bool startPrefixMapping( const TQString& prefix, const TQString& uri ); - bool endPrefixMapping( const TQString& prefix ); - bool startElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName, const TQXmlAttributes& atts ); - bool endElement( const TQString& namespaceURI, const TQString& localName, const TQString& qName ); - bool characters( const TQString& ch ); - bool ignorableWhitespace( const TQString& ch ); - bool processingInstruction( const TQString& target, const TQString& data ); - bool skippedEntity( const TQString& name ); - - bool warning( const TQXmlParseException& exception ); - bool error( const TQXmlParseException& exception ); - bool fatalError( const TQXmlParseException& exception ); - - bool notationDecl( const TQString& name, const TQString& publicId, const TQString& systemId ); - bool unparsedEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId, const TQString& notationName ); - - bool resolveEntity( const TQString& publicId, const TQString& systemId, TQXmlInputSource*& ret ); - - bool startDTD( const TQString& name, const TQString& publicId, const TQString& systemId ); - bool endDTD(); - bool startEntity( const TQString& name ); - bool endEntity( const TQString& name ); - bool startCDATA(); - bool endCDATA(); - bool comment( const TQString& ch ); - - bool attributeDecl( const TQString& eName, const TQString& aName, const TQString& type, const TQString& valueDefault, const TQString& value ); - bool internalEntityDecl( const TQString& name, const TQString& value ); - bool externalEntityDecl( const TQString& name, const TQString& publicId, const TQString& systemId ); - - TQString errorString(); - -private: - TQXmlDefaultHandlerPrivate *d; -}; - - -// -// inlines -// - -inline bool TQXmlSimpleReader::atEnd() -{ return (c.unicode()|0x0001) == 0xffff; } -inline int TQXmlAttributes::count() const -{ return length(); } - - -#endif //QT_NO_XML - -#endif -- cgit v1.2.3