From 397b7afa8e3f32268c4454bf4783ac2a5a799658 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 15 Oct 2024 13:05:33 +0900 Subject: Rename ntqapplication, ntqconfig and ntqmodules files to equivalent tq* Signed-off-by: Michele Calgaro --- .gitignore | 8 +- configure | 102 +- doc/application-walkthrough.doc | 12 +- doc/classchart.doc | 2 +- doc/customstyles.doc | 4 +- doc/distributingtqt.doc | 2 +- doc/dnd.doc | 14 +- doc/features.doc | 6 +- doc/html/aclock-example.html | 8 +- doc/html/addressbook-example.html | 14 +- doc/html/annotated.html | 2 +- doc/html/application.html | 2 +- doc/html/archivesearch-example.html | 14 +- doc/html/biff-example.html | 8 +- doc/html/bigtable-example.html | 8 +- doc/html/buttongroups-example.html | 8 +- doc/html/canvas-chart-example.html | 16 +- doc/html/canvas-example.html | 20 +- doc/html/chart-chartform-cpp.html | 4 +- doc/html/chart-element-cpp.html | 8 +- doc/html/chart-main-cpp.html | 12 +- doc/html/checklists-example.html | 8 +- doc/html/classchart.html | 2 +- doc/html/classes.html | 2 +- doc/html/clientserver-example.html | 22 +- doc/html/cursor-example.html | 8 +- doc/html/customlayout-example.html | 8 +- doc/html/customstyles.html | 2 +- doc/html/dclock-example.html | 8 +- doc/html/debug.html | 22 +- doc/html/designer-manual-3.html | 16 +- doc/html/designer-manual-4.html | 6 +- doc/html/designer-manual-6.html | 18 +- doc/html/designer-manual-7.html | 12 +- doc/html/designer-manual-8.html | 8 +- doc/html/desktop-example.html | 20 +- doc/html/dirview-example.html | 12 +- doc/html/distributingtqt.html | 2 +- doc/html/distributor-example.html | 14 +- doc/html/dnd.html | 14 +- doc/html/drawdemo-example.html | 8 +- doc/html/drawlines-example.html | 8 +- doc/html/eventsandfilters.html | 6 +- doc/html/extension-dialog-example.html | 12 +- doc/html/fileiconview-example.html | 14 +- doc/html/forever-example.html | 8 +- doc/html/ftpclient-example.html | 16 +- doc/html/functions.html | 206 +- doc/html/groups.html | 2 +- doc/html/headers.html | 2 +- doc/html/hello-example.html | 10 +- doc/html/helpsystem-example.html | 8 +- doc/html/helpviewer-example.html | 20 +- doc/html/hierarchy.html | 2 +- doc/html/httpd-example.html | 12 +- doc/html/i18n-example.html | 22 +- doc/html/i18n.html | 24 +- doc/html/iconview-example.html | 18 +- doc/html/iconview-simple_dd-main-cpp.html | 6 +- doc/html/iconview-simple_dd-main-h.html | 2 +- doc/html/index | 222 +- doc/html/layout-example.html | 10 +- doc/html/life-example.html | 12 +- doc/html/lineedits-example.html | 8 +- doc/html/linguist-manual-4.html | 32 +- doc/html/listbox-example.html | 8 +- doc/html/listboxcombo-example.html | 8 +- doc/html/listviews-example.html | 8 +- doc/html/mac-differences.html | 4 +- doc/html/mail-example.html | 4 +- doc/html/mainclasses.html | 2 +- doc/html/mdi-example.html | 14 +- doc/html/menu-example.html | 30 +- doc/html/movies-example.html | 10 +- doc/html/network.html | 12 +- doc/html/ntqapplication.html | 2000 ------ doc/html/opengl-x11-overlays.html | 2 +- doc/html/outliner-example.html | 8 +- doc/html/picture-example.html | 10 +- doc/html/plugins-howto.html | 10 +- doc/html/popup-example.html | 10 +- doc/html/process-example.html | 10 +- doc/html/progress-example.html | 18 +- doc/html/progressbar-example.html | 8 +- doc/html/propertydocs | 24 +- doc/html/qapplication-h.html | 542 -- doc/html/qfd-example.html | 12 +- doc/html/qmag-example.html | 38 +- doc/html/qmake-manual-7.html | 12 +- doc/html/qt.dcf | 228 +- doc/html/qwerty-example.html | 24 +- doc/html/rangecontrols-example.html | 8 +- doc/html/regexptester-example.html | 12 +- doc/html/richtext-example.html | 12 +- doc/html/rot-example.html | 10 +- doc/html/scribble-example.html | 16 +- doc/html/scrollview-example.html | 26 +- doc/html/session.html | 16 +- doc/html/showimg-example.html | 36 +- doc/html/simple-application-example.html | 12 +- doc/html/simple-application.html | 22 +- doc/html/simple-font-demo-example.html | 8 +- doc/html/simple_dd-example.html | 8 +- doc/html/small-table-example-example.html | 8 +- doc/html/sound-example.html | 10 +- doc/html/splitter-example.html | 8 +- doc/html/sql-overview-basicbrowsing-main-cpp.html | 4 +- doc/html/sql-overview-basicbrowsing2-main-cpp.html | 4 +- doc/html/sql-overview-basicdatamanip-main-cpp.html | 4 +- doc/html/sql-overview-connect1-main-cpp.html | 4 +- .../sql-overview-create_connections-main-cpp.html | 4 +- doc/html/sql-overview-custom1-main-cpp.html | 6 +- doc/html/sql-overview-custom1-main-h.html | 2 +- doc/html/sql-overview-delete-main-cpp.html | 4 +- doc/html/sql-overview-extract-main-cpp.html | 6 +- doc/html/sql-overview-form1-main-cpp.html | 8 +- doc/html/sql-overview-form2-main-h.html | 2 +- doc/html/sql-overview-insert-main-cpp.html | 4 +- doc/html/sql-overview-navigating-main-cpp.html | 4 +- doc/html/sql-overview-order1-main-cpp.html | 6 +- doc/html/sql-overview-order2-main-cpp.html | 6 +- doc/html/sql-overview-retrieve1-main-cpp.html | 6 +- doc/html/sql-overview-retrieve2-main-cpp.html | 6 +- doc/html/sql-overview-subclass1-main-cpp.html | 8 +- doc/html/sql-overview-subclass2-main-cpp.html | 6 +- doc/html/sql-overview-subclass2-main-h.html | 2 +- doc/html/sql-overview-subclass3-main-cpp.html | 6 +- doc/html/sql-overview-subclass3-main-h.html | 2 +- doc/html/sql-overview-subclass4-main-cpp.html | 6 +- doc/html/sql-overview-subclass4-main-h.html | 2 +- doc/html/sql-overview-subclass5-main-cpp.html | 6 +- doc/html/sql-overview-subclass5-main-h.html | 2 +- doc/html/sql-overview-table1-main-cpp.html | 8 +- doc/html/sql-overview-table2-main-cpp.html | 8 +- doc/html/sql-overview-table3-main-cpp.html | 6 +- doc/html/sql-overview-table3-main-h.html | 2 +- doc/html/sql-overview-table4-main-cpp.html | 6 +- doc/html/sql-overview-table4-main-h.html | 2 +- doc/html/sql-overview-update-main-cpp.html | 4 +- doc/html/sql.html | 58 +- doc/html/sqltable-example.html | 8 +- doc/html/statistics-example.html | 8 +- doc/html/t10-lcdrange-cpp.html | 2 +- doc/html/t10-main-cpp.html | 12 +- doc/html/t11-lcdrange-cpp.html | 2 +- doc/html/t11-main-cpp.html | 12 +- doc/html/t12-lcdrange-cpp.html | 2 +- doc/html/t12-main-cpp.html | 12 +- doc/html/t13-gamebrd-cpp.html | 4 +- doc/html/t13-lcdrange-cpp.html | 2 +- doc/html/t13-main-cpp.html | 10 +- doc/html/t14-gamebrd-cpp.html | 6 +- doc/html/t14-lcdrange-cpp.html | 2 +- doc/html/t14-main-cpp.html | 10 +- doc/html/t7-main-cpp.html | 10 +- doc/html/t8-lcdrange-cpp.html | 2 +- doc/html/t8-main-cpp.html | 10 +- doc/html/t9-lcdrange-cpp.html | 2 +- doc/html/t9-main-cpp.html | 12 +- doc/html/tabdialog-example.html | 12 +- doc/html/table-bigtable-main-cpp.html | 8 +- doc/html/table-small-table-demo-main-cpp.html | 8 +- doc/html/tagreader-with-features-example.html | 8 +- doc/html/tetrix-example.html | 6 +- doc/html/themes-example.html | 80 +- doc/html/threads.html | 18 +- doc/html/tictac-example.html | 14 +- doc/html/timers.html | 2 +- doc/html/titleindex | 6 +- doc/html/toggleaction-example.html | 8 +- doc/html/tools.html | 2 +- doc/html/tooltip-example.html | 10 +- doc/html/toplevel-example.html | 4 +- doc/html/tqaction-application-example.html | 12 +- doc/html/tqapplication-h.html | 542 ++ doc/html/tqapplication-members.html | 191 + doc/html/tqapplication.html | 2000 ++++++ doc/html/tqasciicache.html | 2 +- doc/html/tqasciidict.html | 2 +- doc/html/tqcache.html | 2 +- doc/html/tqcanvasview.html | 2 +- doc/html/tqchildevent.html | 2 +- doc/html/tqclipboard.html | 6 +- doc/html/tqcloseevent.html | 8 +- doc/html/tqcolor.html | 10 +- doc/html/tqcursor.html | 6 +- doc/html/tqcustomevent.html | 8 +- doc/html/tqdatasource.html | 2 +- doc/html/tqdatetime.html | 2 +- doc/html/tqdesktopwidget.html | 4 +- doc/html/tqdialog.html | 12 +- doc/html/tqdict.html | 2 +- doc/html/tqdir-example.html | 6 +- doc/html/tqdir.html | 16 +- doc/html/tqerrormessage.html | 4 +- doc/html/tqevent.html | 10 +- doc/html/tqeventloop.html | 10 +- doc/html/tqfile.html | 4 +- doc/html/tqfileinfo.html | 4 +- doc/html/tqfont.html | 12 +- doc/html/tqfontdatabase.html | 8 +- doc/html/tqglcolormap.html | 6 +- doc/html/tqglformat.html | 12 +- doc/html/tqglobal-h.html | 14 +- doc/html/tqguardedptr.html | 2 +- doc/html/tqintcache.html | 2 +- doc/html/tqintdict.html | 2 +- doc/html/tqlistboxitem.html | 4 +- doc/html/tqmap.html | 2 +- doc/html/tqmemarray.html | 8 +- doc/html/tqmenubar.html | 2 +- doc/html/tqmessagebox-h.html | 2 +- doc/html/tqmessagebox.html | 8 +- doc/html/tqmotifstyle.html | 2 +- doc/html/tqnamespace-h.html | 6 +- doc/html/tqobject.html | 22 +- doc/html/tqpaintdevice.html | 2 +- doc/html/tqpainter.html | 20 +- doc/html/tqpalette.html | 2 +- doc/html/tqprogressdialog.html | 6 +- doc/html/tqptrdict.html | 2 +- doc/html/tqsessionmanager.html | 22 +- doc/html/tqsjiscodec.html | 2 +- doc/html/tqsocket.html | 4 +- doc/html/tqsocketnotifier.html | 2 +- doc/html/tqsplashscreen.html | 14 +- doc/html/tqsqlcursor.html | 2 +- doc/html/tqsqlquery.html | 4 +- doc/html/tqstring.html | 2 +- doc/html/tqstyle.html | 12 +- doc/html/tqtextcodec.html | 4 +- doc/html/tqthread.html | 2 +- doc/html/tqthreadstorage.html | 2 +- doc/html/tqtime.html | 2 +- doc/html/tqtimer.html | 8 +- doc/html/tqtranslator.html | 14 +- doc/html/tqvariant.html | 2 +- doc/html/tqwidget.html | 50 +- doc/html/tqwizard.html | 2 +- doc/html/tutorial1-01.html | 24 +- doc/html/tutorial1-02.html | 14 +- doc/html/tutorial1-03.html | 10 +- doc/html/tutorial1-04.html | 18 +- doc/html/tutorial1-05.html | 12 +- doc/html/tutorial1-06.html | 12 +- doc/html/tutorial1-08.html | 6 +- doc/html/tutorial1-09.html | 6 +- doc/html/tutorial1-14.html | 2 +- doc/html/tutorial2-03.html | 2 +- doc/html/tutorial2-04.html | 14 +- doc/html/tutorial2-05.html | 2 +- doc/html/whatsthis | 2 +- doc/html/wizard-example.html | 6 +- doc/html/wizard-wizard-cpp.html | 2 +- doc/html/xform-example.html | 10 +- doc/html/xml-sax-features-walkthrough.html | 8 +- doc/html/y2k.html | 2 +- doc/i18n.doc | 10 +- doc/indices.doc | 4 +- doc/mac.doc | 2 +- doc/man/man3/tqapplication.3qt | 378 +- doc/man/man3/tqchildevent.3qt | 2 +- doc/man/man3/tqclipboard.3qt | 4 +- doc/man/man3/tqcloseevent.3qt | 6 +- doc/man/man3/tqcolor.3qt | 10 +- doc/man/man3/tqcursor.3qt | 6 +- doc/man/man3/tqcustomevent.3qt | 6 +- doc/man/man3/tqdesktopwidget.3qt | 4 +- doc/man/man3/tqdialog.3qt | 8 +- doc/man/man3/tqdir.3qt | 4 +- doc/man/man3/tqevent.3qt | 6 +- doc/man/man3/tqeventloop.3qt | 10 +- doc/man/man3/tqfile.3qt | 2 +- doc/man/man3/tqfont.3qt | 12 +- doc/man/man3/tqfontdatabase.3qt | 4 +- doc/man/man3/tqfontdialog.3qt | 2 +- doc/man/man3/tqglcolormap.3qt | 4 +- doc/man/man3/tqglformat.3qt | 6 +- doc/man/man3/tqlistboxitem.3qt | 4 +- doc/man/man3/tqmap.3qt | 2 +- doc/man/man3/tqmessagebox.3qt | 6 +- doc/man/man3/tqmotifstyle.3qt | 2 +- doc/man/man3/tqobject.3qt | 12 +- doc/man/man3/tqpaintdevice.3qt | 2 +- doc/man/man3/tqpainter.3qt | 20 +- doc/man/man3/tqpalette.3qt | 2 +- doc/man/man3/tqprogressdialog.3qt | 4 +- doc/man/man3/tqsessionmanager.3qt | 16 +- doc/man/man3/tqsjiscodec.3qt | 2 +- doc/man/man3/tqsocket.3qt | 4 +- doc/man/man3/tqsplashscreen.3qt | 6 +- doc/man/man3/tqstyle.3qt | 16 +- doc/man/man3/tqtextcodec.3qt | 6 +- doc/man/man3/tqthreadstorage.3qt | 2 +- doc/man/man3/tqtimer.3qt | 4 +- doc/man/man3/tqtranslator.3qt | 8 +- doc/man/man3/tqwidget.3qt | 50 +- doc/man/man3/tqwizard.3qt | 2 +- doc/networking.doc | 2 +- doc/object.doc | 10 +- doc/opengl-x11-overlays.doc | 2 +- doc/plugins-howto.doc | 12 +- doc/session.doc | 16 +- doc/threads.doc | 22 +- doc/tqmap.doc | 2 +- doc/tutorial.doc | 24 +- doc/tutorial2.doc | 2 +- doc/xml-sax-features-walkthrough.doc | 2 +- doc/y2k.doc | 2 +- examples/aclock/main.cpp | 2 +- examples/action/application.cpp | 2 +- examples/action/main.cpp | 2 +- examples/action/toggleaction/toggleaction.cpp | 2 +- examples/addressbook/main.cpp | 2 +- examples/addressbook/mainwindow.cpp | 2 +- examples/application/application.cpp | 2 +- examples/application/main.cpp | 2 +- examples/biff/main.cpp | 2 +- examples/buttongroups/main.cpp | 2 +- examples/canvas/canvas.cpp | 2 +- examples/canvas/main.cpp | 2 +- examples/chart/chartform.cpp | 2 +- examples/chart/main.cpp | 2 +- examples/checklists/main.cpp | 2 +- examples/cursor/cursor.cpp | 2 +- examples/customlayout/main.cpp | 2 +- examples/dclock/main.cpp | 2 +- examples/demo/dnd/listview.cpp | 2 +- examples/demo/dnd/styledbutton.cpp | 2 +- examples/demo/frame.cpp | 2 +- examples/demo/i18n/i18n.cpp | 2 +- examples/demo/main.cpp | 4 +- examples/demo/qasteroids/toplevel.cpp | 2 +- examples/demo/qasteroids/view.cpp | 2 +- examples/demo/textdrawing/helpwindow.cpp | 2 +- examples/demo/textdrawing/textedit.cpp | 2 +- examples/desktop/desktop.cpp | 2 +- examples/dirview/dirview.cpp | 2 +- examples/dirview/main.cpp | 2 +- examples/distributor/distributor.ui.h | 2 +- examples/distributor/main.cpp | 2 +- examples/dragdrop/main.cpp | 2 +- examples/drawdemo/drawdemo.cpp | 2 +- examples/drawlines/connect.cpp | 2 +- examples/extension/main.cpp | 2 +- examples/extension/mainform.ui.h | 2 +- examples/fileiconview/main.cpp | 2 +- examples/fileiconview/tqfileiconview.cpp | 2 +- .../simple-tqfont-demo/simple-tqfont-demo.cpp | 2 +- examples/forever/forever.cpp | 2 +- examples/gridview/gridview.cpp | 2 +- examples/hello/main.cpp | 2 +- examples/helpdemo/main.cpp | 2 +- examples/helpsystem/main.cpp | 2 +- examples/helpsystem/mainwindow.cpp | 2 +- examples/helpsystem/whatsthis.cpp | 2 +- examples/helpviewer/helpwindow.cpp | 2 +- examples/helpviewer/main.cpp | 2 +- examples/i18n/main.cpp | 2 +- examples/i18n/mywidget.cpp | 2 +- examples/iconview/main.cpp | 2 +- examples/iconview/simple_dd/main.h | 2 +- examples/layout/layout.cpp | 2 +- examples/life/life.cpp | 2 +- examples/life/lifedlg.cpp | 2 +- examples/life/main.cpp | 2 +- examples/lineedits/main.cpp | 2 +- examples/listbox/main.cpp | 2 +- examples/listboxcombo/main.cpp | 2 +- examples/listviews/main.cpp | 2 +- examples/mdi/application.cpp | 2 +- examples/mdi/main.cpp | 2 +- examples/menu/menu.cpp | 2 +- examples/movies/main.cpp | 2 +- examples/network/archivesearch/archivedialog.ui | 2 +- examples/network/archivesearch/main.cpp | 2 +- examples/network/clientserver/client/client.cpp | 2 +- examples/network/clientserver/server/server.cpp | 2 +- examples/network/ftpclient/ftpmainwindow.ui.h | 2 +- examples/network/ftpclient/main.cpp | 2 +- examples/network/httpd/httpd.cpp | 2 +- .../network/infoprotocol/infoclient/client.cpp | 2 +- examples/network/infoprotocol/infoclient/main.cpp | 2 +- examples/network/infoprotocol/infoserver/main.cpp | 2 +- .../network/infoprotocol/infoserver/server.cpp | 2 +- .../network/infoprotocol/infourlclient/client.cpp | 2 +- .../network/infoprotocol/infourlclient/main.cpp | 2 +- examples/network/mail/main.cpp | 2 +- examples/network/mail/smtp.cpp | 2 +- examples/network/networkprotocol/main.cpp | 2 +- examples/network/remotecontrol/ipcserver.cpp | 2 +- examples/network/remotecontrol/main.cpp | 2 +- examples/opengl/box/globjwin.cpp | 2 +- examples/opengl/box/main.cpp | 2 +- examples/opengl/gear/gear.cpp | 2 +- examples/opengl/glpixmap/globjwin.cpp | 2 +- examples/opengl/glpixmap/main.cpp | 2 +- examples/opengl/overlay/globjwin.cpp | 2 +- examples/opengl/overlay/glteapots.cpp | 2 +- examples/opengl/overlay/main.cpp | 2 +- examples/opengl/overlay_x11/README.X11-OVERLAYS | 2 +- examples/opengl/overlay_x11/main.cpp | 2 +- examples/opengl/sharedbox/globjwin.cpp | 2 +- examples/opengl/sharedbox/main.cpp | 2 +- examples/opengl/texture/globjwin.cpp | 2 +- examples/opengl/texture/main.cpp | 2 +- examples/picture/picture.cpp | 2 +- examples/popup/popup.cpp | 2 +- examples/process/process.cpp | 2 +- examples/progress/progress.cpp | 2 +- examples/progressbar/main.cpp | 2 +- examples/qfd/fontdisplayer.cpp | 2 +- examples/qfd/qfd.cpp | 2 +- examples/qmag/qmag.cpp | 2 +- examples/qwerty/main.cpp | 2 +- examples/qwerty/qwerty.cpp | 2 +- examples/rangecontrols/main.cpp | 2 +- examples/regexptester/main.cpp | 2 +- examples/regexptester/regexptester.cpp | 2 +- examples/richtext/main.cpp | 2 +- examples/richtext/richtext.cpp | 2 +- examples/rot13/rot13.cpp | 2 +- examples/scribble/main.cpp | 2 +- examples/scribble/scribble.cpp | 2 +- examples/scrollview/scrollview.cpp | 2 +- examples/showimg/main.cpp | 2 +- examples/showimg/showimg.cpp | 2 +- examples/sound/sound.cpp | 2 +- examples/splitter/splitter.cpp | 2 +- examples/sql/blob/main.cpp | 2 +- examples/sql/overview/basicbrowsing/main.cpp | 2 +- examples/sql/overview/basicbrowsing2/main.cpp | 2 +- examples/sql/overview/basicdatamanip/main.cpp | 2 +- examples/sql/overview/connect1/main.cpp | 2 +- examples/sql/overview/create_connections/main.cpp | 2 +- examples/sql/overview/custom1/main.h | 2 +- examples/sql/overview/delete/main.cpp | 2 +- examples/sql/overview/extract/main.cpp | 2 +- examples/sql/overview/form1/main.cpp | 2 +- examples/sql/overview/form2/main.h | 2 +- examples/sql/overview/insert/main.cpp | 2 +- examples/sql/overview/insert2/main.cpp | 2 +- examples/sql/overview/navigating/main.cpp | 2 +- examples/sql/overview/order1/main.cpp | 2 +- examples/sql/overview/order2/main.cpp | 2 +- examples/sql/overview/retrieve1/main.cpp | 2 +- examples/sql/overview/retrieve2/main.cpp | 2 +- examples/sql/overview/subclass1/main.cpp | 2 +- examples/sql/overview/subclass2/main.h | 2 +- examples/sql/overview/subclass3/main.h | 2 +- examples/sql/overview/subclass4/main.h | 2 +- examples/sql/overview/subclass5/main.h | 2 +- examples/sql/overview/table1/main.cpp | 2 +- examples/sql/overview/table2/main.cpp | 2 +- examples/sql/overview/table3/main.h | 2 +- examples/sql/overview/table4/main.h | 2 +- examples/sql/overview/update/main.cpp | 2 +- examples/sql/sqltable/main.cpp | 2 +- examples/tabdialog/main.cpp | 2 +- examples/tabdialog/tabdialog.cpp | 2 +- examples/table/bigtable/main.cpp | 2 +- examples/table/small-table-demo/main.cpp | 2 +- examples/table/statistics/main.cpp | 2 +- examples/tablet/canvas.cpp | 2 +- examples/tablet/main.cpp | 2 +- examples/tablet/scribble.cpp | 2 +- examples/tetrix/qtetrix.cpp | 2 +- examples/tetrix/tqdragapp.h | 2 +- examples/textedit/main.cpp | 2 +- examples/textedit/textedit.cpp | 2 +- examples/themes/main.cpp | 2 +- examples/themes/metal.cpp | 2 +- examples/themes/themes.cpp | 2 +- examples/themes/wood.cpp | 2 +- examples/thread/prodcons/prodcons.cpp | 2 +- examples/thread/semaphores/main.cpp | 2 +- examples/tictac/main.cpp | 2 +- examples/tictac/tictac.cpp | 2 +- examples/tooltip/main.cpp | 2 +- examples/tooltip/tooltip.cpp | 2 +- examples/toplevel/main.cpp | 2 +- examples/tqdir/tqdir.cpp | 2 +- examples/tux/tux.cpp | 2 +- examples/widgets/main.cpp | 2 +- examples/widgets/widgets.cpp | 2 +- examples/wizard/main.cpp | 2 +- examples/wizard/wizard.cpp | 2 +- examples/xform/xform.cpp | 2 +- examples/xml/outliner/main.cpp | 2 +- examples/xml/tagreader-with-features/tagreader.cpp | 2 +- include/ntqapplication.h | 1 - include/private/qapplication_p.h | 1 - include/private/tqapplication_p.h | 1 + include/qconfig-dist.h | 1 - include/qconfig-large.h | 1 - include/qconfig-medium.h | 1 - include/qconfig-minimal.h | 1 - include/qconfig-small.h | 1 - include/tqapplication.h | 1 + include/tqconfig-dist.h | 1 + include/tqconfig-large.h | 1 + include/tqconfig-medium.h | 1 + include/tqconfig-minimal.h | 1 + include/tqconfig-small.h | 1 + .../src/accessible/widgets/tqaccessiblewidget.cpp | 2 +- plugins/src/codecs/cn/main.cpp | 2 +- .../src/inputmethods/xim/qximinputcontext_x11.cpp | 4 +- qmake/Makefile.unix | 8 +- qmake/Makefile.win32-g++ | 6 +- qmake/book/qmake-pch.leaf | 2 +- qmake/examples/precompile/main.cpp | 2 +- qmake/examples/precompile/stable.h | 2 +- qmake/examples/tutorial/main.cpp | 2 +- src/3rdparty/sqlite/config.h | 2 +- src/3rdparty/sqlite/trolltech.patch | 2 +- src/canvas/tqcanvas.cpp | 2 +- src/codecs/tqtextcodecfactory.cpp | 2 +- src/dialogs/tqcolordialog.cpp | 2 +- src/dialogs/tqdialog.cpp | 4 +- src/dialogs/tqerrormessage.cpp | 2 +- src/dialogs/tqfiledialog.cpp | 6 +- src/dialogs/tqfontdialog.cpp | 2 +- src/dialogs/tqinputdialog.cpp | 2 +- src/dialogs/tqmessagebox.cpp | 2 +- src/dialogs/tqmessagebox.h | 2 +- src/dialogs/tqprintdialog.cpp | 8 +- src/dialogs/tqprogressdialog.cpp | 2 +- src/dialogs/tqtabdialog.cpp | 2 +- src/dialogs/tqwizard.cpp | 2 +- src/inputmethod/tqinputcontextfactory.cpp | 2 +- src/kernel/ntqapplication.h | 532 -- src/kernel/qapplication.cpp | 4969 --------------- src/kernel/qapplication_p.h | 95 - src/kernel/qapplication_x11.cpp | 6732 -------------------- src/kernel/qdnd_x11.cpp | 2 +- src/kernel/qt_kernel.pri | 12 +- src/kernel/qt_pch.h | 2 +- src/kernel/qtaddons_x11.cpp | 2 +- src/kernel/tqabstractlayout.cpp | 2 +- src/kernel/tqaccel.cpp | 2 +- src/kernel/tqaccessible.cpp | 2 +- src/kernel/tqapplication.cpp | 4969 +++++++++++++++ src/kernel/tqapplication.h | 532 ++ src/kernel/tqapplication_p.h | 95 + src/kernel/tqapplication_x11.cpp | 6732 ++++++++++++++++++++ src/kernel/tqclipboard.cpp | 4 +- src/kernel/tqclipboard_x11.cpp | 12 +- src/kernel/tqcolor_x11.cpp | 4 +- src/kernel/tqcursor_x11.cpp | 2 +- src/kernel/tqdesktopwidget_x11.cpp | 4 +- src/kernel/tqdragobject.cpp | 2 +- src/kernel/tqdrawutil.cpp | 2 +- src/kernel/tqevent.cpp | 2 +- src/kernel/tqeventloop.cpp | 2 +- src/kernel/tqeventloop_unix.cpp | 2 +- src/kernel/tqeventloop_unix_glib.cpp | 2 +- src/kernel/tqeventloop_x11.cpp | 8 +- src/kernel/tqeventloop_x11_glib.cpp | 8 +- src/kernel/tqfont.cpp | 2 +- src/kernel/tqfont_x11.cpp | 2 +- src/kernel/tqfontdatabase.cpp | 4 +- src/kernel/tqiconset.cpp | 2 +- src/kernel/tqimage.cpp | 2 +- src/kernel/tqinputcontext.cpp | 2 +- src/kernel/tqinputcontext_x11.cpp | 2 +- src/kernel/tqlayout.cpp | 2 +- src/kernel/tqlocalfs.cpp | 2 +- src/kernel/tqmime.cpp | 2 +- src/kernel/tqmotifdnd_x11.cpp | 2 +- src/kernel/tqnamespace.h | 6 +- src/kernel/tqobject.cpp | 4 +- src/kernel/tqpaintdevice_x11.cpp | 2 +- src/kernel/tqpainter.cpp | 2 +- src/kernel/tqpixmap.cpp | 2 +- src/kernel/tqpixmap_x11.cpp | 6 +- src/kernel/tqprinter_unix.cpp | 2 +- src/kernel/tqprocess.cpp | 2 +- src/kernel/tqprocess_unix.cpp | 2 +- src/kernel/tqpsprinter.cpp | 2 +- src/kernel/tqrichtext.cpp | 2 +- src/kernel/tqrichtext_p.h | 2 +- src/kernel/tqsimplerichtext.cpp | 2 +- src/kernel/tqsizegrip.cpp | 4 +- src/kernel/tqsocketnotifier.cpp | 2 +- src/kernel/tqsound_x11.cpp | 2 +- src/kernel/tqstyle.cpp | 2 +- src/kernel/tqt3.h | 2 +- src/kernel/tqtextlayout.cpp | 2 +- src/kernel/tqthread.cpp | 2 +- src/kernel/tqthread_unix.cpp | 2 +- src/kernel/tqtimer.cpp | 2 +- src/kernel/tqtranslator.cpp | 2 +- src/kernel/tqurl.cpp | 2 +- src/kernel/tqwidget.cpp | 4 +- src/kernel/tqwidget_p.h | 2 +- src/kernel/tqwidget_x11.cpp | 20 +- src/network/tqdns.cpp | 2 +- src/opengl/tqgl_x11.cpp | 2 +- src/opengl/tqglcolormap.cpp | 2 +- src/qt.pro | 6 +- src/qt_install.pri | 4 +- src/sql/drivers/odbc/tqsql_odbc.cpp | 2 +- src/sql/tqdatatable.cpp | 2 +- src/sql/tqsqldatabase.cpp | 2 +- src/sql/tqsqlmanager_p.cpp | 2 +- src/styles/tqcommonstyle.cpp | 2 +- src/styles/tqinterlacestyle.cpp | 2 +- src/styles/tqmotifplusstyle.cpp | 2 +- src/styles/tqmotifstyle.cpp | 2 +- src/styles/tqplatinumstyle.cpp | 2 +- src/styles/tqsgistyle.cpp | 2 +- src/styles/tqstylefactory.cpp | 2 +- src/styles/tqwindowsstyle.cpp | 2 +- src/table/tqtable.cpp | 2 +- src/tools/qconfig-dist.h | 11 - src/tools/qconfig-large.h | 40 - src/tools/qconfig-medium.h | 95 - src/tools/qconfig-minimal.h | 83 - src/tools/qconfig-small.h | 76 - src/tools/tqcomlibrary.cpp | 2 +- src/tools/tqcomponentfactory.cpp | 2 +- src/tools/tqconfig-dist.h | 11 + src/tools/tqconfig-large.h | 40 + src/tools/tqconfig-medium.h | 95 + src/tools/tqconfig-minimal.h | 83 + src/tools/tqconfig-small.h | 76 + src/tools/tqglobal.cpp | 2 +- src/tools/tqglobal.h | 14 +- src/tools/tqthreadstorage_unix.cpp | 2 +- src/tqmoc/tqmoc.y | 2 +- src/tqmoc/tqmoc_yacc.cpp | 2 +- src/widgets/tqbutton.cpp | 2 +- src/widgets/tqbuttongroup.cpp | 2 +- src/widgets/tqcheckbox.cpp | 2 +- src/widgets/tqcombobox.cpp | 2 +- src/widgets/tqdatetimeedit.cpp | 3 +- src/widgets/tqdial.cpp | 2 +- src/widgets/tqdialogbuttons.cpp | 2 +- src/widgets/tqdockarea.cpp | 2 +- src/widgets/tqdockwindow.cpp | 2 +- src/widgets/tqeffects.cpp | 2 +- src/widgets/tqgrid.cpp | 2 +- src/widgets/tqgroupbox.cpp | 2 +- src/widgets/tqhbox.cpp | 2 +- src/widgets/tqheader.cpp | 2 +- src/widgets/tqiconview.cpp | 2 +- src/widgets/tqlabel.cpp | 2 +- src/widgets/tqlineedit.cpp | 2 +- src/widgets/tqlistbox.cpp | 2 +- src/widgets/tqlistview.cpp | 2 +- src/widgets/tqmainwindow.cpp | 2 +- src/widgets/tqmenubar.cpp | 4 +- src/widgets/tqmenudata.cpp | 2 +- src/widgets/tqmultilineedit.cpp | 2 +- src/widgets/tqpopupmenu.cpp | 2 +- src/widgets/tqpushbutton.cpp | 2 +- src/widgets/tqradiobutton.cpp | 2 +- src/widgets/tqscrollbar.cpp | 2 +- src/widgets/tqscrollview.cpp | 2 +- src/widgets/tqslider.cpp | 2 +- src/widgets/tqspinbox.cpp | 2 +- src/widgets/tqsplashscreen.cpp | 2 +- src/widgets/tqsplitter.cpp | 2 +- src/widgets/tqtabbar.cpp | 2 +- src/widgets/tqtabwidget.cpp | 2 +- src/widgets/tqtextbrowser.cpp | 2 +- src/widgets/tqtextedit.cpp | 3 +- src/widgets/tqtitlebar.cpp | 4 +- src/widgets/tqtoolbox.cpp | 2 +- src/widgets/tqtoolbutton.cpp | 2 +- src/widgets/tqtooltip.cpp | 2 +- src/widgets/tqwhatsthis.cpp | 2 +- src/widgets/tqwidgetresizehandler.cpp | 2 +- src/widgets/tqwidgetstack.cpp | 2 +- src/workspace/tqworkspace.cpp | 2 +- tools/assistant/config.cpp | 2 +- tools/assistant/finddialog.ui.h | 2 +- tools/assistant/helpdialogimpl.cpp | 2 +- tools/assistant/helpwindow.cpp | 2 +- tools/assistant/index.cpp | 2 +- tools/assistant/main.cpp | 2 +- tools/assistant/mainwindow.ui | 2 +- tools/assistant/settingsdialogimpl.cpp | 2 +- tools/designer/designer/actiondnd.cpp | 2 +- tools/designer/designer/command.cpp | 2 +- tools/designer/designer/customwidgeteditorimpl.cpp | 2 +- tools/designer/designer/dbconnectionsimpl.cpp | 2 +- tools/designer/designer/designer_de.ts | 2 +- tools/designer/designer/designer_fr.ts | 2 +- tools/designer/designer/designer_pch.h | 2 +- tools/designer/designer/designerapp.h | 2 +- tools/designer/designer/formfile.cpp | 2 +- tools/designer/designer/formwindow.cpp | 3 +- tools/designer/designer/hierarchyview.cpp | 2 +- tools/designer/designer/listeditor.ui.h | 2 +- tools/designer/designer/mainwindowactions.cpp | 2 +- tools/designer/designer/menubareditor.cpp | 2 +- tools/designer/designer/metadatabase.cpp | 2 +- tools/designer/designer/multilineeditorimpl.cpp | 2 +- tools/designer/designer/orderindicator.cpp | 2 +- tools/designer/designer/outputwindow.cpp | 2 +- .../designer/paletteeditoradvancedimpl.cpp | 2 +- tools/designer/designer/paletteeditorimpl.cpp | 2 +- tools/designer/designer/pixmapchooser.cpp | 2 +- tools/designer/designer/popupmenueditor.cpp | 2 +- tools/designer/designer/project.cpp | 2 +- tools/designer/designer/propertyeditor.cpp | 2 +- tools/designer/designer/propertyeditor.h | 2 +- tools/designer/designer/resource.cpp | 2 +- tools/designer/designer/sizehandle.cpp | 2 +- tools/designer/designer/startdialogimpl.cpp | 2 +- tools/designer/designer/styledbutton.cpp | 2 +- tools/designer/designer/syntaxhighlighter_html.cpp | 2 +- tools/designer/designer/tqcompletionedit.cpp | 2 +- tools/designer/designer/widgetfactory.cpp | 2 +- tools/designer/designer/workspace.cpp | 2 +- tools/designer/editor/completion.cpp | 2 +- tools/designer/editor/conf.cpp | 2 +- tools/designer/editor/editor.cpp | 2 +- tools/designer/editor/parenmatcher.cpp | 2 +- .../designer/examples/addressbook/addressbook.ui.h | 2 +- tools/designer/examples/addressbook/main.cpp | 2 +- tools/designer/examples/book/book1/main.cpp | 2 +- tools/designer/examples/book/book2/main.cpp | 2 +- tools/designer/examples/book/book3/main.cpp | 2 +- tools/designer/examples/book/book4/main.cpp | 2 +- tools/designer/examples/book/book5/main.cpp | 2 +- tools/designer/examples/book/book6/main.cpp | 2 +- tools/designer/examples/book/book7/main.cpp | 2 +- tools/designer/examples/book/book8/main.cpp | 2 +- tools/designer/examples/colortool/main.cpp | 2 +- tools/designer/examples/colortool/mainform.ui | 2 +- tools/designer/examples/credit/main.cpp | 2 +- .../designer/examples/filechooser/widget/main.cpp | 2 +- tools/designer/examples/metric/main.cpp | 2 +- tools/designer/examples/multiclip/main.cpp | 2 +- tools/designer/examples/multiclip/multiclip.ui | 2 +- tools/designer/examples/receiver1/main.cpp | 2 +- tools/designer/examples/receiver2/main.cpp | 2 +- tools/designer/examples/richedit/main.cpp | 2 +- tools/designer/examples/richedit/richedit.ui | 2 +- tools/designer/examples/sizeaware/main.cpp | 2 +- tools/designer/examples/vcr/main.cpp | 2 +- .../plugins/cppeditor/editorinterfaceimpl.cpp | 2 +- .../cppeditor/sourcetemplateinterfaceimpl.cpp | 2 +- .../plugins/cppeditor/syntaxhighliter_cpp.cpp | 2 +- tools/designer/plugins/dlg/main.cpp | 2 +- tools/designer/plugins/glade/glade2ui.cpp | 2 +- tools/designer/plugins/glade/main.cpp | 2 +- tools/designer/plugins/kdevdlg/main.cpp | 2 +- tools/designer/plugins/rc/main.cpp | 2 +- tools/designer/plugins/wizards/main.cpp | 2 +- tools/designer/shared/globaldefs.h | 2 +- tools/designer/shared/widgetdatabase.cpp | 2 +- tools/designer/tools/tqtconv2ui/main.cpp | 2 +- tools/designer/tools/tqtcreatecw/main.cpp | 2 +- tools/designer/tquic/form.cpp | 2 +- tools/designer/tquic/main.cpp | 2 +- tools/designer/uilib/test/main.cpp | 2 +- tools/designer/uilib/tqwidgetfactory.cpp | 2 +- tools/linguist/book/linguist-manager.leaf | 4 +- tools/linguist/book/linguist-programmer.leaf | 18 +- tools/linguist/linguist/main.cpp | 2 +- tools/linguist/linguist/msgedit.cpp | 2 +- tools/linguist/linguist/phrase.cpp | 2 +- tools/linguist/linguist/phrasebookbox.cpp | 2 +- tools/linguist/linguist/trwindow.cpp | 2 +- tools/linguist/shared/metatranslator.cpp | 2 +- tools/linguist/tutorial/tt1/main.cpp | 2 +- tools/linguist/tutorial/tt2/main.cpp | 2 +- tools/linguist/tutorial/tt2/mainwindow.cpp | 2 +- tools/linguist/tutorial/tt3/main.cpp | 2 +- tools/linguist/tutorial/tt3/mainwindow.cpp | 2 +- tools/qconfig/LICENSE.GPL | 280 - tools/qconfig/main.cpp | 733 --- tools/qconfig/main.h | 86 - tools/qconfig/qconfig.pro | 7 - tools/qtconfig/colorbutton.cpp | 2 +- tools/qtconfig/main.cpp | 2 +- tools/qtconfig/mainwindow.cpp | 4 +- tools/qtconfig/paletteeditoradvanced.cpp | 2 +- tools/tools.pro | 2 +- tools/tqconfig/LICENSE.GPL | 280 + tools/tqconfig/main.cpp | 733 +++ tools/tqconfig/main.h | 86 + tools/tqconfig/qconfig.pro | 7 + translations/qt_ar.ts | 2 +- translations/qt_ca.ts | 2 +- translations/qt_cs.ts | 2 +- translations/qt_de.ts | 2 +- translations/qt_es.ts | 2 +- translations/qt_fr.ts | 2 +- translations/qt_he.ts | 2 +- translations/qt_it.ts | 2 +- translations/qt_ja.ts | 2 +- translations/qt_nb.ts | 2 +- translations/qt_pt-br.ts | 2 +- translations/qt_pt.ts | 2 +- translations/qt_ru.ts | 2 +- translations/qt_sk.ts | 2 +- translations/qt_tr.ts | 2 +- translations/qt_zh-cn.ts | 2 +- translations/qt_zh-tw.ts | 2 +- translations/template.ts | 2 +- tutorial/t1/main.cpp | 2 +- tutorial/t10/main.cpp | 2 +- tutorial/t11/main.cpp | 2 +- tutorial/t12/main.cpp | 2 +- tutorial/t13/gamebrd.cpp | 2 +- tutorial/t13/main.cpp | 2 +- tutorial/t14/gamebrd.cpp | 2 +- tutorial/t14/main.cpp | 2 +- tutorial/t15/main.h | 2 +- tutorial/t2/main.cpp | 2 +- tutorial/t3/main.cpp | 2 +- tutorial/t4/main.cpp | 2 +- tutorial/t5/main.cpp | 2 +- tutorial/t6/main.cpp | 2 +- tutorial/t7/main.cpp | 2 +- tutorial/t8/main.cpp | 2 +- tutorial/t9/main.cpp | 2 +- 821 files changed, 18902 insertions(+), 18714 deletions(-) delete mode 100644 doc/html/ntqapplication.html delete mode 100644 doc/html/qapplication-h.html create mode 100644 doc/html/tqapplication-h.html create mode 100644 doc/html/tqapplication-members.html create mode 100644 doc/html/tqapplication.html delete mode 120000 include/ntqapplication.h delete mode 120000 include/private/qapplication_p.h create mode 120000 include/private/tqapplication_p.h delete mode 120000 include/qconfig-dist.h delete mode 120000 include/qconfig-large.h delete mode 120000 include/qconfig-medium.h delete mode 120000 include/qconfig-minimal.h delete mode 120000 include/qconfig-small.h create mode 120000 include/tqapplication.h create mode 120000 include/tqconfig-dist.h create mode 120000 include/tqconfig-large.h create mode 120000 include/tqconfig-medium.h create mode 120000 include/tqconfig-minimal.h create mode 120000 include/tqconfig-small.h delete mode 100644 src/kernel/ntqapplication.h delete mode 100644 src/kernel/qapplication.cpp delete mode 100644 src/kernel/qapplication_p.h delete mode 100644 src/kernel/qapplication_x11.cpp create mode 100644 src/kernel/tqapplication.cpp create mode 100644 src/kernel/tqapplication.h create mode 100644 src/kernel/tqapplication_p.h create mode 100644 src/kernel/tqapplication_x11.cpp delete mode 100644 src/tools/qconfig-dist.h delete mode 100644 src/tools/qconfig-large.h delete mode 100644 src/tools/qconfig-medium.h delete mode 100644 src/tools/qconfig-minimal.h delete mode 100644 src/tools/qconfig-small.h create mode 100644 src/tools/tqconfig-dist.h create mode 100644 src/tools/tqconfig-large.h create mode 100644 src/tools/tqconfig-medium.h create mode 100644 src/tools/tqconfig-minimal.h create mode 100644 src/tools/tqconfig-small.h delete mode 100644 tools/qconfig/LICENSE.GPL delete mode 100644 tools/qconfig/main.cpp delete mode 100644 tools/qconfig/main.h delete mode 100644 tools/qconfig/qconfig.pro create mode 100644 tools/tqconfig/LICENSE.GPL create mode 100644 tools/tqconfig/main.cpp create mode 100644 tools/tqconfig/main.h create mode 100644 tools/tqconfig/qconfig.pro diff --git a/.gitignore b/.gitignore index 7c03d9267..cdb998c83 100644 --- a/.gitignore +++ b/.gitignore @@ -181,8 +181,8 @@ Makefile /examples/xml/outliner/outliner /examples/xml/tagreader/tagreader /examples/xml/tagreader-with-features/tagreader-with-features -/include/ntqconfig.h -/include/ntqmodules.h +/include/tqconfig.h +/include/tqmodules.h /listvieweditor.h /mkspecs/default /plugins/designer/ @@ -191,7 +191,7 @@ Makefile /plugins/sqldrivers/ /plugins/styles/ /qmake/tqmake -/src/tools/qconfig.cpp +/src/tools/tqconfig.cpp /tools/assistant/finddialog.cpp /tools/assistant/finddialog.h /tools/assistant/helpdialog.cpp @@ -294,7 +294,7 @@ Makefile /tools/linguist/tutorial/tt2/tt2 /tools/linguist/tutorial/tt3/tt3 /tools/msg2tqm/msg2tqm -/tools/qconfig/qconfig +/tools/tqconfig/tqconfig /tools/qembed/tqembed /tools/qtconfig/mainwindowbase.cpp /tools/qtconfig/mainwindowbase.h diff --git a/configure b/configure index 1ac52f216..92bdf2227 100755 --- a/configure +++ b/configure @@ -48,10 +48,10 @@ PLATFORM_X11=no PLATFORM_MAC=no PLATFORM_QNX=no -if [ -f $relpath/src/kernel/qapplication_mac.cpp ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then +if [ -f $relpath/src/kernel/tqapplication_mac.cpp ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then # Qt/Mac # ~ the Carbon SDK exists - # ~ src/kernel/qapplication_mac.cpp is present + # ~ src/kernel/tqapplication_mac.cpp is present # ~ this is the internal edition and Qt/Mac sources exist PLATFORM_MAC=maybe fi @@ -337,7 +337,7 @@ while [ "$#" -gt 0 ]; do sysshare) QT_INSTALL_SHARE="$VAL" ;; - qconfig) + tqconfig) CFG_QCONFIG="$VAL" ;; bindir) @@ -853,7 +853,7 @@ while [ "$#" -gt 0 ]; do done #------------------------------------------------------------------------------- -# post initialize QT_INSTALL_* variables, and generate qconfig.cpp +# post initialize QT_INSTALL_* variables, and generate tqconfig.cpp #------------------------------------------------------------------------------- # default $outpath @@ -877,9 +877,9 @@ done # default PREFIX/share [ -z "$QT_INSTALL_SHARE" ] && QT_INSTALL_SHARE=$QT_INSTALL_PREFIX/share -# generate qconfig.cpp +# generate tqconfig.cpp [ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools -cat > $outpath/src/tools/qconfig.cpp.new < $outpath/src/tools/tqconfig.cpp.new <>$outpath/include/qmake/ntqconfig.h <>$outpath/include/qmake/tqconfig.h <>$outpath/include/qmake/ntqmodules.h <>$outpath/include/qmake/tqmodules.h <&2 "No such configuration: $CFG_QCONFIG" OPT_HELP=yes fi @@ -2525,27 +2525,27 @@ if [ "$CFG_EXCEPTION_SUPPORT" = "no" ]; then fi #------------------------------------------------------------------------------- -# part of configuration information goes into ntqmodules.h +# part of configuration information goes into tqmodules.h #------------------------------------------------------------------------------- -rm -f $outpath/include/ntqmodules.h.new -cat >$outpath/include/ntqmodules.h.new << EOF +rm -f $outpath/include/tqmodules.h.new +cat >$outpath/include/tqmodules.h.new << EOF /* These modules are present in this configuration of TQt */ EOF for MODULE in $MODULES; do if [ -d "$relpath/src/$MODULE" ]; then M=`echo $MODULE | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - echo "#define TQT_MODULE_$M" >>$outpath/include/ntqmodules.h.new + echo "#define TQT_MODULE_$M" >>$outpath/include/tqmodules.h.new fi done -# avoid unecessary rebuilds by copying only if ntqmodules.h has changed -if cmp -s $outpath/include/ntqmodules.h $outpath/include/ntqmodules.h.new; then - rm -f $outpath/include/ntqmodules.h.new +# avoid unecessary rebuilds by copying only if tqmodules.h has changed +if cmp -s $outpath/include/tqmodules.h $outpath/include/tqmodules.h.new; then + rm -f $outpath/include/tqmodules.h.new else - [ -f $outpath/include/ntqmodules.h ] && chmod +w $outpath/include/ntqmodules.h - mv -f $outpath/include/ntqmodules.h.new $outpath/include/ntqmodules.h - chmod -w $outpath/include/ntqmodules.h + [ -f $outpath/include/tqmodules.h ] && chmod +w $outpath/include/tqmodules.h + mv -f $outpath/include/tqmodules.h.new $outpath/include/tqmodules.h + chmod -w $outpath/include/tqmodules.h fi #------------------------------------------------------------------------------- @@ -2710,20 +2710,20 @@ TQT_BUILD_KEY="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD TQT_BUILD_KEY=`echo $TQT_BUILD_KEY | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"` #------------------------------------------------------------------------------- -# part of configuration information goes into ntqconfig.h +# part of configuration information goes into tqconfig.h #------------------------------------------------------------------------------- case "$CFG_QCONFIG" in full) - echo "/* Everything */" >$outpath/include/ntqconfig.h.new + echo "/* Everything */" >$outpath/include/tqconfig.h.new ;; *) - QCONFIGFILE=qconfig-$CFG_QCONFIG.h - echo "/* Copied from $QCONFIGFILE */" >$outpath/include/ntqconfig.h.new - cat $relpath/src/tools/$QCONFIGFILE >>$outpath/include/ntqconfig.h.new + QCONFIGFILE=tqconfig-$CFG_QCONFIG.h + echo "/* Copied from $QCONFIGFILE */" >$outpath/include/tqconfig.h.new + cat $relpath/src/tools/$QCONFIGFILE >>$outpath/include/tqconfig.h.new ;; esac -cat >> $outpath/include/ntqconfig.h.new <> $outpath/include/tqconfig.h.new <> $outpath/include/ntqconfig.h.new <> $outpath/include/ntqconfig.h.new << EOF +cat >> $outpath/include/tqconfig.h.new << EOF #if defined(__BIG_ENDIAN__) # define TQ_BYTE_ORDER TQ_BIG_ENDIAN #elif defined(__LITTLE_ENDIAN__) @@ -2747,23 +2747,23 @@ cat >> $outpath/include/ntqconfig.h.new << EOF #endif EOF else -echo "#define TQ_BYTE_ORDER $CFG_ENDIAN" >> $outpath/include/ntqconfig.h.new +echo "#define TQ_BYTE_ORDER $CFG_ENDIAN" >> $outpath/include/tqconfig.h.new fi -cat >> $outpath/include/ntqconfig.h.new << EOF +cat >> $outpath/include/tqconfig.h.new << EOF /* Compile time features */ EOF -[ '!' -z "$LicenseKey" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKey\"" >>$outpath/include/ntqconfig.h.new +[ '!' -z "$LicenseKey" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKey\"" >>$outpath/include/tqconfig.h.new if [ "$CFG_LARGEFILE" = "yes" ]; then - echo "#define QT_LARGEFILE_SUPPORT 64" >>$outpath/include/ntqconfig.h.new + echo "#define QT_LARGEFILE_SUPPORT 64" >>$outpath/include/tqconfig.h.new fi $unixtests/ptrsize.test $XQMAKESPEC $OPT_VERBOSE $relpath $outpath -echo "#define TQT_POINTER_SIZE $?" >>$outpath/include/ntqconfig.h.new +echo "#define TQT_POINTER_SIZE $?" >>$outpath/include/tqconfig.h.new if [ ! -z "$QT_MAC_VERSION" ]; then - echo "#define QT_MACOSX_VERSION ${QT_MAC_VERSION} /*from config.tests*/" >>$outpath/include/ntqconfig.h.new + echo "#define QT_MACOSX_VERSION ${QT_MAC_VERSION} /*from config.tests*/" >>$outpath/include/tqconfig.h.new fi ## find excluded styles and add this to $QCONFIG_FLAGS @@ -2798,7 +2798,7 @@ done if [ -n "$QCONFIG_FLAGS" ]; then for cfg in $QCONFIG_FLAGS; do -cat >>$outpath/include/ntqconfig.h.new << EOF +cat >>$outpath/include/tqconfig.h.new << EOF #ifndef $cfg # define $cfg #endif @@ -2807,13 +2807,13 @@ EOF done fi -# avoid unecessary rebuilds by copying only if ntqconfig.h has changed -if cmp -s $outpath/include/ntqconfig.h $outpath/include/ntqconfig.h.new; then - rm -f $outpath/include/ntqconfig.h.new +# avoid unecessary rebuilds by copying only if tqconfig.h has changed +if cmp -s $outpath/include/tqconfig.h $outpath/include/tqconfig.h.new; then + rm -f $outpath/include/tqconfig.h.new else - [ -f $outpath/include/ntqconfig.h ] && chmod +w $outpath/include/ntqconfig.h - mv $outpath/include/ntqconfig.h.new $outpath/include/ntqconfig.h - chmod -w $outpath/include/ntqconfig.h + [ -f $outpath/include/tqconfig.h ] && chmod +w $outpath/include/tqconfig.h + mv $outpath/include/tqconfig.h.new $outpath/include/tqconfig.h + chmod -w $outpath/include/tqconfig.h fi diff --git a/doc/application-walkthrough.doc b/doc/application-walkthrough.doc index 08669fd98..5d748995d 100644 --- a/doc/application-walkthrough.doc +++ b/doc/application-walkthrough.doc @@ -49,7 +49,7 @@ modern application window tends to use. (See also \link tutorial2.html Tutorial #2\endlink.) It also illustrates some aspects of \l TQWhatsThis (for simple help) and a -typical \c main() using \l QApplication. +typical \c main() using \l TQApplication. Finally, it shows a typical print function based on \l TQPrinter. @@ -77,11 +77,11 @@ Now we'll look at \c main.cpp in detail. \quotefile application/main.cpp \skipto argc \printline argc -\printline QApplication +\printline TQApplication -With the above line, we create a QApplication object with the usual +With the above line, we create a TQApplication object with the usual constructor and let it -parse \e argc and \e argv. QApplication itself takes care of X11-specific +parse \e argc and \e argv. TQApplication itself takes care of X11-specific command-line options like \e -geometry, so the program will automatically behave the way X clients are expected to. @@ -96,13 +96,13 @@ system caption to "Document 1", and \e show() it. \printline connect When the application's last window is closed, it should quit. Both -the signal and the slot are predefined members of QApplication. +the signal and the slot are predefined members of TQApplication. \printline exec Having completed the application's initialization, we start the main event loop (the GUI), and eventually return the error code -that QApplication returns when it leaves the event loop. +that TQApplication returns when it leaves the event loop. \printline } diff --git a/doc/classchart.doc b/doc/classchart.doc index d451d7d6a..1eb1d500a 100644 --- a/doc/classchart.doc +++ b/doc/classchart.doc @@ -107,7 +107,7 @@ - + diff --git a/doc/customstyles.doc b/doc/customstyles.doc index fb6e49382..07cdac219 100644 --- a/doc/customstyles.doc +++ b/doc/customstyles.doc @@ -195,8 +195,8 @@ application's main() function: int main( int argc, char ** argv ) { - QApplication::setStyle( new CustomStyle() ); - // do the usual routine on creating your QApplication object etc. + TQApplication::setStyle( new CustomStyle() ); + // do the usual routine on creating your TQApplication object etc. } \endcode diff --git a/doc/distributingtqt.doc b/doc/distributingtqt.doc index 47be37a41..63c65908c 100644 --- a/doc/distributingtqt.doc +++ b/doc/distributingtqt.doc @@ -100,7 +100,7 @@ Qt searches in the following directories for plugin categories: \endlist Application specific plugin paths can be added using -QApplication::addLibraryPath(). The build-directory of TQt is hardcoded +TQApplication::addLibraryPath(). The build-directory of TQt is hardcoded in the TQt library and can be changed as a part of the installation process (see the \l distributor-example.html Distributor example). diff --git a/doc/dnd.doc b/doc/dnd.doc index bb5b93fa8..8ae297cd3 100644 --- a/doc/dnd.doc +++ b/doc/dnd.doc @@ -140,14 +140,14 @@ information on the clipboard: \code void MyWidget::copy() { - QApplication::clipboard()->setData( + TQApplication::clipboard()->setData( new TQTextDrag(myHighlightedText()) ); } void MyWidget::paste() { TQString text; - if ( TQTextDrag::decode(QApplication::clipboard()->data(), text) ) + if ( TQTextDrag::decode(TQApplication::clipboard()->data(), text) ) insertText( text ); } \endcode @@ -336,12 +336,12 @@ feedback as the drag progresses, to start timers, to scroll the window, or whatever is appropriate (don't forget to stop the scrolling and timers in a dragLeaveEvent() though). -The QApplication object (available as the \c tqApp global) also +The TQApplication object (available as the \c tqApp global) also provides some drag and drop related functions: -\l{QApplication::setStartDragTime()}, -\l{QApplication::setStartDragDistance()}, and their corresponding -getters, \l{QApplication::startDragTime()} and -\l{QApplication::startDragDistance()}. +\l{TQApplication::setStartDragTime()}, +\l{TQApplication::setStartDragDistance()}, and their corresponding +getters, \l{TQApplication::startDragTime()} and +\l{TQApplication::startDragDistance()}. \section1 Inter-operating with Other Applications diff --git a/doc/features.doc b/doc/features.doc index 5f143ec55..9dd976245 100644 --- a/doc/features.doc +++ b/doc/features.doc @@ -41,12 +41,12 @@ \title The Feature Definition File -By modifying the configured \c ntqconfig.h file from src/tools, you +By modifying the configured \c tqconfig.h file from src/tools, you can define a subset of the full TQt functionality that you wish to -be available in your installation. The -qconfig option to +be available in your installation. The -tqconfig option to configure is used to select the configuration. -The \c ntqconfig.h definition file simply defines macros to disable +The \c tqconfig.h definition file simply defines macros to disable features. Some features are dependent on other features and these dependencies are expressed in \c tqfeatures.h. diff --git a/doc/html/aclock-example.html b/doc/html/aclock-example.html index 3f7397512..31574d780 100644 --- a/doc/html/aclock-example.html +++ b/doc/html/aclock-example.html @@ -247,20 +247,20 @@ void AnalogClock::drawClock( TQPaint *****************************************************************************/ #include "aclock.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); AnalogClock *clock = new AnalogClock; if ( argc == 2 && strcmp( argv[1], "-transparent" ) == 0 ) clock->setAutoMask( TRUE ); clock->resize( 100, 100 ); - a.setMainWidget( clock ); + a.setMainWidget( clock ); clock->setCaption("TQt Example - Analog Clock"); clock->show(); - int result = a.exec(); + int result = a.exec(); delete clock; return result; } diff --git a/doc/html/addressbook-example.html b/doc/html/addressbook-example.html index 3866fc7b5..ce4807a53 100644 --- a/doc/html/addressbook-example.html +++ b/doc/html/addressbook-example.html @@ -108,7 +108,7 @@ protected: #include <tqpopupmenu.h> #include <tqmenubar.h> #include <tqstatusbar.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqfiledialog.h> ABMainWindow::ABMainWindow() @@ -140,7 +140,7 @@ void ABMainWindow::setupMenuBar() file->insertItem( TQPixmap( "fileprint.xpm" ), "Print...", this, TQ_SLOT( filePrint() ), CTRL + Key_P ); file->insertSeparator(); file->insertItem( "Close", this, TQ_SLOT( closeWindow() ), CTRL + Key_W ); - file->insertItem( "Quit", tqApp, TQ_SLOT( quit() ), CTRL + Key_Q ); + file->insertItem( "Quit", tqApp, TQ_SLOT( quit() ), CTRL + Key_Q ); } void ABMainWindow::setupFileTools() @@ -633,21 +633,21 @@ void ABCentralWidget::findEntries() ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "mainwindow.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ABMainWindow *mw = new ABMainWindow(); mw->setCaption( "TQt Example - Addressbook" ); - a.setMainWidget( mw ); + a.setMainWidget( mw ); mw->show(); - a.connect( &a, TQ_SIGNAL( lastWindowClosed() ), &a, TQ_SLOT( quit() ) ); - int result = a.exec(); + a.connect( &a, TQ_SIGNAL( lastWindowClosed() ), &a, TQ_SLOT( quit() ) ); + int result = a.exec(); delete mw; return result; } diff --git a/doc/html/annotated.html b/doc/html/annotated.html index fa5d1ba8a..4cd8b01cf 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -40,7 +40,7 @@ body { background: #ffffff; color: black; } TQAccessibleObjectImplements parts of the TQAccessibleInterface for TQObjects TQActionAbstract user interface action that can appear both in menus and tool bars TQActionGroupGroups actions together -TQApplicationManages the GUI application's control flow and main settings +TQApplicationManages the GUI application's control flow and main settings TQAsciiCacheTemplate class that provides a cache based on char* keys TQAsciiCacheIteratorIterator for TQAsciiCache collections TQAsciiDictTemplate class that provides a dictionary based on char* keys diff --git a/doc/html/application.html b/doc/html/application.html index e0ac6014d..1ea6126cb 100644 --- a/doc/html/application.html +++ b/doc/html/application.html @@ -38,7 +38,7 @@ a statusbar, etc.

TQActionAbstract user interface action that can appear both in menus and tool bars
TQActionGroupGroups actions together -
TQApplicationManages the GUI application's control flow and main settings +
TQApplicationManages the GUI application's control flow and main settings
TQDockAreaManages and lays out TQDockWindows
TQDockWindowWidget which can be docked inside a TQDockArea or floated as a top level window on the desktop
TQEventLoopManages the event queue diff --git a/doc/html/archivesearch-example.html b/doc/html/archivesearch-example.html index 91c263877..e4f792811 100644 --- a/doc/html/archivesearch-example.html +++ b/doc/html/archivesearch-example.html @@ -99,7 +99,7 @@ void ArchiveDialog::search() "Please type a search string.", TQMessageBox::Ok, TQMessageBox::NoButton); } else { - TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor)); + TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor)); articleSearcher.setHost("lists.trolltech.com"); @@ -138,7 +138,7 @@ void ArchiveDialog::searchDone( bool error ) } } - TQApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } @@ -155,18 +155,18 @@ void ArchiveDialog::searchDone( bool error ) *****************************************************************************/ #include "archivedialog.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main(int argc, char **argv) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ArchiveDialog ad; ad.show(); - TQObject::connect( &a, TQ_SIGNAL(lastWindowClosed()), - &a, TQ_SLOT(quit()) ); + TQObject::connect( &a, TQ_SIGNAL(lastWindowClosed()), + &a, TQ_SLOT(quit()) ); - return a.exec(); + return a.exec(); } diff --git a/doc/html/biff-example.html b/doc/html/biff-example.html index f4566aa11..8ff0a2884 100644 --- a/doc/html/biff-example.html +++ b/doc/html/biff-example.html @@ -171,17 +171,17 @@ void Biff::paintEvent( ntqapplication.h> +#include <tqapplication.h> #include "biff.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); Biff b; - a.setMainWidget( &b ); + a.setMainWidget( &b ); b.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/bigtable-example.html b/doc/html/bigtable-example.html index ef863467f..bdf714f78 100644 --- a/doc/html/bigtable-example.html +++ b/doc/html/bigtable-example.html @@ -46,7 +46,7 @@ keep track of the cells that are actually in use. ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqtable.h> // Table size @@ -93,12 +93,12 @@ private: int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); MyTable table( numRows, numCols ); - app.setMainWidget( &table ); + app.setMainWidget( &table ); table.show(); - return app.exec(); + return app.exec(); } diff --git a/doc/html/buttongroups-example.html b/doc/html/buttongroups-example.html index c130f24d0..2cda99aba 100644 --- a/doc/html/buttongroups-example.html +++ b/doc/html/buttongroups-example.html @@ -211,19 +211,19 @@ void ButtonsGroups::slotChangeGrp3State() *****************************************************************************/ #include "buttongroups.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ButtonsGroups buttonsgroups; buttonsgroups.resize( 500, 250 ); buttonsgroups.setCaption( "TQt Example - Buttongroups" ); - a.setMainWidget( &buttonsgroups ); + a.setMainWidget( &buttonsgroups ); buttonsgroups.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/canvas-chart-example.html b/doc/html/canvas-chart-example.html index 9b8be423b..fb251c48f 100644 --- a/doc/html/canvas-chart-example.html +++ b/doc/html/canvas-chart-example.html @@ -249,7 +249,7 @@ private: #include "setdataform.h" #include <tqaction.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcombobox.h> #include <tqfile.h> #include <tqfiledialog.h> @@ -613,7 +613,7 @@ void ChartForm::fileQuit() { if ( okToClear() ) { saveOptions(); - tqApp->exit( 0 ); + tqApp->exit( 0 ); } } @@ -778,26 +778,26 @@ void ChartForm::helpAboutTQt()


Main: -

#include <ntqapplication.h>
+

#include <tqapplication.h>
 #include "chartform.h"
 
 
 int main( int argc, char *argv[] )
 {
-    TQApplication app( argc, argv );
+    TQApplication app( argc, argv );
 
     TQString filename;
-    if ( app.argc() > 1 ) {
-        filename = app.argv()[1];
+    if ( app.argc() > 1 ) {
+        filename = app.argv()[1];
         if ( !filename.endsWith( ".cht" ) )
             filename = TQString::null;
     }
 
     ChartForm *cf = new ChartForm( filename );
-    app.setMainWidget( cf );
+    app.setMainWidget( cf );
     cf->show();
 
-    return app.exec();
+    return app.exec();
 }
 
diff --git a/doc/html/canvas-example.html b/doc/html/canvas-example.html index 782592399..d0d4a990d 100644 --- a/doc/html/canvas-example.html +++ b/doc/html/canvas-example.html @@ -137,7 +137,7 @@ private: #include <tqstatusbar.h> #include <tqmessagebox.h> #include <tqmenubar.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpainter.h> #include <tqprinter.h> #include <tqlabel.h> @@ -445,7 +445,7 @@ static TQImage *logoimg; file->insertSeparator(); file->insertItem("&Print...", this, TQ_SLOT(print()), CTRL+Key_P); file->insertSeparator(); - file->insertItem("E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q); + file->insertItem("E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q); menu->insertItem("&File", file); TQPopupMenu* edit = new TQPopupMenu( menu ); @@ -535,9 +535,9 @@ void Main::newView() { // Open a new view... have it delete when closed. Main *m = new Main(canvas, 0, 0, WDestructiveClose); - tqApp->setMainWidget(m); + tqApp->setMainWidget(m); m->show(); - tqApp->setMainWidget(0); + tqApp->setMainWidget(0); } void Main::clear() @@ -878,7 +878,7 @@ void Main::addRectangle()

#include <tqstatusbar.h>
 #include <tqmessagebox.h>
 #include <tqmenubar.h>
-#include <ntqapplication.h>
+#include <tqapplication.h>
 #include <tqimage.h>
 
 #include "canvas.h"
@@ -890,7 +890,7 @@ extern TQString logo_fn;
 
 int main(int argc, char** argv)
 {
-    TQApplication app(argc,argv);
+    TQApplication app(argc,argv);
 
     if ( argc > 1 )
         butterfly_fn = argv[1];
@@ -907,15 +907,15 @@ int main(int argc, char** argv)
     Main m(canvas);
     m.resize(m.sizeHint());
     m.setCaption("TQt Example - Canvas");
-    if ( TQApplication::desktop()->width() > m.width() + 10
-        && TQApplication::desktop()->height() > m.height() +30 )
+    if ( TQApplication::desktop()->width() > m.width() + 10
+        && TQApplication::desktop()->height() > m.height() +30 )
         m.show();
     else
         m.showMaximized();
 
-    TQObject::connect( tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit()) );
+    TQObject::connect( tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit()) );
 
-    return app.exec();
+    return app.exec();
 }
 
 
diff --git a/doc/html/chart-chartform-cpp.html b/doc/html/chart-chartform-cpp.html index 5b1b18808..66618d380 100644 --- a/doc/html/chart-chartform-cpp.html +++ b/doc/html/chart-chartform-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } #include "setdataform.h" #include <tqaction.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcombobox.h> #include <tqfile.h> #include <tqfiledialog.h> @@ -401,7 +401,7 @@ void ChartForm::fileQuit() { if ( okToClear() ) { saveOptions(); - tqApp->exit( 0 ); + tqApp->exit( 0 ); } } diff --git a/doc/html/chart-element-cpp.html b/doc/html/chart-element-cpp.html index 2317ac727..4fe12aa05 100644 --- a/doc/html/chart-element-cpp.html +++ b/doc/html/chart-element-cpp.html @@ -64,28 +64,28 @@ void Element::setValuePattern( int valuePattern ) double Element::proX( int index ) const { - Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); + Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); return m_propoints[2 * index]; } double Element::proY( int index ) const { - Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); + Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); return m_propoints[(2 * index) + 1]; } void Element::setProX( int index, double value ) { - Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); + Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); m_propoints[2 * index] = value; } void Element::setProY( int index, double value ) { - Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); + Q_ASSERT(index >= 0 && index < MAX_PROPOINTS); m_propoints[(2 * index) + 1] = value; } diff --git a/doc/html/chart-main-cpp.html b/doc/html/chart-main-cpp.html index c8bb01181..9b737743c 100644 --- a/doc/html/chart-main-cpp.html +++ b/doc/html/chart-main-cpp.html @@ -31,26 +31,26 @@ body { background: #ffffff; color: black; }

chart/main.cpp Example File

-
#include <ntqapplication.h>
+
#include <tqapplication.h>
 #include "chartform.h"
 
 
 int main( int argc, char *argv[] )
 {
-    TQApplication app( argc, argv );
+    TQApplication app( argc, argv );
 
     TQString filename;
-    if ( app.argc() > 1 ) {
-        filename = app.argv()[1];
+    if ( app.argc() > 1 ) {
+        filename = app.argv()[1];
         if ( !filename.endsWith( ".cht" ) )
             filename = TQString::null;
     }
 
     ChartForm *cf = new ChartForm( filename );
-    app.setMainWidget( cf );
+    app.setMainWidget( cf );
     cf->show();
 
-    return app.exec();
+    return app.exec();
 }
 


diff --git a/doc/html/checklists-example.html b/doc/html/checklists-example.html index 539c0c939..cb59c7268 100644 --- a/doc/html/checklists-example.html +++ b/doc/html/checklists-example.html @@ -254,19 +254,19 @@ void CheckLists::copy2to3() *****************************************************************************/ #include "checklists.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); CheckLists checklists; checklists.resize( 650, 350 ); checklists.setCaption( "TQt Example - CheckLists" ); - a.setMainWidget( &checklists ); + a.setMainWidget( &checklists ); checklists.show(); - return a.exec(); + return a.exec(); }
diff --git a/doc/html/classchart.html b/doc/html/classchart.html index 22578098e..d5d616ac7 100644 --- a/doc/html/classchart.html +++ b/doc/html/classchart.html @@ -96,7 +96,7 @@ body { background: #ffffff; color: black; } - + diff --git a/doc/html/classes.html b/doc/html/classes.html index eb99b5bf9..300e4815b 100644 --- a/doc/html/classes.html +++ b/doc/html/classes.html @@ -103,7 +103,7 @@ classes, see TQt's Main Classes. TQTabletEvent -TQApplication +TQApplication TQDockWindow diff --git a/doc/html/clientserver-example.html b/doc/html/clientserver-example.html index 3c68667e1..ba5e9ef9f 100644 --- a/doc/html/clientserver-example.html +++ b/doc/html/clientserver-example.html @@ -56,7 +56,7 @@ specified. You can send single lines to the server. #include <tqsocket.h> #include <tqserversocket.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqvbox.h> #include <tqtextview.h> #include <tqlabel.h> @@ -126,7 +126,7 @@ public: TQServerSocket( 4242, 1, parent ) { if ( !ok() ) { - tqWarning("Failed to bind to port 4242"); + tqWarning("Failed to bind to port 4242"); exit(1); } } @@ -170,7 +170,7 @@ public: connect( server, TQ_SIGNAL(newConnect(ClientSocket*)), TQ_SLOT(newConnect(ClientSocket*)) ); connect( quit, TQ_SIGNAL(clicked()), tqApp, - TQ_SLOT(quit()) ); + TQ_SLOT(quit()) ); } ~ServerInfo() @@ -199,11 +199,11 @@ private: int main( int argc, char** argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); ServerInfo info; - app.setMainWidget( &info ); + app.setMainWidget( &info ); info.show(); - return app.exec(); + return app.exec(); } #include "server.moc" @@ -222,7 +222,7 @@ int main( int argc, char** argv ) *****************************************************************************/ #include <tqsocket.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqvbox.h> #include <tqhbox.h> #include <tqtextview.h> @@ -248,7 +248,7 @@ public: connect( send, TQ_SIGNAL(clicked()), TQ_SLOT(sendToServer()) ); connect( close, TQ_SIGNAL(clicked()), TQ_SLOT(closeConnection()) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); // create the socket and connect various of its signals socket = new TQSocket( this ); @@ -329,11 +329,11 @@ private: int main( int argc, char** argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); Client client( argc<2 ? "localhost" : argv[1], 4242 ); - app.setMainWidget( &client ); + app.setMainWidget( &client ); client.show(); - return app.exec(); + return app.exec(); } #include "client.moc" diff --git a/doc/html/cursor-example.html b/doc/html/cursor-example.html index d24ea6600..17044d4eb 100644 --- a/doc/html/cursor-example.html +++ b/doc/html/cursor-example.html @@ -47,7 +47,7 @@ This example shows how to set a mouse cursor for a widget. #include <tqlabel.h> #include <tqbitmap.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlayout.h> #include <tqcursor.h> @@ -177,12 +177,12 @@ CursorView::CursorView() // construct view int main( int argc, char **argv ) { - TQApplication a( argc, argv ); // application object + TQApplication a( argc, argv ); // application object CursorView v; // cursor view - a.setMainWidget( &v ); + a.setMainWidget( &v ); v.setCaption("TQt Example - Cursors"); v.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/customlayout-example.html b/doc/html/customlayout-example.html index 423d5c33e..a900f2af2 100644 --- a/doc/html/customlayout-example.html +++ b/doc/html/customlayout-example.html @@ -754,7 +754,7 @@ CardLayout::~CardLayout() #include "border.h" #include "card.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlabel.h> #include <tqcolor.h> #include <tqgroupbox.h> @@ -764,7 +764,7 @@ CardLayout::~CardLayout() int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TQWidget *f = new TQWidget; TQBoxLayout *gm = new TQVBoxLayout( f, 5 ); @@ -828,11 +828,11 @@ int main( int argc, char **argv ) s->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); s->setAlignment( TQt::AlignVCenter | TQt::AlignHCenter ); gm->addWidget( s ); - a.setMainWidget( f ); + a.setMainWidget( f ); f->setCaption("TQt Example - Custom Layout"); f->show(); - int result = a.exec(); + int result = a.exec(); delete f; return result; } diff --git a/doc/html/customstyles.html b/doc/html/customstyles.html index 2156b8cee..bab0887c8 100644 --- a/doc/html/customstyles.html +++ b/doc/html/customstyles.html @@ -178,7 +178,7 @@ application's main() function: int main( int argc, char ** argv ) { - TQApplication::setStyle( new CustomStyle() ); + TQApplication::setStyle( new CustomStyle() ); // do the usual routine on creating your TQApplication object etc. } diff --git a/doc/html/dclock-example.html b/doc/html/dclock-example.html index 80941a2ba..0cdfcda25 100644 --- a/doc/html/dclock-example.html +++ b/doc/html/dclock-example.html @@ -193,18 +193,18 @@ void DigitalClock::showTime() *****************************************************************************/ #include "dclock.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); DigitalClock *clock = new DigitalClock; clock->resize( 170, 80 ); - a.setMainWidget( clock ); + a.setMainWidget( clock ); clock->setCaption("TQt Example - Digital Clock"); clock->show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/debug.html b/doc/html/debug.html index 5d4aa007f..d8e43ae20 100644 --- a/doc/html/debug.html +++ b/doc/html/debug.html @@ -58,16 +58,16 @@ option is only valid for the X11 version of TQt.

TQt includes three global functions for writing out warning and debug text.

    -
  • tqDebug() for writing debug output for testing etc. -
  • tqWarning() for writing warning output when program +
  • tqDebug() for writing debug output for testing etc. +
  • tqWarning() for writing warning output when program errors occur. -
  • tqFatal() for writing fatal error messages +
  • tqFatal() for writing fatal error messages and exiting.

The TQt implementation of these functions prints the text to the stderr output under Unix/X11 and to the debugger under Windows. You can take over these functions by installing a message handler; -qInstallMsgHandler(). +qInstallMsgHandler().

The debugging functions TQObject::dumpObjectTree() and TQObject::dumpObjectInfo() are often useful when an application looks or acts strangely. More useful if you use object names than not, but often useful even without names. @@ -77,10 +77,10 @@ often useful even without names. #defines.

Two important macros are:

    -
  • Q_ASSERT(b) where b is a boolean +
  • Q_ASSERT(b) where b is a boolean expression, writes the warning: "ASSERT: 'b' in file file.cpp (234)" if b is FALSE. -
  • TQ_CHECK_PTR(p) where p is a pointer. +
  • TQ_CHECK_PTR(p) where p is a pointer. Writes the warning "In file file.cpp, line 234: Out of memory" if p is 0.
@@ -88,9 +88,9 @@ Writes the warning "In file file.cpp, line 234: Out of memory" if p is
   char *alloc( int size )
   {
-      Q_ASSERT( size > 0 );
+      Q_ASSERT( size > 0 );
       char *p = new char[size];
-      TQ_CHECK_PTR( p );
+      TQ_CHECK_PTR( p );
       return p;
   }
 
@@ -107,7 +107,7 @@ TQ_CHECK_PTR: char *alloc( int size ) { char *p; - TQ_CHECK_PTR( p = new char[size] ); // WRONG! + TQ_CHECK_PTR( p = new char[size] ); // WRONG! return p; } @@ -140,12 +140,12 @@ define TQT_NO_CHECK. { #if defined(QT_CHECK_NULL) if ( p == 0 ) - tqWarning( "f: Null pointer not allowed" ); + tqWarning( "f: Null pointer not allowed" ); #endif #if defined(QT_CHECK_RANGE) if ( i < 0 ) - tqWarning( "f: The index cannot be negative" ); + tqWarning( "f: The index cannot be negative" ); #endif } diff --git a/doc/html/designer-manual-3.html b/doc/html/designer-manual-3.html index 1c25ddd04..46dc87d3e 100644 --- a/doc/html/designer-manual-3.html +++ b/doc/html/designer-manual-3.html @@ -262,14 +262,14 @@ body { background: #ffffff; color: black; }
  • class TQString;

  • class TQColor;

Adding Includes

-

Our form will also need some included files. Includes may be added in the declaration, or (for preference) in the implementation. Right click "Includes (in Implementation)", then click Edit. Use the dialog that pops up to enter "tqcolor.h" and "tqstring.h". Since we're going to use the clipboard we'll need access to the global clipboard object via TQApplication, so also add "ntqapplication.h" and "tqclipboard.h". We'll also be doing some drawing (e.g. the color swatches), so add "tqpainter.h" too, then close the dialog.

+

Our form will also need some included files. Includes may be added in the declaration, or (for preference) in the implementation. Right click "Includes (in Implementation)", then click Edit. Use the dialog that pops up to enter "tqcolor.h" and "tqstring.h". Since we're going to use the clipboard we'll need access to the global clipboard object via TQApplication, so also add "tqapplication.h" and "tqclipboard.h". We'll also be doing some drawing (e.g. the color swatches), so add "tqpainter.h" too, then close the dialog.

When entering include files you can include double quotes or angle brackets if you wish; if you don't use either TQt Designer will put in double quotes automatically.

You should now have added the following includes (in implementation):

  • "tqcolor.h"

  • "tqstring.h"

    -
  • "ntqapplication.h"

    +
  • "tqapplication.h"

  • "tqclipboard.h"

  • "tqpainter.h"

Signals and Slots Connections

@@ -322,7 +322,7 @@ body { background: #ffffff; color: black; }

init()

    void MainForm::init()
     {
-        clipboard = TQApplication::clipboard();
+        clipboard = TQApplication::clipboard();
         if ( clipboard->supportsSelection() )
             clipboard->setSelectionMode( TRUE );
 
@@ -460,15 +460,15 @@ body { background: #ffffff; color: black; }
 

Creating main.cpp

Now that we've entered some of the code it would be nice to build and run the application to get a feel for the progress we've made. To do this we need to create a main() function. In TQt we typically create a small main.cpp file for the main() function. We can ask TQt Designer to create this file for us.

Click File|New to invoke the New File dialog. Click "C++ Main-File", then click OK. The Configure Main-File dialog appears, listing the all the forms in the project. We've only got one form, "MainForm", so it is already highlighted. Click OK to create a main.cpp file that loads our MainForm.

-
    #include <ntqapplication.h>
+
    #include <tqapplication.h>
     #include "mainform.h"
 
     int main( int argc, char ** argv )
     {
-        TQApplication a( argc, argv );
+        TQApplication a( argc, argv );
         MainForm *w = new MainForm;
         w->show();
-        return a.exec();
+        return a.exec();
     }
 

When TQt Designer generates a main.cpp file it includes this line:

@@ -486,7 +486,7 @@ body { background: #ffffff; color: black; }

Now, whatever the user clicks to close the application, our fileExit() slot will be called. We'll code the fileExit() slot right now:

    void MainForm::fileExit()
     {
-            TQApplication::exit( 0 );
+            TQApplication::exit( 0 );
     }
 

This ensures that our application will cleanly terminate. Later we'll revise this function to give the user the opportunity to save any unsaved data.

@@ -754,7 +754,7 @@ Captures: cap(1) cap(2) cap(3) cap(4)
    void MainForm::fileExit()
     {
         if ( okToClear() ) {
-            TQApplication::exit( 0 );
+            TQApplication::exit( 0 );
         }
     }
 
diff --git a/doc/html/designer-manual-4.html b/doc/html/designer-manual-4.html index 4cc8aafce..a13478de7 100644 --- a/doc/html/designer-manual-4.html +++ b/doc/html/designer-manual-4.html @@ -428,7 +428,7 @@ body { background: #ffffff; color: black; } { if ( okToClear() ) { saveSettings(); - TQApplication::exit( 0 ); + TQApplication::exit( 0 ); } }
@@ -489,7 +489,7 @@ body { background: #ffffff; color: black; }
  • "tqpainter.h"

  • "tqstring.h"

  • "tqcolor.h"

    -
  • "ntqapplication.h"

    +
  • "tqapplication.h"

  • "tqfiledialog.h"

  • "tqfile.h"

  • "tqregexp.h"

    @@ -513,7 +513,7 @@ body { background: #ffffff; color: black; }

    The OptionsForm has no members.

    main.cpp Members

    This file should begin with the following declarations:

    -
        #include <ntqapplication.h>
    +
        #include <tqapplication.h>
         #include "mainform.h"
     
    diff --git a/doc/html/designer-manual-6.html b/doc/html/designer-manual-6.html index ee8677c36..2ab181dcb 100644 --- a/doc/html/designer-manual-6.html +++ b/doc/html/designer-manual-6.html @@ -79,7 +79,7 @@ FORMS = settingsformbase.ui
    Creating the Test Harness

    Although we intend our dialog to be used within an application it is useful to create a test harness so that we can develop and test it stand-alone. Click File|New to invoke the 'New File' dialog, then click 'C++ Source', then click OK. In the editor window that pops up, enter the following code:

    -#include <ntqapplication.h>
    +#include <tqapplication.h>
     #include "creditformbase.h"
     
     int main( int argc, char *argv[] ) 
    @@ -135,18 +135,18 @@ int main( int argc, char *argv[] )
     

    We call setAmount() in the constructor to ensure that the correct amount is shown when the form starts based on whichever radio button we checked in TQt Designer. In setAmount() we set the amount if the standard or none radio button is checked. If the user has checked the special radio button they are free to change the amount themselves.

    To be able to test our subclass we change main.cpp to include creditform.h rather than creditformbase.h and change the instantiation of the creditForm object:

    -
        #include <ntqapplication.h>
    +
        #include <tqapplication.h>
         #include "creditform.h"
     
         int main( int argc, char *argv[] )
         {
    -        TQApplication app( argc, argv );
    +        TQApplication app( argc, argv );
     
             CreditForm creditForm;
    -        app.setMainWidget( &creditForm );
    +        app.setMainWidget( &creditForm );
             creditForm.show();
     
    -        return app.exec();
    +        return app.exec();
         }
     

    If you created the creditform.h and creditform.cpp files in TQt Designer, they are already in the project file, but if you created them manually you must also update the project file by adding these two new lines at the end:

    @@ -176,18 +176,18 @@ INCLUDEPATH += $(TQTDIR)/tools/designer/uilib

    We do not include the creditformbase.ui file since this file will be read at runtime, as we'll see shortly. We must include the tqui library since the functionality we require is not part of the standard TQt library.

    Creating main.cpp

    The main.cpp is quite standard. It will invoke the form we're going to create in TQt Designer as its main form. This form will then load and execute the dynamic dialog.

    -
        #include <ntqapplication.h>
    +
        #include <tqapplication.h>
         #include "mainform.h"
     
         int main( int argc, char *argv[] )
         {
    -        TQApplication app( argc, argv );
    +        TQApplication app( argc, argv );
     
             MainForm *mainForm = new MainForm;
    -        app.setMainWidget( mainForm );
    +        app.setMainWidget( mainForm );
             mainForm->show();
     
    -        return app.exec();
    +        return app.exec();
         }
     

    We create a new instance of our MainForm class, set it to be the main widget, show it and enter the event loop in the app.exec() call.

    diff --git a/doc/html/designer-manual-7.html b/doc/html/designer-manual-7.html index 389e96ea5..587cff348 100644 --- a/doc/html/designer-manual-7.html +++ b/doc/html/designer-manual-7.html @@ -79,15 +79,15 @@ HEADERS += vcr.h DBFILE = vcr.db

    The qt/tools/designer/examples/vcr/main.cpp file is also brief:

    -
        #include <ntqapplication.h>
    +
        #include <tqapplication.h>
         #include "vcr.h"
     
         int main( int argc, char ** argv )
         {
    -        TQApplication app( argc, argv );
    +        TQApplication app( argc, argv );
             Vcr *vcr = new Vcr;
             vcr->show();
    -        return app.exec();
    +        return app.exec();
         }
     

    Once we're satisfied that the custom widget compiles and runs we are ready to incorporate it into TQt Designer.

    @@ -222,15 +222,15 @@ DBFILE = vcr.db

    Although these two files complete the implementation of the FileChooser widget it is good practice to write a test harness to check that the widget behaves as expected before attempting to put it into a plugin.

    Testing the Implementation

    We present a rudimentary test harness which will allow us to run our custom widget. The test harness requires two files, a main.cpp to contain the FileChooser, and a .pro file to create the Makefile from. Here is qt/tools/designer/examples/filechooser/widget/main.cpp:

    -
        #include <ntqapplication.h>
    +
        #include <tqapplication.h>
         #include "filechooser.h"
     
         int main( int argc, char ** argv )
         {
    -        TQApplication a( argc, argv );
    +        TQApplication a( argc, argv );
             FileChooser *fc = new FileChooser;
             fc->show();
    -        return a.exec();
    +        return a.exec();
         }
     

    And here is qt/tools/designer/examples/filechooser/widget/filechooser.pro

    diff --git a/doc/html/designer-manual-8.html b/doc/html/designer-manual-8.html index 9c9716d8d..f22a272e6 100644 --- a/doc/html/designer-manual-8.html +++ b/doc/html/designer-manual-8.html @@ -96,19 +96,19 @@ bool createConnections()

    We call addDatabase() passing it the name of the driver we wish to use. We then set the connection information by calling the set... functions. Finally we attempt to open the connection. If we succeed we return TRUE, otherwise we output some error information and return FALSE. From qt/tools/designer/examples/book/book1/main.cpp

        int main( int argc, char *argv[] )
         {
    -        TQApplication app( argc, argv );
    +        TQApplication app( argc, argv );
     
             if ( ! createConnections() )
                 return 1;
     
             BookForm bookForm;
    -        app.setMainWidget( &bookForm );
    +        app.setMainWidget( &bookForm );
             bookForm.show();
     
    -        return app.exec();
    +        return app.exec();
         }
     
    -

    All the examples presented in this chapter call createConnections() after creating the TQApplication object in their main.cpp file and make use of the default connection. If you need to connect to multiple databases use the two-argument form of addDatabase(), passing it both the name of the driver and a unique identifier. This is explained further in the TQt SQL Module documentation.

    +

    All the examples presented in this chapter call createConnections() after creating the TQApplication object in their main.cpp file and make use of the default connection. If you need to connect to multiple databases use the two-argument form of addDatabase(), passing it both the name of the driver and a unique identifier. This is explained further in the TQt SQL Module documentation.

    You do not need to keep a reference to database connections. If you use a single database connection, this becomes the default connection and database functions will use this connection automatically. We can always get a pointer to any of our connections by calling TQSqlDatabase::database().

    If you create a main.cpp file using TQt Designer, this file will not include createConnections(). We do not include this function because it needs the username and password for the database connection, and you may prefer to handle these differently from our simple example function. As a result, applications that preview correctly in TQt Designer will not run unless you implement your own database connections function.

    Using TQDataTable

    diff --git a/doc/html/desktop-example.html b/doc/html/desktop-example.html index cbdace5f6..491aaee96 100644 --- a/doc/html/desktop-example.html +++ b/doc/html/desktop-example.html @@ -51,7 +51,7 @@ any other. #include <tqimage.h> #include <tqbitmap.h> #include <tqpainter.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdropsite.h> #include <tqdragobject.h> #include <stdio.h> @@ -84,7 +84,7 @@ static int velocity( int i ) // change velocity void poly() { - TQWidget *d = TQApplication::desktop(); + TQWidget *d = TQApplication::desktop(); d->setBackgroundColor( TQt::white ); // white desktop const int maxpoints = 5; @@ -173,7 +173,7 @@ void rotate() pm = image; // convert image to pixmap pm.setOptimization( TQPixmap::BestOptim ); // rotation will be faster - TQWidget *d = TQApplication::desktop(); // w = desktop widget + TQWidget *d = TQApplication::desktop(); // w = desktop widget for ( i=0; i<=360; i += 2 ) { TQWMatrix m; @@ -302,7 +302,7 @@ void desktopWidget( const char *s = "Trolltech" ) { DesktopWidget *t = new DesktopWidget(s); t->update(); - tqApp->exec(); + tqApp->exec(); delete t; } @@ -310,7 +310,7 @@ void desktopText( const char *s = "Trolltech" ) { const int border = 20; - TQColor c1 = tqApp->palette().inactive().background(); + TQColor c1 = tqApp->palette().inactive().background(); TQColor c2 = c1.light(104); TQColor c3 = c1.dark(106); @@ -321,8 +321,8 @@ void desktopText( const char *s = "Trolltech" ) TQRect r = p.fontMetrics().boundingRect( s ); p.end(); - int appWidth = tqApp->desktop()->width(); - int appHeight = tqApp->desktop()->height(); + int appWidth = tqApp->desktop()->width(); + int appHeight = tqApp->desktop()->height(); if ( r.width() > appWidth - border*2 ) r.setWidth( appWidth - border*2 ); if ( r.height() > appHeight - border*2 ) @@ -334,7 +334,7 @@ void desktopText( const char *s = "Trolltech" ) drawShadeText( &p, -r.x() + border, -r.y() + border, s, c2, c3 ); p.end(); - tqApp->desktop()->setBackgroundPixmap( pm ); + tqApp->desktop()->setBackgroundPixmap( pm ); } // @@ -343,12 +343,12 @@ void desktopText( const char *s = "Trolltech" ) int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( argc > 1 ) { TQFont f( "charter", 96, TQFont::Black ); f.setStyleHint( TQFont::Times ); - app.setFont( f ); + app.setFont( f ); } bool validOptions = FALSE; diff --git a/doc/html/dirview-example.html b/doc/html/dirview-example.html index 4d5903565..7f50fb26d 100644 --- a/doc/html/dirview-example.html +++ b/doc/html/dirview-example.html @@ -179,7 +179,7 @@ can be used in any other trees. #include <tqmime.h> #include <tqstrlist.h> #include <tqstringlist.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqheader.h> static const char* folder_closed_xpm[]={ @@ -627,7 +627,7 @@ TQString DirectoryView::fullPath(TQListViewItem* item) void DirectoryView::contentsMouseMoveEvent( TQMouseEvent* e ) { - if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) { + if ( mousePressed && ( presspos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) { mousePressed = FALSE; TQListViewItem *item = itemAt( contentsToViewport(presspos) ); if ( item ) { @@ -703,14 +703,14 @@ const TQPixmap *FileItem::pixmap( int i ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqfileinfo.h> #include <tqdir.h> #include "dirview.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); DirectoryView mw; @@ -731,10 +731,10 @@ int main( int argc, char ** argv ) mw.resize( 400, 400 ); mw.setCaption( "TQt Example - Directory Browser" ); mw.setAllColumnsShowFocus( TRUE ); - a.setMainWidget( &mw ); + a.setMainWidget( &mw ); mw.show(); - return a.exec(); + return a.exec(); }
    diff --git a/doc/html/distributingtqt.html b/doc/html/distributingtqt.html index 4be4e542a..efcd28af0 100644 --- a/doc/html/distributingtqt.html +++ b/doc/html/distributingtqt.html @@ -91,7 +91,7 @@ plugin category (e.g. styles, sqldrivers, designer, e
  • The application directory

    Application specific plugin paths can be added using -TQApplication::addLibraryPath(). The build-directory of TQt is hardcoded +TQApplication::addLibraryPath(). The build-directory of TQt is hardcoded in the TQt library and can be changed as a part of the installation process (see the distributor-example.html Distributor example).

    Dynamic Dialogs diff --git a/doc/html/distributor-example.html b/doc/html/distributor-example.html index 090dec2fb..09b89cd1e 100644 --- a/doc/html/distributor-example.html +++ b/doc/html/distributor-example.html @@ -61,7 +61,7 @@ distributed with TQt. ** place of a destructor. *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcursor.h> #include <tqeventloop.h> #include <tqfile.h> @@ -213,14 +213,14 @@ void Distributor::checkLibData() TQFile file( libFilename->text() ); if ( file.open( IO_ReadOnly ) ) { - TQApplication::setOverrideCursor( WaitCursor ); + TQApplication::setOverrideCursor( WaitCursor ); // instead of reading in the entire file, do the search in chunks char data[60000]; ulong offset = 0; while ( ! file.atEnd() && completed < total_steps ) { - TQApplication::eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); + TQApplication::eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); ulong len = file.readBlock( data, sizeof(data) ); if ( len < 267 ) { @@ -259,7 +259,7 @@ void Distributor::checkLibData() file.close(); - TQApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } if ( completed == total_steps ) { @@ -366,14 +366,14 @@ void Distributor::accept() TQFile file( libFilename->text() ); if ( file.open( IO_ReadWrite ) ) { - TQApplication::setOverrideCursor( WaitCursor ); + TQApplication::setOverrideCursor( WaitCursor ); // instead of reading in the entire file, do the search in chunks char data[60000]; ulong offset = 0; while ( ! file.atEnd() && completed < total_steps ) { - TQApplication::eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); + TQApplication::eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); ulong len = file.readBlock( data, sizeof(data) ); if ( len < 267 ) { @@ -420,7 +420,7 @@ void Distributor::accept() file.close(); - TQApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } if ( completed != total_steps ) { diff --git a/doc/html/dnd.html b/doc/html/dnd.html index 48e511348..b5bc53181 100644 --- a/doc/html/dnd.html +++ b/doc/html/dnd.html @@ -141,14 +141,14 @@ information on the clipboard:
     void MyWidget::copy()
     {
    -    TQApplication::clipboard()->setData(
    +    TQApplication::clipboard()->setData(
             new TQTextDrag(myHighlightedText()) );
     }
     
     void MyWidget::paste()
     {
         TQString text;
    -    if ( TQTextDrag::decode(TQApplication::clipboard()->data(), text) )
    +    if ( TQTextDrag::decode(TQApplication::clipboard()->data(), text) )
             insertText( text );
     }
     
    @@ -318,12 +318,12 @@ void MyWidget::dragMoveEvent(TQDragMoveEvent* event) feedback as the drag progresses, to start timers, to scroll the window, or whatever is appropriate (don't forget to stop the scrolling and timers in a dragLeaveEvent() though). -

    The TQApplication object (available as the tqApp global) also +

    The TQApplication object (available as the tqApp global) also provides some drag and drop related functions: -TQApplication::setStartDragTime(), -TQApplication::setStartDragDistance(), and their corresponding -getters, TQApplication::startDragTime() and -TQApplication::startDragDistance(). +TQApplication::setStartDragTime(), +TQApplication::setStartDragDistance(), and their corresponding +getters, TQApplication::startDragTime() and +TQApplication::startDragDistance().

    Inter-operating with Other Applications

    On X11, the public tqpushbutton.h> #include <tqradiobutton.h> #include <tqbuttongroup.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <math.h> // @@ -342,12 +342,12 @@ void DrawView::paintEvent( TQApplication app( argc, argv ); + TQApplication app( argc, argv ); DrawView draw; - app.setMainWidget( &draw ); + app.setMainWidget( &draw ); draw.setCaption("TQt Example - Drawdemo"); draw.show(); - return app.exec(); + return app.exec(); }

  • diff --git a/doc/html/drawlines-example.html b/doc/html/drawlines-example.html index 8f13910b8..93bf8acbb 100644 --- a/doc/html/drawlines-example.html +++ b/doc/html/drawlines-example.html @@ -50,7 +50,7 @@ release the button, and watch the lines get drawn. #include <tqwidget.h> #include <tqpainter.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <stdlib.h> @@ -162,14 +162,14 @@ ConnectWidget::~ConnectWidget() int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ConnectWidget connect; #ifndef TQT_NO_WIDGET_TOPEXTRA // for TQt/Embedded minimal build connect.setCaption( "TQt Example - Draw lines"); #endif - a.setMainWidget( &connect ); + a.setMainWidget( &connect ); connect.show(); - return a.exec(); + return a.exec(); }
    diff --git a/doc/html/eventsandfilters.html b/doc/html/eventsandfilters.html index f8ec0e46e..44ff1c3b1 100644 --- a/doc/html/eventsandfilters.html +++ b/doc/html/eventsandfilters.html @@ -53,7 +53,7 @@ supports mouse moves, presses, shift-presses, drags, clicks, right-presses, etc.

    Since programs need to react in varied and complex ways, TQt's event delivery mechanisms are flexible. The documentation for -TQApplication::notify() concisely tells the whole story, here we +TQApplication::notify() concisely tells the whole story, here we will explain enough for 99% of applications.

    The normal way for an event to be delivered is by calling a virtual function. For example, TQPaintEvent is delivered by calling TQWidget::paintEvent(). This virtual function is responsible for @@ -113,14 +113,14 @@ event, the event is sent to the target object itself. If one of them stops processing, the target and any later event filters don't get to see the event at all.

    It's also possible to filter all events for the entire application, -by installing an event filter on TQApplication. This is what TQToolTip does in order to see all the mouse and keyboard activity. +by installing an event filter on TQApplication. This is what TQToolTip does in order to see all the mouse and keyboard activity. This is very powerful, but it also slows down event delivery of every single event in the entire application, so it's best avoided.

    The global event filters are called before the object-specific filters.

    Finally, many applications want to create and send their own events.

    Creating an event of a built-in type is very simple: create an object -of the relevant type, and then call TQApplication::sendEvent() or TQApplication::postEvent(). +of the relevant type, and then call TQApplication::sendEvent() or TQApplication::postEvent().

    sendEvent() processes the event immediately - when sendEvent() returns, (the event filters and) the object have already processed the event. For many event classes there is a function called isAccepted() diff --git a/doc/html/extension-dialog-example.html b/doc/html/extension-dialog-example.html index 663e39138..4a7526a55 100644 --- a/doc/html/extension-dialog-example.html +++ b/doc/html/extension-dialog-example.html @@ -66,7 +66,7 @@ DBFILE = extension.db *****************************************************************************/ #include "dialogform.h" #include "extension.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcheckbox.h> #include <tqlineedit.h> @@ -101,7 +101,7 @@ void MainForm::optionsDlg() void MainForm::quit() { - TQApplication::exit( 0 ); + TQApplication::exit( 0 ); }

    @@ -142,16 +142,16 @@ void DialogForm::toggleDetails()


    Main: -

    #include <ntqapplication.h>
    +

    #include <tqapplication.h>
     #include "mainform.h"
     
     int main( int argc, char ** argv )
     {
    -    TQApplication a( argc, argv );
    +    TQApplication a( argc, argv );
         MainForm *w = new MainForm;
         w->show();
    -    a.connect( &a, TQ_SIGNAL( lastWindowClosed() ), w, TQ_SLOT( quit() ) );
    -    return a.exec();
    +    a.connect( &a, TQ_SIGNAL( lastWindowClosed() ), w, TQ_SLOT( quit() ) );
    +    return a.exec();
     }
     
    diff --git a/doc/html/fileiconview-example.html b/doc/html/fileiconview-example.html index 5f23a19bb..3333452bb 100644 --- a/doc/html/fileiconview-example.html +++ b/doc/html/fileiconview-example.html @@ -235,7 +235,7 @@ protected: #include <tqevent.h> #include <tqpopupmenu.h> #include <tqcursor.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqwmatrix.h> #include <stdlib.h> @@ -688,7 +688,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() : TQIconView( parent, name ), viewDir( dir ), newFolderNum( 0 ) { if ( !iconFolderLockedLarge ) { - tqAddPostRoutine( cleanup ); + tqAddPostRoutine( cleanup ); TQWMatrix m; m.scale( 0.6, 0.6 ); TQPixmap iconpix( folder_locked_icon ); @@ -771,7 +771,7 @@ void TQtFileIconView::newDirectory() item->setSelected( TRUE, TRUE ); setCurrentItem( item ); repaintItem( item ); - tqApp->processEvents(); + tqApp->processEvents(); item->rename(); } setAutoArrange( TRUE ); @@ -1365,19 +1365,19 @@ void FileMainWindow::disableMkdir() #include "mainwindow.h" #include "tqfileiconview.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); FileMainWindow mw; mw.resize( 680, 480 ); - a.setMainWidget( &mw ); + a.setMainWidget( &mw ); mw.fileView()->setDirectory( "/" ); mw.show(); - return a.exec(); + return a.exec(); }
    diff --git a/doc/html/forever-example.html b/doc/html/forever-example.html index 10bfa67c0..3e8a3420c 100644 --- a/doc/html/forever-example.html +++ b/doc/html/forever-example.html @@ -93,7 +93,7 @@ private: #include <tqtimer.h> #include <tqpainter.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <stdlib.h> // defines rand() function #include "forever.h" @@ -173,13 +173,13 @@ void Forever::updateCaption() int main( int argc, char **argv ) { - TQApplication a( argc, argv ); // create application object + TQApplication a( argc, argv ); // create application object Forever always; // create widget always.resize( 400, 250 ); // start up with size 400x250 - a.setMainWidget( &always ); // set as main widget + a.setMainWidget( &always ); // set as main widget always.setCaption("TQt Example - Forever"); always.show(); // show widget - return a.exec(); // run event loop + return a.exec(); // run event loop }
  • diff --git a/doc/html/ftpclient-example.html b/doc/html/ftpclient-example.html index 9d84ada51..0296997c1 100644 --- a/doc/html/ftpclient-example.html +++ b/doc/html/ftpclient-example.html @@ -64,7 +64,7 @@ commands. The GUI parts are done in the Designer. #include <tqmessagebox.h> #include <tqfiledialog.h> #include <tqprogressdialog.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include "connectdialog.h" #include "ftpviewitem.h" @@ -233,7 +233,7 @@ void FtpMainWindow::changePathOrDownload( TQListVi void FtpMainWindow::ftp_commandStarted() { - TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); if ( ftp->currentCommand() == TQFtp::List ) { remoteView->clear(); if ( currentFtpDir != "/" ) @@ -243,7 +243,7 @@ void FtpMainWindow::ftp_commandStarted() void FtpMainWindow::ftp_commandFinished() { - TQApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); delete ftp->currentDevice(); } @@ -324,19 +324,19 @@ void FtpMainWindow::ftp_rawCommandReply( int code, const ntqapplication.h> +#include <tqapplication.h> #include "ftpmainwindow.h" int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); FtpMainWindow m; - a.setMainWidget( &m ); + a.setMainWidget( &m ); m.show(); - a.processEvents(); + a.processEvents(); m.connectToHost(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/functions.html b/doc/html/functions.html index dc8392b87..efe2c6838 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -39,16 +39,16 @@ API with links to the class documentation for each function.
    • DTDHandler: TQXmlReader
    • Q_ASSERT: - TQApplication
    • TQ_CHECK_PTR: - TQApplication
    • + TQApplication
    • TQ_CHECK_PTR: + TQApplication
    • abort: TQFtp TQHttp TQPrinter
    • aborted: TQPrinter
    • about: TQMessageBox
    • aboutTQt: - TQApplication TQMessageBox
    • aboutToBlock: + TQApplication TQMessageBox
    • aboutToBlock: TQEventLoop
    • aboutToHide: TQPopupMenu
    • aboutToQuit: - TQApplication
    • aboutToShow: + TQApplication
    • aboutToShow: TQPopupMenu TQTabDialog TQWidgetStack
    • absFilePath: TQDir TQFileInfo
    • absPath: TQDir
    • accel: @@ -70,9 +70,9 @@ abort: TQAccel
    • activatedPos: TQListViewItem
    • active: TQPalette
    • activeModalWidget: - TQApplication
    • activePopupWidget: - TQApplication
    • activeWindow: - TQApplication TQWorkspace
    • add: + TQApplication
    • activePopupWidget: + TQApplication
    • activeWindow: + TQApplication TQWorkspace
    • add: TQActionGroup TQGridLayout TQLayout TQObjectCleanupHandler TQToolTip TQWhatsThis
    • addArgument: TQProcess
    • addBindValue: TQSqlQuery
    • addChild: @@ -90,7 +90,7 @@ abort: TQHeader
    • addLayout: TQBoxLayout TQGridLayout
    • addLeftWidget: TQFileDialog
    • addLibraryPath: - TQApplication
    • addLine: + TQApplication
    • addLine: TQDial TQRangeControl
    • addMSecs: TQTime
    • addMonths: TQDate TQDateTime
    • addMultiCell: @@ -134,7 +134,7 @@ abort: TQListView
    • allGray: TQImage
    • allItems: TQCanvas
    • allWidgets: - TQApplication
    • alloc: + TQApplication
    • alloc: TQColor
    • allowedInContext: TQStyleSheetItem
    • allowsErrorInteraction: TQSessionManager
    • allowsInteraction: @@ -152,17 +152,17 @@ abort: TQCString TQIconDrag TQPtrList TQSqlCursor TQSqlIndex TQSqlRecord TQString TQTextEdit TQValueList TQValueVector TQXmlAttributes
    • appendChild: TQDomNode
    • appendData: TQDomCharacterData
    • applicationDirPath: - TQApplication
    • applicationFilePath: - TQApplication
    • applyButtonPressed: + TQApplication
    • applicationFilePath: + TQApplication
    • applyButtonPressed: TQTabDialog
    • appropriate: TQMainWindow TQWizard
    • area: TQDockWindow
    • areaPoints: TQCanvasPolygon TQCanvasPolygonalItem
    • areaPointsAdvanced: TQCanvasPolygonalItem
    • arg: TQNetworkOperation TQString
    • argc: - TQApplication
    • arguments: + TQApplication
    • arguments: TQProcess
    • argv: - TQApplication
    • arrangeItemsInGrid: + TQApplication
    • arrangeItemsInGrid: TQIconView
    • arrangement: TQIconView
    • arrowType: TQStyleOption
    • asBitArray: @@ -249,7 +249,7 @@ back: TQColorGroup
    • baseName: TQFileInfo
    • baseSize: TQWidget
    • beep: - TQApplication
    • beforeDelete: + TQApplication
    • beforeDelete: TQDataBrowser TQDataTable
    • beforeInsert: TQDataBrowser TQDataTable
    • beforeSeek: TQSqlQuery
    • beforeUpdate: @@ -403,19 +403,19 @@ c: TQWidget
    • clicked: TQButton TQButtonGroup TQCheckBox TQHeader TQIconView TQListBox TQListView TQPushButton TQRadioButton TQTable TQTextEdit TQWhatsThis
    • clipRegion: TQPainter TQWidget
    • clipboard: - TQApplication
    • clipper: + TQApplication
    • clipper: TQScrollView
    • cloneNode: TQDomNode
    • close: TQFile TQFtp TQIODevice TQSocket TQSqlDatabase TQSqlDriver TQWidget
    • closeActiveWindow: TQWorkspace
    • closeAllWindows: - TQApplication TQWorkspace
    • closeAssistant: + TQApplication TQWorkspace
    • closeAssistant: TQAssistantClient
    • closeConnection: TQHttp
    • closeEvent: TQWidget
    • closeMode: TQDockWindow
    • closeStdin: TQProcess
    • closed: TQCanvasSpline
    • closingDown: - TQApplication
    • cmd: + TQApplication
    • cmd: TQPaintDevice
    • codec: TQTextStream
    • codecForCStrings: TQTextCodec
    • codecForContent: @@ -436,7 +436,7 @@ c: TQWidget
    • colorMode: TQPrinter
    • colorNames: TQColor
    • colorSpec: - TQApplication
    • colorTable: + TQApplication
    • colorTable: TQImage
    • colormap: TQGLWidget
    • columnAlignment: TQListView
    • columnAt: @@ -457,7 +457,7 @@ c: TQFtp
    • comment: TQTranslatorMessage TQXmlLexicalHandler
    • commit: TQSqlDatabase
    • commitData: - TQApplication
    • commitTransaction: + TQApplication
    • commitTransaction: TQSqlDriver
    • commonPrefix: TQTranslatorMessage
    • communication: TQProcess
    • compare: @@ -608,7 +608,7 @@ c: TQLineEdit
    • cursorChanged: TQDataBrowser TQDataTable
    • cursorDown: TQMultiLineEdit
    • cursorFlashTime: - TQApplication
    • cursorForward: + TQApplication
    • cursorForward: TQLineEdit
    • cursorLeft: TQMultiLineEdit
    • cursorName: TQSqlIndex
    • cursorPoint: @@ -688,8 +688,8 @@ dark: TQImageIO
    • deselect: TQLineEdit
    • designable: TQMetaProperty
    • desktop: - TQApplication
    • desktopSettingsAware: - TQApplication
    • destroy: + TQApplication
    • desktopSettingsAware: + TQApplication
    • destroy: TQWidget
    • destroyAllocContext: TQColor
    • destroyed: TQObject
    • det: @@ -739,7 +739,7 @@ dark: TQImage
    • dotsPerMeterY: TQImage
    • doubleBuffer: TQGLFormat TQGLWidget
    • doubleClickInterval: - TQApplication
    • doubleClicked: + TQApplication
    • doubleClicked: TQIconView TQListBox TQListView TQTable TQTextEdit
    • downRect: TQSpinBox
    • drag: TQDragObject
    • dragAutoScroll: @@ -874,12 +874,12 @@ echoMode: TQRegExp TQStyleSheet
    • event: TQObject TQWidget
    • eventFilter: TQListView TQObject TQScrollView TQSpinBox
    • eventLoop: - TQApplication
    • exactMatch: + TQApplication
    • exactMatch: TQFont TQFontInfo TQRegExp
    • exec: - TQApplication TQDialog TQEventLoop TQPopupMenu TQSqlDatabase TQSqlQuery
    • executedQuery: + TQApplication TQDialog TQEventLoop TQPopupMenu TQSqlDatabase TQSqlQuery
    • executedQuery: TQSqlQuery
    • exists: TQDir TQFile TQFileInfo
    • exit: - TQApplication TQEventLoop TQThread
    • exitLoop: + TQApplication TQEventLoop TQThread
    • exitLoop: TQEventLoop
    • exitStatus: TQProcess
    • expand: TQGridLayout
    • expandTo: @@ -943,8 +943,8 @@ falseText: TQMacMime
    • flavorFor: TQMacMime
    • flavorToMime: TQMacMime
    • flush: - TQApplication TQFile TQIODevice TQPainter TQSocket
    • flushX: - TQApplication
    • focusData: + TQApplication TQFile TQIODevice TQPainter TQSocket
    • flushX: + TQApplication
    • focusData: TQWidget
    • focusInEvent: TQWidget
    • focusNextPrevChild: TQTextEdit TQWidget
    • focusOutEvent: @@ -953,13 +953,13 @@ falseText: TQWidget
    • focusRectPolicy: TQMacStyle
    • focusStyle: TQTable
    • focusWidget: - TQApplication TQFocusData TQWidget
    • font: - TQApplication TQCanvasText TQFontDatabase TQPainter TQToolTip TQWidget
    • fontChange: + TQApplication TQFocusData TQWidget
    • font: + TQApplication TQCanvasText TQFontDatabase TQPainter TQToolTip TQWidget
    • fontChange: TQWidget
    • fontFamily: TQStyleSheetItem
    • fontInfo: TQPainter TQWidget
    • fontItalic: TQStyleSheetItem
    • fontMetrics: - TQApplication TQPainter TQWidget
    • fontSize: + TQApplication TQPainter TQWidget
    • fontSize: TQStyleSheetItem
    • fontStrikeOut: TQStyleSheetItem
    • fontUnderline: TQStyleSheetItem
    • fontWeight: @@ -1036,7 +1036,7 @@ gamma: TQGLWidget
    • glInit: TQGLWidget
    • globalPos: TQContextMenuEvent TQMouseEvent TQTabletEvent TQWheelEvent
    • globalStrut: - TQApplication
    • globalX: + TQApplication
    • globalX: TQContextMenuEvent TQMouseEvent TQTabletEvent TQWheelEvent
    • globalY: TQContextMenuEvent TQMouseEvent TQTabletEvent TQWheelEvent
    • gotFocus: TQFocusEvent
    • grabFrameBuffer: @@ -1054,7 +1054,7 @@ gamma: TQIconView
    • group: TQButton TQCheckBox TQFileInfo TQPushButton TQRadioButton TQSettings TQToolTip TQUrlInfo TQWidgetPlugin
    • groupId: TQFileInfo
    • guiThreadAwake: - TQApplication
    • + TQApplication
    • hScrollBarMode: TQScrollView
    • handle: TQCursor TQFile TQFont TQPaintDevice TQPainter TQRegion TQSessionManager
    • handleError: @@ -1078,7 +1078,7 @@ hScrollBarMode: TQDockArea TQMainWindow
    • hasFeature: TQDomImplementation TQSqlDriver TQXmlReader
    • hasFocus: TQWidget
    • hasGlobalMouseTracking: - TQApplication
    • hasHeightForWidth: + TQApplication
    • hasHeightForWidth: TQBoxLayout TQGridLayout TQLayoutItem TQSizePolicy
    • hasHelpButton: TQTabDialog
    • hasHost: TQUrl
    • hasKey: @@ -1095,7 +1095,7 @@ hScrollBarMode: TQUrl
    • hasPath: TQUrl
    • hasPendingCommands: TQFtp
    • hasPendingEvents: - TQApplication TQEventLoop
    • hasPendingRequests: + TQApplication TQEventLoop
    • hasPendingRequests: TQHttp
    • hasPort: TQUrl
    • hasProperty: TQXmlReader
    • hasRef: @@ -1135,7 +1135,7 @@ hScrollBarMode: TQDir
    • horData: TQSizePolicy
    • horStretch: TQSizePolicy
    • horizontalAlignment: - TQApplication
    • horizontalHeader: + TQApplication
    • horizontalHeader: TQTable
    • horizontalScrollBar: TQScrollView
    • horizontalSliderPressed: TQScrollView
    • horizontalSliderReleased: @@ -1228,7 +1228,7 @@ icon: TQImageFormatPlugin
    • installIconFactory: TQIconSet
    • installPropertyMap: TQDataTable TQSqlForm
    • installTranslator: - TQApplication
    • intValue: + TQApplication
    • intValue: TQLCDNumber
    • internalEntityDecl: TQXmlDeclHandler
    • internalSubset: TQDomDocumentType
    • interpretText: @@ -1291,7 +1291,7 @@ icon: TQSqlDatabase
    • isEditable: TQComboTableItem
    • isEditing: TQTable
    • isEffectEnabled: - TQApplication
    • isElement: + TQApplication
    • isElement: TQDomElement TQDomNode
    • isEmpty: TQAsciiCache TQAsciiCacheIterator TQAsciiDict TQAsciiDictIterator TQCString TQCache TQCacheIterator TQDict TQDictIterator TQDockArea TQGLColormap TQIntCache TQIntCacheIterator TQIntDict TQIntDictIterator TQKeySequence TQLayout TQLayoutItem TQMap TQMemArray TQObjectCleanupHandler TQPtrDict TQPtrDictIterator TQPtrList TQPtrListIterator TQPtrQueue TQPtrStack TQPtrVector TQRect TQRegExp TQRegion TQSize TQSpacerItem TQSqlRecord TQString TQTableSelection TQTranslator TQValueList TQValueVector TQWidgetItem
    • isEnabled: TQAccel TQAction TQCanvasItem TQLayout TQListViewItem TQSocketNotifier TQTab TQTableItem TQWidget
    • isEnabledTo: @@ -1379,7 +1379,7 @@ icon: TQCanvasItem TQIconViewItem TQListBox TQListBoxItem TQListView TQListViewItem TQTable
    • isSeparator: TQCustomMenuItem
    • isSequentialAccess: TQIODevice
    • isSessionRestored: - TQApplication
    • isSetType: + TQApplication
    • isSetType: TQMetaProperty
    • isSharing: TQGLContext TQGLWidget
    • isShown: TQWidget
    • isSizeGripEnabled: @@ -1468,7 +1468,7 @@ label: TQDataBrowser
    • lastResortFamily: TQFont
    • lastResortFont: TQFont
    • lastWindowClosed: - TQApplication
    • latin1: + TQApplication
    • latin1: TQChar TQString
    • launch: TQProcess
    • launchFinished: TQProcess
    • layOutButtonRow: @@ -1493,7 +1493,7 @@ label: TQUrlInfo
    • lexicalHandler: TQXmlReader
    • library: TQLibrary
    • libraryPaths: - TQApplication
    • light: + TQApplication
    • light: TQColor TQColorGroup
    • lineEdit: TQComboBox
    • lineLength: TQMultiLineEdit
    • lineNumber: @@ -1529,8 +1529,8 @@ label: TQDomNode TQXmlAttributes
    • locale: TQTextCodec
    • localeAwareCompare: TQString
    • lock: - TQApplication TQMutex
    • locked: - TQApplication TQMutex
    • logicalDpiX: + TQApplication TQMutex
    • locked: + TQApplication TQMutex
    • logicalDpiX: TQPaintDeviceMetrics
    • logicalDpiY: TQPaintDeviceMetrics
    • logicalFontSize: TQStyleSheetItem
    • logicalFontSizeStep: @@ -1549,9 +1549,9 @@ m11: TQWMatrix
    • m22: TQWMatrix
    • macEvent: TQWidget
    • macEventFilter: - TQApplication
    • mailServers: + TQApplication
    • mailServers: TQDns
    • mainWidget: - TQApplication TQLayout
    • mainWindow: + TQApplication TQLayout
    • mainWindow: TQToolBar
    • majorVersion: TQHttpHeader TQHttpRequestHeader TQHttpResponseHeader
    • makeAbsolute: TQMimeSourceFactory
    • makeArc: @@ -1719,7 +1719,7 @@ name: TQDial
    • notchTarget: TQDial
    • notchesVisible: TQDial
    • notify: - TQApplication
    • nrefs: + TQApplication
    • nrefs: TQMemArray
    • nullText: TQDataTable TQSqlDriver
    • numBitPlanes: TQColor
    • numBytes: @@ -1820,7 +1820,7 @@ object: TQGLContext
    • overline: TQFont
    • overlinePos: TQFontMetrics
    • overrideCursor: - TQApplication
    • ownCursor: + TQApplication
    • ownCursor: TQWidget
    • ownFont: TQWidget
    • ownPalette: TQWidget
    • owner: @@ -1853,7 +1853,7 @@ packImage: TQHeader
    • paintSectionLabel: TQHeader
    • paintingActive: TQPaintDevice
    • palette: - TQApplication TQToolTip TQWidget
    • paletteBackgroundColor: + TQApplication TQToolTip TQWidget
    • paletteBackgroundColor: TQWidget
    • paletteBackgroundPixmap: TQWidget
    • paletteChange: TQWidget
    • paletteForegroundColor: @@ -1904,7 +1904,7 @@ packImage: TQFont
    • pointSizes: TQFontDatabase
    • points: TQCanvasPolygon
    • polish: - TQApplication TQStyle TQWidget
    • polishPopupMenu: + TQApplication TQStyle TQWidget
    • polishPopupMenu: TQStyle
    • pop: TQPtrStack TQValueStack
    • popContext: TQXmlNamespaceSupport
    • pop_back: @@ -1917,7 +1917,7 @@ packImage: TQSqlRecord
    • positionFromValue: TQRangeControl
    • post: TQHttp
    • postEvent: - TQApplication
    • precision: + TQApplication
    • precision: TQSqlFieldInfo TQTextStream
    • prefix: TQDomNode TQSpinBox TQXmlNamespaceSupport
    • prefixes: TQXmlNamespaceSupport
    • prepare: @@ -1943,7 +1943,7 @@ packImage: TQPrinter
    • printerName: TQPrinter
    • printerSelectionOption: TQPrinter
    • processEvents: - TQApplication TQEventLoop
    • processExited: + TQApplication TQEventLoop
    • processExited: TQProcess
    • processIdentifier: TQProcess
    • processName: TQXmlNamespaceSupport
    • processingInstruction: @@ -1966,33 +1966,33 @@ packImage: TQPointArray
    • putch: TQFile TQIODevice TQSocket
    • tqAddPostRoutine: - TQApplication
    • tqAlpha: + TQApplication
    • tqAlpha: TQColor
    • tqBlue: TQColor
    • tqChecksum: TQMemArray
    • tqCompress: TQByteArray
    • tqDebug: - TQApplication
    • qDrawPlainRect: + TQApplication
    • qDrawPlainRect: TQPainter
    • qDrawShadeLine: TQPainter
    • qDrawShadePanel: TQPainter
    • qDrawShadeRect: TQPainter
    • qDrawWinButton: TQPainter
    • qDrawWinPanel: TQPainter
    • tqFatal: - TQApplication
    • tqGray: + TQApplication
    • tqGray: TQColor
    • tqGreen: TQColor
    • tqInitNetworkProtocols: TQUrlOperator
    • qInstallMsgHandler: - TQApplication
    • qMakePair: + TQApplication
    • qMakePair: TQPair
    • qName: TQXmlAttributes
    • tqRed: TQColor
    • tqRgb: TQColor
    • tqRgba: TQColor
    • tqSysInfo: - TQApplication
    • tqSystemWarning: - TQApplication
    • tqUncompress: + TQApplication
    • tqSystemWarning: + TQApplication
    • tqUncompress: TQByteArray
    • tqVersion: - TQApplication
    • tqWarning: - TQApplication
    • qglClearColor: + TQApplication
    • tqWarning: + TQApplication
    • qglClearColor: TQGLWidget
    • qglColor: TQGLWidget
    • tqmemmove: TQCString
    • qstrcmp: @@ -2016,7 +2016,7 @@ tqAddPostRoutine: TQStyle
    • querySubControlMetrics: TQStyle
    • question: TQMessageBox
    • quit: - TQApplication
    • + TQApplication
    • rBottom: TQRect
    • rLeft: TQRect
    • rRight: @@ -2104,7 +2104,7 @@ rBottom: TQMenuData TQPopupMenu
    • removeLabel: TQHeader
    • removeLast: TQPtrList
    • removeLibraryPath: - TQApplication
    • removeLine: + TQApplication
    • removeLine: TQMultiLineEdit
    • removeMappings: TQSignalMapper
    • removeNamedItem: TQDomNamedNodeMap
    • removeNamedItemNS: @@ -2112,7 +2112,7 @@ rBottom: TQPtrList
    • removePage: TQTabDialog TQTabWidget TQWizard
    • removeParagraph: TQTextEdit
    • removePostedEvents: - TQApplication
    • removeRef: + TQApplication
    • removeRef: TQPtrList
    • removeRenameBox: TQIconViewItem
    • removeRow: TQTable
    • removeRows: @@ -2125,7 +2125,7 @@ rBottom: TQTabWidget
    • removeTip: TQToolTipGroup
    • removeToolTip: TQTabBar
    • removeTranslator: - TQApplication
    • removeValue: + TQApplication
    • removeValue: TQHttpHeader
    • removeWidget: TQStatusBar TQWidgetStack
    • removed: TQChildEvent TQNetworkProtocol TQUrlOperator
    • rename: @@ -2178,12 +2178,12 @@ rBottom: TQSessionManager
    • restartHint: TQSessionManager
    • restore: TQPainter
    • restoreOverrideCursor: - TQApplication
    • result: + TQApplication
    • result: TQDialog TQSqlQuery
    • resultsReady: TQDns
    • retune: TQCanvas
    • returnPressed: TQIconView TQLineEdit TQListBox TQListView TQTextEdit
    • reverseLayout: - TQApplication
    • rewind: + TQApplication
    • rewind: TQDataSource TQIODeviceSource
    • rewindable: TQDataSource TQIODeviceSource
    • rgb: TQColor
    • rgba: @@ -2226,7 +2226,7 @@ rBottom: sRect: TQHeader
    • save: TQDomNode TQImage TQPainter TQPicture TQPixmap TQTranslator
    • saveState: - TQApplication
    • scale: + TQApplication
    • scale: TQImage TQPainter TQSize TQWMatrix
    • scaleFont: TQStyleSheet
    • scaleHeight: TQImage
    • scaleWidth: @@ -2276,14 +2276,14 @@ sRect: TQPixmap
    • selfNesting: TQStyleSheetItem
    • sendBufferSize: TQSocketDevice
    • sendEvent: - TQApplication
    • sendTo: + TQApplication
    • sendTo: TQDataSource TQIODeviceSource
    • sender: TQObject
    • separator: TQDateEdit TQDir TQTimeEdit
    • serialNumber: TQMimeSource TQPalette TQPixmap
    • servers: TQDns
    • sessionId: - TQApplication TQSessionManager
    • sessionKey: - TQApplication TQSessionManager
    • setAccel: + TQApplication TQSessionManager
    • sessionKey: + TQApplication TQSessionManager
    • setAccel: TQAction TQButton TQCheckBox TQMenuData TQPopupMenu TQPushButton TQRadioButton
    • setAcceptDockWindow: TQDockArea
    • setAcceptDrops: TQWidget
    • setAccum: @@ -2389,7 +2389,7 @@ sRect: TQSplitter
    • setColor: TQBrush TQCanvasText TQColorDrag TQColorGroup TQImage TQPalette TQPen TQStyleSheetItem TQTextEdit
    • setColorMode: TQPrinter
    • setColorSpec: - TQApplication
    • setColormap: + TQApplication
    • setColormap: TQGLWidget
    • setColumn: TQDataTable
    • setColumnAlignment: TQListView
    • setColumnLabels: @@ -2432,7 +2432,7 @@ sRect: TQTabBar
    • setCurrentText: TQComboBox
    • setCursor: TQWidget
    • setCursorFlashTime: - TQApplication
    • setCursorName: + TQApplication
    • setCursorName: TQSqlIndex
    • setCursorPosition: TQLineEdit TQMultiLineEdit TQTextEdit
    • setCustomColor: TQColorDialog
    • setCustomHighlighting: @@ -2463,7 +2463,7 @@ sRect: TQGLFormat
    • setDescending: TQSqlIndex
    • setDescription: TQImageIO
    • setDesktopSettingsAware: - TQApplication
    • setDevice: + TQApplication
    • setDevice: TQDataStream TQTextStream
    • setDir: TQFileDialog TQUrlInfo
    • setDirectRendering: TQGLFormat
    • setDirection: @@ -2481,7 +2481,7 @@ sRect: TQImage
    • setDoubleBuffer: TQGLFormat
    • setDoubleBuffering: TQCanvas
    • setDoubleClickInterval: - TQApplication
    • setDown: + TQApplication
    • setDown: TQButton TQCheckBox TQPushButton TQRadioButton
    • setDragAutoScroll: TQScrollView
    • setDragEnabled: TQIconViewItem TQLineEdit TQListViewItem TQTable
    • setDriverText: @@ -2493,7 +2493,7 @@ sRect: TQComboBox
    • setEditable: TQComboBox TQComboTableItem
    • setEdited: TQMultiLineEdit
    • setEffectEnabled: - TQApplication
    • setEnabled: + TQApplication
    • setEnabled: TQAccel TQAction TQCanvasItem TQLayout TQListViewItem TQSocketNotifier TQTab TQTableItem TQToolTipGroup TQWidget
    • setEncodedData: TQStoredDrag
    • setEncodedPathAndQuery: TQUrl
    • setEncoding: @@ -2536,7 +2536,7 @@ sRect: TQWidget
    • setFocusRectPolicy: TQMacStyle
    • setFocusStyle: TQTable
    • setFont: - TQApplication TQCanvasText TQComboBox TQCustomMenuItem TQLabel TQPainter TQTabDialog TQToolTip TQWhatsThis TQWidget
    • setFontFamily: + TQApplication TQCanvasText TQComboBox TQCustomMenuItem TQLabel TQPainter TQTabDialog TQToolTip TQWhatsThis TQWidget
    • setFontFamily: TQStyleSheetItem
    • setFontItalic: TQStyleSheetItem
    • setFontSize: TQStyleSheetItem
    • setFontStrikeOut: @@ -2558,8 +2558,8 @@ sRect: TQImageIO
    • setGenerated: TQSqlCursor TQSqlFieldInfo TQSqlRecord
    • setGeometry: TQBoxLayout TQGridLayout TQLayout TQLayoutItem TQSpacerItem TQWidget TQWidgetItem
    • setGlobalMouseTracking: - TQApplication
    • setGlobalStrut: - TQApplication
    • setGloballyEnabled: + TQApplication
    • setGlobalStrut: + TQApplication
    • setGloballyEnabled: TQToolTip
    • setGridX: TQIconView
    • setGridY: TQIconView
    • setGroup: @@ -2629,7 +2629,7 @@ sRect: TQTable
    • setLength: TQString
    • setLexicalHandler: TQXmlReader
    • setLibraryPaths: - TQApplication
    • setLineEdit: + TQApplication
    • setLineEdit: TQComboBox
    • setLineStep: TQDial TQScrollBar TQSlider TQSpinBox
    • setLineWidth: TQFrame
    • setLinkUnderline: @@ -2641,7 +2641,7 @@ sRect: TQStyleSheetItem
    • setLooping: TQImageConsumer
    • setLoops: TQSound
    • setMainWidget: - TQApplication
    • setManagerProperty: + TQApplication
    • setManagerProperty: TQSessionManager
    • setMapping: TQSignalMapper
    • setMargin: TQFrame TQLayout TQStyleSheetItem TQTabWidget
    • setMargins: @@ -2718,13 +2718,13 @@ sRect: TQPrinter
    • setOverlay: TQGLFormat
    • setOverline: TQFont
    • setOverrideCursor: - TQApplication
    • setOverwriteMode: + TQApplication
    • setOverwriteMode: TQTextEdit
    • setOwner: TQUrlInfo
    • setPageOrder: TQPrinter
    • setPageSize: TQPrinter
    • setPageStep: TQDial TQScrollBar TQSlider
    • setPalette: - TQApplication TQComboBox TQScrollBar TQSlider TQToolTip TQWidget
    • setPaletteBackgroundColor: + TQApplication TQComboBox TQScrollBar TQSlider TQToolTip TQWidget
    • setPaletteBackgroundColor: TQWidget
    • setPaletteBackgroundPixmap: TQWidget
    • setPaletteForegroundColor: TQWidget
    • setPaper: @@ -2794,7 +2794,7 @@ sRect: TQSessionManager
    • setRestartHint: TQSessionManager
    • setResult: TQDialog
    • setReverseLayout: - TQApplication
    • setRgb: + TQApplication
    • setRgb: TQColor
    • setRgba: TQGLFormat
    • setRight: TQRect
    • setRootIsDecorated: @@ -2853,8 +2853,8 @@ sRect: TQMovie
    • setSqlCursor: TQDataBrowser TQDataTable
    • setStandardColor: TQColorDialog
    • setStartDragDistance: - TQApplication
    • setStartDragTime: - TQApplication
    • setState: + TQApplication
    • setStartDragTime: + TQApplication
    • setState: TQButton TQCheckListItem TQIODevice TQNetworkOperation
    • setStaticBackground: TQScrollView
    • setStatus: TQIODevice TQImageIO
    • setStatusTip: @@ -2869,7 +2869,7 @@ sRect: TQToolBar
    • setStrikeOut: TQFont
    • setStringList: TQComboTableItem
    • setStyle: - TQApplication TQBrush TQPen TQWidget
    • setStyleHint: + TQApplication TQBrush TQPen TQWidget
    • setStyleHint: TQFont
    • setStyleSheet: TQTextEdit
    • setStyleStrategy: TQFont
    • setSubtype: @@ -2962,7 +2962,7 @@ sRect: TQToolTip
    • setWeight: TQFont
    • setWhatsThis: TQAccel TQAction TQMenuData TQPopupMenu
    • setWheelScrollLines: - TQApplication
    • setWhiteSpaceMode: + TQApplication
    • setWhiteSpaceMode: TQStyleSheetItem
    • setWidget: TQDockWindow
    • setWidgetSizePolicy: TQMacStyle
    • setWidth: @@ -3076,8 +3076,8 @@ sRect: TQXmlLexicalHandler
    • startDocument: TQXmlContentHandler
    • startDrag: TQIconView TQListView TQTable
    • startDragDistance: - TQApplication
    • startDragTime: - TQApplication
    • startElement: + TQApplication
    • startDragTime: + TQApplication
    • startElement: TQXmlContentHandler
    • startEntity: TQXmlLexicalHandler
    • startPoint: TQCanvasLine
    • startPrefixMapping: @@ -3085,7 +3085,7 @@ sRect: TQListViewItem
    • startTimer: TQObject
    • startedNextCopy: TQUrlOperator
    • startingUp: - TQApplication
    • startsWith: + TQApplication
    • startsWith: TQString
    • state: TQAccessibleInterface TQButton TQCheckBox TQCheckListItem TQContextMenuEvent TQFtp TQHttp TQIODevice TQKeyEvent TQMouseEvent TQNetworkOperation TQPushButton TQRadioButton TQSocket TQWheelEvent
    • stateAfter: TQKeyEvent TQMouseEvent
    • stateChange: @@ -3110,7 +3110,7 @@ sRect: TQFontMetrics
    • string: TQConstString
    • stripWhiteSpace: TQCString TQString
    • style: - TQApplication TQBrush TQPen TQWidget
    • styleChange: + TQApplication TQBrush TQPen TQWidget
    • styleChange: TQWidget
    • styleHint: TQFont TQFontInfo TQStyle
    • stylePixmap: TQStyle
    • styleSheet: @@ -3141,7 +3141,7 @@ sRect: TQImage
    • swapRows: TQTable
    • sync: TQTextEdit
    • syncX: - TQApplication
    • syntaxHighlighter: + TQApplication
    • syntaxHighlighter: TQTextEdit
    • system: TQLocale
    • systemBitOrder: TQImage
    • systemByteOrder: @@ -3284,7 +3284,7 @@ tab: TQListBox
    • topLeft: TQRect
    • topLevelWidget: TQWidget
    • topLevelWidgets: - TQApplication
    • topMargin: + TQApplication
    • topMargin: TQScrollView
    • topRight: TQRect
    • topRow: TQTableSelection
    • total: @@ -3297,7 +3297,7 @@ tab: TQDial TQHeader TQScrollBar TQSlider
    • transaction: TQSqlDatabase
    • transformationMode: TQWMatrix
    • translate: - TQApplication TQPainter TQPointArray TQRegion TQWMatrix
    • translation: + TQApplication TQPainter TQPointArray TQRegion TQWMatrix
    • translation: TQTranslatorMessage
    • transpose: TQSize TQSizePolicy
    • treeStepSize: TQListView
    • triggerUpdate: @@ -3306,10 +3306,10 @@ tab: TQDataTable
    • truncate: TQCString TQMemArray TQString
    • tryAccess: TQSemaphore
    • tryLock: - TQApplication TQMutex
    • tryTerminate: + TQApplication TQMutex
    • tryTerminate: TQProcess
    • turnOffChild: TQCheckListItem
    • type: - TQApplication TQCheckListItem TQEvent TQMetaProperty TQSocketDevice TQSocketNotifier TQSqlError TQSqlField TQSqlFieldInfo TQVariant TQXmlAttributes
    • typeID: + TQApplication TQCheckListItem TQEvent TQMetaProperty TQSocketDevice TQSocketNotifier TQSqlError TQSqlField TQSqlFieldInfo TQVariant TQXmlAttributes
    • typeID: TQSqlFieldInfo
    • typeName: TQVariant
    • typeToName: TQVariant
    • @@ -3328,7 +3328,7 @@ ucs2: TQTabletEvent
    • unite: TQRect TQRegion
    • unload: TQLibrary
    • unlock: - TQApplication TQMutex
    • unparsedEntityDecl: + TQApplication TQMutex
    • unparsedEntityDecl: TQXmlDTDHandler
    • unpause: TQMovie
    • unregisterDecoderFactory: TQImageDecoder
    • unregisterSocketNotifier: @@ -3412,7 +3412,7 @@ wait: TQWaitCondition
    • wakeOne: TQWaitCondition
    • wakeUp: TQEventLoop
    • wakeUpGuiThread: - TQApplication
    • warning: + TQApplication
    • warning: TQMessageBox TQXmlErrorHandler
    • wasCanceled: TQProgressDialog
    • weekNumber: TQDate
    • weight: @@ -3420,10 +3420,10 @@ wait: TQAccel TQAction TQMainWindow TQMenuData TQPopupMenu TQWidgetPlugin
    • whatsThisButton: TQWhatsThis
    • wheelEvent: TQWidget
    • wheelScrollLines: - TQApplication
    • whiteSpaceMode: + TQApplication
    • whiteSpaceMode: TQStyleSheetItem
    • widget: TQDockWindow TQLayoutItem TQSqlForm TQStyleOption TQWidgetItem TQWidgetStack
    • widgetAt: - TQApplication
    • widgetSizePolicy: + TQApplication
    • widgetSizePolicy: TQMacStyle
    • widgetToField: TQSqlForm
    • widgets: TQWidgetFactory
    • width: @@ -3433,8 +3433,8 @@ wait: TQSimpleRichText
    • wildcard: TQRegExp
    • winEvent: TQWidget
    • winEventFilter: - TQApplication
    • winFocus: - TQApplication
    • winId: + TQApplication
    • winFocus: + TQApplication
    • winId: TQWidget
    • winPageSize: TQPrinter
    • winding: TQCanvasPolygonalItem
    • window: @@ -3482,8 +3482,8 @@ x: TQPaintDevice
    • x11Display: TQPaintDevice
    • x11Event: TQWidget
    • x11EventFilter: - TQApplication
    • x11ProcessEvent: - TQApplication
    • x11Screen: + TQApplication
    • x11ProcessEvent: + TQApplication
    • x11Screen: TQPaintDevice
    • x11SetAppDpiX: TQPaintDevice
    • x11SetAppDpiY: TQPaintDevice
    • x11Visual: diff --git a/doc/html/groups.html b/doc/html/groups.html index 51456cefa..715183466 100644 --- a/doc/html/groups.html +++ b/doc/html/groups.html @@ -67,7 +67,7 @@ event handling, access to system settings and Utility Classes Collection classes such as list, queue, stack and string, along -with other classes that can be used without needing TQApplication. +with other classes that can be used without needing TQApplication. Graphics and Printing Classes providing drawing (and printing) primitives, including diff --git a/doc/html/headers.html b/doc/html/headers.html index fc4beba1a..cc8c59e29 100644 --- a/doc/html/headers.html +++ b/doc/html/headers.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; }
    • tqaccel.h
    • tqaccessible.h
    • tqaction.h -
    • ntqapplication.h +
    • tqapplication.h
    • tqasciicache.h
    • tqasciidict.h
    • tqassistantclient.h diff --git a/doc/html/hello-example.html b/doc/html/hello-example.html index 47f0f277a..d3479116b 100644 --- a/doc/html/hello-example.html +++ b/doc/html/hello-example.html @@ -191,7 +191,7 @@ void Hello::paintEvent( ntqapplication.h> +#include <tqapplication.h> /* @@ -201,7 +201,7 @@ void Hello::paintEvent( TQApplication a(argc,argv); + TQApplication a(argc,argv); TQString s; for ( int i=1; i<argc; i++ ) { s += argv[i]; @@ -214,12 +214,12 @@ int main( int argc, char **argv ) #ifndef TQT_NO_WIDGET_TOPEXTRA // for TQt/Embedded minimal build h.setCaption( "TQt says hello" ); #endif - TQObject::connect( &h, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); + TQObject::connect( &h, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); h.setFont( TQFont("times",32,TQFont::Bold) ); // default font h.setBackgroundColor( TQt::white ); // default bg color - a.setMainWidget( &h ); + a.setMainWidget( &h ); h.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/helpsystem-example.html b/doc/html/helpsystem-example.html index 89f6ac710..3b7df0469 100644 --- a/doc/html/helpsystem-example.html +++ b/doc/html/helpsystem-example.html @@ -455,16 +455,16 @@ location of the documentation files and shows the specified page in TQt Assistant. -
          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include "mainwindow.h"
       
           int main( int argc, char** argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
               MainWindow main;
               main.show();
      -        app.setMainWidget( &main );
      -        return app.exec();
      +        app.setMainWidget( &main );
      +        return app.exec();
           }
       

      The main function is a standard implementation opening diff --git a/doc/html/helpviewer-example.html b/doc/html/helpviewer-example.html index 210654ae4..895524ec5 100644 --- a/doc/html/helpviewer-example.html +++ b/doc/html/helpviewer-example.html @@ -127,7 +127,7 @@ private: #include <tqstylesheet.h> #include <tqmessagebox.h> #include <tqfiledialog.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcombobox.h> #include <tqevent.h> #include <tqlineedit.h> @@ -173,7 +173,7 @@ private: file->insertItem( tr("&Print"), this, TQ_SLOT( print() ), CTRL+Key_P ); file->insertSeparator(); file->insertItem( tr("&Close"), this, TQ_SLOT( close() ), CTRL+Key_Q ); - file->insertItem( tr("E&xit"), tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_X ); + file->insertItem( tr("E&xit"), tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_X ); // The same three icons are used twice each. TQIconSet icon_back( TQPixmap("back.xpm") ); @@ -435,15 +435,15 @@ void HelpWindow::addBookmark() *****************************************************************************/ #include "helpwindow.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdir.h> #include <stdlib.h> int main( int argc, char ** argv ) { - TQApplication::setColorSpec( TQApplication::ManyColor ); - TQApplication a(argc, argv); + TQApplication::setColorSpec( TQApplication::ManyColor ); + TQApplication a(argc, argv); TQString home; if (argc > 1) { @@ -455,16 +455,16 @@ int main( int argc, char ** argv ) HelpWindow *help = new HelpWindow(home, ".", 0, "help viewer"); help->setCaption("TQt Example - Helpviewer"); - if ( TQApplication::desktop()->width() > 400 - && TQApplication::desktop()->height() > 500 ) + if ( TQApplication::desktop()->width() > 400 + && TQApplication::desktop()->height() > 500 ) help->show(); else help->showMaximized(); - TQObject::connect( &a, TQ_SIGNAL(lastWindowClosed()), - &a, TQ_SLOT(quit()) ); + TQObject::connect( &a, TQ_SIGNAL(lastWindowClosed()), + &a, TQ_SLOT(quit()) ); - return a.exec(); + return a.exec(); }

      diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index 0d9e89dfa..dbeee1e25 100644 --- a/doc/html/hierarchy.html +++ b/doc/html/hierarchy.html @@ -297,7 +297,7 @@ classes in the TQt API. -
    • TQApplication +
    • TQApplication
    • TQAssistantClient
      diff --git a/doc/html/httpd-example.html b/doc/html/httpd-example.html index 06a1d69a4..7537218e2 100644 --- a/doc/html/httpd-example.html +++ b/doc/html/httpd-example.html @@ -51,7 +51,7 @@ sending the page, it closes the connection. #include <tqsocket.h> #include <tqregexp.h> #include <tqserversocket.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmainwindow.h> #include <tqtextstream.h> #include <tqvbox.h> @@ -68,7 +68,7 @@ public: TQServerSocket(8080,1,parent) { if ( !ok() ) { - tqWarning("Failed to bind to port 8080"); + tqWarning("Failed to bind to port 8080"); exit( 1 ); } } @@ -144,7 +144,7 @@ public: connect( httpd, TQ_SIGNAL(newConnect()), TQ_SLOT(newConnect()) ); connect( httpd, TQ_SIGNAL(endConnect()), TQ_SLOT(endConnect()) ); connect( httpd, TQ_SIGNAL(wroteToClient()), TQ_SLOT(wroteToClient()) ); - connect( quit, TQ_SIGNAL(pressed()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(pressed()), tqApp, TQ_SLOT(quit()) ); } ~HttpInfo() @@ -172,11 +172,11 @@ private: int main( int argc, char** argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); HttpInfo info; - app.setMainWidget( &info ); + app.setMainWidget( &info ); info.show(); - return app.exec(); + return app.exec(); } #include "httpd.moc" diff --git a/doc/html/i18n-example.html b/doc/html/i18n-example.html index 45ad9e907..8d17ef04f 100644 --- a/doc/html/i18n-example.html +++ b/doc/html/i18n-example.html @@ -98,7 +98,7 @@ private: #include <tqpopupmenu.h> #include <tqmenubar.h> #include <tqstatusbar.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include "mywidget.h" @@ -111,7 +111,7 @@ private: setCentralWidget(central); TQPopupMenu* file = new TQPopupMenu(this); - file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()), + file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()), TQAccel::stringToKey(tr("Ctrl+Q")) ); menuBar()->insertItem( tr("&File"), file ); @@ -164,7 +164,7 @@ void MyWidget::initChoices(TQWidget* parent) ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqtranslator.h> #include <tqfileinfo.h> #include <tqmessagebox.h> @@ -228,7 +228,7 @@ MyWidget* showLang(TQString lang) static TQTranslator *translator = 0; - tqApp->setPalette(TQPalette(TQColor(220-rand()%64,220-rand()%64,220-rand()%64))); + tqApp->setPalette(TQPalette(TQColor(220-rand()%64,220-rand()%64,220-rand()%64))); lang = "mywidget_" + lang + ".qm"; TQFileInfo fi( lang ); @@ -240,12 +240,12 @@ MyWidget* showLang(TQString lang) return 0; } if ( translator ) { - tqApp->removeTranslator( translator ); + tqApp->removeTranslator( translator ); delete translator; } translator = new TQTranslator( 0 ); translator->load( lang, "." ); - tqApp->installTranslator( translator ); + tqApp->installTranslator( translator ); MyWidget *m = new MyWidget; m->setCaption("TQt Example - i18n - " + m->caption() ); return m; @@ -253,7 +253,7 @@ MyWidget* showLang(TQString lang) int main( int argc, char** argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); const char* qm[]= { "ar", "cs", "de", "el", "en", "eo", "fr", "it", "jp", "ko", "no", "ru", "zh", 0 }; @@ -283,7 +283,7 @@ int main( int argc, char** argv ) r = dlg.exec(); } if ( r ) { - TQRect screen = tqApp->desktop()->availableGeometry(); + TQRect screen = tqApp->desktop()->availableGeometry(); bool tight = screen.width() < 1024; int x=screen.left()+5; int y=screen.top()+25; @@ -292,7 +292,7 @@ int main( int argc, char** argv ) MyWidget* w = showLang((const char*)qm[i]); if( w == 0 ) exit( 0 ); - TQObject::connect(w, TQ_SIGNAL(closed()), tqApp, TQ_SLOT(quit())); + TQObject::connect(w, TQ_SIGNAL(closed()), tqApp, TQ_SLOT(quit())); w->setGeometry(x,y,197,356); w->show(); if ( tight ) { @@ -313,7 +313,7 @@ int main( int argc, char** argv ) } else { TQString lang = argv[1]; TQWidget* m = showLang(lang); - app.setMainWidget( m ); + app.setMainWidget( m ); m->setCaption("TQt Example - i18n"); m->show(); } @@ -323,7 +323,7 @@ int main( int argc, char** argv ) #endif // While we run "all", kill them all - return app.exec(); + return app.exec(); } diff --git a/doc/html/i18n.html b/doc/html/i18n.html index 75b50385a..bd7ba3bc4 100644 --- a/doc/html/i18n.html +++ b/doc/html/i18n.html @@ -176,7 +176,7 @@ const char* and char from traditional C.

      Use tr() for all Literal Text

      Wherever your program uses "quoted text" for text that will -be presented to the user, ensure that it is processed by the TQApplication::translate() function. Essentially all that is necessary +be presented to the user, ensure that it is processed by the TQApplication::translate() function. Essentially all that is necessary to achieve this is to use TQObject::tr(). For example, assuming the LoginWidget is a subclass of TQWidget:

      @@ -191,7 +191,7 @@ to achieve this is to use TQObject::tr(). For exa
       write.
       

      If the quoted text is not in a member function of a TQObject subclass, use either the tr() function of an -appropriate class, or the TQApplication::translate() function +appropriate class, or the TQApplication::translate() function directly:

           void some_global_function( LoginWidget *logwid )
      @@ -203,7 +203,7 @@ directly:
           void same_global_function( LoginWidget *logwid )
           {
               TQLabel *label = new TQLabel(
      -                tqApp->translate("LoginWidget", "Password:"),
      +                tqApp->translate("LoginWidget", "Password:"),
                       logwid );
           }
       
      @@ -239,7 +239,7 @@ The macros expand to just the text (without the context). TQString global_greeting( int greet_type ) { - return tqApp->translate( "FriendlyConversation", + return tqApp->translate( "FriendlyConversation", greeting_strings[greet_type] ); }
      @@ -252,7 +252,7 @@ Disabling the conversion can make programming a bit cumbersome.

      If your source language uses characters outside Latin-1, you might find TQObject::trUtf8() more convenient than TQObject::tr(), as tr() depends on the -TQApplication::defaultCodec(), which makes it more fragile than +TQApplication::defaultCodec(), which makes it more fragile than TQObject::trUtf8().

      Use TQKeySequence() for Accelerator Values

      @@ -288,8 +288,8 @@ example: TQString s1 = "%1 of %2 files copied. Copying: %3"; TQString s2 = "Kopierer nu %3. Av totalt %2 filer er %1 kopiert."; - tqDebug( s1.arg(5).arg(10).arg("somefile.txt").ascii() ); - tqDebug( s2.arg(5).arg(10).arg("somefile.txt").ascii() ); + tqDebug( s1.arg(5).arg(10).arg("somefile.txt").ascii() ); + tqDebug( s2.arg(5).arg(10).arg("somefile.txt").ascii() );

      produces the correct output in English and Norwegian: @@ -345,7 +345,7 @@ Norwegian and Swedish. If you use qmake, you usu file for lupdate; your qmake project file will work fine once you add the TRANSLATIONS entry.

      In your application, you must TQTranslator::load() the translation -files appropriate for the user's language, and install them using TQApplication::installTranslator(). +files appropriate for the user's language, and install them using TQApplication::installTranslator().

      If you have been using the old TQt tools (tqtfindtr, msg2tqm and tqtmergetr), you can use tqm2ts to convert your old .qm files.

      linguist, lupdate and lrelease are installed in the bin subdirectory of the base directory TQt is installed into. Click Help|Manual @@ -368,21 +368,21 @@ useful.)

           int main( int argc, char **argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               // translation file for TQt
               TQTranslator qt( 0 );
               qt.load( TQString( "qt_" ) + TQTextCodec::locale(), "." );
      -        app.installTranslator( &qt );
      +        app.installTranslator( &qt );
       
               // translation file for application strings
               TQTranslator myapp( 0 );
               myapp.load( TQString( "myapp_" ) + TQTextCodec::locale(), "." );
      -        app.installTranslator( &myapp );
      +        app.installTranslator( &myapp );
       
               ...
       
      -        return app.exec();
      +        return app.exec();
           }
       
      diff --git a/doc/html/iconview-example.html b/doc/html/iconview-example.html index c81d36f0b..2208c85b4 100644 --- a/doc/html/iconview-example.html +++ b/doc/html/iconview-example.html @@ -47,7 +47,7 @@ view modes, rubberband selection, etc. *****************************************************************************/ #include <tqiconview.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdragobject.h> #include <tqpixmap.h> #include <tqiconset.h> @@ -66,18 +66,18 @@ public: public slots: void dropped( TQDropEvent *mime ) { - tqDebug( "Dropped Mimesource %p into the view %p", mime, view ); - tqDebug( " Formats:" ); + tqDebug( "Dropped Mimesource %p into the view %p", mime, view ); + tqDebug( " Formats:" ); int i = 0; const char *str = mime->format( i ); - tqDebug( " %s", str ); + tqDebug( " %s", str ); while ( str ) { - tqDebug( " %s", str ); + tqDebug( " %s", str ); str = mime->format( ++i ); } }; void moved() { - tqDebug( "All selected items were moved to another widget" ); + tqDebug( "All selected items were moved to another widget" ); } protected: @@ -87,7 +87,7 @@ protected: int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TQIconView tqiconview; tqiconview.setSelectionMode( TQIconView::Extended ); @@ -104,11 +104,11 @@ int main( int argc, char **argv ) &listen_dnd, TQ_SLOT( dropped( TQDropEvent * ) ) ); TQObject::connect( &tqiconview, TQ_SIGNAL( moved() ), &listen_dnd, TQ_SLOT( moved() ) ); - a.setMainWidget( &tqiconview ); + a.setMainWidget( &tqiconview ); tqiconview.show(); tqiconview.resize( tqiconview.sizeHint() ); - return a.exec(); + return a.exec(); } #include "main.moc" diff --git a/doc/html/iconview-simple_dd-main-cpp.html b/doc/html/iconview-simple_dd-main-cpp.html index fb9f51f0a..e7160804d 100644 --- a/doc/html/iconview-simple_dd-main-cpp.html +++ b/doc/html/iconview-simple_dd-main-cpp.html @@ -191,13 +191,13 @@ void DDIconView::slotNewItem( TQDrop int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); // Create and show the widgets TQSplitter *split = new TQSplitter(); DDIconView *iv = new DDIconView( split ); (void) new DDListBox( split ); - app.setMainWidget( split ); + app.setMainWidget( split ); split->resize( 600, 400 ); split->show(); @@ -215,7 +215,7 @@ int main( int argc, char *argv[] ) item = new DDIconViewItem( iv, "Blue", TQPixmap( blue_icon ) ); item->setRenameEnabled( TRUE ); - return app.exec(); + return app.exec(); } diff --git a/doc/html/iconview-simple_dd-main-h.html b/doc/html/iconview-simple_dd-main-h.html index de28cec58..a91815ff4 100644 --- a/doc/html/iconview-simple_dd-main-h.html +++ b/doc/html/iconview-simple_dd-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcursor.h> #include <tqsplitter.h> #include <tqlistbox.h> diff --git a/doc/html/index b/doc/html/index index 4f94b1562..042448975 100644 --- a/doc/html/index +++ b/doc/html/index @@ -208,107 +208,107 @@ "TQActionGroup::usesDropDown" tqactiongroup.html#usesDropDown "TQActionGroup::usesDropDown" tqactiongroup.html#usesDropDown-prop "TQActionGroup::~TQActionGroup" tqactiongroup.html#~TQActionGroup -"QApplication" ntqapplication.html -"QApplication::ColorSpec" ntqapplication.html#ColorSpec -"QApplication::Encoding" ntqapplication.html#Encoding -"QApplication::Type" ntqapplication.html#Type -"QApplication::aboutTQt" ntqapplication.html#aboutTQt -"QApplication::aboutToQuit" ntqapplication.html#aboutToQuit -"QApplication::activeModalWidget" ntqapplication.html#activeModalWidget -"QApplication::activePopupWidget" ntqapplication.html#activePopupWidget -"QApplication::activeWindow" ntqapplication.html#activeWindow -"QApplication::addLibraryPath" ntqapplication.html#addLibraryPath -"QApplication::allWidgets" ntqapplication.html#allWidgets -"QApplication::applicationDirPath" ntqapplication.html#applicationDirPath -"QApplication::applicationFilePath" ntqapplication.html#applicationFilePath -"QApplication::argc" ntqapplication.html#argc -"QApplication::argv" ntqapplication.html#argv -"QApplication::beep" ntqapplication.html#beep -"QApplication::clipboard" ntqapplication.html#clipboard -"QApplication::closeAllWindows" ntqapplication.html#closeAllWindows -"QApplication::closingDown" ntqapplication.html#closingDown -"QApplication::colorSpec" ntqapplication.html#colorSpec -"QApplication::commitData" ntqapplication.html#commitData -"QApplication::cursorFlashTime" ntqapplication.html#cursorFlashTime -"QApplication::desktop" ntqapplication.html#desktop -"QApplication::desktopSettingsAware" ntqapplication.html#desktopSettingsAware -"QApplication::doubleClickInterval" ntqapplication.html#doubleClickInterval -"QApplication::eventLoop" ntqapplication.html#eventLoop -"QApplication::exec" ntqapplication.html#exec -"QApplication::exit" ntqapplication.html#exit -"QApplication::flush" ntqapplication.html#flush -"QApplication::flushX" ntqapplication.html#flushX -"QApplication::focusWidget" ntqapplication.html#focusWidget -"QApplication::font" ntqapplication.html#font -"QApplication::fontMetrics" ntqapplication.html#fontMetrics -"QApplication::globalStrut" ntqapplication.html#globalStrut -"QApplication::guiThreadAwake" ntqapplication.html#guiThreadAwake -"QApplication::hasGlobalMouseTracking" ntqapplication.html#hasGlobalMouseTracking -"QApplication::hasPendingEvents" ntqapplication.html#hasPendingEvents -"QApplication::horizontalAlignment" ntqapplication.html#horizontalAlignment -"QApplication::initialize" ntqapplication.html#initialize -"QApplication::installTranslator" ntqapplication.html#installTranslator -"QApplication::isEffectEnabled" ntqapplication.html#isEffectEnabled -"QApplication::isSessionRestored" ntqapplication.html#isSessionRestored -"QApplication::lastWindowClosed" ntqapplication.html#lastWindowClosed -"QApplication::libraryPaths" ntqapplication.html#libraryPaths -"QApplication::lock" ntqapplication.html#lock -"QApplication::locked" ntqapplication.html#locked -"QApplication::macEventFilter" ntqapplication.html#macEventFilter -"QApplication::mainWidget" ntqapplication.html#mainWidget -"QApplication::notify" ntqapplication.html#notify -"QApplication::overrideCursor" ntqapplication.html#overrideCursor -"QApplication::palette" ntqapplication.html#palette -"QApplication::polish" ntqapplication.html#polish -"QApplication::postEvent" ntqapplication.html#postEvent -"QApplication::processEvents" ntqapplication.html#processEvents -"QApplication::quit" ntqapplication.html#quit -"QApplication::removeLibraryPath" ntqapplication.html#removeLibraryPath -"QApplication::removePostedEvent" ntqapplication.html#removePostedEvent -"QApplication::removePostedEvents" ntqapplication.html#removePostedEvents -"QApplication::removeTranslator" ntqapplication.html#removeTranslator -"QApplication::restoreOverrideCursor" ntqapplication.html#restoreOverrideCursor -"QApplication::reverseLayout" ntqapplication.html#reverseLayout -"QApplication::saveState" ntqapplication.html#saveState -"QApplication::sendEvent" ntqapplication.html#sendEvent -"QApplication::sendPostedEvents" ntqapplication.html#sendPostedEvents -"QApplication::sessionId" ntqapplication.html#sessionId -"QApplication::sessionKey" ntqapplication.html#sessionKey -"QApplication::setColorSpec" ntqapplication.html#setColorSpec -"QApplication::setCursorFlashTime" ntqapplication.html#setCursorFlashTime -"QApplication::setDesktopSettingsAware" ntqapplication.html#setDesktopSettingsAware -"QApplication::setDoubleClickInterval" ntqapplication.html#setDoubleClickInterval -"QApplication::setEffectEnabled" ntqapplication.html#setEffectEnabled -"QApplication::setFont" ntqapplication.html#setFont -"QApplication::setGlobalMouseTracking" ntqapplication.html#setGlobalMouseTracking -"QApplication::setGlobalStrut" ntqapplication.html#setGlobalStrut -"QApplication::setLibraryPaths" ntqapplication.html#setLibraryPaths -"QApplication::setMainWidget" ntqapplication.html#setMainWidget -"QApplication::setOverrideCursor" ntqapplication.html#setOverrideCursor -"QApplication::setPalette" ntqapplication.html#setPalette -"QApplication::setReverseLayout" ntqapplication.html#setReverseLayout -"QApplication::setStartDragDistance" ntqapplication.html#setStartDragDistance -"QApplication::setStartDragTime" ntqapplication.html#setStartDragTime -"QApplication::setStyle" ntqapplication.html#setStyle -"QApplication::setWheelScrollLines" ntqapplication.html#setWheelScrollLines -"QApplication::startDragDistance" ntqapplication.html#startDragDistance -"QApplication::startDragTime" ntqapplication.html#startDragTime -"QApplication::startingUp" ntqapplication.html#startingUp -"QApplication::style" ntqapplication.html#style -"QApplication::syncX" ntqapplication.html#syncX -"QApplication::topLevelWidgets" ntqapplication.html#topLevelWidgets -"QApplication::translate" ntqapplication.html#translate -"QApplication::tryLock" ntqapplication.html#tryLock -"QApplication::type" ntqapplication.html#type -"QApplication::unlock" ntqapplication.html#unlock -"QApplication::wakeUpGuiThread" ntqapplication.html#wakeUpGuiThread -"QApplication::wheelScrollLines" ntqapplication.html#wheelScrollLines -"QApplication::widgetAt" ntqapplication.html#widgetAt -"QApplication::winEventFilter" ntqapplication.html#winEventFilter -"QApplication::winFocus" ntqapplication.html#winFocus -"QApplication::x11EventFilter" ntqapplication.html#x11EventFilter -"QApplication::x11ProcessEvent" ntqapplication.html#x11ProcessEvent -"QApplication::~QApplication" ntqapplication.html#~QApplication +"TQApplication" tqapplication.html +"TQApplication::ColorSpec" tqapplication.html#ColorSpec +"TQApplication::Encoding" tqapplication.html#Encoding +"TQApplication::Type" tqapplication.html#Type +"TQApplication::aboutTQt" tqapplication.html#aboutTQt +"TQApplication::aboutToQuit" tqapplication.html#aboutToQuit +"TQApplication::activeModalWidget" tqapplication.html#activeModalWidget +"TQApplication::activePopupWidget" tqapplication.html#activePopupWidget +"TQApplication::activeWindow" tqapplication.html#activeWindow +"TQApplication::addLibraryPath" tqapplication.html#addLibraryPath +"TQApplication::allWidgets" tqapplication.html#allWidgets +"TQApplication::applicationDirPath" tqapplication.html#applicationDirPath +"TQApplication::applicationFilePath" tqapplication.html#applicationFilePath +"TQApplication::argc" tqapplication.html#argc +"TQApplication::argv" tqapplication.html#argv +"TQApplication::beep" tqapplication.html#beep +"TQApplication::clipboard" tqapplication.html#clipboard +"TQApplication::closeAllWindows" tqapplication.html#closeAllWindows +"TQApplication::closingDown" tqapplication.html#closingDown +"TQApplication::colorSpec" tqapplication.html#colorSpec +"TQApplication::commitData" tqapplication.html#commitData +"TQApplication::cursorFlashTime" tqapplication.html#cursorFlashTime +"TQApplication::desktop" tqapplication.html#desktop +"TQApplication::desktopSettingsAware" tqapplication.html#desktopSettingsAware +"TQApplication::doubleClickInterval" tqapplication.html#doubleClickInterval +"TQApplication::eventLoop" tqapplication.html#eventLoop +"TQApplication::exec" tqapplication.html#exec +"TQApplication::exit" tqapplication.html#exit +"TQApplication::flush" tqapplication.html#flush +"TQApplication::flushX" tqapplication.html#flushX +"TQApplication::focusWidget" tqapplication.html#focusWidget +"TQApplication::font" tqapplication.html#font +"TQApplication::fontMetrics" tqapplication.html#fontMetrics +"TQApplication::globalStrut" tqapplication.html#globalStrut +"TQApplication::guiThreadAwake" tqapplication.html#guiThreadAwake +"TQApplication::hasGlobalMouseTracking" tqapplication.html#hasGlobalMouseTracking +"TQApplication::hasPendingEvents" tqapplication.html#hasPendingEvents +"TQApplication::horizontalAlignment" tqapplication.html#horizontalAlignment +"TQApplication::initialize" tqapplication.html#initialize +"TQApplication::installTranslator" tqapplication.html#installTranslator +"TQApplication::isEffectEnabled" tqapplication.html#isEffectEnabled +"TQApplication::isSessionRestored" tqapplication.html#isSessionRestored +"TQApplication::lastWindowClosed" tqapplication.html#lastWindowClosed +"TQApplication::libraryPaths" tqapplication.html#libraryPaths +"TQApplication::lock" tqapplication.html#lock +"TQApplication::locked" tqapplication.html#locked +"TQApplication::macEventFilter" tqapplication.html#macEventFilter +"TQApplication::mainWidget" tqapplication.html#mainWidget +"TQApplication::notify" tqapplication.html#notify +"TQApplication::overrideCursor" tqapplication.html#overrideCursor +"TQApplication::palette" tqapplication.html#palette +"TQApplication::polish" tqapplication.html#polish +"TQApplication::postEvent" tqapplication.html#postEvent +"TQApplication::processEvents" tqapplication.html#processEvents +"TQApplication::quit" tqapplication.html#quit +"TQApplication::removeLibraryPath" tqapplication.html#removeLibraryPath +"TQApplication::removePostedEvent" tqapplication.html#removePostedEvent +"TQApplication::removePostedEvents" tqapplication.html#removePostedEvents +"TQApplication::removeTranslator" tqapplication.html#removeTranslator +"TQApplication::restoreOverrideCursor" tqapplication.html#restoreOverrideCursor +"TQApplication::reverseLayout" tqapplication.html#reverseLayout +"TQApplication::saveState" tqapplication.html#saveState +"TQApplication::sendEvent" tqapplication.html#sendEvent +"TQApplication::sendPostedEvents" tqapplication.html#sendPostedEvents +"TQApplication::sessionId" tqapplication.html#sessionId +"TQApplication::sessionKey" tqapplication.html#sessionKey +"TQApplication::setColorSpec" tqapplication.html#setColorSpec +"TQApplication::setCursorFlashTime" tqapplication.html#setCursorFlashTime +"TQApplication::setDesktopSettingsAware" tqapplication.html#setDesktopSettingsAware +"TQApplication::setDoubleClickInterval" tqapplication.html#setDoubleClickInterval +"TQApplication::setEffectEnabled" tqapplication.html#setEffectEnabled +"TQApplication::setFont" tqapplication.html#setFont +"TQApplication::setGlobalMouseTracking" tqapplication.html#setGlobalMouseTracking +"TQApplication::setGlobalStrut" tqapplication.html#setGlobalStrut +"TQApplication::setLibraryPaths" tqapplication.html#setLibraryPaths +"TQApplication::setMainWidget" tqapplication.html#setMainWidget +"TQApplication::setOverrideCursor" tqapplication.html#setOverrideCursor +"TQApplication::setPalette" tqapplication.html#setPalette +"TQApplication::setReverseLayout" tqapplication.html#setReverseLayout +"TQApplication::setStartDragDistance" tqapplication.html#setStartDragDistance +"TQApplication::setStartDragTime" tqapplication.html#setStartDragTime +"TQApplication::setStyle" tqapplication.html#setStyle +"TQApplication::setWheelScrollLines" tqapplication.html#setWheelScrollLines +"TQApplication::startDragDistance" tqapplication.html#startDragDistance +"TQApplication::startDragTime" tqapplication.html#startDragTime +"TQApplication::startingUp" tqapplication.html#startingUp +"TQApplication::style" tqapplication.html#style +"TQApplication::syncX" tqapplication.html#syncX +"TQApplication::topLevelWidgets" tqapplication.html#topLevelWidgets +"TQApplication::translate" tqapplication.html#translate +"TQApplication::tryLock" tqapplication.html#tryLock +"TQApplication::type" tqapplication.html#type +"TQApplication::unlock" tqapplication.html#unlock +"TQApplication::wakeUpGuiThread" tqapplication.html#wakeUpGuiThread +"TQApplication::wheelScrollLines" tqapplication.html#wheelScrollLines +"TQApplication::widgetAt" tqapplication.html#widgetAt +"TQApplication::winEventFilter" tqapplication.html#winEventFilter +"TQApplication::winFocus" tqapplication.html#winFocus +"TQApplication::x11EventFilter" tqapplication.html#x11EventFilter +"TQApplication::x11ProcessEvent" tqapplication.html#x11ProcessEvent +"TQApplication::~TQApplication" tqapplication.html#~TQApplication "TQAsciiCache" tqasciicache.html "TQAsciiCache::clear" tqasciicache.html#clear "TQAsciiCache::count" tqasciicache.html#count @@ -7695,8 +7695,8 @@ "TQXmlSimpleReader::parseContinue" tqxmlsimplereader.html#parseContinue "TQXmlSimpleReader::setFeature" tqxmlsimplereader.html#setFeature "TQXmlSimpleReader::~TQXmlSimpleReader" tqxmlsimplereader.html#~TQXmlSimpleReader -"Q_ASSERT" ntqapplication.html#Q_ASSERT -"TQ_CHECK_PTR" ntqapplication.html#TQ_CHECK_PTR +"Q_ASSERT" tqapplication.html#Q_ASSERT +"TQ_CHECK_PTR" tqapplication.html#TQ_CHECK_PTR "Qt" tqt.html "TQt Commercial Editions" commercialeditions.html "TQt Demo" demo-example.html @@ -7948,32 +7948,32 @@ "operator|" tqbitarray.html#operator| "organizers" organizers.html "plugins" plugins.html -"qAddPostRoutine" ntqapplication.html#qAddPostRoutine +"qAddPostRoutine" tqapplication.html#qAddPostRoutine "qAlpha" tqcolor.html#qAlpha "qBlue" tqcolor.html#qBlue "qChecksum" tqmemarray.html#qChecksum "qCompress" tqbytearray.html#qCompress -"qDebug" ntqapplication.html#qDebug +"qDebug" tqapplication.html#qDebug "qDrawPlainRect" tqpainter.html#qDrawPlainRect "qDrawShadeLine" tqpainter.html#qDrawShadeLine "qDrawShadePanel" tqpainter.html#qDrawShadePanel "qDrawShadeRect" tqpainter.html#qDrawShadeRect "qDrawWinButton" tqpainter.html#qDrawWinButton "qDrawWinPanel" tqpainter.html#qDrawWinPanel -"qFatal" ntqapplication.html#qFatal +"qFatal" tqapplication.html#qFatal "qGray" tqcolor.html#qGray "qGreen" tqcolor.html#qGreen "qInitNetworkProtocols" tqurloperator.html#qInitNetworkProtocols -"qInstallMsgHandler" ntqapplication.html#qInstallMsgHandler +"qInstallMsgHandler" tqapplication.html#qInstallMsgHandler "qMakePair" tqpair.html#qMakePair "qRed" tqcolor.html#qRed "qRgb" tqcolor.html#qRgb "qRgba" tqcolor.html#qRgba -"qSysInfo" ntqapplication.html#qSysInfo -"qSystemWarning" ntqapplication.html#qSystemWarning +"qSysInfo" tqapplication.html#qSysInfo +"qSystemWarning" tqapplication.html#qSystemWarning "qUncompress" tqbytearray.html#qUncompress -"qVersion" ntqapplication.html#qVersion -"qWarning" ntqapplication.html#qWarning +"qVersion" tqapplication.html#qVersion +"qWarning" tqapplication.html#qWarning "tqaction-examples" tqaction-examples.html "tqfont-examples" tqfont-examples.html "qmemmove" tqcstring.html#qmemmove diff --git a/doc/html/layout-example.html b/doc/html/layout-example.html index 475ddf93f..b1c3552d8 100644 --- a/doc/html/layout-example.html +++ b/doc/html/layout-example.html @@ -46,7 +46,7 @@ classes, TQGridLayout, ntqapplication.h> +#include <tqapplication.h> #include <tqlabel.h> #include <tqcolor.h> #include <tqpushbutton.h> @@ -75,7 +75,7 @@ public: menubar->setSeparator( TQMenuBar::InWindowsStyle ); TQPopupMenu* popup; popup = new TQPopupMenu( this ); - popup->insertItem( "&Quit", tqApp, TQ_SLOT(quit()) ); + popup->insertItem( "&Quit", tqApp, TQ_SLOT(quit()) ); menubar->insertItem( "&File", popup ); // ...and tell the layout about it. @@ -187,14 +187,14 @@ ExampleWidget::~ExampleWidget() int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ExampleWidget f; - a.setMainWidget(&f); + a.setMainWidget(&f); f.setCaption("TQt Example - Layouts"); f.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/life-example.html b/doc/html/life-example.html index fcc286029..007905bcd 100644 --- a/doc/html/life-example.html +++ b/doc/html/life-example.html @@ -113,7 +113,7 @@ private: #include <tqdrawutil.h> #include <tqcheckbox.h> #include <tqevent.h> -#include <ntqapplication.h> +#include <tqapplication.h> // The main game of life widget @@ -249,17 +249,17 @@ void LifeWidget::nextGeneration() *****************************************************************************/ #include "lifedlg.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <stdlib.h> void usage() { - tqWarning( "Usage: life [-scale scale]" ); + tqWarning( "Usage: life [-scale scale]" ); } int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); int scale = 10; @@ -277,11 +277,11 @@ int main( int argc, char **argv ) scale = 2; LifeDialog *life = new LifeDialog( scale ); - a.setMainWidget( life ); + a.setMainWidget( life ); life->setCaption("TQt Example - Life"); life->show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/lineedits-example.html b/doc/html/lineedits-example.html index 463a8312d..17f13c7b5 100644 --- a/doc/html/lineedits-example.html +++ b/doc/html/lineedits-example.html @@ -366,18 +366,18 @@ void LineEdits::slotReadOnlyChanged( int i ) *****************************************************************************/ #include "lineedits.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); LineEdits lineedits; lineedits.setCaption( "TQt Example - Lineedits" ); - a.setMainWidget( &lineedits ); + a.setMainWidget( &lineedits ); lineedits.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/linguist-manual-4.html b/doc/html/linguist-manual-4.html index 9e21faf9a..fe06608a6 100644 --- a/doc/html/linguist-manual-4.html +++ b/doc/html/linguist-manual-4.html @@ -51,25 +51,25 @@ body { background: #ffffff; color: black; }

      Loading Translations

          int main( int argc, char **argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       

      This is how a simple main() function of a TQt application begins.

          int main( int argc, char **argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               TQTranslator translator( 0 );
               translator.load( "tt1_la", "." );
      -        app.installTranslator( &translator );
      +        app.installTranslator( &translator );
       

      For a translation-aware application a translator object is created, a translation is loaded and the translator object installed into the application.

          int main( int argc, char **argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               TQTranslator translator( 0 );
               translator.load( TQString("tt2_") + TQTextCodec::locale(), "." );
      -        app.installTranslator( &translator );
      +        app.installTranslator( &translator );
       

      In production applications a more flexible approach, for example, loading translations according to locale, might be more appropriate. If the .ts files are all named according to a convention such as appname_locale, e.g. tt2_fr, tt2_de etc, then the code above will load the current locale's translation at runtime.

      If there is no translation file for the current locale the application will fall back to using the original source text.

      @@ -101,7 +101,7 @@ body { background: #ffffff; color: black; } rbh = new TQRadioButton( tr("Enabled", "Hue frame"), this );

      Ctrl key accelerators are also translatable:

      -
              file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()),
      +
              file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()),
                                 tr("Ctrl+Q", "Quit") );
       

      It is strongly recommended that the two argument form of tr() is used for Ctrl key accelerators. The second argument is the only clue the translator has as to the function performed by the accelerator.

      @@ -188,24 +188,24 @@ TRANSLATIONS = tt1_la.ts ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqtranslator.h> int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); TQTranslator translator( 0 ); translator.load( "tt1_la", "." ); - app.installTranslator( &translator ); + app.installTranslator( &translator ); TQPushButton hello( TQPushButton::tr("Hello world!"), 0 ); - app.setMainWidget( &hello ); + app.setMainWidget( &hello ); hello.show(); - return app.exec(); + return app.exec(); }

      main.cpp

      @@ -220,7 +220,7 @@ int main( int argc, char **argv )
              translator.load( "tt1_la", "." );
       

      Tries to load a file called tt1_la.qm (the .qm file extension is implicit) that contains Latin translations for the source texts used in the program. No error will occur if the file is not found.

      -
              app.installTranslator( &translator );
      +
              app.installTranslator( &translator );
       

      Adds the translations from tt1_la.qm to the pool of translations used by the program.

              TQPushButton hello( TQPushButton::tr("Hello world!"), 0 );
      @@ -335,14 +335,14 @@ TRANSLATIONS    = tt2_fr.ts \
       
              ArrowPad *ap = new ArrowPad( this, "arrow pad" );
       

      We also call MainWindow::tr() twice, once for the menu item and once for the accelerator.

      -
              file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()),
      +
              file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()),
                                 tr("Ctrl+Q", "Quit") );
       

      Note the use of tr() to support different keys in other languages. "Ctrl+Q" is a good choice for Quit in English, but a Dutch translator might want to use "Ctrl+A" (for Afsluiten) and a German translator "Strg+E" (for Beenden). When using tr() for Ctrl key accelerators, the two argument form should be used with the second argument describing the function that the accelerator performs.

      Our main() function is defined in main.cpp as usual.

              TQTranslator translator( 0 );
               translator.load( TQString("tt2_") + TQTextCodec::locale(), "." );
      -        app.installTranslator( &translator );
      +        app.installTranslator( &translator );
       

      We choose which translation to use according to the current locale. TQTextCodec::locale() can be influenced by setting the LANG environment variable, for example. Notice that the use of a naming convention that incorporates the locale for .qm message files, (and .ts files), makes it easy to implement choosing the translation file according to locale.

      If there is no .qm message file for the locale chosen the original source text will be used and no error raised.

      @@ -451,7 +451,7 @@ TRANSLATIONS = tt3_pt.ts
              setCaption( tr("Troll Print 1.0") );
       

      We must translate the window's caption.

      -
              file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()),
      +
              file->insertItem( tr("E&xit"), tqApp, TQ_SLOT(quit()),
                                 tr("Ctrl+Q", "Quit") );
               TQPopupMenu *help = new TQPopupMenu( this );
               help->insertItem( tr("&About"), this, TQ_SLOT(about()), Key_F1 );
      @@ -464,7 +464,7 @@ TRANSLATIONS    = tt3_pt.ts
        

      We also need to translate the menu items. Note that the two argument form of tr() is used for the keyboard accelerator, "Ctrl+Q", since the second argument is the only clue the translator has to indicate what function that accelerator will perform.

              TQTranslator translator( 0 );
               translator.load( TQString("tt3_") + TQTextCodec::locale(), "." );
      -        app.installTranslator( &translator );
      +        app.installTranslator( &translator );
       

      The main() function in main.cpp is the same as the one in Tutorial 2. In particular it chooses a translation file based on the current locale.

      Running Troll Print 1.0 in English and in Portuguese
      diff --git a/doc/html/listbox-example.html b/doc/html/listbox-example.html index 90a1148a1..2f806e96b 100644 --- a/doc/html/listbox-example.html +++ b/doc/html/listbox-example.html @@ -297,18 +297,18 @@ void ListBoxDemo::sortDescending() *****************************************************************************/ #include "listbox.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ListBoxDemo t; t.setCaption( "TQt Example - Listbox" ); - a.setMainWidget( &t ); + a.setMainWidget( &t ); t.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/listboxcombo-example.html b/doc/html/listboxcombo-example.html index 3779695a0..f13c05176 100644 --- a/doc/html/listboxcombo-example.html +++ b/doc/html/listboxcombo-example.html @@ -280,19 +280,19 @@ void ListBoxCombo::slotCombo2Activated( const ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ListBoxCombo listboxcombo; listboxcombo.resize( 400, 270 ); listboxcombo.setCaption( "TQt Example - Listboxes and Comboboxes" ); - a.setMainWidget( &listboxcombo ); + a.setMainWidget( &listboxcombo ); listboxcombo.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/listviews-example.html b/doc/html/listviews-example.html index 030504ac8..9ce039ad1 100644 --- a/doc/html/listviews-example.html +++ b/doc/html/listviews-example.html @@ -484,19 +484,19 @@ void ListViews::slotMessageChanged() *****************************************************************************/ #include "listviews.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ListViews listViews; listViews.resize( 640, 480 ); listViews.setCaption( "TQt Example - Listview" ); - a.setMainWidget( &listViews ); + a.setMainWidget( &listViews ); listViews.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/mac-differences.html b/doc/html/mac-differences.html index cb598a363..62aa0a567 100644 --- a/doc/html/mac-differences.html +++ b/doc/html/mac-differences.html @@ -203,7 +203,7 @@ do this: kCFURLPOSIXPathStyle); const char *pathPtr = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding()); - tqDebug("Path = %s", pathPtr); + tqDebug("Path = %s", pathPtr); CFRelease(pluginRef); CFRelease(macPath);
      @@ -253,7 +253,7 @@ one-button mouse support. into Mac native menubars. Fitting this into your existing TQt application will normally be automatic, however, if you have special needs the TQt/Mac implementation currently selects a menubar by starting at the active window -(ie TQApplication::activeWindow()), and applying: +(ie TQApplication::activeWindow()), and applying:

      1) If the window has a TQMenuBar then it is used. 2) If the window is a modal then its menubar is used. If no menubar is specified then a default menubar is used (as documented below) diff --git a/doc/html/mail-example.html b/doc/html/mail-example.html index 001e8feff..4ad42d003 100644 --- a/doc/html/mail-example.html +++ b/doc/html/mail-example.html @@ -116,7 +116,7 @@ private: #include <tqsocket.h> #include <tqdns.h> #include <tqtimer.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmessagebox.h> #include <tqregexp.h> @@ -219,7 +219,7 @@ void Smtp::readyRead() return; } else { // something broke. - TQMessageBox::warning( tqApp->activeWindow(), + TQMessageBox::warning( tqApp->activeWindow(), tr( "TQt Mail Example" ), tr( "Unexpected reply from SMTP server:\n\n" ) + response ); diff --git a/doc/html/mainclasses.html b/doc/html/mainclasses.html index f9f261e36..c9856171a 100644 --- a/doc/html/mainclasses.html +++ b/doc/html/mainclasses.html @@ -49,7 +49,7 @@ classes), see TQt's Classes. TQTimer -TQApplication +TQApplication TQFont diff --git a/doc/html/mdi-example.html b/doc/html/mdi-example.html index 3a98a4788..3a94262e9 100644 --- a/doc/html/mdi-example.html +++ b/doc/html/mdi-example.html @@ -147,7 +147,7 @@ private: #include <tqstatusbar.h> #include <tqmessagebox.h> #include <tqprinter.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqaccel.h> #include <tqtextstream.h> @@ -232,7 +232,7 @@ const char * filePrintText = "Click this button to print the file you " #endif file->insertSeparator(); file->insertItem( "&Close", this, TQ_SLOT(closeWindow()), CTRL+Key_W ); - file->insertItem( "&Quit", tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_Q ); + file->insertItem( "&Quit", tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_Q ); windowsMenu = new TQPopupMenu( this ); windowsMenu->setCheckable( TRUE ); @@ -569,17 +569,17 @@ void MDIWindow::print( TQPrinter ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "application.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ApplicationWindow * mw = new ApplicationWindow(); - a.setMainWidget(mw); + a.setMainWidget(mw); mw->setCaption( "TQt Example - Multiple Documents Interface (MDI)" ); mw->show(); - a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); - int res = a.exec(); + a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); + int res = a.exec(); return res; }

      diff --git a/doc/html/menu-example.html b/doc/html/menu-example.html index 2d8864374..e91c9ee22 100644 --- a/doc/html/menu-example.html +++ b/doc/html/menu-example.html @@ -114,7 +114,7 @@ private: #include "menu.h" #include <tqcursor.h> #include <tqpopupmenu.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmessagebox.h> #include <tqpixmap.h> #include <tqpainter.h> @@ -224,7 +224,7 @@ private: TQPixmap p2( p2_xpm ); TQPixmap p3( p3_xpm ); TQPopupMenu *print = new TQPopupMenu( this ); - TQ_CHECK_PTR( print ); + TQ_CHECK_PTR( print ); print->insertTearOffHandle(); print->insertItem( "&Print to printer", this, TQ_SLOT(printer()) ); print->insertItem( "Print to &file", this, TQ_SLOT(file()) ); @@ -233,7 +233,7 @@ private: print->insertItem( "Printer &Setup", this, TQ_SLOT(printerSetup()) ); TQPopupMenu *file = new TQPopupMenu( this ); - TQ_CHECK_PTR( file ); + TQ_CHECK_PTR( file ); file->insertItem( p1, "&Open", this, TQ_SLOT(open()), CTRL+Key_O ); file->insertItem( p2, "&New", this, TQ_SLOT(news()), CTRL+Key_N ); file->insertItem( p3, "&Save", this, TQ_SLOT(save()), CTRL+Key_S ); @@ -241,17 +241,17 @@ private: file->insertSeparator(); file->insertItem( "&Print", print, CTRL+Key_P ); file->insertSeparator(); - file->insertItem( "E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q ); + file->insertItem( "E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q ); TQPopupMenu *edit = new TQPopupMenu( this ); - TQ_CHECK_PTR( edit ); + TQ_CHECK_PTR( edit ); int undoID = edit->insertItem( "&Undo", this, TQ_SLOT(undo()) ); int redoID = edit->insertItem( "&Redo", this, TQ_SLOT(redo()) ); edit->setItemEnabled( undoID, FALSE ); edit->setItemEnabled( redoID, FALSE ); TQPopupMenu* options = new TQPopupMenu( this ); - TQ_CHECK_PTR( options ); + TQ_CHECK_PTR( options ); options->insertTearOffHandle(); options->setCaption("Options"); options->insertItem( "&Normal Font", this, TQ_SLOT(normal()) ); @@ -275,13 +275,13 @@ private: TQPopupMenu *help = new TQPopupMenu( this ); - TQ_CHECK_PTR( help ); + TQ_CHECK_PTR( help ); help->insertItem( "&About", this, TQ_SLOT(about()), CTRL+Key_H ); help->insertItem( "About &TQt", this, TQ_SLOT(aboutTQt()) ); // If we used a TQMainWindow we could use its built-in menuBar(). menu = new TQMenuBar( this ); - TQ_CHECK_PTR( menu ); + TQ_CHECK_PTR( menu ); menu->insertItem( "&File", file ); menu->insertItem( "&Edit", edit ); menu->insertItem( "&Options", options ); @@ -291,7 +291,7 @@ private: TQLabel *msg = new TQLabel( this ); - TQ_CHECK_PTR( msg ); + TQ_CHECK_PTR( msg ); msg->setText( "A context menu is available.\n" "Invoke it by right-clicking or by" " pressing the 'context' button." ); @@ -299,7 +299,7 @@ private: msg->setAlignment( AlignCenter ); label = new TQLabel( this ); - TQ_CHECK_PTR( label ); + TQ_CHECK_PTR( label ); label->setGeometry( 20, rect().center().y()-20, width()-40, 40 ); label->setFrameStyle( TQFrame::Box | TQFrame::Raised ); label->setLineWidth( 1 ); @@ -316,7 +316,7 @@ private: void MenuExample::contextMenuEvent( TQContextMenuEvent * ) { TQPopupMenu* contextMenu = new TQPopupMenu( this ); - TQ_CHECK_PTR( contextMenu ); + TQ_CHECK_PTR( contextMenu ); TQLabel *caption = new TQLabel( "<font color=darkblue><u><b>" "Context Menu</b></u></font>", this ); caption->setAlignment( TQt::AlignCenter ); @@ -325,7 +325,7 @@ private: contextMenu->insertItem( "&Open...", this, TQ_SLOT(open()), CTRL+Key_O ); contextMenu->insertItem( "&Save", this, TQ_SLOT(save()), CTRL+Key_S ); TQPopupMenu *submenu = new TQPopupMenu( this ); - TQ_CHECK_PTR( submenu ); + TQ_CHECK_PTR( submenu ); submenu->insertItem( "&Print to printer", this, TQ_SLOT(printer()) ); submenu->insertItem( "Print to &file", this, TQ_SLOT(file()) ); submenu->insertItem( "Print to fa&x", this, TQ_SLOT(fax()) ); @@ -450,12 +450,12 @@ void MenuExample::printerSetup() int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MenuExample m; m.setCaption("TQt Examples - Menus"); - a.setMainWidget( &m ); + a.setMainWidget( &m ); m.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/movies-example.html b/doc/html/movies-example.html index 069cfae8b..e5c0317e0 100644 --- a/doc/html/movies-example.html +++ b/doc/html/movies-example.html @@ -47,7 +47,7 @@ The Movies example displays MNG and animated GIF files using the ntqapplication.h> +#include <tqapplication.h> #include <tqfiledialog.h> #include <tqpushbutton.h> #include <tqlabel.h> @@ -291,7 +291,7 @@ void MovieStarter::startMovie(const T void MovieStarter::done( int r ) { if (r != Accepted) - tqApp->quit(); // end on Cancel + tqApp->quit(); // end on Cancel setResult( r ); // And don't hide. @@ -300,7 +300,7 @@ void MovieStarter::startMovie(const T int main(int argc, char **argv) { - TQApplication a(argc, argv); + TQApplication a(argc, argv); if (argc > 1) { // Commandline mode - show movies given on the command line @@ -316,7 +316,7 @@ int main(int argc, char **argv) (void)new MovieScreen(argv[arg], TQMovie(argv[arg]), 0, 0, TQt::WDestructiveClose); } - TQObject::connect(tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit())); + TQObject::connect(tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit())); } else { // "GUI" mode - open a chooser for movies // @@ -325,7 +325,7 @@ int main(int argc, char **argv) } // Go! - return a.exec(); + return a.exec(); } #include "main.moc" diff --git a/doc/html/network.html b/doc/html/network.html index e80ffcdab..ab49f5528 100644 --- a/doc/html/network.html +++ b/doc/html/network.html @@ -128,9 +128,9 @@ void MyClass::slotOperationFinished( TQNetwork switch ( op->operation() ) { case TQNetworkProtocol::OpMkDir: if ( op->state() == TQNetworkProtocol::StFailed ) - tqDebug( "Couldn't create directory %s", op->arg( 0 ).latin1() ); + tqDebug( "Couldn't create directory %s", op->arg( 0 ).latin1() ); else - tqDebug( "Successfully created directory %s", op->arg( 0 ).latin1() ); + tqDebug( "Successfully created directory %s", op->arg( 0 ).latin1() ); break; // ... and so on } @@ -158,24 +158,24 @@ void MyClass::slotInsertEntries( const TQValueListbegin(); for ( ; it != info.end(); ++it ) { const TQUrlInfo &inf = *it; - tqDebug( "Name: %s, Size: %d, Last Modified: %s", + tqDebug( "Name: %s, Size: %d, Last Modified: %s", inf.name().latin1(), inf.size(), inf.lastModified().toString().latin1() ); } } void MyClass::slotStart( TQNetworkOperation * ) { - tqDebug( "Start reading '%s'", op.toString().latin1() ); + tqDebug( "Start reading '%s'", op.toString().latin1() ); } void MyClass::slotFinished( TQNetworkOperation *operation ) { if ( operation->operation() == TQNetworkProtocol::OpListChildren ) { if ( operation->state() == TQNetworkProtocol::StFailed ) - tqDebug( "Couldn't read '%s'! Following error occurred: %s", + tqDebug( "Couldn't read '%s'! Following error occurred: %s", op.toString().latin1(), operation->protocolDetail().latin1() ); else - tqDebug( "Finished reading '%s'!", op.toString().latin1() ); + tqDebug( "Finished reading '%s'!", op.toString().latin1() ); } } diff --git a/doc/html/ntqapplication.html b/doc/html/ntqapplication.html deleted file mode 100644 index 33a61f84a..000000000 --- a/doc/html/ntqapplication.html +++ /dev/null @@ -1,2000 +0,0 @@ - - - - -TQApplication Class - - - - - - - -
      - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

      TQApplication Class Reference

      - -

      The TQApplication class manages the GUI application's control -flow and main settings. -More... -

      #include <ntqapplication.h> -

      Inherits TQObject. -

      List of all member functions. -

      Public Members

      - -

      Public Slots

      - -

      Signals

      - -

      Static Public Members

      - -

      Related Functions

      - -

      Detailed Description

      - - -The TQApplication class manages the GUI application's control -flow and main settings. -

      - -

      It contains the main event loop, where all events from the window -system and other sources are processed and dispatched. It also -handles the application's initialization and finalization, and -provides session management. It also handles most system-wide and -application-wide settings. -

      For any GUI application that uses TQt, there is precisely one -TQApplication object, no matter whether the application has 0, 1, 2 -or more windows at any time. -

      The TQApplication object is accessible through the global pointer tqApp. Its main areas of responsibility are: -

        -

      • It initializes the application with the user's desktop settings -such as palette(), font() and doubleClickInterval(). It keeps track -of these properties in case the user changes the desktop globally, for -example through some kind of control panel. -

      • It performs event handling, meaning that it receives events -from the underlying window system and dispatches them to the relevant -widgets. By using sendEvent() and postEvent() you can send your own -events to widgets. -

      • It parses common command line arguments and sets its internal -state accordingly. See the constructor documentation below for more details about this. -

      • It defines the application's look and feel, which is -encapsulated in a TQStyle object. This can be changed at runtime -with setStyle(). -

      • It specifies how the application is to allocate colors. -See setColorSpec() for details. -

      • It provides localization of strings that are visible to the user -via translate(). -

      • It provides some magical objects like the desktop() and the -clipboard(). -

      • It knows about the application's windows. You can ask which -widget is at a certain position using widgetAt(), get a list of -topLevelWidgets() and closeAllWindows(), etc. -

      • It manages the application's mouse cursor handling, -see setOverrideCursor() and setGlobalMouseTracking(). -

      • On the X window system, it provides functions to flush and sync -the communication stream, see flushX() and syncX(). -

      • It provides support for sophisticated session management. This makes it possible -for applications to terminate gracefully when the user logs out, to -cancel a shutdown process if termination isn't possible and even to -preserve the entire application's state for a future session. See -isSessionRestored(), sessionId() and commitData() and saveState() -for details. -

      -

      The Application walk-through -example contains a typical complete main() that does the usual -things with TQApplication. -

      Since the TQApplication object does so much initialization, it -must be created before any other objects related to the user -interface are created. -

      Since it also deals with common command line arguments, it is -usually a good idea to create it before any interpretation or -modification of argv is done in the application itself. (Note -also that for X11, setMainWidget() may change the main widget -according to the -geometry option. To preserve this -functionality, you must set your defaults before setMainWidget() and -any overrides after.) -

      - - - - - - - - - - - -
      Groups of functions -
      System settings - -desktopSettingsAware(), -setDesktopSettingsAware(), -cursorFlashTime(), -setCursorFlashTime(), -doubleClickInterval(), -setDoubleClickInterval(), -wheelScrollLines(), -setWheelScrollLines(), -palette(), -setPalette(), -font(), -setFont(), -fontMetrics(). -
      Event handling - -exec(), -processEvents(), -enter_loop(), -exit_loop(), -exit(), -quit(). -sendEvent(), -postEvent(), -sendPostedEvents(), -removePostedEvents(), -hasPendingEvents(), -notify(), -macEventFilter(), -x11EventFilter(), -x11ProcessEvent(), -winEventFilter(). -
      GUI Styles - -style(), -setStyle(), -polish(). -
      Color usage - -colorSpec(), -setColorSpec(), -
      Text handling - -installTranslator(), -removeTranslator() -translate(). -
      Widgets - -mainWidget(), -setMainWidget(), -allWidgets(), -topLevelWidgets(), -desktop(), -activePopupWidget(), -activeModalWidget(), -clipboard(), -focusWidget(), -winFocus(), -activeWindow(), -widgetAt(). -
      Advanced cursor handling - -hasGlobalMouseTracking(), -setGlobalMouseTracking(), -overrideCursor(), -setOverrideCursor(), -restoreOverrideCursor(). -
      X Window System synchronization - -flushX(), -syncX(). -
      Session management - -isSessionRestored(), -sessionId(), -commitData(), -saveState(). -
      Threading - -lock(), unlock(), locked(), tryLock(), -wakeUpGuiThread() -
      Miscellaneous - -closeAllWindows(), -startingUp(), -closingDown(), -type(). -
      -

      Non-GUI programs: While TQt is not optimized or -designed for writing non-GUI programs, it's possible to use -some of its classes without creating a -TQApplication. This can be useful if you wish to share code between -a non-GUI server and a GUI client. - - - -

      See also Main Window and Related Classes. - -


      Member Type Documentation

      -

      TQApplication::ColorSpec

      - -
        -
      • TQApplication::NormalColor - the default color allocation policy -
      • TQApplication::CustomColor - the same as NormalColor for X11; allocates colors -to a palette on demand under Windows -
      • TQApplication::ManyColor - the right choice for applications that use thousands of -colors -

      See setColorSpec() for full details. - -

      TQApplication::Encoding

      -

      This enum type defines the 8-bit encoding of character string -arguments to translate(): -

        -
      • TQApplication::DefaultCodec - the encoding specified by -TQTextCodec::codecForTr() (Latin-1 if none has been set) -
      • TQApplication::UnicodeUTF8 - UTF-8 -

      See also TQObject::tr(), TQObject::trUtf8(), and TQString::fromUtf8(). - -

      TQApplication::Type

      - -
        -
      • TQApplication::Tty - a console application -
      • TQApplication::GuiClient - a GUI client application -
      • TQApplication::GuiServer - a GUI server application -
      -

      Member Function Documentation

      -

      TQApplication::TQApplication ( int & argc, char ** argv ) -

      -Initializes the window system and constructs an application object -with argc command line arguments in argv. -

      The global tqApp pointer refers to this application object. Only -one application object should be created. -

      This application object must be constructed before any paint devices (including widgets, pixmaps, bitmaps -etc.). -

      Note that argc and argv might be changed. TQt removes command -line arguments that it recognizes. The modified argc and argv -can also be accessed later with tqApp->argc() and tqApp->argv(). -The documentation for argv() contains a detailed description of how -to process command line arguments. -

      TQt debugging options (not available if TQt was compiled with the -TQT_NO_DEBUG flag defined): -

        -
      • -nograb, tells TQt that it must never grab the mouse or the keyboard. -
      • -dograb (only under X11), running under a debugger can cause -an implicit -nograb, use -dograb to override. -
      • -sync (only under X11), switches to synchronous mode for -debugging. -
      -

      See Debugging Techniques for a more -detailed explanation. -

      All TQt programs automatically support the following command line options: -

        -
      • -reverse causes text to be formatted for right-to-left languages -rather than in the usual left-to-right direction. -
      • -style= style, sets the application GUI style. Possible values -are motif, windows, and platinum. If you compiled TQt -with additional styles or have additional styles as plugins these -will be available to the -style command line option. -
      • -style style, is the same as listed above. -
      • -session= session, restores the application from an earlier -session. -
      • -session session, is the same as listed above. -
      • -widgetcount, prints debug message at the end about number of widgets left -undestroyed and maximum number of widgets existed at the same time -
      -

      The X11 version of TQt also supports some traditional X11 -command line options: -

        -
      • -display display, sets the X display (default is $DISPLAY). -
      • -geometry geometry, sets the client geometry of the -main widget. -
      • -fn or -font font, defines the application font. The -font should be specified using an X logical font description. -
      • -bg or -background color, sets the default background color -and an application palette (light and dark shades are calculated). -
      • -fg or -foreground color, sets the default foreground color. -
      • -btn or -button color, sets the default button color. -
      • -name name, sets the application name. -
      • -title title, sets the application title (caption). -
      • -visual TrueColor, forces the application to use a TrueColor visual -on an 8-bit display. -
      • -ncols count, limits the number of colors allocated in the -color cube on an 8-bit display, if the application is using the -TQApplication::ManyColor color specification. If count is -216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, -and 6 of blue); for other values, a cube -approximately proportional to a 2x3x1 cube is used. -
      • -cmap, causes the application to install a private color map -on an 8-bit display. -
      -

      See also argc() and argv(). - -

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

      -Constructs an application object with argc command line arguments -in argv. If GUIenabled is TRUE, a GUI application is -constructed, otherwise a non-GUI (console) application is created. -

      Set GUIenabled to FALSE for programs without a graphical user -interface that should be able to run without a window system. -

      On X11, the window system is initialized if GUIenabled is TRUE. -If GUIenabled is FALSE, the application does not connect to the -X-server. -On Windows and Macintosh, currently the window system is always -initialized, regardless of the value of GUIenabled. This may change in -future versions of TQt. -

      The following example shows how to create an application that -uses a graphical interface when available. -

      -  int main( int argc, char **argv )
      -  {
      -#ifdef TQ_WS_X11
      -    bool useGUI = getenv( "DISPLAY" ) != 0;
      -#else
      -    bool useGUI = TRUE;
      -#endif
      -    TQApplication app(argc, argv, useGUI);
      -
      -    if ( useGUI ) {
      -       //start GUI version
      -       ...
      -    } else {
      -       //start non-GUI version
      -       ...
      -    }
      -    return app.exec();
      -  }
      -
      - - -

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

      -Constructs an application object with argc command line arguments -in argv. - -

      TQApplication::TQApplication ( Display * dpy, HANDLE visual = 0, HANDLE colormap = 0 ) -

      -Create an application, given an already open display dpy. If visual and colormap are non-zero, the application will use those as -the default Visual and Colormap contexts. -

      Warning: TQt only supports TrueColor visuals at depths higher than 8 -bits-per-pixel. -

      This is available only on X11. - -

      TQApplication::TQApplication ( Display * dpy, int argc, char ** argv, HANDLE visual = 0, HANDLE colormap = 0 ) -

      -Create an application, given an already open display dpy and using -argc command line arguments in argv. If visual and colormap are non-zero, the application will use those as -the default Visual and Colormap contexts. -

      Warning: TQt only supports TrueColor visuals at depths higher than 8 -bits-per-pixel. -

      This is available only on X11. -

      -

      TQApplication::~TQApplication () [virtual] -

      -Cleans up any window system resources that were allocated by this -application. Sets the global variable tqApp to 0. - -

      void TQApplication::aboutTQt () [slot] -

      -Displays a simple message box about TQt. The message includes the -version number of TQt being used by the application. -

      This is useful for inclusion in the Help menu of an application. -See the examples/menu/menu.cpp example. -

      This function is a convenience slot for TQMessageBox::aboutTQt(). - -

      void TQApplication::aboutToQuit () [signal] -

      - -

      This signal is emitted when the application is about to quit the -main event loop, e.g. when the event loop level drops to zero. -This may happen either after a call to quit() from inside the -application or when the users shuts down the entire desktop session. -

      The signal is particularly useful if your application has to do some -last-second cleanup. Note that no user interaction is possible in -this state. -

      See also quit(). - -

      TQWidget * TQApplication::activeModalWidget () [static] -

      -Returns the active modal widget. -

      A modal widget is a special top level widget which is a subclass of -TQDialog that specifies the modal parameter of the constructor as -TRUE. A modal widget must be closed before the user can continue -with other parts of the program. -

      Modal widgets are organized in a stack. This function returns -the active modal widget at the top of the stack. -

      See also activePopupWidget() and topLevelWidgets(). - -

      TQWidget * TQApplication::activePopupWidget () [static] -

      -Returns the active popup widget. -

      A popup widget is a special top level widget that sets the WType_Popup widget flag, e.g. the TQPopupMenu widget. When the -application opens a popup widget, all events are sent to the popup. -Normal widgets and modal widgets cannot be accessed before the popup -widget is closed. -

      Only other popup widgets may be opened when a popup widget is shown. -The popup widgets are organized in a stack. This function returns -the active popup widget at the top of the stack. -

      See also activeModalWidget() and topLevelWidgets(). - -

      TQWidget * TQApplication::activeWindow () const -

      - -

      Returns the application top-level window that has the keyboard input -focus, or 0 if no application window has the focus. Note that -there might be an activeWindow() even if there is no focusWidget(), -for example if no widget in that window accepts key events. -

      See also TQWidget::setFocus(), TQWidget::focus, and focusWidget(). - -

      Example: network/mail/smtp.cpp. -

      void TQApplication::addLibraryPath ( const TQString & path ) [static] -

      -Append path to the end of the library path list. If path is -empty or already in the path list, the path list is not changed. -

      The default path list consists of a single entry, the installation -directory for plugins. The default installation directory for plugins -is INSTALL/plugins, where INSTALL is the directory where TQt was -installed. -

      See also removeLibraryPath(), libraryPaths(), and setLibraryPaths(). - -

      TQWidgetList * TQApplication::allWidgets () [static] -

      -Returns a list of all the widgets in the application. -

      The list is created using new and must be deleted by the caller. -

      The list is empty (TQPtrList::isEmpty()) if there are no widgets. -

      Note that some of the widgets may be hidden. -

      Example that updates all widgets: -

      -    TQWidgetList  *list = TQApplication::allWidgets();
      -    TQWidgetListIt it( *list );         // iterate over the widgets
      -    TQWidget * w;
      -    while ( (w=it.current()) != 0 ) {  // for each widget...
      -        ++it;
      -        w->update();
      -    }
      -    delete list;                      // delete the list, not the widgets
      -  
      - -

      The TQWidgetList class is defined in the tqwidgetlist.h header -file. -

      Warning: Delete the list as soon as you have finished using it. -The widgets in the list may be deleted by someone else at any time. -

      See also topLevelWidgets(), TQWidget::visible, and TQPtrList::isEmpty(). - -

      TQString TQApplication::applicationDirPath () -

      -Returns the directory that contains the application executable. -

      For example, if you have installed TQt in the C:\Trolltech\TQt -directory, and you run the demo example, this function will -return "C:/Trolltech/TQt/examples/demo". -

      On Mac OS X this will point to the directory actually containing the -executable, which may be inside of an application bundle (if the -application is bundled). -

      Warning: On Unix, this function assumes that argv[0] contains the file -name of the executable (which it normally does). It also assumes that -the current directory hasn't been changed by the application. -

      See also applicationFilePath(). - -

      TQString TQApplication::applicationFilePath () -

      -Returns the file path of the application executable. -

      For example, if you have installed TQt in the C:\Trolltech\TQt -directory, and you run the demo example, this function will -return "C:/Trolltech/TQt/examples/demo/demo.exe". -

      Warning: On Unix, this function assumes that argv[0] contains the file -name of the executable (which it normally does). It also assumes that -the current directory hasn't been changed by the application. -

      See also applicationDirPath(). - -

      int TQApplication::argc () const -

      - -

      Returns the number of command line arguments. -

      The documentation for argv() describes how to process command line -arguments. -

      See also argv() and TQApplication::TQApplication(). - -

      Examples: chart/main.cpp and scribble/scribble.cpp. -

      char ** TQApplication::argv () const -

      - -

      Returns the command line argument vector. -

      argv()[0] is the program name, argv()[1] is the first -argument and argv()[argc()-1] is the last argument. -

      A TQApplication object is constructed by passing argc and argv from the main() function. Some of the arguments may be -recognized as TQt options and removed from the argument vector. For -example, the X11 version of TQt knows about -display, -font -and a few more options. -

      Example: -

      -        // showargs.cpp - displays program arguments in a list box
      -
      -        #include <ntqapplication.h>
      -        #include <tqlistbox.h>
      -
      -        int main( int argc, char **argv )
      -        {
      -            TQApplication a( argc, argv );
      -            TQListBox b;
      -            a.setMainWidget( &b );
      -            for ( int i = 0; i < a.argc(); i++ )  // a.argc() == argc
      -                b.insertItem( a.argv()[i] );      // a.argv()[i] == argv[i]
      -            b.show();
      -            return a.exec();
      -        }
      -    
      - -

      If you run showargs -display unix:0 -font 9x15bold hello world -under X11, the list box contains the three strings "showargs", -"hello" and "world". -

      TQt provides a global pointer, tqApp, that points to the -TQApplication object, and through which you can access argc() and -argv() in functions other than main(). -

      See also argc() and TQApplication::TQApplication(). - -

      Examples: chart/main.cpp and scribble/scribble.cpp. -

      void TQApplication::beep () [static] -

      -Sounds the bell, using the default volume and sound. - -

      TQClipboard * TQApplication::clipboard () [static] -

      -Returns a pointer to the application global clipboard. - -

      Examples: regexptester/regexptester.cpp and showimg/showimg.cpp. -

      void TQApplication::closeAllWindows () [slot] -

      -Closes all top-level windows. -

      This function is particularly useful for applications with many -top-level windows. It could, for example, be connected to a "Quit" -entry in the file menu as shown in the following code example: -

      -    // the "Quit" menu entry should try to close all windows
      -    TQPopupMenu* file = new TQPopupMenu( this );
      -    file->insertItem( "&Quit", tqApp, TQ_SLOT(closeAllWindows()), CTRL+Key_Q );
      -
      -    // when the last window is closed, the application should quit
      -    connect( tqApp, TQ_SIGNAL( lastWindowClosed() ), tqApp, TQ_SLOT( quit() ) );
      -  
      - -

      The windows are closed in random order, until one window does not -accept the close event. -

      See also TQWidget::close(), TQWidget::closeEvent(), lastWindowClosed(), quit(), topLevelWidgets(), and TQWidget::isTopLevel. - -

      -

      Examples: action/application.cpp, application/application.cpp, helpviewer/helpwindow.cpp, mdi/application.cpp, and qwerty/qwerty.cpp. -

      bool TQApplication::closingDown () [static] -

      -Returns TRUE if the application objects are being destroyed; -otherwise returns FALSE. -

      See also startingUp(). - -

      int TQApplication::colorSpec () [static] -

      -Returns the color specification. -

      See also TQApplication::setColorSpec(). - -

      Example: showimg/showimg.cpp. -

      void TQApplication::commitData ( TQSessionManager & sm ) [virtual] -

      - -

      This function deals with session - management. It is invoked when the TQSessionManager wants the -application to commit all its data. -

      Usually this means saving all open files, after getting -permission from the user. Furthermore you may want to provide a means -by which the user can cancel the shutdown. -

      Note that you should not exit the application within this function. -Instead, the session manager may or may not do this afterwards, -depending on the context. -

      Warning: Within this function, no user interaction is possible, unless you ask the session manager sm for explicit permission. -See TQSessionManager::allowsInteraction() and -TQSessionManager::allowsErrorInteraction() for details and example -usage. -

      The default implementation requests interaction and sends a close -event to all visible top level widgets. If any event was -rejected, the shutdown is canceled. -

      See also isSessionRestored(), sessionId(), saveState(), and the Session Management overview. - -

      int TQApplication::cursorFlashTime () [static] -

      -Returns the text cursor's flash (blink) time in milliseconds. The -flash time is the time required to display, invert and restore the -caret display. -

      The default value on X11 is 1000 milliseconds. On Windows, the -control panel value is used. -

      Widgets should not cache this value since it may be changed at any -time by the user changing the global desktop settings. -

      See also setCursorFlashTime(). - -

      TQTextCodec * TQApplication::defaultCodec () const -

      This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      Returns TQTextCodec::codecForTr(). - -

      TQDesktopWidget * TQApplication::desktop () [static] -

      -Returns the desktop widget (also called the root window). -

      The desktop widget is useful for obtaining the size of the screen. -It may also be possible to draw on the desktop. We recommend against -assuming that it's possible to draw on the desktop, since this does -not work on all operating systems. -

      -    TQDesktopWidget *d = TQApplication::desktop();
      -    int w = d->width();     // returns desktop width
      -    int h = d->height();    // returns desktop height
      -  
      - - -

      Examples: canvas/main.cpp, desktop/desktop.cpp, helpviewer/main.cpp, i18n/main.cpp, qmag/qmag.cpp, qwerty/main.cpp, and scribble/main.cpp. -

      bool TQApplication::desktopSettingsAware () [static] -

      -Returns the value set by setDesktopSettingsAware(); by default TRUE. -

      See also setDesktopSettingsAware(). - -

      int TQApplication::doubleClickInterval () [static] -

      -Returns the maximum duration for a double click. -

      The default value on X11 is 400 milliseconds. On Windows, the -control panel value is used. -

      See also setDoubleClickInterval(). - -

      int TQApplication::enter_loop () -

      -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      This function enters the main event loop (recursively). Do not call -it unless you really know what you are doing. -

      Use TQApplication::eventLoop()->enterLoop() instead. -

      -

      TQEventLoop * TQApplication::eventLoop () [static] -

      -Returns the application event loop. This function will return -zero if called during and after destroying TQApplication. -

      To create your own instance of TQEventLoop or TQEventLoop subclass create -it before you create the TQApplication object. -

      See also TQEventLoop. - -

      Example: distributor/distributor.ui.h. -

      int TQApplication::exec () -

      -Enters the main event loop and waits until exit() is called or the -main widget is destroyed, and returns the value that was set to -exit() (which is 0 if exit() is called via quit()). -

      It is necessary to call this function to start event handling. The -main event loop receives events from the window system and -dispatches these to the application widgets. -

      Generally speaking, no user interaction can take place before -calling exec(). As a special case, modal widgets like TQMessageBox -can be used before calling exec(), because modal widgets call -exec() to start a local event loop. -

      To make your application perform idle processing, i.e. executing a -special function whenever there are no pending events, use a -TQTimer with 0 timeout. More advanced idle processing schemes can -be achieved using processEvents(). -

      See also quit(), exit(), processEvents(), and setMainWidget(). - -

      Examples: helpsystem/main.cpp, life/main.cpp, network/archivesearch/main.cpp, network/ftpclient/main.cpp, t1/main.cpp, and t4/main.cpp. -

      void TQApplication::exit ( int retcode = 0 ) [static] -

      -Tells the application to exit with a return code. -

      After this function has been called, the application leaves the main -event loop and returns from the call to exec(). The exec() function -returns retcode. -

      By convention, a retcode of 0 means success, and any non-zero -value indicates an error. -

      Note that unlike the C library function of the same name, this -function does return to the caller -- it is event processing that -stops. -

      See also quit() and exec(). - -

      Examples: chart/chartform.cpp, extension/mainform.ui.h, and picture/picture.cpp. -

      void TQApplication::exit_loop () -

      -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      This function exits from a recursive call to the main event loop. -Do not call it unless you are an expert. -

      Use TQApplication::eventLoop()->exitLoop() instead. -

      -

      void TQApplication::flush () [static] -

      -Flushes the window system specific event queues. -

      If you are doing graphical changes inside a loop that does not -return to the event loop on asynchronous window systems like X11 -or double buffered window systems like MacOS X, and you want to -visualize these changes immediately (e.g. Splash Screens), call -this function. -

      See also flushX(), sendPostedEvents(), and TQPainter::flush(). - -

      void TQApplication::flushX () [static] -

      -Flushes the X event queue in the X11 implementation. This normally -returns almost immediately. Does nothing on other platforms. -

      See also syncX(). - -

      Example: xform/xform.cpp. -

      TQWidget * TQApplication::focusWidget () const -

      - -

      Returns the application widget that has the keyboard input focus, or -0 if no widget in this application has the focus. -

      See also TQWidget::setFocus(), TQWidget::focus, and activeWindow(). - -

      TQFont TQApplication::font ( const TQWidget * w = 0 ) [static] -

      -Returns the default font for the widget w, or the default -application font if w is 0. -

      See also setFont(), fontMetrics(), and TQWidget::font. - -

      Examples: qfd/fontdisplayer.cpp, themes/metal.cpp, and themes/themes.cpp. -

      TQFontMetrics TQApplication::fontMetrics () [static] -

      -Returns display (screen) font metrics for the application font. -

      See also font(), setFont(), TQWidget::fontMetrics(), and TQPainter::fontMetrics(). - -

      TQSize TQApplication::globalStrut () [static] -

      - -

      Returns the application's global strut. -

      The strut is a size object whose dimensions are the minimum that any -GUI element that the user can interact with should have. For example -no button should be resized to be smaller than the global strut size. -

      See also setGlobalStrut(). - -

      void TQApplication::guiThreadAwake () [signal] -

      - -

      This signal is emitted after the event loop returns from a function -that could block. -

      See also wakeUpGuiThread(). - -

      bool TQApplication::hasGlobalMouseTracking () [static] -

      - -

      Returns TRUE if global mouse tracking is enabled; otherwise -returns FALSE. -

      See also setGlobalMouseTracking(). - -

      bool TQApplication::hasPendingEvents () -

      -This function returns TRUE if there are pending events; otherwise -returns FALSE. Pending events can be either from the window system -or posted events using TQApplication::postEvent(). - -

      int TQApplication::horizontalAlignment ( int align ) [static] -

      - -

      Strips out vertical alignment flags and transforms an -alignment align of AlignAuto into AlignLeft or -AlignRight according to the language used. The other horizontal -alignment flags are left untouched. - -

      void TQApplication::installTranslator ( TQTranslator * mf ) -

      -Adds the message file mf to the list of message files to be used -for translations. -

      Multiple message files can be installed. Translations are searched -for in the last installed message file, then the one from last, and -so on, back to the first installed message file. The search stops as -soon as a matching translation is found. -

      See also removeTranslator(), translate(), and TQTranslator::load(). - -

      Example: i18n/main.cpp. -

      bool TQApplication::isEffectEnabled ( TQt::UIEffect effect ) [static] -

      -Returns TRUE if effect is enabled; otherwise returns FALSE. -

      By default, TQt will try to use the desktop settings. Call -setDesktopSettingsAware(FALSE) to prevent this. -

      Note: All effects are disabled on screens running at less than -16-bit color depth. -

      See also setEffectEnabled() and TQt::UIEffect. - -

      bool TQApplication::isSessionRestored () const -

      - -

      Returns TRUE if the application has been restored from an earlier -session; otherwise returns FALSE. -

      See also sessionId(), commitData(), and saveState(). - -

      void TQApplication::lastWindowClosed () [signal] -

      - -

      This signal is emitted when the user has closed the last -top level window. -

      The signal is very useful when your application has many top level -widgets but no main widget. You can then connect it to the quit() -slot. -

      For convenience, this signal is not emitted for transient top level -widgets such as popup menus and dialogs. -

      See also mainWidget(), topLevelWidgets(), TQWidget::isTopLevel, and TQWidget::close(). - -

      Examples: addressbook/main.cpp, extension/main.cpp, helpviewer/main.cpp, mdi/main.cpp, network/archivesearch/main.cpp, qwerty/main.cpp, and regexptester/main.cpp. -

      TQStringList TQApplication::libraryPaths () [static] -

      -Returns a list of paths that the application will search when -dynamically loading libraries. -The installation directory for plugins is the only entry if no -paths have been set. The default installation directory for plugins -is INSTALL/plugins, where INSTALL is the directory where TQt was -installed. The directory of the application executable (NOT the -working directory) is also added to the plugin paths. -

      If you want to iterate over the list, you should iterate over a -copy, e.g. -

      -    TQStringList list = app.libraryPaths();
      -    TQStringList::Iterator it = list.begin();
      -    while( it != list.end() ) {
      -        myProcessing( *it );
      -        ++it;
      -    }
      -    
      - -

      See the plugins documentation for a -description of how the library paths are used. -

      See also setLibraryPaths(), addLibraryPath(), removeLibraryPath(), and TQLibrary. - -

      void TQApplication::lock () -

      -

      Lock the TQt Library Mutex. If another thread has already locked the -mutex, the calling thread will block until the other thread has -unlocked the mutex. -

      See also unlock(), locked(), and Thread Support in TQt. - -

      bool TQApplication::locked () -

      -

      Returns TRUE if the TQt Library Mutex is locked by a different thread; -otherwise returns FALSE. -

      Warning: Due to different implementations of recursive mutexes on -the supported platforms, calling this function from the same thread -that previously locked the mutex will give undefined results. -

      See also lock(), unlock(), and Thread Support in TQt. - -

      int TQApplication::loopLevel () const -

      -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      Returns the current loop level. -

      Use TQApplication::eventLoop()->loopLevel() instead. -

      -

      bool TQApplication::macEventFilter ( EventHandlerCallRef, EventRef ) [virtual] -

      -This virtual function is only implemented under Macintosh. -

      If you create an application that inherits TQApplication and -reimplement this function, you get direct access to all Carbon Events -that are received from the MacOS. -

      Return TRUE if you want to stop the event from being processed. -Return FALSE for normal event dispatching. - -

      TQWidget * TQApplication::mainWidget () const -

      - -

      Returns the main application widget, or 0 if there is no main -widget. -

      See also setMainWidget(). - -

      bool TQApplication::notify ( TQObject * receiver, TQEvent * e ) [virtual] -

      -Sends event e to receiver: receiver->event(e). -Returns the value that is returned from the receiver's event handler. -

      For certain types of events (e.g. mouse and key events), -the event will be propagated to the receiver's parent and so on up to -the top-level object if the receiver is not interested in the event -(i.e., it returns FALSE). -

      There are five different ways that events can be processed; -reimplementing this virtual function is just one of them. All five -approaches are listed below: -

        -
      1. Reimplementing this function. This is very powerful, providing -complete control; but only one subclass can be tqApp. -

      2. Installing an event filter on tqApp. Such an event filter is able -to process all events for all widgets, so it's just as powerful as -reimplementing notify(); furthermore, it's possible to have more -than one application-global event filter. Global event filters even -see mouse events for disabled - widgets, and if global mouse - tracking is enabled, as well as mouse move events for all -widgets. -

      3. Reimplementing TQObject::event() (as TQWidget does). If you do -this you get Tab key presses, and you get to see the events before -any widget-specific event filters. -

      4. Installing an event filter on the object. Such an event filter -gets all the events except Tab and Shift-Tab key presses. -

      5. Reimplementing paintEvent(), mousePressEvent() and so -on. This is the commonest, easiest and least powerful way. -
      -

      See also TQObject::event() and installEventFilter(). - -

      TQCursor * TQApplication::overrideCursor () [static] -

      - -

      Returns the active application override cursor. -

      This function returns 0 if no application cursor has been defined -(i.e. the internal cursor stack is empty). -

      See also setOverrideCursor() and restoreOverrideCursor(). - -

      TQPalette TQApplication::palette ( const TQWidget * w = 0 ) [static] -

      -Returns the application palette. -

      If a widget is passed in w, the default palette for the -widget's class is returned. This may or may not be the application -palette. In most cases there isn't a special palette for certain -types of widgets, but one notable exception is the popup menu under -Windows, if the user has defined a special background color for -menus in the display settings. -

      See also setPalette() and TQWidget::palette. - -

      Examples: desktop/desktop.cpp, themes/metal.cpp, and themes/wood.cpp. -

      void TQApplication::polish ( TQWidget * w ) [virtual] -

      -Initialization of the appearance of the widget w before it is first -shown. -

      Usually widgets call this automatically when they are polished. It -may be used to do some style-based central customization of widgets. -

      Note that you are not limited to the public functions of TQWidget. -Instead, based on meta information like TQObject::className() you are -able to customize any kind of widget. -

      See also TQStyle::polish(), TQWidget::polish(), setPalette(), and setFont(). - -

      void TQApplication::postEvent ( TQObject * receiver, TQEvent * event ) [static] -

      Note: This function is thread-safe when TQt is built withthread support.

      - -Adds the event event with the object receiver as the receiver of the -event, to an event queue and returns immediately. -

      The event must be allocated on the heap since the post event queue -will take ownership of the event and delete it once it has been posted. -

      When control returns to the main event loop, all events that are -stored in the queue will be sent using the notify() function. -

      -

      See also sendEvent() and notify(). - -

      void TQApplication::processEvents () -

      -Processes pending events, for 3 seconds or until there are no more -events to process, whichever is shorter. -

      You can call this function occasionally when your program is busy -performing a long operation (e.g. copying a file). -

      See also exec(), TQTimer, and TQEventLoop::processEvents(). - -

      Examples: fileiconview/tqfileiconview.cpp and network/ftpclient/main.cpp. -

      void TQApplication::processEvents ( int maxtime ) -

      -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Processes pending events for maxtime milliseconds or until -there are no more events to process, whichever is shorter. -

      You can call this function occasionally when you program is busy -doing a long operation (e.g. copying a file). -

      See also exec(), TQTimer, and TQEventLoop::processEvents(). - -

      void TQApplication::processOneEvent () -

      This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      Waits for an event to occur, processes it, then returns. -

      This function is useful for adapting TQt to situations where the -event processing must be grafted onto existing program loops. -

      Using this function in new applications may be an indication of design -problems. -

      See also processEvents(), exec(), and TQTimer. - -

      void TQApplication::quit () [slot] -

      -Tells the application to exit with return code 0 (success). -Equivalent to calling TQApplication::exit( 0 ). -

      It's common to connect the lastWindowClosed() signal to quit(), and -you also often connect e.g. TQButton::clicked() or signals in -TQAction, TQPopupMenu or TQMenuBar to it. -

      Example: -

      -    TQPushButton *quitButton = new TQPushButton( "Quit" );
      -    connect( quitButton, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );
      -  
      - -

      See also exit(), aboutToQuit(), lastWindowClosed(), and TQAction. - -

      Examples: addressbook/main.cpp, mdi/main.cpp, network/archivesearch/main.cpp, regexptester/main.cpp, t2/main.cpp, t4/main.cpp, and t6/main.cpp. -

      void TQApplication::removeLibraryPath ( const TQString & path ) [static] -

      -Removes path from the library path list. If path is empty or not -in the path list, the list is not changed. -

      See also addLibraryPath(), libraryPaths(), and setLibraryPaths(). - -

      void TQApplication::removePostedEvents ( TQObject * receiver ) [static] -

      Note: This function is thread-safe when TQt is built withthread support.

      - -Removes all events posted using postEvent() for receiver. -

      The events are not dispatched, instead they are removed from the -queue. You should never need to call this function. If you do call it, -be aware that killing events may cause receiver to break one or -more invariants. -

      - -

      void TQApplication::removeTranslator ( TQTranslator * mf ) -

      -Removes the message file mf from the list of message files used by -this application. (It does not delete the message file from the file -system.) -

      See also installTranslator(), translate(), and TQObject::tr(). - -

      Example: i18n/main.cpp. -

      void TQApplication::restoreOverrideCursor () [static] -

      -Undoes the last setOverrideCursor(). -

      If setOverrideCursor() has been called twice, calling -restoreOverrideCursor() will activate the first cursor set. -Calling this function a second time restores the original widgets' -cursors. -

      See also setOverrideCursor() and overrideCursor(). - -

      Examples: distributor/distributor.ui.h, network/archivesearch/archivedialog.ui.h, network/ftpclient/ftpmainwindow.ui.h, and showimg/showimg.cpp. -

      bool TQApplication::reverseLayout () [static] -

      -Returns TRUE if all dialogs and widgets will be laid out in a -mirrored (right to left) fashion. Returns FALSE if dialogs and -widgets will be laid out left to right. -

      See also setReverseLayout(). - -

      void TQApplication::saveState ( TQSessionManager & sm ) [virtual] -

      - -

      This function deals with session - management. It is invoked when the -session manager wants the application -to preserve its state for a future session. -

      For example, a text editor would create a temporary file that -includes the current contents of its edit buffers, the location of -the cursor and other aspects of the current editing session. -

      Note that you should never exit the application within this -function. Instead, the session manager may or may not do this -afterwards, depending on the context. Futhermore, most session -managers will very likely request a saved state immediately after -the application has been started. This permits the session manager -to learn about the application's restart policy. -

      Warning: Within this function, no user interaction is possible, unless you ask the session manager sm for explicit permission. -See TQSessionManager::allowsInteraction() and -TQSessionManager::allowsErrorInteraction() for details. -

      See also isSessionRestored(), sessionId(), commitData(), and the Session Management overview. - -

      bool TQApplication::sendEvent ( TQObject * receiver, TQEvent * event ) [static] -

      - -

      Sends event event directly to receiver receiver, using the -notify() function. Returns the value that was returned from the event -handler. -

      The event is not deleted when the event has been sent. The normal -approach is to create the event on the stack, e.g. -

      -    TQMouseEvent me( TQEvent::MouseButtonPress, pos, 0, 0 );
      -    TQApplication::sendEvent( mainWindow, &me );
      -    
      - -If you create the event on the heap you must delete it. -

      See also postEvent() and notify(). - -

      Example: popup/popup.cpp. -

      void TQApplication::sendPostedEvents ( TQObject * receiver, int event_type ) [static] -

      -Immediately dispatches all events which have been previously queued -with TQApplication::postEvent() and which are for the object receiver -and have the event type event_type. -

      Note that events from the window system are not dispatched by this -function, but by processEvents(). -

      If receiver is null, the events of event_type are sent for all -objects. If event_type is 0, all the events are sent for receiver. - -

      void TQApplication::sendPostedEvents () [static] -

      This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Dispatches all posted events, i.e. empties the event queue. - -

      TQString TQApplication::sessionId () const -

      - -

      Returns the current session's identifier. -

      If the application has been restored from an earlier session, this -identifier is the same as it was in that previous session. -

      The session identifier is guaranteed to be unique both for different -applications and for different instances of the same application. -

      See also isSessionRestored(), sessionKey(), commitData(), and saveState(). - -

      TQString TQApplication::sessionKey () const -

      - -

      Returns the session key in the current session. -

      If the application has been restored from an earlier session, this -key is the same as it was when the previous session ended. -

      The session key changes with every call of commitData() or -saveState(). -

      See also isSessionRestored(), sessionId(), commitData(), and saveState(). - -

      void TQApplication::setColorSpec ( int spec ) [static] -

      -Sets the color specification for the application to spec. -

      The color specification controls how the application allocates colors -when run on a display with a limited amount of colors, e.g. 8 bit / 256 -color displays. -

      The color specification must be set before you create the TQApplication -object. -

      The options are: -

        -
      • TQApplication::NormalColor. -This is the default color allocation strategy. Use this option if -your application uses buttons, menus, texts and pixmaps with few -colors. With this option, the application uses system global -colors. This works fine for most applications under X11, but on -Windows machines it may cause dithering of non-standard colors. -
      • TQApplication::CustomColor. -Use this option if your application needs a small number of custom -colors. On X11, this option is the same as NormalColor. On Windows, TQt -creates a Windows palette, and allocates colors to it on demand. -
      • TQApplication::ManyColor. -Use this option if your application is very color hungry -(e.g. it requires thousands of colors). -Under X11 the effect is: -
          -
        • For 256-color displays which have at best a 256 color true color -visual, the default visual is used, and colors are allocated -from a color cube. The color cube is the 6x6x6 (216 color) "Web -palette"*, but the number of colors can be changed -by the -ncols option. The user can force the application to -use the true color visual with the -visual option. -
        • For 256-color displays which have a true color visual with more -than 256 colors, use that visual. Silicon Graphics X servers -have this feature, for example. They provide an 8 bit visual -by default but can deliver true color when asked. -
        -On Windows, TQt creates a Windows palette, and fills it with a color cube. -
      -

      Be aware that the CustomColor and ManyColor choices may lead to colormap -flashing: The foreground application gets (most) of the available -colors, while the background windows will look less attractive. -

      Example: -

      -  int main( int argc, char **argv )
      -  {
      -      TQApplication::setColorSpec( TQApplication::ManyColor );
      -      TQApplication a( argc, argv );
      -      ...
      -  }
      -  
      - -

      TQColor provides more functionality for controlling color allocation and -freeing up certain colors. See TQColor::enterAllocContext() for more -information. -

      To check what mode you end up with, call TQColor::numBitPlanes() once -the TQApplication object exists. A value greater than 8 (typically -16, 24 or 32) means true color. -

      * The color cube used by TQt has 216 colors whose red, -green, and blue components always have one of the following values: -0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF. -

      See also colorSpec(), TQColor::numBitPlanes(), and TQColor::enterAllocContext(). - -

      Examples: helpviewer/main.cpp, showimg/main.cpp, t9/main.cpp, tetrix/tetrix.cpp, and themes/main.cpp. -

      void TQApplication::setCursorFlashTime ( int msecs ) [static] -

      -Sets the text cursor's flash (blink) time to msecs -milliseconds. The flash time is the time required to display, -invert and restore the caret display. Usually the text cursor is -displayed for msecs/2 milliseconds, then hidden for msecs/2 -milliseconds, but this may vary. -

      Note that on Microsoft Windows, calling this function sets the -cursor flash time for all windows. -

      See also cursorFlashTime(). - -

      void TQApplication::setDefaultCodec ( TQTextCodec * codec ) -

      This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      This is the same as TQTextCodec::setCodecForTr(). - -

      void TQApplication::setDesktopSettingsAware ( bool on ) [static] -

      -By default, TQt will try to use the current standard colors, fonts -etc., from the underlying window system's desktop settings, -and use them for all relevant widgets. This behavior can be switched off -by calling this function with on set to FALSE. -

      This static function must be called before creating the TQApplication -object, like this: -

      -  int main( int argc, char** argv ) {
      -    TQApplication::setDesktopSettingsAware( FALSE ); // I know better than the user
      -    TQApplication myApp( argc, argv ); // Use default fonts & colors
      -    ...
      -  }
      -  
      - -

      See also desktopSettingsAware(). - -

      void TQApplication::setDoubleClickInterval ( int ms ) [static] -

      -Sets the time limit that distinguishes a double click from two -consecutive mouse clicks to ms milliseconds. -

      Note that on Microsoft Windows, calling this function sets the -double click interval for all windows. -

      See also doubleClickInterval(). - -

      void TQApplication::setEffectEnabled ( TQt::UIEffect effect, bool enable = TRUE ) [static] -

      -Enables the UI effect effect if enable is TRUE, otherwise -the effect will not be used. -

      Note: All effects are disabled on screens running at less than -16-bit color depth. -

      See also isEffectEnabled(), TQt::UIEffect, and setDesktopSettingsAware(). - -

      void TQApplication::setFont ( const TQFont & font, bool informWidgets = FALSE, const char * className = 0 ) [static] -

      Changes the default application font to font. If informWidgets is TRUE, then existing widgets are informed about the -change and may adjust themselves to the new application -setting. If informWidgets is FALSE, the change only affects newly -created widgets. If className is passed, the change applies only -to classes that inherit className (as reported by -TQObject::inherits()). -

      On application start-up, the default font depends on the window -system. It can vary depending on both the window system version and -the locale. This function lets you override the default font; but -overriding may be a bad idea because, for example, some locales need -extra-large fonts to support their special characters. -

      See also font(), fontMetrics(), and TQWidget::font. - -

      Examples: desktop/desktop.cpp, themes/metal.cpp, and themes/themes.cpp. -

      void TQApplication::setGlobalMouseTracking ( bool enable ) [static] -

      -Enables global mouse tracking if enable is TRUE, or disables it -if enable is FALSE. -

      Enabling global mouse tracking makes it possible for widget event -filters or application event filters to get all mouse move events, -even when no button is depressed. This is useful for special GUI -elements, e.g. tooltips. -

      Global mouse tracking does not affect widgets and their -mouseMoveEvent(). For a widget to get mouse move events when no -button is depressed, it must do TQWidget::setMouseTracking(TRUE). -

      This function uses an internal counter. Each -setGlobalMouseTracking(TRUE) must have a corresponding -setGlobalMouseTracking(FALSE): -

      -        // at this point global mouse tracking is off
      -        TQApplication::setGlobalMouseTracking( TRUE );
      -        TQApplication::setGlobalMouseTracking( TRUE );
      -        TQApplication::setGlobalMouseTracking( FALSE );
      -        // at this point it's still on
      -        TQApplication::setGlobalMouseTracking( FALSE );
      -        // but now it's off
      -    
      - -

      See also hasGlobalMouseTracking() and TQWidget::mouseTracking. - -

      void TQApplication::setGlobalStrut ( const TQSize & strut ) [static] -

      -Sets the application's global strut to strut. -

      The strut is a size object whose dimensions are the minimum that any -GUI element that the user can interact with should have. For example -no button should be resized to be smaller than the global strut size. -

      The strut size should be considered when reimplementing GUI controls -that may be used on touch-screens or similar IO-devices. -

      Example: -

      -  TQSize& WidgetClass::sizeHint() const
      -  {
      -      return TQSize( 80, 25 ).expandedTo( TQApplication::globalStrut() );
      -  }
      -  
      - -

      See also globalStrut(). - -

      void TQApplication::setLibraryPaths ( const TQStringList & paths ) [static] -

      -Sets the list of directories to search when loading libraries to paths. -All existing paths will be deleted and the path list will consist of the -paths given in paths. -

      See also libraryPaths(), addLibraryPath(), removeLibraryPath(), and TQLibrary. - -

      void TQApplication::setMainWidget ( TQWidget * mainWidget ) [virtual] -

      -Sets the application's main widget to mainWidget. -

      In most respects the main widget is like any other widget, except -that if it is closed, the application exits. Note that -TQApplication does not take ownership of the mainWidget, so -if you create your main widget on the heap you must delete it -yourself. -

      You need not have a main widget; connecting lastWindowClosed() to -quit() is an alternative. -

      For X11, this function also resizes and moves the main widget -according to the -geometry command-line option, so you should -set the default geometry (using TQWidget::setGeometry()) before -calling setMainWidget(). -

      See also mainWidget(), exec(), and quit(). - -

      Examples: chart/main.cpp, helpsystem/main.cpp, life/main.cpp, network/ftpclient/main.cpp, t1/main.cpp, and t4/main.cpp. -

      void TQApplication::setOverrideCursor ( const TQCursor & cursor, bool replace = FALSE ) [static] -

      -Sets the application override cursor to cursor. -

      Application override cursors are intended for showing the user -that the application is in a special state, for example during an -operation that might take some time. -

      This cursor will be displayed in all the application's widgets -until restoreOverrideCursor() or another setOverrideCursor() is -called. -

      Application cursors are stored on an internal stack. -setOverrideCursor() pushes the cursor onto the stack, and -restoreOverrideCursor() pops the active cursor off the stack. -Every setOverrideCursor() must eventually be followed by a -corresponding restoreOverrideCursor(), otherwise the stack will -never be emptied. -

      If replace is TRUE, the new cursor will replace the last -override cursor (the stack keeps its depth). If replace is -FALSE, the new stack is pushed onto the top of the stack. -

      Example: -

      -        TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) );
      -        calculateHugeMandelbrot();              // lunch time...
      -        TQApplication::restoreOverrideCursor();
      -    
      - -

      See also overrideCursor(), restoreOverrideCursor(), and TQWidget::cursor. - -

      Examples: distributor/distributor.ui.h, network/archivesearch/archivedialog.ui.h, network/ftpclient/ftpmainwindow.ui.h, and showimg/showimg.cpp. -

      void TQApplication::setPalette ( const TQPalette & palette, bool informWidgets = FALSE, const char * className = 0 ) [static] -

      -Changes the default application palette to palette. If informWidgets is TRUE, then existing widgets are informed about the -change and may adjust themselves to the new application -setting. If informWidgets is FALSE, the change only affects newly -created widgets. -

      If className is passed, the change applies only to widgets that -inherit className (as reported by TQObject::inherits()). If -className is left 0, the change affects all widgets, thus overriding -any previously set class specific palettes. -

      The palette may be changed according to the current GUI style in -TQStyle::polish(). -

      See also TQWidget::palette, palette(), and TQStyle::polish(). - -

      Examples: i18n/main.cpp, themes/metal.cpp, themes/themes.cpp, and themes/wood.cpp. -

      void TQApplication::setReverseLayout ( bool b ) [static] -

      -If b is TRUE, all dialogs and widgets will be laid out in a -mirrored fashion, as required by right to left languages such as -Arabic and Hebrew. If b is FALSE, dialogs and widgets are laid -out left to right. -

      Changing this flag in runtime does not cause a relayout of already -instantiated widgets. -

      See also reverseLayout(). - -

      void TQApplication::setStartDragDistance ( int l ) [static] -

      -Sets the distance after which a drag should start to l pixels. -

      See also startDragDistance(). - -

      void TQApplication::setStartDragTime ( int ms ) [static] -

      -Sets the time after which a drag should start to ms ms. -

      See also startDragTime(). - -

      void TQApplication::setStyle ( TQStyle * style ) [static] -

      -Sets the application's GUI style to style. Ownership of the style -object is transferred to TQApplication, so TQApplication will delete -the style object on application exit or when a new style is set. -

      Example usage: -

      -    TQApplication::setStyle( new TQWindowsStyle );
      -  
      - -

      When switching application styles, the color palette is set back to -the initial colors or the system defaults. This is necessary since -certain styles have to adapt the color palette to be fully -style-guide compliant. -

      See also style(), TQStyle, setPalette(), and desktopSettingsAware(). - -

      Example: themes/themes.cpp. -

      TQStyle * TQApplication::setStyle ( const TQString & style ) [static] -

      -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Requests a TQStyle object for style from the TQStyleFactory. -

      The string must be one of the TQStyleFactory::keys(), typically one -of "windows", "motif", "cde", "motifplus", "platinum", "sgi" and -"compact". Depending on the platform, "windowsxp", "aqua" or -"macintosh" may be available. -

      A later call to the TQApplication constructor will override the -requested style when a "-style" option is passed in as a commandline -parameter. -

      Returns 0 if an unknown style is passed, otherwise the TQStyle object -returned is set as the application's GUI style. - -

      void TQApplication::setWheelScrollLines ( int n ) [static] -

      -Sets the number of lines to scroll when the mouse wheel is rotated -to n. -

      If this number exceeds the number of visible lines in a certain -widget, the widget should interpret the scroll operation as a -single page up / page down operation instead. -

      See also wheelScrollLines(). - -

      void TQApplication::setWinStyleHighlightColor ( const TQColor & c ) [static] -

      - -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      Sets the color used to mark selections in windows style for all widgets -in the application. Will repaint all widgets if the color is changed. -

      The default color is darkBlue. -

      See also winStyleHighlightColor(). - -

      int TQApplication::startDragDistance () [static] -

      -If you support drag and drop in you application and a drag should -start after a mouse click and after moving the mouse a certain -distance, you should use the value which this method returns as the -distance. -

      For example, if the mouse position of the click is stored in startPos and the current position (e.g. in the mouse move event) is -currPos, you can find out if a drag should be started with code -like this: -

      -  if ( ( startPos - currPos ).manhattanLength() >
      -       TQApplication::startDragDistance() )
      -    startTheDrag();
      -  
      - -

      TQt uses this value internally, e.g. in TQFileDialog. -

      The default value is 4 pixels. -

      See also setStartDragDistance(), startDragTime(), and TQPoint::manhattanLength(). - -

      int TQApplication::startDragTime () [static] -

      -If you support drag and drop in you application and a drag should -start after a mouse click and after a certain time elapsed, you -should use the value which this method returns as the delay (in ms). -

      TQt also uses this delay internally, e.g. in TQTextEdit and TQLineEdit, -for starting a drag. -

      The default value is 500 ms. -

      See also setStartDragTime() and startDragDistance(). - -

      bool TQApplication::startingUp () [static] -

      -Returns TRUE if an application object has not been created yet; -otherwise returns FALSE. -

      See also closingDown(). - -

      TQStyle & TQApplication::style () [static] -

      -Returns the application's style object. -

      See also setStyle() and TQStyle. - -

      void TQApplication::syncX () [static] -

      -Synchronizes with the X server in the X11 implementation. This -normally takes some time. Does nothing on other platforms. -

      See also flushX(). - -

      TQWidgetList * TQApplication::topLevelWidgets () [static] -

      -Returns a list of the top level widgets in the application. -

      The list is created using new and must be deleted by the caller. -

      The list is empty (TQPtrList::isEmpty()) if there are no top level -widgets. -

      Note that some of the top level widgets may be hidden, for example -the tooltip if no tooltip is currently shown. -

      Example: -

      -    // Show all hidden top level widgets.
      -    TQWidgetList  *list = TQApplication::topLevelWidgets();
      -    TQWidgetListIt it( *list );  // iterate over the widgets
      -    TQWidget * w;
      -    while ( (w=it.current()) != 0 ) {   // for each top level widget...
      -        ++it;
      -        if ( !w->isVisible() )
      -            w->show();
      -    }
      -    delete list;                // delete the list, not the widgets
      -  
      - -

      Warning: Delete the list as soon you have finished using it. -The widgets in the list may be deleted by someone else at any time. -

      See also allWidgets(), TQWidget::isTopLevel, TQWidget::visible, and TQPtrList::isEmpty(). - -

      TQString TQApplication::translate ( const char * context, const char * sourceText, const char * comment = 0, Encoding encoding = DefaultCodec ) const -

      Note: This function is reentrant when TQt is built with thread support.

      - -Returns the translation text for sourceText, by querying the -installed messages files. The message files are searched from the most -recently installed message file back to the first installed message -file. -

      TQObject::tr() and TQObject::trUtf8() provide this functionality more -conveniently. -

      context is typically a class name (e.g., "MyDialog") and -sourceText is either English text or a short identifying text, if -the output text will be very long (as for help texts). -

      comment is a disambiguating comment, for when the same sourceText is used in different roles within the same context. By -default, it is null. encoding indicates the 8-bit encoding of -character stings -

      See the TQTranslator documentation for more information about -contexts and comments. -

      If none of the message files contain a translation for sourceText in context, this function returns a TQString -equivalent of sourceText. The encoding of sourceText is -specified by encoding; it defaults to DefaultCodec. -

      This function is not virtual. You can use alternative translation -techniques by subclassing TQTranslator. -

      Warning: This method is reentrant only if all translators are -installed before calling this method. Installing or removing -translators while performing translations is not supported. Doing -so will most likely result in crashes or other undesirable behavior. -

      See also TQObject::tr(), installTranslator(), and defaultCodec(). - -

      bool TQApplication::tryLock () -

      -

      Attempts to lock the TQt Library Mutex, and returns immediately. If -the lock was obtained, this function returns TRUE. If another thread -has locked the mutex, this function returns FALSE, instead of -waiting for the lock to become available. -

      The mutex must be unlocked with unlock() before another thread can -successfully lock it. -

      See also lock(), unlock(), and Thread Support in TQt. - -

      Type TQApplication::type () const -

      -Returns the type of application, Tty, GuiClient or GuiServer. - -

      void TQApplication::unlock ( bool wakeUpGui = TRUE ) -

      -

      Unlock the TQt Library Mutex. If wakeUpGui is TRUE (the default), -then the GUI thread will be woken with TQApplication::wakeUpGuiThread(). -

      See also lock(), locked(), and Thread Support in TQt. - -

      void TQApplication::wakeUpGuiThread () -

      -

      Wakes up the GUI thread. -

      See also guiThreadAwake() and Thread Support in TQt. - -

      int TQApplication::wheelScrollLines () [static] -

      -Returns the number of lines to scroll when the mouse wheel is -rotated. -

      See also setWheelScrollLines(). - -

      TQWidget * TQApplication::widgetAt ( int x, int y, bool child = FALSE ) [static] -

      -Returns a pointer to the widget at global screen position (x, y), or 0 if there is no TQt widget there. -

      If child is FALSE and there is a child widget at position (x, y), the top-level widget containing it is returned. If child -is TRUE the child widget at position (x, y) is returned. -

      This function is normally rather slow. -

      See also TQCursor::pos(), TQWidget::grabMouse(), and TQWidget::grabKeyboard(). - -

      TQWidget * TQApplication::widgetAt ( const TQPoint & pos, bool child = FALSE ) [static] -

      -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Returns a pointer to the widget at global screen position pos, -or 0 if there is no TQt widget there. -

      If child is FALSE and there is a child widget at position pos, the top-level widget containing it is returned. If child -is TRUE the child widget at position pos is returned. - -

      bool TQApplication::winEventFilter ( MSG * ) [virtual] -

      -This virtual function is only implemented under Windows. -

      The message procedure calls this function for every message -received. Reimplement this function if you want to process window -messages that are not processed by TQt. If you don't want -the event to be processed by TQt, then return TRUE; otherwise -return FALSE. - -

      void TQApplication::winFocus ( TQWidget * widget, bool gotFocus ) -

      -This function is available only on Windows. -

      If gotFocus is TRUE, widget will become the active window. -Otherwise the active window is reset to NULL. - -

      const TQColor & TQApplication::winStyleHighlightColor () [static] -

      - -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

      Returns the color used to mark selections in windows style. -

      See also setWinStyleHighlightColor(). - -

      bool TQApplication::x11EventFilter ( XEvent * ) [virtual] -

      -This virtual function is only implemented under X11. -

      If you create an application that inherits TQApplication and -reimplement this function, you get direct access to all X events -that the are received from the X server. -

      Return TRUE if you want to stop the event from being processed. -Return FALSE for normal event dispatching. -

      See also x11ProcessEvent(). - -

      int TQApplication::x11ProcessEvent ( XEvent * event ) -

      -This function does the core processing of individual X -events, normally by dispatching TQt events to the right -destination. -

      It returns 1 if the event was consumed by special handling, 0 if -the event was consumed by normal handling, and -1 if the event was for an unrecognized widget. -

      See also x11EventFilter(). - -


      Related Functions

      -

      void Q_ASSERT ( bool test ) -

      - -

      -

      Prints a warning message containing the source code file name and -line number if test is FALSE. -

      This is really a macro defined in tqglobal.h. -

      Q_ASSERT is useful for testing pre- and post-conditions. -

      Example: -

      -        //
      -        // File: div.cpp
      -        //
      -
      -        #include <tqglobal.h>
      -
      -        int divide( int a, int b )
      -        {
      -            Q_ASSERT( b != 0 );                 // this is line 9
      -            return a/b;
      -        }
      -    
      - -

      If b is zero, the Q_ASSERT statement will output the following -message using the tqWarning() function: -

      -        ASSERT: "b != 0" in div.cpp (9)
      -    
      - -

      See also tqWarning() and Debugging. - -

      void TQ_CHECK_PTR ( void * p ) -

      - -

      -

      If 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 tqglobal.h. -

      Example: -

      -        int *a;
      -
      -        TQ_CHECK_PTR( a = new int[80] );  // WRONG!
      -
      -        a = new (nothrow) int[80];       // Right
      -        TQ_CHECK_PTR( a );
      -    
      - -

      See also tqWarning() and Debugging. - -

      void tqAddPostRoutine ( TQtCleanUpFunction p ) -

      - -

      Adds a global routine that will be called from the TQApplication -destructor. This function is normally used to add cleanup routines -for program-wide functionality. -

      The function given by p should take no arguments and return -nothing, like this: -

      -    static int *global_ptr = 0;
      -
      -    static void cleanup_ptr()
      -    {
      -        delete [] global_ptr;
      -        global_ptr = 0;
      -    }
      -
      -    void init_ptr()
      -    {
      -        global_ptr = new int[100];      // allocate data
      -        tqAddPostRoutine( cleanup_ptr ); // delete later
      -    }
      -  
      - -

      Note that for an application- or module-wide cleanup, -tqAddPostRoutine() is often not suitable. People have a tendency to -make such modules dynamically loaded, and then unload those modules -long before the TQApplication destructor is called, for example. -

      For modules and libraries, using a reference-counted initialization -manager or TQt' parent-child delete mechanism may be better. Here is -an example of a private class which uses the parent-child mechanism -to call a cleanup function at the right time: -

      -    class MyPrivateInitStuff: public TQObject {
      -    private:
      -        MyPrivateInitStuff( TQObject * parent ): TQObject( parent) {
      -            // initialization goes here
      -        }
      -        MyPrivateInitStuff * p;
      -
      -    public:
      -        static MyPrivateInitStuff * initStuff( TQObject * parent ) {
      -            if ( !p )
      -                p = new MyPrivateInitStuff( parent );
      -            return p;
      -        }
      -
      -        ~MyPrivateInitStuff() {
      -            // cleanup (the "post routine") goes here
      -        }
      -    }
      -  
      - -

      By selecting the right parent widget/object, this can often be made -to clean up the module's data at the exact right moment. - -

      void tqDebug ( const char * msg, ... ) -

      - -

      -

      Prints a debug message msg, or calls the message handler (if it -has been installed). -

      This function takes a format string and a list of arguments, -similar to the C printf() function. -

      Example: -

      -        tqDebug( "my window handle = %x", myWidget->id() );
      -    
      - -

      Under X11, the text is printed to stderr. Under Windows, the text -is sent to the debugger. -

      Warning: The internal buffer is limited to 8196 bytes (including -the '\0'-terminator). -

      Warning: Passing (const char *)0 as argument to tqDebug might lead -to crashes on certain platforms due to the platforms printf implementation. -

      See also tqWarning(), tqFatal(), qInstallMsgHandler(), and Debugging. - -

      void tqFatal ( const char * msg, ... ) -

      - -

      -

      Prints a fatal error message msg and exits, or calls the -message handler (if it has been installed). -

      This function takes a format string and a list of arguments, -similar to the C printf() function. -

      Example: -

      -        int divide( int a, int b )
      -        {
      -            if ( b == 0 )                               // program error
      -                tqFatal( "divide: cannot divide by zero" );
      -            return a/b;
      -        }
      -    
      - -

      Under X11, the text is printed to stderr. Under Windows, the text -is sent to the debugger. -

      Warning: The internal buffer is limited to 8196 bytes (including -the '\0'-terminator). -

      Warning: Passing (const char *)0 as argument to tqFatal might lead -to crashes on certain platforms due to the platforms printf implementation. -

      See also tqDebug(), tqWarning(), qInstallMsgHandler(), and Debugging. - -

      TQtMsgHandler qInstallMsgHandler ( TQtMsgHandler h ) -

      - -

      Installs a TQt message handler h. Returns a pointer to the -message handler previously defined. -

      The message handler is a function that prints out debug messages, -warnings and fatal error messages. The TQt library (debug version) -contains hundreds of warning messages that are printed when -internal errors (usually invalid function arguments) occur. If you -implement your own message handler, you get total control of these -messages. -

      The default message handler prints the message to the standard -output under X11 or to the debugger under Windows. If it is a -fatal message, the application aborts immediately. -

      Only one message handler can be defined, since this is usually -done on an application-wide basis to control debug output. -

      To restore the message handler, call qInstallMsgHandler(0). -

      Example: -

      -        #include <ntqapplication.h>
      -        #include <stdio.h>
      -        #include <stdlib.h>
      -
      -        void myMessageOutput( TQtMsgType type, const char *msg )
      -        {
      -            switch ( type ) {
      -                case TQtDebugMsg:
      -                    fprintf( stderr, "Debug: %s\n", msg );
      -                    break;
      -                case TQtWarningMsg:
      -                    fprintf( stderr, "Warning: %s\n", msg );
      -                    break;
      -                case TQtFatalMsg:
      -                    fprintf( stderr, "Fatal: %s\n", msg );
      -                    abort();                    // deliberately core dump
      -            }
      -        }
      -
      -        int main( int argc, char **argv )
      -        {
      -            qInstallMsgHandler( myMessageOutput );
      -            TQApplication a( argc, argv );
      -            ...
      -            return a.exec();
      -        }
      -    
      - -

      See also tqDebug(), tqWarning(), tqFatal(), and Debugging. - -

      bool tqSysInfo ( int * wordSize, bool * bigEndian ) -

      - -

      Obtains information about the system. -

      The system's word size in bits (typically 32) is returned in *wordSize. The *bigEndian is set to TRUE if this is a big-endian -machine, or to FALSE if this is a little-endian machine. -

      In debug mode, this function calls tqFatal() with a message if the -computer is truly weird (i.e. different endianness for 16 bit and -32 bit integers); in release mode it returns FALSE. - -

      void tqSystemWarning ( const char * msg, int code ) -

      - -

      Prints the message msg and uses code to get a system specific -error message. When code is -1 (the default), the system's last -error code will be used if possible. Use this method to handle -failures in platform specific API calls. -

      This function does nothing when TQt is built with TQT_NO_DEBUG -defined. - -

      const char * tqVersion () -

      - -

      Returns the TQt version number as a string, for example, "2.3.0" or -"3.0.5". -

      The TQT_VERSION define has the numeric value in the form: -0xmmiibb (m = major, i = minor, b = bugfix). For example, TQt -3.0.5's TQT_VERSION is 0x030005. - -

      void tqWarning ( const char * msg, ... ) -

      - -

      -

      Prints a warning message msg, or calls the message handler (if -it has been installed). -

      This function takes a format string and a list of arguments, -similar to the C printf() function. -

      Example: -

      -        void f( int c )
      -        {
      -            if ( c > 200 )
      -                tqWarning( "f: bad argument, c == %d", c );
      -        }
      -    
      - -

      Under X11, the text is printed to stderr. Under Windows, the text -is sent to the debugger. -

      Warning: The internal buffer is limited to 8196 bytes (including -the '\0'-terminator). -

      Warning: Passing (const char *)0 as argument to tqWarning might lead -to crashes on certain platforms due to the platforms printf implementation. -

      See also tqDebug(), tqFatal(), qInstallMsgHandler(), and Debugging. - - -


      -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


      - -
      Copyright © 2007 -TrolltechTrademarks -
      TQt 3.3.8
      -
      - diff --git a/doc/html/opengl-x11-overlays.html b/doc/html/opengl-x11-overlays.html index e7aa57dc8..2efb4d6c4 100644 --- a/doc/html/opengl-x11-overlays.html +++ b/doc/html/opengl-x11-overlays.html @@ -83,7 +83,7 @@ transparent color. For the overlay widget, you will typically want to set the background color to the transparent color, so that the OpenGL image shows through except where explicitly overpainted.

      Note: to use this technique, you must not use the "ManyColor" or -"TrueColor" ColorSpec for TQApplication, because this will force +"TrueColor" ColorSpec for TQApplication, because this will force the normal TQt widgets to use a TrueColor visual, which will typically be in the main plane, not in the overlay plane as desired.

      diff --git a/doc/html/outliner-example.html b/doc/html/outliner-example.html index 452660ce8..f8c3c4689 100644 --- a/doc/html/outliner-example.html +++ b/doc/html/outliner-example.html @@ -251,18 +251,18 @@ void OutlineTree::buildTree( TQ ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "outlinetree.h" int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); OutlineTree outline( "todos.opml" ); - a.setMainWidget( &outline ); + a.setMainWidget( &outline ); outline.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/picture-example.html b/doc/html/picture-example.html index 89fd4f01d..b632df5f0 100644 --- a/doc/html/picture-example.html +++ b/doc/html/picture-example.html @@ -46,7 +46,7 @@ a set of drawing commands. ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpainter.h> #include <tqpicture.h> #include <tqpixmap.h> @@ -132,7 +132,7 @@ void PictureDisplay::paintEvent( update(); break; case 'q': // quit - TQApplication::exit(); + TQApplication::exit(); break; } } @@ -140,7 +140,7 @@ void PictureDisplay::paintEvent( TQApplication a( argc, argv ); // TQApplication required! + TQApplication a( argc, argv ); // TQApplication required! const char *fileName = "car.pic"; // default picture file name @@ -160,11 +160,11 @@ int main( int argc, char **argv ) return 0; } else { PictureDisplay test( fileName ); // create picture display - a.setMainWidget( &test); // set main widget + a.setMainWidget( &test); // set main widget test.setCaption("TQt Example - Picture"); test.show(); // show it - return a.exec(); // start event loop + return a.exec(); // start event loop } } diff --git a/doc/html/plugins-howto.html b/doc/html/plugins-howto.html index 05502bd31..c9182a9f8 100644 --- a/doc/html/plugins-howto.html +++ b/doc/html/plugins-howto.html @@ -62,13 +62,13 @@ by default in the standard plugin directory.

      But where is the pluginsbase directory? When the application is run, TQt will first treat the application's executable directory as the -pluginsbase. For example if the application is in C:\Program Files\MyApp and has a style plugin, TQt will look in C:\Program Files\MyApp\styles. (See TQApplication::applicationDirPath() for +pluginsbase. For example if the application is in C:\Program Files\MyApp and has a style plugin, TQt will look in C:\Program Files\MyApp\styles. (See TQApplication::applicationDirPath() for how to find out where the application's executable is.) TQt will also look in the directory given by tqInstallPathPlugins(). If you want TQt to look in additional places you can add as many paths as you need -with calls to TQApplication::addLibraryPath(). And if you want to +with calls to TQApplication::addLibraryPath(). And if you want to set your own path or paths you can use -TQApplication::setLibraryPaths(). +TQApplication::setLibraryPaths().

      Suppose that you have a new style class called 'MyStyle' that you want to make available as a plugin. The required code is straightforward:

      @@ -111,7 +111,7 @@ no explicit object creation is required. TQt will find and create them
       as required. Styles are an exception, since you might want to set a
       style explicitly in code. To apply a style, use code like this:
       
      -    TQApplication::setStyle( TQStyleFactory::create( "MyStyle" ) );
      +    TQApplication::setStyle( TQStyleFactory::create( "MyStyle" ) );
       

      Some plugin classes require additional functions to be implemented. @@ -132,7 +132,7 @@ with each type of plugin in a subdirectory for that type, e.g. styles. want to use the standard plugins path, have your installation process determine the path you want to use for the plugins, and save the path, e.g. using TQSettings, for the application to read when it runs. The -application can then call TQApplication::addLibraryPath() with this +application can then call TQApplication::addLibraryPath() with this path and your plugins will be available to the application. Note that the final part of the path, i.e. styles, widgets, etc., cannot be changed. diff --git a/doc/html/popup-example.html b/doc/html/popup-example.html index 032f285d0..53f86132b 100644 --- a/doc/html/popup-example.html +++ b/doc/html/popup-example.html @@ -110,7 +110,7 @@ private: *****************************************************************************/ #include "popup.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlayout.h> FancyPopup::FancyPopup( TQWidget* parent, const char* name ): @@ -148,7 +148,7 @@ private: // avoid the button remaining in pressed state we simply send a // faked mouse button release event to it. TQMouseEvent me( TQEvent::MouseButtonRelease, TQPoint(0,0), TQPoint(0,0), TQMouseEvent::LeftButton, TQMouseEvent::NoButton); - TQApplication::sendEvent( popupParent, &me ); + TQApplication::sendEvent( popupParent, &me ); } void FancyPopup::popup( TQWidget* parent) { @@ -224,13 +224,13 @@ void Frame::button2Pressed(){ int main( int argc, char **argv ) { - TQApplication a(argc,argv); + TQApplication a(argc,argv); Frame frame; frame.setCaption("TQt Example - Custom Popups"); - a.setMainWidget(&frame); + a.setMainWidget(&frame); frame.show(); - return a.exec(); + return a.exec(); }

      diff --git a/doc/html/process-example.html b/doc/html/process-example.html index c270ee210..3df808575 100644 --- a/doc/html/process-example.html +++ b/doc/html/process-example.html @@ -53,7 +53,7 @@ output of the command. #include <tqvbox.h> #include <tqtextview.h> #include <tqpushbutton.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmessagebox.h> #include <stdlib.h> @@ -82,7 +82,7 @@ private: output = new TQTextView( this ); quitButton = new TQPushButton( tr("Quit"), this ); connect( quitButton, TQ_SIGNAL(clicked()), - tqApp, TQ_SLOT(quit()) ); + tqApp, TQ_SLOT(quit()) ); resize( 500, 500 ); // TQProcess related code @@ -125,11 +125,11 @@ void UicManager::scrollToTop() int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); UicManager manager; - a.setMainWidget( &manager ); + a.setMainWidget( &manager ); manager.show(); - return a.exec(); + return a.exec(); } #include "process.moc" diff --git a/doc/html/progress-example.html b/doc/html/progress-example.html index c74912a4c..0f4c11248 100644 --- a/doc/html/progress-example.html +++ b/doc/html/progress-example.html @@ -48,7 +48,7 @@ demonstrates simple use of menus. *****************************************************************************/ #include <tqprogressdialog.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmenubar.h> #include <tqpopupmenu.h> #include <tqpainter.h> @@ -182,19 +182,19 @@ public: pb(0) { menubar = new TQMenuBar( this, "menu" ); - TQ_CHECK_PTR( menubar ); + TQ_CHECK_PTR( menubar ); TQPopupMenu* file = new TQPopupMenu(); - TQ_CHECK_PTR( file ); + TQ_CHECK_PTR( file ); menubar->insertItem( "&File", file ); for (int i=first_draw_item; i<=last_draw_item; i++) file->insertItem( drawItemText(i), i ); connect( menubar, TQ_SIGNAL(activated(int)), this, TQ_SLOT(doMenuItem(int)) ); file->insertSeparator(); - file->insertItem( "Quit", tqApp, TQ_SLOT(quit()) ); + file->insertItem( "Quit", tqApp, TQ_SLOT(quit()) ); options = new TQPopupMenu(); - TQ_CHECK_PTR( options ); + TQ_CHECK_PTR( options ); menubar->insertItem( "&Options", options ); td_id = options->insertItem( "Timer driven", this, TQ_SLOT(timerDriven()) ); ld_id = options->insertItem( "Loop driven", this, TQ_SLOT(loopDriven()) ); @@ -312,7 +312,7 @@ private: { if ( timer_driven ) { if ( pb ) { - tqWarning("This cannot happen!"); + tqWarning("This cannot happen!"); return; } rects = n; @@ -362,16 +362,16 @@ private: int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); int wincount = argc > 1 ? atoi(argv[1]) : 1; for ( int i=0; i<wincount; i++ ) { CPUWaster* cpuw = new CPUWaster; - if ( i == 0 ) a.setMainWidget(cpuw); + if ( i == 0 ) a.setMainWidget(cpuw); cpuw->show(); } - return a.exec(); + return a.exec(); } #include "progress.moc" diff --git a/doc/html/progressbar-example.html b/doc/html/progressbar-example.html index ba45b7f16..d5ef1c61c 100644 --- a/doc/html/progressbar-example.html +++ b/doc/html/progressbar-example.html @@ -261,18 +261,18 @@ void ProgressBar::slotTimeout() *****************************************************************************/ #include "progressbar.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main(int argc,char **argv) { - TQApplication a(argc,argv); + TQApplication a(argc,argv); ProgressBar progressbar; progressbar.setCaption("TQt Example - ProgressBar"); - a.setMainWidget(&progressbar); + a.setMainWidget(&progressbar); progressbar.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/propertydocs b/doc/html/propertydocs index 83d70b6d7..81478984e 100644 --- a/doc/html/propertydocs +++ b/doc/html/propertydocs @@ -2702,11 +2702,11 @@ function. The object name is not very useful in the current version of Qt, but will become increasingly important in the future. <p> If the object does not have a name, the <a href="tqobject.html#name">name</a>() function returns -"unnamed", so printf() (used in <a href="ntqapplication.html#qDebug">qDebug</a>()) will not be asked to +"unnamed", so printf() (used in <a href="tqapplication.html#qDebug">qDebug</a>()) will not be asked to output a null pointer. If you want a null pointer to be returned for unnamed objects, you can call name( 0 ). <p> <pre> - <a href="ntqapplication.html#qDebug">qDebug</a>( "MyClass::setPrecision(): (%s) invalid precision %f", + <a href="tqapplication.html#qDebug">qDebug</a>( "MyClass::setPrecision(): (%s) invalid precision %f", <a href="tqobject.html#name">name</a>(), newPrecision ); </pre> @@ -2839,7 +2839,7 @@ this property to 0 and finally set it to in-between. <p> <b>Warning:</b> If the progress dialog is modal (see <a href="tqprogressdialog.html#TQProgressDialog">TQProgressDialog::TQProgressDialog</a>()), -this function calls <a href="ntqapplication.html#processEvents">QApplication::processEvents</a>(), so take care that +this function calls <a href="tqapplication.html#processEvents">TQApplication::processEvents</a>(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a TQProgressDialog inside a <a href="tqwidget.html#paintEvent">paintEvent</a>()! <p> <p>See also <a href="tqprogressdialog.html#totalSteps-prop">totalSteps</a>. @@ -4282,7 +4282,7 @@ together seamlessly, you will probably want to use <p>This property holds the widget's background brush. <p>The background brush depends on a widget's palette and its background mode. -<p> <p>See also <a href="tqwidget.html#backgroundColor">backgroundColor</a>(), <a href="tqwidget.html#backgroundPixmap">backgroundPixmap</a>(), <a href="tqwidget.html#eraseColor">eraseColor</a>(), <a href="tqwidget.html#palette-prop">palette</a>, and <a href="ntqapplication.html#setPalette">QApplication::setPalette</a>(). +<p> <p>See also <a href="tqwidget.html#backgroundColor">backgroundColor</a>(), <a href="tqwidget.html#backgroundPixmap">backgroundPixmap</a>(), <a href="tqwidget.html#eraseColor">eraseColor</a>(), <a href="tqwidget.html#palette-prop">palette</a>, and <a href="tqapplication.html#setPalette">TQApplication::setPalette</a>(). <p>Get this property's value with <a href="tqwidget.html#backgroundBrush">backgroundBrush</a>(). @@ -4401,7 +4401,7 @@ widget. See the <a href="tqt.html#CursorShape-enum">list of predefined cur <p> If no cursor has been set, or after a call to <a href="tqwidget.html#unsetCursor">unsetCursor</a>(), the parent's cursor is used. The function unsetCursor() has no effect on top-level widgets. -<p> <p>See also <a href="ntqapplication.html#setOverrideCursor">QApplication::setOverrideCursor</a>(). +<p> <p>See also <a href="tqapplication.html#setOverrideCursor">TQApplication::setOverrideCursor</a>(). <p>Set this property's value with <a href="tqwidget.html#setCursor">setCursor</a>(), get this property's value with <a href="tqwidget.html#cursor">cursor</a>(), and reset this property's value with <a href="tqwidget.html#unsetCursor">unsetCursor</a>(). @@ -4448,7 +4448,7 @@ explicitly disabled. <p>This property holds whether this widget (or its focus proxy) has the keyboard input focus. <p>Effectively equivalent to <tt>qApp-&gt;focusWidget() == this</tt>. -<p> <p>See also <a href="tqwidget.html#setFocus">setFocus</a>(), <a href="tqwidget.html#clearFocus">clearFocus</a>(), <a href="tqwidget.html#focusPolicy-prop">focusPolicy</a>, and <a href="ntqapplication.html#focusWidget">QApplication::focusWidget</a>(). +<p> <p>See also <a href="tqwidget.html#setFocus">setFocus</a>(), <a href="tqwidget.html#clearFocus">clearFocus</a>(), <a href="tqwidget.html#focusPolicy-prop">focusPolicy</a>, and <a href="tqapplication.html#focusWidget">TQApplication::focusWidget</a>(). <p>Get this property's value with <a href="tqwidget.html#hasFocus">hasFocus</a>(). @@ -4621,7 +4621,7 @@ the input method disabled if they have focus. This is the default. that has <a href="focus.html#keyboard-focus">keyboard focus</a>. <p> When popup windows are visible, this property is TRUE for both the active window <em>and</em> for the popup. -<p> <p>See also <a href="tqwidget.html#setActiveWindow">setActiveWindow</a>() and <a href="ntqapplication.html#activeWindow">QApplication::activeWindow</a>(). +<p> <p>See also <a href="tqwidget.html#setActiveWindow">setActiveWindow</a>() and <a href="tqapplication.html#activeWindow">TQApplication::activeWindow</a>(). <p>Get this property's value with <a href="tqwidget.html#isActiveWindow">isActiveWindow</a>(). @@ -4631,7 +4631,7 @@ active window <em>and</em> for the popup. <p>This property holds whether the widget is a desktop widget, i.e. represents the desktop. <p>A desktop widget is also a top-level widget. -<p> <p>See also <a href="tqwidget.html#isTopLevel-prop">isTopLevel</a> and <a href="ntqapplication.html#desktop">QApplication::desktop</a>(). +<p> <p>See also <a href="tqwidget.html#isTopLevel-prop">isTopLevel</a> and <a href="tqapplication.html#desktop">TQApplication::desktop</a>(). <p>Get this property's value with <a href="tqwidget.html#isDesktop">isDesktop</a>(). @@ -4815,7 +4815,7 @@ receives mouse move events when at least one mouse button is pressed while the mouse is being moved. <p> If mouse tracking is enabled, the widget receives mouse move events even if no buttons are pressed. -<p> <p>See also <a href="tqwidget.html#mouseMoveEvent">mouseMoveEvent</a>() and <a href="ntqapplication.html#setGlobalMouseTracking">QApplication::setGlobalMouseTracking</a>(). +<p> <p>See also <a href="tqwidget.html#mouseMoveEvent">mouseMoveEvent</a>() and <a href="tqapplication.html#setGlobalMouseTracking">TQApplication::setGlobalMouseTracking</a>(). <p>Set this property's value with <a href="tqwidget.html#setMouseTracking">setMouseTracking</a>() and get this property's value with <a href="tqwidget.html#hasMouseTracking">hasMouseTracking</a>(). @@ -4864,7 +4864,7 @@ widget), the default application palette. <a href="tqwidget.html#paletteForegroundColor-prop">paletteForegroundColor</a> convenience properties to change a widget's background and foreground appearance only. -<p> <p>See also <a href="tqwidget.html#ownPalette-prop">ownPalette</a>, <a href="tqwidget.html#colorGroup-prop">colorGroup</a>, and <a href="ntqapplication.html#palette">QApplication::palette</a>(). +<p> <p>See also <a href="tqwidget.html#ownPalette-prop">ownPalette</a>, <a href="tqwidget.html#colorGroup-prop">colorGroup</a>, and <a href="tqapplication.html#palette">TQApplication::palette</a>(). <p>Set this property's value with <a href="tqwidget.html#setPalette">setPalette</a>(), get this property's value with <a href="tqwidget.html#palette">palette</a>(), and reset this property's value with <a href="tqwidget.html#unsetPalette">unsetPalette</a>(). @@ -4916,7 +4916,7 @@ and sets a modified <a href="tqpalette.html">TQPalette</a> with < modified according to the widget's <em>background mode</em>. For example, if the background mode is <a href="tqt.html#BackgroundMode-enum">PaletteButton</a> the palette entry <a href="tqcolorgroup.html#ColorRole-enum">TQColorGroup::ButtonText</a> is set to color. -<p> <p>See also <a href="tqwidget.html#palette-prop">palette</a>, <a href="ntqapplication.html#setPalette">QApplication::setPalette</a>(), <a href="tqwidget.html#backgroundMode-prop">backgroundMode</a>, <a href="tqwidget.html#foregroundColor">foregroundColor</a>(), <a href="tqwidget.html#backgroundMode-prop">backgroundMode</a>, and <a href="tqwidget.html#setEraseColor">setEraseColor</a>(). +<p> <p>See also <a href="tqwidget.html#palette-prop">palette</a>, <a href="tqapplication.html#setPalette">TQApplication::setPalette</a>(), <a href="tqwidget.html#backgroundMode-prop">backgroundMode</a>, <a href="tqwidget.html#foregroundColor">foregroundColor</a>(), <a href="tqwidget.html#backgroundMode-prop">backgroundMode</a>, and <a href="tqwidget.html#setEraseColor">setEraseColor</a>(). <p>Set this property's value with <a href="tqwidget.html#setPaletteForegroundColor">setPaletteForegroundColor</a>(), get this property's value with <a href="tqwidget.html#paletteForegroundColor">paletteForegroundColor</a>(), and reset this property's value with <a href="tqwidget.html#unsetPalette">unsetPalette</a>(). @@ -5177,7 +5177,7 @@ for an overview of top-level widget geometry. TQWizard::titleFont <p>This property holds the font used for page titles. -<p>The default is <a href="ntqapplication.html#font">QApplication::font</a>(). +<p>The default is <a href="tqapplication.html#font">TQApplication::font</a>(). <p>Set this property's value with <a href="tqwizard.html#setTitleFont">setTitleFont</a>() and get this property's value with <a href="tqwizard.html#titleFont">titleFont</a>(). diff --git a/doc/html/qapplication-h.html b/doc/html/qapplication-h.html deleted file mode 100644 index f8606370d..000000000 --- a/doc/html/qapplication-h.html +++ /dev/null @@ -1,542 +0,0 @@ - - - - -ntqapplication.h Include File - - - - - - - -
      - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

      ntqapplication.h

      - -

      This is the verbatim text of the ntqapplication.h include file. It is provided only for illustration; the copyright remains with Trolltech. -


      -
      -/****************************************************************************
      -** $Id: qt/ntqapplication.h   3.3.8   edited Jan 16 10:54 $
      -**
      -** Definition of TQApplication class
      -**
      -** Created : 931107
      -**
      -** Copyright (C) 1992-2007 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 file LICENSE.GPL included in the
      -** packaging of this file. Alternatively you may (at your option) use any
      -** later version of the GNU General Public License if such license has
      -** been publicly approved by Trolltech ASA (or its successors, if any)
      -** and the KDE Free TQt Foundation.
      -**
      -** Please review the following information to ensure GNU General
      -** Public Licensing requirements will be met:
      -** http://trolltech.com/products/qt/licenses/licensing/opensource/.
      -** If you are unsure which license is appropriate for your use, please
      -** review the following information:
      -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
      -** or contact the sales department at sales@trolltech.com.
      -**
      -** This file may be used under the terms of the Q Public License as
      -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
      -** included in the packaging of this file.  Licensees holding valid TQt
      -** Commercial licenses may use this file in accordance with the TQt
      -** Commercial License Agreement provided with the Software.
      -**
      -** This file is provided "AS IS" with NO 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 "tqdesktopwidget.h"
      -#include "tqasciidict.h"
      -#include "tqpalette.h"
      -#include "tqtranslator.h"
      -#include "tqstrlist.h"
      -#include "tqstringlist.h"
      -#endif // QT_H
      -
      -class TQSessionManager;
      -class TQStyle;
      -class TQTranslator;
      -class TQEventLoop;
      -
      -#ifdef TQT_THREAD_SUPPORT
      -class TQMutex;
      -#endif // TQT_THREAD_SUPPORT
      -
      -
      -class TQApplication;
      -extern TQ_EXPORT TQApplication *tqApp;		// global application object
      -
      -
      -class TQ_EXPORT TQApplication : public TQObject
      -{
      -    TQ_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(TQ_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 TQT_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 TQT_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 TQT_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 TQT_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 TQT_NO_TRANSLATION
      -# ifndef TQT_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 TQT_NO_DIR
      -    TQString   applicationDirPath();
      -    TQString   applicationFilePath();
      -#endif
      -#ifndef TQT_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 TQT_NO_WHEELEVENT
      -    static void      setWheelScrollLines( int );
      -    static int       wheelScrollLines();
      -#endif
      -    static void	     setGlobalStrut( const TQSize & );
      -    static TQSize     globalStrut();
      -
      -#ifndef TQT_NO_COMPONENT
      -    static void      setLibraryPaths( const TQStringList & );
      -    static TQStringList libraryPaths();
      -    static void      addLibraryPath( const TQString & );
      -    static void      removeLibraryPath( const TQString & );
      -#endif // TQT_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(TQ_WS_MAC)
      -    virtual bool     macEventFilter( EventHandlerCallRef, EventRef );
      -#endif
      -#if defined(TQ_WS_WIN)
      -    virtual bool     winEventFilter( MSG * );
      -#endif
      -#if defined(TQ_WS_X11)
      -    virtual bool     x11EventFilter( XEvent * );
      -    virtual int	     x11ClientMessage( TQWidget*, XEvent*, bool passive_only);
      -    int              x11ProcessEvent( XEvent* );
      -#endif
      -
      -#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN)
      -    static WindowsVersion winVersion();
      -#elif defined(Q_OS_MAC)
      -    static MacintoshVersion macVersion();
      -#endif
      -#if defined(TQ_WS_WIN)
      -    void	     winFocus( TQWidget *, bool );
      -    static void	     winMouseButtonUp();
      -#endif
      -
      -#ifndef TQT_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(TQ_WS_X11)
      -    static void create_xim();
      -    static void close_xim();
      -    static bool x11_apply_settings();
      -#endif
      -    void	     wakeUpGuiThread();
      -#if defined(TQT_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();
      -
      -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(TQ_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 tqt_init(int *, char **, TQApplication::Type);
      -#endif
      -
      -#ifdef TQT_THREAD_SUPPORT
      -    static TQMutex   *tqt_mutex;
      -#endif // TQT_THREAD_SUPPORT
      -
      -    int		     app_argc;
      -    char	   **app_argv;
      -    bool	     quit_now;
      -    int		     quit_code;
      -    static TQStyle   *app_style;
      -    static int	     app_cspec;
      -#ifndef TQT_NO_PALETTE
      -    static TQPalette *app_pal;
      -#endif
      -    static TQFont    *app_font;
      -#ifndef TQT_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<TQTranslator*> *translators;
      -#ifndef TQT_NO_SESSIONMANAGER
      -    TQSessionManager *session_manager;
      -    TQString	     session_id;
      -    static TQString* session_key;
      -    bool	     is_session_restored;
      -#endif
      -#if defined(TQ_WS_X11) && !defined (TQT_NO_STYLE )
      -    static void x11_initialize_style();
      -#endif
      -
      -    static TQSize     app_strut;
      -#ifndef TQT_NO_COMPONENT
      -    static TQStringList *app_libpaths;
      -#endif
      -    static TQAsciiDict<TQPalette> *app_palettes;
      -    static TQAsciiDict<TQFont>    *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 * );
      -
      -    friend class TQWidget;
      -    friend class TQETWidget;
      -    friend class TQDialog;
      -    friend class TQAccelManager;
      -    friend class TQEvent;
      -    friend class TQTranslator;
      -    friend class TQEventLoop;
      -    friend TQ_EXPORT void tqt_ucm_initialize( TQApplication * );
      -#if defined(TQ_WS_WIN)
      -    friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* );
      -#endif
      -private: // Disabled copy constructor and operator=
      -#if defined(TQ_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;
      -}
      -
      -#ifndef TQT_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 TQT_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 tqApp ? tqApp->notify( receiver, event ) : FALSE; }
      -
      -inline bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event )
      -{ if ( event ) event->spont = TRUE; return tqApp ? tqApp->notify( receiver, event ) : FALSE; }
      -
      -#ifdef TQT_NO_TRANSLATION
      -// Simple versions
      -inline TQString TQApplication::translate( const char *, const char *sourceText,
      -					const char *, Encoding encoding ) const
      -{
      -#ifndef TQT_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
      -
      -
      - -


      - -
      Copyright © 2007 -TrolltechTrademarks -
      TQt 3.3.8
      -
      - diff --git a/doc/html/qfd-example.html b/doc/html/qfd-example.html index 8635ddb17..e8c582e7d 100644 --- a/doc/html/qfd-example.html +++ b/doc/html/qfd-example.html @@ -98,7 +98,7 @@ public: *****************************************************************************/ #include "fontdisplayer.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqslider.h> #include <tqspinbox.h> #include <tqpainter.h> @@ -117,7 +117,7 @@ public: setFrameStyle(Panel|Sunken); setMargin(8); setRow(0); - tablefont = TQApplication::font(); + tablefont = TQApplication::font(); } TQSize FontRowTable::sizeHint() const @@ -259,7 +259,7 @@ void FontRowTable::chooseFont() #include "fontdisplayer.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqslider.h> #include <tqpainter.h> #include <tqstatusbar.h> @@ -268,17 +268,17 @@ void FontRowTable::chooseFont() int main(int argc, char** argv) { - TQApplication app(argc,argv); + TQApplication app(argc,argv); FontDisplayer m; TQSize sh = m.centralWidget()->sizeHint(); m.resize(sh.width(), sh.height()+3*m.statusBar()->height()); - app.setMainWidget(&m); + app.setMainWidget(&m); m.setCaption("TQt Example - TQFD"); m.show(); - return app.exec(); + return app.exec(); } diff --git a/doc/html/qmag-example.html b/doc/html/qmag-example.html index b3448ebbe..632655a37 100644 --- a/doc/html/qmag-example.html +++ b/doc/html/qmag-example.html @@ -59,7 +59,7 @@ magnified area as a .bmp file. #include <tqfiledialog.h> #include <tqregexp.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpainter.h> #include <tqwmatrix.h> @@ -132,12 +132,12 @@ static const int timer[] = { int w=0, x=0, n; zoom = new TQComboBox( FALSE, this ); - TQ_CHECK_PTR(zoom); + TQ_CHECK_PTR(zoom); zoom->insertStrList( zoomfactors, 9 ); connect( zoom, TQ_SIGNAL(activated(int)), TQ_SLOT(setZoom(int)) ); refresh = new TQComboBox( FALSE, this ); - TQ_CHECK_PTR(refresh); + TQ_CHECK_PTR(refresh); refresh->insertStrList( refreshrates, 9 ); connect( refresh, TQ_SIGNAL(activated(int)), TQ_SLOT(setRefresh(int)) ); @@ -156,7 +156,7 @@ static const int timer[] = { refresh->setGeometry( x, 2, w+30, 20 ); saveButton = new TQPushButton( this ); - TQ_CHECK_PTR(saveButton); + TQ_CHECK_PTR(saveButton); connect( saveButton, TQ_SIGNAL(clicked()), this, TQ_SLOT(save()) ); saveButton->setText( "Save" ); saveButton->setGeometry( x+w+30+2, 2, @@ -164,15 +164,15 @@ static const int timer[] = { multiSaveButton = new TQPushButton( this ); multiSaveButton->setToggleButton(TRUE); - TQ_CHECK_PTR(multiSaveButton); + TQ_CHECK_PTR(multiSaveButton); connect( multiSaveButton, TQ_SIGNAL(clicked()), this, TQ_SLOT(multiSave()) ); multiSaveButton->setText( "MultiSave" ); multiSaveButton->setGeometry( saveButton->geometry().right() + 2, 2, 10+multiSaveButton->fontMetrics().width("MultiSave"), 20 ); quitButton = new TQPushButton( this ); - TQ_CHECK_PTR(quitButton); - connect( quitButton, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + TQ_CHECK_PTR(quitButton); + connect( quitButton, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); quitButton->setText( "Quit" ); quitButton->setGeometry( multiSaveButton->geometry().right() + 2, 2, 10+quitButton->fontMetrics().width("Quit"), 20 ); @@ -185,7 +185,7 @@ static const int timer[] = { setZoom(5); rgb = new TQLabel( this ); - TQ_CHECK_PTR( rgb ); + TQ_CHECK_PTR( rgb ); rgb->setText( "" ); rgb->setAlignment( AlignVCenter ); rgb->resize( width(), rgb->fontMetrics().height() + 4 ); @@ -206,7 +206,7 @@ static const int timer[] = { setMouseTracking( TRUE ); // and do let me know what pixel I'm at, eh? - grabAround( TQPoint(grabx=tqApp->desktop()->width()/2, graby=tqApp->desktop()->height()/2) ); + grabAround( TQPoint(grabx=tqApp->desktop()->width()/2, graby=tqApp->desktop()->height()/2) ); } @@ -273,16 +273,16 @@ void MagWidget::grab() x = grabx-w/2; // find a suitable position to grab from y = graby-h/2; - if ( x + w > TQApplication::desktop()->width() ) - x = TQApplication::desktop()->width()-w; + if ( x + w > TQApplication::desktop()->width() ) + x = TQApplication::desktop()->width()-w; else if ( x < 0 ) x = 0; - if ( y + h > TQApplication::desktop()->height() ) - y = TQApplication::desktop()->height()-h; + if ( y + h > TQApplication::desktop()->height() ) + y = TQApplication::desktop()->height()-h; else if ( y < 0 ) y = 0; - p = TQPixmap::grabWindow( TQApplication::desktop()->winId(), x, y, w, h ); + p = TQPixmap::grabWindow( TQApplication::desktop()->winId(), x, y, w, h ); image = p.convertToImage(); TQWMatrix m; // after getting it, scale it m.scale( (double)z, (double)z ); @@ -339,8 +339,8 @@ void MagWidget::grabAround(TQPoint pos) int pz; pz = 1; while ( w*pz*h*pz < width()*(height()-yoffset) && - w*pz < TQApplication::desktop()->width() && - h*pz < TQApplication::desktop()->height() ) + w*pz < TQApplication::desktop()->width() && + h*pz < TQApplication::desktop()->height() ) pz++; if ( (w*pz*h*pz - width()*(height()-yoffset)) > (width()*(height()-yoffset) - w*(pz-1)*h*(pz-1)) ) @@ -425,11 +425,11 @@ void MagWidget::grabAround(TQPoint pos) int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MagWidget m; - a.setMainWidget( &m ); + a.setMainWidget( &m ); m.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/qmake-manual-7.html b/doc/html/qmake-manual-7.html index 0f83e33fc..498096730 100644 --- a/doc/html/qmake-manual-7.html +++ b/doc/html/qmake-manual-7.html @@ -55,7 +55,7 @@ body { background: #ffffff; color: black; } #include <stdlib> #include <iostream> #include <vector> - #include <ntqapplication.h> // TQt includes + #include <tqapplication.h> // TQt includes #include <tqpushbutton.h> #include <tqlabel.h> #include "thirdparty/include/libmain.h" @@ -117,7 +117,7 @@ body { background: #ffffff; color: black; } /* Add C++ includes here */ # include <iostream> - # include <ntqapplication.h> + # include <tqapplication.h> # include <tqpushbutton.h> # include <tqlabel.h> #endif @@ -152,7 +152,7 @@ body { background: #ffffff; color: black; } }

      main.cpp

      -
          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqpushbutton.h>
           #include <tqlabel.h>
           #include "myobject.h"
      @@ -160,15 +160,15 @@ body { background: #ffffff; color: black; }
       
           int main(int argc, char **argv)
           {
      -        TQApplication app(argc, argv);
      +        TQApplication app(argc, argv);
       
               MyObject obj;
               MyDialog dia;
      -        app.setMainWidget( &dia );
      +        app.setMainWidget( &dia );
               dia.connect( dia.aButton, TQ_SIGNAL(clicked()), TQ_SLOT(close()) );
               dia.show();
       
      -        return app.exec();
      +        return app.exec();
           }
       

      precompile.pro

      diff --git a/doc/html/qt.dcf b/doc/html/qt.dcf index 0f08678ea..856ee66c9 100644 --- a/doc/html/qt.dcf +++ b/doc/html/qt.dcf @@ -130,120 +130,120 @@
      -
      - QApplication - ColorSpec - Encoding - Type - aboutTQt - aboutToQuit - activeModalWidget - activePopupWidget - activeWindow - addLibraryPath - allWidgets - applicationDirPath - applicationFilePath - argc - argv - beep - clipboard - closeAllWindows - closingDown - colorSpec - commitData - cursorFlashTime - desktop - desktopSettingsAware - doubleClickInterval - eventLoop - exec - exit - flush - flushX - focusWidget - font - fontMetrics - globalStrut - guiThreadAwake - hasGlobalMouseTracking - hasPendingEvents - horizontalAlignment - initialize - installTranslator - isEffectEnabled - isSessionRestored - lastWindowClosed - libraryPaths - lock - locked - macEventFilter - mainWidget - notify - overrideCursor - palette - polish - postEvent - processEvents - quit - removeLibraryPath - removePostedEvent - removePostedEvents - removeTranslator - restoreOverrideCursor - reverseLayout - saveState - sendEvent - sendPostedEvents - sessionId - sessionKey - setColorSpec - setCursorFlashTime - setDesktopSettingsAware - setDoubleClickInterval - setEffectEnabled - setFont - setGlobalMouseTracking - setGlobalStrut - setLibraryPaths - setMainWidget - setOverrideCursor - setPalette - setReverseLayout - setStartDragDistance - setStartDragTime - setStyle - setWheelScrollLines - startDragDistance - startDragTime - startingUp - style - syncX - topLevelWidgets - translate - tryLock - type - unlock - wakeUpGuiThread - wheelScrollLines - widgetAt - winEventFilter - winFocus - x11EventFilter - x11ProcessEvent - ~QApplication - Q_ASSERT - TQ_CHECK_PTR - tqAddPostRoutine - tqDebug - tqFatal - qInstallMsgHandler - tqSysInfo - tqSystemWarning - tqVersion - tqWarning -
      -
      +
      + TQApplication + ColorSpec + Encoding + Type + aboutTQt + aboutToQuit + activeModalWidget + activePopupWidget + activeWindow + addLibraryPath + allWidgets + applicationDirPath + applicationFilePath + argc + argv + beep + clipboard + closeAllWindows + closingDown + colorSpec + commitData + cursorFlashTime + desktop + desktopSettingsAware + doubleClickInterval + eventLoop + exec + exit + flush + flushX + focusWidget + font + fontMetrics + globalStrut + guiThreadAwake + hasGlobalMouseTracking + hasPendingEvents + horizontalAlignment + initialize + installTranslator + isEffectEnabled + isSessionRestored + lastWindowClosed + libraryPaths + lock + locked + macEventFilter + mainWidget + notify + overrideCursor + palette + polish + postEvent + processEvents + quit + removeLibraryPath + removePostedEvent + removePostedEvents + removeTranslator + restoreOverrideCursor + reverseLayout + saveState + sendEvent + sendPostedEvents + sessionId + sessionKey + setColorSpec + setCursorFlashTime + setDesktopSettingsAware + setDoubleClickInterval + setEffectEnabled + setFont + setGlobalMouseTracking + setGlobalStrut + setLibraryPaths + setMainWidget + setOverrideCursor + setPalette + setReverseLayout + setStartDragDistance + setStartDragTime + setStyle + setWheelScrollLines + startDragDistance + startDragTime + startingUp + style + syncX + topLevelWidgets + translate + tryLock + type + unlock + wakeUpGuiThread + wheelScrollLines + widgetAt + winEventFilter + winFocus + x11EventFilter + x11ProcessEvent + ~TQApplication + Q_ASSERT + TQ_CHECK_PTR + tqAddPostRoutine + tqDebug + tqFatal + qInstallMsgHandler + tqSysInfo + tqSystemWarning + tqVersion + tqWarning +
      +
      TQAsciiCache diff --git a/doc/html/qwerty-example.html b/doc/html/qwerty-example.html index 4c076f173..44b208c0a 100644 --- a/doc/html/qwerty-example.html +++ b/doc/html/qwerty-example.html @@ -108,7 +108,7 @@ private: *****************************************************************************/ #include "qwerty.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqfile.h> #include <tqfiledialog.h> #include <tqpopupmenu.h> @@ -134,7 +134,7 @@ enum { Uni = 0, MBug = 1, Lat1 = 2, Local = 3, Guess = 4, Codec = 5 }; m = new TQMenuBar( this, "menu" ); TQPopupMenu * file = new TQPopupMenu(); - TQ_CHECK_PTR( file ); + TQ_CHECK_PTR( file ); m->insertItem( "&File", file ); file->insertItem( "&New", this, TQ_SLOT(newDoc()), ALT+Key_N ); @@ -152,14 +152,14 @@ enum { Uni = 0, MBug = 1, Lat1 = 2, Local = 3, Guess = 4, Codec = 5 }; #endif file->insertSeparator(); file->insertItem( "&Close", this, TQ_SLOT(close()),ALT+Key_W ); - file->insertItem( "&Quit", tqApp, TQ_SLOT(closeAllWindows()), ALT+Key_Q ); + file->insertItem( "&Quit", tqApp, TQ_SLOT(closeAllWindows()), ALT+Key_Q ); connect( save_as, TQ_SIGNAL(activated(int)), this, TQ_SLOT(saveAsEncoding(int)) ); connect( open_as, TQ_SIGNAL(activated(int)), this, TQ_SLOT(openAsEncoding(int)) ); rebuildCodecList(); TQPopupMenu * edit = new TQPopupMenu(); - TQ_CHECK_PTR( edit ); + TQ_CHECK_PTR( edit ); m->insertItem( "&Edit", edit ); edit->insertItem( "To &Uppercase", this, TQ_SLOT(toUpper()), ALT+Key_U ); @@ -230,8 +230,8 @@ void Editor::rebuildCodecList() void Editor::newDoc() { Editor *ed = new Editor; - if ( tqApp->desktop()->size().width() < 450 - || tqApp->desktop()->size().height() < 450 ) { + if ( tqApp->desktop()->size().width() < 450 + || tqApp->desktop()->size().height() < 450 ) { ed->showMaximized(); } else { ed->resize( 400, 400 ); @@ -466,17 +466,17 @@ void Editor::textChanged() ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "qwerty.h" int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); - bool isSmall = tqApp->desktop()->size().width() < 450 - || tqApp->desktop()->size().height() < 450; + bool isSmall = tqApp->desktop()->size().width() < 450 + || tqApp->desktop()->size().height() < 450; int i; for ( i= argc <= 1 ? 0 : 1; i<argc; i++ ) { @@ -491,8 +491,8 @@ int main( int argc, char **argv ) e->show(); } } - a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); - return a.exec(); + a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); + return a.exec(); }
      diff --git a/doc/html/rangecontrols-example.html b/doc/html/rangecontrols-example.html index 40e7ea264..7766fd2f4 100644 --- a/doc/html/rangecontrols-example.html +++ b/doc/html/rangecontrols-example.html @@ -155,19 +155,19 @@ private: *****************************************************************************/ #include "rangecontrols.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); RangeControls rangecontrols; rangecontrols.resize( 500, 300 ); rangecontrols.setCaption( "TQt Example - Range Control Widgets" ); - a.setMainWidget( &rangecontrols ); + a.setMainWidget( &rangecontrols ); rangecontrols.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/regexptester-example.html b/doc/html/regexptester-example.html index 1afbddefd..63e247b99 100644 --- a/doc/html/regexptester-example.html +++ b/doc/html/regexptester-example.html @@ -90,7 +90,7 @@ private:


      Implementation: -

      #include <ntqapplication.h>
      +

      #include <tqapplication.h>
       #include <tqcheckbox.h>
       #include <tqclipboard.h>
       #include <tqcombobox.h>
      @@ -245,7 +245,7 @@ void RegexpTester::copy()
           TQString escaped = regexComboBox->currentText();
           if (!escaped.isEmpty()) {
               escaped = escaped.replace("\\", "\\\\");
      -        TQClipboard *cb = TQApplication::clipboard();
      +        TQClipboard *cb = TQApplication::clipboard();
               cb->setText(escaped, TQClipboard::Clipboard);
               if (cb->supportsSelection())
                   cb->setText(escaped, TQClipboard::Selection);
      @@ -273,16 +273,16 @@ void RegexpTester::languageChange()
       
       


      Main: -

      #include <ntqapplication.h>
      +

      #include <tqapplication.h>
       #include "regexptester.h"
       
       int main(int argc, char **argv)
       {
      -    TQApplication app(argc, argv);
      +    TQApplication app(argc, argv);
           RegexpTester form;
           form.show();
      -    app.connect(&app, TQ_SIGNAL(lastWindowClosed()), &app, TQ_SLOT(quit()));
      -    return app.exec();
      +    app.connect(&app, TQ_SIGNAL(lastWindowClosed()), &app, TQ_SLOT(quit()));
      +    return app.exec();
       }
       
      diff --git a/doc/html/richtext-example.html b/doc/html/richtext-example.html index d0ad7de19..311f415bb 100644 --- a/doc/html/richtext-example.html +++ b/doc/html/richtext-example.html @@ -95,7 +95,7 @@ protected slots: #include <tqpushbutton.h> #include <tqtextview.h> #include <tqbrush.h> -#include <ntqapplication.h> +#include <tqapplication.h> static const char* sayings[] = { "<b>Saying 1:</b><br>" @@ -181,7 +181,7 @@ static const char* sayings[] = { bPrev->setEnabled( FALSE ); - connect( bClose, TQ_SIGNAL( clicked() ), tqApp, TQ_SLOT( quit() ) ); + connect( bClose, TQ_SIGNAL( clicked() ), tqApp, TQ_SLOT( quit() ) ); connect( bPrev, TQ_SIGNAL( clicked() ), this, TQ_SLOT( prev() ) ); connect( bNext, TQ_SIGNAL( clicked() ), this, TQ_SLOT( next() ) ); @@ -235,19 +235,19 @@ void MyRichText::next() *****************************************************************************/ #include "richtext.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MyRichText richtext; richtext.resize( 450, 350 ); richtext.setCaption( "TQt Example - Richtext" ); - a.setMainWidget( &richtext ); + a.setMainWidget( &richtext ); richtext.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/rot-example.html b/doc/html/rot-example.html index 954698644..77227cde3 100644 --- a/doc/html/rot-example.html +++ b/doc/html/rot-example.html @@ -92,7 +92,7 @@ private: #include <tqmultilineedit.h> #include <tqpushbutton.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlayout.h> Rot13::Rot13() @@ -104,7 +104,7 @@ private: TQPushButton * quit = new TQPushButton( "&Quit", this ); quit->setFocusPolicy( NoFocus ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); TQGridLayout * l = new TQGridLayout( this, 2, 2, 5 ); l->addWidget( left, 0, 0 ); @@ -149,13 +149,13 @@ TQString Rot13::rot13( const TQString int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); Rot13 r; r.resize( 400, 400 ); - a.setMainWidget( &r ); + a.setMainWidget( &r ); r.setCaption("TQt Example - ROT13"); r.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/scribble-example.html b/doc/html/scribble-example.html index 3c5ec5689..a82937778 100644 --- a/doc/html/scribble-example.html +++ b/doc/html/scribble-example.html @@ -140,7 +140,7 @@ protected slots: #include "scribble.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqevent.h> #include <tqpainter.h> #include <tqtoolbar.h> @@ -164,7 +164,7 @@ const bool no_writing = FALSE; mousePressed( FALSE ), buffer( width(), height() ) { - if ((tqApp->argc() > 0) && !buffer.load(tqApp->argv()[1])) + if ((tqApp->argc() > 0) && !buffer.load(tqApp->argv()[1])) buffer.fill( colorGroup().base() ); setBackgroundMode( TQWidget::PaletteBase ); #ifndef TQT_NO_CURSOR @@ -331,24 +331,24 @@ void Scribble::slotClear() *****************************************************************************/ #include "scribble.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); Scribble scribble; scribble.resize( 500, 350 ); scribble.setCaption("TQt Example - Scribble"); - a.setMainWidget( &scribble ); - if ( TQApplication::desktop()->width() > 550 - && TQApplication::desktop()->height() > 366 ) + a.setMainWidget( &scribble ); + if ( TQApplication::desktop()->width() > 550 + && TQApplication::desktop()->height() > 366 ) scribble.show(); else scribble.showMaximized(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/scrollview-example.html b/doc/html/scrollview-example.html index 8b11778cc..a9d8d4a43 100644 --- a/doc/html/scrollview-example.html +++ b/doc/html/scrollview-example.html @@ -47,7 +47,7 @@ optimized for very large contents. *****************************************************************************/ #include <tqscrollview.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmenubar.h> #include <tqpopupmenu.h> #include <tqpushbutton.h> @@ -82,7 +82,7 @@ public: for (int y=0; y<2000-h; y+=h+10) { if (y == 0) { TQButton* q=new TQPushButton("Quit", this); - connect(q, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit())); + connect(q, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit())); } else { TQString str; if ( b > 0 ) { @@ -241,15 +241,15 @@ public: TQWidget(parent,name) { TQMenuBar* menubar = new TQMenuBar(this); - TQ_CHECK_PTR( menubar ); + TQ_CHECK_PTR( menubar ); TQPopupMenu* file = new TQPopupMenu( menubar ); - TQ_CHECK_PTR( file ); + TQ_CHECK_PTR( file ); menubar->insertItem( "&File", file ); - file->insertItem( "Quit", tqApp, TQ_SLOT(quit()) ); + file->insertItem( "Quit", tqApp, TQ_SLOT(quit()) ); vp_options = new TQPopupMenu( menubar ); - TQ_CHECK_PTR( vp_options ); + TQ_CHECK_PTR( vp_options ); vp_options->setCheckable( TRUE ); menubar->insertItem( "&ScrollView", vp_options ); connect( vp_options, TQ_SIGNAL(activated(int)), @@ -287,7 +287,7 @@ public: } f_options = new TQPopupMenu( menubar ); - TQ_CHECK_PTR( f_options ); + TQ_CHECK_PTR( f_options ); f_options->setCheckable( TRUE ); menubar->insertItem( "F&rame", f_options ); connect( f_options, TQ_SIGNAL(activated(int)), @@ -304,7 +304,7 @@ public: f_options->insertItem( "Sunken", style_id|TQFrame::Sunken )); f_options->insertSeparator(); lw_options = new TQPopupMenu( menubar ); - TQ_CHECK_PTR( lw_options ); + TQ_CHECK_PTR( lw_options ); lw_options->setCheckable( TRUE ); for (int lw = 1; lw <= max_lw; lw++) { TQString str; @@ -315,7 +315,7 @@ public: connect( lw_options, TQ_SIGNAL(activated(int)), this, TQ_SLOT(doFMenuItem(int)) ); mlw_options = new TQPopupMenu( menubar ); - TQ_CHECK_PTR( mlw_options ); + TQ_CHECK_PTR( mlw_options ); mlw_options->setCheckable( TRUE ); for (int mlw = 0; mlw <= max_mlw; mlw++) { TQString str; @@ -326,7 +326,7 @@ public: connect( mlw_options, TQ_SIGNAL(activated(int)), this, TQ_SLOT(doFMenuItem(int)) ); mw_options = new TQPopupMenu( menubar ); - TQ_CHECK_PTR( mw_options ); + TQ_CHECK_PTR( mw_options ); mw_options->setCheckable( TRUE ); for (int mw = 0; mw <= max_mw; mw++) { TQString str; @@ -460,7 +460,7 @@ private: int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ScrollViewExample ve1(1,0,"ve1"); ScrollViewExample ve2(2,0,"ve2"); @@ -472,9 +472,9 @@ int main( int argc, char **argv ) ve3.setCaption("TQt Example - Scrollviews"); ve3.show(); - TQObject::connect(tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit())); + TQObject::connect(tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit())); - return a.exec(); + return a.exec(); } #include "scrollview.moc" diff --git a/doc/html/session.html b/doc/html/session.html index 24e32fb52..85e6d1315 100644 --- a/doc/html/session.html +++ b/doc/html/session.html @@ -63,11 +63,11 @@ the machine! management for applications yet, i.e. no restoring of previous sessions. They do support graceful logouts where applications have the opportunity to cancel the process after getting confirmation -from the user. This is the functionality that corresponds to the TQApplication::commitData() method. +from the user. This is the functionality that corresponds to the TQApplication::commitData() method.

      X11 has supported complete session management since X11R6.

      Getting session management to work with TQt

      -

      Start by reimplementing TQApplication::commitData() to +

      Start by reimplementing TQApplication::commitData() to enable your application to take part in the graceful logout process. If you are only targeting the MS-Windows platform, this is all you can and must provide. Ideally, your application should provide a shutdown @@ -77,14 +77,14 @@ dialog similar to the following:

      For complete session management (only supported on X11R6 at present), you must also take care of saving the application's state, and potentially of restoring the state in the next life cycle of the -session. This saving is done by reimplementing TQApplication::saveState(). All state data you are saving in this -function, should be marked with the session identifier TQApplication::sessionId(). This application specific identifier is +session. This saving is done by reimplementing TQApplication::saveState(). All state data you are saving in this +function, should be marked with the session identifier TQApplication::sessionId(). This application specific identifier is globally unique, so no clashes will occur. (See TQSessionManager for information on saving/restoring the state of a particular TQt application.)

      Restoration is usually done in the application's main() -function. Check if TQApplication::isSessionRestored() is TRUE. If -that's the case, use the session identifier TQApplication::sessionId() again to access your state data and restore +function. Check if TQApplication::isSessionRestored() is TRUE. If +that's the case, use the session identifier TQApplication::sessionId() again to access your state data and restore the state of the application.

      Important: In order to allow the window manager to restore window attributes such as stacking order or geometry @@ -134,8 +134,8 @@ crash.

    • Use the session manager's Checkpoint and Shutdown buttons with different settings and see how your application behaves. The save type local means that the clients should save their state. It -corresponds to the TQApplication::saveState() function. The global save type asks applications to save their unsaved changes in -permanent, globally accessible storage. It invokes TQApplication::commitData(). +corresponds to the TQApplication::saveState() function. The global save type asks applications to save their unsaved changes in +permanent, globally accessible storage. It invokes TQApplication::commitData().
    • Whenever something crashes, blame xsm and not TQt. xsm is far from being a usable session manager on a user's desktop. It is, however, stable and useful enough to serve as testing environment. diff --git a/doc/html/showimg-example.html b/doc/html/showimg-example.html index df1bce029..c44642cf7 100644 --- a/doc/html/showimg-example.html +++ b/doc/html/showimg-example.html @@ -152,7 +152,7 @@ private slots: #include <tqpopupmenu.h> #include <tqlabel.h> #include <tqpainter.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqclipboard.h> @@ -194,7 +194,7 @@ private slots: si = file->insertItem( "Save image", saveimage ); sp = file->insertItem( "Save pixmap", savepixmap ); file->insertSeparator(); - file->insertItem( "E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q ); + file->insertItem( "E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q ); edit = new TQPopupMenu( menubar ); menubar->insertItem( "&Edit", edit ); @@ -230,7 +230,7 @@ private slots: options->insertSeparator(); ss = options->insertItem( "Smooth scaling" ); cc = options->insertItem( "Use color context" ); - if ( TQApplication::colorSpec() == TQApplication::ManyColor ) + if ( TQApplication::colorSpec() == TQApplication::ManyColor ) options->setItemEnabled( cc, FALSE ); options->setCheckable( TRUE ); setMenuItemFlags(); @@ -481,7 +481,7 @@ bool ImageViewer::loadImage( const TQ filename = fileName; bool ok = FALSE; if ( !filename.isEmpty() ) { - TQApplication::setOverrideCursor( waitCursor ); // this might take time + TQApplication::setOverrideCursor( waitCursor ); // this might take time ok = image.load(filename, 0); pickx = -1; clickx = -1; @@ -506,7 +506,7 @@ bool ImageViewer::loadImage( const TQ pm.resize(0,0); // couldn't load image update(); } - TQApplication::restoreOverrideCursor(); // restore original cursor + TQApplication::restoreOverrideCursor(); // restore original cursor } updateStatus(); setMenuItemFlags(); @@ -530,7 +530,7 @@ bool ImageViewer::reconvertImage() painter.eraseRect(0, menubar->heightForWidth( width() ), width(), height()); } - TQApplication::setOverrideCursor( waitCursor ); // this might take time + TQApplication::setOverrideCursor( waitCursor ); // this might take time if ( pm.convertFromImage(image, conversion_flags) ) { pmScaled = TQPixmap(); @@ -542,7 +542,7 @@ bool ImageViewer::reconvertImage() } updateStatus(); setMenuItemFlags(); - TQApplication::restoreOverrideCursor(); // restore original cursor + TQApplication::restoreOverrideCursor(); // restore original cursor if ( useColorContext() ) TQColor::leaveAllocContext(); @@ -571,7 +571,7 @@ void ImageViewer::scale() if ( image.isNull() ) return; - TQApplication::setOverrideCursor( waitCursor ); // this might take time + TQApplication::setOverrideCursor( waitCursor ); // this might take time if ( width() == pm.width() && h == pm.height() ) { // no need to scale if widget pmScaled = pm; // size equals pixmap size @@ -586,7 +586,7 @@ void ImageViewer::scale() pmScaled = pm.xForm( m ); // create scaled pixmap } } - TQApplication::restoreOverrideCursor(); // restore original cursor + TQApplication::restoreOverrideCursor(); // restore original cursor } /* @@ -735,14 +735,14 @@ void ImageViewer::rot180() void ImageViewer::copy() { #ifndef TQT_NO_MIMECLIPBOARD - TQApplication::clipboard()->setImage(image); // Less information loss + TQApplication::clipboard()->setImage(image); // Less information loss #endif } void ImageViewer::paste() { #ifndef TQT_NO_MIMECLIPBOARD - TQImage p = TQApplication::clipboard()->image(); + TQImage p = TQApplication::clipboard()->image(); if ( !p.isNull() ) { filename = "pasted"; setImage(p); @@ -823,26 +823,26 @@ void ImageViewer::toBitDepth(int d) #include "showimg.h" #include "imagefip.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqimage.h> int main( int argc, char **argv ) { if ( argc > 1 && TQString(argv[1]) == "-m" ) { - TQApplication::setColorSpec( TQApplication::ManyColor ); + TQApplication::setColorSpec( TQApplication::ManyColor ); argc--; argv++; } else if ( argc > 1 && TQString(argv[1]) == "-n" ) { - TQApplication::setColorSpec( TQApplication::NormalColor ); + TQApplication::setColorSpec( TQApplication::NormalColor ); argc--; argv++; } else { - TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication::setColorSpec( TQApplication::CustomColor ); } - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ImageIconProvider iip; TQFileDialog::setIconProvider( &iip ); @@ -864,9 +864,9 @@ int main( int argc, char **argv ) } } - TQObject::connect(tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit())); + TQObject::connect(tqApp, TQ_SIGNAL(lastWindowClosed()), tqApp, TQ_SLOT(quit())); - return a.exec(); + return a.exec(); } diff --git a/doc/html/simple-application-example.html b/doc/html/simple-application-example.html index a5ba219a5..d8e2a0ae7 100644 --- a/doc/html/simple-application-example.html +++ b/doc/html/simple-application-example.html @@ -114,7 +114,7 @@ private: #include <tqstatusbar.h> #include <tqmessagebox.h> #include <tqprinter.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqaccel.h> #include <tqtextstream.h> #include <tqpainter.h> @@ -205,7 +205,7 @@ private: file->insertItem( "&Close", this, TQ_SLOT(close()), CTRL+Key_W ); - file->insertItem( "&Quit", tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_Q ); + file->insertItem( "&Quit", tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_Q ); menuBar()->insertSeparator(); @@ -399,16 +399,16 @@ void ApplicationWindow::aboutTQt() ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "application.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ApplicationWindow *mw = new ApplicationWindow(); mw->setCaption( "TQt Example - Application" ); mw->show(); - a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); - return a.exec(); + a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); + return a.exec(); } diff --git a/doc/html/simple-application.html b/doc/html/simple-application.html index 0c8c62fea..91df8c6f2 100644 --- a/doc/html/simple-application.html +++ b/doc/html/simple-application.html @@ -36,7 +36,7 @@ body { background: #ffffff; color: black; }

      This walkthrough shows simple use of TQMainWindow, TQMenuBar, TQPopupMenu, TQToolBar and TQStatusBar - classes that every modern application window tends to use. (See also Tutorial #2.)

      It also illustrates some aspects of TQWhatsThis (for simple help) and a -typical main() using TQApplication. +typical main() using TQApplication.

      Finally, it shows a typical print function based on TQPrinter.

      The declaration of ApplicationWindow

      @@ -109,16 +109,16 @@ includes application.h when tqtextedit.hntqapplication.h> +#include <tqapplication.h> #include "application.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); ApplicationWindow *mw = new ApplicationWindow(); mw->setCaption( "TQt Example - Application" ); mw->show(); - a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); - return a.exec(); + a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) ); + return a.exec(); } @@ -126,9 +126,9 @@ int main( int argc, char ** argv ) {

          int main( int argc, char ** argv ) {
      -        TQApplication a( argc, argv );
      +        TQApplication a( argc, argv );
       
      -

      With the above line, we create a TQApplication object with the usual +

      With the above line, we create a TQApplication object with the usual constructor and let it parse argc and argv. TQApplication itself takes care of X11-specific command-line options like -geometry, so the program will automatically @@ -140,11 +140,11 @@ behave the way X clients are expected to.

      We create an ApplicationWindow as a top-level widget, set its window system caption to "Document 1", and show() it.

      -

              a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) );
      +
              a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) );
       

      When the application's last window is closed, it should quit. Both -the signal and the slot are predefined members of TQApplication. -

              return a.exec();
      +the signal and the slot are predefined members of TQApplication.
      +

              return a.exec();
       

      Having completed the application's initialization, we start the main event loop (the GUI), and eventually return the error code @@ -291,7 +291,7 @@ example for a shorter and easier approach.) file->insertSeparator(); file->insertItem( "&Close", this, TQ_SLOT(close()), CTRL+Key_W ); - file->insertItem( "&Quit", tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_Q ); + file->insertItem( "&Quit", tqApp, TQ_SLOT( closeAllWindows() ), CTRL+Key_Q );

      ... the Print command with "What's This?" help, another separator and two more commands (Close and Quit) without "What's This?" and pixmaps. diff --git a/doc/html/simple-font-demo-example.html b/doc/html/simple-font-demo-example.html index f86dddc5e..194dd96bb 100644 --- a/doc/html/simple-font-demo-example.html +++ b/doc/html/simple-font-demo-example.html @@ -247,16 +247,16 @@ void Viewer::setFontSubstitutions() #include "viewer.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); Viewer * textViewer = new Viewer(); textViewer->setCaption( "TQt Example - Simple TQFont Demo" ); - app.setMainWidget( textViewer ); + app.setMainWidget( textViewer ); textViewer->show(); - return app.exec(); + return app.exec(); }

      diff --git a/doc/html/simple_dd-example.html b/doc/html/simple_dd-example.html index 71cad2f02..5234a03fa 100644 --- a/doc/html/simple_dd-example.html +++ b/doc/html/simple_dd-example.html @@ -47,7 +47,7 @@ functionality. ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcursor.h> #include <tqsplitter.h> #include <tqlistbox.h> @@ -262,13 +262,13 @@ void DDIconView::slotNewItem( TQDr int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); // Create and show the widgets TQSplitter *split = new TQSplitter(); DDIconView *iv = new DDIconView( split ); (void) new DDListBox( split ); - app.setMainWidget( split ); + app.setMainWidget( split ); split->resize( 600, 400 ); split->show(); @@ -286,7 +286,7 @@ int main( int argc, char *argv[] ) item = new DDIconViewItem( iv, "Blue", TQPixmap( blue_icon ) ); item->setRenameEnabled( TRUE ); - return app.exec(); + return app.exec(); } diff --git a/doc/html/small-table-example-example.html b/doc/html/small-table-example-example.html index 582857396..9515ea06f 100644 --- a/doc/html/small-table-example-example.html +++ b/doc/html/small-table-example-example.html @@ -45,7 +45,7 @@ This example displays a TQTable and some ntqapplication.h> +#include <tqapplication.h> #include <tqtable.h> #include <tqimage.h> #include <tqpixmap.h> @@ -63,7 +63,7 @@ const int numCols = 10; int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); TQTable table( numRows, numCols ); @@ -89,9 +89,9 @@ int main( int argc, char **argv ) for ( int j = 0; j < numRows; ++j ) table.setItem( j, 1, new TQCheckTableItem( &table, "Check me" ) ); - app.setMainWidget( &table ); + app.setMainWidget( &table ); table.show(); - return app.exec(); + return app.exec(); } diff --git a/doc/html/sound-example.html b/doc/html/sound-example.html index ec1838c29..6d56c42a5 100644 --- a/doc/html/sound-example.html +++ b/doc/html/sound-example.html @@ -91,7 +91,7 @@ private: // #include "sound.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqmessagebox.h> #include <tqmenubar.h> @@ -127,7 +127,7 @@ private: file->insertItem("Play 3 and 4 together", this, TQ_SLOT(doPlay34())); file->insertItem("Play all together", this, TQ_SLOT(doPlay1234())); file->insertSeparator(); - file->insertItem("E&xit", tqApp, TQ_SLOT(quit())); + file->insertItem("E&xit", tqApp, TQ_SLOT(quit())); menuBar()->insertItem("&File", file); } @@ -169,12 +169,12 @@ void SoundPlayer::doPlay1234() int main(int argc, char** argv) { - TQApplication app(argc,argv); + TQApplication app(argc,argv); SoundPlayer sp; - app.setMainWidget(&sp); + app.setMainWidget(&sp); sp.setCaption("TQt Example - Sounds"); sp.show(); - return app.exec(); + return app.exec(); } diff --git a/doc/html/splitter-example.html b/doc/html/splitter-example.html index 586bb202c..a6045f34a 100644 --- a/doc/html/splitter-example.html +++ b/doc/html/splitter-example.html @@ -46,7 +46,7 @@ decide for themselves how much space each child item should get. ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlabel.h> #include <tqsplitter.h> #include <tqmultilineedit.h> @@ -95,7 +95,7 @@ private: int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TQSplitter *s1 = new TQSplitter( TQSplitter::Vertical, 0 , "main" ); @@ -125,10 +125,10 @@ int main( int argc, char ** argv ) s2->setOpaqueResize( TRUE ); s3->setOpaqueResize( TRUE ); - a.setMainWidget( s1 ); + a.setMainWidget( s1 ); s1->setCaption("TQt Example - Splitters"); s1->show(); - int result = a.exec(); + int result = a.exec(); delete s1; return result; } diff --git a/doc/html/sql-overview-basicbrowsing-main-cpp.html b/doc/html/sql-overview-basicbrowsing-main-cpp.html index ca35ce942..eb7531558 100644 --- a/doc/html/sql-overview-basicbrowsing-main-cpp.html +++ b/doc/html/sql-overview-basicbrowsing-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlquery.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlDatabase *oracledb = TQSqlDatabase::database( "ORACLE" ); diff --git a/doc/html/sql-overview-basicbrowsing2-main-cpp.html b/doc/html/sql-overview-basicbrowsing2-main-cpp.html index 3b0c38f6d..a6553bb70 100644 --- a/doc/html/sql-overview-basicbrowsing2-main-cpp.html +++ b/doc/html/sql-overview-basicbrowsing2-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlquery.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlDatabase *oracledb = TQSqlDatabase::database( "ORACLE" ); diff --git a/doc/html/sql-overview-basicdatamanip-main-cpp.html b/doc/html/sql-overview-basicdatamanip-main-cpp.html index c7805bc27..93e846e10 100644 --- a/doc/html/sql-overview-basicdatamanip-main-cpp.html +++ b/doc/html/sql-overview-basicdatamanip-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlquery.h> #include "../connection.h" @@ -51,7 +51,7 @@ bool createConnections(); int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); int rows = 0; diff --git a/doc/html/sql-overview-connect1-main-cpp.html b/doc/html/sql-overview-connect1-main-cpp.html index 3ba7a7053..a294c4ff3 100644 --- a/doc/html/sql-overview-connect1-main-cpp.html +++ b/doc/html/sql-overview-connect1-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); TQSqlDatabase *defaultDB = TQSqlDatabase::addDatabase( DB_SALES_DRIVER ); defaultDB->setDatabaseName( DB_SALES_DBNAME ); diff --git a/doc/html/sql-overview-create_connections-main-cpp.html b/doc/html/sql-overview-create_connections-main-cpp.html index d2523b18f..b1dadfaa5 100644 --- a/doc/html/sql-overview-create_connections-main-cpp.html +++ b/doc/html/sql-overview-create_connections-main-cpp.html @@ -41,13 +41,13 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { // Databases successfully opened; get pointers to them: diff --git a/doc/html/sql-overview-custom1-main-cpp.html b/doc/html/sql-overview-custom1-main-cpp.html index 55782533c..b575aaeaf 100644 --- a/doc/html/sql-overview-custom1-main-cpp.html +++ b/doc/html/sql-overview-custom1-main-cpp.html @@ -130,16 +130,16 @@ void FormDialog::save() int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( ! createConnections() ) return 1; FormDialog *formDialog = new FormDialog(); formDialog->show(); - app.setMainWidget( formDialog ); + app.setMainWidget( formDialog ); - return app.exec(); + return app.exec(); }


      diff --git a/doc/html/sql-overview-custom1-main-h.html b/doc/html/sql-overview-custom1-main-h.html index e30c2331f..7bede1912 100644 --- a/doc/html/sql-overview-custom1-main-h.html +++ b/doc/html/sql-overview-custom1-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdialog.h> #include <tqlabel.h> #include <tqlayout.h> diff --git a/doc/html/sql-overview-delete-main-cpp.html b/doc/html/sql-overview-delete-main-cpp.html index c879e2c26..78c5bd9a3 100644 --- a/doc/html/sql-overview-delete-main-cpp.html +++ b/doc/html/sql-overview-delete-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlCursor cur( "prices" ); diff --git a/doc/html/sql-overview-extract-main-cpp.html b/doc/html/sql-overview-extract-main-cpp.html index 50445c2ee..279cedd0d 100644 --- a/doc/html/sql-overview-extract-main-cpp.html +++ b/doc/html/sql-overview-extract-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlCursor cur( "creditors" ); @@ -67,7 +67,7 @@ int main( int argc, char *argv[] ) int id = cur.value( "id" ).toInt(); TQString name = cur.value( "forename" ).toString() + " " + cur.value( "surname" ).toString(); - tqDebug( TQString::number( id ) + ": " + name ); + tqDebug( TQString::number( id ) + ": " + name ); } } diff --git a/doc/html/sql-overview-form1-main-cpp.html b/doc/html/sql-overview-form1-main-cpp.html index fd86d48ad..bbf1b2bdb 100644 --- a/doc/html/sql-overview-form1-main-cpp.html +++ b/doc/html/sql-overview-form1-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdialog.h> #include <tqlabel.h> #include <tqlayout.h> @@ -91,15 +91,15 @@ class FormDialog : public TQDialog int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( ! createConnections() ) return 1; FormDialog *formDialog = new FormDialog(); formDialog->show(); - app.setMainWidget( formDialog ); + app.setMainWidget( formDialog ); - return app.exec(); + return app.exec(); }


      diff --git a/doc/html/sql-overview-form2-main-h.html b/doc/html/sql-overview-form2-main-h.html index d97249c7e..304daf2b8 100644 --- a/doc/html/sql-overview-form2-main-h.html +++ b/doc/html/sql-overview-form2-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdialog.h> #include <tqlabel.h> #include <tqlayout.h> diff --git a/doc/html/sql-overview-insert-main-cpp.html b/doc/html/sql-overview-insert-main-cpp.html index ebd31b601..6c87d1012 100644 --- a/doc/html/sql-overview-insert-main-cpp.html +++ b/doc/html/sql-overview-insert-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { int count = 0; diff --git a/doc/html/sql-overview-navigating-main-cpp.html b/doc/html/sql-overview-navigating-main-cpp.html index 5c942c583..61549533f 100644 --- a/doc/html/sql-overview-navigating-main-cpp.html +++ b/doc/html/sql-overview-navigating-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlquery.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlQuery query( "SELECT id, name FROM people ORDER BY name" ); diff --git a/doc/html/sql-overview-order1-main-cpp.html b/doc/html/sql-overview-order1-main-cpp.html index 5dd03fe5e..3d3c5498b 100644 --- a/doc/html/sql-overview-order1-main-cpp.html +++ b/doc/html/sql-overview-order1-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlCursor cur( "staff" ); @@ -56,7 +56,7 @@ int main( int argc, char *argv[] ) TQSqlIndex order = cur.index( fields ); cur.select( order ); while ( cur.next() ) { - tqDebug( cur.value( "id" ).toString() + ": " + + tqDebug( cur.value( "id" ).toString() + ": " + cur.value( "surname" ).toString() + " " + cur.value( "forename" ).toString() ); } diff --git a/doc/html/sql-overview-order2-main-cpp.html b/doc/html/sql-overview-order2-main-cpp.html index b3d540a23..1922d2b32 100644 --- a/doc/html/sql-overview-order2-main-cpp.html +++ b/doc/html/sql-overview-order2-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlCursor cur( "staff" ); @@ -58,7 +58,7 @@ int main( int argc, char *argv[] ) cur.setValue( "surname", "Bloggs" ); cur.select( filter, order ); while ( cur.next() ) { - tqDebug( cur.value( "id" ).toString() + ": " + + tqDebug( cur.value( "id" ).toString() + ": " + cur.value( "surname" ).toString() + " " + cur.value( "forename" ).toString() ); } diff --git a/doc/html/sql-overview-retrieve1-main-cpp.html b/doc/html/sql-overview-retrieve1-main-cpp.html index 2523f383b..ae2bfab2d 100644 --- a/doc/html/sql-overview-retrieve1-main-cpp.html +++ b/doc/html/sql-overview-retrieve1-main-cpp.html @@ -41,20 +41,20 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlquery.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlQuery query( "SELECT id, surname FROM staff" ); if ( query.isActive() ) { while ( query.next() ) { - tqDebug( query.value(0).toString() + ": " + + tqDebug( query.value(0).toString() + ": " + query.value(1).toString() ); } } diff --git a/doc/html/sql-overview-retrieve2-main-cpp.html b/doc/html/sql-overview-retrieve2-main-cpp.html index f4bac8f04..bab196b73 100644 --- a/doc/html/sql-overview-retrieve2-main-cpp.html +++ b/doc/html/sql-overview-retrieve2-main-cpp.html @@ -41,20 +41,20 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { TQSqlCursor cur( "staff" ); // Specify the table/view name cur.select(); // We'll retrieve every record while ( cur.next() ) { - tqDebug( cur.value( "id" ).toString() + ": " + + tqDebug( cur.value( "id" ).toString() + ": " + cur.value( "surname" ).toString() + " " + cur.value( "salary" ).toString() ); } diff --git a/doc/html/sql-overview-subclass1-main-cpp.html b/doc/html/sql-overview-subclass1-main-cpp.html index af7fb2320..cba13dbf7 100644 --- a/doc/html/sql-overview-subclass1-main-cpp.html +++ b/doc/html/sql-overview-subclass1-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include <tqdatatable.h> @@ -49,14 +49,14 @@ body { background: #ffffff; color: black; } int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { TQSqlCursor invoiceItemCursor( "invoiceitem" ); TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); - app.setMainWidget( invoiceItemTable ); + app.setMainWidget( invoiceItemTable ); invoiceItemTable->addColumn( "pricesid", "PriceID" ); invoiceItemTable->addColumn( "quantity", "Quantity" ); @@ -65,7 +65,7 @@ int main( int argc, char *argv[] ) invoiceItemTable->refresh(); invoiceItemTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-subclass2-main-cpp.html b/doc/html/sql-overview-subclass2-main-cpp.html index 63d9455e6..2289656c5 100644 --- a/doc/html/sql-overview-subclass2-main-cpp.html +++ b/doc/html/sql-overview-subclass2-main-cpp.html @@ -53,14 +53,14 @@ body { background: #ffffff; color: black; } int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { InvoiceItemCursor invoiceItemCursor; TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); - app.setMainWidget( invoiceItemTable ); + app.setMainWidget( invoiceItemTable ); invoiceItemTable->addColumn( "pricesid", "PriceID" ); invoiceItemTable->addColumn( "quantity", "Quantity" ); @@ -69,7 +69,7 @@ int main( int argc, char *argv[] ) invoiceItemTable->refresh(); invoiceItemTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-subclass2-main-h.html b/doc/html/sql-overview-subclass2-main-h.html index f7c69ac89..f4c0e164b 100644 --- a/doc/html/sql-overview-subclass2-main-h.html +++ b/doc/html/sql-overview-subclass2-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" diff --git a/doc/html/sql-overview-subclass3-main-cpp.html b/doc/html/sql-overview-subclass3-main-cpp.html index 1aec0bcad..dc93b28ee 100644 --- a/doc/html/sql-overview-subclass3-main-cpp.html +++ b/doc/html/sql-overview-subclass3-main-cpp.html @@ -68,14 +68,14 @@ TQVariant InvoiceItemCursor::calculate int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { InvoiceItemCursor invoiceItemCursor; TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); - app.setMainWidget( invoiceItemTable ); + app.setMainWidget( invoiceItemTable ); invoiceItemTable->addColumn( "productname", "Product" ); invoiceItemTable->addColumn( "quantity", "Quantity" ); @@ -84,7 +84,7 @@ int main( int argc, char *argv[] ) invoiceItemTable->refresh(); invoiceItemTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-subclass3-main-h.html b/doc/html/sql-overview-subclass3-main-h.html index 1724ad579..62912cff2 100644 --- a/doc/html/sql-overview-subclass3-main-h.html +++ b/doc/html/sql-overview-subclass3-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" diff --git a/doc/html/sql-overview-subclass4-main-cpp.html b/doc/html/sql-overview-subclass4-main-cpp.html index b51f4bac2..779a2887a 100644 --- a/doc/html/sql-overview-subclass4-main-cpp.html +++ b/doc/html/sql-overview-subclass4-main-cpp.html @@ -90,14 +90,14 @@ TQVariant InvoiceItemCursor::calculate int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { InvoiceItemCursor invoiceItemCursor; TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); - app.setMainWidget( invoiceItemTable ); + app.setMainWidget( invoiceItemTable ); invoiceItemTable->addColumn( "productname", "Product" ); invoiceItemTable->addColumn( "price", "Price" ); @@ -108,7 +108,7 @@ int main( int argc, char *argv[] ) invoiceItemTable->refresh(); invoiceItemTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-subclass4-main-h.html b/doc/html/sql-overview-subclass4-main-h.html index fee1c76ac..b0afe4d28 100644 --- a/doc/html/sql-overview-subclass4-main-h.html +++ b/doc/html/sql-overview-subclass4-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" diff --git a/doc/html/sql-overview-subclass5-main-cpp.html b/doc/html/sql-overview-subclass5-main-cpp.html index c7ff0d4fd..cce7d978c 100644 --- a/doc/html/sql-overview-subclass5-main-cpp.html +++ b/doc/html/sql-overview-subclass5-main-cpp.html @@ -103,14 +103,14 @@ TQSqlRecord *InvoiceItemCursor::primeInse int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { InvoiceItemCursor invoiceItemCursor; TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor ); - app.setMainWidget( invoiceItemTable ); + app.setMainWidget( invoiceItemTable ); invoiceItemTable->addColumn( "productname", "Product" ); invoiceItemTable->addColumn( "price", "Price" ); @@ -121,7 +121,7 @@ int main( int argc, char *argv[] ) invoiceItemTable->refresh(); invoiceItemTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-subclass5-main-h.html b/doc/html/sql-overview-subclass5-main-h.html index e470e00ce..9ded30f84 100644 --- a/doc/html/sql-overview-subclass5-main-h.html +++ b/doc/html/sql-overview-subclass5-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdatetime.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> diff --git a/doc/html/sql-overview-table1-main-cpp.html b/doc/html/sql-overview-table1-main-cpp.html index f8be6f2b1..ffc506d7f 100644 --- a/doc/html/sql-overview-table1-main-cpp.html +++ b/doc/html/sql-overview-table1-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include <tqdatatable.h> @@ -49,16 +49,16 @@ body { background: #ffffff; color: black; } int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { TQSqlCursor staffCursor( "staff" ); TQDataTable *staffTable = new TQDataTable( &staffCursor, TRUE ); - app.setMainWidget( staffTable ); + app.setMainWidget( staffTable ); staffTable->refresh(); staffTable->show(); - return app.exec(); + return app.exec(); } return 0; diff --git a/doc/html/sql-overview-table2-main-cpp.html b/doc/html/sql-overview-table2-main-cpp.html index 294ceb34a..6507bf55e 100644 --- a/doc/html/sql-overview-table2-main-cpp.html +++ b/doc/html/sql-overview-table2-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include <tqdatatable.h> @@ -49,14 +49,14 @@ body { background: #ffffff; color: black; } int main( int argc, char *argv[] ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { TQSqlCursor staffCursor( "staff" ); TQDataTable *staffTable = new TQDataTable( &staffCursor ); - app.setMainWidget( staffTable ); + app.setMainWidget( staffTable ); staffTable->addColumn( "forename", "Forename" ); staffTable->addColumn( "surname", "Surname" ); @@ -68,7 +68,7 @@ int main( int argc, char *argv[] ) staffTable->refresh(); staffTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-table3-main-cpp.html b/doc/html/sql-overview-table3-main-cpp.html index 1ffc30d29..bd3f41bd7 100644 --- a/doc/html/sql-overview-table3-main-cpp.html +++ b/doc/html/sql-overview-table3-main-cpp.html @@ -92,7 +92,7 @@ TQWidget *CustomSqlEditorFactory::TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { TQSqlCursor staffCursor( "staff" ); @@ -104,7 +104,7 @@ int main( int argc, char *argv[] ) staffTable->installPropertyMap( propMap ); staffTable->installEditorFactory( editorFactory ); - app.setMainWidget( staffTable ); + app.setMainWidget( staffTable ); staffTable->addColumn( "forename", "Forename" ); staffTable->addColumn( "surname", "Surname" ); @@ -117,7 +117,7 @@ int main( int argc, char *argv[] ) staffTable->refresh(); staffTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-table3-main-h.html b/doc/html/sql-overview-table3-main-h.html index 9e6640e22..f618bcf3a 100644 --- a/doc/html/sql-overview-table3-main-h.html +++ b/doc/html/sql-overview-table3-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcombobox.h> #include <tqmap.h> #include <tqsqldatabase.h> diff --git a/doc/html/sql-overview-table4-main-cpp.html b/doc/html/sql-overview-table4-main-cpp.html index 9b6d5fa48..c304320f9 100644 --- a/doc/html/sql-overview-table4-main-cpp.html +++ b/doc/html/sql-overview-table4-main-cpp.html @@ -111,7 +111,7 @@ TQWidget *CustomSqlEditorFactory::TQApplication app( argc, argv ); + TQApplication app( argc, argv ); if ( createConnections() ) { TQSqlCursor staffCursor( "staff" ); @@ -123,7 +123,7 @@ int main( int argc, char *argv[] ) staffTable->installPropertyMap( propMap ); staffTable->installEditorFactory( editorFactory ); - app.setMainWidget( staffTable ); + app.setMainWidget( staffTable ); staffTable->addColumn( "forename", "Forename" ); staffTable->addColumn( "surname", "Surname" ); @@ -136,7 +136,7 @@ int main( int argc, char *argv[] ) staffTable->refresh(); staffTable->show(); - return app.exec(); + return app.exec(); } return 1; diff --git a/doc/html/sql-overview-table4-main-h.html b/doc/html/sql-overview-table4-main-h.html index 5d03f9ac1..a31072d58 100644 --- a/doc/html/sql-overview-table4-main-h.html +++ b/doc/html/sql-overview-table4-main-h.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqcombobox.h> #include <tqmap.h> #include <tqpainter.h> diff --git a/doc/html/sql-overview-update-main-cpp.html b/doc/html/sql-overview-update-main-cpp.html index 9c8bb989c..46832c3b8 100644 --- a/doc/html/sql-overview-update-main-cpp.html +++ b/doc/html/sql-overview-update-main-cpp.html @@ -41,14 +41,14 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqsqldatabase.h> #include <tqsqlcursor.h> #include "../connection.h" int main( int argc, char *argv[] ) { - TQApplication app( argc, argv, FALSE ); + TQApplication app( argc, argv, FALSE ); if ( createConnections() ) { TQSqlCursor cur( "prices" ); diff --git a/doc/html/sql.html b/doc/html/sql.html index 4b6ce21a1..9a9aa90d1 100644 --- a/doc/html/sql.html +++ b/doc/html/sql.html @@ -232,13 +232,13 @@ the driver, set up the connection information, and open the connection.

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include "../connection.h"
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv, FALSE );
      +        TQApplication app( argc, argv, FALSE );
       
               TQSqlDatabase *defaultDB = TQSqlDatabase::addDatabase( DB_SALES_DRIVER );
               defaultDB->setDatabaseName( DB_SALES_DBNAME );
      @@ -313,7 +313,7 @@ function in connection.h.
               defaultDB->setPassword( DB_SALES_PASSWD );
               defaultDB->setHostName( DB_SALES_HOST );
               if ( ! defaultDB->open() ) {
      -            tqWarning( "Failed to open sales database: " + defaultDB->lastError().text() );
      +            tqWarning( "Failed to open sales database: " + defaultDB->lastError().text() );
                   return FALSE;
               }
       
      @@ -323,7 +323,7 @@ function in connection.h.
               oracle->setPassword( DB_ORDERS_PASSWD );
               oracle->setHostName( DB_ORDERS_HOST );
               if ( ! oracle->open() ) {
      -            tqWarning( "Failed to open orders database: " + oracle->lastError().text() );
      +            tqWarning( "Failed to open orders database: " + oracle->lastError().text() );
                   return FALSE;
               }
       
      @@ -349,13 +349,13 @@ function in connection.h.
       

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include "../connection.h"
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv, FALSE );
      +        TQApplication app( argc, argv, FALSE );
       
               if ( createConnections() ) {
                   // Databases successfully opened; get pointers to them:
      @@ -411,14 +411,14 @@ the transaction, and then either TQSqlDataba
       
       

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include <tqsqlquery.h>
           #include "../connection.h"
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv, FALSE );
      +        TQApplication app( argc, argv, FALSE );
       
               if ( createConnections() ) {
                   TQSqlDatabase *oracledb = TQSqlDatabase::database( "ORACLE" );
      @@ -486,7 +486,7 @@ cannot be determined, e.g. if the query fails.
           **
           *****************************************************************************/
       
      -    #include <ntqapplication.h>
      +    #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include <tqsqlquery.h>
           #include "../connection.h"
      @@ -495,7 +495,7 @@ cannot be determined, e.g. if the query fails.
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv, FALSE );
      +        TQApplication app( argc, argv, FALSE );
       
               int rows = 0;
       
      @@ -569,7 +569,7 @@ retrieve data from it.
                   TQSqlQuery query( "SELECT id, surname FROM staff" );
                   if ( query.isActive() ) {
                       while ( query.next() ) {
      -                    tqDebug( query.value(0).toString() + ": " +
      +                    tqDebug( query.value(0).toString() + ": " +
                                   query.value(1).toString() );
                       }
                   }
      @@ -627,20 +627,20 @@ discuss subclassing TQSqlCursor.
       
       

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include <tqsqlcursor.h>
           #include "../connection.h"
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               if ( createConnections() ) {
                   TQSqlCursor cur( "staff" ); // Specify the table/view name
                   cur.select(); // We'll retrieve every record
                   while ( cur.next() ) {
      -                tqDebug( cur.value( "id" ).toString() + ": " +
      +                tqDebug( cur.value( "id" ).toString() + ": " +
                               cur.value( "surname" ).toString() + " " +
                               cur.value( "salary" ).toString() );
                   }
      @@ -779,7 +779,7 @@ setValue() to ensure that the value used is the one we want.
                       int id = cur.value( "id" ).toInt();
                       TQString name = cur.value( "forename" ).toString() + " " +
                                      cur.value( "surname" ).toString();
      -                tqDebug( TQString::number( id ) + ": " + name );
      +                tqDebug( TQString::number( id ) + ": " + name );
                   }
       

      From sql/overview/extract/main.cpp

      @@ -803,7 +803,7 @@ values ourselves with the setValue() calls. The order fields are used in the ORDER BY clause.

      Now we iterate through each matching record (if any). We retrieve the contents of the id, forename and surname fields and pass them on to -some processing function, in this example a simple tqDebug() call. +some processing function, in this example a simple tqDebug() call.

      Manipulating Records

      @@ -949,7 +949,7 @@ examples provides additional information.

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include <tqsqlcursor.h>
           #include <tqdatatable.h>
      @@ -957,16 +957,16 @@ examples provides additional information.
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               if ( createConnections() ) {
                   TQSqlCursor staffCursor( "staff" );
                   TQDataTable *staffTable = new TQDataTable( &staffCursor, TRUE );
      -            app.setMainWidget( staffTable );
      +            app.setMainWidget( staffTable );
                   staffTable->refresh();
                   staffTable->show();
       
      -            return app.exec();
      +            return app.exec();
               }
       
               return 0;
      @@ -987,7 +987,7 @@ function.
       
                  TQSqlCursor staffCursor( "staff" );
                   TQDataTable *staffTable = new TQDataTable( &staffCursor );
       
      -            app.setMainWidget( staffTable );
      +            app.setMainWidget( staffTable );
       
                   staffTable->addColumn( "forename", "Forename" );
                   staffTable->addColumn( "surname",  "Surname" );
      @@ -1022,7 +1022,7 @@ the code below can be automatically generated by 
       
       

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqdialog.h>
           #include <tqlabel.h>
           #include <tqlayout.h>
      @@ -1070,15 +1070,15 @@ the code below can be automatically generated by 
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               if ( ! createConnections() ) return 1;
       
               FormDialog *formDialog = new FormDialog();
               formDialog->show();
      -        app.setMainWidget( formDialog );
      +        app.setMainWidget( formDialog );
       
      -        return app.exec();
      +        return app.exec();
           }
       

      From sql/overview/form1/main.cpp

      @@ -1420,7 +1420,7 @@ staffTable from being a TQDataTable to being a CustomTable.

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include <tqsqldatabase.h>
           #include <tqsqlcursor.h>
           #include <tqdatatable.h>
      @@ -1428,14 +1428,14 @@ staffTable from being a TQDataTable to being a CustomTable.
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               if ( createConnections() ) {
                   TQSqlCursor invoiceItemCursor( "invoiceitem" );
       
                   TQDataTable *invoiceItemTable = new TQDataTable( &invoiceItemCursor );
       
      -            app.setMainWidget( invoiceItemTable );
      +            app.setMainWidget( invoiceItemTable );
       
                   invoiceItemTable->addColumn( "pricesid", "PriceID" );
                   invoiceItemTable->addColumn( "quantity", "Quantity" );
      @@ -1444,7 +1444,7 @@ staffTable from being a TQDataTable to being a CustomTable.
                   invoiceItemTable->refresh();
                   invoiceItemTable->show();
       
      -            return app.exec();
      +            return app.exec();
               }
       
               return 1;
      diff --git a/doc/html/sqltable-example.html b/doc/html/sqltable-example.html
      index 394d4fa48..aed386f19 100644
      --- a/doc/html/sqltable-example.html
      +++ b/doc/html/sqltable-example.html
      @@ -44,7 +44,7 @@ This example shows how to use a TQDataTable to br
       **
       *****************************************************************************/
       
      -#include <ntqapplication.h>
      +#include <tqapplication.h>
       #include <tqsqldatabase.h>
       #include <tqdatatable.h>
       #include <tqsqlcursor.h>
      @@ -75,7 +75,7 @@ protected:
       
       int main( int argc, char ** argv )
       {
      -    TQApplication a( argc, argv );
      +    TQApplication a( argc, argv );
       
           TQSqlDatabase * db = TQSqlDatabase::addDatabase( DRIVER );
           db->setDatabaseName( DATABASE );
      @@ -100,11 +100,11 @@ int main( int argc, char ** argv )
           table.addColumn( "address", "Address" );
           table.setSorting( TRUE );
       
      -    a.setMainWidget( &table );
      +    a.setMainWidget( &table );
           table.refresh(); /* load data */
           table.show();    /* show widget */
       
      -    return a.exec();
      +    return a.exec();
       }
       
      diff --git a/doc/html/statistics-example.html b/doc/html/statistics-example.html index 48896710b..56275aa95 100644 --- a/doc/html/statistics-example.html +++ b/doc/html/statistics-example.html @@ -279,15 +279,15 @@ void Table::recalcSum( int, int col ) *****************************************************************************/ #include "statistics.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main( int argc, char **argv ) { - TQApplication a(argc,argv); + TQApplication a(argc,argv); Table t; - a.setMainWidget( &t ); + a.setMainWidget( &t ); t.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/t10-lcdrange-cpp.html b/doc/html/t10-lcdrange-cpp.html index 2c1045434..3eae6bcbf 100644 --- a/doc/html/t10-lcdrange-cpp.html +++ b/doc/html/t10-lcdrange-cpp.html @@ -70,7 +70,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t10-main-cpp.html b/doc/html/t10-main-cpp.html index 7d474eba6..1d62d97fb 100644 --- a/doc/html/t10-main-cpp.html +++ b/doc/html/t10-main-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> #include <tqfont.h> @@ -60,7 +60,7 @@ public: TQPushButton *quit = new TQPushButton( "&Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( this, "angle" ); angle->setRange( 5, 70 ); @@ -97,14 +97,14 @@ public: int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication a( argc, argv ); MyWidget w; w.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t11-lcdrange-cpp.html b/doc/html/t11-lcdrange-cpp.html index 40760e2e6..55d67cedb 100644 --- a/doc/html/t11-lcdrange-cpp.html +++ b/doc/html/t11-lcdrange-cpp.html @@ -70,7 +70,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t11-main-cpp.html b/doc/html/t11-main-cpp.html index 735afb93f..4d1432f8b 100644 --- a/doc/html/t11-main-cpp.html +++ b/doc/html/t11-main-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> #include <tqfont.h> @@ -60,7 +60,7 @@ public: TQPushButton *quit = new TQPushButton( "&Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( this, "angle" ); angle->setRange( 5, 70 ); @@ -107,14 +107,14 @@ public: int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication a( argc, argv ); MyWidget w; w.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t12-lcdrange-cpp.html b/doc/html/t12-lcdrange-cpp.html index d7fb4a798..4f95640e4 100644 --- a/doc/html/t12-lcdrange-cpp.html +++ b/doc/html/t12-lcdrange-cpp.html @@ -100,7 +100,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t12-main-cpp.html b/doc/html/t12-main-cpp.html index bfe3190aa..fbba608f5 100644 --- a/doc/html/t12-main-cpp.html +++ b/doc/html/t12-main-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> #include <tqfont.h> @@ -60,7 +60,7 @@ public: TQPushButton *quit = new TQPushButton( "&Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( "ANGLE", this, "angle" ); angle->setRange( 5, 70 ); @@ -107,14 +107,14 @@ public: int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication a( argc, argv ); MyWidget w; w.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t13-gamebrd-cpp.html b/doc/html/t13-gamebrd-cpp.html index 18971f888..d5c507914 100644 --- a/doc/html/t13-gamebrd-cpp.html +++ b/doc/html/t13-gamebrd-cpp.html @@ -40,7 +40,7 @@ body { background: #ffffff; color: black; } #include "gamebrd.h" #include <tqfont.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlabel.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> @@ -55,7 +55,7 @@ body { background: #ffffff; color: black; } TQPushButton *quit = new TQPushButton( "&Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( "ANGLE", this, "angle" ); angle->setRange( 5, 70 ); diff --git a/doc/html/t13-lcdrange-cpp.html b/doc/html/t13-lcdrange-cpp.html index d3307f759..f76139af2 100644 --- a/doc/html/t13-lcdrange-cpp.html +++ b/doc/html/t13-lcdrange-cpp.html @@ -105,7 +105,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t13-main-cpp.html b/doc/html/t13-main-cpp.html index 34d886bb0..553af9c66 100644 --- a/doc/html/t13-main-cpp.html +++ b/doc/html/t13-main-cpp.html @@ -37,21 +37,21 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "gamebrd.h" int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication a( argc, argv ); GameBoard gb; gb.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &gb ); + a.setMainWidget( &gb ); gb.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t14-gamebrd-cpp.html b/doc/html/t14-gamebrd-cpp.html index c6a8a1e86..1186c66af 100644 --- a/doc/html/t14-gamebrd-cpp.html +++ b/doc/html/t14-gamebrd-cpp.html @@ -40,7 +40,7 @@ body { background: #ffffff; color: black; } #include "gamebrd.h" #include <tqfont.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqlabel.h> #include <tqaccel.h> #include <tqpushbutton.h> @@ -57,7 +57,7 @@ body { background: #ffffff; color: black; } TQPushButton *quit = new TQPushButton( "&Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( "ANGLE", this, "angle" ); angle->setRange( 5, 70 ); @@ -111,7 +111,7 @@ body { background: #ffffff; color: black; } accel->connectItem( accel->insertItem( Key_Return ), this, TQ_SLOT(fire()) ); accel->connectItem( accel->insertItem( CTRL+Key_Q ), - tqApp, TQ_SLOT(quit()) ); + tqApp, TQ_SLOT(quit()) ); TQGridLayout *grid = new TQGridLayout( this, 2, 2, 10 ); grid->addWidget( quit, 0, 0 ); diff --git a/doc/html/t14-lcdrange-cpp.html b/doc/html/t14-lcdrange-cpp.html index 939eeb984..94478429e 100644 --- a/doc/html/t14-lcdrange-cpp.html +++ b/doc/html/t14-lcdrange-cpp.html @@ -105,7 +105,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t14-main-cpp.html b/doc/html/t14-main-cpp.html index 9bf4b856f..fcd0b0ae3 100644 --- a/doc/html/t14-main-cpp.html +++ b/doc/html/t14-main-cpp.html @@ -37,21 +37,21 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "gamebrd.h" int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication a( argc, argv ); GameBoard gb; gb.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &gb ); + a.setMainWidget( &gb ); gb.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t7-main-cpp.html b/doc/html/t7-main-cpp.html index 34e90556d..01c71e433 100644 --- a/doc/html/t7-main-cpp.html +++ b/doc/html/t7-main-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> #include <tqfont.h> @@ -60,7 +60,7 @@ public: TQPushButton *quit = new TQPushButton( "Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); TQGrid *grid = new TQGrid( 4, this ); @@ -79,12 +79,12 @@ public: int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MyWidget w; - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t8-lcdrange-cpp.html b/doc/html/t8-lcdrange-cpp.html index 0ce51d8b3..865416902 100644 --- a/doc/html/t8-lcdrange-cpp.html +++ b/doc/html/t8-lcdrange-cpp.html @@ -70,7 +70,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t8-main-cpp.html b/doc/html/t8-main-cpp.html index af7c74b1a..ff85a584c 100644 --- a/doc/html/t8-main-cpp.html +++ b/doc/html/t8-main-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> #include <tqfont.h> @@ -60,7 +60,7 @@ public: TQPushButton *quit = new TQPushButton( "Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( this, "angle" ); angle->setRange( 5, 70 ); @@ -88,13 +88,13 @@ public: int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MyWidget w; w.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/t9-lcdrange-cpp.html b/doc/html/t9-lcdrange-cpp.html index a239019af..8bc9fe0c0 100644 --- a/doc/html/t9-lcdrange-cpp.html +++ b/doc/html/t9-lcdrange-cpp.html @@ -70,7 +70,7 @@ void LCDRange::setValue( int value ) void LCDRange::setRange( int minVal, int maxVal ) { if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) { - tqWarning( "LCDRange::setRange(%d,%d)\n" + tqWarning( "LCDRange::setRange(%d,%d)\n" "\tRange must be 0..99\n" "\tand minVal must not be greater than maxVal", minVal, maxVal ); diff --git a/doc/html/t9-main-cpp.html b/doc/html/t9-main-cpp.html index b92b3e4f2..2c4c63ef6 100644 --- a/doc/html/t9-main-cpp.html +++ b/doc/html/t9-main-cpp.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqlcdnumber.h> #include <tqfont.h> @@ -60,7 +60,7 @@ public: TQPushButton *quit = new TQPushButton( "&Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); LCDRange *angle = new LCDRange( this, "angle" ); angle->setRange( 5, 70 ); @@ -84,14 +84,14 @@ public: int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication a( argc, argv ); MyWidget w; w.setGeometry( 100, 100, 500, 355 ); - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }


      diff --git a/doc/html/tabdialog-example.html b/doc/html/tabdialog-example.html index cd9dcedef..d5e407bb6 100644 --- a/doc/html/tabdialog-example.html +++ b/doc/html/tabdialog-example.html @@ -96,7 +96,7 @@ protected: #include <tqbuttongroup.h> #include <tqcheckbox.h> #include <tqlistbox.h> -#include <ntqapplication.h> +#include <tqapplication.h> TabDialog::TabDialog( TQWidget *parent, const char *name, const TQString &_filename ) : TQTabDialog( parent, name ), filename( _filename ), fileinfo( filename ) @@ -105,7 +105,7 @@ protected: setupTab2(); setupTab3(); - connect( this, TQ_SIGNAL( applyButtonPressed() ), tqApp, TQ_SLOT( quit() ) ); + connect( this, TQ_SIGNAL( applyButtonPressed() ), tqApp, TQ_SLOT( quit() ) ); } void TabDialog::setupTab1() @@ -203,21 +203,21 @@ void TabDialog::setupTab3() *****************************************************************************/ #include "tabdialog.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqstring.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TabDialog tabdialog( 0, "tabdialog", TQString( argc < 2 ? "." : argv[1] ) ); tabdialog.resize( 450, 350 ); tabdialog.setCaption( "TQt Example - Tabbed Dialog" ); - a.setMainWidget( &tabdialog ); + a.setMainWidget( &tabdialog ); tabdialog.show(); - return a.exec(); + return a.exec(); }
      diff --git a/doc/html/table-bigtable-main-cpp.html b/doc/html/table-bigtable-main-cpp.html index 5c89ca113..3a04306c3 100644 --- a/doc/html/table-bigtable-main-cpp.html +++ b/doc/html/table-bigtable-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqtable.h> // Table size @@ -88,12 +88,12 @@ private: int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); MyTable table( numRows, numCols ); - app.setMainWidget( &table ); + app.setMainWidget( &table ); table.show(); - return app.exec(); + return app.exec(); }


      diff --git a/doc/html/table-small-table-demo-main-cpp.html b/doc/html/table-small-table-demo-main-cpp.html index 5d2fc3d8e..a7015224d 100644 --- a/doc/html/table-small-table-demo-main-cpp.html +++ b/doc/html/table-small-table-demo-main-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqtable.h> #include <tqimage.h> #include <tqpixmap.h> @@ -59,7 +59,7 @@ const int numCols = 10; int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); TQTable table( numRows, numCols ); @@ -85,9 +85,9 @@ int main( int argc, char **argv ) for ( int j = 0; j < numRows; ++j ) table.setItem( j, 1, new TQCheckTableItem( &table, "Check me" ) ); - app.setMainWidget( &table ); + app.setMainWidget( &table ); table.show(); - return app.exec(); + return app.exec(); }


      diff --git a/doc/html/tagreader-with-features-example.html b/doc/html/tagreader-with-features-example.html index 1e82f3144..0e70aee56 100644 --- a/doc/html/tagreader-with-features-example.html +++ b/doc/html/tagreader-with-features-example.html @@ -150,7 +150,7 @@ void StructureParser::setListView( *****************************************************************************/ #include "structureparser.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqfile.h> #include <tqxml.h> #include <tqlistview.h> @@ -160,7 +160,7 @@ void StructureParser::setListView( int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); TQFile xmlFile( argc == 2 ? argv[1] : "fnord.xml" ); TQXmlInputSource source( &xmlFile ); @@ -210,9 +210,9 @@ int main( int argc, char **argv ) container ); - app.setMainWidget( container ); + app.setMainWidget( container ); container->show(); - return app.exec(); + return app.exec(); } diff --git a/doc/html/tetrix-example.html b/doc/html/tetrix-example.html index 4dffee843..0e5ae8aa8 100644 --- a/doc/html/tetrix-example.html +++ b/doc/html/tetrix-example.html @@ -51,14 +51,14 @@ This is the TQt implementation of the well known game Tetris. int main( int argc, char **argv ) { - TQApplication::setColorSpec( TQApplication::CustomColor ); + TQApplication::setColorSpec( TQApplication::CustomColor ); TQDragApplication a(argc,argv); TQTetrix *tetrix = new TQTetrix; tetrix->setCaption("Tetrix"); - a.setMainWidget(tetrix); + a.setMainWidget(tetrix); tetrix->setCaption("TQt Example - Tetrix"); tetrix->show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/themes-example.html b/doc/html/themes-example.html index aa6b313f8..c78ce1e67 100644 --- a/doc/html/themes-example.html +++ b/doc/html/themes-example.html @@ -67,10 +67,10 @@ class NorwegianWoodStyle : public TQWindowsStyleTQApplication*); + void polish( TQApplication*); void polish( TQWidget* ); void unPolish( TQWidget* ); - void unPolish( TQApplication*); + void unPolish( TQApplication*); void drawPrimitive( PrimitiveElement pe, TQPainter *p, @@ -147,7 +147,7 @@ private: #ifndef TQT_NO_STYLE_WINDOWS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcombobox.h" #include "tqpainter.h" #include "tqdrawutil.h" // for now @@ -905,10 +905,10 @@ enum { PointUp, PointDown, PointLeft, PointRight }; /*! Reimplementation from TQStyle */ -void NorwegianWoodStyle::polish( TQApplication *app) +void NorwegianWoodStyle::polish( TQApplication *app) { - oldPalette = app->palette(); + oldPalette = app->palette(); // we simply create a nice TQColorGroup with a couple of fancy wood // pixmaps here and apply to it all widgets @@ -1005,13 +1005,13 @@ enum { PointUp, PointDown, PointLeft, PointRight }; TQBrush(op.disabled().background(), background) ); - app->setPalette(TQPalette(active, disabled, active), TRUE ); + app->setPalette(TQPalette(active, disabled, active), TRUE ); } -void NorwegianWoodStyle::unPolish( TQApplication *app) +void NorwegianWoodStyle::unPolish( TQApplication *app) { - app->setPalette(oldPalette, TRUE); + app->setPalette(oldPalette, TRUE); } /*! @@ -1581,8 +1581,8 @@ class MetalStyle : public TQWindowsStyle { public: MetalStyle(); - void polish( TQApplication*); - void unPolish( TQApplication*); + void polish( TQApplication*); + void unPolish( TQApplication*); void polish( TQWidget* ); void unPolish( TQWidget* ); @@ -1643,7 +1643,7 @@ private: #ifndef TQT_NO_STYLE_WINDOWS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcombobox.h" #include "tqpainter.h" #include "tqdrawutil.h" // for now @@ -1673,18 +1673,18 @@ private: /*! Reimplementation from TQStyle */ -void MetalStyle::polish( TQApplication *app) +void MetalStyle::polish( TQApplication *app) { - oldPalette = app->palette(); + oldPalette = app->palette(); // we simply create a nice TQColorGroup with a couple of fancy // pixmaps here and apply to it all widgets - TQFont f("times", app->font().pointSize() ); + TQFont f("times", app->font().pointSize() ); f.setBold( TRUE ); f.setItalic( TRUE ); - app->setFont( f, TRUE, "TQMenuBar"); - app->setFont( f, TRUE, "TQPopupMenu"); + app->setFont( f, TRUE, "TQMenuBar"); + app->setFont( f, TRUE, "TQPopupMenu"); @@ -1698,7 +1698,7 @@ private: TQPixmap mid( stone1_xpm ); TQPixmap light( stone1_xpm );//1, 1 ); light.fill( green ); - TQPalette op = app->palette(); + TQPalette op = app->palette(); TQColor backCol( 227,227,227 ); @@ -1727,16 +1727,16 @@ private: ); TQPalette newPalette( active, disabled, active ); - app->setPalette( newPalette, TRUE ); + app->setPalette( newPalette, TRUE ); } /*! Reimplementation from TQStyle */ -void MetalStyle::unPolish( TQApplication *app) +void MetalStyle::unPolish( TQApplication *app) { - app->setPalette(oldPalette, TRUE); - app->setFont( app->font(), TRUE ); + app->setPalette(oldPalette, TRUE); + app->setFont( app->font(), TRUE ); } /*! @@ -2186,7 +2186,7 @@ private: #include "../richtext/richtext.h" #include <tqtabwidget.h> -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpopupmenu.h> #include <tqmenubar.h> #include <tqmessagebox.h> @@ -2199,7 +2199,7 @@ private: Themes::Themes( TQWidget *parent, const char *name, WFlags f ) : TQMainWindow( parent, name, f ) { - appFont = TQApplication::font(); + appFont = TQApplication::font(); tabwidget = new TQTabWidget( this ); tabwidget->addTab( new ButtonsGroups( tabwidget ), "Buttons/Groups" ); @@ -2252,7 +2252,7 @@ private: } ag->addTo(style); style->insertSeparator(); - style->insertItem("&Quit", tqApp, TQ_SLOT( quit() ), CTRL | Key_Q ); + style->insertItem("&Quit", tqApp, TQ_SLOT( quit() ), CTRL | Key_Q ); TQPopupMenu * help = new TQPopupMenu( this ); menuBar()->insertSeparator(); @@ -2261,7 +2261,7 @@ private: help->insertItem( "About &TQt", this, TQ_SLOT(aboutTQt())); #ifndef TQT_NO_STYLE_WINDOWS - tqApp->setStyle( new NorwegianWoodStyle ); + tqApp->setStyle( new NorwegianWoodStyle ); #endif } @@ -2269,20 +2269,20 @@ void Themes::makeStyle(const TQString { if(style == "Norwegian Wood") { #ifndef TQT_NO_STYLE_WINDOWS - tqApp->setStyle( new NorwegianWoodStyle ); + tqApp->setStyle( new NorwegianWoodStyle ); #endif } else if( style == "Metal" ) { #ifndef TQT_NO_STYLE_WINDOWS - tqApp->setStyle( new MetalStyle ); + tqApp->setStyle( new MetalStyle ); #endif } else { - tqApp->setStyle(style); + tqApp->setStyle(style); if(style == "Platinum") { TQPalette p( TQColor( 239, 239, 239 ) ); - tqApp->setPalette( p, TRUE ); - tqApp->setFont( appFont, TRUE ); + tqApp->setPalette( p, TRUE ); + tqApp->setFont( appFont, TRUE ); } else if(style == "Windows") { - tqApp->setFont( appFont, TRUE ); + tqApp->setFont( appFont, TRUE ); } else if(style == "CDE") { TQPalette p( TQColor( 75, 123, 130 ) ); p.setColor( TQPalette::Active, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); @@ -2303,12 +2303,12 @@ void Themes::makeStyle(const TQString p.setColor( TQPalette::Disabled, TQColorGroup::Foreground, TQt::lightGray ); p.setColor( TQPalette::Disabled, TQColorGroup::Text, TQt::lightGray ); p.setColor( TQPalette::Disabled, TQColorGroup::ButtonText, TQt::lightGray ); - tqApp->setPalette( p, TRUE ); - tqApp->setFont( TQFont( "times", appFont.pointSize() ), TRUE ); + tqApp->setPalette( p, TRUE ); + tqApp->setFont( TQFont( "times", appFont.pointSize() ), TRUE ); } else if(style == "Motif" || style == "MotifPlus") { TQPalette p( TQColor( 192, 192, 192 ) ); - tqApp->setPalette( p, TRUE ); - tqApp->setFont( appFont, TRUE ); + tqApp->setPalette( p, TRUE ); + tqApp->setFont( appFont, TRUE ); } } } @@ -2342,7 +2342,7 @@ void Themes::aboutTQt() ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqwindowsstyle.h> #include "themes.h" @@ -2350,16 +2350,16 @@ void Themes::aboutTQt() int main( int argc, char ** argv ) { - TQApplication::setColorSpec( TQApplication::ManyColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::ManyColor ); + TQApplication a( argc, argv ); Themes themes; themes.setCaption( "TQt Example - Themes (TQStyle)" ); themes.resize( 640, 400 ); - a.setMainWidget( &themes ); + a.setMainWidget( &themes ); themes.show(); - return a.exec(); + return a.exec(); } diff --git a/doc/html/threads.html b/doc/html/threads.html index 9d4444352..492080901 100644 --- a/doc/html/threads.html +++ b/doc/html/threads.html @@ -82,7 +82,7 @@ against this library (with -ltqt-mt) rather than the standard TQt library.

      On both platforms, you should compile with the macro TQT_THREAD_SUPPORT defined (e.g. compile with -DTQT_THREAD_SUPPORT). On Windows, this is usually done by an -entry in ntqconfig.h. +entry in tqconfig.h.

      The Thread Classes

      These classes are built into the TQt library when thread support is enabled: @@ -184,8 +184,8 @@ mutex must be used:

      Thread-safe Event Posting

      In TQt, one thread is always the GUI or event thread. This is the -thread that creates a TQApplication object and calls -TQApplication::exec(). This is also the initial thread that calls +thread that creates a TQApplication object and calls +TQApplication::exec(). This is also the initial thread that calls main() at program start. This thread is the only thread that is allowed to perform GUI operations, including generating and receiving events from the window system. TQt does not support creating @@ -194,7 +194,7 @@ a secondary thread. You must create the TQApplication object and call TQApplication::exec() from the main() function in your program.

      Threads that wish to display data in a widget cannot modify the widget directly, so they must post an event to the widget using -TQApplication::postEvent(). The event will be delivered later on by +TQApplication::postEvent(). The event will be delivered later on by the GUI thread.

      Normally, the programmer would like to include some information in the event sent to the widget. See the documentation for TQCustomEvent for @@ -226,7 +226,7 @@ delivered to the object.

      The TQt Library Mutex

      -

      TQApplication includes a mutex that is used to protect access to window +

      TQApplication includes a mutex that is used to protect access to window system functions. This mutex is locked while the event loop is running (e.g. during event delivery) and unlocked when the eventloop goes to sleep. Note: The TQt event loop is recursive, and the library @@ -238,7 +238,7 @@ operations. Operations such as creating a TQPainter

           ...
      -    tqApp->lock();
      +    tqApp->lock();
       
           TQPainter p;
           p.begin( mywidget );
      @@ -246,7 +246,7 @@ are examples of simple GUI operations:
           p.drawLine( 0,0,100,100 );
           p.end();
       
      -    tqApp->unlock();
      +    tqApp->unlock();
           ...
       
      @@ -314,8 +314,8 @@ library, you should not link with the normal TQt library, dynamically load the normal TQt library or dynamically load another library or plugin that depends on the normal TQt library. On some systems, doing this can corrupt the static data used in the TQt library. -

    • TQt does not support creating TQApplication and running the event -loop (with TQApplication::exec()) in a secondary thread. You must +

    • TQt does not support creating TQApplication and running the event +loop (with TQApplication::exec()) in a secondary thread. You must create the TQApplication object and call TQApplication::exec() from the main() function in your program.

    diff --git a/doc/html/tictac-example.html b/doc/html/tictac-example.html index 5cc4714a2..a9945bffd 100644 --- a/doc/html/tictac-example.html +++ b/doc/html/tictac-example.html @@ -162,7 +162,7 @@ private: *****************************************************************************/ #include "tictac.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpainter.h> #include <tqdrawutil.h> #include <tqcombobox.h> @@ -478,7 +478,7 @@ void TicTacGameBoard::computerMove() newGame = new TQPushButton( "Play!", this ); connect( newGame, TQ_SIGNAL(clicked()), TQ_SLOT(newGameClicked()) ); quit = new TQPushButton( "Quit", this ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); TQHBoxLayout * b = new TQHBoxLayout; l->addLayout( b ); b->addWidget( newGame ); @@ -541,26 +541,26 @@ void TicTacToe::newState() ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <stdlib.h> #include "tictac.h" int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); int n = 3; if ( argc == 2 ) // get board size n n = atoi(argv[1]); if ( n < 3 || n > 10 ) { // out of range - tqWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] ); + tqWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] ); return 1; } TicTacToe ttt( n ); // create game - a.setMainWidget( &ttt ); + a.setMainWidget( &ttt ); ttt.setCaption("TQt Example - TicTac"); ttt.show(); // show widget - return a.exec(); // go + return a.exec(); // go } diff --git a/doc/html/timers.html b/doc/html/timers.html index 4bfcf5848..ce6865026 100644 --- a/doc/html/timers.html +++ b/doc/html/timers.html @@ -39,7 +39,7 @@ unique integer timer id. The timer will now "fire" every interval milliseconds, until you explicitly call TQObject::killTimer() with the timer id.

    For this mechanism to work, the application must run in an event -loop. You start an event loop with TQApplication::exec(). When a +loop. You start an event loop with TQApplication::exec(). When a timer fires, the application sends a TQTimerEvent, and the flow of control leaves the event loop until the timer event is processed. This implies that a timer cannot fire while your application is busy doing diff --git a/doc/html/titleindex b/doc/html/titleindex index 5e2f9628d..42c5f2882 100644 --- a/doc/html/titleindex +++ b/doc/html/titleindex @@ -140,8 +140,8 @@ TQAction Examples | tqaction-examples.html TQAction Member List | tqaction-members.html TQActionGroup Class | tqactiongroup.html TQActionGroup Member List | tqactiongroup-members.html -QApplication Class | ntqapplication.html -QApplication Member List | qapplication-members.html +TQApplication Class | tqapplication.html +TQApplication Member List | tqapplication-members.html TQAsciiCache Class | tqasciicache.html TQAsciiCache Member List | tqasciicache-members.html TQAsciiCacheIterator Class | tqasciicacheiterator.html @@ -1039,7 +1039,7 @@ iconview/simple_dd/main.h Example File | iconview-simple_dd-main-h.html tqaccel.h Include File | tqaccel-h.html tqaccessible.h Include File | tqaccessible-h.html tqaction.h Include File | tqaction-h.html -ntqapplication.h Include File | qapplication-h.html +tqapplication.h Include File | tqapplication-h.html tqasciicache.h Include File | tqasciicache-h.html tqasciidict.h Include File | tqasciidict-h.html tqassistantclient.h Include File | tqassistantclient-h.html diff --git a/doc/html/toggleaction-example.html b/doc/html/toggleaction-example.html index 3c1a5ce00..38c0e93a1 100644 --- a/doc/html/toggleaction-example.html +++ b/doc/html/toggleaction-example.html @@ -36,7 +36,7 @@ body { background: #ffffff; color: black; } in its incarnation as a toggle action.


    Main: -

    #include <ntqapplication.h>
    +

    #include <tqapplication.h>
     #include <tqmainwindow.h>
     #include <tqtoolbar.h>
     #include <tqaction.h>
    @@ -45,7 +45,7 @@ in its incarnation as a toggle action.
     
     int main( int argc, char **argv )
     {
    -    TQApplication app( argc, argv );
    +    TQApplication app( argc, argv );
         TQMainWindow * window = new TQMainWindow;
         window->setCaption("TQt Example - Toggleaction");
         TQToolBar * toolbar = new TQToolBar( window );
    @@ -62,9 +62,9 @@ int main( int argc, char **argv )
     
         labelonoffaction->addTo( toolbar );
     
    -    app.setMainWidget( window );
    +    app.setMainWidget( window );
         window->show();
    -    return app.exec();
    +    return app.exec();
     }
     
     
    diff --git a/doc/html/tools.html b/doc/html/tools.html index aced757fd..b0ccda8c0 100644 --- a/doc/html/tools.html +++ b/doc/html/tools.html @@ -33,7 +33,7 @@ body { background: #ffffff; color: black; }

    The non-GUI classes are general-purpose collection and string classes that may be used independently of the GUI classes. -

    In particular, these classes do not depend on TQApplication at all, +

    In particular, these classes do not depend on TQApplication at all, and so can be used in non-GUI programs.

    See also the introduction to the TQt collection classes. diff --git a/doc/html/tooltip-example.html b/doc/html/tooltip-example.html index c978d1460..a4ab7b73b 100644 --- a/doc/html/tooltip-example.html +++ b/doc/html/tooltip-example.html @@ -98,7 +98,7 @@ private: *****************************************************************************/ #include "tooltip.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpainter.h> #include <stdlib.h> @@ -218,19 +218,19 @@ TQRect TellMe::tip( const TQPoint ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include "tooltip.h" int main( int argc, char ** argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TellMe mw; mw.setCaption( "TQt Example - Dynamic Tool Tips" ); - a.setMainWidget( &mw ); + a.setMainWidget( &mw ); mw.show(); - return a.exec(); + return a.exec(); }

    diff --git a/doc/html/toplevel-example.html b/doc/html/toplevel-example.html index 6aaa08474..ab5d266c6 100644 --- a/doc/html/toplevel-example.html +++ b/doc/html/toplevel-example.html @@ -50,12 +50,12 @@ tooltips and What's This help. Load the options.ui file into TQt Designer for more details.

    -

        #include <ntqapplication.h>
    +
        #include <tqapplication.h>
         #include "options.h"
     
         int main( int argc, char ** argv )
         {
    -        TQApplication a( argc, argv );
    +        TQApplication a( argc, argv );
             OptionsDialog dlg;
             return dlg.exec();
         }
    diff --git a/doc/html/tqaction-application-example.html b/doc/html/tqaction-application-example.html
    index 49560af19..42968e34f 100644
    --- a/doc/html/tqaction-application-example.html
    +++ b/doc/html/tqaction-application-example.html
    @@ -115,7 +115,7 @@ private:
     #include <tqstatusbar.h>
     #include <tqmessagebox.h>
     #include <tqprinter.h>
    -#include <ntqapplication.h>
    +#include <tqapplication.h>
     #include <tqaccel.h>
     #include <tqtextstream.h>
     #include <tqpainter.h>
    @@ -189,7 +189,7 @@ private:
         fileQuitAction = new TQAction( "Quit", "&Quit", CTRL+Key_Q, this,
                                       "quit" );
         connect( fileQuitAction, TQ_SIGNAL( activated() ) , tqApp,
    -             TQ_SLOT( closeAllWindows() ) );
    +             TQ_SLOT( closeAllWindows() ) );
     
         // populate a tool bar with some actions
     
    @@ -412,16 +412,16 @@ void ApplicationWindow::aboutTQt()
     **
     *****************************************************************************/
     
    -#include <ntqapplication.h>
    +#include <tqapplication.h>
     #include "application.h"
     
     int main( int argc, char ** argv ) {
    -    TQApplication a( argc, argv );
    +    TQApplication a( argc, argv );
         ApplicationWindow * mw = new ApplicationWindow();
         mw->setCaption( "Document 1" );
         mw->show();
    -    a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) );
    -    return a.exec();
    +    a.connect( &a, TQ_SIGNAL(lastWindowClosed()), &a, TQ_SLOT(quit()) );
    +    return a.exec();
     }
     
    diff --git a/doc/html/tqapplication-h.html b/doc/html/tqapplication-h.html new file mode 100644 index 000000000..f3bc3b9d1 --- /dev/null +++ b/doc/html/tqapplication-h.html @@ -0,0 +1,542 @@ + + + + +tqapplication.h Include File + + + + + + + +
    + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

    tqapplication.h

    + +

    This is the verbatim text of the tqapplication.h include file. It is provided only for illustration; the copyright remains with Trolltech. +


    +
    +/****************************************************************************
    +** $Id: qt/tqapplication.h   3.3.8   edited Jan 16 10:54 $
    +**
    +** Definition of TQApplication class
    +**
    +** Created : 931107
    +**
    +** Copyright (C) 1992-2007 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 file LICENSE.GPL included in the
    +** packaging of this file. Alternatively you may (at your option) use any
    +** later version of the GNU General Public License if such license has
    +** been publicly approved by Trolltech ASA (or its successors, if any)
    +** and the KDE Free TQt Foundation.
    +**
    +** Please review the following information to ensure GNU General
    +** Public Licensing requirements will be met:
    +** http://trolltech.com/products/qt/licenses/licensing/opensource/.
    +** If you are unsure which license is appropriate for your use, please
    +** review the following information:
    +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
    +** or contact the sales department at sales@trolltech.com.
    +**
    +** This file may be used under the terms of the Q Public License as
    +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
    +** included in the packaging of this file.  Licensees holding valid TQt
    +** Commercial licenses may use this file in accordance with the TQt
    +** Commercial License Agreement provided with the Software.
    +**
    +** This file is provided "AS IS" with NO 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 "tqdesktopwidget.h"
    +#include "tqasciidict.h"
    +#include "tqpalette.h"
    +#include "tqtranslator.h"
    +#include "tqstrlist.h"
    +#include "tqstringlist.h"
    +#endif // QT_H
    +
    +class TQSessionManager;
    +class TQStyle;
    +class TQTranslator;
    +class TQEventLoop;
    +
    +#ifdef TQT_THREAD_SUPPORT
    +class TQMutex;
    +#endif // TQT_THREAD_SUPPORT
    +
    +
    +class TQApplication;
    +extern TQ_EXPORT TQApplication *tqApp;		// global application object
    +
    +
    +class TQ_EXPORT TQApplication : public TQObject
    +{
    +    TQ_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(TQ_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 TQT_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 TQT_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 TQT_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 TQT_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 TQT_NO_TRANSLATION
    +# ifndef TQT_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 TQT_NO_DIR
    +    TQString   applicationDirPath();
    +    TQString   applicationFilePath();
    +#endif
    +#ifndef TQT_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 TQT_NO_WHEELEVENT
    +    static void      setWheelScrollLines( int );
    +    static int       wheelScrollLines();
    +#endif
    +    static void	     setGlobalStrut( const TQSize & );
    +    static TQSize     globalStrut();
    +
    +#ifndef TQT_NO_COMPONENT
    +    static void      setLibraryPaths( const TQStringList & );
    +    static TQStringList libraryPaths();
    +    static void      addLibraryPath( const TQString & );
    +    static void      removeLibraryPath( const TQString & );
    +#endif // TQT_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(TQ_WS_MAC)
    +    virtual bool     macEventFilter( EventHandlerCallRef, EventRef );
    +#endif
    +#if defined(TQ_WS_WIN)
    +    virtual bool     winEventFilter( MSG * );
    +#endif
    +#if defined(TQ_WS_X11)
    +    virtual bool     x11EventFilter( XEvent * );
    +    virtual int	     x11ClientMessage( TQWidget*, XEvent*, bool passive_only);
    +    int              x11ProcessEvent( XEvent* );
    +#endif
    +
    +#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN)
    +    static WindowsVersion winVersion();
    +#elif defined(Q_OS_MAC)
    +    static MacintoshVersion macVersion();
    +#endif
    +#if defined(TQ_WS_WIN)
    +    void	     winFocus( TQWidget *, bool );
    +    static void	     winMouseButtonUp();
    +#endif
    +
    +#ifndef TQT_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(TQ_WS_X11)
    +    static void create_xim();
    +    static void close_xim();
    +    static bool x11_apply_settings();
    +#endif
    +    void	     wakeUpGuiThread();
    +#if defined(TQT_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();
    +
    +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(TQ_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 tqt_init(int *, char **, TQApplication::Type);
    +#endif
    +
    +#ifdef TQT_THREAD_SUPPORT
    +    static TQMutex   *tqt_mutex;
    +#endif // TQT_THREAD_SUPPORT
    +
    +    int		     app_argc;
    +    char	   **app_argv;
    +    bool	     quit_now;
    +    int		     quit_code;
    +    static TQStyle   *app_style;
    +    static int	     app_cspec;
    +#ifndef TQT_NO_PALETTE
    +    static TQPalette *app_pal;
    +#endif
    +    static TQFont    *app_font;
    +#ifndef TQT_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<TQTranslator*> *translators;
    +#ifndef TQT_NO_SESSIONMANAGER
    +    TQSessionManager *session_manager;
    +    TQString	     session_id;
    +    static TQString* session_key;
    +    bool	     is_session_restored;
    +#endif
    +#if defined(TQ_WS_X11) && !defined (TQT_NO_STYLE )
    +    static void x11_initialize_style();
    +#endif
    +
    +    static TQSize     app_strut;
    +#ifndef TQT_NO_COMPONENT
    +    static TQStringList *app_libpaths;
    +#endif
    +    static TQAsciiDict<TQPalette> *app_palettes;
    +    static TQAsciiDict<TQFont>    *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 * );
    +
    +    friend class TQWidget;
    +    friend class TQETWidget;
    +    friend class TQDialog;
    +    friend class TQAccelManager;
    +    friend class TQEvent;
    +    friend class TQTranslator;
    +    friend class TQEventLoop;
    +    friend TQ_EXPORT void tqt_ucm_initialize( TQApplication * );
    +#if defined(TQ_WS_WIN)
    +    friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* );
    +#endif
    +private: // Disabled copy constructor and operator=
    +#if defined(TQ_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;
    +}
    +
    +#ifndef TQT_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 TQT_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 tqApp ? tqApp->notify( receiver, event ) : FALSE; }
    +
    +inline bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event )
    +{ if ( event ) event->spont = TRUE; return tqApp ? tqApp->notify( receiver, event ) : FALSE; }
    +
    +#ifdef TQT_NO_TRANSLATION
    +// Simple versions
    +inline TQString TQApplication::translate( const char *, const char *sourceText,
    +					const char *, Encoding encoding ) const
    +{
    +#ifndef TQT_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
    +
    +
    + +


    + +
    Copyright © 2007 +TrolltechTrademarks +
    TQt 3.3.8
    +
    + diff --git a/doc/html/tqapplication-members.html b/doc/html/tqapplication-members.html new file mode 100644 index 000000000..bcb60e10c --- /dev/null +++ b/doc/html/tqapplication-members.html @@ -0,0 +1,191 @@ + + + + +TQApplication Member List + + + + + + + +
    + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

    Complete Member List for TQApplication

    + +

    This is the complete list of member functions for +TQApplication, including inherited members. + +

    + +


    + +
    Copyright © 2007 +TrolltechTrademarks +
    TQt 3.3.8
    +
    + diff --git a/doc/html/tqapplication.html b/doc/html/tqapplication.html new file mode 100644 index 000000000..369c8ef6d --- /dev/null +++ b/doc/html/tqapplication.html @@ -0,0 +1,2000 @@ + + + + +TQApplication Class + + + + + + + +
    + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

    TQApplication Class Reference

    + +

    The TQApplication class manages the GUI application's control +flow and main settings. +More... +

    #include <tqapplication.h> +

    Inherits TQObject. +

    List of all member functions. +

    Public Members

    + +

    Public Slots

    + +

    Signals

    + +

    Static Public Members

    + +

    Related Functions

    + +

    Detailed Description

    + + +The TQApplication class manages the GUI application's control +flow and main settings. +

    + +

    It contains the main event loop, where all events from the window +system and other sources are processed and dispatched. It also +handles the application's initialization and finalization, and +provides session management. It also handles most system-wide and +application-wide settings. +

    For any GUI application that uses TQt, there is precisely one +TQApplication object, no matter whether the application has 0, 1, 2 +or more windows at any time. +

    The TQApplication object is accessible through the global pointer tqApp. Its main areas of responsibility are: +

      +

    • It initializes the application with the user's desktop settings +such as palette(), font() and doubleClickInterval(). It keeps track +of these properties in case the user changes the desktop globally, for +example through some kind of control panel. +

    • It performs event handling, meaning that it receives events +from the underlying window system and dispatches them to the relevant +widgets. By using sendEvent() and postEvent() you can send your own +events to widgets. +

    • It parses common command line arguments and sets its internal +state accordingly. See the constructor documentation below for more details about this. +

    • It defines the application's look and feel, which is +encapsulated in a TQStyle object. This can be changed at runtime +with setStyle(). +

    • It specifies how the application is to allocate colors. +See setColorSpec() for details. +

    • It provides localization of strings that are visible to the user +via translate(). +

    • It provides some magical objects like the desktop() and the +clipboard(). +

    • It knows about the application's windows. You can ask which +widget is at a certain position using widgetAt(), get a list of +topLevelWidgets() and closeAllWindows(), etc. +

    • It manages the application's mouse cursor handling, +see setOverrideCursor() and setGlobalMouseTracking(). +

    • On the X window system, it provides functions to flush and sync +the communication stream, see flushX() and syncX(). +

    • It provides support for sophisticated session management. This makes it possible +for applications to terminate gracefully when the user logs out, to +cancel a shutdown process if termination isn't possible and even to +preserve the entire application's state for a future session. See +isSessionRestored(), sessionId() and commitData() and saveState() +for details. +

    +

    The Application walk-through +example contains a typical complete main() that does the usual +things with TQApplication. +

    Since the TQApplication object does so much initialization, it +must be created before any other objects related to the user +interface are created. +

    Since it also deals with common command line arguments, it is +usually a good idea to create it before any interpretation or +modification of argv is done in the application itself. (Note +also that for X11, setMainWidget() may change the main widget +according to the -geometry option. To preserve this +functionality, you must set your defaults before setMainWidget() and +any overrides after.) +

    + + + + + + + + + + + +
    Groups of functions +
    System settings + +desktopSettingsAware(), +setDesktopSettingsAware(), +cursorFlashTime(), +setCursorFlashTime(), +doubleClickInterval(), +setDoubleClickInterval(), +wheelScrollLines(), +setWheelScrollLines(), +palette(), +setPalette(), +font(), +setFont(), +fontMetrics(). +
    Event handling + +exec(), +processEvents(), +enter_loop(), +exit_loop(), +exit(), +quit(). +sendEvent(), +postEvent(), +sendPostedEvents(), +removePostedEvents(), +hasPendingEvents(), +notify(), +macEventFilter(), +x11EventFilter(), +x11ProcessEvent(), +winEventFilter(). +
    GUI Styles + +style(), +setStyle(), +polish(). +
    Color usage + +colorSpec(), +setColorSpec(), +
    Text handling + +installTranslator(), +removeTranslator() +translate(). +
    Widgets + +mainWidget(), +setMainWidget(), +allWidgets(), +topLevelWidgets(), +desktop(), +activePopupWidget(), +activeModalWidget(), +clipboard(), +focusWidget(), +winFocus(), +activeWindow(), +widgetAt(). +
    Advanced cursor handling + +hasGlobalMouseTracking(), +setGlobalMouseTracking(), +overrideCursor(), +setOverrideCursor(), +restoreOverrideCursor(). +
    X Window System synchronization + +flushX(), +syncX(). +
    Session management + +isSessionRestored(), +sessionId(), +commitData(), +saveState(). +
    Threading + +lock(), unlock(), locked(), tryLock(), +wakeUpGuiThread() +
    Miscellaneous + +closeAllWindows(), +startingUp(), +closingDown(), +type(). +
    +

    Non-GUI programs: While TQt is not optimized or +designed for writing non-GUI programs, it's possible to use +some of its classes without creating a +TQApplication. This can be useful if you wish to share code between +a non-GUI server and a GUI client. + + + +

    See also Main Window and Related Classes. + +


    Member Type Documentation

    +

    TQApplication::ColorSpec

    + +
      +
    • TQApplication::NormalColor - the default color allocation policy +
    • TQApplication::CustomColor - the same as NormalColor for X11; allocates colors +to a palette on demand under Windows +
    • TQApplication::ManyColor - the right choice for applications that use thousands of +colors +

    See setColorSpec() for full details. + +

    TQApplication::Encoding

    +

    This enum type defines the 8-bit encoding of character string +arguments to translate(): +

      +
    • TQApplication::DefaultCodec - the encoding specified by +TQTextCodec::codecForTr() (Latin-1 if none has been set) +
    • TQApplication::UnicodeUTF8 - UTF-8 +

    See also TQObject::tr(), TQObject::trUtf8(), and TQString::fromUtf8(). + +

    TQApplication::Type

    + +
      +
    • TQApplication::Tty - a console application +
    • TQApplication::GuiClient - a GUI client application +
    • TQApplication::GuiServer - a GUI server application +
    +

    Member Function Documentation

    +

    TQApplication::TQApplication ( int & argc, char ** argv ) +

    +Initializes the window system and constructs an application object +with argc command line arguments in argv. +

    The global tqApp pointer refers to this application object. Only +one application object should be created. +

    This application object must be constructed before any paint devices (including widgets, pixmaps, bitmaps +etc.). +

    Note that argc and argv might be changed. TQt removes command +line arguments that it recognizes. The modified argc and argv +can also be accessed later with tqApp->argc() and tqApp->argv(). +The documentation for argv() contains a detailed description of how +to process command line arguments. +

    TQt debugging options (not available if TQt was compiled with the +TQT_NO_DEBUG flag defined): +

      +
    • -nograb, tells TQt that it must never grab the mouse or the keyboard. +
    • -dograb (only under X11), running under a debugger can cause +an implicit -nograb, use -dograb to override. +
    • -sync (only under X11), switches to synchronous mode for +debugging. +
    +

    See Debugging Techniques for a more +detailed explanation. +

    All TQt programs automatically support the following command line options: +

      +
    • -reverse causes text to be formatted for right-to-left languages +rather than in the usual left-to-right direction. +
    • -style= style, sets the application GUI style. Possible values +are motif, windows, and platinum. If you compiled TQt +with additional styles or have additional styles as plugins these +will be available to the -style command line option. +
    • -style style, is the same as listed above. +
    • -session= session, restores the application from an earlier +session. +
    • -session session, is the same as listed above. +
    • -widgetcount, prints debug message at the end about number of widgets left +undestroyed and maximum number of widgets existed at the same time +
    +

    The X11 version of TQt also supports some traditional X11 +command line options: +

      +
    • -display display, sets the X display (default is $DISPLAY). +
    • -geometry geometry, sets the client geometry of the +main widget. +
    • -fn or -font font, defines the application font. The +font should be specified using an X logical font description. +
    • -bg or -background color, sets the default background color +and an application palette (light and dark shades are calculated). +
    • -fg or -foreground color, sets the default foreground color. +
    • -btn or -button color, sets the default button color. +
    • -name name, sets the application name. +
    • -title title, sets the application title (caption). +
    • -visual TrueColor, forces the application to use a TrueColor visual +on an 8-bit display. +
    • -ncols count, limits the number of colors allocated in the +color cube on an 8-bit display, if the application is using the +TQApplication::ManyColor color specification. If count is +216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, +and 6 of blue); for other values, a cube +approximately proportional to a 2x3x1 cube is used. +
    • -cmap, causes the application to install a private color map +on an 8-bit display. +
    +

    See also argc() and argv(). + +

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

    +Constructs an application object with argc command line arguments +in argv. If GUIenabled is TRUE, a GUI application is +constructed, otherwise a non-GUI (console) application is created. +

    Set GUIenabled to FALSE for programs without a graphical user +interface that should be able to run without a window system. +

    On X11, the window system is initialized if GUIenabled is TRUE. +If GUIenabled is FALSE, the application does not connect to the +X-server. +On Windows and Macintosh, currently the window system is always +initialized, regardless of the value of GUIenabled. This may change in +future versions of TQt. +

    The following example shows how to create an application that +uses a graphical interface when available. +

    +  int main( int argc, char **argv )
    +  {
    +#ifdef TQ_WS_X11
    +    bool useGUI = getenv( "DISPLAY" ) != 0;
    +#else
    +    bool useGUI = TRUE;
    +#endif
    +    TQApplication app(argc, argv, useGUI);
    +
    +    if ( useGUI ) {
    +       //start GUI version
    +       ...
    +    } else {
    +       //start non-GUI version
    +       ...
    +    }
    +    return app.exec();
    +  }
    +
    + + +

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

    +Constructs an application object with argc command line arguments +in argv. + +

    TQApplication::TQApplication ( Display * dpy, HANDLE visual = 0, HANDLE colormap = 0 ) +

    +Create an application, given an already open display dpy. If visual and colormap are non-zero, the application will use those as +the default Visual and Colormap contexts. +

    Warning: TQt only supports TrueColor visuals at depths higher than 8 +bits-per-pixel. +

    This is available only on X11. + +

    TQApplication::TQApplication ( Display * dpy, int argc, char ** argv, HANDLE visual = 0, HANDLE colormap = 0 ) +

    +Create an application, given an already open display dpy and using +argc command line arguments in argv. If visual and colormap are non-zero, the application will use those as +the default Visual and Colormap contexts. +

    Warning: TQt only supports TrueColor visuals at depths higher than 8 +bits-per-pixel. +

    This is available only on X11. +

    +

    TQApplication::~TQApplication () [virtual] +

    +Cleans up any window system resources that were allocated by this +application. Sets the global variable tqApp to 0. + +

    void TQApplication::aboutTQt () [slot] +

    +Displays a simple message box about TQt. The message includes the +version number of TQt being used by the application. +

    This is useful for inclusion in the Help menu of an application. +See the examples/menu/menu.cpp example. +

    This function is a convenience slot for TQMessageBox::aboutTQt(). + +

    void TQApplication::aboutToQuit () [signal] +

    + +

    This signal is emitted when the application is about to quit the +main event loop, e.g. when the event loop level drops to zero. +This may happen either after a call to quit() from inside the +application or when the users shuts down the entire desktop session. +

    The signal is particularly useful if your application has to do some +last-second cleanup. Note that no user interaction is possible in +this state. +

    See also quit(). + +

    TQWidget * TQApplication::activeModalWidget () [static] +

    +Returns the active modal widget. +

    A modal widget is a special top level widget which is a subclass of +TQDialog that specifies the modal parameter of the constructor as +TRUE. A modal widget must be closed before the user can continue +with other parts of the program. +

    Modal widgets are organized in a stack. This function returns +the active modal widget at the top of the stack. +

    See also activePopupWidget() and topLevelWidgets(). + +

    TQWidget * TQApplication::activePopupWidget () [static] +

    +Returns the active popup widget. +

    A popup widget is a special top level widget that sets the WType_Popup widget flag, e.g. the TQPopupMenu widget. When the +application opens a popup widget, all events are sent to the popup. +Normal widgets and modal widgets cannot be accessed before the popup +widget is closed. +

    Only other popup widgets may be opened when a popup widget is shown. +The popup widgets are organized in a stack. This function returns +the active popup widget at the top of the stack. +

    See also activeModalWidget() and topLevelWidgets(). + +

    TQWidget * TQApplication::activeWindow () const +

    + +

    Returns the application top-level window that has the keyboard input +focus, or 0 if no application window has the focus. Note that +there might be an activeWindow() even if there is no focusWidget(), +for example if no widget in that window accepts key events. +

    See also TQWidget::setFocus(), TQWidget::focus, and focusWidget(). + +

    Example: network/mail/smtp.cpp. +

    void TQApplication::addLibraryPath ( const TQString & path ) [static] +

    +Append path to the end of the library path list. If path is +empty or already in the path list, the path list is not changed. +

    The default path list consists of a single entry, the installation +directory for plugins. The default installation directory for plugins +is INSTALL/plugins, where INSTALL is the directory where TQt was +installed. +

    See also removeLibraryPath(), libraryPaths(), and setLibraryPaths(). + +

    TQWidgetList * TQApplication::allWidgets () [static] +

    +Returns a list of all the widgets in the application. +

    The list is created using new and must be deleted by the caller. +

    The list is empty (TQPtrList::isEmpty()) if there are no widgets. +

    Note that some of the widgets may be hidden. +

    Example that updates all widgets: +

    +    TQWidgetList  *list = TQApplication::allWidgets();
    +    TQWidgetListIt it( *list );         // iterate over the widgets
    +    TQWidget * w;
    +    while ( (w=it.current()) != 0 ) {  // for each widget...
    +        ++it;
    +        w->update();
    +    }
    +    delete list;                      // delete the list, not the widgets
    +  
    + +

    The TQWidgetList class is defined in the tqwidgetlist.h header +file. +

    Warning: Delete the list as soon as you have finished using it. +The widgets in the list may be deleted by someone else at any time. +

    See also topLevelWidgets(), TQWidget::visible, and TQPtrList::isEmpty(). + +

    TQString TQApplication::applicationDirPath () +

    +Returns the directory that contains the application executable. +

    For example, if you have installed TQt in the C:\Trolltech\TQt +directory, and you run the demo example, this function will +return "C:/Trolltech/TQt/examples/demo". +

    On Mac OS X this will point to the directory actually containing the +executable, which may be inside of an application bundle (if the +application is bundled). +

    Warning: On Unix, this function assumes that argv[0] contains the file +name of the executable (which it normally does). It also assumes that +the current directory hasn't been changed by the application. +

    See also applicationFilePath(). + +

    TQString TQApplication::applicationFilePath () +

    +Returns the file path of the application executable. +

    For example, if you have installed TQt in the C:\Trolltech\TQt +directory, and you run the demo example, this function will +return "C:/Trolltech/TQt/examples/demo/demo.exe". +

    Warning: On Unix, this function assumes that argv[0] contains the file +name of the executable (which it normally does). It also assumes that +the current directory hasn't been changed by the application. +

    See also applicationDirPath(). + +

    int TQApplication::argc () const +

    + +

    Returns the number of command line arguments. +

    The documentation for argv() describes how to process command line +arguments. +

    See also argv() and TQApplication::TQApplication(). + +

    Examples: chart/main.cpp and scribble/scribble.cpp. +

    char ** TQApplication::argv () const +

    + +

    Returns the command line argument vector. +

    argv()[0] is the program name, argv()[1] is the first +argument and argv()[argc()-1] is the last argument. +

    A TQApplication object is constructed by passing argc and argv from the main() function. Some of the arguments may be +recognized as TQt options and removed from the argument vector. For +example, the X11 version of TQt knows about -display, -font +and a few more options. +

    Example: +

    +        // showargs.cpp - displays program arguments in a list box
    +
    +        #include <tqapplication.h>
    +        #include <tqlistbox.h>
    +
    +        int main( int argc, char **argv )
    +        {
    +            TQApplication a( argc, argv );
    +            TQListBox b;
    +            a.setMainWidget( &b );
    +            for ( int i = 0; i < a.argc(); i++ )  // a.argc() == argc
    +                b.insertItem( a.argv()[i] );      // a.argv()[i] == argv[i]
    +            b.show();
    +            return a.exec();
    +        }
    +    
    + +

    If you run showargs -display unix:0 -font 9x15bold hello world +under X11, the list box contains the three strings "showargs", +"hello" and "world". +

    TQt provides a global pointer, tqApp, that points to the +TQApplication object, and through which you can access argc() and +argv() in functions other than main(). +

    See also argc() and TQApplication::TQApplication(). + +

    Examples: chart/main.cpp and scribble/scribble.cpp. +

    void TQApplication::beep () [static] +

    +Sounds the bell, using the default volume and sound. + +

    TQClipboard * TQApplication::clipboard () [static] +

    +Returns a pointer to the application global clipboard. + +

    Examples: regexptester/regexptester.cpp and showimg/showimg.cpp. +

    void TQApplication::closeAllWindows () [slot] +

    +Closes all top-level windows. +

    This function is particularly useful for applications with many +top-level windows. It could, for example, be connected to a "Quit" +entry in the file menu as shown in the following code example: +

    +    // the "Quit" menu entry should try to close all windows
    +    TQPopupMenu* file = new TQPopupMenu( this );
    +    file->insertItem( "&Quit", tqApp, TQ_SLOT(closeAllWindows()), CTRL+Key_Q );
    +
    +    // when the last window is closed, the application should quit
    +    connect( tqApp, TQ_SIGNAL( lastWindowClosed() ), tqApp, TQ_SLOT( quit() ) );
    +  
    + +

    The windows are closed in random order, until one window does not +accept the close event. +

    See also TQWidget::close(), TQWidget::closeEvent(), lastWindowClosed(), quit(), topLevelWidgets(), and TQWidget::isTopLevel. + +

    +

    Examples: action/application.cpp, application/application.cpp, helpviewer/helpwindow.cpp, mdi/application.cpp, and qwerty/qwerty.cpp. +

    bool TQApplication::closingDown () [static] +

    +Returns TRUE if the application objects are being destroyed; +otherwise returns FALSE. +

    See also startingUp(). + +

    int TQApplication::colorSpec () [static] +

    +Returns the color specification. +

    See also TQApplication::setColorSpec(). + +

    Example: showimg/showimg.cpp. +

    void TQApplication::commitData ( TQSessionManager & sm ) [virtual] +

    + +

    This function deals with session + management. It is invoked when the TQSessionManager wants the +application to commit all its data. +

    Usually this means saving all open files, after getting +permission from the user. Furthermore you may want to provide a means +by which the user can cancel the shutdown. +

    Note that you should not exit the application within this function. +Instead, the session manager may or may not do this afterwards, +depending on the context. +

    Warning: Within this function, no user interaction is possible, unless you ask the session manager sm for explicit permission. +See TQSessionManager::allowsInteraction() and +TQSessionManager::allowsErrorInteraction() for details and example +usage. +

    The default implementation requests interaction and sends a close +event to all visible top level widgets. If any event was +rejected, the shutdown is canceled. +

    See also isSessionRestored(), sessionId(), saveState(), and the Session Management overview. + +

    int TQApplication::cursorFlashTime () [static] +

    +Returns the text cursor's flash (blink) time in milliseconds. The +flash time is the time required to display, invert and restore the +caret display. +

    The default value on X11 is 1000 milliseconds. On Windows, the +control panel value is used. +

    Widgets should not cache this value since it may be changed at any +time by the user changing the global desktop settings. +

    See also setCursorFlashTime(). + +

    TQTextCodec * TQApplication::defaultCodec () const +

    This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    Returns TQTextCodec::codecForTr(). + +

    TQDesktopWidget * TQApplication::desktop () [static] +

    +Returns the desktop widget (also called the root window). +

    The desktop widget is useful for obtaining the size of the screen. +It may also be possible to draw on the desktop. We recommend against +assuming that it's possible to draw on the desktop, since this does +not work on all operating systems. +

    +    TQDesktopWidget *d = TQApplication::desktop();
    +    int w = d->width();     // returns desktop width
    +    int h = d->height();    // returns desktop height
    +  
    + + +

    Examples: canvas/main.cpp, desktop/desktop.cpp, helpviewer/main.cpp, i18n/main.cpp, qmag/qmag.cpp, qwerty/main.cpp, and scribble/main.cpp. +

    bool TQApplication::desktopSettingsAware () [static] +

    +Returns the value set by setDesktopSettingsAware(); by default TRUE. +

    See also setDesktopSettingsAware(). + +

    int TQApplication::doubleClickInterval () [static] +

    +Returns the maximum duration for a double click. +

    The default value on X11 is 400 milliseconds. On Windows, the +control panel value is used. +

    See also setDoubleClickInterval(). + +

    int TQApplication::enter_loop () +

    +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    This function enters the main event loop (recursively). Do not call +it unless you really know what you are doing. +

    Use TQApplication::eventLoop()->enterLoop() instead. +

    +

    TQEventLoop * TQApplication::eventLoop () [static] +

    +Returns the application event loop. This function will return +zero if called during and after destroying TQApplication. +

    To create your own instance of TQEventLoop or TQEventLoop subclass create +it before you create the TQApplication object. +

    See also TQEventLoop. + +

    Example: distributor/distributor.ui.h. +

    int TQApplication::exec () +

    +Enters the main event loop and waits until exit() is called or the +main widget is destroyed, and returns the value that was set to +exit() (which is 0 if exit() is called via quit()). +

    It is necessary to call this function to start event handling. The +main event loop receives events from the window system and +dispatches these to the application widgets. +

    Generally speaking, no user interaction can take place before +calling exec(). As a special case, modal widgets like TQMessageBox +can be used before calling exec(), because modal widgets call +exec() to start a local event loop. +

    To make your application perform idle processing, i.e. executing a +special function whenever there are no pending events, use a +TQTimer with 0 timeout. More advanced idle processing schemes can +be achieved using processEvents(). +

    See also quit(), exit(), processEvents(), and setMainWidget(). + +

    Examples: helpsystem/main.cpp, life/main.cpp, network/archivesearch/main.cpp, network/ftpclient/main.cpp, t1/main.cpp, and t4/main.cpp. +

    void TQApplication::exit ( int retcode = 0 ) [static] +

    +Tells the application to exit with a return code. +

    After this function has been called, the application leaves the main +event loop and returns from the call to exec(). The exec() function +returns retcode. +

    By convention, a retcode of 0 means success, and any non-zero +value indicates an error. +

    Note that unlike the C library function of the same name, this +function does return to the caller -- it is event processing that +stops. +

    See also quit() and exec(). + +

    Examples: chart/chartform.cpp, extension/mainform.ui.h, and picture/picture.cpp. +

    void TQApplication::exit_loop () +

    +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    This function exits from a recursive call to the main event loop. +Do not call it unless you are an expert. +

    Use TQApplication::eventLoop()->exitLoop() instead. +

    +

    void TQApplication::flush () [static] +

    +Flushes the window system specific event queues. +

    If you are doing graphical changes inside a loop that does not +return to the event loop on asynchronous window systems like X11 +or double buffered window systems like MacOS X, and you want to +visualize these changes immediately (e.g. Splash Screens), call +this function. +

    See also flushX(), sendPostedEvents(), and TQPainter::flush(). + +

    void TQApplication::flushX () [static] +

    +Flushes the X event queue in the X11 implementation. This normally +returns almost immediately. Does nothing on other platforms. +

    See also syncX(). + +

    Example: xform/xform.cpp. +

    TQWidget * TQApplication::focusWidget () const +

    + +

    Returns the application widget that has the keyboard input focus, or +0 if no widget in this application has the focus. +

    See also TQWidget::setFocus(), TQWidget::focus, and activeWindow(). + +

    TQFont TQApplication::font ( const TQWidget * w = 0 ) [static] +

    +Returns the default font for the widget w, or the default +application font if w is 0. +

    See also setFont(), fontMetrics(), and TQWidget::font. + +

    Examples: qfd/fontdisplayer.cpp, themes/metal.cpp, and themes/themes.cpp. +

    TQFontMetrics TQApplication::fontMetrics () [static] +

    +Returns display (screen) font metrics for the application font. +

    See also font(), setFont(), TQWidget::fontMetrics(), and TQPainter::fontMetrics(). + +

    TQSize TQApplication::globalStrut () [static] +

    + +

    Returns the application's global strut. +

    The strut is a size object whose dimensions are the minimum that any +GUI element that the user can interact with should have. For example +no button should be resized to be smaller than the global strut size. +

    See also setGlobalStrut(). + +

    void TQApplication::guiThreadAwake () [signal] +

    + +

    This signal is emitted after the event loop returns from a function +that could block. +

    See also wakeUpGuiThread(). + +

    bool TQApplication::hasGlobalMouseTracking () [static] +

    + +

    Returns TRUE if global mouse tracking is enabled; otherwise +returns FALSE. +

    See also setGlobalMouseTracking(). + +

    bool TQApplication::hasPendingEvents () +

    +This function returns TRUE if there are pending events; otherwise +returns FALSE. Pending events can be either from the window system +or posted events using TQApplication::postEvent(). + +

    int TQApplication::horizontalAlignment ( int align ) [static] +

    + +

    Strips out vertical alignment flags and transforms an +alignment align of AlignAuto into AlignLeft or +AlignRight according to the language used. The other horizontal +alignment flags are left untouched. + +

    void TQApplication::installTranslator ( TQTranslator * mf ) +

    +Adds the message file mf to the list of message files to be used +for translations. +

    Multiple message files can be installed. Translations are searched +for in the last installed message file, then the one from last, and +so on, back to the first installed message file. The search stops as +soon as a matching translation is found. +

    See also removeTranslator(), translate(), and TQTranslator::load(). + +

    Example: i18n/main.cpp. +

    bool TQApplication::isEffectEnabled ( TQt::UIEffect effect ) [static] +

    +Returns TRUE if effect is enabled; otherwise returns FALSE. +

    By default, TQt will try to use the desktop settings. Call +setDesktopSettingsAware(FALSE) to prevent this. +

    Note: All effects are disabled on screens running at less than +16-bit color depth. +

    See also setEffectEnabled() and TQt::UIEffect. + +

    bool TQApplication::isSessionRestored () const +

    + +

    Returns TRUE if the application has been restored from an earlier +session; otherwise returns FALSE. +

    See also sessionId(), commitData(), and saveState(). + +

    void TQApplication::lastWindowClosed () [signal] +

    + +

    This signal is emitted when the user has closed the last +top level window. +

    The signal is very useful when your application has many top level +widgets but no main widget. You can then connect it to the quit() +slot. +

    For convenience, this signal is not emitted for transient top level +widgets such as popup menus and dialogs. +

    See also mainWidget(), topLevelWidgets(), TQWidget::isTopLevel, and TQWidget::close(). + +

    Examples: addressbook/main.cpp, extension/main.cpp, helpviewer/main.cpp, mdi/main.cpp, network/archivesearch/main.cpp, qwerty/main.cpp, and regexptester/main.cpp. +

    TQStringList TQApplication::libraryPaths () [static] +

    +Returns a list of paths that the application will search when +dynamically loading libraries. +The installation directory for plugins is the only entry if no +paths have been set. The default installation directory for plugins +is INSTALL/plugins, where INSTALL is the directory where TQt was +installed. The directory of the application executable (NOT the +working directory) is also added to the plugin paths. +

    If you want to iterate over the list, you should iterate over a +copy, e.g. +

    +    TQStringList list = app.libraryPaths();
    +    TQStringList::Iterator it = list.begin();
    +    while( it != list.end() ) {
    +        myProcessing( *it );
    +        ++it;
    +    }
    +    
    + +

    See the plugins documentation for a +description of how the library paths are used. +

    See also setLibraryPaths(), addLibraryPath(), removeLibraryPath(), and TQLibrary. + +

    void TQApplication::lock () +

    +

    Lock the TQt Library Mutex. If another thread has already locked the +mutex, the calling thread will block until the other thread has +unlocked the mutex. +

    See also unlock(), locked(), and Thread Support in TQt. + +

    bool TQApplication::locked () +

    +

    Returns TRUE if the TQt Library Mutex is locked by a different thread; +otherwise returns FALSE. +

    Warning: Due to different implementations of recursive mutexes on +the supported platforms, calling this function from the same thread +that previously locked the mutex will give undefined results. +

    See also lock(), unlock(), and Thread Support in TQt. + +

    int TQApplication::loopLevel () const +

    +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    Returns the current loop level. +

    Use TQApplication::eventLoop()->loopLevel() instead. +

    +

    bool TQApplication::macEventFilter ( EventHandlerCallRef, EventRef ) [virtual] +

    +This virtual function is only implemented under Macintosh. +

    If you create an application that inherits TQApplication and +reimplement this function, you get direct access to all Carbon Events +that are received from the MacOS. +

    Return TRUE if you want to stop the event from being processed. +Return FALSE for normal event dispatching. + +

    TQWidget * TQApplication::mainWidget () const +

    + +

    Returns the main application widget, or 0 if there is no main +widget. +

    See also setMainWidget(). + +

    bool TQApplication::notify ( TQObject * receiver, TQEvent * e ) [virtual] +

    +Sends event e to receiver: receiver->event(e). +Returns the value that is returned from the receiver's event handler. +

    For certain types of events (e.g. mouse and key events), +the event will be propagated to the receiver's parent and so on up to +the top-level object if the receiver is not interested in the event +(i.e., it returns FALSE). +

    There are five different ways that events can be processed; +reimplementing this virtual function is just one of them. All five +approaches are listed below: +

      +
    1. Reimplementing this function. This is very powerful, providing +complete control; but only one subclass can be tqApp. +

    2. Installing an event filter on tqApp. Such an event filter is able +to process all events for all widgets, so it's just as powerful as +reimplementing notify(); furthermore, it's possible to have more +than one application-global event filter. Global event filters even +see mouse events for disabled + widgets, and if global mouse + tracking is enabled, as well as mouse move events for all +widgets. +

    3. Reimplementing TQObject::event() (as TQWidget does). If you do +this you get Tab key presses, and you get to see the events before +any widget-specific event filters. +

    4. Installing an event filter on the object. Such an event filter +gets all the events except Tab and Shift-Tab key presses. +

    5. Reimplementing paintEvent(), mousePressEvent() and so +on. This is the commonest, easiest and least powerful way. +
    +

    See also TQObject::event() and installEventFilter(). + +

    TQCursor * TQApplication::overrideCursor () [static] +

    + +

    Returns the active application override cursor. +

    This function returns 0 if no application cursor has been defined +(i.e. the internal cursor stack is empty). +

    See also setOverrideCursor() and restoreOverrideCursor(). + +

    TQPalette TQApplication::palette ( const TQWidget * w = 0 ) [static] +

    +Returns the application palette. +

    If a widget is passed in w, the default palette for the +widget's class is returned. This may or may not be the application +palette. In most cases there isn't a special palette for certain +types of widgets, but one notable exception is the popup menu under +Windows, if the user has defined a special background color for +menus in the display settings. +

    See also setPalette() and TQWidget::palette. + +

    Examples: desktop/desktop.cpp, themes/metal.cpp, and themes/wood.cpp. +

    void TQApplication::polish ( TQWidget * w ) [virtual] +

    +Initialization of the appearance of the widget w before it is first +shown. +

    Usually widgets call this automatically when they are polished. It +may be used to do some style-based central customization of widgets. +

    Note that you are not limited to the public functions of TQWidget. +Instead, based on meta information like TQObject::className() you are +able to customize any kind of widget. +

    See also TQStyle::polish(), TQWidget::polish(), setPalette(), and setFont(). + +

    void TQApplication::postEvent ( TQObject * receiver, TQEvent * event ) [static] +

    Note: This function is thread-safe when TQt is built withthread support.

    + +Adds the event event with the object receiver as the receiver of the +event, to an event queue and returns immediately. +

    The event must be allocated on the heap since the post event queue +will take ownership of the event and delete it once it has been posted. +

    When control returns to the main event loop, all events that are +stored in the queue will be sent using the notify() function. +

    +

    See also sendEvent() and notify(). + +

    void TQApplication::processEvents () +

    +Processes pending events, for 3 seconds or until there are no more +events to process, whichever is shorter. +

    You can call this function occasionally when your program is busy +performing a long operation (e.g. copying a file). +

    See also exec(), TQTimer, and TQEventLoop::processEvents(). + +

    Examples: fileiconview/tqfileiconview.cpp and network/ftpclient/main.cpp. +

    void TQApplication::processEvents ( int maxtime ) +

    +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

    Processes pending events for maxtime milliseconds or until +there are no more events to process, whichever is shorter. +

    You can call this function occasionally when you program is busy +doing a long operation (e.g. copying a file). +

    See also exec(), TQTimer, and TQEventLoop::processEvents(). + +

    void TQApplication::processOneEvent () +

    This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    Waits for an event to occur, processes it, then returns. +

    This function is useful for adapting TQt to situations where the +event processing must be grafted onto existing program loops. +

    Using this function in new applications may be an indication of design +problems. +

    See also processEvents(), exec(), and TQTimer. + +

    void TQApplication::quit () [slot] +

    +Tells the application to exit with return code 0 (success). +Equivalent to calling TQApplication::exit( 0 ). +

    It's common to connect the lastWindowClosed() signal to quit(), and +you also often connect e.g. TQButton::clicked() or signals in +TQAction, TQPopupMenu or TQMenuBar to it. +

    Example: +

    +    TQPushButton *quitButton = new TQPushButton( "Quit" );
    +    connect( quitButton, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );
    +  
    + +

    See also exit(), aboutToQuit(), lastWindowClosed(), and TQAction. + +

    Examples: addressbook/main.cpp, mdi/main.cpp, network/archivesearch/main.cpp, regexptester/main.cpp, t2/main.cpp, t4/main.cpp, and t6/main.cpp. +

    void TQApplication::removeLibraryPath ( const TQString & path ) [static] +

    +Removes path from the library path list. If path is empty or not +in the path list, the list is not changed. +

    See also addLibraryPath(), libraryPaths(), and setLibraryPaths(). + +

    void TQApplication::removePostedEvents ( TQObject * receiver ) [static] +

    Note: This function is thread-safe when TQt is built withthread support.

    + +Removes all events posted using postEvent() for receiver. +

    The events are not dispatched, instead they are removed from the +queue. You should never need to call this function. If you do call it, +be aware that killing events may cause receiver to break one or +more invariants. +

    + +

    void TQApplication::removeTranslator ( TQTranslator * mf ) +

    +Removes the message file mf from the list of message files used by +this application. (It does not delete the message file from the file +system.) +

    See also installTranslator(), translate(), and TQObject::tr(). + +

    Example: i18n/main.cpp. +

    void TQApplication::restoreOverrideCursor () [static] +

    +Undoes the last setOverrideCursor(). +

    If setOverrideCursor() has been called twice, calling +restoreOverrideCursor() will activate the first cursor set. +Calling this function a second time restores the original widgets' +cursors. +

    See also setOverrideCursor() and overrideCursor(). + +

    Examples: distributor/distributor.ui.h, network/archivesearch/archivedialog.ui.h, network/ftpclient/ftpmainwindow.ui.h, and showimg/showimg.cpp. +

    bool TQApplication::reverseLayout () [static] +

    +Returns TRUE if all dialogs and widgets will be laid out in a +mirrored (right to left) fashion. Returns FALSE if dialogs and +widgets will be laid out left to right. +

    See also setReverseLayout(). + +

    void TQApplication::saveState ( TQSessionManager & sm ) [virtual] +

    + +

    This function deals with session + management. It is invoked when the +session manager wants the application +to preserve its state for a future session. +

    For example, a text editor would create a temporary file that +includes the current contents of its edit buffers, the location of +the cursor and other aspects of the current editing session. +

    Note that you should never exit the application within this +function. Instead, the session manager may or may not do this +afterwards, depending on the context. Futhermore, most session +managers will very likely request a saved state immediately after +the application has been started. This permits the session manager +to learn about the application's restart policy. +

    Warning: Within this function, no user interaction is possible, unless you ask the session manager sm for explicit permission. +See TQSessionManager::allowsInteraction() and +TQSessionManager::allowsErrorInteraction() for details. +

    See also isSessionRestored(), sessionId(), commitData(), and the Session Management overview. + +

    bool TQApplication::sendEvent ( TQObject * receiver, TQEvent * event ) [static] +

    + +

    Sends event event directly to receiver receiver, using the +notify() function. Returns the value that was returned from the event +handler. +

    The event is not deleted when the event has been sent. The normal +approach is to create the event on the stack, e.g. +

    +    TQMouseEvent me( TQEvent::MouseButtonPress, pos, 0, 0 );
    +    TQApplication::sendEvent( mainWindow, &me );
    +    
    + +If you create the event on the heap you must delete it. +

    See also postEvent() and notify(). + +

    Example: popup/popup.cpp. +

    void TQApplication::sendPostedEvents ( TQObject * receiver, int event_type ) [static] +

    +Immediately dispatches all events which have been previously queued +with TQApplication::postEvent() and which are for the object receiver +and have the event type event_type. +

    Note that events from the window system are not dispatched by this +function, but by processEvents(). +

    If receiver is null, the events of event_type are sent for all +objects. If event_type is 0, all the events are sent for receiver. + +

    void TQApplication::sendPostedEvents () [static] +

    This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

    Dispatches all posted events, i.e. empties the event queue. + +

    TQString TQApplication::sessionId () const +

    + +

    Returns the current session's identifier. +

    If the application has been restored from an earlier session, this +identifier is the same as it was in that previous session. +

    The session identifier is guaranteed to be unique both for different +applications and for different instances of the same application. +

    See also isSessionRestored(), sessionKey(), commitData(), and saveState(). + +

    TQString TQApplication::sessionKey () const +

    + +

    Returns the session key in the current session. +

    If the application has been restored from an earlier session, this +key is the same as it was when the previous session ended. +

    The session key changes with every call of commitData() or +saveState(). +

    See also isSessionRestored(), sessionId(), commitData(), and saveState(). + +

    void TQApplication::setColorSpec ( int spec ) [static] +

    +Sets the color specification for the application to spec. +

    The color specification controls how the application allocates colors +when run on a display with a limited amount of colors, e.g. 8 bit / 256 +color displays. +

    The color specification must be set before you create the TQApplication +object. +

    The options are: +

      +
    • TQApplication::NormalColor. +This is the default color allocation strategy. Use this option if +your application uses buttons, menus, texts and pixmaps with few +colors. With this option, the application uses system global +colors. This works fine for most applications under X11, but on +Windows machines it may cause dithering of non-standard colors. +
    • TQApplication::CustomColor. +Use this option if your application needs a small number of custom +colors. On X11, this option is the same as NormalColor. On Windows, TQt +creates a Windows palette, and allocates colors to it on demand. +
    • TQApplication::ManyColor. +Use this option if your application is very color hungry +(e.g. it requires thousands of colors). +Under X11 the effect is: +
        +
      • For 256-color displays which have at best a 256 color true color +visual, the default visual is used, and colors are allocated +from a color cube. The color cube is the 6x6x6 (216 color) "Web +palette"*, but the number of colors can be changed +by the -ncols option. The user can force the application to +use the true color visual with the -visual option. +
      • For 256-color displays which have a true color visual with more +than 256 colors, use that visual. Silicon Graphics X servers +have this feature, for example. They provide an 8 bit visual +by default but can deliver true color when asked. +
      +On Windows, TQt creates a Windows palette, and fills it with a color cube. +
    +

    Be aware that the CustomColor and ManyColor choices may lead to colormap +flashing: The foreground application gets (most) of the available +colors, while the background windows will look less attractive. +

    Example: +

    +  int main( int argc, char **argv )
    +  {
    +      TQApplication::setColorSpec( TQApplication::ManyColor );
    +      TQApplication a( argc, argv );
    +      ...
    +  }
    +  
    + +

    TQColor provides more functionality for controlling color allocation and +freeing up certain colors. See TQColor::enterAllocContext() for more +information. +

    To check what mode you end up with, call TQColor::numBitPlanes() once +the TQApplication object exists. A value greater than 8 (typically +16, 24 or 32) means true color. +

    * The color cube used by TQt has 216 colors whose red, +green, and blue components always have one of the following values: +0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF. +

    See also colorSpec(), TQColor::numBitPlanes(), and TQColor::enterAllocContext(). + +

    Examples: helpviewer/main.cpp, showimg/main.cpp, t9/main.cpp, tetrix/tetrix.cpp, and themes/main.cpp. +

    void TQApplication::setCursorFlashTime ( int msecs ) [static] +

    +Sets the text cursor's flash (blink) time to msecs +milliseconds. The flash time is the time required to display, +invert and restore the caret display. Usually the text cursor is +displayed for msecs/2 milliseconds, then hidden for msecs/2 +milliseconds, but this may vary. +

    Note that on Microsoft Windows, calling this function sets the +cursor flash time for all windows. +

    See also cursorFlashTime(). + +

    void TQApplication::setDefaultCodec ( TQTextCodec * codec ) +

    This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    This is the same as TQTextCodec::setCodecForTr(). + +

    void TQApplication::setDesktopSettingsAware ( bool on ) [static] +

    +By default, TQt will try to use the current standard colors, fonts +etc., from the underlying window system's desktop settings, +and use them for all relevant widgets. This behavior can be switched off +by calling this function with on set to FALSE. +

    This static function must be called before creating the TQApplication +object, like this: +

    +  int main( int argc, char** argv ) {
    +    TQApplication::setDesktopSettingsAware( FALSE ); // I know better than the user
    +    TQApplication myApp( argc, argv ); // Use default fonts & colors
    +    ...
    +  }
    +  
    + +

    See also desktopSettingsAware(). + +

    void TQApplication::setDoubleClickInterval ( int ms ) [static] +

    +Sets the time limit that distinguishes a double click from two +consecutive mouse clicks to ms milliseconds. +

    Note that on Microsoft Windows, calling this function sets the +double click interval for all windows. +

    See also doubleClickInterval(). + +

    void TQApplication::setEffectEnabled ( TQt::UIEffect effect, bool enable = TRUE ) [static] +

    +Enables the UI effect effect if enable is TRUE, otherwise +the effect will not be used. +

    Note: All effects are disabled on screens running at less than +16-bit color depth. +

    See also isEffectEnabled(), TQt::UIEffect, and setDesktopSettingsAware(). + +

    void TQApplication::setFont ( const TQFont & font, bool informWidgets = FALSE, const char * className = 0 ) [static] +

    Changes the default application font to font. If informWidgets is TRUE, then existing widgets are informed about the +change and may adjust themselves to the new application +setting. If informWidgets is FALSE, the change only affects newly +created widgets. If className is passed, the change applies only +to classes that inherit className (as reported by +TQObject::inherits()). +

    On application start-up, the default font depends on the window +system. It can vary depending on both the window system version and +the locale. This function lets you override the default font; but +overriding may be a bad idea because, for example, some locales need +extra-large fonts to support their special characters. +

    See also font(), fontMetrics(), and TQWidget::font. + +

    Examples: desktop/desktop.cpp, themes/metal.cpp, and themes/themes.cpp. +

    void TQApplication::setGlobalMouseTracking ( bool enable ) [static] +

    +Enables global mouse tracking if enable is TRUE, or disables it +if enable is FALSE. +

    Enabling global mouse tracking makes it possible for widget event +filters or application event filters to get all mouse move events, +even when no button is depressed. This is useful for special GUI +elements, e.g. tooltips. +

    Global mouse tracking does not affect widgets and their +mouseMoveEvent(). For a widget to get mouse move events when no +button is depressed, it must do TQWidget::setMouseTracking(TRUE). +

    This function uses an internal counter. Each +setGlobalMouseTracking(TRUE) must have a corresponding +setGlobalMouseTracking(FALSE): +

    +        // at this point global mouse tracking is off
    +        TQApplication::setGlobalMouseTracking( TRUE );
    +        TQApplication::setGlobalMouseTracking( TRUE );
    +        TQApplication::setGlobalMouseTracking( FALSE );
    +        // at this point it's still on
    +        TQApplication::setGlobalMouseTracking( FALSE );
    +        // but now it's off
    +    
    + +

    See also hasGlobalMouseTracking() and TQWidget::mouseTracking. + +

    void TQApplication::setGlobalStrut ( const TQSize & strut ) [static] +

    +Sets the application's global strut to strut. +

    The strut is a size object whose dimensions are the minimum that any +GUI element that the user can interact with should have. For example +no button should be resized to be smaller than the global strut size. +

    The strut size should be considered when reimplementing GUI controls +that may be used on touch-screens or similar IO-devices. +

    Example: +

    +  TQSize& WidgetClass::sizeHint() const
    +  {
    +      return TQSize( 80, 25 ).expandedTo( TQApplication::globalStrut() );
    +  }
    +  
    + +

    See also globalStrut(). + +

    void TQApplication::setLibraryPaths ( const TQStringList & paths ) [static] +

    +Sets the list of directories to search when loading libraries to paths. +All existing paths will be deleted and the path list will consist of the +paths given in paths. +

    See also libraryPaths(), addLibraryPath(), removeLibraryPath(), and TQLibrary. + +

    void TQApplication::setMainWidget ( TQWidget * mainWidget ) [virtual] +

    +Sets the application's main widget to mainWidget. +

    In most respects the main widget is like any other widget, except +that if it is closed, the application exits. Note that +TQApplication does not take ownership of the mainWidget, so +if you create your main widget on the heap you must delete it +yourself. +

    You need not have a main widget; connecting lastWindowClosed() to +quit() is an alternative. +

    For X11, this function also resizes and moves the main widget +according to the -geometry command-line option, so you should +set the default geometry (using TQWidget::setGeometry()) before +calling setMainWidget(). +

    See also mainWidget(), exec(), and quit(). + +

    Examples: chart/main.cpp, helpsystem/main.cpp, life/main.cpp, network/ftpclient/main.cpp, t1/main.cpp, and t4/main.cpp. +

    void TQApplication::setOverrideCursor ( const TQCursor & cursor, bool replace = FALSE ) [static] +

    +Sets the application override cursor to cursor. +

    Application override cursors are intended for showing the user +that the application is in a special state, for example during an +operation that might take some time. +

    This cursor will be displayed in all the application's widgets +until restoreOverrideCursor() or another setOverrideCursor() is +called. +

    Application cursors are stored on an internal stack. +setOverrideCursor() pushes the cursor onto the stack, and +restoreOverrideCursor() pops the active cursor off the stack. +Every setOverrideCursor() must eventually be followed by a +corresponding restoreOverrideCursor(), otherwise the stack will +never be emptied. +

    If replace is TRUE, the new cursor will replace the last +override cursor (the stack keeps its depth). If replace is +FALSE, the new stack is pushed onto the top of the stack. +

    Example: +

    +        TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) );
    +        calculateHugeMandelbrot();              // lunch time...
    +        TQApplication::restoreOverrideCursor();
    +    
    + +

    See also overrideCursor(), restoreOverrideCursor(), and TQWidget::cursor. + +

    Examples: distributor/distributor.ui.h, network/archivesearch/archivedialog.ui.h, network/ftpclient/ftpmainwindow.ui.h, and showimg/showimg.cpp. +

    void TQApplication::setPalette ( const TQPalette & palette, bool informWidgets = FALSE, const char * className = 0 ) [static] +

    +Changes the default application palette to palette. If informWidgets is TRUE, then existing widgets are informed about the +change and may adjust themselves to the new application +setting. If informWidgets is FALSE, the change only affects newly +created widgets. +

    If className is passed, the change applies only to widgets that +inherit className (as reported by TQObject::inherits()). If +className is left 0, the change affects all widgets, thus overriding +any previously set class specific palettes. +

    The palette may be changed according to the current GUI style in +TQStyle::polish(). +

    See also TQWidget::palette, palette(), and TQStyle::polish(). + +

    Examples: i18n/main.cpp, themes/metal.cpp, themes/themes.cpp, and themes/wood.cpp. +

    void TQApplication::setReverseLayout ( bool b ) [static] +

    +If b is TRUE, all dialogs and widgets will be laid out in a +mirrored fashion, as required by right to left languages such as +Arabic and Hebrew. If b is FALSE, dialogs and widgets are laid +out left to right. +

    Changing this flag in runtime does not cause a relayout of already +instantiated widgets. +

    See also reverseLayout(). + +

    void TQApplication::setStartDragDistance ( int l ) [static] +

    +Sets the distance after which a drag should start to l pixels. +

    See also startDragDistance(). + +

    void TQApplication::setStartDragTime ( int ms ) [static] +

    +Sets the time after which a drag should start to ms ms. +

    See also startDragTime(). + +

    void TQApplication::setStyle ( TQStyle * style ) [static] +

    +Sets the application's GUI style to style. Ownership of the style +object is transferred to TQApplication, so TQApplication will delete +the style object on application exit or when a new style is set. +

    Example usage: +

    +    TQApplication::setStyle( new TQWindowsStyle );
    +  
    + +

    When switching application styles, the color palette is set back to +the initial colors or the system defaults. This is necessary since +certain styles have to adapt the color palette to be fully +style-guide compliant. +

    See also style(), TQStyle, setPalette(), and desktopSettingsAware(). + +

    Example: themes/themes.cpp. +

    TQStyle * TQApplication::setStyle ( const TQString & style ) [static] +

    +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

    Requests a TQStyle object for style from the TQStyleFactory. +

    The string must be one of the TQStyleFactory::keys(), typically one +of "windows", "motif", "cde", "motifplus", "platinum", "sgi" and +"compact". Depending on the platform, "windowsxp", "aqua" or +"macintosh" may be available. +

    A later call to the TQApplication constructor will override the +requested style when a "-style" option is passed in as a commandline +parameter. +

    Returns 0 if an unknown style is passed, otherwise the TQStyle object +returned is set as the application's GUI style. + +

    void TQApplication::setWheelScrollLines ( int n ) [static] +

    +Sets the number of lines to scroll when the mouse wheel is rotated +to n. +

    If this number exceeds the number of visible lines in a certain +widget, the widget should interpret the scroll operation as a +single page up / page down operation instead. +

    See also wheelScrollLines(). + +

    void TQApplication::setWinStyleHighlightColor ( const TQColor & c ) [static] +

    + +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    Sets the color used to mark selections in windows style for all widgets +in the application. Will repaint all widgets if the color is changed. +

    The default color is darkBlue. +

    See also winStyleHighlightColor(). + +

    int TQApplication::startDragDistance () [static] +

    +If you support drag and drop in you application and a drag should +start after a mouse click and after moving the mouse a certain +distance, you should use the value which this method returns as the +distance. +

    For example, if the mouse position of the click is stored in startPos and the current position (e.g. in the mouse move event) is +currPos, you can find out if a drag should be started with code +like this: +

    +  if ( ( startPos - currPos ).manhattanLength() >
    +       TQApplication::startDragDistance() )
    +    startTheDrag();
    +  
    + +

    TQt uses this value internally, e.g. in TQFileDialog. +

    The default value is 4 pixels. +

    See also setStartDragDistance(), startDragTime(), and TQPoint::manhattanLength(). + +

    int TQApplication::startDragTime () [static] +

    +If you support drag and drop in you application and a drag should +start after a mouse click and after a certain time elapsed, you +should use the value which this method returns as the delay (in ms). +

    TQt also uses this delay internally, e.g. in TQTextEdit and TQLineEdit, +for starting a drag. +

    The default value is 500 ms. +

    See also setStartDragTime() and startDragDistance(). + +

    bool TQApplication::startingUp () [static] +

    +Returns TRUE if an application object has not been created yet; +otherwise returns FALSE. +

    See also closingDown(). + +

    TQStyle & TQApplication::style () [static] +

    +Returns the application's style object. +

    See also setStyle() and TQStyle. + +

    void TQApplication::syncX () [static] +

    +Synchronizes with the X server in the X11 implementation. This +normally takes some time. Does nothing on other platforms. +

    See also flushX(). + +

    TQWidgetList * TQApplication::topLevelWidgets () [static] +

    +Returns a list of the top level widgets in the application. +

    The list is created using new and must be deleted by the caller. +

    The list is empty (TQPtrList::isEmpty()) if there are no top level +widgets. +

    Note that some of the top level widgets may be hidden, for example +the tooltip if no tooltip is currently shown. +

    Example: +

    +    // Show all hidden top level widgets.
    +    TQWidgetList  *list = TQApplication::topLevelWidgets();
    +    TQWidgetListIt it( *list );  // iterate over the widgets
    +    TQWidget * w;
    +    while ( (w=it.current()) != 0 ) {   // for each top level widget...
    +        ++it;
    +        if ( !w->isVisible() )
    +            w->show();
    +    }
    +    delete list;                // delete the list, not the widgets
    +  
    + +

    Warning: Delete the list as soon you have finished using it. +The widgets in the list may be deleted by someone else at any time. +

    See also allWidgets(), TQWidget::isTopLevel, TQWidget::visible, and TQPtrList::isEmpty(). + +

    TQString TQApplication::translate ( const char * context, const char * sourceText, const char * comment = 0, Encoding encoding = DefaultCodec ) const +

    Note: This function is reentrant when TQt is built with thread support.

    + +Returns the translation text for sourceText, by querying the +installed messages files. The message files are searched from the most +recently installed message file back to the first installed message +file. +

    TQObject::tr() and TQObject::trUtf8() provide this functionality more +conveniently. +

    context is typically a class name (e.g., "MyDialog") and +sourceText is either English text or a short identifying text, if +the output text will be very long (as for help texts). +

    comment is a disambiguating comment, for when the same sourceText is used in different roles within the same context. By +default, it is null. encoding indicates the 8-bit encoding of +character stings +

    See the TQTranslator documentation for more information about +contexts and comments. +

    If none of the message files contain a translation for sourceText in context, this function returns a TQString +equivalent of sourceText. The encoding of sourceText is +specified by encoding; it defaults to DefaultCodec. +

    This function is not virtual. You can use alternative translation +techniques by subclassing TQTranslator. +

    Warning: This method is reentrant only if all translators are +installed before calling this method. Installing or removing +translators while performing translations is not supported. Doing +so will most likely result in crashes or other undesirable behavior. +

    See also TQObject::tr(), installTranslator(), and defaultCodec(). + +

    bool TQApplication::tryLock () +

    +

    Attempts to lock the TQt Library Mutex, and returns immediately. If +the lock was obtained, this function returns TRUE. If another thread +has locked the mutex, this function returns FALSE, instead of +waiting for the lock to become available. +

    The mutex must be unlocked with unlock() before another thread can +successfully lock it. +

    See also lock(), unlock(), and Thread Support in TQt. + +

    Type TQApplication::type () const +

    +Returns the type of application, Tty, GuiClient or GuiServer. + +

    void TQApplication::unlock ( bool wakeUpGui = TRUE ) +

    +

    Unlock the TQt Library Mutex. If wakeUpGui is TRUE (the default), +then the GUI thread will be woken with TQApplication::wakeUpGuiThread(). +

    See also lock(), locked(), and Thread Support in TQt. + +

    void TQApplication::wakeUpGuiThread () +

    +

    Wakes up the GUI thread. +

    See also guiThreadAwake() and Thread Support in TQt. + +

    int TQApplication::wheelScrollLines () [static] +

    +Returns the number of lines to scroll when the mouse wheel is +rotated. +

    See also setWheelScrollLines(). + +

    TQWidget * TQApplication::widgetAt ( int x, int y, bool child = FALSE ) [static] +

    +Returns a pointer to the widget at global screen position (x, y), or 0 if there is no TQt widget there. +

    If child is FALSE and there is a child widget at position (x, y), the top-level widget containing it is returned. If child +is TRUE the child widget at position (x, y) is returned. +

    This function is normally rather slow. +

    See also TQCursor::pos(), TQWidget::grabMouse(), and TQWidget::grabKeyboard(). + +

    TQWidget * TQApplication::widgetAt ( const TQPoint & pos, bool child = FALSE ) [static] +

    +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

    Returns a pointer to the widget at global screen position pos, +or 0 if there is no TQt widget there. +

    If child is FALSE and there is a child widget at position pos, the top-level widget containing it is returned. If child +is TRUE the child widget at position pos is returned. + +

    bool TQApplication::winEventFilter ( MSG * ) [virtual] +

    +This virtual function is only implemented under Windows. +

    The message procedure calls this function for every message +received. Reimplement this function if you want to process window +messages that are not processed by TQt. If you don't want +the event to be processed by TQt, then return TRUE; otherwise +return FALSE. + +

    void TQApplication::winFocus ( TQWidget * widget, bool gotFocus ) +

    +This function is available only on Windows. +

    If gotFocus is TRUE, widget will become the active window. +Otherwise the active window is reset to NULL. + +

    const TQColor & TQApplication::winStyleHighlightColor () [static] +

    + +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

    Returns the color used to mark selections in windows style. +

    See also setWinStyleHighlightColor(). + +

    bool TQApplication::x11EventFilter ( XEvent * ) [virtual] +

    +This virtual function is only implemented under X11. +

    If you create an application that inherits TQApplication and +reimplement this function, you get direct access to all X events +that the are received from the X server. +

    Return TRUE if you want to stop the event from being processed. +Return FALSE for normal event dispatching. +

    See also x11ProcessEvent(). + +

    int TQApplication::x11ProcessEvent ( XEvent * event ) +

    +This function does the core processing of individual X +events, normally by dispatching TQt events to the right +destination. +

    It returns 1 if the event was consumed by special handling, 0 if +the event was consumed by normal handling, and -1 if the event was for an unrecognized widget. +

    See also x11EventFilter(). + +


    Related Functions

    +

    void Q_ASSERT ( bool test ) +

    + +

    +

    Prints a warning message containing the source code file name and +line number if test is FALSE. +

    This is really a macro defined in tqglobal.h. +

    Q_ASSERT is useful for testing pre- and post-conditions. +

    Example: +

    +        //
    +        // File: div.cpp
    +        //
    +
    +        #include <tqglobal.h>
    +
    +        int divide( int a, int b )
    +        {
    +            Q_ASSERT( b != 0 );                 // this is line 9
    +            return a/b;
    +        }
    +    
    + +

    If b is zero, the Q_ASSERT statement will output the following +message using the tqWarning() function: +

    +        ASSERT: "b != 0" in div.cpp (9)
    +    
    + +

    See also tqWarning() and Debugging. + +

    void TQ_CHECK_PTR ( void * p ) +

    + +

    +

    If 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 tqglobal.h. +

    Example: +

    +        int *a;
    +
    +        TQ_CHECK_PTR( a = new int[80] );  // WRONG!
    +
    +        a = new (nothrow) int[80];       // Right
    +        TQ_CHECK_PTR( a );
    +    
    + +

    See also tqWarning() and Debugging. + +

    void tqAddPostRoutine ( TQtCleanUpFunction p ) +

    + +

    Adds a global routine that will be called from the TQApplication +destructor. This function is normally used to add cleanup routines +for program-wide functionality. +

    The function given by p should take no arguments and return +nothing, like this: +

    +    static int *global_ptr = 0;
    +
    +    static void cleanup_ptr()
    +    {
    +        delete [] global_ptr;
    +        global_ptr = 0;
    +    }
    +
    +    void init_ptr()
    +    {
    +        global_ptr = new int[100];      // allocate data
    +        tqAddPostRoutine( cleanup_ptr ); // delete later
    +    }
    +  
    + +

    Note that for an application- or module-wide cleanup, +tqAddPostRoutine() is often not suitable. People have a tendency to +make such modules dynamically loaded, and then unload those modules +long before the TQApplication destructor is called, for example. +

    For modules and libraries, using a reference-counted initialization +manager or TQt' parent-child delete mechanism may be better. Here is +an example of a private class which uses the parent-child mechanism +to call a cleanup function at the right time: +

    +    class MyPrivateInitStuff: public TQObject {
    +    private:
    +        MyPrivateInitStuff( TQObject * parent ): TQObject( parent) {
    +            // initialization goes here
    +        }
    +        MyPrivateInitStuff * p;
    +
    +    public:
    +        static MyPrivateInitStuff * initStuff( TQObject * parent ) {
    +            if ( !p )
    +                p = new MyPrivateInitStuff( parent );
    +            return p;
    +        }
    +
    +        ~MyPrivateInitStuff() {
    +            // cleanup (the "post routine") goes here
    +        }
    +    }
    +  
    + +

    By selecting the right parent widget/object, this can often be made +to clean up the module's data at the exact right moment. + +

    void tqDebug ( const char * msg, ... ) +

    + +

    +

    Prints a debug message msg, or calls the message handler (if it +has been installed). +

    This function takes a format string and a list of arguments, +similar to the C printf() function. +

    Example: +

    +        tqDebug( "my window handle = %x", myWidget->id() );
    +    
    + +

    Under X11, the text is printed to stderr. Under Windows, the text +is sent to the debugger. +

    Warning: The internal buffer is limited to 8196 bytes (including +the '\0'-terminator). +

    Warning: Passing (const char *)0 as argument to tqDebug might lead +to crashes on certain platforms due to the platforms printf implementation. +

    See also tqWarning(), tqFatal(), qInstallMsgHandler(), and Debugging. + +

    void tqFatal ( const char * msg, ... ) +

    + +

    +

    Prints a fatal error message msg and exits, or calls the +message handler (if it has been installed). +

    This function takes a format string and a list of arguments, +similar to the C printf() function. +

    Example: +

    +        int divide( int a, int b )
    +        {
    +            if ( b == 0 )                               // program error
    +                tqFatal( "divide: cannot divide by zero" );
    +            return a/b;
    +        }
    +    
    + +

    Under X11, the text is printed to stderr. Under Windows, the text +is sent to the debugger. +

    Warning: The internal buffer is limited to 8196 bytes (including +the '\0'-terminator). +

    Warning: Passing (const char *)0 as argument to tqFatal might lead +to crashes on certain platforms due to the platforms printf implementation. +

    See also tqDebug(), tqWarning(), qInstallMsgHandler(), and Debugging. + +

    TQtMsgHandler qInstallMsgHandler ( TQtMsgHandler h ) +

    + +

    Installs a TQt message handler h. Returns a pointer to the +message handler previously defined. +

    The message handler is a function that prints out debug messages, +warnings and fatal error messages. The TQt library (debug version) +contains hundreds of warning messages that are printed when +internal errors (usually invalid function arguments) occur. If you +implement your own message handler, you get total control of these +messages. +

    The default message handler prints the message to the standard +output under X11 or to the debugger under Windows. If it is a +fatal message, the application aborts immediately. +

    Only one message handler can be defined, since this is usually +done on an application-wide basis to control debug output. +

    To restore the message handler, call qInstallMsgHandler(0). +

    Example: +

    +        #include <tqapplication.h>
    +        #include <stdio.h>
    +        #include <stdlib.h>
    +
    +        void myMessageOutput( TQtMsgType type, const char *msg )
    +        {
    +            switch ( type ) {
    +                case TQtDebugMsg:
    +                    fprintf( stderr, "Debug: %s\n", msg );
    +                    break;
    +                case TQtWarningMsg:
    +                    fprintf( stderr, "Warning: %s\n", msg );
    +                    break;
    +                case TQtFatalMsg:
    +                    fprintf( stderr, "Fatal: %s\n", msg );
    +                    abort();                    // deliberately core dump
    +            }
    +        }
    +
    +        int main( int argc, char **argv )
    +        {
    +            qInstallMsgHandler( myMessageOutput );
    +            TQApplication a( argc, argv );
    +            ...
    +            return a.exec();
    +        }
    +    
    + +

    See also tqDebug(), tqWarning(), tqFatal(), and Debugging. + +

    bool tqSysInfo ( int * wordSize, bool * bigEndian ) +

    + +

    Obtains information about the system. +

    The system's word size in bits (typically 32) is returned in *wordSize. The *bigEndian is set to TRUE if this is a big-endian +machine, or to FALSE if this is a little-endian machine. +

    In debug mode, this function calls tqFatal() with a message if the +computer is truly weird (i.e. different endianness for 16 bit and +32 bit integers); in release mode it returns FALSE. + +

    void tqSystemWarning ( const char * msg, int code ) +

    + +

    Prints the message msg and uses code to get a system specific +error message. When code is -1 (the default), the system's last +error code will be used if possible. Use this method to handle +failures in platform specific API calls. +

    This function does nothing when TQt is built with TQT_NO_DEBUG +defined. + +

    const char * tqVersion () +

    + +

    Returns the TQt version number as a string, for example, "2.3.0" or +"3.0.5". +

    The TQT_VERSION define has the numeric value in the form: +0xmmiibb (m = major, i = minor, b = bugfix). For example, TQt +3.0.5's TQT_VERSION is 0x030005. + +

    void tqWarning ( const char * msg, ... ) +

    + +

    +

    Prints a warning message msg, or calls the message handler (if +it has been installed). +

    This function takes a format string and a list of arguments, +similar to the C printf() function. +

    Example: +

    +        void f( int c )
    +        {
    +            if ( c > 200 )
    +                tqWarning( "f: bad argument, c == %d", c );
    +        }
    +    
    + +

    Under X11, the text is printed to stderr. Under Windows, the text +is sent to the debugger. +

    Warning: The internal buffer is limited to 8196 bytes (including +the '\0'-terminator). +

    Warning: Passing (const char *)0 as argument to tqWarning might lead +to crashes on certain platforms due to the platforms printf implementation. +

    See also tqDebug(), tqFatal(), qInstallMsgHandler(), and Debugging. + + +


    +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


    + +
    Copyright © 2007 +TrolltechTrademarks +
    TQt 3.3.8
    +
    + diff --git a/doc/html/tqasciicache.html b/doc/html/tqasciicache.html index b1a94d224..0f4a5216b 100644 --- a/doc/html/tqasciicache.html +++ b/doc/html/tqasciicache.html @@ -216,7 +216,7 @@ This should be a bit bigger than count() is likely to be.

    A debug-only utility function. Prints out cache usage, hit/miss, -and distribution information using tqDebug(). This function does +and distribution information using tqDebug(). This function does nothing in the release library.

    type * TQAsciiCache::take ( const char * k ) diff --git a/doc/html/tqasciidict.html b/doc/html/tqasciidict.html index 90c00b613..a7bcc7b5b 100644 --- a/doc/html/tqasciidict.html +++ b/doc/html/tqasciidict.html @@ -289,7 +289,7 @@ constructor).

    Debugging-only function that prints out the dictionary -distribution using tqDebug(). +distribution using tqDebug().

    type * TQAsciiDict::take ( const char * key )

    diff --git a/doc/html/tqcache.html b/doc/html/tqcache.html index e4eb58764..c7f046f0d 100644 --- a/doc/html/tqcache.html +++ b/doc/html/tqcache.html @@ -243,7 +243,7 @@ This should be a bit bigger than count() is likely to be.

    A debug-only utility function. Prints out cache usage, hit/miss, -and distribution information using tqDebug(). This function does +and distribution information using tqDebug(). This function does nothing in the release library.

    type * TQCache::take ( const TQString & k ) diff --git a/doc/html/tqcanvasview.html b/doc/html/tqcanvasview.html index 5cc443413..48fe627c5 100644 --- a/doc/html/tqcanvasview.html +++ b/doc/html/tqcanvasview.html @@ -70,7 +70,7 @@ subclass TQCanvasView. You might then reimplement TQCanvasItemList l = canvas()->collisions(e->pos()); for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { if ( (*it)->rtti() == TQCanvasRectangle::RTTI ) - tqDebug("A TQCanvasRectangle lies somewhere at this point"); + tqDebug("A TQCanvasRectangle lies somewhere at this point"); } }

    diff --git a/doc/html/tqchildevent.html b/doc/html/tqchildevent.html index 02fad3b23..19ac970ee 100644 --- a/doc/html/tqchildevent.html +++ b/doc/html/tqchildevent.html @@ -51,7 +51,7 @@ events.

    Child events are sent to objects when children are inserted or removed. -

    A ChildRemoved event is sent immediately, but a ChildInserted event is posted (with TQApplication::postEvent()). +

    A ChildRemoved event is sent immediately, but a ChildInserted event is posted (with TQApplication::postEvent()).

    Note that if a child is removed immediately after it is inserted, the ChildInserted event may be suppressed, but the ChildRemoved event will always be sent. In this case there will be a ChildRemoved event without a corresponding ChildInserted diff --git a/doc/html/tqclipboard.html b/doc/html/tqclipboard.html index ef2dec2db..bde04f0e0 100644 --- a/doc/html/tqclipboard.html +++ b/doc/html/tqclipboard.html @@ -82,15 +82,15 @@ between applications. uses similar mechanisms. For advanced clipboard usage read the drag-and-drop documentation.

    There is a single TQClipboard object in an application, and you can -access it using TQApplication::clipboard(). +access it using TQApplication::clipboard().

    Example:

    -    TQClipboard *cb = TQApplication::clipboard();
    +    TQClipboard *cb = TQApplication::clipboard();
     
         // Copy text from the clipboard (paste)
         TQString text = cb->text(TQClipboard::Clipboard);
         if ( !text.isNull() )
    -        tqDebug( "The clipboard contains: " + text );
    +        tqDebug( "The clipboard contains: " + text );
     
         // Copy text into the clipboard
         cb->setText( "This text can be pasted by other programs",
    diff --git a/doc/html/tqcloseevent.html b/doc/html/tqcloseevent.html
    index 98405e12a..bfe2fe879 100644
    --- a/doc/html/tqcloseevent.html
    +++ b/doc/html/tqcloseevent.html
    @@ -58,10 +58,10 @@ the WDestructiveClose flag). If it refus
     event nothing happens. (Under X11 it is possible that the window
     manager will forcibly close the window; but at the time of writing
     we are not aware of any window manager that does this.)
    -

    The application's main widget -- TQApplication::mainWidget() -- +

    The application's main widget -- TQApplication::mainWidget() -- is a special case. When it accepts the close event, TQt leaves the main event loop and the application is immediately terminated -(i.e. it returns from the call to TQApplication::exec() in the +(i.e. it returns from the call to TQApplication::exec() in the main() function).

    The event handler TQWidget::closeEvent() receives close events. The default implementation of this event handler accepts the close @@ -75,12 +75,12 @@ with the WDestructiveClose widget flag. independent top-level windows in a multi-window application.

    TQObjects emits the destroyed() signal when they are deleted.

    If the last top-level window is closed, the -TQApplication::lastWindowClosed() signal is emitted. +TQApplication::lastWindowClosed() signal is emitted.

    The isAccepted() function returns TRUE if the event's receiver has agreed to close the widget; call accept() to agree to close the widget and call ignore() if the receiver of this event does not want the widget to be closed. -

    See also TQWidget::close(), TQWidget::hide(), TQObject::destroyed(), TQApplication::setMainWidget(), TQApplication::lastWindowClosed(), TQApplication::exec(), TQApplication::quit(), and Event Classes. +

    See also TQWidget::close(), TQWidget::hide(), TQObject::destroyed(), TQApplication::setMainWidget(), TQApplication::lastWindowClosed(), TQApplication::exec(), TQApplication::quit(), and Event Classes.


    Member Function Documentation

    TQCloseEvent::TQCloseEvent () diff --git a/doc/html/tqcolor.html b/doc/html/tqcolor.html index 60f87a2d3..d44963cdb 100644 --- a/doc/html/tqcolor.html +++ b/doc/html/tqcolor.html @@ -178,7 +178,7 @@ moving slightly towards the magenta, could be H=350 (equivalent to

    TQt returns a hue value of -1 for achromatic colors. If you pass a too-big hue value, TQt forces it into range. Hue 360 or 720 is treated as 0; hue 540 is treated as 180. -

    See also TQPalette, TQColorGroup, TQApplication::setColorSpec(), Color FAQ, Widget Appearance and Style, Graphics Classes, and Image Processing Classes. +

    See also TQPalette, TQColorGroup, TQApplication::setColorSpec(), Color FAQ, Widget Appearance and Style, Graphics Classes, and Image Processing Classes.


    Member Type Documentation

    TQColor::Spec

    @@ -262,7 +262,7 @@ don't need to call this function.

    void TQColor::cleanup () [static]

    Internal clean up required for TQColor. -This function is called from the TQApplication destructor. +This function is called from the TQApplication destructor.

    See also initialize().

    TQStringList TQColor::colorNames () [static] @@ -351,8 +351,8 @@ enterAllocContex() must have a corresponding leaveAllocContext().

    You may also want to set the application's color specification. -See TQApplication::setColorSpec() for more information. -

    See also leaveAllocContext(), currentAllocContext(), destroyAllocContext(), and TQApplication::setColorSpec(). +See TQApplication::setColorSpec() for more information. +

    See also leaveAllocContext(), currentAllocContext(), destroyAllocContext(), and TQApplication::setColorSpec().

    Example: showimg/showimg.cpp.

    void TQColor::getHsv ( int * h, int * s, int * v ) const @@ -390,7 +390,7 @@ Use getHsv() instead.

    void TQColor::initialize () [static]

    Internal initialization required for TQColor. -This function is called from the TQApplication constructor. +This function is called from the TQApplication constructor.

    See also cleanup().

    bool TQColor::isValid () const diff --git a/doc/html/tqcursor.html b/doc/html/tqcursor.html index 117294741..3b68b69ea 100644 --- a/doc/html/tqcursor.html +++ b/doc/html/tqcursor.html @@ -81,7 +81,7 @@ of the mouse cursor. custom cursor shapes based on a TQBitmap, a mask and a hotspot.

    To associate a cursor with a widget, use TQWidget::setCursor(). To associate a cursor with all widgets (normally for a short period -of time), use TQApplication::setOverrideCursor(). +of time), use TQApplication::setOverrideCursor().

    To set a cursor shape use TQCursor::setShape() or use the TQCursor constructor which takes the shape as argument, or you can use one of the predefined cursors defined in the CursorShape enum. @@ -196,7 +196,7 @@ cursors.

    void TQCursor::cleanup () [static]

    Internal function that deinitializes the predefined cursors. -This function is called from the TQApplication destructor. +This function is called from the TQApplication destructor.

    See also initialize().

    HANDLE TQCursor::handle () const @@ -214,7 +214,7 @@ standard cursors.

    void TQCursor::initialize () [static]

    Internal function that initializes the predefined cursors. -This function is called from the TQApplication constructor. +This function is called from the TQApplication constructor.

    See also cleanup().

    const TQBitmap * TQCursor::mask () const diff --git a/doc/html/tqcustomevent.html b/doc/html/tqcustomevent.html index e29b1c0dd..f8626d291 100644 --- a/doc/html/tqcustomevent.html +++ b/doc/html/tqcustomevent.html @@ -49,8 +49,8 @@ The TQCustomEvent class provides support for custom events.

    TQCustomEvent is a generic event class for user-defined events. User defined events can be sent to widgets or other TQObject -instances using TQApplication::postEvent() or -TQApplication::sendEvent(). Subclasses of TQObject can easily +instances using TQApplication::postEvent() or +TQApplication::sendEvent(). Subclasses of TQObject can easily receive custom events by implementing the TQObject::customEvent() event handler function.

    TQCustomEvent objects should be created with a type ID that @@ -81,7 +81,7 @@ suitable for your event type. // To send an event of this custom event type: ColorChangeEvent* ce = new ColorChangeEvent( blue ); - TQApplication::postEvent( receiver, ce ); // TQt will delete it when done + TQApplication::postEvent( receiver, ce ); // TQt will delete it when done // To receive an event of this custom event type: @@ -94,7 +94,7 @@ suitable for your event type. } -

    See also TQWidget::customEvent(), TQApplication::notify(), and Event Classes. +

    See also TQWidget::customEvent(), TQApplication::notify(), and Event Classes.


    Member Function Documentation

    TQCustomEvent::TQCustomEvent ( int type ) diff --git a/doc/html/tqdatasource.html b/doc/html/tqdatasource.html index c5267c3fb..f31e7832f 100644 --- a/doc/html/tqdatasource.html +++ b/doc/html/tqdatasource.html @@ -64,7 +64,7 @@ If this function is called with on set to TRUE, and rewind() function to subsequently operate as described. If rewindable() is FALSE, the function should call TQDataSource::enableRewind(), which aborts with -a tqFatal() error. +a tqFatal() error.

    For example, a network connection may choose to use a disk cache of input only if rewinding is enabled before the first buffer-full of data is discarded, returning FALSE in rewindable() if that first buffer diff --git a/doc/html/tqdatetime.html b/doc/html/tqdatetime.html index 0e9c2d440..707b3f51d 100644 --- a/doc/html/tqdatetime.html +++ b/doc/html/tqdatetime.html @@ -244,7 +244,7 @@ is negative if dt is earlier than this datetime).

         TQDateTime dt = TQDateTime::currentDateTime();
         TQDateTime xmas( TQDate(dt.date().year(),12,24), TQTime(17,00) );
    -    tqDebug( "There are %d seconds to Christmas", dt.secsTo(xmas) );
    +    tqDebug( "There are %d seconds to Christmas", dt.secsTo(xmas) );
         

    See also addSecs(), daysTo(), and TQTime::secsTo(). diff --git a/doc/html/tqdesktopwidget.html b/doc/html/tqdesktopwidget.html index 2977ae116..a32e86fa2 100644 --- a/doc/html/tqdesktopwidget.html +++ b/doc/html/tqdesktopwidget.html @@ -95,7 +95,7 @@ Creates the desktop widget. the size of the virtual desktop; otherwise this widget will have the size of the primary screen.

    Instead of using TQDesktopWidget directly, use -TQApplication::desktop(). +TQApplication::desktop().

    TQDesktopWidget::~TQDesktopWidget ()

    @@ -149,7 +149,7 @@ Returns a widget that represents the screen with index screen. This widget can be used to draw directly on the desktop, using an unclipped painter like this:

    -    TQPainter paint( TQApplication::desktop()->screen( 0 ), TRUE );
    +    TQPainter paint( TQApplication::desktop()->screen( 0 ), TRUE );
         paint.draw...
         ...
         paint.end();
    diff --git a/doc/html/tqdialog.html b/doc/html/tqdialog.html
    index f8d072887..0c8fbad3f 100644
    --- a/doc/html/tqdialog.html
    +++ b/doc/html/tqdialog.html
    @@ -112,7 +112,7 @@ setModal(TRUE) is especially useful for progress dialogs, where
     the user must have the ability to interact with the dialog, e.g.
     to cancel a long running operation. If you use show() and
     setModal(TRUE) together you must call
    -TQApplication::processEvents() periodically during processing to
    +TQApplication::processEvents() periodically during processing to
     enable the user to interact with the dialog. (See TQProgressDialog.)
     

    Modeless Dialogs @@ -188,13 +188,13 @@ event loop.
        int main( int argc, char **argv )
         {
    -        TQApplication a( argc, argv );
    +        TQApplication a( argc, argv );
     
            int scale = 10;
     
            LifeDialog *life = new LifeDialog( scale );
    -        a.setMainWidget( life );
    +        a.setMainWidget( life );
             life->setCaption("TQt Example - Life");
             life->show();
    -
            return a.exec();
    +
            return a.exec();
         }
     

    See also TQTabDialog, TQWidget, TQProgressDialog, GUI Design Handbook: Dialogs, Standard, Abstract Widget Classes, and Dialog Classes. @@ -239,9 +239,9 @@ is shown with exec(), done() causes the and exec() to return r.

    As with TQWidget::close(), done() deletes the dialog if the WDestructiveClose flag is set. If the dialog is the application's main widget, the application terminates. If the dialog is the -last window closed, the TQApplication::lastWindowClosed() signal is +last window closed, the TQApplication::lastWindowClosed() signal is emitted. -

    See also accept(), reject(), TQApplication::mainWidget(), and TQApplication::quit(). +

    See also accept(), reject(), TQApplication::mainWidget(), and TQApplication::quit().

    int TQDialog::exec () [slot]

    diff --git a/doc/html/tqdict.html b/doc/html/tqdict.html index 52fb5a789..f3d034688 100644 --- a/doc/html/tqdict.html +++ b/doc/html/tqdict.html @@ -363,7 +363,7 @@ constructor).

    Debugging-only function that prints out the dictionary -distribution using tqDebug(). +distribution using tqDebug().

    type * TQDict::take ( const TQString & key )

    diff --git a/doc/html/tqdir-example.html b/doc/html/tqdir-example.html index 1559e8094..6144bb26d 100644 --- a/doc/html/tqdir-example.html +++ b/doc/html/tqdir-example.html @@ -47,7 +47,7 @@ body { background: #ffffff; color: black; } #include "../dirview/dirview.h" #include "tqdir.h" -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqtextview.h> #include <tqfileinfo.h> #include <tqfile.h> @@ -328,7 +328,7 @@ int main( int argc, char ** argv ) TQString caption; bool preview = FALSE; bool custom = FALSE; - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); for (int i=1; i<argc; i++) { TQString arg = argv[i]; if ( arg == "-any" ) @@ -344,7 +344,7 @@ int main( int argc, char ** argv ) else if ( arg == "-custom" ) custom = TRUE; else if ( arg[0] == '-' ) { - tqDebug("Usage: tqdir [-any | -dir | -custom] [-preview] [-default f] {-filter f} [caption ...]\n" + tqDebug("Usage: tqdir [-any | -dir | -custom] [-preview] [-default f] {-filter f} [caption ...]\n" " -any Get any filename, need not exist.\n" " -dir Return a directory rather than a file.\n" " -custom Opens a customized TQFileDialog with \n" diff --git a/doc/html/tqdir.html b/doc/html/tqdir.html index bd578e9a1..604502d3c 100644 --- a/doc/html/tqdir.html +++ b/doc/html/tqdir.html @@ -135,7 +135,7 @@ common paths is provided with the static functions, currenthome() and root() which return TQDir objects or currentDirPath(), homeDirPath() and rootDirPath() which return the path as a string. If you want to know about your application's path use -TQApplication::applicationDirPath(). +TQApplication::applicationDirPath().

    The number of entries in a directory is returned by count(). Obtain a string list of the names of all the files and directories in a directory with entryList(). If you prefer a list of TQFileInfo @@ -165,18 +165,18 @@ for a function in the underlying operating system use

         TQDir d( "example" );                        // "./example"
         if ( !d.exists() )
    -        tqWarning( "Cannot find the example directory" );
    +        tqWarning( "Cannot find the example directory" );
         

    Traversing directories and reading a file.

         TQDir d = TQDir::root();                      // "/"
         if ( !d.cd("tmp") ) {                       // "/tmp"
    -        tqWarning( "Cannot find the \"/tmp\" directory" );
    +        tqWarning( "Cannot find the \"/tmp\" directory" );
         } else {
             TQFile f( d.filePath("ex1.txt") );       // "/tmp/ex1.txt"
             if ( !f.open(IO_ReadWrite) )
    -            tqWarning( "Cannot create the file %s", f.name() );
    +            tqWarning( "Cannot create the file %s", f.name() );
         }
         
    @@ -205,7 +205,7 @@ for a function in the underlying operating system use }
    -

    See also TQApplication::applicationDirPath() and Input/Output and Networking. +

    See also TQApplication::applicationDirPath() and Input/Output and Networking.


    Member Type Documentation

    TQDir::FilterSpec

    @@ -583,7 +583,7 @@ this function returns FALSE. If you want to test for this use TQDir d( "/tmp/root_link" ); d = d.canonicalPath(); if ( d.isRoot() ) - tqWarning( "It is a root link" ); + tqWarning( "It is a root link" );

    See also root() and rootDirPath(). @@ -639,7 +639,7 @@ FALSE. TQDir d1( "/usr/local/bin" ); TQDir d2( "bin" ); if ( d1 != d2 ) - tqDebug( "They differ" ); + tqDebug( "They differ" ); @@ -664,7 +664,7 @@ returns FALSE. TQDir d2( "bin" ); d2.convertToAbs(); if ( d1 == d2 ) - tqDebug( "They're the same" ); + tqDebug( "They're the same" ); diff --git a/doc/html/tqerrormessage.html b/doc/html/tqerrormessage.html index d965c9078..6bf816711 100644 --- a/doc/html/tqerrormessage.html +++ b/doc/html/tqerrormessage.html @@ -62,8 +62,8 @@ display messages which you don't need the user to see more than once. To use TQErrorMessage like this, you create the dialog in the usual way and call the message() slot, or connect signals to it.

  • For developers. In this context the static qtHandler() installs -a message handler using qInstallMsgHandler() and creates a TQErrorMessage -that displays tqDebug(), tqWarning() and tqFatal() messages. +a message handler using qInstallMsgHandler() and creates a TQErrorMessage +that displays tqDebug(), tqWarning() and tqFatal() messages.

    In both cases TQErrorMessage will queue pending messages, and display them (or not) in order, as soon as the user presses Enter or clicks OK diff --git a/doc/html/tqevent.html b/doc/html/tqevent.html index a67c9018f..0c9b46753 100644 --- a/doc/html/tqevent.html +++ b/doc/html/tqevent.html @@ -52,13 +52,13 @@ The TQEvent class is the base class of all event classes. Event objects contain event parameters.

    -

    TQt's main event loop (TQApplication::exec()) fetches native window +

    TQt's main event loop (TQApplication::exec()) fetches native window system events from the event queue, translates them into TQEvents and sends the translated events to TQObjects.

    In general, events come from the underlying window system (spontaneous() returns TRUE) but it is also possible to manually -send events using TQApplication::sendEvent() and -TQApplication::postEvent() (spontaneous() returns FALSE). +send events using TQApplication::sendEvent() and +TQApplication::postEvent() (spontaneous() returns FALSE).

    TQObjects receive events by having their TQObject::event() function called. The function can be reimplemented in subclasses to customize event handling and add additional event types; @@ -69,7 +69,7 @@ object to intercept events destined for another object.

    The basic TQEvent contains only an event type parameter. Subclasses of TQEvent contain additional parameters that describe the particular event. -

    See also TQObject::event(), TQObject::installEventFilter(), TQWidget::event(), TQApplication::sendEvent(), TQApplication::postEvent(), TQApplication::processEvents(), Environment Classes, and Event Classes. +

    See also TQObject::event(), TQObject::installEventFilter(), TQWidget::event(), TQApplication::sendEvent(), TQApplication::postEvent(), TQApplication::processEvents(), Environment Classes, and Event Classes.


    Member Type Documentation

    TQEvent::Type

    @@ -165,7 +165,7 @@ maximized or full-screen, has changed. See T

    TQEvent::~TQEvent () [virtual]

    -Destroys the event. If it was posted, +Destroys the event. If it was posted, it will be removed from the list of events to be posted.

    bool TQEvent::spontaneous () const diff --git a/doc/html/tqeventloop.html b/doc/html/tqeventloop.html index fa115503f..267855afe 100644 --- a/doc/html/tqeventloop.html +++ b/doc/html/tqeventloop.html @@ -69,7 +69,7 @@ The TQEventLoop class manages the event queue.

    It receives events from the window system and other sources. It -then sends them to TQApplication for processing and delivery. +then sends them to TQApplication for processing and delivery.

    TQEventLoop allows the application programmer to have more control over event delivery. Programs that perform long operations can call either processOneEvent() or processEvents() with various @@ -104,8 +104,8 @@ A typedef to allow various ProcessEvents values to be OR'ed together.

    Creates a TQEventLoop object, this object becomes the global event loop object. There can only be one event loop object. The TQEventLoop is usually constructed -by calling TQApplication::eventLoop(). To create your own event loop object create -it before you instantiate the TQApplication object. +by calling TQApplication::eventLoop(). To create your own event loop object create +it before you instantiate the TQApplication object.

    The parent and name arguments are passed on to the TQObject constructor.

    TQEventLoop::~TQEventLoop () @@ -161,7 +161,7 @@ exec() to start a local event loop. special function whenever there are no pending events, use a TQTimer with 0 timeout. More advanced idle processing schemes can be achieved using processEvents(). -

    See also TQApplication::quit(), exit(), and processEvents(). +

    See also TQApplication::quit(), exit(), and processEvents().

    void TQEventLoop::exit ( int retcode = 0 ) [virtual]

    @@ -173,7 +173,7 @@ value indicates an error.

    Note that unlike the C library function of the same name, this function does return to the caller -- it is event processing that stops. -

    See also TQApplication::quit() and exec(). +

    See also TQApplication::quit() and exec().

    void TQEventLoop::exitLoop () [virtual]

    diff --git a/doc/html/tqfile.html b/doc/html/tqfile.html index 1bbaca399..ff845a39c 100644 --- a/doc/html/tqfile.html +++ b/doc/html/tqfile.html @@ -219,7 +219,7 @@ Returns a human-readable description of the reason of an error that occurred on the device. The error described by the string corresponds to changes of TQIODevice::status(). If the status is reset, the error string is also reset.

    The returned strings are not translated with the TQObject::tr() or -TQApplication::translate() functions. They are marked as translatable +TQApplication::translate() functions. They are marked as translatable strings in the "TQFile" context. Before you show the string to the user you should translate it first, for example:

    @@ -228,7 +228,7 @@ should translate it first, for example:
                 TQMessageBox::critical(
                     this,
                     tr("Open failed"),
    -                tr("Could not open file for reading: %1").arg( tqApp->translate("TQFile",f.errorString()) )
    +                tr("Could not open file for reading: %1").arg( tqApp->translate("TQFile",f.errorString()) )
                     );
                 return;
             }
    diff --git a/doc/html/tqfileinfo.html b/doc/html/tqfileinfo.html
    index c893307a6..52cd5286f 100644
    --- a/doc/html/tqfileinfo.html
    +++ b/doc/html/tqfileinfo.html
    @@ -410,9 +410,9 @@ always returns TRUE.
     
             TQFileInfo fi( "/tmp/archive.tar.gz" );
             if ( fi.permission( TQFileInfo::WriteUser | TQFileInfo::ReadGroup ) )
    -            tqWarning( "I can change the file; my group can read the file" );
    +            tqWarning( "I can change the file; my group can read the file" );
             if ( fi.permission( TQFileInfo::WriteGroup | TQFileInfo::WriteOther ) )
    -            tqWarning( "The group or others can change the file" );
    +            tqWarning( "The group or others can change the file" );
         

    See also isReadable(), isWritable(), and isExecutable(). diff --git a/doc/html/tqfont.html b/doc/html/tqfont.html index fde1552bf..d1344d9c0 100644 --- a/doc/html/tqfont.html +++ b/doc/html/tqfont.html @@ -129,7 +129,7 @@ actually used are retrievable from a TQFontInfo ob window system provides an exact match exactMatch() returns TRUE. Use TQFontMetrics to get measurements, e.g. the pixel length of a string using TQFontMetrics::width(). -

    Use TQApplication::setFont() to set the application's default font. +

    Use TQApplication::setFont() to set the application's default font.

    If a choosen X11 font does not include all the characters that need to be displayed, TQFont will try to find the characters in the nearest equivalent fonts. When a TQPainter draws a character from a @@ -248,7 +248,7 @@ system, use a TQFontInfo object, e.g. comp.fonts FAQ. Information on encodings can be found from Roman Czyborra's page. -

    See also TQFontMetrics, TQFontInfo, TQFontDatabase, TQApplication::setFont(), TQWidget::font, TQPainter::setFont(), TQFont::StyleHint, TQFont::Weight, Widget Appearance and Style, Graphics Classes, and Implicitly and Explicitly Shared Classes. +

    See also TQFontMetrics, TQFontInfo, TQFontDatabase, TQApplication::setFont(), TQWidget::font, TQPainter::setFont(), TQFont::StyleHint, TQFont::Weight, Widget Appearance and Style, Graphics Classes, and Implicitly and Explicitly Shared Classes.


    Member Type Documentation

    TQFont::Script

    @@ -447,7 +447,7 @@ ultralight, whilst 99 will be an extremely black.

    TQFont::TQFont ()

    Constructs a font object that uses the application's default font. -

    See also TQApplication::setFont() and TQApplication::font(). +

    See also TQApplication::setFont() and TQApplication::font().

    TQFont::TQFont ( const TQString & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )

    @@ -460,7 +460,7 @@ available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the font matching algorithm. -

    See also Weight, setFamily(), setPointSize(), setWeight(), setItalic(), setStyleHint(), and TQApplication::font(). +

    See also Weight, setFamily(), setPointSize(), setWeight(), setItalic(), setStyleHint(), and TQApplication::font().

    TQFont::TQFont ( const TQFont & font )

    @@ -492,7 +492,7 @@ hint.

    TQFont TQFont::defaultFont () [static]

    This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

    Please use TQApplication::font() instead. +

    Please use TQApplication::font() instead.

    bool TQFont::dirty () const [protected]

    @@ -670,7 +670,7 @@ Returns a new TQFont that has attributes copied from other.

    Examples: menu/menu.cpp and themes/metal.cpp.

    void TQFont::setDefaultFont ( const TQFont & f ) [static]

    This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

    Please use TQApplication::setFont() instead. +

    Please use TQApplication::setFont() instead.

    void TQFont::setFamily ( const TQString & family )

    diff --git a/doc/html/tqfontdatabase.html b/doc/html/tqfontdatabase.html index 21b488012..8f1579ed4 100644 --- a/doc/html/tqfontdatabase.html +++ b/doc/html/tqfontdatabase.html @@ -103,18 +103,18 @@ description of a script using scriptSample().

    Example:

    -#include <ntqapplication.h>
    +#include <tqapplication.h>
     #include <tqfontdatabase.h>
     #include <else.h>
     
     int main( int argc, char **argv )
     {
    -    TQApplication app( argc, argv );
    +    TQApplication app( argc, argv );
         TQFontDatabase fdb;
         TQStringList families = fdb.families();
         for ( TQStringList::Iterator f = families.begin(); f != families.end(); ++f ) {
             TQString family = *f;
    -        tqDebug( family );
    +        tqDebug( family );
             TQStringList styles = fdb.styles( family );
             for ( TQStringList::Iterator s = styles.begin(); s != styles.end(); ++s ) {
                 TQString style = *s;
    @@ -125,7 +125,7 @@ int main( int argc, char **argv )
                     dstyle += TQString::number( *points ) + " ";
                 }
                 dstyle = dstyle.left( dstyle.length() - 1 ) + ")";
    -            tqDebug( dstyle );
    +            tqDebug( dstyle );
             }
         }
         return 0;
    diff --git a/doc/html/tqglcolormap.html b/doc/html/tqglcolormap.html
    index e0046648b..86ebe77de 100644
    --- a/doc/html/tqglcolormap.html
    +++ b/doc/html/tqglcolormap.html
    @@ -78,12 +78,12 @@ in child widgets.
         Classes).
     

    Example of use:

    -    #include <ntqapplication.h>
    +    #include <tqapplication.h>
         #include <tqglcolormap.h>
     
         int main()
         {
    -        TQApplication a( argc, argv );
    +        TQApplication a( argc, argv );
     
             MySuperGLWidget widget( 0 ); // A TQGLWidget in color-index mode
             TQGLColormap colormap;
    @@ -95,7 +95,7 @@ in child widgets.
     
             widget.setColormap( colormap );
             widget.show();
    -        return a.exec();
    +        return a.exec();
         }
         
    diff --git a/doc/html/tqglformat.html b/doc/html/tqglformat.html index c8b59c49d..f2c6a9c61 100644 --- a/doc/html/tqglformat.html +++ b/doc/html/tqglformat.html @@ -130,7 +130,7 @@ requested features the system was able to provide: if ( !w->format().stereo() ) { // ok, goggles off if ( !w->format().hasOverlay() ) { - tqFatal( "Cool hardware required" ); + tqFatal( "Cool hardware required" ); } }
    @@ -171,9 +171,9 @@ in classes derived from TQGLWidget, for example: : TQGLWidget( TQGLFormat( StencilBuffer | AlphaChannel ), parent, name ) { if ( !format().stencil() ) - tqWarning( "Could not get stencil buffer; results will be suboptimal" ); + tqWarning( "Could not get stencil buffer; results will be suboptimal" ); if ( !format().alphaChannel() ) - tqWarning( "Could not get alpha channel; results will be suboptimal" ); + tqWarning( "Could not get alpha channel; results will be suboptimal" ); ... }
    @@ -255,7 +255,7 @@ FALSE. Double buffering is enabled by default.

    Returns TRUE if the window system has any OpenGL support; otherwise returns FALSE. -

    Warning: This function must not be called until the TQApplication +

    Warning: This function must not be called until the TQApplication object has been created.

    bool TQGLFormat::hasOpenGLOverlays () [static] @@ -263,7 +263,7 @@ object has been created.

    Returns TRUE if the window system supports OpenGL overlays; otherwise returns FALSE. -

    Warning: This function must not be called until the TQApplication +

    Warning: This function must not be called until the TQApplication object has been created.

    bool TQGLFormat::hasOverlay () const @@ -312,7 +312,7 @@ Sets a new default TQGLFormat for the application to f. For example, to set single buffering as the default instead of double buffering, your main() might contain code like this:
    -    TQApplication a(argc, argv);
    +    TQApplication a(argc, argv);
         TQGLFormat f;
         f.setDoubleBuffer( FALSE );
         TQGLFormat::setDefaultFormat( f );
    diff --git a/doc/html/tqglobal-h.html b/doc/html/tqglobal-h.html
    index fe52090e8..a6dade0be 100644
    --- a/doc/html/tqglobal-h.html
    +++ b/doc/html/tqglobal-h.html
    @@ -768,17 +768,17 @@ class TQDataStream;
     
     #if !defined(QT_MOC)
     #if defined(TQCONFIG_LOCAL)
    -#include "qconfig-local.h"
    +#include "tqconfig-local.h"
     #elif defined(TQCONFIG_MINIMAL)
    -#include "qconfig-minimal.h"
    +#include "tqconfig-minimal.h"
     #elif defined(TQCONFIG_SMALL)
    -#include "qconfig-small.h"
    +#include "tqconfig-small.h"
     #elif defined(TQCONFIG_MEDIUM)
    -#include "qconfig-medium.h"
    +#include "tqconfig-medium.h"
     #elif defined(TQCONFIG_LARGE)
    -#include "qconfig-large.h"
    +#include "tqconfig-large.h"
     #else // everything...
    -#include "ntqconfig.h"
    +#include "tqconfig.h"
     #endif
     #endif
     
    @@ -788,7 +788,7 @@ class TQDataStream;
     #endif
     
     // prune to local config
    -#include "ntqmodules.h"
    +#include "tqmodules.h"
     #ifndef TQT_MODULE_DIALOGS
     # define TQT_NO_DIALOG
     #endif
    diff --git a/doc/html/tqguardedptr.html b/doc/html/tqguardedptr.html
    index 410265727..992cd31ae 100644
    --- a/doc/html/tqguardedptr.html
    +++ b/doc/html/tqguardedptr.html
    @@ -74,7 +74,7 @@ test the pointer for validity.
             if ( label)
                 label->show();
             else
    -            tqDebug("The label has been destroyed");
    +            tqDebug("The label has been destroyed");
         

    The program will output The label has been destroyed rather diff --git a/doc/html/tqintcache.html b/doc/html/tqintcache.html index e6d6a71e1..a72ef3ee4 100644 --- a/doc/html/tqintcache.html +++ b/doc/html/tqintcache.html @@ -206,7 +206,7 @@ This should be a bit larger than count() is likely to be.

    A debug-only utility function. Prints out cache usage, hit/miss, -and distribution information using tqDebug(). This function does +and distribution information using tqDebug(). This function does nothing in the release library.

    type * TQIntCache::take ( long k ) diff --git a/doc/html/tqintdict.html b/doc/html/tqintdict.html index 4ae68ebfa..d25f1a99f 100644 --- a/doc/html/tqintdict.html +++ b/doc/html/tqintdict.html @@ -276,7 +276,7 @@ constructor).

    Debugging-only function that prints out the dictionary -distribution using tqDebug(). +distribution using tqDebug().

    type * TQIntDict::take ( long key )

    diff --git a/doc/html/tqlistboxitem.html b/doc/html/tqlistboxitem.html index 8790d486d..94cc06b35 100644 --- a/doc/html/tqlistboxitem.html +++ b/doc/html/tqlistboxitem.html @@ -96,7 +96,7 @@ Destroys the list box item.

    Implement this function to return the height of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.

    The default implementation returns -TQApplication::globalStrut()'s height. +TQApplication::globalStrut()'s height.

    See also paint() and width().

    Reimplemented in TQListBoxText and TQListBoxPixmap. @@ -199,7 +199,7 @@ Returns the text of the item. This text is also used for sorting.

    Reimplement this function to return the width of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.

    The default implementation returns -TQApplication::globalStrut()'s width. +TQApplication::globalStrut()'s width.

    See also paint() and height().

    Reimplemented in TQListBoxText and TQListBoxPixmap. diff --git a/doc/html/tqmap.html b/doc/html/tqmap.html index a47aff444..4c296c9a1 100644 --- a/doc/html/tqmap.html +++ b/doc/html/tqmap.html @@ -162,7 +162,7 @@ the STL-like functions if preferred. int main(int argc, char **argv) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); typedef TQMap<TQString, Employee> EmployeeMap; EmployeeMap map; diff --git a/doc/html/tqmemarray.html b/doc/html/tqmemarray.html index d49fea400..6ee45bdb2 100644 --- a/doc/html/tqmemarray.html +++ b/doc/html/tqmemarray.html @@ -121,7 +121,7 @@ constructor). TQValueVector provides an STL-compatible syntax and is TQMemArray<int> fib( int num ) // returns fibonacci array { - Q_ASSERT( num > 2 ); + Q_ASSERT( num > 2 ); TQMemArray<int> f( num ); // array of ints f[0] = f[1] = 1; @@ -135,10 +135,10 @@ constructor). TQValueVector provides an STL-compatible syntax and is { TQMemArray<int> a = fib( 6 ); // get first 6 fibonaccis for ( int i = 0; i < a.size(); i++ ) - tqDebug( "%d: %d", i, a[i] ); + tqDebug( "%d: %d", i, a[i] ); - tqDebug( "1 is found %d times", a.contains(1) ); - tqDebug( "5 is found at index %d", a.find(5) ); + tqDebug( "1 is found %d times", a.contains(1) ); + tqDebug( "5 is found at index %d", a.find(5) ); return 0; } diff --git a/doc/html/tqmenubar.html b/doc/html/tqmenubar.html index 12c8b38d5..2f92f5c2b 100644 --- a/doc/html/tqmenubar.html +++ b/doc/html/tqmenubar.html @@ -170,7 +170,7 @@ the Application Menu quit or exit Application Menu | Quit If this entry is not found a default Quit item will be -created to call TQApplication::quit() +created to call TQApplication::quit()

    menu/menu.cpp is an example of TQMenuBar and TQPopupMenu use. diff --git a/doc/html/tqmessagebox-h.html b/doc/html/tqmessagebox-h.html index f43f4d114..da5b08063 100644 --- a/doc/html/tqmessagebox-h.html +++ b/doc/html/tqmessagebox-h.html @@ -235,7 +235,7 @@ private: // Disabled copy constructor and operator= /* * Macro to be used at the beginning of main(), e.g. * -* #include <ntqapplication.h> +* #include <tqapplication.h> * #include <tqmessagebox.h> * int main( int argc, char**argv ) * { diff --git a/doc/html/tqmessagebox.html b/doc/html/tqmessagebox.html index 33fe75b23..77f834b7c 100644 --- a/doc/html/tqmessagebox.html +++ b/doc/html/tqmessagebox.html @@ -389,11 +389,11 @@ Displays a simple about box with caption caption and text text

    1. It prefers parent->icon() if that exists.
    2. If not, it tries the top-level widget containing parent. -
    3. If that fails, it tries the main widget. +
    4. If that fails, it tries the main widget.
    5. As a last resort it uses the Information icon.

    The about box has a single button labelled "OK". -

    See also TQWidget::icon and TQApplication::mainWidget(). +

    See also TQWidget::icon and TQApplication::mainWidget().

    Examples: action/application.cpp, application/application.cpp, chart/chartform.cpp, helpviewer/helpwindow.cpp, mdi/application.cpp, menu/menu.cpp, and themes/themes.cpp.

    void TQMessageBox::aboutTQt ( TQWidget * parent, const TQString & caption = TQString::null ) [static] @@ -403,8 +403,8 @@ and centered over parent (if parent is not 0). The message includes the version number of TQt being used by the application.

    This is useful for inclusion in the Help menu of an application. See the examples/menu/menu.cpp example. -

    TQApplication provides this functionality as a slot. -

    See also TQApplication::aboutTQt(). +

    TQApplication provides this functionality as a slot. +

    See also TQApplication::aboutTQt().

    Examples: action/application.cpp, application/application.cpp, chart/chartform.cpp, helpviewer/helpwindow.cpp, menu/menu.cpp and themes/themes.cpp.

    void TQMessageBox::adjustSize () [virtual] diff --git a/doc/html/tqmotifstyle.html b/doc/html/tqmotifstyle.html index 9572485a8..eb3dd93f3 100644 --- a/doc/html/tqmotifstyle.html +++ b/doc/html/tqmotifstyle.html @@ -68,7 +68,7 @@ If arg is FALSE, the style will polish the application's color palette to emulate the Motif way of highlighting, which is a simple inversion between the base and the text color.

    The effect will show up the next time an application palette is -set via TQApplication::setPalette(). The current color palette of +set via TQApplication::setPalette(). The current color palette of the application remains unchanged.

    See also TQStyle::polish(). diff --git a/doc/html/tqnamespace-h.html b/doc/html/tqnamespace-h.html index 284f58728..c19218310 100644 --- a/doc/html/tqnamespace-h.html +++ b/doc/html/tqnamespace-h.html @@ -737,7 +737,7 @@ public: CustomPattern=24 }; - // documented in qapplication_mac.cpp + // documented in tqapplication_mac.cpp enum MacintoshVersion { //Unknown MV_Unknown = 0x0000, @@ -758,7 +758,7 @@ public: MV_TIGER = MV_10_DOT_4 }; - // documented in qapplication_win.cpp + // documented in tqapplication_win.cpp enum WindowsVersion { WV_32s = 0x0001, WV_95 = 0x0002, @@ -928,7 +928,7 @@ public: }; // "handle" type for system objects. Documented as \internal in - // qapplication.cpp + // tqapplication.cpp #if defined(TQ_WS_MAC) typedef void * HANDLE; #elif defined(TQ_WS_WIN) diff --git a/doc/html/tqobject.html b/doc/html/tqobject.html index d1098dbc3..85cb488d0 100644 --- a/doc/html/tqobject.html +++ b/doc/html/tqobject.html @@ -35,7 +35,7 @@ body { background: #ffffff; color: black; }

    All the functions in this class are reentrant when TQt is built with thread support.

    #include <tqobject.h>

    Inherits TQt. --

    Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQWidget, TQCanvas, TQStyle, TQClipboard, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQNetworkOperation, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator. +-

    Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQWidget, TQCanvas, TQStyle, TQClipboard, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQNetworkOperation, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator.

    List of all member functions.

    Public Members

      @@ -231,7 +231,7 @@ child events.

      Child events are sent to objects when children are inserted or removed.

      Note that events with TQEvent::type() TQEvent::ChildInserted are -posted (with TQApplication::postEvent()) to make sure that the +posted (with TQApplication::postEvent()) to make sure that the child's construction is completed before this function is called.

      If a child is removed immediately after it is inserted, the ChildInserted event may be suppressed, but the ChildRemoved event will always be sent. In such cases it is possible that there @@ -239,7 +239,7 @@ will be a ChildRemoved event without a corresponding ChildInserted<

      If you change state based on ChildInserted events, call TQWidget::constPolish(), or do

      -        TQApplication::sendPostedEvents( this, TQEvent::ChildInserted );
      +        TQApplication::sendPostedEvents( this, TQEvent::ChildInserted );
           
      in functions that depend on the state. One notable example is @@ -484,7 +484,7 @@ This virtual function receives events to an object and should return TRUE if the event e was recognized and processed.

      The event() function can be reimplemented to customize the behavior of an object. -

      See also installEventFilter(), timerEvent(), TQApplication::sendEvent(), TQApplication::postEvent(), and TQWidget::event(). +

      See also installEventFilter(), timerEvent(), TQApplication::sendEvent(), TQApplication::postEvent(), and TQWidget::event().

      Reimplemented in TQWidget.

      bool TQObject::eventFilter ( TQObject * watched, TQEvent * e ) [virtual] @@ -521,7 +521,7 @@ TRUE; otherwise return FALSE. if ( obj == textEdit ) { if ( e->type() == TQEvent::KeyPress ) { TQKeyEvent *k = (TQKeyEvent*)ev; - tqDebug( "Ate key press %d", k->key() ); + tqDebug( "Ate key press %d", k->key() ); return TRUE; } else { return FALSE; @@ -615,7 +615,7 @@ monitored objects: if ( e->type() == TQEvent::KeyPress ) { // special processing for key press TQKeyEvent *k = (TQKeyEvent *)e; - tqDebug( "Ate key press %d", k->key() ); + tqDebug( "Ate key press %d", k->key() ); return TRUE; // eat event } else { // standard event processing @@ -856,7 +856,7 @@ used to find out which timer was activated. void MyObject::timerEvent( TQTimerEvent *e ) { - tqDebug( "timer event, id %d", e->timerId() ); + tqDebug( "timer event, id %d", e->timerId() ); } @@ -891,7 +891,7 @@ context. installed before calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior. -

      See also trUtf8(), TQApplication::translate(), and Internationalization with TQt. +

      See also trUtf8(), TQApplication::translate(), and Internationalization with TQt.

      Example: network/networkprotocol/view.cpp.

      TQString TQObject::trUtf8 ( const char * sourceText, const char * comment ) [static] @@ -905,7 +905,7 @@ version. It is otherwise identical to tr(sourceText, installed before calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior. -

      See also tr() and TQApplication::translate(). +

      See also tr() and TQApplication::translate().


      Property Documentation

      TQCString name

      @@ -917,11 +917,11 @@ function. The object name is not very useful in the current version of TQt, but will become increasingly important in the future.

      If the object does not have a name, the name() function returns -"unnamed", so printf() (used in tqDebug()) will not be asked to +"unnamed", so printf() (used in tqDebug()) will not be asked to output a null pointer. If you want a null pointer to be returned for unnamed objects, you can call name( 0 ).

      -        tqDebug( "MyClass::setPrecision(): (%s) invalid precision %f",
      +        tqDebug( "MyClass::setPrecision(): (%s) invalid precision %f",
                       name(), newPrecision );
           
      diff --git a/doc/html/tqpaintdevice.html b/doc/html/tqpaintdevice.html index 446469e17..206d51f92 100644 --- a/doc/html/tqpaintdevice.html +++ b/doc/html/tqpaintdevice.html @@ -126,7 +126,7 @@ is implemented as the global function bitBlt(). bitBlt( myWidget, 10, 0, myWidget ); -

      Warning: TQt requires that a TQApplication object exists before +

      Warning: TQt requires that a TQApplication object exists before any paint devices can be created. Paint devices access window system resources, and these resources are not initialized before an application object is created. diff --git a/doc/html/tqpainter.html b/doc/html/tqpainter.html index 3d5cf510d..bf08f62b4 100644 --- a/doc/html/tqpainter.html +++ b/doc/html/tqpainter.html @@ -898,13 +898,13 @@ Draws a Windows focus rectangle with upper left corner at (x, y) and with width w and height h using a pen color that contrasts with bgColor.

      This function draws a stippled rectangle (XOR is not used) that is -used to indicate keyboard focus (when the TQApplication::style() is +used to indicate keyboard focus (when the TQApplication::style() is WindowStyle).

      The pen color used to draw the rectangle is either white or black depending on the color of bgColor (see TQColor::gray()).

      Warning: This function draws nothing if the coordinate system has been rotated or sheared. -

      See also drawRect() and TQApplication::style(). +

      See also drawRect() and TQApplication::style().

      void TQPainter::drawWinFocusRect ( int x, int y, int w, int h )

      @@ -912,10 +912,10 @@ This is an overloaded member function, provided for convenience. It behaves esse

      Draws a Windows focus rectangle with upper left corner at (x, y) and with width w and height h.

      This function draws a stippled XOR rectangle that is used to -indicate keyboard focus (when TQApplication::style() is WindowStyle). +indicate keyboard focus (when TQApplication::style() is WindowStyle).

      Warning: This function draws nothing if the coordinate system has been rotated or sheared. -

      See also drawRect() and TQApplication::style(). +

      See also drawRect() and TQApplication::style().

      void TQPainter::drawWinFocusRect ( const TQRect & r )

      @@ -1518,7 +1518,7 @@ using the painter p.

      If you want to use a TQFrame widget instead, you can make it display a plain rectangle, for example TQFrame::setFrameStyle( TQFrame::Box | TQFrame::Plain ).

      Warning: This function does not look at TQWidget::style() or -TQApplication::style(). Use the drawing functions in TQStyle to make +TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style.

      See also qDrawShadeRect() and TQStyle::drawPrimitive(). @@ -1539,7 +1539,7 @@ drawn in the TQColorGroup::mid() color.

      If you want to use a TQFrame widget instead, you can make it display a shaded line, for example TQFrame::setFrameStyle( TQFrame::HLine | TQFrame::Sunken ).

      Warning: This function does not look at TQWidget::style() or -TQApplication::style(). Use the drawing functions in TQStyle to make +TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style.

      See also qDrawShadeRect(), qDrawShadePanel(), and TQStyle::drawPrimitive(). @@ -1556,7 +1556,7 @@ the painter p.

      If you want to use a TQFrame widget instead, you can make it display a shaded panel, for example TQFrame::setFrameStyle( TQFrame::Panel | TQFrame::Sunken ).

      Warning: This function does not look at TQWidget::style() or -TQApplication::style(). Use the drawing functions in TQStyle to make +TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style.

      See also qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), and TQStyle::drawPrimitive(). @@ -1577,7 +1577,7 @@ drawn in the TQColorGroup::mid() color.

      If you want to use a TQFrame widget instead, you can make it display a shaded rectangle, for example TQFrame::setFrameStyle( TQFrame::Box | TQFrame::Raised ).

      Warning: This function does not look at TQWidget::style() or -TQApplication::style(). Use the drawing functions in TQStyle to make +TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style.

      See also qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), TQStyle::drawItem(), TQStyle::drawControl(), and TQStyle::drawComplexControl(). @@ -1591,7 +1591,7 @@ widgets that follow the current GUI style.

      The line width is 2 pixels.

      The button's interior is filled with the *fill brush unless fill is 0.

      Warning: This function does not look at TQWidget::style() or -TQApplication::style(). Use the drawing functions in TQStyle to make +TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style.

      See also qDrawWinPanel() and TQStyle::drawControl(). @@ -1607,7 +1607,7 @@ widgets that follow the current GUI style.

      If you want to use a TQFrame widget instead, you can make it display a shaded panel, for example TQFrame::setFrameStyle( TQFrame::WinPanel | TQFrame::Raised ).

      Warning: This function does not look at TQWidget::style() or -TQApplication::style(). Use the drawing functions in TQStyle to make +TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style.

      See also qDrawShadePanel(), qDrawWinButton(), and TQStyle::drawPrimitive(). diff --git a/doc/html/tqpalette.html b/doc/html/tqpalette.html index 1a6b7d64c..37265b295 100644 --- a/doc/html/tqpalette.html +++ b/doc/html/tqpalette.html @@ -100,7 +100,7 @@ to modify the palette. palette's color groups with setColor() and setBrush().

      You can copy a palette using the copy constructor and test to see if two palettes are identical using isCopyOf(). -

      See also TQApplication::setPalette(), TQWidget::palette, TQColorGroup, TQColor, Widget Appearance and Style, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes. +

      See also TQApplication::setPalette(), TQWidget::palette, TQColorGroup, TQColor, Widget Appearance and Style, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes.


      Member Type Documentation

      TQPalette::ColorGroup

      diff --git a/doc/html/tqprogressdialog.html b/doc/html/tqprogressdialog.html index 5bfb7e7b4..54125a361 100644 --- a/doc/html/tqprogressdialog.html +++ b/doc/html/tqprogressdialog.html @@ -115,7 +115,7 @@ operation. Use setAutoReset() and TQApplication::processEvents() or +must call TQApplication::processEvents() or TQEventLoop::processEvents(ExcludeUserInput) to keep the event loop running to ensure that the application doesn't freeze. Do the operation in a loop, call setProgress() at intervals, and check @@ -125,7 +125,7 @@ TQProgressDialog progress( "Copying files...", "Abort Copy", numFiles, this, "progress", TRUE ); for ( int i = 0; i < numFiles; i++ ) { progress.setProgress( i ); - tqApp->processEvents(); + tqApp->processEvents(); if ( progress.wasCanceled() ) break; @@ -373,7 +373,7 @@ this property to 0 and finally set it to in-between.

      Warning: If the progress dialog is modal (see TQProgressDialog::TQProgressDialog()), -this function calls TQApplication::processEvents(), so take care that +this function calls TQApplication::processEvents(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a TQProgressDialog inside a paintEvent()!

      See also totalSteps. diff --git a/doc/html/tqptrdict.html b/doc/html/tqptrdict.html index 8b6ca6d7d..a2dbd76c4 100644 --- a/doc/html/tqptrdict.html +++ b/doc/html/tqptrdict.html @@ -280,7 +280,7 @@ constructor).

      Debugging-only function that prints out the dictionary -distribution using tqDebug(). +distribution using tqDebug().

      type * TQPtrDict::take ( void * key )

      diff --git a/doc/html/tqsessionmanager.html b/doc/html/tqsessionmanager.html index eb8ab42d5..d918c5f2f 100644 --- a/doc/html/tqsessionmanager.html +++ b/doc/html/tqsessionmanager.html @@ -74,8 +74,8 @@ etc.

      TQSessionManager provides an interface between the application and the session manager so that the program can work well with the session manager. In TQt, session management requests for action -are handled by the two virtual functions TQApplication::commitData() -and TQApplication::saveState(). Both provide a reference to +are handled by the two virtual functions TQApplication::commitData() +and TQApplication::saveState(). Both provide a reference to a session manager object as argument, to allow the application to communicate with the session manager.

      During a session management action (i.e. within commitData() and @@ -141,7 +141,7 @@ released when the application exits.)

      If the user decides to cancel the shutdown process during the interaction phase, you must tell the session manager that this has happened by calling cancel(). -

      Here's an example of how an application's TQApplication::commitData() +

      Here's an example of how an application's TQApplication::commitData() might be implemented:

       void MyApplication::commitData( TQSessionManager& sm ) {
      @@ -173,7 +173,7 @@ void MyApplication::commitData( TQSessionManager& sm ) {
        
       

      If an error occurred within the application while saving its data, you may want to try allowsErrorInteraction() instead. -

      See also TQApplication::commitData(), release(), and cancel(). +

      See also TQApplication::commitData(), release(), and cancel().

      void TQSessionManager::cancel ()

      @@ -224,7 +224,7 @@ interaction phase.

      Requests a second session management phase for the application. The application may then return immediately from the -TQApplication::commitData() or TQApplication::saveState() function, +TQApplication::commitData() or TQApplication::saveState() function, and they will be called again once most or all other applications have finished their session management.

      The two phases are useful for applications such as the X11 window manager @@ -266,7 +266,7 @@ iterate over a copy, e.g.

      Returns the identifier of the current session.

      If the application has been restored from an earlier session, this identifier is the same as it was in that earlier session. -

      See also sessionKey() and TQApplication::sessionId(). +

      See also sessionKey() and TQApplication::sessionId().

      TQString TQSessionManager::sessionKey () const

      @@ -276,7 +276,7 @@ identifier is the same as it was in that earlier session. key is the same as it was when the previous session ended.

      The session key changes with every call of commitData() or saveState(). -

      See also sessionId() and TQApplication::sessionKey(). +

      See also sessionId() and TQApplication::sessionKey().

      void TQSessionManager::setDiscardCommand ( const TQStringList & )

      @@ -307,10 +307,10 @@ defaults to appname -session id
      -

      The -session option is mandatory; otherwise TQApplication cannot +

      The -session option is mandatory; otherwise TQApplication cannot tell whether it has been restored or what the current session -identifier is. See TQApplication::isSessionRestored() and -TQApplication::sessionId() for details. +identifier is. See TQApplication::isSessionRestored() and +TQApplication::sessionId() for details.

      If your application is very simple, it may be possible to store the entire application state in additional command line options. This is usually a very bad idea because command lines are often limited @@ -327,7 +327,7 @@ session. startup the hint is set to RestartIfRunning.

      Note that these flags are only hints, a session manager may or may not respect them. -

      We recommend setting the restart hint in TQApplication::saveState() +

      We recommend setting the restart hint in TQApplication::saveState() because most session managers perform a checkpoint shortly after an application's startup.

      See also restartHint(). diff --git a/doc/html/tqsjiscodec.html b/doc/html/tqsjiscodec.html index cda95a225..dfd167e6c 100644 --- a/doc/html/tqsjiscodec.html +++ b/doc/html/tqsjiscodec.html @@ -88,7 +88,7 @@ SUCH DAMAGE.

      TQSjisCodec::TQSjisCodec ()

      Creates a Shift-JIS codec. Note that this is done automatically by -the TQApplication, you do not need construct your own. +the TQApplication, you do not need construct your own.

      TQSjisCodec::~TQSjisCodec ()

      diff --git a/doc/html/tqsocket.html b/doc/html/tqsocket.html index 18cf443d9..a981d31fe 100644 --- a/doc/html/tqsocket.html +++ b/doc/html/tqsocket.html @@ -93,7 +93,7 @@ The TQSocket class provides a buffered TCP connection.

      It provides a totally non-blocking TQIODevice, and modifies and extends the API of TQIODevice with socket-specific code. -

      Note that a TQApplication must have been constructed before this +

      Note that a TQApplication must have been constructed before this class can be used.

      The functions you're likely to call most are connectToHost(), bytesAvailable(), canReadLine() and the ones it inherits from @@ -163,7 +163,7 @@ using TQSocketDevice instead. Creates a TQSocket object in TQSocket::Idle state.

      The parent and name arguments are passed on to the TQObject constructor. -

      Note that a TQApplication must have been constructed before sockets +

      Note that a TQApplication must have been constructed before sockets can be used.

      TQSocket::~TQSocket () [virtual] diff --git a/doc/html/tqsocketnotifier.html b/doc/html/tqsocketnotifier.html index 9452196ff..2db360748 100644 --- a/doc/html/tqsocketnotifier.html +++ b/doc/html/tqsocketnotifier.html @@ -96,7 +96,7 @@ block" error has occurred) is undefined. Depending on the operating system, it may fire on every pass of the event loop or not at all.

      If you need a time-out for your sockets you can use either timer events or the TQTimer class. -

      Socket action is detected in the main +

      Socket action is detected in the main event loop of TQt. The X11 version of TQt has a single UNIX select() call that incorporates all socket notifiers and the X socket. diff --git a/doc/html/tqsplashscreen.html b/doc/html/tqsplashscreen.html index 831fea0a8..138570743 100644 --- a/doc/html/tqsplashscreen.html +++ b/doc/html/tqsplashscreen.html @@ -82,17 +82,17 @@ following code snippet.

          int main( int argc, char **argv )
          {
      -       TQApplication app( argc, argv );
      +       TQApplication app( argc, argv );
              TQPixmap pixmap( "splash.png" );
              TQSplashScreen *splash = new TQSplashScreen( pixmap );
              splash->show();
              TQMainWindow *mainWin = new TQMainWindow;
              ...
      -       app.setMainWidget( mainWin );
      +       app.setMainWidget( mainWin );
              mainWin->show();
              splash->finish( mainWin );
              delete splash;
      -       return app.exec();
      +       return app.exec();
          }
          
      @@ -106,17 +106,17 @@ Alternatively, you can subclass TQSplashScreen and reimplement

      The user can hide the splash screen by clicking on it with the mouse. Since the splash screen is typically displayed before the event loop has started running, it is necessary to periodically -call TQApplication::processEvents() to receive the mouse clicks. +call TQApplication::processEvents() to receive the mouse clicks.

          TQPixmap pixmap( "splash.png" );
          TQSplashScreen *splash = new TQSplashScreen( pixmap );
          splash->show();
          ... // Loading some items
          splash->message( "Loaded modules" );
      -   tqApp->processEvents();
      +   tqApp->processEvents();
          ... // Establishing connections
          splash->message( "Established connections" );
      -   tqApp->processEvents();
      +   tqApp->processEvents();
          

      See also Miscellaneous Classes. @@ -170,7 +170,7 @@ does not have any of the text drawn by message() calls.

      void TQSplashScreen::repaint ()

      This overrides TQWidget::repaint(). It differs from the standard -repaint function in that it also calls TQApplication::flush() to +repaint function in that it also calls TQApplication::flush() to ensure the updates are displayed, even when there is no event loop present. diff --git a/doc/html/tqsqlcursor.html b/doc/html/tqsqlcursor.html index b68079c5f..f88598a43 100644 --- a/doc/html/tqsqlcursor.html +++ b/doc/html/tqsqlcursor.html @@ -126,7 +126,7 @@ and the values returned by value() are undefined.
                  TQSqlCursor cur( "staff" ); // Specify the table/view name
                   cur.select(); // We'll retrieve every record
                   while ( cur.next() ) {
      -                tqDebug( cur.value( "id" ).toString() + ": " +
      +                tqDebug( cur.value( "id" ).toString() + ": " +
                               cur.value( "surname" ).toString() + " " +
                               cur.value( "salary" ).toString() );
                   }
      diff --git a/doc/html/tqsqlquery.html b/doc/html/tqsqlquery.html
      index 58db878b6..ca4e3314f 100644
      --- a/doc/html/tqsqlquery.html
      +++ b/doc/html/tqsqlquery.html
      @@ -323,7 +323,7 @@ Returns a map of the bound values.
           TQMap<TQString, TQVariant>::ConstIterator it;
           TQMap<TQString, TQVariant> vals = query.boundValues();
           for ( it = vals.begin(); it != vals.end(); ++it )
      -        tqWarning( "Placeholder: " + it.key() + ", Value: " + (*it).toString() );
      +        tqWarning( "Placeholder: " + it.key() + ", Value: " + (*it).toString() );
           ...
       
           // Examine the bound values - bound using positional binding
      @@ -331,7 +331,7 @@ Returns a map of the bound values.
           TQValueList<TQVariant> list = query.boundValues().values();
           int i = 0;
           for ( it = list.begin(); it != list.end(); ++it )
      -        tqWarning( "Placeholder pos: %d, Value: " + (*it).toString(), i++ );
      +        tqWarning( "Placeholder pos: %d, Value: " + (*it).toString(), i++ );
           ...
       
           
      diff --git a/doc/html/tqstring.html b/doc/html/tqstring.html index 78bb1c9fb..054176257 100644 --- a/doc/html/tqstring.html +++ b/doc/html/tqstring.html @@ -466,7 +466,7 @@ natural language sentences does not usually translate well into other languages because sentence structure and word order often differ between languages.

      If there is no place marker (%1, %2, etc.), a warning -message (tqWarning()) is output and the result is undefined. +message (tqWarning()) is output and the result is undefined.

      Warning: If any placeholder occurs more than once, the result is undefined.

      TQString TQString::arg ( long a, int fieldWidth = 0, int base = 10 ) const diff --git a/doc/html/tqstyle.html b/doc/html/tqstyle.html index 4dd3ab7c5..be1169606 100644 --- a/doc/html/tqstyle.html +++ b/doc/html/tqstyle.html @@ -1016,10 +1016,10 @@ expected to work reasonably with all current and future widgets.

      See also unPolish(). -

      void TQStyle::polish ( TQApplication * ) [virtual] +

      void TQStyle::polish ( TQApplication * ) [virtual]

      This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Late initialization of the TQApplication object. +

      Late initialization of the TQApplication object.

      See also unPolish().

      void TQStyle::polish ( TQPalette & ) [virtual] @@ -1028,7 +1028,7 @@ This is an overloaded member function, provided for convenience. It behaves esse

      The style may have certain requirements for color palettes. In this function it has the chance to change the palette according to these requirements. -

      See also TQPalette and TQApplication::setPalette(). +

      See also TQPalette and TQApplication::setPalette().

      void TQStyle::polishPopupMenu ( TQPopupMenu * ) [pure virtual]

      @@ -1183,7 +1183,7 @@ style has to unpolish its settings before the new style can polish them again.

      See also polish(). -

      void TQStyle::unPolish ( TQApplication * ) [virtual] +

      void TQStyle::unPolish ( TQApplication * ) [virtual]

      This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

      Undoes the application polish. @@ -1196,7 +1196,7 @@ This is an overloaded member function, provided for convenience. It behaves esse rect for widget w is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode. -

      See also TQApplication::reverseLayout(). +

      See also TQApplication::reverseLayout().

      TQRect TQStyle::visualRect ( const TQRect & logical, const TQRect & bounding ) [static]

      @@ -1204,7 +1204,7 @@ This is an overloaded member function, provided for convenience. It behaves esse

      Returns the rect logical in screen coordinates. The rect bounding is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode. -

      See also TQApplication::reverseLayout(). +

      See also TQApplication::reverseLayout().


      diff --git a/doc/html/tqtextcodec.html b/doc/html/tqtextcodec.html index f196de136..6d9eb5afb 100644 --- a/doc/html/tqtextcodec.html +++ b/doc/html/tqtextcodec.html @@ -359,7 +359,7 @@ function returns 0 (the default), tr() assumes Latin-1. Deletes all the created codecs.

      Warning: Do not call this function. -

      TQApplication calls this function just before exiting to delete +

      TQApplication calls this function just before exiting to delete any TQTextCodec objects that may be lying around. Since various other classes hold pointers to TQTextCodec objects, it is not safe to call this function earlier. @@ -538,7 +538,7 @@ main() function might look like this:

           int main(int argc, char** argv)
           {
      -        TQApplication app(argc, argv);
      +        TQApplication app(argc, argv);
               ... install any additional codecs ...
               TQTextCodec::setCodecForTr( TQTextCodec::codecForName("eucKR") );
               ...
      diff --git a/doc/html/tqthread.html b/doc/html/tqthread.html
      index e521e69f5..8858f4aaa 100644
      --- a/doc/html/tqthread.html
      +++ b/doc/html/tqthread.html
      @@ -88,7 +88,7 @@ run() to include your code. For example:
           {
               for( int count = 0; count < 20; count++ ) {
                   sleep( 1 );
      -            tqDebug( "Ping!" );
      +            tqDebug( "Ping!" );
               }
           }
       
      diff --git a/doc/html/tqthreadstorage.html b/doc/html/tqthreadstorage.html
      index 984207711..3ab7fdd98 100644
      --- a/doc/html/tqthreadstorage.html
      +++ b/doc/html/tqthreadstorage.html
      @@ -106,7 +106,7 @@ used to exit or terminate a TQThread using TQThreadStorage. Doing so
       will cause all per-thread data to be leaked. See TQThread::exit()
       and TQThread::terminate().
       

    • TQThreadStorage can be used to store data for the main() -thread after TQApplication has been constructed. TQThreadStorage +thread after TQApplication has been constructed. TQThreadStorage deletes all data set for the main() thread when TQApplication is destroyed, regardless of whether or not the main() thread has actually finished. diff --git a/doc/html/tqtime.html b/doc/html/tqtime.html index d265b4ae9..3e1159a19 100644 --- a/doc/html/tqtime.html +++ b/doc/html/tqtime.html @@ -315,7 +315,7 @@ Sets this time to the current time. This is practical for timing: TQTime t; t.start(); some_lengthy_task(); - tqDebug( "Time elapsed: %d ms", t.elapsed() ); + tqDebug( "Time elapsed: %d ms", t.elapsed() );
    • See also restart(), elapsed(), and currentTime(). diff --git a/doc/html/tqtimer.html b/doc/html/tqtimer.html index e8b8029b8..3e1a5f786 100644 --- a/doc/html/tqtimer.html +++ b/doc/html/tqtimer.html @@ -140,15 +140,15 @@ to bother with a timerEvent or to create a local TQTimer object.

      Example:

      -        #include <ntqapplication.h>
      +        #include <tqapplication.h>
               #include <tqtimer.h>
       
               int main( int argc, char **argv )
               {
      -            TQApplication a( argc, argv );
      -            TQTimer::singleShot( 10*60*1000, &a, TQ_SLOT(quit()) );
      +            TQApplication a( argc, argv );
      +            TQTimer::singleShot( 10*60*1000, &a, TQ_SLOT(quit()) );
                       ... // create and show your widgets
      -            return a.exec();
      +            return a.exec();
               }
           
      diff --git a/doc/html/tqtranslator.html b/doc/html/tqtranslator.html index 28fedbab6..1a3f06ce7 100644 --- a/doc/html/tqtranslator.html +++ b/doc/html/tqtranslator.html @@ -72,22 +72,22 @@ look up translations, add new ones, remove them, load and save them, etc.

      The most common use of TQTranslator is to: load a translator file created with TQt Linguist, -install it using TQApplication::installTranslator(), and use it via +install it using TQApplication::installTranslator(), and use it via TQObject::tr(). For example:

           int main( int argc, char ** argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               TQTranslator translator( 0 );
               translator.load( "french.qm", "." );
      -        app.installTranslator( &translator );
      +        app.installTranslator( &translator );
       
               MyWidget m;
      -        app.setMainWidget( &m );
      +        app.setMainWidget( &m );
               m.show();
       
      -        return app.exec();
      +        return app.exec();
           }
           
      @@ -99,7 +99,7 @@ applications that work on translator files.

      We call a translation a "messsage". For this reason, translation files are sometimes referred to as "message files".

      It is possible to lookup a translation using findMessage() (as -tr() and TQApplication::translate() do) and contains(), to insert a +tr() and TQApplication::translate() do) and contains(), to insert a new translation messsage using insert(), and to remove one using remove().

      Translation tools often need more information than the bare source @@ -147,7 +147,7 @@ translations.

      Note that when TQTranslator loads a stripped file, most functions do not work. The functions that do work with stripped files are explicitly documented as such. -

      See also TQTranslatorMessage, TQApplication::installTranslator(), TQApplication::removeTranslator(), TQObject::tr(), TQApplication::translate(), Environment Classes, and Internationalization with TQt. +

      See also TQTranslatorMessage, TQApplication::installTranslator(), TQApplication::removeTranslator(), TQObject::tr(), TQApplication::translate(), Environment Classes, and Internationalization with TQt.


      Member Type Documentation

      TQTranslator::SaveMode

      diff --git a/doc/html/tqvariant.html b/doc/html/tqvariant.html index 2c15249d7..96ec899c7 100644 --- a/doc/html/tqvariant.html +++ b/doc/html/tqvariant.html @@ -214,7 +214,7 @@ return a reference to the new contents of the variant. TQDataStream in(...); // (opening the previously written stream) in >> v; // Reads an Int variant int z = v.toInt(); // z = 123 - tqDebug("Type is %s", // prints "Type is int" + tqDebug("Type is %s", // prints "Type is int" v.typeName()); v.asInt() += 100; // The variant now hold the value 223. v = TQVariant( TQStringList() ); diff --git a/doc/html/tqwidget.html b/doc/html/tqwidget.html index efebd7515..0fe84bb54 100644 --- a/doc/html/tqwidget.html +++ b/doc/html/tqwidget.html @@ -807,7 +807,7 @@ Takes keyboard input focus from the widget. to lose the focus.

      This widget must enable focus setting in order to get the keyboard input focus, i.e. it must call setFocusPolicy(). -

      See also focus, setFocus(), focusInEvent(), focusOutEvent(), focusPolicy, and TQApplication::focusWidget(). +

      See also focus, setFocus(), focusInEvent(), focusOutEvent(), focusPolicy, and TQApplication::focusWidget().

      void TQWidget::clearMask ()

      @@ -836,7 +836,7 @@ general you do not need to call it. otherwise returns FALSE.

      First it sends the widget a TQCloseEvent. The widget is hidden if it accepts the close event. The default implementation of TQWidget::closeEvent() accepts the close event. -

      The TQApplication::lastWindowClosed() signal is emitted when the +

      The TQApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed.

      Examples: mdi/application.cpp, popup/popup.cpp, and toplevel/options.ui.h. @@ -849,11 +849,11 @@ otherwise returns FALSE. widget can prevent itself from being closed by rejecting the TQCloseEvent it gets. A close events is delivered to the widget no matter if the widget is visible or not. -

      The TQApplication::lastWindowClosed() signal is emitted when the +

      The TQApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed. -

      Note that closing the TQApplication::mainWidget() terminates the +

      Note that closing the TQApplication::mainWidget() terminates the application. -

      See also closeEvent(), TQCloseEvent, hide(), TQApplication::quit(), TQApplication::setMainWidget(), and TQApplication::lastWindowClosed(). +

      See also closeEvent(), TQCloseEvent, hide(), TQApplication::quit(), TQApplication::setMainWidget(), and TQApplication::lastWindowClosed().

      void TQWidget::closeEvent ( TQCloseEvent * e ) [virtual protected]

      @@ -1119,7 +1119,7 @@ Returns the focus proxy, or 0 if there is no focus proxy.

      TQWidget * TQWidget::focusWidget () const

      Returns the focus widget in this widget's window. This is not the -same as TQApplication::focusWidget(), which returns the focus +same as TQApplication::focusWidget(), which returns the focus widget in the currently active window.

      TQFont TQWidget::font () const @@ -1447,7 +1447,7 @@ event being handled by TQt, return TRUE. If you return FALSE, this native event is passed back to TQt, which translates the event into a TQt event and sends it to the widget.

      Warning: This function is not portable. -

      See also TQApplication::macEventFilter(). +

      See also TQApplication::macEventFilter().

      TQPoint TQWidget::mapFrom ( TQWidget * parent, const TQPoint & pos ) const

      @@ -1675,10 +1675,10 @@ having an instantiated widget. This is something a constructor cannot guarantee since the initialization of the subclasses might not be finished.

      After this function, the widget has a proper font and palette and -TQApplication::polish() has been called. +TQApplication::polish() has been called.

      Remember to call TQWidget's implementation first when reimplementing this function to ensure that your program does not end up in infinite recursion. -

      See also constPolish() and TQApplication::polish(). +

      See also constPolish() and TQApplication::polish().

      Example: menu/menu.cpp.

      TQPoint TQWidget::pos () const @@ -1832,7 +1832,7 @@ that is read but not written. For example, when scrolling 10 pixels rightwards, the leftmost ten pixels of the widget need repainting. The paint event may be delivered immediately or later, depending on some heuristics (note that you might have to force -processing of paint events using TQApplication::sendPostedEvents() +processing of paint events using TQApplication::sendPostedEvents() when using scroll() and move() in combination).

      See also TQScrollView, erase(), and bitBlt(). @@ -1978,7 +1978,7 @@ but does not clear any keyboard grab (see grabKeyboard Warning: If you call setFocus() in a function which may itself be called from focusOutEvent() or focusInEvent(), you may get an infinite recursion. -

      See also focus, clearFocus(), focusInEvent(), focusOutEvent(), focusPolicy, TQApplication::focusWidget(), grabKeyboard(), and grabMouse(). +

      See also focus, clearFocus(), focusInEvent(), focusOutEvent(), focusPolicy, TQApplication::focusWidget(), grabKeyboard(), and grabMouse().

      Examples: addressbook/centralwidget.cpp, lineedits/lineedits.cpp, mdi/application.cpp, popup/popup.cpp, rot13/rot13.cpp, t8/main.cpp, and wizard/wizard.cpp.

      void TQWidget::setFocusPolicy ( FocusPolicy ) [virtual] @@ -2172,14 +2172,14 @@ This is an overloaded member function, provided for convenience. It behaves esse Sets the widget's GUI style to style. Ownership of the style object is not transferred.

      If no style is set, the widget uses the application's style, -TQApplication::style() instead. +TQApplication::style() instead.

      Setting a widget's style has no effect on existing or future child widgets.

      Warning: This function is particularly useful for demonstration purposes, where you want to show TQt's styling capabilities. Real applications should avoid it and use one consistent GUI style instead. -

      See also style(), TQStyle, TQApplication::style(), and TQApplication::setStyle(). +

      See also style(), TQStyle, TQApplication::style(), and TQApplication::setStyle().

      Examples: progressbar/progressbar.cpp.

      TQStyle * TQWidget::setStyle ( const TQString & style ) @@ -2342,7 +2342,7 @@ Places the widget under w in the parent widget's stack.

      TQStyle & TQWidget::style () const

      Returns the GUI style for this widget -

      See also TQWidget::setStyle(), TQApplication::setStyle(), and TQApplication::style(). +

      See also TQWidget::setStyle(), TQApplication::setStyle(), and TQApplication::style().

      void TQWidget::styleChange ( TQStyle & oldStyle ) [virtual protected]

      @@ -2354,7 +2354,7 @@ GUI style changes. You will almost certainly need to update the widget using update().

      The default implementation updates the widget including its geometry. -

      See also TQApplication::setStyle(), style(), update(), and updateGeometry(). +

      See also TQApplication::setStyle(), style(), update(), and updateGeometry().

      void TQWidget::tabletEvent ( TQTabletEvent * e ) [virtual protected]

      @@ -2491,7 +2491,7 @@ event being handled by TQt, return TRUE. If you return FALSE, this native event is passed back to TQt, which translates the event into a TQt event and sends it to the widget.

      Warning: This function is not portable. -

      See also TQApplication::winEventFilter(). +

      See also TQApplication::winEventFilter().

      WId TQWidget::winId () const

      @@ -2534,7 +2534,7 @@ event being handled by TQt, return TRUE. If you return FALSE, this native event is passed back to TQt, which translates the event into a TQt event and sends it to the widget.

      Warning: This function is not portable. -

      See also TQApplication::x11EventFilter(). +

      See also TQApplication::x11EventFilter().

      int TQWidget::y () const

      Returns the y coordinate of the widget relative to its parent and including any window frame. @@ -2587,7 +2587,7 @@ together seamlessly, you will probably want to use

      This property holds the widget's background brush.

      The background brush depends on a widget's palette and its background mode. -

      See also backgroundColor(), backgroundPixmap(), eraseColor(), palette, and TQApplication::setPalette(). +

      See also backgroundColor(), backgroundPixmap(), eraseColor(), palette, and TQApplication::setPalette().

      Get this property's value with backgroundBrush().

      BackgroundMode backgroundMode

      @@ -2674,7 +2674,7 @@ widget. See the list of predefined cursor

      If no cursor has been set, or after a call to unsetCursor(), the parent's cursor is used. The function unsetCursor() has no effect on top-level widgets. -

      See also TQApplication::setOverrideCursor(). +

      See also TQApplication::setOverrideCursor().

      Set this property's value with setCursor(), get this property's value with cursor(), and reset this property's value with unsetCursor().

      bool customWhatsThis

      @@ -2709,7 +2709,7 @@ explicitly disabled.

      bool focus

      This property holds whether this widget (or its focus proxy) has the keyboard input focus.

      Effectively equivalent to tqApp->focusWidget() == this. -

      See also setFocus(), clearFocus(), focusPolicy, and TQApplication::focusWidget(). +

      See also setFocus(), clearFocus(), focusPolicy, and TQApplication::focusWidget().

      Get this property's value with hasFocus().

      bool focusEnabled

      @@ -2830,13 +2830,13 @@ the input method disabled if they have focus. This is the default. that has keyboard focus.

      When popup windows are visible, this property is TRUE for both the active window and for the popup. -

      See also setActiveWindow() and TQApplication::activeWindow(). +

      See also setActiveWindow() and TQApplication::activeWindow().

      Get this property's value with isActiveWindow().

      bool isDesktop

      This property holds whether the widget is a desktop widget, i.e. represents the desktop.

      A desktop widget is also a top-level widget. -

      See also isTopLevel and TQApplication::desktop(). +

      See also isTopLevel and TQApplication::desktop().

      Get this property's value with isDesktop().

      bool isDialog

      @@ -2960,7 +2960,7 @@ receives mouse move events when at least one mouse button is pressed while the mouse is being moved.

      If mouse tracking is enabled, the widget receives mouse move events even if no buttons are pressed. -

      See also mouseMoveEvent() and TQApplication::setGlobalMouseTracking(). +

      See also mouseMoveEvent() and TQApplication::setGlobalMouseTracking().

      Set this property's value with setMouseTracking() and get this property's value with hasMouseTracking().

      bool ownCursor

      @@ -2993,7 +2993,7 @@ widget), the default application palette. paletteForegroundColor convenience properties to change a widget's background and foreground appearance only. -

      See also ownPalette, colorGroup, and TQApplication::palette(). +

      See also ownPalette, colorGroup, and TQApplication::palette().

      Set this property's value with setPalette(), get this property's value with palette(), and reset this property's value with unsetPalette().

      TQColor paletteBackgroundColor

      @@ -3033,7 +3033,7 @@ and sets a modified TQPalette with PaletteButton the palette entry TQColorGroup::ButtonText is set to color. -

      See also palette, TQApplication::setPalette(), backgroundMode, foregroundColor(), backgroundMode, and setEraseColor(). +

      See also palette, TQApplication::setPalette(), backgroundMode, foregroundColor(), backgroundMode, and setEraseColor().

      Set this property's value with setPaletteForegroundColor(), get this property's value with paletteForegroundColor(), and reset this property's value with unsetPalette().

      TQPoint pos

      diff --git a/doc/html/tqwizard.html b/doc/html/tqwizard.html index fe4f42480..b1937308b 100644 --- a/doc/html/tqwizard.html +++ b/doc/html/tqwizard.html @@ -320,7 +320,7 @@ See the "titleFont" property for deta

      Property Documentation

      TQFont titleFont

      This property holds the font used for page titles. -

      The default is TQApplication::font(). +

      The default is TQApplication::font().

      Set this property's value with setTitleFont() and get this property's value with titleFont(). diff --git a/doc/html/tutorial1-01.html b/doc/html/tutorial1-01.html index db3221177..ffdff0b36 100644 --- a/doc/html/tutorial1-01.html +++ b/doc/html/tutorial1-01.html @@ -41,20 +41,20 @@ The picture above is a snapshot of this program. ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TQPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); - a.setMainWidget( &hello ); + a.setMainWidget( &hello ); hello.show(); - return a.exec(); + return a.exec(); } @@ -62,9 +62,9 @@ int main( int argc, char **argv )

      Line-by-line Walkthrough

      -

          #include <ntqapplication.h>
      +

          #include <tqapplication.h>
       
      -

      This line includes the TQApplication class definition. There has to be +

      This line includes the TQApplication class definition. There has to be exactly one TQApplication object in every application that uses TQt. TQApplication manages various application-wide resources, such as the default font and cursor. @@ -76,7 +76,7 @@ mentions at the top which file needs to be included to use that class.

      TQPushButton is a classical GUI push button that the user can press and release. It manages its own look and feel, like every other TQWidget. A widget is a user interface object that can process user input and draw graphics. The programmer can change both the overall -look and feel and many minor +look and feel and many minor properties of it (such as color), as well as the widget's content. A TQPushButton can show either a text or a TQPixmap.

          int main( int argc, char **argv )
      @@ -90,12 +90,12 @@ program about the user's actions via events.
       array of command-line arguments. This is a C/C++ feature. It is not
       specific to TQt; however, TQt needs to process these arguments (see
       following).
      -

              TQApplication a( argc, argv );
      +

              TQApplication a( argc, argv );
       
      -

      a is this program's TQApplication. Here it is created and processes +

      a is this program's TQApplication. Here it is created and processes some of the command-line arguments (such as -display under X Window). Note that all command-line arguments recognized by TQt are removed from -argv (and argc is decremented accordingly). See the TQApplication::argv() documentation for details. +argv (and argc is decremented accordingly). See the TQApplication::argv() documentation for details.

      Note: It is essential that the TQApplication object be created before any window-system parts of TQt are used.

              TQPushButton hello( "Hello world!", 0 );
      @@ -110,7 +110,7 @@ window, inside which the button should be located).
       

      The button is set up to be 100 pixels wide and 30 pixels high (plus the window system frame). In this case we don't care about the button's position, and we accept the default value. -

              a.setMainWidget( &hello );
      +

              a.setMainWidget( &hello );
       

      The push button is chosen as the main widget for the application. If the user closes a main widget, the application exits. @@ -119,7 +119,7 @@ the user closes a main widget, the application exits.

      A widget is never visible when you create it. You must call show() to make it visible. -

              return a.exec();
      +

              return a.exec();
       

      This is where main() passes control to TQt, and exec() will return when the application exits. diff --git a/doc/html/tutorial1-02.html b/doc/html/tutorial1-02.html index a4098da17..4acff99ac 100644 --- a/doc/html/tutorial1-02.html +++ b/doc/html/tutorial1-02.html @@ -41,24 +41,24 @@ now go on to make the application quit properly when the user tells it to. ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqfont.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TQPushButton quit( "Quit", 0 ); quit.resize( 75, 30 ); quit.setFont( TQFont( "Times", 18, TQFont::Bold ) ); - TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); + TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); - a.setMainWidget( &quit ); + a.setMainWidget( &quit ); quit.show(); - return a.exec(); + return a.exec(); }

      @@ -85,8 +85,8 @@ to set right size.

      Here we choose a new font for the button, an 18-point bold font from the Times family. Note that we create the font on the spot. -

      It is also possible to change the default font (using TQApplication::setFont()) for the whole application. -

              TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) );
      +

      It is also possible to change the default font (using TQApplication::setFont()) for the whole application. +

              TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) );
       

      connect() is perhaps the most central feature of TQt. Note that connect() is a static function in TQObject. Do not confuse it diff --git a/doc/html/tutorial1-03.html b/doc/html/tutorial1-03.html index 3879630a0..a71239777 100644 --- a/doc/html/tutorial1-03.html +++ b/doc/html/tutorial1-03.html @@ -40,14 +40,14 @@ body { background: #ffffff; color: black; } ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqfont.h> #include <tqvbox.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); TQVBox box; box.resize( 200, 120 ); @@ -55,12 +55,12 @@ int main( int argc, char **argv ) TQPushButton quit( "Quit", &box ); quit.setFont( TQFont( "Times", 18, TQFont::Bold ) ); - TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); + TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); - a.setMainWidget( &box ); + a.setMainWidget( &box ); box.show(); - return a.exec(); + return a.exec(); }

      diff --git a/doc/html/tutorial1-04.html b/doc/html/tutorial1-04.html index 259eb436a..6c0980bfa 100644 --- a/doc/html/tutorial1-04.html +++ b/doc/html/tutorial1-04.html @@ -40,7 +40,7 @@ minimum and maximum sizes of a widget, and introduces widget names. ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqfont.h> @@ -62,19 +62,19 @@ public: quit->setGeometry( 62, 40, 75, 30 ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); } int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MyWidget w; w.setGeometry( 100, 100, 200, 120 ); - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }
      @@ -131,7 +131,7 @@ when you choose to, the child will automatically tell TQt about its imminent death.)

      The setGeometry() call does the same as move() and resize() did in the previous chapters. -

              connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );
      +

              connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );
           }
       

      Because the MyWidget class doesn't know about the application object, it @@ -144,13 +144,13 @@ so TQt offers an alias, tqApp, for the cases in which a component such as MyWidget needs to talk to the application object.

          int main( int argc, char **argv )
           {
      -        TQApplication a( argc, argv );
      +        TQApplication a( argc, argv );
       
               MyWidget w;
               w.setGeometry( 100, 100, 200, 120 );
      -        a.setMainWidget( &w );
      +        a.setMainWidget( &w );
               w.show();
      -        return a.exec();
      +        return a.exec();
           }
       

      Here we instantiate our new child, set it to be the main widget, and diff --git a/doc/html/tutorial1-05.html b/doc/html/tutorial1-05.html index 046178b0e..2c1f23534 100644 --- a/doc/html/tutorial1-05.html +++ b/doc/html/tutorial1-05.html @@ -40,7 +40,7 @@ by using signals and slots, and how to handle resize events. ** ****************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqpushbutton.h> #include <tqslider.h> #include <tqlcdnumber.h> @@ -61,7 +61,7 @@ public: TQPushButton *quit = new TQPushButton( "Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); TQLCDNumber *lcd = new TQLCDNumber( 2, this, "lcd" ); @@ -74,12 +74,12 @@ public: int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); MyWidget w; - a.setMainWidget( &w ); + a.setMainWidget( &w ); w.show(); - return a.exec(); + return a.exec(); }

      @@ -87,7 +87,7 @@ int main( int argc, char **argv )

      Line-by-line Walkthrough

      -

          #include <ntqapplication.h>
      +

          #include <tqapplication.h>
           #include <tqpushbutton.h>
           #include <tqslider.h>
           #include <tqlcdnumber.h>
      diff --git a/doc/html/tutorial1-06.html b/doc/html/tutorial1-06.html
      index 1249d3260..37570a1da 100644
      --- a/doc/html/tutorial1-06.html
      +++ b/doc/html/tutorial1-06.html
      @@ -42,7 +42,7 @@ widget as a child widget.
       **
       ****************************************************************/
       
      -#include <ntqapplication.h>
      +#include <tqapplication.h>
       #include <tqpushbutton.h>
       #include <tqslider.h>
       #include <tqlcdnumber.h>
      @@ -79,7 +79,7 @@ public:
           TQPushButton *quit = new TQPushButton( "Quit", this, "quit" );
           quit->setFont( TQFont( "Times", 18, TQFont::Bold ) );
       
      -    connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );
      +    connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );
       
           TQGrid *grid = new TQGrid( 4, this );
       
      @@ -90,12 +90,12 @@ public:
       
       int main( int argc, char **argv )
       {
      -    TQApplication a( argc, argv );
      +    TQApplication a( argc, argv );
       
           MyWidget w;
      -    a.setMainWidget( &w );
      +    a.setMainWidget( &w );
           w.show();
      -    return a.exec();
      +    return a.exec();
       }
       
      @@ -138,7 +138,7 @@ is renamed. TQPushButton *quit = new TQPushButton( "Quit", this, "quit" ); quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); - connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) );

      The push button that used to be in what is now LCDRange has been separated so that we can have one "Quit" button and many LCDRange diff --git a/doc/html/tutorial1-08.html b/doc/html/tutorial1-08.html index bc6e08409..06c845c60 100644 --- a/doc/html/tutorial1-08.html +++ b/doc/html/tutorial1-08.html @@ -62,7 +62,7 @@ Until now, it has been fixed at 0..99.

          void LCDRange::setRange( int minVal, int maxVal )
           {
               if ( minVal < 0 || maxVal > 99 || minVal > maxVal ) {
      -          tqWarning( "LCDRange::setRange(%d,%d)\n"
      +          tqWarning( "LCDRange::setRange(%d,%d)\n"
                          "\tRange must be 0..99\n"
                          "\tand minVal must not be greater than maxVal",
                          minVal, maxVal );
      @@ -76,10 +76,10 @@ have set up the TQLCDNumber to always display two
       limit the possible range of minVal and maxVal to 0..99 to avoid
       overflow of the TQLCDNumber. (We could have allowed values down to -9
       but chose not to.)  If the arguments are illegal, we use TQt's
      -tqWarning() function to issue a warning to the user and return
      +tqWarning() function to issue a warning to the user and return
       immediately. tqWarning() is a printf-like function that by default
       sends its output to stderr. If you want, you can install your own handler
      -function using ::qInstallMsgHandler().
      +function using ::qInstallMsgHandler().
       

      t8/cannon.h

      CannonField is a new custom widget that knows how to display itself. diff --git a/doc/html/tutorial1-09.html b/doc/html/tutorial1-09.html index af90e0f10..65f2d73e9 100644 --- a/doc/html/tutorial1-09.html +++ b/doc/html/tutorial1-09.html @@ -113,12 +113,12 @@ this time.

          int main( int argc, char **argv )
           {
      -        TQApplication::setColorSpec( TQApplication::CustomColor );
      -        TQApplication a( argc, argv );
      +        TQApplication::setColorSpec( TQApplication::CustomColor );
      +        TQApplication a( argc, argv );
       

      We tell TQt that we want a different color-allocation strategy for this program. There is no single correct color-allocation strategy. Because -this program uses an unusual yellow but not many colors, CustomColor is best. There are several other allocation strategies; you can read about them in the TQApplication::setColorSpec() +this program uses an unusual yellow but not many colors, CustomColor is best. There are several other allocation strategies; you can read about them in the TQApplication::setColorSpec() documentation.

      Mostly you can ignore this, since the default is good. Occasionally some applications with unusual color use look bad; changing the diff --git a/doc/html/tutorial1-14.html b/doc/html/tutorial1-14.html index 39f17821d..fdf985631 100644 --- a/doc/html/tutorial1-14.html +++ b/doc/html/tutorial1-14.html @@ -225,7 +225,7 @@ key Ctrl+Q is pressed. Because Enter is sometimes Return and there are even keyboards with both keys, we make both Enter and Return invoke fire().

              accel->connectItem( accel->insertItem( CTRL+Key_Q ),
      -                            tqApp, TQ_SLOT(quit()) );
      +                            tqApp, TQ_SLOT(quit()) );
       

      And then we set up Ctrl+Q to do the same thing as Alt+Q. Some people are more used to Ctrl+Q (and anyway it shows how do do it). diff --git a/doc/html/tutorial2-03.html b/doc/html/tutorial2-03.html index 8837886ce..bbf7be7a0 100644 --- a/doc/html/tutorial2-03.html +++ b/doc/html/tutorial2-03.html @@ -135,7 +135,7 @@ with the isValid() function.

          double Element::proX( int index ) const
           {
      -        Q_ASSERT(index >= 0 && index < MAX_PROPOINTS);
      +        Q_ASSERT(index >= 0 && index < MAX_PROPOINTS);
               return m_propoints[2 * index];
           }
       
      diff --git a/doc/html/tutorial2-04.html b/doc/html/tutorial2-04.html index 240225db5..5a0a850fc 100644 --- a/doc/html/tutorial2-04.html +++ b/doc/html/tutorial2-04.html @@ -35,29 +35,29 @@ body { background: #ffffff; color: black; }

      (main.cpp.)

      -

          #include <ntqapplication.h>
      +
          #include <tqapplication.h>
           #include "chartform.h"
       
           int main( int argc, char *argv[] )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       
               TQString filename;
      -        if ( app.argc() > 1 ) {
      -            filename = app.argv()[1];
      +        if ( app.argc() > 1 ) {
      +            filename = app.argv()[1];
                   if ( !filename.endsWith( ".cht" ) )
                       filename = TQString::null;
               }
       
               ChartForm *cf = new ChartForm( filename );
      -        app.setMainWidget( cf );
      +        app.setMainWidget( cf );
               cf->show();
       
      -        return app.exec();
      +        return app.exec();
           }
       

      We have kept the main() function simple and small. We create a -TQApplication object and pass it the command line arguments. We are +TQApplication object and pass it the command line arguments. We are allowing users to invoke the program with chart mychart.cht, so if they've added a filename we pass that through to the chart form constructor. Most of the action takes place within the chart form diff --git a/doc/html/tutorial2-05.html b/doc/html/tutorial2-05.html index 731d8f359..ac2f6ec51 100644 --- a/doc/html/tutorial2-05.html +++ b/doc/html/tutorial2-05.html @@ -498,7 +498,7 @@ item id. { if ( okToClear() ) { saveOptions(); - tqApp->exit( 0 ); + tqApp->exit( 0 ); } }

      diff --git a/doc/html/whatsthis b/doc/html/whatsthis index 433b49c0a..43061cd4d 100644 --- a/doc/html/whatsthis +++ b/doc/html/whatsthis @@ -215,7 +215,7 @@ Mac/Platinum look and feel. | TQPlatinumStyle Main application window, with a menu bar, dock windows (e.g. for toolbars), and a status bar. | TQMainWindow Maintains the list of widgets in the focus chain. | TQFocusData Manages and lays out TQDockWindows. | TQDockArea -Manages the GUI application's control flow and main settings. | QApplication +Manages the GUI application's control flow and main settings. | TQApplication Manages the event queue. | TQEventLoop Manipulates the fields in SQL database tables and views. | TQSqlField Maps open-standard MIME to Mac flavors. | TQMacMime diff --git a/doc/html/wizard-example.html b/doc/html/wizard-example.html index ec2513b64..1781ddeeb 100644 --- a/doc/html/wizard-example.html +++ b/doc/html/wizard-example.html @@ -104,7 +104,7 @@ protected slots: #include <tqlineedit.h> #include <tqpushbutton.h> #include <tqvalidator.h> -#include <ntqapplication.h> +#include <tqapplication.h> Wizard::Wizard( TQWidget *parent, const char *name ) : TQWizard( parent, name, TRUE ) @@ -327,11 +327,11 @@ void Wizard::dataChanged( const TQStr *****************************************************************************/ #include "wizard.h" -#include <ntqapplication.h> +#include <tqapplication.h> int main(int argc,char **argv) { - TQApplication a(argc,argv); + TQApplication a(argc,argv); Wizard wizard; wizard.setCaption("TQt Example - Wizard"); diff --git a/doc/html/wizard-wizard-cpp.html b/doc/html/wizard-wizard-cpp.html index e726e445e..e89fdc806 100644 --- a/doc/html/wizard-wizard-cpp.html +++ b/doc/html/wizard-wizard-cpp.html @@ -50,7 +50,7 @@ body { background: #ffffff; color: black; } #include <tqlineedit.h> #include <tqpushbutton.h> #include <tqvalidator.h> -#include <ntqapplication.h> +#include <tqapplication.h> Wizard::Wizard( TQWidget *parent, const char *name ) : TQWizard( parent, name, TRUE ) diff --git a/doc/html/xform-example.html b/doc/html/xform-example.html index 83d684498..f877b8346 100644 --- a/doc/html/xform-example.html +++ b/doc/html/xform-example.html @@ -46,7 +46,7 @@ arbitrarily. ** *****************************************************************************/ -#include <ntqapplication.h> +#include <tqapplication.h> #include <tqdialog.h> #include <tqlabel.h> @@ -326,7 +326,7 @@ void XFormControl::changeMode(int m) else rb_pic->setChecked(TRUE); } - tqApp->flushX(); + tqApp->flushX(); } ShowXForm::ShowXForm( const TQFont &initialFont, @@ -533,14 +533,14 @@ void XFormCenter::newMode( int m ) int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); XFormCenter *xfc = new XFormCenter; - a.setMainWidget( xfc ); + a.setMainWidget( xfc ); xfc->setCaption("TQt Example - XForm"); xfc->show(); - return a.exec(); + return a.exec(); } #include "xform.moc" // include metadata generated by the tqmoc diff --git a/doc/html/xml-sax-features-walkthrough.html b/doc/html/xml-sax-features-walkthrough.html index fd61011d2..7b8241de0 100644 --- a/doc/html/xml-sax-features-walkthrough.html +++ b/doc/html/xml-sax-features-walkthrough.html @@ -55,7 +55,7 @@ namespace URIs.

      Let's begin with the main program of the application. First the boring part: we include all the classes we need:

          #include "structureparser.h"
      -    #include <ntqapplication.h>
      +    #include <tqapplication.h>
           #include <tqfile.h>
           #include <tqxml.h>
           #include <tqlistview.h>
      @@ -67,7 +67,7 @@ part: we include all the classes we need:
       the XML parser that we implement in structureparser.cpp.
       

          int main( int argc, char **argv )
           {
      -        TQApplication app( argc, argv );
      +        TQApplication app( argc, argv );
       

      As usual we then create a TQt application object and hand command line arguments over to it. @@ -176,9 +176,9 @@ FALSE and http://xml.org/sax/features/namespace-prefixes TRUE.

      The second row of the container grid is filled with three labels denoting the reader settings that belong to the above listview. -

              app.setMainWidget( container );
      +

              app.setMainWidget( container );
               container->show();
      -        return app.exec();
      +        return app.exec();
           }
       

      Same procedure as with every TQt GUI program: the grid serves as the diff --git a/doc/html/y2k.html b/doc/html/y2k.html index cd53502f0..e105f62c7 100644 --- a/doc/html/y2k.html +++ b/doc/html/y2k.html @@ -56,7 +56,7 @@ not deal with years or leap days at all. seconds or milliseconds, and is thus Year 2000 Compliant.

      This applies to the above four classes and also to TQFileDialog (which can sort files by time/date), TQFileInfo (which operates on -file times/dates) and TQApplication (which does various internal +file times/dates) and TQApplication (which does various internal housekeeping tasks).

      The conversion to year/month/date format in TQDate (and TQDateTime) has been verified to be correct for all of December 31, diff --git a/doc/i18n.doc b/doc/i18n.doc index 4b51c6654..83d401f6a 100644 --- a/doc/i18n.doc +++ b/doc/i18n.doc @@ -178,7 +178,7 @@ const char* and char from traditional C. Wherever your program uses \c{"quoted text"} for text that will be presented to the user, ensure that it is processed by the \l -QApplication::translate() function. Essentially all that is necessary +TQApplication::translate() function. Essentially all that is necessary to achieve this is to use \l TQObject::tr(). For example, assuming the \c LoginWidget is a subclass of TQWidget: @@ -195,7 +195,7 @@ write. If the quoted text is not in a member function of a TQObject subclass, use either the tr() function of an -appropriate class, or the QApplication::translate() function +appropriate class, or the TQApplication::translate() function directly: \code @@ -259,7 +259,7 @@ Disabling the conversion can make programming a bit cumbersome. If your source language uses characters outside Latin-1, you might find TQObject::trUtf8() more convenient than TQObject::tr(), as tr() depends on the -QApplication::defaultCodec(), which makes it more fragile than +TQApplication::defaultCodec(), which makes it more fragile than TQObject::trUtf8(). \section2 Use TQKeySequence() for Accelerator Values @@ -370,7 +370,7 @@ you add the \c TRANSLATIONS entry. In your application, you must \l TQTranslator::load() the translation files appropriate for the user's language, and install them using \l -QApplication::installTranslator(). +TQApplication::installTranslator(). If you have been using the old TQt tools (\c tqtfindtr, \c msg2tqm and \c tqtmergetr), you can use \e tqm2ts to convert your old \c .qm files. @@ -399,7 +399,7 @@ Typically, your application's main() function will look like this: \code int main( int argc, char **argv ) { - QApplication app( argc, argv ); + TQApplication app( argc, argv ); // translation file for Qt TQTranslator qt( 0 ); diff --git a/doc/indices.doc b/doc/indices.doc index 084c60c57..429b96c36 100644 --- a/doc/indices.doc +++ b/doc/indices.doc @@ -231,7 +231,7 @@ related classes together. Some classes may appear in more than one group. \row \i \link tools.html Utility Classes \endlink \i Collection classes such as list, queue, stack and string, along -with other classes that can be used without needing QApplication. +with other classes that can be used without needing TQApplication. \row \i \link graphics.html Graphics and Printing \endlink @@ -450,7 +450,7 @@ programmers and try to make learning TQt as painless as possible. The non-GUI classes are general-purpose collection and string classes that may be used independently of the GUI classes. -In particular, these classes do not depend on QApplication at all, +In particular, these classes do not depend on TQApplication at all, and so can be used in non-GUI programs. See also the \link collection.html introduction to the TQt collection diff --git a/doc/mac.doc b/doc/mac.doc index 97efe7533..1b64d1ed8 100644 --- a/doc/mac.doc +++ b/doc/mac.doc @@ -235,7 +235,7 @@ Qt/Mac will automatically detect your menubars for you and turn them into Mac native menubars. Fitting this into your existing TQt application will normally be automatic, however, if you have special needs the Qt/Mac implementation currently selects a menubar by starting at the active window -(ie QApplication::activeWindow()), and applying: +(ie TQApplication::activeWindow()), and applying: 1) If the window has a TQMenuBar then it is used. 2) If the window is a modal then its menubar is used. If no menubar is diff --git a/doc/man/man3/tqapplication.3qt b/doc/man/man3/tqapplication.3qt index 3761797b7..aa073c581 100644 --- a/doc/man/man3/tqapplication.3qt +++ b/doc/man/man3/tqapplication.3qt @@ -1,5 +1,5 @@ '\" t -.TH QApplication 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQApplication 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,34 +7,34 @@ .ad l .nh .SH NAME -QApplication \- Manages the GUI application's control flow and main settings +TQApplication \- Manages the GUI application's control flow and main settings .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP Inherits TQObject. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQApplication\fR ( int & argc, char ** argv )" +.BI "\fBTQApplication\fR ( int & argc, char ** argv )" .br .ti -1c -.BI "\fBQApplication\fR ( int & argc, char ** argv, bool GUIenabled )" +.BI "\fBTQApplication\fR ( int & argc, char ** argv, bool GUIenabled )" .br .ti -1c .BI "enum \fBType\fR { Tty, GuiClient, GuiServer }" .br .ti -1c -.BI "\fBQApplication\fR ( int & argc, char ** argv, Type type )" +.BI "\fBTQApplication\fR ( int & argc, char ** argv, Type type )" .br .ti -1c -.BI "\fBQApplication\fR ( Display * dpy, HANDLE visual = 0, HANDLE colormap = 0 )" +.BI "\fBTQApplication\fR ( Display * dpy, HANDLE visual = 0, HANDLE colormap = 0 )" .br .ti -1c -.BI "\fBQApplication\fR ( Display * dpy, int argc, char ** argv, HANDLE visual = 0, HANDLE colormap = 0 )" +.BI "\fBTQApplication\fR ( Display * dpy, int argc, char ** argv, HANDLE visual = 0, HANDLE colormap = 0 )" .br .ti -1c -.BI "virtual \fB~QApplication\fR ()" +.BI "virtual \fB~TQApplication\fR ()" .br .ti -1c .BI "int \fBargc\fR () const" @@ -404,13 +404,13 @@ Inherits TQObject. .br .in -1c .SH DESCRIPTION -The QApplication class manages the GUI application's control flow and main settings. +The TQApplication class manages the GUI application's control flow and main settings. .PP It contains the main event loop, where all events from the window system and other sources are processed and dispatched. It also handles the application's initialization and finalization, and provides session management. It also handles most system-wide and application-wide settings. .PP -For any GUI application that uses Qt, there is precisely one QApplication object, no matter whether the application has 0, 1, 2 or more windows at any time. +For any GUI application that uses Qt, there is precisely one TQApplication object, no matter whether the application has 0, 1, 2 or more windows at any time. .PP -The QApplication object is accessible through the global pointer \fCqApp\fR. Its main areas of responsibility are: +The TQApplication object is accessible through the global pointer \fCqApp\fR. Its main areas of responsibility are: .IP .TP It initializes the application with the user's desktop settings such as palette(), font() and doubleClickInterval(). It keeps track of these properties in case the user changes the desktop globally, for example through some kind of control panel. @@ -446,9 +446,9 @@ On the X window system, it provides functions to flush and sync the communicatio It provides support for sophisticated session management. This makes it possible for applications to terminate gracefully when the user logs out, to cancel a shutdown process if termination isn't possible and even to preserve the entire application's state for a future session. See isSessionRestored(), sessionId() and commitData() and saveState() for details. .IP .PP -The Application walk-through example contains a typical complete main() that does the usual things with QApplication. +The Application walk-through example contains a typical complete main() that does the usual things with TQApplication. .PP -Since the QApplication object does so much initialization, it \fBmust\fR be created before any other objects related to the user interface are created. +Since the TQApplication object does so much initialization, it \fBmust\fR be created before any other objects related to the user interface are created. .PP Since it also deals with common command line arguments, it is usually a good idea to create it \fIbefore\fR any interpretation or modification of \fCargv\fR is done in the application itself. (Note also that for X11, setMainWidget() may change the main widget according to the \fC-geometry\fR option. To preserve this functionality, you must set your defaults before setMainWidget() and any overrides after.) .PP @@ -459,36 +459,36 @@ l - l. Groups of functions System settings desktopSettingsAware(), setDesktopSet .fi .PP -\fINon-GUI programs:\fR While TQt is not optimized or designed for writing non-GUI programs, it's possible to use some of its classes without creating a QApplication. This can be useful if you wish to share code between a non-GUI server and a GUI client. +\fINon-GUI programs:\fR While TQt is not optimized or designed for writing non-GUI programs, it's possible to use some of its classes without creating a TQApplication. This can be useful if you wish to share code between a non-GUI server and a GUI client. .PP See also Main Window and Related Classes. .SS "Member Type Documentation" -.SH "QApplication::ColorSpec" +.SH "TQApplication::ColorSpec" .TP -\fCQApplication::NormalColor\fR - the default color allocation policy +\fCTQApplication::NormalColor\fR - the default color allocation policy .TP -\fCQApplication::CustomColor\fR - the same as NormalColor for X11; allocates colors to a palette on demand under Windows +\fCTQApplication::CustomColor\fR - the same as NormalColor for X11; allocates colors to a palette on demand under Windows .TP -\fCQApplication::ManyColor\fR - the right choice for applications that use thousands of colors +\fCTQApplication::ManyColor\fR - the right choice for applications that use thousands of colors .PP See setColorSpec() for full details. -.SH "QApplication::Encoding" +.SH "TQApplication::Encoding" This enum type defines the 8-bit encoding of character string arguments to translate(): .TP -\fCQApplication::DefaultCodec\fR - the encoding specified by TQTextCodec::codecForTr() (Latin-1 if none has been set) +\fCTQApplication::DefaultCodec\fR - the encoding specified by TQTextCodec::codecForTr() (Latin-1 if none has been set) .TP -\fCQApplication::UnicodeUTF8\fR - UTF-8 +\fCTQApplication::UnicodeUTF8\fR - UTF-8 .PP See also TQObject::tr(), TQObject::trUtf8(), and TQString::fromUtf8(). -.SH "QApplication::Type" +.SH "TQApplication::Type" .TP -\fCQApplication::Tty\fR - a console application +\fCTQApplication::Tty\fR - a console application .TP -\fCQApplication::GuiClient\fR - a GUI client application +\fCTQApplication::GuiClient\fR - a GUI client application .TP -\fCQApplication::GuiServer\fR - a GUI server application +\fCTQApplication::GuiServer\fR - a GUI server application .SH MEMBER FUNCTION DOCUMENTATION -.SH "QApplication::QApplication ( int & argc, char ** argv )" +.SH "TQApplication::TQApplication ( int & argc, char ** argv )" Initializes the window system and constructs an application object with \fIargc\fR command line arguments in \fIargv\fR. .PP The global \fCqApp\fR pointer refers to this application object. Only one application object should be created. @@ -541,12 +541,12 @@ The X11 version of TQt also supports some traditional X11 command line options: .TP -visual \fCTrueColor\fR, forces the application to use a TrueColor visual on an 8-bit display. .TP --ncols \fIcount\fR, limits the number of colors allocated in the color cube on an 8-bit display, if the application is using the QApplication::ManyColor color specification. If \fIcount\fR is 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, and 6 of blue); for other values, a cube approximately proportional to a 2x3x1 cube is used. +-ncols \fIcount\fR, limits the number of colors allocated in the color cube on an 8-bit display, if the application is using the TQApplication::ManyColor color specification. If \fIcount\fR is 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, and 6 of blue); for other values, a cube approximately proportional to a 2x3x1 cube is used. .TP -cmap, causes the application to install a private color map on an 8-bit display. .PP See also argc() and argv(). -.SH "QApplication::QApplication ( int & argc, char ** argv, bool GUIenabled )" +.SH "TQApplication::TQApplication ( int & argc, char ** argv, bool GUIenabled )" Constructs an application object with \fIargc\fR command line arguments in \fIargv\fR. If \fIGUIenabled\fR is TRUE, a GUI application is constructed, otherwise a non-GUI (console) application is created. .PP Set \fIGUIenabled\fR to FALSE for programs without a graphical user interface that should be able to run without a window system. @@ -571,7 +571,7 @@ The following example shows how to create an application that uses a graphical i .br #endif .br - QApplication app(argc, argv, useGUI); + TQApplication app(argc, argv, useGUI); .br .br if ( useGUI ) { @@ -592,35 +592,35 @@ The following example shows how to create an application that uses a graphical i .br } .fi -.SH "QApplication::QApplication ( int & argc, char ** argv, Type type )" +.SH "TQApplication::TQApplication ( int & argc, char ** argv, Type type )" Constructs an application object with \fIargc\fR command line arguments in \fIargv\fR. -.SH "QApplication::QApplication ( Display * dpy, HANDLE visual = 0, HANDLE colormap = 0 )" +.SH "TQApplication::TQApplication ( Display * dpy, HANDLE visual = 0, HANDLE colormap = 0 )" Create an application, given an already open display \fIdpy\fR. If \fIvisual\fR and \fIcolormap\fR are non-zero, the application will use those as the default Visual and Colormap contexts. .PP \fBWarning:\fR TQt only supports TrueColor visuals at depths higher than 8 bits-per-pixel. .PP This is available only on X11. -.SH "QApplication::QApplication ( Display * dpy, int argc, char ** argv, HANDLE visual = 0, HANDLE colormap = 0 )" +.SH "TQApplication::TQApplication ( Display * dpy, int argc, char ** argv, HANDLE visual = 0, HANDLE colormap = 0 )" Create an application, given an already open display \fIdpy\fR and using \fIargc\fR command line arguments in \fIargv\fR. If \fIvisual\fR and \fIcolormap\fR are non-zero, the application will use those as the default Visual and Colormap contexts. .PP \fBWarning:\fR TQt only supports TrueColor visuals at depths higher than 8 bits-per-pixel. .PP This is available only on X11. -.SH "QApplication::~QApplication ()\fC [virtual]\fR" +.SH "TQApplication::~TQApplication ()\fC [virtual]\fR" Cleans up any window system resources that were allocated by this application. Sets the global variable \fCqApp\fR to 0. -.SH "void QApplication::aboutTQt ()\fC [slot]\fR" +.SH "void TQApplication::aboutTQt ()\fC [slot]\fR" Displays a simple message box about Qt. The message includes the version number of TQt being used by the application. .PP This is useful for inclusion in the Help menu of an application. See the examples/menu/menu.cpp example. .PP This function is a convenience slot for TQMessageBox::aboutTQt(). -.SH "void QApplication::aboutToQuit ()\fC [signal]\fR" +.SH "void TQApplication::aboutToQuit ()\fC [signal]\fR" This signal is emitted when the application is about to quit the main event loop, e.g. when the event loop level drops to zero. This may happen either after a call to quit() from inside the application or when the users shuts down the entire desktop session. .PP The signal is particularly useful if your application has to do some last-second cleanup. Note that no user interaction is possible in this state. .PP See also quit(). -.SH "TQWidget * QApplication::activeModalWidget ()\fC [static]\fR" +.SH "TQWidget * TQApplication::activeModalWidget ()\fC [static]\fR" Returns the active modal widget. .PP A modal widget is a special top level widget which is a subclass of TQDialog that specifies the modal parameter of the constructor as TRUE. A modal widget must be closed before the user can continue with other parts of the program. @@ -628,7 +628,7 @@ A modal widget is a special top level widget which is a subclass of TQDialog tha Modal widgets are organized in a stack. This function returns the active modal widget at the top of the stack. .PP See also activePopupWidget() and topLevelWidgets(). -.SH "TQWidget * QApplication::activePopupWidget ()\fC [static]\fR" +.SH "TQWidget * TQApplication::activePopupWidget ()\fC [static]\fR" Returns the active popup widget. .PP A popup widget is a special top level widget that sets the WType_Popup widget flag, e.g. the TQPopupMenu widget. When the application opens a popup widget, all events are sent to the popup. Normal widgets and modal widgets cannot be accessed before the popup widget is closed. @@ -636,19 +636,19 @@ A popup widget is a special top level widget that sets the WType_Popup widget fl Only other popup widgets may be opened when a popup widget is shown. The popup widgets are organized in a stack. This function returns the active popup widget at the top of the stack. .PP See also activeModalWidget() and topLevelWidgets(). -.SH "TQWidget * QApplication::activeWindow () const" +.SH "TQWidget * TQApplication::activeWindow () const" Returns the application top-level window that has the keyboard input focus, or 0 if no application window has the focus. Note that there might be an activeWindow() even if there is no focusWidget(), for example if no widget in that window accepts key events. .PP See also TQWidget::setFocus(), TQWidget::focus, and focusWidget(). .PP Example: network/mail/smtp.cpp. -.SH "void QApplication::addLibraryPath ( const TQString & path )\fC [static]\fR" +.SH "void TQApplication::addLibraryPath ( const TQString & path )\fC [static]\fR" Append \fIpath\fR to the end of the library path list. If \fIpath\fR is empty or already in the path list, the path list is not changed. .PP The default path list consists of a single entry, the installation directory for plugins. The default installation directory for plugins is \fCINSTALL/plugins\fR, where \fCINSTALL\fR is the directory where TQt was installed. .PP See also removeLibraryPath(), libraryPaths(), and setLibraryPaths(). -.SH "TQWidgetList * QApplication::allWidgets ()\fC [static]\fR" +.SH "TQWidgetList * TQApplication::allWidgets ()\fC [static]\fR" Returns a list of all the widgets in the application. .PP The list is created using \fCnew\fR and must be deleted by the caller. @@ -661,7 +661,7 @@ Example that updates all widgets: .PP .nf .br - TQWidgetList *list = QApplication::allWidgets(); + TQWidgetList *list = TQApplication::allWidgets(); .br TQWidgetListIt it( *list ); // iterate over the widgets .br @@ -684,7 +684,7 @@ The TQWidgetList class is defined in the \fCtqwidgetlist.h\fR header file. \fBWarning:\fR Delete the list as soon as you have finished using it. The widgets in the list may be deleted by someone else at any time. .PP See also topLevelWidgets(), TQWidget::visible, and TQPtrList::isEmpty(). -.SH "TQString QApplication::applicationDirPath ()" +.SH "TQString TQApplication::applicationDirPath ()" Returns the directory that contains the application executable. .PP For example, if you have installed TQt in the \fCC:\Trolltech\Qt\fR directory, and you run the \fCdemo\fR example, this function will return "C:/Trolltech/Qt/examples/demo". @@ -694,7 +694,7 @@ On Mac OS X this will point to the directory actually containing the executable, \fBWarning:\fR On Unix, this function assumes that argv[0] contains the file name of the executable (which it normally does). It also assumes that the current directory hasn't been changed by the application. .PP See also applicationFilePath(). -.SH "TQString QApplication::applicationFilePath ()" +.SH "TQString TQApplication::applicationFilePath ()" Returns the file path of the application executable. .PP For example, if you have installed TQt in the \fCC:\Trolltech\Qt\fR directory, and you run the \fCdemo\fR example, this function will return "C:/Trolltech/Qt/examples/demo/demo.exe". @@ -702,21 +702,21 @@ For example, if you have installed TQt in the \fCC:\Trolltech\Qt\fR dire \fBWarning:\fR On Unix, this function assumes that argv[0] contains the file name of the executable (which it normally does). It also assumes that the current directory hasn't been changed by the application. .PP See also applicationDirPath(). -.SH "int QApplication::argc () const" +.SH "int TQApplication::argc () const" Returns the number of command line arguments. .PP The documentation for argv() describes how to process command line arguments. .PP -See also argv() and QApplication::QApplication(). +See also argv() and TQApplication::TQApplication(). .PP Examples: .)l chart/main.cpp and scribble/scribble.cpp. -.SH "char ** QApplication::argv () const" +.SH "char ** TQApplication::argv () const" Returns the command line argument vector. .PP \fCargv()[0]\fR is the program name, \fCargv()[1]\fR is the first argument and \fCargv()[argc()-1]\fR is the last argument. .PP -A QApplication object is constructed by passing \fIargc\fR and \fIargv\fR from the \fCmain()\fR function. Some of the arguments may be recognized as TQt options and removed from the argument vector. For example, the X11 version of TQt knows about \fC-display\fR, \fC-font\fR and a few more options. +A TQApplication object is constructed by passing \fIargc\fR and \fIargv\fR from the \fCmain()\fR function. Some of the arguments may be recognized as TQt options and removed from the argument vector. For example, the X11 version of TQt knows about \fC-display\fR, \fC-font\fR and a few more options. .PP Example: .PP @@ -725,7 +725,7 @@ Example: // showargs.cpp - displays program arguments in a list box .br .br - #include + #include .br #include .br @@ -734,7 +734,7 @@ Example: .br { .br - QApplication a( argc, argv ); + TQApplication a( argc, argv ); .br TQListBox b; .br @@ -754,20 +754,20 @@ Example: .PP If you run \fCshowargs -display unix:0 -font 9x15bold hello world\fR under X11, the list box contains the three strings "showargs"," hello" and "world". .PP -Qt provides a global pointer, \fCqApp\fR, that points to the QApplication object, and through which you can access argc() and argv() in functions other than main(). +Qt provides a global pointer, \fCqApp\fR, that points to the TQApplication object, and through which you can access argc() and argv() in functions other than main(). .PP -See also argc() and QApplication::QApplication(). +See also argc() and TQApplication::TQApplication(). .PP Examples: .)l chart/main.cpp and scribble/scribble.cpp. -.SH "void QApplication::beep ()\fC [static]\fR" +.SH "void TQApplication::beep ()\fC [static]\fR" Sounds the bell, using the default volume and sound. -.SH "TQClipboard * QApplication::clipboard ()\fC [static]\fR" +.SH "TQClipboard * TQApplication::clipboard ()\fC [static]\fR" Returns a pointer to the application global clipboard. .PP Examples: .)l regexptester/regexptester.cpp and showimg/showimg.cpp. -.SH "void QApplication::closeAllWindows ()\fC [slot]\fR" +.SH "void TQApplication::closeAllWindows ()\fC [slot]\fR" Closes all top-level windows. .PP This function is particularly useful for applications with many top-level windows. It could, for example, be connected to a "Quit" entry in the file menu as shown in the following code example: @@ -793,17 +793,17 @@ See also TQWidget::close(), TQWidget::closeEvent(), lastWindowClosed(), quit(), .PP Examples: .)l action/application.cpp, application/application.cpp, helpviewer/helpwindow.cpp, mdi/application.cpp, and qwerty/qwerty.cpp. -.SH "bool QApplication::closingDown ()\fC [static]\fR" +.SH "bool TQApplication::closingDown ()\fC [static]\fR" Returns TRUE if the application objects are being destroyed; otherwise returns FALSE. .PP See also startingUp(). -.SH "int QApplication::colorSpec ()\fC [static]\fR" +.SH "int TQApplication::colorSpec ()\fC [static]\fR" Returns the color specification. .PP -See also QApplication::setColorSpec(). +See also TQApplication::setColorSpec(). .PP Example: showimg/showimg.cpp. -.SH "void QApplication::commitData ( TQSessionManager & sm )\fC [virtual]\fR" +.SH "void TQApplication::commitData ( TQSessionManager & sm )\fC [virtual]\fR" This function deals with session management. It is invoked when the TQSessionManager wants the application to commit all its data. .PP Usually this means saving all open files, after getting permission from the user. Furthermore you may want to provide a means by which the user can cancel the shutdown. @@ -815,7 +815,7 @@ Note that you should not exit the application within this function. Instead, the The default implementation requests interaction and sends a close event to all visible top level widgets. If any event was rejected, the shutdown is canceled. .PP See also isSessionRestored(), sessionId(), saveState(), and the Session Management overview. -.SH "int QApplication::cursorFlashTime ()\fC [static]\fR" +.SH "int TQApplication::cursorFlashTime ()\fC [static]\fR" Returns the text cursor's flash (blink) time in milliseconds. The flash time is the time required to display, invert and restore the caret display. .PP The default value on X11 is 1000 milliseconds. On Windows, the control panel value is used. @@ -823,18 +823,18 @@ The default value on X11 is 1000 milliseconds. On Windows, the control panel val Widgets should not cache this value since it may be changed at any time by the user changing the global desktop settings. .PP See also setCursorFlashTime(). -.SH "TQTextCodec * QApplication::defaultCodec () const" +.SH "TQTextCodec * TQApplication::defaultCodec () const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Returns TQTextCodec::codecForTr(). -.SH "TQDesktopWidget * QApplication::desktop ()\fC [static]\fR" +.SH "TQDesktopWidget * TQApplication::desktop ()\fC [static]\fR" Returns the desktop widget (also called the root window). .PP The desktop widget is useful for obtaining the size of the screen. It may also be possible to draw on the desktop. We recommend against assuming that it's possible to draw on the desktop, since this does not work on all operating systems. .PP .nf .br - TQDesktopWidget *d = QApplication::desktop(); + TQDesktopWidget *d = TQApplication::desktop(); .br int w = d->width(); // returns desktop width .br @@ -844,31 +844,31 @@ The desktop widget is useful for obtaining the size of the screen. It may also b .PP Examples: .)l canvas/main.cpp, desktop/desktop.cpp, helpviewer/main.cpp, i18n/main.cpp, qmag/qmag.cpp, qwerty/main.cpp, and scribble/main.cpp. -.SH "bool QApplication::desktopSettingsAware ()\fC [static]\fR" +.SH "bool TQApplication::desktopSettingsAware ()\fC [static]\fR" Returns the value set by setDesktopSettingsAware(); by default TRUE. .PP See also setDesktopSettingsAware(). -.SH "int QApplication::doubleClickInterval ()\fC [static]\fR" +.SH "int TQApplication::doubleClickInterval ()\fC [static]\fR" Returns the maximum duration for a double click. .PP The default value on X11 is 400 milliseconds. On Windows, the control panel value is used. .PP See also setDoubleClickInterval(). -.SH "int QApplication::enter_loop ()" +.SH "int TQApplication::enter_loop ()" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP This function enters the main event loop (recursively). Do not call it unless you really know what you are doing. .PP -Use QApplication::eventLoop()->enterLoop() instead. -.SH "TQEventLoop * QApplication::eventLoop ()\fC [static]\fR" -Returns the application event loop. This function will return zero if called during and after destroying QApplication. +Use TQApplication::eventLoop()->enterLoop() instead. +.SH "TQEventLoop * TQApplication::eventLoop ()\fC [static]\fR" +Returns the application event loop. This function will return zero if called during and after destroying TQApplication. .PP -To create your own instance of TQEventLoop or TQEventLoop subclass create it before you create the QApplication object. +To create your own instance of TQEventLoop or TQEventLoop subclass create it before you create the TQApplication object. .PP See also TQEventLoop. .PP Example: distributor/distributor.ui.h. -.SH "int QApplication::exec ()" +.SH "int TQApplication::exec ()" Enters the main event loop and waits until exit() is called or the main widget is destroyed, and returns the value that was set to exit() (which is 0 if exit() is called via quit()). .PP It is necessary to call this function to start event handling. The main event loop receives events from the window system and dispatches these to the application widgets. @@ -881,7 +881,7 @@ See also quit(), exit(), processEvents(), and setMainWidget(). .PP Examples: .)l helpsystem/main.cpp, life/main.cpp, network/archivesearch/main.cpp, network/ftpclient/main.cpp, opengl/main.cpp, t1/main.cpp, and t4/main.cpp. -.SH "void QApplication::exit ( int retcode = 0 )\fC [static]\fR" +.SH "void TQApplication::exit ( int retcode = 0 )\fC [static]\fR" Tells the application to exit with a return code. .PP After this function has been called, the application leaves the main event loop and returns from the call to exec(). The exec() function returns \fIretcode\fR. @@ -894,58 +894,58 @@ See also quit() and exec(). .PP Examples: .)l chart/chartform.cpp, extension/mainform.ui.h, and picture/picture.cpp. -.SH "void QApplication::exit_loop ()" +.SH "void TQApplication::exit_loop ()" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP This function exits from a recursive call to the main event loop. Do not call it unless you are an expert. .PP -Use QApplication::eventLoop()->exitLoop() instead. -.SH "void QApplication::flush ()\fC [static]\fR" +Use TQApplication::eventLoop()->exitLoop() instead. +.SH "void TQApplication::flush ()\fC [static]\fR" Flushes the window system specific event queues. .PP If you are doing graphical changes inside a loop that does not return to the event loop on asynchronous window systems like X11 or double buffered window systems like MacOS X, and you want to visualize these changes immediately (e.g. Splash Screens), call this function. .PP See also flushX(), sendPostedEvents(), and TQPainter::flush(). -.SH "void QApplication::flushX ()\fC [static]\fR" +.SH "void TQApplication::flushX ()\fC [static]\fR" Flushes the X event queue in the X11 implementation. This normally returns almost immediately. Does nothing on other platforms. .PP See also syncX(). .PP Example: xform/xform.cpp. -.SH "TQWidget * QApplication::focusWidget () const" +.SH "TQWidget * TQApplication::focusWidget () const" Returns the application widget that has the keyboard input focus, or 0 if no widget in this application has the focus. .PP See also TQWidget::setFocus(), TQWidget::focus, and activeWindow(). -.SH "TQFont QApplication::font ( const TQWidget * w = 0 )\fC [static]\fR" +.SH "TQFont TQApplication::font ( const TQWidget * w = 0 )\fC [static]\fR" Returns the default font for the widget \fIw\fR, or the default application font if \fIw\fR is 0. .PP See also setFont(), fontMetrics(), and TQWidget::font. .PP Examples: .)l qfd/fontdisplayer.cpp, themes/metal.cpp, and themes/themes.cpp. -.SH "TQFontMetrics QApplication::fontMetrics ()\fC [static]\fR" +.SH "TQFontMetrics TQApplication::fontMetrics ()\fC [static]\fR" Returns display (screen) font metrics for the application font. .PP See also font(), setFont(), TQWidget::fontMetrics(), and TQPainter::fontMetrics(). -.SH "TQSize QApplication::globalStrut ()\fC [static]\fR" +.SH "TQSize TQApplication::globalStrut ()\fC [static]\fR" Returns the application's global strut. .PP The strut is a size object whose dimensions are the minimum that any GUI element that the user can interact with should have. For example no button should be resized to be smaller than the global strut size. .PP See also setGlobalStrut(). -.SH "void QApplication::guiThreadAwake ()\fC [signal]\fR" +.SH "void TQApplication::guiThreadAwake ()\fC [signal]\fR" This signal is emitted after the event loop returns from a function that could block. .PP See also wakeUpGuiThread(). -.SH "bool QApplication::hasGlobalMouseTracking ()\fC [static]\fR" +.SH "bool TQApplication::hasGlobalMouseTracking ()\fC [static]\fR" Returns TRUE if global mouse tracking is enabled; otherwise returns FALSE. .PP See also setGlobalMouseTracking(). -.SH "bool QApplication::hasPendingEvents ()" -This function returns TRUE if there are pending events; otherwise returns FALSE. Pending events can be either from the window system or posted events using QApplication::postEvent(). -.SH "int QApplication::horizontalAlignment ( int align )\fC [static]\fR" +.SH "bool TQApplication::hasPendingEvents ()" +This function returns TRUE if there are pending events; otherwise returns FALSE. Pending events can be either from the window system or posted events using TQApplication::postEvent(). +.SH "int TQApplication::horizontalAlignment ( int align )\fC [static]\fR" Strips out vertical alignment flags and transforms an alignment \fIalign\fR of AlignAuto into AlignLeft or AlignRight according to the language used. The other horizontal alignment flags are left untouched. -.SH "void QApplication::installTranslator ( TQTranslator * mf )" +.SH "void TQApplication::installTranslator ( TQTranslator * mf )" Adds the message file \fImf\fR to the list of message files to be used for translations. .PP Multiple message files can be installed. Translations are searched for in the last installed message file, then the one from last, and so on, back to the first installed message file. The search stops as soon as a matching translation is found. @@ -953,7 +953,7 @@ Multiple message files can be installed. Translations are searched for in the la See also removeTranslator(), translate(), and TQTranslator::load(). .PP Example: i18n/main.cpp. -.SH "bool QApplication::isEffectEnabled ( TQt::UIEffect effect )\fC [static]\fR" +.SH "bool TQApplication::isEffectEnabled ( TQt::UIEffect effect )\fC [static]\fR" Returns TRUE if \fIeffect\fR is enabled; otherwise returns FALSE. .PP By default, TQt will try to use the desktop settings. Call setDesktopSettingsAware(FALSE) to prevent this. @@ -961,11 +961,11 @@ By default, TQt will try to use the desktop settings. Call setDesktopSettingsAwa Note: All effects are disabled on screens running at less than 16-bit color depth. .PP See also setEffectEnabled() and TQt::UIEffect. -.SH "bool QApplication::isSessionRestored () const" +.SH "bool TQApplication::isSessionRestored () const" Returns TRUE if the application has been restored from an earlier session; otherwise returns FALSE. .PP See also sessionId(), commitData(), and saveState(). -.SH "void QApplication::lastWindowClosed ()\fC [signal]\fR" +.SH "void TQApplication::lastWindowClosed ()\fC [signal]\fR" This signal is emitted when the user has closed the last top level window. .PP The signal is very useful when your application has many top level widgets but no main widget. You can then connect it to the quit() slot. @@ -976,7 +976,7 @@ See also mainWidget(), topLevelWidgets(), TQWidget::isTopLevel, and TQWidget::cl .PP Examples: .)l addressbook/main.cpp, extension/main.cpp, helpviewer/main.cpp, mdi/main.cpp, network/archivesearch/main.cpp, qwerty/main.cpp, and regexptester/main.cpp. -.SH "TQStringList QApplication::libraryPaths ()\fC [static]\fR" +.SH "TQStringList TQApplication::libraryPaths ()\fC [static]\fR" Returns a list of paths that the application will search when dynamically loading libraries. The installation directory for plugins is the only entry if no paths have been set. The default installation directory for plugins is \fCINSTALL/plugins\fR, where \fCINSTALL\fR is the directory where TQt was installed. The directory of the application executable (NOT the working directory) is also added to the plugin paths. .PP If you want to iterate over the list, you should iterate over a copy, e.g. @@ -1000,33 +1000,33 @@ If you want to iterate over the list, you should iterate over a copy, e.g. See the plugins documentation for a description of how the library paths are used. .PP See also setLibraryPaths(), addLibraryPath(), removeLibraryPath(), and TQLibrary. -.SH "void QApplication::lock ()" +.SH "void TQApplication::lock ()" Lock the TQt Library Mutex. If another thread has already locked the mutex, the calling thread will block until the other thread has unlocked the mutex. .PP See also unlock(), locked(), and Thread Support in Qt. -.SH "bool QApplication::locked ()" +.SH "bool TQApplication::locked ()" Returns TRUE if the TQt Library Mutex is locked by a different thread; otherwise returns FALSE. .PP \fBWarning:\fR Due to different implementations of recursive mutexes on the supported platforms, calling this function from the same thread that previously locked the mutex will give undefined results. .PP See also lock(), unlock(), and Thread Support in Qt. -.SH "int QApplication::loopLevel () const" +.SH "int TQApplication::loopLevel () const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Returns the current loop level. .PP -Use QApplication::eventLoop()->loopLevel() instead. -.SH "bool QApplication::macEventFilter ( EventHandlerCallRef, EventRef )\fC [virtual]\fR" +Use TQApplication::eventLoop()->loopLevel() instead. +.SH "bool TQApplication::macEventFilter ( EventHandlerCallRef, EventRef )\fC [virtual]\fR" This virtual function is only implemented under Macintosh. .PP -If you create an application that inherits QApplication and reimplement this function, you get direct access to all Carbon Events that are received from the MacOS. +If you create an application that inherits TQApplication and reimplement this function, you get direct access to all Carbon Events that are received from the MacOS. .PP Return TRUE if you want to stop the event from being processed. Return FALSE for normal event dispatching. -.SH "TQWidget * QApplication::mainWidget () const" +.SH "TQWidget * TQApplication::mainWidget () const" Returns the main application widget, or 0 if there is no main widget. .PP See also setMainWidget(). -.SH "bool QApplication::notify ( TQObject * receiver, TQEvent * e )\fC [virtual]\fR" +.SH "bool TQApplication::notify ( TQObject * receiver, TQEvent * e )\fC [virtual]\fR" Sends event \fIe\fR to \fIreceiver\fR: \fIreceiver\fR->event(\fIe\fR). Returns the value that is returned from the receiver's event handler. .PP For certain types of events (e.g. mouse and key events), the event will be propagated to the receiver's parent and so on up to the top-level object if the receiver is not interested in the event (i.e., it returns FALSE). @@ -1048,13 +1048,13 @@ Installing an event filter on the object. Such an event filter gets all the even Reimplementing paintEvent(), mousePressEvent() and so on. This is the commonest, easiest and least powerful way. .PP See also TQObject::event() and installEventFilter(). -.SH "TQCursor * QApplication::overrideCursor ()\fC [static]\fR" +.SH "TQCursor * TQApplication::overrideCursor ()\fC [static]\fR" Returns the active application override cursor. .PP This function returns 0 if no application cursor has been defined (i.e. the internal cursor stack is empty). .PP See also setOverrideCursor() and restoreOverrideCursor(). -.SH "TQPalette QApplication::palette ( const TQWidget * w = 0 )\fC [static]\fR" +.SH "TQPalette TQApplication::palette ( const TQWidget * w = 0 )\fC [static]\fR" Returns the application palette. .PP If a widget is passed in \fIw\fR, the default palette for the widget's class is returned. This may or may not be the application palette. In most cases there isn't a special palette for certain types of widgets, but one notable exception is the popup menu under Windows, if the user has defined a special background color for menus in the display settings. @@ -1063,7 +1063,7 @@ See also setPalette() and TQWidget::palette. .PP Examples: .)l desktop/desktop.cpp, themes/metal.cpp, and themes/wood.cpp. -.SH "void QApplication::polish ( TQWidget * w )\fC [virtual]\fR" +.SH "void TQApplication::polish ( TQWidget * w )\fC [virtual]\fR" Initialization of the appearance of the widget \fIw\fR \fIbefore\fR it is first shown. .PP Usually widgets call this automatically when they are polished. It may be used to do some style-based central customization of widgets. @@ -1071,7 +1071,7 @@ Usually widgets call this automatically when they are polished. It may be used t Note that you are not limited to the public functions of TQWidget. Instead, based on meta information like TQObject::className() you are able to customize any kind of widget. .PP See also TQStyle::polish(), TQWidget::polish(), setPalette(), and setFont(). -.SH "void QApplication::postEvent ( TQObject * receiver, TQEvent * event )\fC [static]\fR" +.SH "void TQApplication::postEvent ( TQObject * receiver, TQEvent * event )\fC [static]\fR" \fBNote:\fR This function is thread-safe when TQt is built withthread support.

      Adds the event \fIevent\fR with the object \fIreceiver\fR as the receiver of the event, to an event queue and returns immediately. .PP The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted. @@ -1079,7 +1079,7 @@ The event must be allocated on the heap since the post event queue will take own When control returns to the main event loop, all events that are stored in the queue will be sent using the notify() function. .PP See also sendEvent() and notify(). -.SH "void QApplication::processEvents ()" +.SH "void TQApplication::processEvents ()" Processes pending events, for 3 seconds or until there are no more events to process, whichever is shorter. .PP You can call this function occasionally when your program is busy performing a long operation (e.g. copying a file). @@ -1088,7 +1088,7 @@ See also exec(), TQTimer, and TQEventLoop::processEvents(). .PP Examples: .)l fileiconview/tqfileiconview.cpp and network/ftpclient/main.cpp. -.SH "void QApplication::processEvents ( int maxtime )" +.SH "void TQApplication::processEvents ( int maxtime )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Processes pending events for \fImaxtime\fR milliseconds or until there are no more events to process, whichever is shorter. @@ -1096,7 +1096,7 @@ Processes pending events for \fImaxtime\fR milliseconds or until there are no mo You can call this function occasionally when you program is busy doing a long operation (e.g. copying a file). .PP See also exec(), TQTimer, and TQEventLoop::processEvents(). -.SH "void QApplication::processOneEvent ()" +.SH "void TQApplication::processOneEvent ()" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Waits for an event to occur, processes it, then returns. @@ -1106,8 +1106,8 @@ This function is useful for adapting TQt to situations where the event processin Using this function in new applications may be an indication of design problems. .PP See also processEvents(), exec(), and TQTimer. -.SH "void QApplication::quit ()\fC [slot]\fR" -Tells the application to exit with return code 0 (success). Equivalent to calling QApplication::exit( 0 ). +.SH "void TQApplication::quit ()\fC [slot]\fR" +Tells the application to exit with return code 0 (success). Equivalent to calling TQApplication::exit( 0 ). .PP It's common to connect the lastWindowClosed() signal to quit(), and you also often connect e.g. TQButton::clicked() or signals in TQAction, TQPopupMenu or TQMenuBar to it. .PP @@ -1125,21 +1125,21 @@ See also exit(), aboutToQuit(), lastWindowClosed(), and TQAction. .PP Examples: .)l addressbook/main.cpp, mdi/main.cpp, network/archivesearch/main.cpp, regexptester/main.cpp, t2/main.cpp, t4/main.cpp, and t6/main.cpp. -.SH "void QApplication::removeLibraryPath ( const TQString & path )\fC [static]\fR" +.SH "void TQApplication::removeLibraryPath ( const TQString & path )\fC [static]\fR" Removes \fIpath\fR from the library path list. If \fIpath\fR is empty or not in the path list, the list is not changed. .PP See also addLibraryPath(), libraryPaths(), and setLibraryPaths(). -.SH "void QApplication::removePostedEvents ( TQObject * receiver )\fC [static]\fR" +.SH "void TQApplication::removePostedEvents ( TQObject * receiver )\fC [static]\fR" \fBNote:\fR This function is thread-safe when TQt is built withthread support.

      Removes all events posted using postEvent() for \fIreceiver\fR. .PP The events are \fInot\fR dispatched, instead they are removed from the queue. You should never need to call this function. If you do call it, be aware that killing events may cause \fIreceiver\fR to break one or more invariants. -.SH "void QApplication::removeTranslator ( TQTranslator * mf )" +.SH "void TQApplication::removeTranslator ( TQTranslator * mf )" Removes the message file \fImf\fR from the list of message files used by this application. (It does not delete the message file from the file system.) .PP See also installTranslator(), translate(), and TQObject::tr(). .PP Example: i18n/main.cpp. -.SH "void QApplication::restoreOverrideCursor ()\fC [static]\fR" +.SH "void TQApplication::restoreOverrideCursor ()\fC [static]\fR" Undoes the last setOverrideCursor(). .PP If setOverrideCursor() has been called twice, calling restoreOverrideCursor() will activate the first cursor set. Calling this function a second time restores the original widgets' cursors. @@ -1148,11 +1148,11 @@ See also setOverrideCursor() and overrideCursor(). .PP Examples: .)l distributor/distributor.ui.h, network/archivesearch/archivedialog.ui.h, network/ftpclient/ftpmainwindow.ui.h, and showimg/showimg.cpp. -.SH "bool QApplication::reverseLayout ()\fC [static]\fR" +.SH "bool TQApplication::reverseLayout ()\fC [static]\fR" Returns TRUE if all dialogs and widgets will be laid out in a mirrored (right to left) fashion. Returns FALSE if dialogs and widgets will be laid out left to right. .PP See also setReverseLayout(). -.SH "void QApplication::saveState ( TQSessionManager & sm )\fC [virtual]\fR" +.SH "void TQApplication::saveState ( TQSessionManager & sm )\fC [virtual]\fR" This function deals with session management. It is invoked when the session manager wants the application to preserve its state for a future session. .PP For example, a text editor would create a temporary file that includes the current contents of its edit buffers, the location of the cursor and other aspects of the current editing session. @@ -1162,7 +1162,7 @@ Note that you should never exit the application within this function. Instead, t \fBWarning:\fR Within this function, no user interaction is possible, \fIunless\fR you ask the session manager \fIsm\fR for explicit permission. See TQSessionManager::allowsInteraction() and TQSessionManager::allowsErrorInteraction() for details. .PP See also isSessionRestored(), sessionId(), commitData(), and the Session Management overview. -.SH "bool QApplication::sendEvent ( TQObject * receiver, TQEvent * event )\fC [static]\fR" +.SH "bool TQApplication::sendEvent ( TQObject * receiver, TQEvent * event )\fC [static]\fR" Sends event \fIevent\fR directly to receiver \fIreceiver\fR, using the notify() function. Returns the value that was returned from the event handler. .PP The event is \fInot\fR deleted when the event has been sent. The normal approach is to create the event on the stack, e.g. @@ -1171,7 +1171,7 @@ The event is \fInot\fR deleted when the event has been sent. The normal approach .br TQMouseEvent me( TQEvent::MouseButtonPress, pos, 0, 0 ); .br - QApplication::sendEvent( mainWindow, &me ); + TQApplication::sendEvent( mainWindow, &me ); .br .fi If you create the event on the heap you must delete it. @@ -1179,17 +1179,17 @@ If you create the event on the heap you must delete it. See also postEvent() and notify(). .PP Example: popup/popup.cpp. -.SH "void QApplication::sendPostedEvents ( TQObject * receiver, int event_type )\fC [static]\fR" -Immediately dispatches all events which have been previously queued with QApplication::postEvent() and which are for the object \fIreceiver\fR and have the event type \fIevent_type\fR. +.SH "void TQApplication::sendPostedEvents ( TQObject * receiver, int event_type )\fC [static]\fR" +Immediately dispatches all events which have been previously queued with TQApplication::postEvent() and which are for the object \fIreceiver\fR and have the event type \fIevent_type\fR. .PP Note that events from the window system are \fInot\fR dispatched by this function, but by processEvents(). .PP If \fIreceiver\fR is null, the events of \fIevent_type\fR are sent for all objects. If \fIevent_type\fR is 0, all the events are sent for \fIreceiver\fR. -.SH "void QApplication::sendPostedEvents ()\fC [static]\fR" +.SH "void TQApplication::sendPostedEvents ()\fC [static]\fR" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Dispatches all posted events, i.e. empties the event queue. -.SH "TQString QApplication::sessionId () const" +.SH "TQString TQApplication::sessionId () const" Returns the current session's identifier. .PP If the application has been restored from an earlier session, this identifier is the same as it was in that previous session. @@ -1197,7 +1197,7 @@ If the application has been restored from an earlier session, this identifier is The session identifier is guaranteed to be unique both for different applications and for different instances of the same application. .PP See also isSessionRestored(), sessionKey(), commitData(), and saveState(). -.SH "TQString QApplication::sessionKey () const" +.SH "TQString TQApplication::sessionKey () const" Returns the session key in the current session. .PP If the application has been restored from an earlier session, this key is the same as it was when the previous session ended. @@ -1205,20 +1205,20 @@ If the application has been restored from an earlier session, this key is the sa The session key changes with every call of commitData() or saveState(). .PP See also isSessionRestored(), sessionId(), commitData(), and saveState(). -.SH "void QApplication::setColorSpec ( int spec )\fC [static]\fR" +.SH "void TQApplication::setColorSpec ( int spec )\fC [static]\fR" Sets the color specification for the application to \fIspec\fR. .PP The color specification controls how the application allocates colors when run on a display with a limited amount of colors, e.g. 8 bit / 256 color displays. .PP -The color specification must be set before you create the QApplication object. +The color specification must be set before you create the TQApplication object. .PP The options are: .TP -QApplication::NormalColor. This is the default color allocation strategy. Use this option if your application uses buttons, menus, texts and pixmaps with few colors. With this option, the application uses system global colors. This works fine for most applications under X11, but on Windows machines it may cause dithering of non-standard colors. +TQApplication::NormalColor. This is the default color allocation strategy. Use this option if your application uses buttons, menus, texts and pixmaps with few colors. With this option, the application uses system global colors. This works fine for most applications under X11, but on Windows machines it may cause dithering of non-standard colors. .TP -QApplication::CustomColor. Use this option if your application needs a small number of custom colors. On X11, this option is the same as NormalColor. On Windows, TQt creates a Windows palette, and allocates colors to it on demand. +TQApplication::CustomColor. Use this option if your application needs a small number of custom colors. On X11, this option is the same as NormalColor. On Windows, TQt creates a Windows palette, and allocates colors to it on demand. .TP -QApplication::ManyColor. Use this option if your application is very color hungry (e.g. it requires thousands of colors). Under X11 the effect is: +TQApplication::ManyColor. Use this option if your application is very color hungry (e.g. it requires thousands of colors). Under X11 the effect is: .TP For 256-color displays which have at best a 256 color true color visual, the default visual is used, and colors are allocated from a color cube. The color cube is the 6x6x6 (216 color) "Web palette"*, but the number of colors can be changed by the \fI-ncols\fR option. The user can force the application to use the true color visual with the -visual option. .TP @@ -1234,9 +1234,9 @@ Example: .br { .br - QApplication::setColorSpec( QApplication::ManyColor ); + TQApplication::setColorSpec( TQApplication::ManyColor ); .br - QApplication a( argc, argv ); + TQApplication a( argc, argv ); .br ... .br @@ -1246,7 +1246,7 @@ Example: .PP TQColor provides more functionality for controlling color allocation and freeing up certain colors. See TQColor::enterAllocContext() for more information. .PP -To check what mode you end up with, call TQColor::numBitPlanes() once the QApplication object exists. A value greater than 8 (typically 16, 24 or 32) means true color. +To check what mode you end up with, call TQColor::numBitPlanes() once the TQApplication object exists. A value greater than 8 (typically 16, 24 or 32) means true color. .PP * The color cube used by TQt has 216 colors whose red, green, and blue components always have one of the following values: 0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF. .PP @@ -1254,28 +1254,28 @@ See also colorSpec(), TQColor::numBitPlanes(), and TQColor::enterAllocContext(). .PP Examples: .)l helpviewer/main.cpp, opengl/main.cpp, showimg/main.cpp, t9/main.cpp, tetrax/tetrax.cpp, tetrix/tetrix.cpp, and themes/main.cpp. -.SH "void QApplication::setCursorFlashTime ( int msecs )\fC [static]\fR" +.SH "void TQApplication::setCursorFlashTime ( int msecs )\fC [static]\fR" Sets the text cursor's flash (blink) time to \fImsecs\fR milliseconds. The flash time is the time required to display, invert and restore the caret display. Usually the text cursor is displayed for \fImsecs/2\fR milliseconds, then hidden for \fImsecs/2\fR milliseconds, but this may vary. .PP Note that on Microsoft Windows, calling this function sets the cursor flash time for all windows. .PP See also cursorFlashTime(). -.SH "void QApplication::setDefaultCodec ( TQTextCodec * codec )" +.SH "void TQApplication::setDefaultCodec ( TQTextCodec * codec )" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP This is the same as TQTextCodec::setCodecForTr(). -.SH "void QApplication::setDesktopSettingsAware ( bool on )\fC [static]\fR" +.SH "void TQApplication::setDesktopSettingsAware ( bool on )\fC [static]\fR" By default, TQt will try to use the current standard colors, fonts etc., from the underlying window system's desktop settings, and use them for all relevant widgets. This behavior can be switched off by calling this function with \fIon\fR set to FALSE. .PP -This static function must be called before creating the QApplication object, like this: +This static function must be called before creating the TQApplication object, like this: .PP .nf .br int main( int argc, char** argv ) { .br - QApplication::setDesktopSettingsAware( FALSE ); // I know better than the user + TQApplication::setDesktopSettingsAware( FALSE ); // I know better than the user .br - QApplication myApp( argc, argv ); // Use default fonts & colors + TQApplication myApp( argc, argv ); // Use default fonts & colors .br ... .br @@ -1284,19 +1284,19 @@ This static function must be called before creating the QApplication object, lik .fi .PP See also desktopSettingsAware(). -.SH "void QApplication::setDoubleClickInterval ( int ms )\fC [static]\fR" +.SH "void TQApplication::setDoubleClickInterval ( int ms )\fC [static]\fR" Sets the time limit that distinguishes a double click from two consecutive mouse clicks to \fIms\fR milliseconds. .PP Note that on Microsoft Windows, calling this function sets the double click interval for all windows. .PP See also doubleClickInterval(). -.SH "void QApplication::setEffectEnabled ( TQt::UIEffect effect, bool enable = TRUE )\fC [static]\fR" +.SH "void TQApplication::setEffectEnabled ( TQt::UIEffect effect, bool enable = TRUE )\fC [static]\fR" Enables the UI effect \fIeffect\fR if \fIenable\fR is TRUE, otherwise the effect will not be used. .PP Note: All effects are disabled on screens running at less than 16-bit color depth. .PP See also isEffectEnabled(), TQt::UIEffect, and setDesktopSettingsAware(). -.SH "void QApplication::setFont ( const TQFont & font, bool informWidgets = FALSE, const char * className = 0 )\fC [static]\fR" +.SH "void TQApplication::setFont ( const TQFont & font, bool informWidgets = FALSE, const char * className = 0 )\fC [static]\fR" Changes the default application font to \fIfont\fR. If \fIinformWidgets\fR is TRUE, then existing widgets are informed about the change and may adjust themselves to the new application setting. If \fIinformWidgets\fR is FALSE, the change only affects newly created widgets. If \fIclassName\fR is passed, the change applies only to classes that inherit \fIclassName\fR (as reported by TQObject::inherits()). .PP On application start-up, the default font depends on the window system. It can vary depending on both the window system version and the locale. This function lets you override the default font; but overriding may be a bad idea because, for example, some locales need extra-large fonts to support their special characters. @@ -1305,7 +1305,7 @@ See also font(), fontMetrics(), and TQWidget::font. .PP Examples: .)l desktop/desktop.cpp, themes/metal.cpp, and themes/themes.cpp. -.SH "void QApplication::setGlobalMouseTracking ( bool enable )\fC [static]\fR" +.SH "void TQApplication::setGlobalMouseTracking ( bool enable )\fC [static]\fR" Enables global mouse tracking if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE. .PP Enabling global mouse tracking makes it possible for widget event filters or application event filters to get all mouse move events, even when no button is depressed. This is useful for special GUI elements, e.g. tooltips. @@ -1318,22 +1318,22 @@ This function uses an internal counter. Each setGlobalMouseTracking(TRUE) must h .br // at this point global mouse tracking is off .br - QApplication::setGlobalMouseTracking( TRUE ); + TQApplication::setGlobalMouseTracking( TRUE ); .br - QApplication::setGlobalMouseTracking( TRUE ); + TQApplication::setGlobalMouseTracking( TRUE ); .br - QApplication::setGlobalMouseTracking( FALSE ); + TQApplication::setGlobalMouseTracking( FALSE ); .br // at this point it's still on .br - QApplication::setGlobalMouseTracking( FALSE ); + TQApplication::setGlobalMouseTracking( FALSE ); .br // but now it's off .br .fi .PP See also hasGlobalMouseTracking() and TQWidget::mouseTracking. -.SH "void QApplication::setGlobalStrut ( const TQSize & strut )\fC [static]\fR" +.SH "void TQApplication::setGlobalStrut ( const TQSize & strut )\fC [static]\fR" Sets the application's global strut to \fIstrut\fR. .PP The strut is a size object whose dimensions are the minimum that any GUI element that the user can interact with should have. For example no button should be resized to be smaller than the global strut size. @@ -1348,21 +1348,21 @@ Example: .br { .br - return TQSize( 80, 25 ).expandedTo( QApplication::globalStrut() ); + return TQSize( 80, 25 ).expandedTo( TQApplication::globalStrut() ); .br } .br .fi .PP See also globalStrut(). -.SH "void QApplication::setLibraryPaths ( const TQStringList & paths )\fC [static]\fR" +.SH "void TQApplication::setLibraryPaths ( const TQStringList & paths )\fC [static]\fR" Sets the list of directories to search when loading libraries to \fIpaths\fR. All existing paths will be deleted and the path list will consist of the paths given in \fIpaths\fR. .PP See also libraryPaths(), addLibraryPath(), removeLibraryPath(), and TQLibrary. -.SH "void QApplication::setMainWidget ( TQWidget * mainWidget )\fC [virtual]\fR" +.SH "void TQApplication::setMainWidget ( TQWidget * mainWidget )\fC [virtual]\fR" Sets the application's main widget to \fImainWidget\fR. .PP -In most respects the main widget is like any other widget, except that if it is closed, the application exits. Note that QApplication does \fInot\fR take ownership of the \fImainWidget\fR, so if you create your main widget on the heap you must delete it yourself. +In most respects the main widget is like any other widget, except that if it is closed, the application exits. Note that TQApplication does \fInot\fR take ownership of the \fImainWidget\fR, so if you create your main widget on the heap you must delete it yourself. .PP You need not have a main widget; connecting lastWindowClosed() to quit() is an alternative. .PP @@ -1372,7 +1372,7 @@ See also mainWidget(), exec(), and quit(). .PP Examples: .)l chart/main.cpp, helpsystem/main.cpp, life/main.cpp, network/ftpclient/main.cpp, opengl/main.cpp, t1/main.cpp, and t4/main.cpp. -.SH "void QApplication::setOverrideCursor ( const TQCursor & cursor, bool replace = FALSE )\fC [static]\fR" +.SH "void TQApplication::setOverrideCursor ( const TQCursor & cursor, bool replace = FALSE )\fC [static]\fR" Sets the application override cursor to \fIcursor\fR. .PP Application override cursors are intended for showing the user that the application is in a special state, for example during an operation that might take some time. @@ -1387,11 +1387,11 @@ Example: .PP .nf .br - QApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); .br calculateHugeMandelbrot(); // lunch time... .br - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); .br .fi .PP @@ -1399,7 +1399,7 @@ See also overrideCursor(), restoreOverrideCursor(), and TQWidget::cursor. .PP Examples: .)l distributor/distributor.ui.h, network/archivesearch/archivedialog.ui.h, network/ftpclient/ftpmainwindow.ui.h, and showimg/showimg.cpp. -.SH "void QApplication::setPalette ( const TQPalette & palette, bool informWidgets = FALSE, const char * className = 0 )\fC [static]\fR" +.SH "void TQApplication::setPalette ( const TQPalette & palette, bool informWidgets = FALSE, const char * className = 0 )\fC [static]\fR" Changes the default application palette to \fIpalette\fR. If \fIinformWidgets\fR is TRUE, then existing widgets are informed about the change and may adjust themselves to the new application setting. If \fIinformWidgets\fR is FALSE, the change only affects newly created widgets. .PP If \fIclassName\fR is passed, the change applies only to widgets that inherit \fIclassName\fR (as reported by TQObject::inherits()). If \fIclassName\fR is left 0, the change affects all widgets, thus overriding any previously set class specific palettes. @@ -1410,28 +1410,28 @@ See also TQWidget::palette, palette(), and TQStyle::polish(). .PP Examples: .)l i18n/main.cpp, themes/metal.cpp, themes/themes.cpp, and themes/wood.cpp. -.SH "void QApplication::setReverseLayout ( bool b )\fC [static]\fR" +.SH "void TQApplication::setReverseLayout ( bool b )\fC [static]\fR" If \fIb\fR is TRUE, all dialogs and widgets will be laid out in a mirrored fashion, as required by right to left languages such as Arabic and Hebrew. If \fIb\fR is FALSE, dialogs and widgets are laid out left to right. .PP Changing this flag in runtime does not cause a relayout of already instantiated widgets. .PP See also reverseLayout(). -.SH "void QApplication::setStartDragDistance ( int l )\fC [static]\fR" +.SH "void TQApplication::setStartDragDistance ( int l )\fC [static]\fR" Sets the distance after which a drag should start to \fIl\fR pixels. .PP See also startDragDistance(). -.SH "void QApplication::setStartDragTime ( int ms )\fC [static]\fR" +.SH "void TQApplication::setStartDragTime ( int ms )\fC [static]\fR" Sets the time after which a drag should start to \fIms\fR ms. .PP See also startDragTime(). -.SH "void QApplication::setStyle ( TQStyle * style )\fC [static]\fR" -Sets the application's GUI style to \fIstyle\fR. Ownership of the style object is transferred to QApplication, so QApplication will delete the style object on application exit or when a new style is set. +.SH "void TQApplication::setStyle ( TQStyle * style )\fC [static]\fR" +Sets the application's GUI style to \fIstyle\fR. Ownership of the style object is transferred to TQApplication, so TQApplication will delete the style object on application exit or when a new style is set. .PP Example usage: .PP .nf .br - QApplication::setStyle( new TQWindowsStyle ); + TQApplication::setStyle( new TQWindowsStyle ); .br .fi .PP @@ -1440,23 +1440,23 @@ When switching application styles, the color palette is set back to the initial See also style(), TQStyle, setPalette(), and desktopSettingsAware(). .PP Example: themes/themes.cpp. -.SH "TQStyle * QApplication::setStyle ( const TQString & style )\fC [static]\fR" +.SH "TQStyle * TQApplication::setStyle ( const TQString & style )\fC [static]\fR" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Requests a TQStyle object for \fIstyle\fR from the TQStyleFactory. .PP The string must be one of the TQStyleFactory::keys(), typically one of "windows", "motif", "cde", "motifplus", "platinum", "sgi" and" compact". Depending on the platform, "windowsxp", "aqua" or" macintosh" may be available. .PP -A later call to the QApplication constructor will override the requested style when a "-style" option is passed in as a commandline parameter. +A later call to the TQApplication constructor will override the requested style when a "-style" option is passed in as a commandline parameter. .PP Returns 0 if an unknown \fIstyle\fR is passed, otherwise the TQStyle object returned is set as the application's GUI style. -.SH "void QApplication::setWheelScrollLines ( int n )\fC [static]\fR" +.SH "void TQApplication::setWheelScrollLines ( int n )\fC [static]\fR" Sets the number of lines to scroll when the mouse wheel is rotated to \fIn\fR. .PP If this number exceeds the number of visible lines in a certain widget, the widget should interpret the scroll operation as a single page up / page down operation instead. .PP See also wheelScrollLines(). -.SH "void QApplication::setWinStyleHighlightColor ( const TQColor & c )\fC [static]\fR" +.SH "void TQApplication::setWinStyleHighlightColor ( const TQColor & c )\fC [static]\fR" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Sets the color used to mark selections in windows style for all widgets in the application. Will repaint all widgets if the color is changed. @@ -1464,7 +1464,7 @@ Sets the color used to mark selections in windows style for all widgets in the a The default color is \fCdarkBlue\fR. .PP See also winStyleHighlightColor(). -.SH "int QApplication::startDragDistance ()\fC [static]\fR" +.SH "int TQApplication::startDragDistance ()\fC [static]\fR" If you support drag and drop in you application and a drag should start after a mouse click and after moving the mouse a certain distance, you should use the value which this method returns as the distance. .PP For example, if the mouse position of the click is stored in \fCstartPos\fR and the current position (e.g. in the mouse move event) is \fCcurrPos\fR, you can find out if a drag should be started with code like this: @@ -1473,7 +1473,7 @@ For example, if the mouse position of the click is stored in \fCstartPos\fR and .br if ( ( startPos - currPos ).manhattanLength() > .br - QApplication::startDragDistance() ) + TQApplication::startDragDistance() ) .br startTheDrag(); .br @@ -1484,7 +1484,7 @@ Qt uses this value internally, e.g. in TQFileDialog. The default value is 4 pixels. .PP See also setStartDragDistance(), startDragTime(), and TQPoint::manhattanLength(). -.SH "int QApplication::startDragTime ()\fC [static]\fR" +.SH "int TQApplication::startDragTime ()\fC [static]\fR" If you support drag and drop in you application and a drag should start after a mouse click and after a certain time elapsed, you should use the value which this method returns as the delay (in ms). .PP Qt also uses this delay internally, e.g. in TQTextEdit and TQLineEdit, for starting a drag. @@ -1492,19 +1492,19 @@ Qt also uses this delay internally, e.g. in TQTextEdit and TQLineEdit, for start The default value is 500 ms. .PP See also setStartDragTime() and startDragDistance(). -.SH "bool QApplication::startingUp ()\fC [static]\fR" +.SH "bool TQApplication::startingUp ()\fC [static]\fR" Returns TRUE if an application object has not been created yet; otherwise returns FALSE. .PP See also closingDown(). -.SH "TQStyle & QApplication::style ()\fC [static]\fR" +.SH "TQStyle & TQApplication::style ()\fC [static]\fR" Returns the application's style object. .PP See also setStyle() and TQStyle. -.SH "void QApplication::syncX ()\fC [static]\fR" +.SH "void TQApplication::syncX ()\fC [static]\fR" Synchronizes with the X server in the X11 implementation. This normally takes some time. Does nothing on other platforms. .PP See also flushX(). -.SH "TQWidgetList * QApplication::topLevelWidgets ()\fC [static]\fR" +.SH "TQWidgetList * TQApplication::topLevelWidgets ()\fC [static]\fR" Returns a list of the top level widgets in the application. .PP The list is created using \fCnew\fR and must be deleted by the caller. @@ -1519,7 +1519,7 @@ Example: .br // Show all hidden top level widgets. .br - TQWidgetList *list = QApplication::topLevelWidgets(); + TQWidgetList *list = TQApplication::topLevelWidgets(); .br TQWidgetListIt it( *list ); // iterate over the widgets .br @@ -1542,7 +1542,7 @@ Example: \fBWarning:\fR Delete the list as soon you have finished using it. The widgets in the list may be deleted by someone else at any time. .PP See also allWidgets(), TQWidget::isTopLevel, TQWidget::visible, and TQPtrList::isEmpty(). -.SH "TQString QApplication::translate ( const char * context, const char * sourceText, const char * comment = 0, Encoding encoding = DefaultCodec ) const" +.SH "TQString TQApplication::translate ( const char * context, const char * sourceText, const char * comment = 0, Encoding encoding = DefaultCodec ) const" \fBNote:\fR This function is reentrant when TQt is built with thread support.

      Returns the translation text for \fIsourceText\fR, by querying the installed messages files. The message files are searched from the most recently installed message file back to the first installed message file. .PP TQObject::tr() and TQObject::trUtf8() provide this functionality more conveniently. @@ -1560,27 +1560,27 @@ This function is not virtual. You can use alternative translation techniques by \fBWarning:\fR This method is reentrant only if all translators are installed \fIbefore\fR calling this method. Installing or removing translators while performing translations is not supported. Doing so will most likely result in crashes or other undesirable behavior. .PP See also TQObject::tr(), installTranslator(), and defaultCodec(). -.SH "bool QApplication::tryLock ()" +.SH "bool TQApplication::tryLock ()" Attempts to lock the TQt Library Mutex, and returns immediately. If the lock was obtained, this function returns TRUE. If another thread has locked the mutex, this function returns FALSE, instead of waiting for the lock to become available. .PP The mutex must be unlocked with unlock() before another thread can successfully lock it. .PP See also lock(), unlock(), and Thread Support in Qt. -.SH "Type QApplication::type () const" +.SH "Type TQApplication::type () const" Returns the type of application, Tty, GuiClient or GuiServer. -.SH "void QApplication::unlock ( bool wakeUpGui = TRUE )" -Unlock the TQt Library Mutex. If \fIwakeUpGui\fR is TRUE (the default), then the GUI thread will be woken with QApplication::wakeUpGuiThread(). +.SH "void TQApplication::unlock ( bool wakeUpGui = TRUE )" +Unlock the TQt Library Mutex. If \fIwakeUpGui\fR is TRUE (the default), then the GUI thread will be woken with TQApplication::wakeUpGuiThread(). .PP See also lock(), locked(), and Thread Support in Qt. -.SH "void QApplication::wakeUpGuiThread ()" +.SH "void TQApplication::wakeUpGuiThread ()" Wakes up the GUI thread. .PP See also guiThreadAwake() and Thread Support in Qt. -.SH "int QApplication::wheelScrollLines ()\fC [static]\fR" +.SH "int TQApplication::wheelScrollLines ()\fC [static]\fR" Returns the number of lines to scroll when the mouse wheel is rotated. .PP See also setWheelScrollLines(). -.SH "TQWidget * QApplication::widgetAt ( int x, int y, bool child = FALSE )\fC [static]\fR" +.SH "TQWidget * TQApplication::widgetAt ( int x, int y, bool child = FALSE )\fC [static]\fR" Returns a pointer to the widget at global screen position \fI(x, y)\fR, or 0 if there is no TQt widget there. .PP If \fIchild\fR is FALSE and there is a child widget at position \fI(x, y)\fR, the top-level widget containing it is returned. If \fIchild\fR is TRUE the child widget at position \fI(x, y)\fR is returned. @@ -1588,35 +1588,35 @@ If \fIchild\fR is FALSE and there is a child widget at position \fI(x, y)\fR, th This function is normally rather slow. .PP See also TQCursor::pos(), TQWidget::grabMouse(), and TQWidget::grabKeyboard(). -.SH "TQWidget * QApplication::widgetAt ( const TQPoint & pos, bool child = FALSE )\fC [static]\fR" +.SH "TQWidget * TQApplication::widgetAt ( const TQPoint & pos, bool child = FALSE )\fC [static]\fR" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns a pointer to the widget at global screen position \fIpos\fR, or 0 if there is no TQt widget there. .PP If \fIchild\fR is FALSE and there is a child widget at position \fIpos\fR, the top-level widget containing it is returned. If \fIchild\fR is TRUE the child widget at position \fIpos\fR is returned. -.SH "bool QApplication::winEventFilter ( MSG * )\fC [virtual]\fR" +.SH "bool TQApplication::winEventFilter ( MSG * )\fC [virtual]\fR" This virtual function is only implemented under Windows. .PP The message procedure calls this function for every message received. Reimplement this function if you want to process window messages that are not processed by Qt. If you don't want the event to be processed by Qt, then return TRUE; otherwise return FALSE. -.SH "void QApplication::winFocus ( TQWidget * widget, bool gotFocus )" +.SH "void TQApplication::winFocus ( TQWidget * widget, bool gotFocus )" This function is available only on Windows. .PP If \fIgotFocus\fR is TRUE, \fIwidget\fR will become the active window. Otherwise the active window is reset to NULL. -.SH "const TQColor & QApplication::winStyleHighlightColor ()\fC [static]\fR" +.SH "const TQColor & TQApplication::winStyleHighlightColor ()\fC [static]\fR" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Returns the color used to mark selections in windows style. .PP See also setWinStyleHighlightColor(). -.SH "bool QApplication::x11EventFilter ( XEvent * )\fC [virtual]\fR" +.SH "bool TQApplication::x11EventFilter ( XEvent * )\fC [virtual]\fR" This virtual function is only implemented under X11. .PP -If you create an application that inherits QApplication and reimplement this function, you get direct access to all X events that the are received from the X server. +If you create an application that inherits TQApplication and reimplement this function, you get direct access to all X events that the are received from the X server. .PP Return TRUE if you want to stop the event from being processed. Return FALSE for normal event dispatching. .PP See also x11ProcessEvent(). -.SH "int QApplication::x11ProcessEvent ( XEvent * event )" +.SH "int TQApplication::x11ProcessEvent ( XEvent * event )" This function does the core processing of individual X \fIevent\fRs, normally by dispatching TQt events to the right destination. .PP It returns 1 if the event was consumed by special handling, 0 if the \fIevent\fR was consumed by normal handling, and -1 if the \fIevent\fR was for an unrecognized widget. @@ -1688,7 +1688,7 @@ Example: .PP See also tqWarning() and Debugging. .SH "void tqAddPostRoutine ( QtCleanUpFunction p )" -Adds a global routine that will be called from the QApplication destructor. This function is normally used to add cleanup routines for program-wide functionality. +Adds a global routine that will be called from the TQApplication destructor. This function is normally used to add cleanup routines for program-wide functionality. .PP The function given by \fIp\fR should take no arguments and return nothing, like this: .PP @@ -1720,7 +1720,7 @@ The function given by \fIp\fR should take no arguments and return nothing, like .br .fi .PP -Note that for an application- or module-wide cleanup, tqAddPostRoutine() is often not suitable. People have a tendency to make such modules dynamically loaded, and then unload those modules long before the QApplication destructor is called, for example. +Note that for an application- or module-wide cleanup, tqAddPostRoutine() is often not suitable. People have a tendency to make such modules dynamically loaded, and then unload those modules long before the TQApplication destructor is called, for example. .PP For modules and libraries, using a reference-counted initialization manager or Qt' parent-child delete mechanism may be better. Here is an example of a private class which uses the parent-child mechanism to call a cleanup function at the right time: .PP @@ -1828,7 +1828,7 @@ Example: .PP .nf .br - #include + #include .br #include .br @@ -1870,7 +1870,7 @@ Example: .br qInstallMsgHandler( myMessageOutput ); .br - QApplication a( argc, argv ); + TQApplication a( argc, argv ); .br ... .br @@ -1925,7 +1925,7 @@ Under X11, the text is printed to stderr. Under Windows, the text is sent to the See also tqDebug(), tqFatal(), qInstallMsgHandler(), and Debugging. .SH "SEE ALSO" -.BR http://doc.trolltech.com/ntqapplication.html +.BR http://doc.trolltech.com/tqapplication.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqchildevent.3qt b/doc/man/man3/tqchildevent.3qt index 652804899..6f2c6d923 100644 --- a/doc/man/man3/tqchildevent.3qt +++ b/doc/man/man3/tqchildevent.3qt @@ -33,7 +33,7 @@ The TQChildEvent class contains event parameters for child object events. .PP Child events are sent to objects when children are inserted or removed. .PP -A ChildRemoved event is sent immediately, but a ChildInserted event is \fIposted\fR (with QApplication::postEvent()). +A ChildRemoved event is sent immediately, but a ChildInserted event is \fIposted\fR (with TQApplication::postEvent()). .PP Note that if a child is removed immediately after it is inserted, the ChildInserted event may be suppressed, but the ChildRemoved event will always be sent. In this case there will be a ChildRemoved event without a corresponding ChildInserted event. .PP diff --git a/doc/man/man3/tqclipboard.3qt b/doc/man/man3/tqclipboard.3qt index 761819cbd..844594131 100644 --- a/doc/man/man3/tqclipboard.3qt +++ b/doc/man/man3/tqclipboard.3qt @@ -110,13 +110,13 @@ The clipboard offers a simple mechanism to copy and paste data between applicati .PP TQClipboard supports the same data types that TQDragObject does, and uses similar mechanisms. For advanced clipboard usage read the drag-and-drop documentation. .PP -There is a single TQClipboard object in an application, and you can access it using QApplication::clipboard(). +There is a single TQClipboard object in an application, and you can access it using TQApplication::clipboard(). .PP Example: .PP .nf .br - TQClipboard *cb = QApplication::clipboard(); + TQClipboard *cb = TQApplication::clipboard(); .br .br // Copy text from the clipboard (paste) diff --git a/doc/man/man3/tqcloseevent.3qt b/doc/man/man3/tqcloseevent.3qt index e8d80d362..47f01da1e 100644 --- a/doc/man/man3/tqcloseevent.3qt +++ b/doc/man/man3/tqcloseevent.3qt @@ -35,7 +35,7 @@ Close events are sent to widgets that the user wants to close, usually by choosi .PP Close events contain a flag that indicates whether the receiver wants the widget to be closed or not. When a widget accepts the close event, it is hidden (and destroyed if it was created with the WDestructiveClose flag). If it refuses to accept the close event nothing happens. (Under X11 it is possible that the window manager will forcibly close the window; but at the time of writing we are not aware of any window manager that does this.) .PP -The application's main widget -- QApplication::mainWidget() -- is a special case. When it accepts the close event, TQt leaves the main event loop and the application is immediately terminated (i.e. it returns from the call to QApplication::exec() in the main() function). +The application's main widget -- TQApplication::mainWidget() -- is a special case. When it accepts the close event, TQt leaves the main event loop and the application is immediately terminated (i.e. it returns from the call to TQApplication::exec() in the main() function). .PP The event handler TQWidget::closeEvent() receives close events. The default implementation of this event handler accepts the close event. If you do not want your widget to be hidden, or want some special handing, you should reimplement the event handler. .PP @@ -45,11 +45,11 @@ If you want the widget to be deleted when it is closed, create it with the WDest .PP TQObjects emits the destroyed() signal when they are deleted. .PP -If the last top-level window is closed, the QApplication::lastWindowClosed() signal is emitted. +If the last top-level window is closed, the TQApplication::lastWindowClosed() signal is emitted. .PP The isAccepted() function returns TRUE if the event's receiver has agreed to close the widget; call accept() to agree to close the widget and call ignore() if the receiver of this event does not want the widget to be closed. .PP -See also TQWidget::close(), TQWidget::hide(), TQObject::destroyed(), QApplication::setMainWidget(), QApplication::lastWindowClosed(), QApplication::exec(), QApplication::quit(), and Event Classes. +See also TQWidget::close(), TQWidget::hide(), TQObject::destroyed(), TQApplication::setMainWidget(), TQApplication::lastWindowClosed(), TQApplication::exec(), TQApplication::quit(), and Event Classes. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQCloseEvent::TQCloseEvent ()" Constructs a close event object with the accept parameter flag set to FALSE. diff --git a/doc/man/man3/tqcolor.3qt b/doc/man/man3/tqcolor.3qt index 62dd6f426..3d5c89b91 100644 --- a/doc/man/man3/tqcolor.3qt +++ b/doc/man/man3/tqcolor.3qt @@ -227,7 +227,7 @@ Here are some examples: Pure red is H=0, S=255, V=255. A dark red, moving slight .PP Qt returns a hue value of -1 for achromatic colors. If you pass a too-big hue value, TQt forces it into range. Hue 360 or 720 is treated as 0; hue 540 is treated as 180. .PP -See also TQPalette, TQColorGroup, QApplication::setColorSpec(), Color FAQ, Widget Appearance and Style, Graphics Classes, and Image Processing Classes. +See also TQPalette, TQColorGroup, TQApplication::setColorSpec(), Color FAQ, Widget Appearance and Style, Graphics Classes, and Image Processing Classes. .SS "Member Type Documentation" .SH "TQColor::Spec" The type of color specified, either RGB or HSV, e.g. in the \fCTQColor::TQColor( x, y, z, colorSpec)\fR constructor. @@ -285,7 +285,7 @@ See also enterAllocContext(). .SH "int TQColor::blue () const" Returns the B (blue) component of the RGB value. .SH "void TQColor::cleanup ()\fC [static]\fR" -Internal clean up required for TQColor. This function is called from the QApplication destructor. +Internal clean up required for TQColor. This function is called from the TQApplication destructor. .PP See also initialize(). .SH "TQStringList TQColor::colorNames ()\fC [static]\fR" @@ -382,9 +382,9 @@ Calling enterAllocContext() enters an allocation context. The allocation context .br .fi .PP -You may also want to set the application's color specification. See QApplication::setColorSpec() for more information. +You may also want to set the application's color specification. See TQApplication::setColorSpec() for more information. .PP -See also leaveAllocContext(), currentAllocContext(), destroyAllocContext(), and QApplication::setColorSpec(). +See also leaveAllocContext(), currentAllocContext(), destroyAllocContext(), and TQApplication::setColorSpec(). .PP Example: showimg/showimg.cpp. .SH "void TQColor::getHsv ( int * h, int * s, int * v ) const" @@ -408,7 +408,7 @@ Returns the G (green) component of the RGB value. .PP Example: themes/metal.cpp. .SH "void TQColor::initialize ()\fC [static]\fR" -Internal initialization required for TQColor. This function is called from the QApplication constructor. +Internal initialization required for TQColor. This function is called from the TQApplication constructor. .PP See also cleanup(). .SH "bool TQColor::isValid () const" diff --git a/doc/man/man3/tqcursor.3qt b/doc/man/man3/tqcursor.3qt index b308c7cbb..e107fe863 100644 --- a/doc/man/man3/tqcursor.3qt +++ b/doc/man/man3/tqcursor.3qt @@ -95,7 +95,7 @@ This class is mainly used to create mouse cursors that are associated with parti .PP Qt has a number of standard cursor shapes, but you can also make custom cursor shapes based on a TQBitmap, a mask and a hotspot. .PP -To associate a cursor with a widget, use TQWidget::setCursor(). To associate a cursor with all widgets (normally for a short period of time), use QApplication::setOverrideCursor(). +To associate a cursor with a widget, use TQWidget::setCursor(). To associate a cursor with all widgets (normally for a short period of time), use TQApplication::setOverrideCursor(). .PP To set a cursor shape use TQCursor::setShape() or use the TQCursor constructor which takes the shape as argument, or you can use one of the predefined cursors defined in the CursorShape enum. .PP @@ -173,7 +173,7 @@ Destroys the cursor. .SH "const TQBitmap * TQCursor::bitmap () const" Returns the cursor bitmap, or 0 if it is one of the standard cursors. .SH "void TQCursor::cleanup ()\fC [static]\fR" -Internal function that deinitializes the predefined cursors. This function is called from the QApplication destructor. +Internal function that deinitializes the predefined cursors. This function is called from the TQApplication destructor. .PP See also initialize(). .SH "HANDLE TQCursor::handle () const" @@ -183,7 +183,7 @@ Returns the window system cursor handle. .SH "TQPoint TQCursor::hotSpot () const" Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors. .SH "void TQCursor::initialize ()\fC [static]\fR" -Internal function that initializes the predefined cursors. This function is called from the QApplication constructor. +Internal function that initializes the predefined cursors. This function is called from the TQApplication constructor. .PP See also cleanup(). .SH "const TQBitmap * TQCursor::mask () const" diff --git a/doc/man/man3/tqcustomevent.3qt b/doc/man/man3/tqcustomevent.3qt index a3e3dddaf..77da419d8 100644 --- a/doc/man/man3/tqcustomevent.3qt +++ b/doc/man/man3/tqcustomevent.3qt @@ -31,7 +31,7 @@ Inherits TQEvent. .SH DESCRIPTION The TQCustomEvent class provides support for custom events. .PP -TQCustomEvent is a generic event class for user-defined events. User defined events can be sent to widgets or other TQObject instances using QApplication::postEvent() or QApplication::sendEvent(). Subclasses of TQObject can easily receive custom events by implementing the TQObject::customEvent() event handler function. +TQCustomEvent is a generic event class for user-defined events. User defined events can be sent to widgets or other TQObject instances using TQApplication::postEvent() or TQApplication::sendEvent(). Subclasses of TQObject can easily receive custom events by implementing the TQObject::customEvent() event handler function. .PP TQCustomEvent objects should be created with a type ID that uniquely identifies the event type. To avoid clashes with the Qt-defined events types, the value should be at least as large as the value of the "User" entry in the TQEvent::Type enum. .PP @@ -67,7 +67,7 @@ Example: .br ColorChangeEvent* ce = new ColorChangeEvent( blue ); .br - QApplication::postEvent( receiver, ce ); // TQt will delete it when done + TQApplication::postEvent( receiver, ce ); // TQt will delete it when done .br .br // To receive an event of this custom event type: @@ -89,7 +89,7 @@ Example: .br .fi .PP -See also TQWidget::customEvent(), QApplication::notify(), and Event Classes. +See also TQWidget::customEvent(), TQApplication::notify(), and Event Classes. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQCustomEvent::TQCustomEvent ( int type )" Constructs a custom event object with event type \fItype\fR. The value of \fItype\fR must be at least as large as TQEvent::User. The data pointer is set to 0. diff --git a/doc/man/man3/tqdesktopwidget.3qt b/doc/man/man3/tqdesktopwidget.3qt index 348ef05ed..6e8003a6f 100644 --- a/doc/man/man3/tqdesktopwidget.3qt +++ b/doc/man/man3/tqdesktopwidget.3qt @@ -90,7 +90,7 @@ Creates the desktop widget. .PP If the system supports a virtual desktop, this widget will have the size of the virtual desktop; otherwise this widget will have the size of the primary screen. .PP -Instead of using TQDesktopWidget directly, use QApplication::desktop(). +Instead of using TQDesktopWidget directly, use TQApplication::desktop(). .SH "TQDesktopWidget::~TQDesktopWidget ()" Destroy the object and free allocated resources. .SH "const TQRect & TQDesktopWidget::availableGeometry ( int screen = -1 ) const" @@ -128,7 +128,7 @@ Returns a widget that represents the screen with index \fIscreen\fR. This widget .PP .nf .br - TQPainter paint( QApplication::desktop()->screen( 0 ), TRUE ); + TQPainter paint( TQApplication::desktop()->screen( 0 ), TRUE ); .br paint.draw... .br diff --git a/doc/man/man3/tqdialog.3qt b/doc/man/man3/tqdialog.3qt index 80cc1b7f1..c6fa8d468 100644 --- a/doc/man/man3/tqdialog.3qt +++ b/doc/man/man3/tqdialog.3qt @@ -104,7 +104,7 @@ A \fBmodal\fR dialog is a dialog that blocks input to other visible windows in t .PP The most common way to display a modal dialog is to call its exec() function. When the user closes the dialog, exec() will provide a useful return value. Typically we connect a default button, e.g. "OK", to the accept() slot and a" Cancel" button to the reject() slot, to get the dialog to close and return the appropriate value. Alternatively you can connect to the done() slot, passing it Accepted or Rejected. .PP -An alternative is to call setModal(TRUE), then show(). Unlike exec(), show() returns control to the caller immediately. Calling setModal(TRUE) is especially useful for progress dialogs, where the user must have the ability to interact with the dialog, e.g. to cancel a long running operation. If you use show() and setModal(TRUE) together you must call QApplication::processEvents() periodically during processing to enable the user to interact with the dialog. (See TQProgressDialog.) +An alternative is to call setModal(TRUE), then show(). Unlike exec(), show() returns control to the caller immediately. Calling setModal(TRUE) is especially useful for progress dialogs, where the user must have the ability to interact with the dialog, e.g. to cancel a long running operation. If you use show() and setModal(TRUE) together you must call TQApplication::processEvents() periodically during processing to enable the user to interact with the dialog. (See TQProgressDialog.) .SH "Modeless Dialogs" A \fBmodeless\fR dialog is a dialog that operates independently of other windows in the same application. Find and replace dialogs in word-processors are often modeless to allow the user to interact with both the application's main window and with the dialog. .PP @@ -153,7 +153,7 @@ A modeless dialog. After the show() call, control returns to the main event loop .br { .br - QApplication a( argc, argv ); + TQApplication a( argc, argv ); .fi .PP .nf @@ -211,9 +211,9 @@ Examples: .SH "void TQDialog::done ( int r )\fC [virtual protected slot]\fR" Closes the dialog and sets its result code to \fIr\fR. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return \fIr\fR. .PP -As with TQWidget::close(), done() deletes the dialog if the WDestructiveClose flag is set. If the dialog is the application's main widget, the application terminates. If the dialog is the last window closed, the QApplication::lastWindowClosed() signal is emitted. +As with TQWidget::close(), done() deletes the dialog if the WDestructiveClose flag is set. If the dialog is the application's main widget, the application terminates. If the dialog is the last window closed, the TQApplication::lastWindowClosed() signal is emitted. .PP -See also accept(), reject(), QApplication::mainWidget(), and QApplication::quit(). +See also accept(), reject(), TQApplication::mainWidget(), and TQApplication::quit(). .SH "int TQDialog::exec ()\fC [slot]\fR" Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result. .PP diff --git a/doc/man/man3/tqdir.3qt b/doc/man/man3/tqdir.3qt index 8aaeb93f8..1cf380043 100644 --- a/doc/man/man3/tqdir.3qt +++ b/doc/man/man3/tqdir.3qt @@ -210,7 +210,7 @@ The "current" path refers to the application's working directory. A TQDir's own .PP An example of an absolute path is the string "/tmp/quartz", a relative path might look like "src/fatlib". You can use the function isRelative() to check if a TQDir is using a relative or an absolute file path. Call convertToAbs() to convert a relative TQDir to an absolute one. For a simplified path use cleanDirPath(). To obtain a path which has no symbolic links or redundant ".." elements use canonicalPath(). The path can be set with setPath(), and changed with cd() and cdUp(). .PP -TQDir provides several static functions, for example, setCurrent() to set the application's working directory and currentDirPath() to retrieve the application's working directory. Access to some common paths is provided with the static functions, current(), home() and root() which return TQDir objects or currentDirPath(), homeDirPath() and rootDirPath() which return the path as a string. If you want to know about your application's path use QApplication::applicationDirPath(). +TQDir provides several static functions, for example, setCurrent() to set the application's working directory and currentDirPath() to retrieve the application's working directory. Access to some common paths is provided with the static functions, current(), home() and root() which return TQDir objects or currentDirPath(), homeDirPath() and rootDirPath() which return the path as a string. If you want to know about your application's path use TQApplication::applicationDirPath(). .PP The number of entries in a directory is returned by count(). Obtain a string list of the names of all the files and directories in a directory with entryList(). If you prefer a list of TQFileInfo pointers use entryInfoList(). Both these functions can apply a name filter, an attributes filter (e.g. read-only, files not directories, etc.), and a sort order. The filters and sort may be set with calls to setNameFilter(), setFilter() and setSorting(). They may also be specified in the entryList() and entryInfoList()'s arguments. .PP @@ -302,7 +302,7 @@ A program that lists all the files in the current directory (excluding symbolic .br .fi .PP -See also QApplication::applicationDirPath() and Input/Output and Networking. +See also TQApplication::applicationDirPath() and Input/Output and Networking. .SS "Member Type Documentation" .SH "TQDir::FilterSpec" This enum describes the filtering options available to TQDir, e.g. for entryList() and entryInfoList(). The filter value is specified by OR-ing together values from the following list: diff --git a/doc/man/man3/tqevent.3qt b/doc/man/man3/tqevent.3qt index f00357f2e..ba1272dab 100644 --- a/doc/man/man3/tqevent.3qt +++ b/doc/man/man3/tqevent.3qt @@ -36,15 +36,15 @@ Inherited by TQTimerEvent, TQMouseEvent, QWheelEvent, TQTabletEvent, TQKeyEvent, .SH DESCRIPTION The TQEvent class is the base class of all event classes. Event objects contain event parameters. .PP -Qt's main event loop (QApplication::exec()) fetches native window system events from the event queue, translates them into TQEvents and sends the translated events to TQObjects. +Qt's main event loop (TQApplication::exec()) fetches native window system events from the event queue, translates them into TQEvents and sends the translated events to TQObjects. .PP -In general, events come from the underlying window system (spontaneous() returns TRUE) but it is also possible to manually send events using QApplication::sendEvent() and QApplication::postEvent() (spontaneous() returns FALSE). +In general, events come from the underlying window system (spontaneous() returns TRUE) but it is also possible to manually send events using TQApplication::sendEvent() and TQApplication::postEvent() (spontaneous() returns FALSE). .PP TQObjects receive events by having their TQObject::event() function called. The function can be reimplemented in subclasses to customize event handling and add additional event types; TQWidget::event() is a notable example. By default, events are dispatched to event handlers like TQObject::timerEvent() and TQWidget::mouseMoveEvent(). TQObject::installEventFilter() allows an object to intercept events destined for another object. .PP The basic TQEvent contains only an event type parameter. Subclasses of TQEvent contain additional parameters that describe the particular event. .PP -See also TQObject::event(), TQObject::installEventFilter(), TQWidget::event(), QApplication::sendEvent(), QApplication::postEvent(), QApplication::processEvents(), Environment Classes, and Event Classes. +See also TQObject::event(), TQObject::installEventFilter(), TQWidget::event(), TQApplication::sendEvent(), TQApplication::postEvent(), TQApplication::processEvents(), Environment Classes, and Event Classes. .SS "Member Type Documentation" .SH "TQEvent::Type" This enum type defines the valid event types in Qt. The event types and the specialized classes for each type are these: diff --git a/doc/man/man3/tqeventloop.3qt b/doc/man/man3/tqeventloop.3qt index 55c907fe4..37e9e878d 100644 --- a/doc/man/man3/tqeventloop.3qt +++ b/doc/man/man3/tqeventloop.3qt @@ -85,13 +85,13 @@ Inherits TQObject. .SH DESCRIPTION The TQEventLoop class manages the event queue. .PP -It receives events from the window system and other sources. It then sends them to QApplication for processing and delivery. +It receives events from the window system and other sources. It then sends them to TQApplication for processing and delivery. .PP TQEventLoop allows the application programmer to have more control over event delivery. Programs that perform long operations can call either processOneEvent() or processEvents() with various ProcessEvent values OR'ed together to control which events should be delivered. .PP TQEventLoop also allows the integration of an external event loop with the TQt event loop. .PP -To use your own instance of TQEventLoop or TQEventLoop subclass create it before you create the QApplication object. +To use your own instance of TQEventLoop or TQEventLoop subclass create it before you create the TQApplication object. .PP See also Main Window and Related Classes and Event Classes. .SS "Member Type Documentation" @@ -113,7 +113,7 @@ A \fCtypedef\fR to allow various ProcessEvents values to be OR'ed together. See also ProcessEvents. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQEventLoop::TQEventLoop ( TQObject * parent = 0, const char * name = 0 )" -Creates a TQEventLoop object, this object becomes the global event loop object. There can only be one event loop object. The TQEventLoop is usually constructed by calling QApplication::eventLoop(). To create your own event loop object create it before you instantiate the QApplication object. +Creates a TQEventLoop object, this object becomes the global event loop object. There can only be one event loop object. The TQEventLoop is usually constructed by calling TQApplication::eventLoop(). To create your own event loop object create it before you instantiate the TQApplication object. .PP The \fIparent\fR and \fIname\fR arguments are passed on to the TQObject constructor. .SH "TQEventLoop::~TQEventLoop ()" @@ -145,7 +145,7 @@ Generally speaking, no user interaction can take place before calling exec(). As .PP To make your application perform idle processing, i.e. executing a special function whenever there are no pending events, use a TQTimer with 0 timeout. More advanced idle processing schemes can be achieved using processEvents(). .PP -See also QApplication::quit(), exit(), and processEvents(). +See also TQApplication::quit(), exit(), and processEvents(). .SH "void TQEventLoop::exit ( int retcode = 0 )\fC [virtual]\fR" Tells the event loop to exit with a return code. .PP @@ -155,7 +155,7 @@ By convention, a \fIretcode\fR of 0 means success, and any non-zero value indica .PP Note that unlike the C library function of the same name, this function \fIdoes\fR return to the caller -- it is event processing that stops. .PP -See also QApplication::quit() and exec(). +See also TQApplication::quit() and exec(). .SH "void TQEventLoop::exitLoop ()\fC [virtual]\fR" This function exits from a recursive call to the main event loop. Do not call it unless you really know what you are doing. .SH "bool TQEventLoop::hasPendingEvents () const\fC [virtual]\fR" diff --git a/doc/man/man3/tqfile.3qt b/doc/man/man3/tqfile.3qt index 6284c9938..c18c09573 100644 --- a/doc/man/man3/tqfile.3qt +++ b/doc/man/man3/tqfile.3qt @@ -244,7 +244,7 @@ Example: distributor/distributor.ui.h. .SH "TQString TQFile::errorString () const" Returns a human-readable description of the reason of an error that occurred on the device. The error described by the string corresponds to changes of TQIODevice::status(). If the status is reset, the error string is also reset. .PP -The returned strings are not translated with the TQObject::tr() or QApplication::translate() functions. They are marked as translatable strings in the "TQFile" context. Before you show the string to the user you should translate it first, for example: +The returned strings are not translated with the TQObject::tr() or TQApplication::translate() functions. They are marked as translatable strings in the "TQFile" context. Before you show the string to the user you should translate it first, for example: .PP .nf .br diff --git a/doc/man/man3/tqfont.3qt b/doc/man/man3/tqfont.3qt index 714153c4b..799ba253c 100644 --- a/doc/man/man3/tqfont.3qt +++ b/doc/man/man3/tqfont.3qt @@ -229,7 +229,7 @@ The TQFont class specifies a font used for drawing text. .PP When you create a TQFont object you specify various attributes that you want the font to have. TQt will use the font with the specified attributes, or if no matching font exists, TQt will use the closest matching installed font. The attributes of the font that is actually used are retrievable from a TQFontInfo object. If the window system provides an exact match exactMatch() returns TRUE. Use TQFontMetrics to get measurements, e.g. the pixel length of a string using TQFontMetrics::width(). .PP -Use QApplication::setFont() to set the application's default font. +Use TQApplication::setFont() to set the application's default font. .PP If a choosen X11 font does not include all the characters that need to be displayed, TQFont will try to find the characters in the nearest equivalent fonts. When a TQPainter draws a character from a font the TQFont will report whether or not it has the character; if it does not, TQPainter will draw an unfilled square. .PP @@ -330,7 +330,7 @@ To find out font metrics use a TQFontMetrics object, e.g. .PP For more general information on fonts, see the comp.fonts FAQ. Information on encodings can be found from Roman Czyborra's page. .PP -See also TQFontMetrics, TQFontInfo, TQFontDatabase, QApplication::setFont(), TQWidget::font, TQPainter::setFont(), TQFont::StyleHint, TQFont::Weight, Widget Appearance and Style, Graphics Classes, and Implicitly and Explicitly Shared Classes. +See also TQFontMetrics, TQFontInfo, TQFontDatabase, TQApplication::setFont(), TQWidget::font, TQPainter::setFont(), TQFont::StyleHint, TQFont::Weight, Widget Appearance and Style, Graphics Classes, and Implicitly and Explicitly Shared Classes. .SS "Member Type Documentation" .SH "TQFont::Script" This enum represents Unicode allocated scripts. For exhaustive coverage see The Unicode Standard Version 3.0. The following scripts are supported: @@ -544,7 +544,7 @@ This enum contains the predefined font weights: .SH "TQFont::TQFont ()" Constructs a font object that uses the application's default font. .PP -See also QApplication::setFont() and QApplication::font(). +See also TQApplication::setFont() and TQApplication::font(). .SH "TQFont::TQFont ( const TQString & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )" Constructs a font object with the specified \fIfamily\fR, \fIpointSize\fR, \fIweight\fR and \fIitalic\fR settings. .PP @@ -552,7 +552,7 @@ If \fIpointSize\fR is <= 0 it is set to 1. .PP The \fIfamily\fR name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". (The TQt 2.x syntax, i.e." Cronyx-Helvetica", is also supported.) If the \fIfamily\fR is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the font matching algorithm. .PP -See also Weight, setFamily(), setPointSize(), setWeight(), setItalic(), setStyleHint(), and QApplication::font(). +See also Weight, setFamily(), setPointSize(), setWeight(), setItalic(), setStyleHint(), and TQApplication::font(). .SH "TQFont::TQFont ( const TQFont & font )" Constructs a font that is a copy of \fIfont\fR. .SH "TQFont::~TQFont ()" @@ -576,7 +576,7 @@ See also StyleHint, styleHint(), and setStyleHint(). .SH "TQFont TQFont::defaultFont ()\fC [static]\fR" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP -Please use QApplication::font() instead. +Please use TQApplication::font() instead. .SH "bool TQFont::dirty () const\fC [protected]\fR" Returns TRUE if the font attributes have been changed and the font has to be (re)loaded; otherwise returns FALSE. .SH "bool TQFont::exactMatch () const" @@ -705,7 +705,7 @@ Examples: .SH "void TQFont::setDefaultFont ( const TQFont & f )\fC [static]\fR" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP -Please use QApplication::setFont() instead. +Please use TQApplication::setFont() instead. .SH "void TQFont::setFamily ( const TQString & family )" Sets the family name of the font. The name is case insensitive and may include a foundry name. .PP diff --git a/doc/man/man3/tqfontdatabase.3qt b/doc/man/man3/tqfontdatabase.3qt index c40050b45..28101cf1a 100644 --- a/doc/man/man3/tqfontdatabase.3qt +++ b/doc/man/man3/tqfontdatabase.3qt @@ -126,7 +126,7 @@ Example: .PP .nf .br -#include +#include .br #include .br @@ -137,7 +137,7 @@ int main( int argc, char **argv ) .br { .br - QApplication app( argc, argv ); + TQApplication app( argc, argv ); .br TQFontDatabase fdb; .br diff --git a/doc/man/man3/tqfontdialog.3qt b/doc/man/man3/tqfontdialog.3qt index 546e9c340..41500d1ba 100644 --- a/doc/man/man3/tqfontdialog.3qt +++ b/doc/man/man3/tqfontdialog.3qt @@ -130,7 +130,7 @@ Example: .br // the user canceled the dialog; font is set to the default .br - // application font, QApplication::font() + // application font, TQApplication::font() .br } .br diff --git a/doc/man/man3/tqglcolormap.3qt b/doc/man/man3/tqglcolormap.3qt index 2b614ad60..1a5d7624e 100644 --- a/doc/man/man3/tqglcolormap.3qt +++ b/doc/man/man3/tqglcolormap.3qt @@ -71,7 +71,7 @@ Example of use: .PP .nf .br - #include + #include .br #include .br @@ -80,7 +80,7 @@ Example of use: .br { .br - QApplication a( argc, argv ); + TQApplication a( argc, argv ); .br .br MySuperGLWidget widget( 0 ); // A TQGLWidget in color-index mode diff --git a/doc/man/man3/tqglformat.3qt b/doc/man/man3/tqglformat.3qt index 0b22d19ef..7e13cc141 100644 --- a/doc/man/man3/tqglformat.3qt +++ b/doc/man/man3/tqglformat.3qt @@ -313,11 +313,11 @@ See also setDoubleBuffer(). .SH "bool TQGLFormat::hasOpenGL ()\fC [static]\fR" Returns TRUE if the window system has any OpenGL support; otherwise returns FALSE. .PP -\fBWarning:\fR This function must not be called until the QApplication object has been created. +\fBWarning:\fR This function must not be called until the TQApplication object has been created. .SH "bool TQGLFormat::hasOpenGLOverlays ()\fC [static]\fR" Returns TRUE if the window system supports OpenGL overlays; otherwise returns FALSE. .PP -\fBWarning:\fR This function must not be called until the QApplication object has been created. +\fBWarning:\fR This function must not be called until the TQApplication object has been created. .SH "bool TQGLFormat::hasOverlay () const" Returns TRUE if overlay plane is enabled; otherwise returns FALSE. .PP @@ -353,7 +353,7 @@ Sets a new default TQGLFormat for the application to \fIf\fR. For example, to se .PP .nf .br - QApplication a(argc, argv); + TQApplication a(argc, argv); .br TQGLFormat f; .br diff --git a/doc/man/man3/tqlistboxitem.3qt b/doc/man/man3/tqlistboxitem.3qt index 686fa033d..9a3b36ffc 100644 --- a/doc/man/man3/tqlistboxitem.3qt +++ b/doc/man/man3/tqlistboxitem.3qt @@ -97,7 +97,7 @@ Destroys the list box item. .SH "int TQListBoxItem::height ( const TQListBox * lb ) const\fC [virtual]\fR" Implement this function to return the height of your item. The \fIlb\fR parameter is the same as listBox() and is provided for convenience and compatibility. .PP -The default implementation returns QApplication::globalStrut()'s height. +The default implementation returns TQApplication::globalStrut()'s height. .PP See also paint() and width(). .PP @@ -171,7 +171,7 @@ Example: listboxcombo/listboxcombo.cpp. .SH "int TQListBoxItem::width ( const TQListBox * lb ) const\fC [virtual]\fR" Reimplement this function to return the width of your item. The \fIlb\fR parameter is the same as listBox() and is provided for convenience and compatibility. .PP -The default implementation returns QApplication::globalStrut()'s width. +The default implementation returns TQApplication::globalStrut()'s width. .PP See also paint() and height(). .PP diff --git a/doc/man/man3/tqmap.3qt b/doc/man/man3/tqmap.3qt index 402ab40bb..e3c5ee9a7 100644 --- a/doc/man/man3/tqmap.3qt +++ b/doc/man/man3/tqmap.3qt @@ -240,7 +240,7 @@ Example: .br { .br - QApplication app( argc, argv ); + TQApplication app( argc, argv ); .br .br typedef TQMap EmployeeMap; diff --git a/doc/man/man3/tqmessagebox.3qt b/doc/man/man3/tqmessagebox.3qt index a3b208d81..081098afe 100644 --- a/doc/man/man3/tqmessagebox.3qt +++ b/doc/man/man3/tqmessagebox.3qt @@ -532,7 +532,7 @@ As a last resort it uses the Information icon. .PP The about box has a single button labelled "OK". .PP -See also TQWidget::icon and QApplication::mainWidget(). +See also TQWidget::icon and TQApplication::mainWidget(). .PP Examples: .)l action/application.cpp, application/application.cpp, chart/chartform.cpp, helpviewer/helpwindow.cpp, mdi/application.cpp, menu/menu.cpp, and themes/themes.cpp. @@ -541,9 +541,9 @@ Displays a simple message box about Qt, with caption \fIcaption\fR and centered .PP This is useful for inclusion in the Help menu of an application. See the examples/menu/menu.cpp example. .PP -QApplication provides this functionality as a slot. +TQApplication provides this functionality as a slot. .PP -See also QApplication::aboutTQt(). +See also TQApplication::aboutTQt(). .PP Examples: .)l action/application.cpp, application/application.cpp, chart/chartform.cpp, helpviewer/helpwindow.cpp, menu/menu.cpp and themes/themes.cpp. diff --git a/doc/man/man3/tqmotifstyle.3qt b/doc/man/man3/tqmotifstyle.3qt index a78bf7295..81036289f 100644 --- a/doc/man/man3/tqmotifstyle.3qt +++ b/doc/man/man3/tqmotifstyle.3qt @@ -41,7 +41,7 @@ If \fIuseHighlightCols\fR is FALSE (the default), the style will polish the appl .SH "void TQMotifStyle::setUseHighlightColors ( bool arg )" If \fIarg\fR is FALSE, the style will polish the application's color palette to emulate the Motif way of highlighting, which is a simple inversion between the base and the text color. .PP -The effect will show up the next time an application palette is set via QApplication::setPalette(). The current color palette of the application remains unchanged. +The effect will show up the next time an application palette is set via TQApplication::setPalette(). The current color palette of the application remains unchanged. .PP See also TQStyle::polish(). .SH "bool TQMotifStyle::useHighlightColors () const" diff --git a/doc/man/man3/tqobject.3qt b/doc/man/man3/tqobject.3qt index ecf09e225..1db0cf235 100644 --- a/doc/man/man3/tqobject.3qt +++ b/doc/man/man3/tqobject.3qt @@ -15,7 +15,7 @@ All the functions in this class are reentrant when TQt is built with thread supp .PP Inherits Qt. .PP --Inherited by TQAccel, TQAccessibleObject, TQAction, QApplication, TQAssistantClient, TQDataPump, TQWidget, TQCanvas, TQStyle, TQClipboard, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQNetworkOperation, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator. +-Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQWidget, TQCanvas, TQStyle, TQClipboard, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQNetworkOperation, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator. .PP .SS "Public Members" .in +1c @@ -259,7 +259,7 @@ This event handler can be reimplemented in a subclass to receive child events. .PP Child events are sent to objects when children are inserted or removed. .PP -Note that events with TQEvent::type() TQEvent::ChildInserted are posted (with QApplication::postEvent()) to make sure that the child's construction is completed before this function is called. +Note that events with TQEvent::type() TQEvent::ChildInserted are posted (with TQApplication::postEvent()) to make sure that the child's construction is completed before this function is called. .PP If a child is removed immediately after it is inserted, the \fCChildInserted\fR event may be suppressed, but the \fCChildRemoved\fR event will always be sent. In such cases it is possible that there will be a \fCChildRemoved\fR event without a corresponding \fCChildInserted\fR event. .PP @@ -267,7 +267,7 @@ If you change state based on \fCChildInserted\fR events, call TQWidget::constPol .PP .nf .br - QApplication::sendPostedEvents( this, TQEvent::ChildInserted ); + TQApplication::sendPostedEvents( this, TQEvent::ChildInserted ); .br .fi in functions that depend on the state. One notable example is TQWidget::sizeHint(). @@ -497,7 +497,7 @@ This virtual function receives events to an object and should return TRUE if the .PP The event() function can be reimplemented to customize the behavior of an object. .PP -See also installEventFilter(), timerEvent(), QApplication::sendEvent(), QApplication::postEvent(), and TQWidget::event(). +See also installEventFilter(), timerEvent(), TQApplication::sendEvent(), TQApplication::postEvent(), and TQWidget::event(). .PP Reimplemented in TQWidget. .SH "bool TQObject::eventFilter ( TQObject * watched, TQEvent * e )\fC [virtual]\fR" @@ -928,7 +928,7 @@ Returns a translated version of \fIsourceText\fR, or \fIsourceText\fR itself if .PP \fBWarning:\fR This method is reentrant only if all translators are installed \fIbefore\fR calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior. .PP -See also trUtf8(), QApplication::translate(), and Internationalization with Qt. +See also trUtf8(), TQApplication::translate(), and Internationalization with Qt. .PP Example: network/networkprotocol/view.cpp. .SH "TQString TQObject::trUtf8 ( const char * sourceText, const char * comment )\fC [static]\fR" @@ -936,7 +936,7 @@ Returns a translated version of \fIsourceText\fR, or TQString::fromUtf8(\fIsourc .PP \fBWarning:\fR This method is reentrant only if all translators are installed \fIbefore\fR calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior. .PP -See also tr() and QApplication::translate(). +See also tr() and TQApplication::translate(). .SS "Property Documentation" .SH "TQCString name" This property holds the name of this object. diff --git a/doc/man/man3/tqpaintdevice.3qt b/doc/man/man3/tqpaintdevice.3qt index 83db6825c..c7ea10702 100644 --- a/doc/man/man3/tqpaintdevice.3qt +++ b/doc/man/man3/tqpaintdevice.3qt @@ -189,7 +189,7 @@ Example (scroll widget contents 10 pixels to the right): .br .fi .PP -\fBWarning:\fR TQt requires that a QApplication object exists before any paint devices can be created. Paint devices access window system resources, and these resources are not initialized before an application object is created. +\fBWarning:\fR TQt requires that a TQApplication object exists before any paint devices can be created. Paint devices access window system resources, and these resources are not initialized before an application object is created. .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION diff --git a/doc/man/man3/tqpainter.3qt b/doc/man/man3/tqpainter.3qt index b7e586ee5..b223bea72 100644 --- a/doc/man/man3/tqpainter.3qt +++ b/doc/man/man3/tqpainter.3qt @@ -1027,23 +1027,23 @@ Draws a tiled pixmap, \fIpm\fR, inside rectangle \fIr\fR. .SH "void TQPainter::drawWinFocusRect ( int x, int y, int w, int h, const TQColor & bgColor )" Draws a Windows focus rectangle with upper left corner at (\fIx\fR, \fIy\fR) and with width \fIw\fR and height \fIh\fR using a pen color that contrasts with \fIbgColor\fR. .PP -This function draws a stippled rectangle (XOR is not used) that is used to indicate keyboard focus (when the QApplication::style() is \fCWindowStyle\fR). +This function draws a stippled rectangle (XOR is not used) that is used to indicate keyboard focus (when the TQApplication::style() is \fCWindowStyle\fR). .PP The pen color used to draw the rectangle is either white or black depending on the color of \fIbgColor\fR (see TQColor::gray()). .PP \fBWarning:\fR This function draws nothing if the coordinate system has been rotated or sheared. .PP -See also drawRect() and QApplication::style(). +See also drawRect() and TQApplication::style(). .SH "void TQPainter::drawWinFocusRect ( int x, int y, int w, int h )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Draws a Windows focus rectangle with upper left corner at (\fIx\fR, \fIy\fR) and with width \fIw\fR and height \fIh\fR. .PP -This function draws a stippled XOR rectangle that is used to indicate keyboard focus (when QApplication::style() is \fCWindowStyle\fR). +This function draws a stippled XOR rectangle that is used to indicate keyboard focus (when TQApplication::style() is \fCWindowStyle\fR). .PP \fBWarning:\fR This function draws nothing if the coordinate system has been rotated or sheared. .PP -See also drawRect() and QApplication::style(). +See also drawRect() and TQApplication::style(). .SH "void TQPainter::drawWinFocusRect ( const TQRect & r )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP @@ -1585,7 +1585,7 @@ The rectangle's interior is filled with the \fIfill\fR brush unless \fIfill\fR i .PP If you want to use a TQFrame widget instead, you can make it display a plain rectangle, for example \fCTQFrame::setFrameStyle( TQFrame::Box | TQFrame::Plain )\fR. .PP -\fBWarning:\fR This function does not look at TQWidget::style() or QApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. +\fBWarning:\fR This function does not look at TQWidget::style() or TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. .PP See also qDrawShadeRect() and TQStyle::drawPrimitive(). .SH "void qDrawShadeLine ( TQPainter * p, int x1, int y1, int x2, int y2, const TQColorGroup & g, bool sunken, int lineWidth, int midLineWidth )" @@ -1605,7 +1605,7 @@ The \fImidLineWidth\fR argument specifies the width of a middle line drawn in th .PP If you want to use a TQFrame widget instead, you can make it display a shaded line, for example \fCTQFrame::setFrameStyle( TQFrame::HLine | TQFrame::Sunken )\fR. .PP -\fBWarning:\fR This function does not look at TQWidget::style() or QApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. +\fBWarning:\fR This function does not look at TQWidget::style() or TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. .PP See also qDrawShadeRect(), qDrawShadePanel(), and TQStyle::drawPrimitive(). .SH "void qDrawShadePanel ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool sunken, int lineWidth, const TQBrush * fill )" @@ -1623,7 +1623,7 @@ The panel's interior is filled with the \fIfill\fR brush unless \fIfill\fR is 0. .PP If you want to use a TQFrame widget instead, you can make it display a shaded panel, for example \fCTQFrame::setFrameStyle( TQFrame::Panel | TQFrame::Sunken )\fR. .PP -\fBWarning:\fR This function does not look at TQWidget::style() or QApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. +\fBWarning:\fR This function does not look at TQWidget::style() or TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. .PP See also qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), and TQStyle::drawPrimitive(). .SH "void qDrawShadeRect ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool sunken, int lineWidth, int midLineWidth, const TQBrush * fill )" @@ -1643,7 +1643,7 @@ The rectangle's interior is filled with the \fIfill\fR brush unless \fIfill\fR i .PP If you want to use a TQFrame widget instead, you can make it display a shaded rectangle, for example \fCTQFrame::setFrameStyle( TQFrame::Box | TQFrame::Raised )\fR. .PP -\fBWarning:\fR This function does not look at TQWidget::style() or QApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. +\fBWarning:\fR This function does not look at TQWidget::style() or TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. .PP See also qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), TQStyle::drawItem(), TQStyle::drawControl(), and TQStyle::drawComplexControl(). .SH "void qDrawWinButton ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool sunken, const TQBrush * fill )" @@ -1659,7 +1659,7 @@ The line width is 2 pixels. .PP The button's interior is filled with the \fI*fill\fR brush unless \fIfill\fR is 0. .PP -\fBWarning:\fR This function does not look at TQWidget::style() or QApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. +\fBWarning:\fR This function does not look at TQWidget::style() or TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. .PP See also qDrawWinPanel() and TQStyle::drawControl(). .SH "void qDrawWinPanel ( TQPainter * p, int x, int y, int w, int h, const TQColorGroup & g, bool sunken, const TQBrush * fill )" @@ -1677,7 +1677,7 @@ The button's interior is filled with the \fIfill\fR brush unless \fIfill\fR is 0 .PP If you want to use a TQFrame widget instead, you can make it display a shaded panel, for example \fCTQFrame::setFrameStyle( TQFrame::WinPanel | TQFrame::Raised )\fR. .PP -\fBWarning:\fR This function does not look at TQWidget::style() or QApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. +\fBWarning:\fR This function does not look at TQWidget::style() or TQApplication::style(). Use the drawing functions in TQStyle to make widgets that follow the current GUI style. .PP See also qDrawShadePanel(), qDrawWinButton(), and TQStyle::drawPrimitive(). diff --git a/doc/man/man3/tqpalette.3qt b/doc/man/man3/tqpalette.3qt index e6b30193f..b758c709a 100644 --- a/doc/man/man3/tqpalette.3qt +++ b/doc/man/man3/tqpalette.3qt @@ -123,7 +123,7 @@ Colors and brushes can be set for particular roles in any of a palette's color g .PP You can copy a palette using the copy constructor and test to see if two palettes are \fIidentical\fR using isCopyOf(). .PP -See also QApplication::setPalette(), TQWidget::palette, TQColorGroup, TQColor, Widget Appearance and Style, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes. +See also TQApplication::setPalette(), TQWidget::palette, TQColorGroup, TQColor, Widget Appearance and Style, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes. .SS "Member Type Documentation" .SH "TQPalette::ColorGroup" .TP diff --git a/doc/man/man3/tqprogressdialog.3qt b/doc/man/man3/tqprogressdialog.3qt index 5b5aace77..aa1125a0b 100644 --- a/doc/man/man3/tqprogressdialog.3qt +++ b/doc/man/man3/tqprogressdialog.3qt @@ -149,7 +149,7 @@ The dialog automatically resets and hides itself at the end of the operation. Us .PP There are two ways of using TQProgressDialog: modal and modeless. .PP -Using a modal TQProgressDialog is simpler for the programmer, but you must call QApplication::processEvents() or TQEventLoop::processEvents(ExcludeUserInput) to keep the event loop running to ensure that the application doesn't freeze. Do the operation in a loop, call setProgress() at intervals, and check for cancellation with wasCanceled(). For example: +Using a modal TQProgressDialog is simpler for the programmer, but you must call TQApplication::processEvents() or TQEventLoop::processEvents(ExcludeUserInput) to keep the event loop running to ensure that the application doesn't freeze. Do the operation in a loop, call setProgress() at intervals, and check for cancellation with wasCanceled(). For example: .PP .nf .br @@ -378,7 +378,7 @@ This property holds the current amount of progress made. .PP For the progress dialog to work as expected, you should initially set this property to 0 and finally set it to TQProgressDialog::totalSteps(); you can call setProgress() any number of times in-between. .PP -\fBWarning:\fR If the progress dialog is modal (see TQProgressDialog::TQProgressDialog()), this function calls QApplication::processEvents(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a TQProgressDialog inside a paintEvent()! +\fBWarning:\fR If the progress dialog is modal (see TQProgressDialog::TQProgressDialog()), this function calls TQApplication::processEvents(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a TQProgressDialog inside a paintEvent()! .PP See also totalSteps. .PP diff --git a/doc/man/man3/tqsessionmanager.3qt b/doc/man/man3/tqsessionmanager.3qt index 57edd4fdf..070972691 100644 --- a/doc/man/man3/tqsessionmanager.3qt +++ b/doc/man/man3/tqsessionmanager.3qt @@ -75,7 +75,7 @@ The TQSessionManager class provides access to the session manager. .PP The session manager is responsible for session management, most importantly for interruption and resumption. A "session" is a kind of record of the state of the system, e.g. which applications were run at start up and which applications are currently running. The session manager is used to save the session, e.g. when the machine is shut down; and to restore a session, e.g. when the machine is started up. Use TQSettings to save and restore an individual application's settings, e.g. window positions, recently used files, etc. .PP -TQSessionManager provides an interface between the application and the session manager so that the program can work well with the session manager. In Qt, session management requests for action are handled by the two virtual functions QApplication::commitData() and QApplication::saveState(). Both provide a reference to a session manager object as argument, to allow the application to communicate with the session manager. +TQSessionManager provides an interface between the application and the session manager so that the program can work well with the session manager. In Qt, session management requests for action are handled by the two virtual functions TQApplication::commitData() and TQApplication::saveState(). Both provide a reference to a session manager object as argument, to allow the application to communicate with the session manager. .PP During a session management action (i.e. within commitData() and saveState()), no user interaction is possible \fIunless\fR the application got explicit permission from the session manager. You ask for permission by calling allowsInteraction() or, if it's really urgent, allowsErrorInteraction(). TQt does not enforce this, but the session manager may. .PP @@ -111,7 +111,7 @@ When the interaction is completed we strongly recommend releasing the user inter .PP If the user decides to cancel the shutdown process during the interaction phase, you must tell the session manager that this has happened by calling cancel(). .PP -Here's an example of how an application's QApplication::commitData() might be implemented: +Here's an example of how an application's TQApplication::commitData() might be implemented: .PP .nf .br @@ -168,7 +168,7 @@ void MyApplication::commitData( TQSessionManager& sm ) { .PP If an error occurred within the application while saving its data, you may want to try allowsErrorInteraction() instead. .PP -See also QApplication::commitData(), release(), and cancel(). +See also TQApplication::commitData(), release(), and cancel(). .SH "void TQSessionManager::cancel ()" Tells the session manager to cancel the shutdown process. Applications should not call this function without first asking the user. .PP @@ -206,7 +206,7 @@ Releases the session manager's interaction semaphore after an interaction phase. .PP See also allowsInteraction() and allowsErrorInteraction(). .SH "void TQSessionManager::requestPhase2 ()" -Requests a second session management phase for the application. The application may then return immediately from the QApplication::commitData() or QApplication::saveState() function, and they will be called again once most or all other applications have finished their session management. +Requests a second session management phase for the application. The application may then return immediately from the TQApplication::commitData() or TQApplication::saveState() function, and they will be called again once most or all other applications have finished their session management. .PP The two phases are useful for applications such as the X11 window manager that need to store information about another application's windows and therefore have to wait until these applications have completed their respective session management tasks. .PP @@ -244,7 +244,7 @@ Returns the identifier of the current session. .PP If the application has been restored from an earlier session, this identifier is the same as it was in that earlier session. .PP -See also sessionKey() and QApplication::sessionId(). +See also sessionKey() and TQApplication::sessionId(). .SH "TQString TQSessionManager::sessionKey () const" Returns the session key in the current session. .PP @@ -252,7 +252,7 @@ If the application has been restored from an earlier session, this key is the sa .PP The session key changes with every call of commitData() or saveState(). .PP -See also sessionId() and QApplication::sessionKey(). +See also sessionId() and TQApplication::sessionKey(). .SH "void TQSessionManager::setDiscardCommand ( const TQStringList & )" See also discardCommand() and setRestartCommand(). .SH "void TQSessionManager::setManagerProperty ( const TQString & name, const TQStringList & value )" @@ -274,7 +274,7 @@ If the session manager is capable of restoring sessions it will execute \fIcomma .br .fi .PP -The \fC-session\fR option is mandatory; otherwise QApplication cannot tell whether it has been restored or what the current session identifier is. See QApplication::isSessionRestored() and QApplication::sessionId() for details. +The \fC-session\fR option is mandatory; otherwise TQApplication cannot tell whether it has been restored or what the current session identifier is. See TQApplication::isSessionRestored() and TQApplication::sessionId() for details. .PP If your application is very simple, it may be possible to store the entire application state in additional command line options. This is usually a very bad idea because command lines are often limited to a few hundred bytes. Instead, use TQSettings, or temporary files or a database for this purpose. By marking the data with the unique sessionId(), you will be able to restore the application in a future session. .PP @@ -284,7 +284,7 @@ Sets the application's restart hint to \fIhint\fR. On application startup the hi .PP Note that these flags are only hints, a session manager may or may not respect them. .PP -We recommend setting the restart hint in QApplication::saveState() because most session managers perform a checkpoint shortly after an application's startup. +We recommend setting the restart hint in TQApplication::saveState() because most session managers perform a checkpoint shortly after an application's startup. .PP See also restartHint(). diff --git a/doc/man/man3/tqsjiscodec.3qt b/doc/man/man3/tqsjiscodec.3qt index 3d1973f67..db8cce557 100644 --- a/doc/man/man3/tqsjiscodec.3qt +++ b/doc/man/man3/tqsjiscodec.3qt @@ -49,7 +49,7 @@ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS". ANY EXPRESS OR See also Internationalization with Qt. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQSjisCodec::TQSjisCodec ()" -Creates a Shift-JIS codec. Note that this is done automatically by the QApplication, you do not need construct your own. +Creates a Shift-JIS codec. Note that this is done automatically by the TQApplication, you do not need construct your own. .SH "TQSjisCodec::~TQSjisCodec ()" Destroys the Shift-JIS codec. .SH "const char * TQSjisCodec::mimeName () const\fC [virtual]\fR" diff --git a/doc/man/man3/tqsocket.3qt b/doc/man/man3/tqsocket.3qt index b8dbd811f..9e440fb79 100644 --- a/doc/man/man3/tqsocket.3qt +++ b/doc/man/man3/tqsocket.3qt @@ -153,7 +153,7 @@ The TQSocket class provides a buffered TCP connection. .PP It provides a totally non-blocking TQIODevice, and modifies and extends the API of TQIODevice with socket-specific code. .PP -Note that a QApplication must have been constructed before this class can be used. +Note that a TQApplication must have been constructed before this class can be used. .PP The functions you're likely to call most are connectToHost(), bytesAvailable(), canReadLine() and the ones it inherits from TQIODevice. .PP @@ -199,7 +199,7 @@ Creates a TQSocket object in TQSocket::Idle state. .PP The \fIparent\fR and \fIname\fR arguments are passed on to the TQObject constructor. .PP -Note that a QApplication must have been constructed before sockets can be used. +Note that a TQApplication must have been constructed before sockets can be used. .SH "TQSocket::~TQSocket ()\fC [virtual]\fR" Destroys the socket. Closes the connection if necessary. .PP diff --git a/doc/man/man3/tqsplashscreen.3qt b/doc/man/man3/tqsplashscreen.3qt index 260f8e321..ade23bf8e 100644 --- a/doc/man/man3/tqsplashscreen.3qt +++ b/doc/man/man3/tqsplashscreen.3qt @@ -72,7 +72,7 @@ The most common usage is to show a splash screen before the main widget is displ .br { .br - QApplication app( argc, argv ); + TQApplication app( argc, argv ); .br TQPixmap pixmap( "splash.png" ); .br @@ -100,7 +100,7 @@ The most common usage is to show a splash screen before the main widget is displ .PP It is sometimes useful to update the splash screen with messages, for example, announcing connections established or modules loaded as the application starts up. TQSplashScreen supports this with the message() function. If you wish to do your own drawing you can get a pointer to the pixmap used in the splash screen with pixmap(). Alternatively, you can subclass TQSplashScreen and reimplement drawContents(). .PP -The user can hide the splash screen by clicking on it with the mouse. Since the splash screen is typically displayed before the event loop has started running, it is necessary to periodically call QApplication::processEvents() to receive the mouse clicks. +The user can hide the splash screen by clicking on it with the mouse. Since the splash screen is typically displayed before the event loop has started running, it is necessary to periodically call TQApplication::processEvents() to receive the mouse clicks. .PP .nf .br @@ -151,7 +151,7 @@ See also message() and clear(). .SH "TQPixmap * TQSplashScreen::pixmap () const" Returns the pixmap that is used in the splash screen. The image does not have any of the text drawn by message() calls. .SH "void TQSplashScreen::repaint ()" -This overrides TQWidget::repaint(). It differs from the standard repaint function in that it also calls QApplication::flush() to ensure the updates are displayed, even when there is no event loop present. +This overrides TQWidget::repaint(). It differs from the standard repaint function in that it also calls TQApplication::flush() to ensure the updates are displayed, even when there is no event loop present. .SH "void TQSplashScreen::setPixmap ( const TQPixmap & pixmap )" Sets the pixmap that will be used as the splash screen's image to \fIpixmap\fR. diff --git a/doc/man/man3/tqstyle.3qt b/doc/man/man3/tqstyle.3qt index 40c4fd206..6d1d18a8b 100644 --- a/doc/man/man3/tqstyle.3qt +++ b/doc/man/man3/tqstyle.3qt @@ -30,10 +30,10 @@ Inherited by TQCommonStyle. .BI "virtual void \fBunPolish\fR ( TQWidget * )" .br .ti -1c -.BI "virtual void \fBpolish\fR ( QApplication * )" +.BI "virtual void \fBpolish\fR ( TQApplication * )" .br .ti -1c -.BI "virtual void \fBunPolish\fR ( QApplication * )" +.BI "virtual void \fBunPolish\fR ( TQApplication * )" .br .ti -1c .BI "virtual void \fBpolish\fR ( TQPalette & )" @@ -953,10 +953,10 @@ Reasonable actions in this function might be to call TQWidget::setBackgroundMode The TQWidget::inherits() function may provide enough information to allow class-specific customizations. But be careful not to hard-code things too much because new TQStyle subclasses are expected to work reasonably with all current and \fIfuture\fR widgets. .PP See also unPolish(). -.SH "void TQStyle::polish ( QApplication * )\fC [virtual]\fR" +.SH "void TQStyle::polish ( TQApplication * )\fC [virtual]\fR" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP -Late initialization of the QApplication object. +Late initialization of the TQApplication object. .PP See also unPolish(). .SH "void TQStyle::polish ( TQPalette & )\fC [virtual]\fR" @@ -964,7 +964,7 @@ This is an overloaded member function, provided for convenience. It behaves esse .PP The style may have certain requirements for color palettes. In this function it has the chance to change the palette according to these requirements. .PP -See also TQPalette and QApplication::setPalette(). +See also TQPalette and TQApplication::setPalette(). .SH "void TQStyle::polishPopupMenu ( TQPopupMenu * )\fC [pure virtual]\fR" Polishes the popup menu according to the GUI style. This usually means setting the mouse tracking (TQPopupMenu::setMouseTracking()) and whether the menu is checkable by default (TQPopupMenu::setCheckable()). .SH "SubControl TQStyle::querySubControl ( ComplexControl control, const TQWidget * widget, const TQPoint & pos, const TQStyleOption & opt = TQStyleOption::Default ) const\fC [pure virtual]\fR" @@ -1046,7 +1046,7 @@ Undoes the initialization of a widget's appearance. This function is the counterpart to polish. It is called for every polished widget when the style is dynamically changed. The former style has to unpolish its settings before the new style can polish them again. .PP See also polish(). -.SH "void TQStyle::unPolish ( QApplication * )\fC [virtual]\fR" +.SH "void TQStyle::unPolish ( TQApplication * )\fC [virtual]\fR" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Undoes the application polish. @@ -1055,13 +1055,13 @@ See also polish(). .SH "TQRect TQStyle::visualRect ( const TQRect & logical, const TQWidget * w )\fC [static]\fR" Returns the rect \fIlogical\fR in screen coordinates. The bounding rect for widget \fIw\fR is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode. .PP -See also QApplication::reverseLayout(). +See also TQApplication::reverseLayout(). .SH "TQRect TQStyle::visualRect ( const TQRect & logical, const TQRect & bounding )\fC [static]\fR" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns the rect \fIlogical\fR in screen coordinates. The rect \fIbounding\fR is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode. .PP -See also QApplication::reverseLayout(). +See also TQApplication::reverseLayout(). .SH "SEE ALSO" .BR http://doc.trolltech.com/tqstyle.html diff --git a/doc/man/man3/tqtextcodec.3qt b/doc/man/man3/tqtextcodec.3qt index f7f9950e4..45311536a 100644 --- a/doc/man/man3/tqtextcodec.3qt +++ b/doc/man/man3/tqtextcodec.3qt @@ -424,9 +424,9 @@ Deletes all the created codecs. .PP \fBWarning:\fR Do not call this function. .PP -QApplication calls this function just before exiting to delete any TQTextCodec objects that may be lying around. Since various other classes hold pointers to TQTextCodec objects, it is not safe to call this function earlier. +TQApplication calls this function just before exiting to delete any TQTextCodec objects that may be lying around. Since various other classes hold pointers to TQTextCodec objects, it is not safe to call this function earlier. .PP -If you are using the utility classes (like TQString) but not using QApplication, calling this function at the very end of your application may be helpful for chasing down memory leaks by eliminating any TQTextCodec objects. +If you are using the utility classes (like TQString) but not using TQApplication, calling this function at the very end of your application may be helpful for chasing down memory leaks by eliminating any TQTextCodec objects. .SH "TQCString TQTextCodec::fromUnicode ( const TQString & uc, int & lenInOut ) const\fC [virtual]\fR" TQTextCodec subclasses must reimplement either this function or makeEncoder(). It converts the first \fIlenInOut\fR characters of \fIuc\fR from Unicode to the encoding of the subclass. If \fIlenInOut\fR is negative or too large, the length of \fIuc\fR is used instead. .PP @@ -518,7 +518,7 @@ If the literal quoted text in the program is not in the Latin-1 encoding, this f .br { .br - QApplication app(argc, argv); + TQApplication app(argc, argv); .br ... install any additional codecs ... .br diff --git a/doc/man/man3/tqthreadstorage.3qt b/doc/man/man3/tqthreadstorage.3qt index 3384c66dc..a56d04774 100644 --- a/doc/man/man3/tqthreadstorage.3qt +++ b/doc/man/man3/tqthreadstorage.3qt @@ -95,7 +95,7 @@ TQThreadStorage can only be used with threads started with TQThread. It \fIcanno As a corollary to the above, platform-specific APIs cannot be used to exit or terminate a TQThread using TQThreadStorage. Doing so will cause all per-thread data to be leaked. See TQThread::exit() and TQThread::terminate(). .IP .TP -TQThreadStorage \fIcan\fR be used to store data for the \fImain()\fR thread \fIafter\fR QApplication has been constructed. TQThreadStorage deletes all data set for the \fImain()\fR thread when QApplication is destroyed, regardless of whether or not the \fImain()\fR thread has actually finished. +TQThreadStorage \fIcan\fR be used to store data for the \fImain()\fR thread \fIafter\fR TQApplication has been constructed. TQThreadStorage deletes all data set for the \fImain()\fR thread when TQApplication is destroyed, regardless of whether or not the \fImain()\fR thread has actually finished. .IP .TP The implementation of TQThreadStorage limits the total number of TQThreadStorage objects to 256. An unlimited number of threads can store per-thread data in each TQThreadStorage object. diff --git a/doc/man/man3/tqtimer.3qt b/doc/man/man3/tqtimer.3qt index 0750c2d76..e62c1308a 100644 --- a/doc/man/man3/tqtimer.3qt +++ b/doc/man/man3/tqtimer.3qt @@ -119,7 +119,7 @@ Example: .PP .nf .br - #include + #include .br #include .br @@ -128,7 +128,7 @@ Example: .br { .br - QApplication a( argc, argv ); + TQApplication a( argc, argv ); .br TQTimer::singleShot( 10*60*1000, &a, TQ_SLOT(quit()) ); .br diff --git a/doc/man/man3/tqtranslator.3qt b/doc/man/man3/tqtranslator.3qt index 6ccb0cb1f..18217c245 100644 --- a/doc/man/man3/tqtranslator.3qt +++ b/doc/man/man3/tqtranslator.3qt @@ -75,7 +75,7 @@ The TQTranslator class provides internationalization support for text output. .PP An object of this class contains a set of TQTranslatorMessage objects, each of which specifies a translation from a source language to a target language. TQTranslator provides functions to look up translations, add new ones, remove them, load and save them, etc. .PP -The most common use of TQTranslator is to: load a translator file created with TQt Linguist, install it using QApplication::installTranslator(), and use it via TQObject::tr(). For example: +The most common use of TQTranslator is to: load a translator file created with TQt Linguist, install it using TQApplication::installTranslator(), and use it via TQObject::tr(). For example: .PP .nf .br @@ -83,7 +83,7 @@ The most common use of TQTranslator is to: load a translator file created with T .br { .br - QApplication app( argc, argv ); + TQApplication app( argc, argv ); .br .br TQTranslator translator( 0 ); @@ -111,7 +111,7 @@ Most applications will never need to do anything else with this class. The other .PP We call a translation a "messsage". For this reason, translation files are sometimes referred to as "message files". .PP -It is possible to lookup a translation using findMessage() (as tr() and QApplication::translate() do) and contains(), to insert a new translation messsage using insert(), and to remove one using remove(). +It is possible to lookup a translation using findMessage() (as tr() and TQApplication::translate() do) and contains(), to insert a new translation messsage using insert(), and to remove one using remove(). .PP Translation tools often need more information than the bare source text and translation, for example, context information to help the translator. But end-user programs that are using translations usually only need lookup. To cater for these different needs, TQTranslator can use stripped translator files that use the minimum of memory and which support little more functionality than findMessage(). .PP @@ -137,7 +137,7 @@ But it's not always so simple. The Spanish version of a printer dialog with sett .PP Note that when TQTranslator loads a stripped file, most functions do not work. The functions that do work with stripped files are explicitly documented as such. .PP -See also TQTranslatorMessage, QApplication::installTranslator(), QApplication::removeTranslator(), TQObject::tr(), QApplication::translate(), Environment Classes, and Internationalization with Qt. +See also TQTranslatorMessage, TQApplication::installTranslator(), TQApplication::removeTranslator(), TQObject::tr(), TQApplication::translate(), Environment Classes, and Internationalization with Qt. .SS "Member Type Documentation" .SH "TQTranslator::SaveMode" This enum type defines how TQTranslator writes translation files. There are two modes: diff --git a/doc/man/man3/tqwidget.3qt b/doc/man/man3/tqwidget.3qt index d95f88ee6..418f0de23 100644 --- a/doc/man/man3/tqwidget.3qt +++ b/doc/man/man3/tqwidget.3qt @@ -1207,7 +1207,7 @@ If the widget has active focus, a focus out event is sent to this widget to tell .PP This widget must enable focus setting in order to get the keyboard input focus, i.e. it must call setFocusPolicy(). .PP -See also focus, setFocus(), focusInEvent(), focusOutEvent(), focusPolicy, and QApplication::focusWidget(). +See also focus, setFocus(), focusInEvent(), focusOutEvent(), focusPolicy, and TQApplication::focusWidget(). .SH "void TQWidget::clearMask ()" Removes any mask set by setMask(). .PP @@ -1229,7 +1229,7 @@ Closes this widget. Returns TRUE if the widget was closed; otherwise returns FAL .PP First it sends the widget a TQCloseEvent. The widget is hidden if it accepts the close event. The default implementation of TQWidget::closeEvent() accepts the close event. .PP -The QApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed. +The TQApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed. .PP Examples: .)l dialog/mainwindow.cpp, mdi/application.cpp, popup/popup.cpp, and toplevel/options.ui.h. @@ -1240,11 +1240,11 @@ Closes this widget. Returns TRUE if the widget was closed; otherwise returns FAL .PP If \fIalsoDelete\fR is TRUE or the widget has the WDestructiveClose widget flag, the widget is also deleted. The widget can prevent itself from being closed by rejecting the TQCloseEvent it gets. A close events is delivered to the widget no matter if the widget is visible or not. .PP -The QApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed. +The TQApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed. .PP -Note that closing the QApplication::mainWidget() terminates the application. +Note that closing the TQApplication::mainWidget() terminates the application. .PP -See also closeEvent(), TQCloseEvent, hide(), QApplication::quit(), QApplication::setMainWidget(), and QApplication::lastWindowClosed(). +See also closeEvent(), TQCloseEvent, hide(), TQApplication::quit(), TQApplication::setMainWidget(), and TQApplication::lastWindowClosed(). .SH "void TQWidget::closeEvent ( TQCloseEvent * e )\fC [virtual protected]\fR" This event handler, for event \fIe\fR, can be reimplemented in a subclass to receive widget close events. .PP @@ -1433,7 +1433,7 @@ Returns the focus proxy, or 0 if there is no focus proxy. .PP See also setFocusProxy(). .SH "TQWidget * TQWidget::focusWidget () const" -Returns the focus widget in this widget's window. This is not the same as QApplication::focusWidget(), which returns the focus widget in the currently active window. +Returns the focus widget in this widget's window. This is not the same as TQApplication::focusWidget(), which returns the focus widget in the currently active window. .SH "TQFont TQWidget::font () const" Returns the font currently set for the widget. See the "font" property for details. .SH "void TQWidget::fontChange ( const TQFont & oldFont )\fC [virtual protected]\fR" @@ -1674,7 +1674,7 @@ In your reimplementation of this function, if you want to stop the event being h .PP \fBWarning:\fR This function is not portable. .PP -See also QApplication::macEventFilter(). +See also TQApplication::macEventFilter(). .SH "TQPoint TQWidget::mapFrom ( TQWidget * parent, const TQPoint & pos ) const" Translates the widget coordinate \fIpos\fR from the coordinate system of \fIparent\fR to this widget's coordinate system. The \fIparent\fR must not be 0 and must be a parent of the calling widget. .PP @@ -1838,11 +1838,11 @@ This function will be called \fIafter\fR a widget has been fully created and \fI .PP Polishing is useful for final initialization which depends on having an instantiated widget. This is something a constructor cannot guarantee since the initialization of the subclasses might not be finished. .PP -After this function, the widget has a proper font and palette and QApplication::polish() has been called. +After this function, the widget has a proper font and palette and TQApplication::polish() has been called. .PP Remember to call TQWidget's implementation first when reimplementing this function to ensure that your program does not end up in infinite recursion. .PP -See also constPolish() and QApplication::polish(). +See also constPolish() and TQApplication::polish(). .PP Example: menu/menu.cpp. .SH "TQPoint TQWidget::pos () const" @@ -1955,7 +1955,7 @@ Reimplemented in TQFrame and TQGLWidget. .SH "void TQWidget::scroll ( int dx, int dy )" Scrolls the widget including its children \fIdx\fR pixels to the right and \fIdy\fR downwards. Both \fIdx\fR and \fIdy\fR may be negative. .PP -After scrolling, scroll() sends a paint event for the the part that is read but not written. For example, when scrolling 10 pixels rightwards, the leftmost ten pixels of the widget need repainting. The paint event may be delivered immediately or later, depending on some heuristics (note that you might have to force processing of paint events using QApplication::sendPostedEvents() when using scroll() and move() in combination). +After scrolling, scroll() sends a paint event for the the part that is read but not written. For example, when scrolling 10 pixels rightwards, the leftmost ten pixels of the widget need repainting. The paint event may be delivered immediately or later, depending on some heuristics (note that you might have to force processing of paint events using TQApplication::sendPostedEvents() when using scroll() and move() in combination). .PP See also TQScrollView, erase(), and bitBlt(). .SH "void TQWidget::scroll ( int dx, int dy, const TQRect & r )" @@ -2060,7 +2060,7 @@ Be aware that if the widget is hidden, it will not accept focus. .PP \fBWarning:\fR If you call setFocus() in a function which may itself be called from focusOutEvent() or focusInEvent(), you may get an infinite recursion. .PP -See also focus, clearFocus(), focusInEvent(), focusOutEvent(), focusPolicy, QApplication::focusWidget(), grabKeyboard(), and grabMouse(). +See also focus, clearFocus(), focusInEvent(), focusOutEvent(), focusPolicy, TQApplication::focusWidget(), grabKeyboard(), and grabMouse(). .PP Examples: .)l addressbook/centralwidget.cpp, lineedits/lineedits.cpp, mdi/application.cpp, popup/popup.cpp, rot13/rot13.cpp, t8/main.cpp, and wizard/wizard.cpp. @@ -2195,13 +2195,13 @@ See also TQSizePolicy::TQSizePolicy(). .SH "void TQWidget::setStyle ( TQStyle * style )" Sets the widget's GUI style to \fIstyle\fR. Ownership of the style object is not transferred. .PP -If no style is set, the widget uses the application's style, QApplication::style() instead. +If no style is set, the widget uses the application's style, TQApplication::style() instead. .PP Setting a widget's style has no effect on existing or future child widgets. .PP \fBWarning:\fR This function is particularly useful for demonstration purposes, where you want to show Qt's styling capabilities. Real applications should avoid it and use one consistent GUI style instead. .PP -See also style(), TQStyle, QApplication::style(), and QApplication::setStyle(). +See also style(), TQStyle, TQApplication::style(), and TQApplication::setStyle(). .PP Examples: .)l progressbar/progressbar.cpp. @@ -2352,7 +2352,7 @@ See also raise() and lower(). .SH "TQStyle & TQWidget::style () const" Returns the GUI style for this widget .PP -See also TQWidget::setStyle(), QApplication::setStyle(), and QApplication::style(). +See also TQWidget::setStyle(), TQApplication::setStyle(), and TQApplication::style(). .SH "void TQWidget::styleChange ( TQStyle & oldStyle )\fC [virtual protected]\fR" This virtual function is called when the style of the widgets changes. \fIoldStyle\fR is the previous GUI style; you can get the new style from style(). .PP @@ -2360,7 +2360,7 @@ Reimplement this function if your widget needs to know when its GUI style change .PP The default implementation updates the widget including its geometry. .PP -See also QApplication::setStyle(), style(), update(), and updateGeometry(). +See also TQApplication::setStyle(), style(), update(), and updateGeometry(). .SH "void TQWidget::tabletEvent ( TQTabletEvent * e )\fC [virtual protected]\fR" This event handler, for event \fIe\fR, can be reimplemented in a subclass to receive tablet events for the widget. .PP @@ -2475,7 +2475,7 @@ In your reimplementation of this function, if you want to stop the event being h .PP \fBWarning:\fR This function is not portable. .PP -See also QApplication::winEventFilter(). +See also TQApplication::winEventFilter(). .SH "WId TQWidget::winId () const" Returns the window system identifier of the widget. .PP @@ -2505,7 +2505,7 @@ In your reimplementation of this function, if you want to stop the event being h .PP \fBWarning:\fR This function is not portable. .PP -See also QApplication::x11EventFilter(). +See also TQApplication::x11EventFilter(). .SH "int TQWidget::y () const" Returns the y coordinate of the widget relative to its parent and including any window frame. See the "y" property for details. .SS "Property Documentation" @@ -2546,7 +2546,7 @@ This property holds the widget's background brush. .PP The background brush depends on a widget's palette and its background mode. .PP -See also backgroundColor(), backgroundPixmap(), eraseColor(), palette, and QApplication::setPalette(). +See also backgroundColor(), backgroundPixmap(), eraseColor(), palette, and TQApplication::setPalette(). .PP Get this property's value with backgroundBrush(). .SH "BackgroundMode backgroundMode" @@ -2634,7 +2634,7 @@ An editor widget might use an I-beam cursor: .PP If no cursor has been set, or after a call to unsetCursor(), the parent's cursor is used. The function unsetCursor() has no effect on top-level widgets. .PP -See also QApplication::setOverrideCursor(). +See also TQApplication::setOverrideCursor(). .PP Set this property's value with setCursor(), get this property's value with cursor(), and reset this property's value with unsetCursor(). .SH "bool customWhatsThis" @@ -2666,7 +2666,7 @@ This property holds whether this widget (or its focus proxy) has the keyboard in .PP Effectively equivalent to \fCqApp->focusWidget() == this\fR. .PP -See also setFocus(), clearFocus(), focusPolicy, and QApplication::focusWidget(). +See also setFocus(), clearFocus(), focusPolicy, and TQApplication::focusWidget(). .PP Get this property's value with hasFocus(). .SH "bool focusEnabled" @@ -2792,7 +2792,7 @@ The active window is the window that contains the widget that has keyboard focus .PP When popup windows are visible, this property is TRUE for both the active window \fIand\fR for the popup. .PP -See also setActiveWindow() and QApplication::activeWindow(). +See also setActiveWindow() and TQApplication::activeWindow(). .PP Get this property's value with isActiveWindow(). .SH "bool isDesktop" @@ -2800,7 +2800,7 @@ This property holds whether the widget is a desktop widget, i.e. represents the .PP A desktop widget is also a top-level widget. .PP -See also isTopLevel and QApplication::desktop(). +See also isTopLevel and TQApplication::desktop(). .PP Get this property's value with isDesktop(). .SH "bool isDialog" @@ -2932,7 +2932,7 @@ If mouse tracking is disabled (the default), the widget only receives mouse move .PP If mouse tracking is enabled, the widget receives mouse move events even if no buttons are pressed. .PP -See also mouseMoveEvent() and QApplication::setGlobalMouseTracking(). +See also mouseMoveEvent() and TQApplication::setGlobalMouseTracking(). .PP Set this property's value with setMouseTracking() and get this property's value with hasMouseTracking(). .SH "bool ownCursor" @@ -2966,7 +2966,7 @@ As long as no special palette has been set, or after unsetPalette() has been cal .PP Instead of defining an entirely new palette, you can also use the paletteBackgroundColor, paletteBackgroundPixmap and paletteForegroundColor convenience properties to change a widget's background and foreground appearance only. .PP -See also ownPalette, colorGroup, and QApplication::palette(). +See also ownPalette, colorGroup, and TQApplication::palette(). .PP Set this property's value with setPalette(), get this property's value with palette(), and reset this property's value with unsetPalette(). .SH "TQColor paletteBackgroundColor" @@ -2994,7 +2994,7 @@ This property holds the foreground color of the widget. .PP setPaletteForegroundColor() is a convenience function that creates and sets a modified TQPalette with setPalette(). The palette is modified according to the widget's \fIbackground mode\fR. For example, if the background mode is PaletteButton the palette entry TQColorGroup::ButtonText is set to color. .PP -See also palette, QApplication::setPalette(), backgroundMode, foregroundColor(), backgroundMode, and setEraseColor(). +See also palette, TQApplication::setPalette(), backgroundMode, foregroundColor(), backgroundMode, and setEraseColor(). .PP Set this property's value with setPaletteForegroundColor(), get this property's value with paletteForegroundColor(), and reset this property's value with unsetPalette(). .SH "TQPoint pos" diff --git a/doc/man/man3/tqwizard.3qt b/doc/man/man3/tqwizard.3qt index 8db06bff3..b5a22c22a 100644 --- a/doc/man/man3/tqwizard.3qt +++ b/doc/man/man3/tqwizard.3qt @@ -259,7 +259,7 @@ Returns the font used for page titles. See the "titleFont" property for details. .SH "TQFont titleFont" This property holds the font used for page titles. .PP -The default is QApplication::font(). +The default is TQApplication::font(). .PP Set this property's value with setTitleFont() and get this property's value with titleFont(). diff --git a/doc/networking.doc b/doc/networking.doc index c4204f83c..d8e5bf9e7 100644 --- a/doc/networking.doc +++ b/doc/networking.doc @@ -66,7 +66,7 @@ Qt's networking classes, showing how they are used in practice. If you are using standard network protocols, such as FTP and HTTP, you must register them before you can use TQUrlOperator. For example, put the following call in your \c main() function, after creating your -QApplication object: +TQApplication object: \code tqInitNetworkProtocols(); \endcode diff --git a/doc/object.doc b/doc/object.doc index 5282000c6..02261eb1d 100644 --- a/doc/object.doc +++ b/doc/object.doc @@ -99,7 +99,7 @@ milliseconds, until you explicitly call \l TQObject::killTimer() with the timer id. For this mechanism to work, the application must run in an event -loop. You start an event loop with \l QApplication::exec(). When a +loop. You start an event loop with \l TQApplication::exec(). When a timer fires, the application sends a TQTimerEvent, and the flow of control leaves the event loop until the timer event is processed. This implies that a timer cannot fire while your application is busy doing @@ -466,7 +466,7 @@ right-presses, etc. Since programs need to react in varied and complex ways, Qt's event delivery mechanisms are flexible. The documentation for -\l QApplication::notify() concisely tells the whole story, here we +\l TQApplication::notify() concisely tells the whole story, here we will explain enough for 99% of applications. The normal way for an event to be delivered is by calling a virtual @@ -532,7 +532,7 @@ stops processing, the target and any later event filters don't get to see the event at all. It's also possible to filter \e all events for the entire application, -by installing an event filter on \l QApplication. This is what \l +by installing an event filter on \l TQApplication. This is what \l TQToolTip does in order to see \e all the mouse and keyboard activity. This is very powerful, but it also slows down event delivery of every single event in the entire application, so it's best avoided. @@ -543,8 +543,8 @@ filters. Finally, many applications want to create and send their own events. Creating an event of a built-in type is very simple: create an object -of the relevant type, and then call \l QApplication::sendEvent() or \l -QApplication::postEvent(). +of the relevant type, and then call \l TQApplication::sendEvent() or \l +TQApplication::postEvent(). sendEvent() processes the event immediately - when sendEvent() returns, (the event filters and) the object have already processed the diff --git a/doc/opengl-x11-overlays.doc b/doc/opengl-x11-overlays.doc index c02dd4a25..18ae02838 100644 --- a/doc/opengl-x11-overlays.doc +++ b/doc/opengl-x11-overlays.doc @@ -102,7 +102,7 @@ set the background color to the transparent color, so that the OpenGL image shows through except where explicitly overpainted. Note: to use this technique, you must not use the "ManyColor" or -"TrueColor" ColorSpec for QApplication, because this will force +"TrueColor" ColorSpec for TQApplication, because this will force the normal TQt widgets to use a TrueColor visual, which will typically be in the main plane, not in the overlay plane as desired. diff --git a/doc/plugins-howto.doc b/doc/plugins-howto.doc index 71d1314af..96368fedc 100644 --- a/doc/plugins-howto.doc +++ b/doc/plugins-howto.doc @@ -81,13 +81,13 @@ But where is the \c{pluginsbase} directory? When the application is run, TQt will first treat the application's executable directory as the \c{pluginsbase}. For example if the application is in \c{C:\Program Files\MyApp} and has a style plugin, TQt will look in \c{C:\Program -Files\MyApp\styles}. (See \l{QApplication::applicationDirPath()} for +Files\MyApp\styles}. (See \l{TQApplication::applicationDirPath()} for how to find out where the application's executable is.) TQt will also look in the directory given by \c{tqInstallPathPlugins()}. If you want Qt to look in additional places you can add as many paths as you need -with calls to \c{QApplication::addLibraryPath()}. And if you want to +with calls to \c{TQApplication::addLibraryPath()}. And if you want to set your own path or paths you can use -\c{QApplication::setLibraryPaths()}. +\c{TQApplication::setLibraryPaths()}. Suppose that you have a new style class called 'MyStyle' that you want to make available as a plugin. The required code is straightforward: @@ -134,7 +134,7 @@ no explicit object creation is required. TQt will find and create them as required. Styles are an exception, since you might want to set a style explicitly in code. To apply a style, use code like this: \code - QApplication::setStyle( TQStyleFactory::create( "MyStyle" ) ); + TQApplication::setStyle( TQStyleFactory::create( "MyStyle" ) ); \endcode Some plugin classes require additional functions to be implemented. @@ -159,7 +159,7 @@ styles. If you want your applications to use plugins and you don't want to use the standard plugins path, have your installation process determine the path you want to use for the plugins, and save the path, e.g. using TQSettings, for the application to read when it runs. The -application can then call QApplication::addLibraryPath() with this +application can then call TQApplication::addLibraryPath() with this path and your plugins will be available to the application. Note that the final part of the path, i.e. \c styles, \c widgets, etc., cannot be changed. @@ -172,7 +172,7 @@ is to create a subdirectory under the application, e.g. \c appdir/plugins/designer, and place the plugin in that directory. For \link designer-manual.book TQt Designer\endlink, you may need to -call QApplication::addLibraryPath("TQTDIR/plugins/designer") to load +call TQApplication::addLibraryPath("TQTDIR/plugins/designer") to load your \link designer-manual.book TQt Designer\endlink plugins. * All references to \c{TQTDIR} refer to the path diff --git a/doc/session.doc b/doc/session.doc index dfa27492c..8837b8431 100644 --- a/doc/session.doc +++ b/doc/session.doc @@ -79,13 +79,13 @@ management for applications yet, i.e. no restoring of previous sessions. They do support graceful logouts where applications have the opportunity to cancel the process after getting confirmation from the user. This is the functionality that corresponds to the \l -QApplication::commitData() method. +TQApplication::commitData() method. X11 has supported complete session management since X11R6. \section1 Getting session management to work with TQt -Start by reimplementing \l QApplication::commitData() to +Start by reimplementing \l TQApplication::commitData() to enable your application to take part in the graceful logout process. If you are only targeting the MS-Windows platform, this is all you can and must provide. Ideally, your application should provide a shutdown @@ -100,17 +100,17 @@ For complete session management (only supported on X11R6 at present), you must also take care of saving the application's state, and potentially of restoring the state in the next life cycle of the session. This saving is done by reimplementing \l -QApplication::saveState(). All state data you are saving in this +TQApplication::saveState(). All state data you are saving in this function, should be marked with the session identifier \l -QApplication::sessionId(). This application specific identifier is +TQApplication::sessionId(). This application specific identifier is globally unique, so no clashes will occur. (See \l TQSessionManager for information on saving/restoring the state of a particular Qt application.) Restoration is usually done in the application's main() -function. Check if \l QApplication::isSessionRestored() is \c TRUE. If +function. Check if \l TQApplication::isSessionRestored() is \c TRUE. If that's the case, use the session identifier \l -QApplication::sessionId() again to access your state data and restore +TQApplication::sessionId() again to access your state data and restore the state of the application. Important: In order to allow the window manager to @@ -164,10 +164,10 @@ crash. \i Use the session manager's \e Checkpoint and \e Shutdown buttons with different settings and see how your application behaves. The save type \e local means that the clients should save their state. It -corresponds to the \l QApplication::saveState() function. The \e +corresponds to the \l TQApplication::saveState() function. The \e global save type asks applications to save their unsaved changes in permanent, globally accessible storage. It invokes \l -QApplication::commitData(). +TQApplication::commitData(). \i Whenever something crashes, blame \c xsm and not Qt. \c xsm is far from being a usable session manager on a user's desktop. It is, however, stable and useful enough to serve as testing environment. diff --git a/doc/threads.doc b/doc/threads.doc index dc1a61d49..b7c6043d0 100644 --- a/doc/threads.doc +++ b/doc/threads.doc @@ -71,7 +71,7 @@ library. On both platforms, you should compile with the macro \c TQT_THREAD_SUPPORT defined (e.g. compile with \c{-DTQT_THREAD_SUPPORT}). On Windows, this is usually done by an -entry in \c{ntqconfig.h}. +entry in \c{tqconfig.h}. \section1 The Thread Classes @@ -190,18 +190,18 @@ mutex must be used: \section1 Thread-safe Event Posting In Qt, one thread is always the GUI or event thread. This is the -thread that creates a QApplication object and calls -QApplication::exec(). This is also the initial thread that calls +thread that creates a TQApplication object and calls +TQApplication::exec(). This is also the initial thread that calls main() at program start. This thread is the only thread that is allowed to perform GUI operations, including generating and receiving events from the window system. TQt does not support creating -QApplication and running the event loop (with QApplication::exec()) in -a secondary thread. You must create the QApplication object and call -QApplication::exec() from the main() function in your program. +TQApplication and running the event loop (with TQApplication::exec()) in +a secondary thread. You must create the TQApplication object and call +TQApplication::exec() from the main() function in your program. Threads that wish to display data in a widget cannot modify the widget directly, so they must post an event to the widget using -QApplication::postEvent(). The event will be delivered later on by +TQApplication::postEvent(). The event will be delivered later on by the GUI thread. Normally, the programmer would like to include some information in the @@ -241,7 +241,7 @@ delivered to the object. \section1 The TQt Library Mutex -QApplication includes a mutex that is used to protect access to window +TQApplication includes a mutex that is used to protect access to window system functions. This mutex is locked while the event loop is running (e.g. during event delivery) and unlocked when the eventloop goes to sleep. Note: The TQt event loop is recursive, and the library @@ -347,9 +347,9 @@ load the normal TQt library or dynamically load another library or plugin that depends on the normal TQt library. On some systems, doing this can corrupt the static data used in the TQt library. -\i TQt does not support creating QApplication and running the event -loop (with QApplication::exec()) in a secondary thread. You must -create the QApplication object and call QApplication::exec() from the +\i TQt does not support creating TQApplication and running the event +loop (with TQApplication::exec()) in a secondary thread. You must +create the TQApplication object and call TQApplication::exec() from the main() function in your program. \endlist diff --git a/doc/tqmap.doc b/doc/tqmap.doc index 47ee53d7c..4184798eb 100644 --- a/doc/tqmap.doc +++ b/doc/tqmap.doc @@ -120,7 +120,7 @@ int main(int argc, char **argv) { - QApplication app( argc, argv ); + TQApplication app( argc, argv ); typedef TQMap EmployeeMap; EmployeeMap map; diff --git a/doc/tutorial.doc b/doc/tutorial.doc index 7821fbdde..57f1482bb 100644 --- a/doc/tutorial.doc +++ b/doc/tutorial.doc @@ -98,9 +98,9 @@ The picture above is a snapshot of this program. \skipto include \printline qapp -This line includes the QApplication class definition. There has to be -exactly one QApplication object in every application that uses Qt. -QApplication manages various application-wide resources, such as the +This line includes the TQApplication class definition. There has to be +exactly one TQApplication object in every application that uses Qt. +TQApplication manages various application-wide resources, such as the default font and cursor. \printline tqpushbutton @@ -113,7 +113,7 @@ TQPushButton is a classical GUI push button that the user can press and release. It manages its own look and feel, like every other \l TQWidget. A widget is a user interface object that can process user input and draw graphics. The programmer can change both the overall -\link QApplication::setStyle() look and feel\endlink and many minor +\link TQApplication::setStyle() look and feel\endlink and many minor properties of it (such as color), as well as the widget's content. A TQPushButton can show either a text or a \l TQPixmap. @@ -130,20 +130,20 @@ array of command-line arguments. This is a C/C++ feature. It is not specific to Qt; however, TQt needs to process these arguments (see following). -\printline QApplication +\printline TQApplication -\c a is this program's QApplication. Here it is created and processes +\c a is this program's TQApplication. Here it is created and processes some of the command-line arguments (such as -display under X Window). Note that all command-line arguments recognized by TQt are removed from \c argv (and \c argc is decremented accordingly). See the \l -QApplication::argv() documentation for details. +TQApplication::argv() documentation for details. -Note: It is essential that the QApplication object be +Note: It is essential that the TQApplication object be created before any window-system parts of TQt are used. \printline TQPushButton -Here, \e after the QApplication, comes the first window-system code: A +Here, \e after the TQApplication, comes the first window-system code: A push button is created. The button is set up to display the text "Hello world!" and be a @@ -258,7 +258,7 @@ Here we choose a new font for the button, an 18-point bold font from the Times family. Note that we create the font on the spot. It is also possible to change the default font (using \l -QApplication::setFont()) for the whole application. +TQApplication::setFont()) for the whole application. \printline connect @@ -1256,12 +1256,12 @@ this time. \printline main \printline { \printline CustomColor -\printline QApplication +\printline TQApplication We tell TQt that we want a different color-allocation strategy for this program. There is no single correct color-allocation strategy. Because this program uses an unusual yellow but not many colors, \c -CustomColor is best. There are several other allocation strategies; you can read about them in the \l QApplication::setColorSpec() +CustomColor is best. There are several other allocation strategies; you can read about them in the \l TQApplication::setColorSpec() documentation. Mostly you can ignore this, since the default is good. Occasionally diff --git a/doc/tutorial2.doc b/doc/tutorial2.doc index 62b699a51..bf06d7d7b 100644 --- a/doc/tutorial2.doc +++ b/doc/tutorial2.doc @@ -332,7 +332,7 @@ to what you want to store. \printline We have kept the main() function simple and small. We create a -QApplication object and pass it the command line arguments. We are +TQApplication object and pass it the command line arguments. We are allowing users to invoke the program with \c{chart mychart.cht}, so if they've added a filename we pass that through to the chart form constructor. Most of the action takes place within the chart form diff --git a/doc/xml-sax-features-walkthrough.doc b/doc/xml-sax-features-walkthrough.doc index 28b54b052..defb87b8f 100644 --- a/doc/xml-sax-features-walkthrough.doc +++ b/doc/xml-sax-features-walkthrough.doc @@ -80,7 +80,7 @@ the XML parser that we implement in \link #structureparser.cpp structureparser.cpp. \endlink \printline main -\printuntil QApplication +\printuntil TQApplication As usual we then create a TQt application object and hand command line arguments over to it. diff --git a/doc/y2k.doc b/doc/y2k.doc index 1fe63d02f..72ab1d105 100644 --- a/doc/y2k.doc +++ b/doc/y2k.doc @@ -70,7 +70,7 @@ seconds or milliseconds, and is thus Year 2000 Compliant. This applies to the above four classes and also to \l TQFileDialog (which can sort files by time/date), \l TQFileInfo (which operates on -file times/dates) and \l QApplication (which does various internal +file times/dates) and \l TQApplication (which does various internal housekeeping tasks). The conversion to year/month/date format in TQDate (and diff --git a/examples/aclock/main.cpp b/examples/aclock/main.cpp index 0331d790e..bad2fb5b8 100644 --- a/examples/aclock/main.cpp +++ b/examples/aclock/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "aclock.h" -#include +#include int main( int argc, char **argv ) diff --git a/examples/action/application.cpp b/examples/action/application.cpp index c599b29ff..e2c6729a6 100644 --- a/examples/action/application.cpp +++ b/examples/action/application.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/action/main.cpp b/examples/action/main.cpp index fd3df5054..0a0156a85 100644 --- a/examples/action/main.cpp +++ b/examples/action/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "application.h" int main( int argc, char ** argv ) { diff --git a/examples/action/toggleaction/toggleaction.cpp b/examples/action/toggleaction/toggleaction.cpp index 79c838d63..13b8c1482 100644 --- a/examples/action/toggleaction/toggleaction.cpp +++ b/examples/action/toggleaction/toggleaction.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/examples/addressbook/main.cpp b/examples/addressbook/main.cpp index 80c36dc05..9b0eda28a 100644 --- a/examples/addressbook/main.cpp +++ b/examples/addressbook/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "mainwindow.h" diff --git a/examples/addressbook/mainwindow.cpp b/examples/addressbook/mainwindow.cpp index 6eadba72f..894458413 100644 --- a/examples/addressbook/mainwindow.cpp +++ b/examples/addressbook/mainwindow.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include ABMainWindow::ABMainWindow() diff --git a/examples/application/application.cpp b/examples/application/application.cpp index 136a97030..8db74fa1f 100644 --- a/examples/application/application.cpp +++ b/examples/application/application.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/application/main.cpp b/examples/application/main.cpp index 442af1206..f63aa868a 100644 --- a/examples/application/main.cpp +++ b/examples/application/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "application.h" int main( int argc, char ** argv ) { diff --git a/examples/biff/main.cpp b/examples/biff/main.cpp index 097ece2bb..ca8e73183 100644 --- a/examples/biff/main.cpp +++ b/examples/biff/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "biff.h" diff --git a/examples/buttongroups/main.cpp b/examples/buttongroups/main.cpp index de32dfb95..bbda6539c 100644 --- a/examples/buttongroups/main.cpp +++ b/examples/buttongroups/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "buttongroups.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/canvas/canvas.cpp b/examples/canvas/canvas.cpp index b0975a154..d5d551985 100644 --- a/examples/canvas/canvas.cpp +++ b/examples/canvas/canvas.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/canvas/main.cpp b/examples/canvas/main.cpp index a1ae84472..d62962cc7 100644 --- a/examples/canvas/main.cpp +++ b/examples/canvas/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include "canvas.h" diff --git a/examples/chart/chartform.cpp b/examples/chart/chartform.cpp index c4956db0a..d585c4f78 100644 --- a/examples/chart/chartform.cpp +++ b/examples/chart/chartform.cpp @@ -4,7 +4,7 @@ #include "setdataform.h" #include -#include +#include #include #include #include diff --git a/examples/chart/main.cpp b/examples/chart/main.cpp index f904c42b3..4e589ee68 100644 --- a/examples/chart/main.cpp +++ b/examples/chart/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "chartform.h" diff --git a/examples/checklists/main.cpp b/examples/checklists/main.cpp index 65f368348..0aa41c9ac 100644 --- a/examples/checklists/main.cpp +++ b/examples/checklists/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "checklists.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/cursor/cursor.cpp b/examples/cursor/cursor.cpp index 342862a55..16961f049 100644 --- a/examples/cursor/cursor.cpp +++ b/examples/cursor/cursor.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/examples/customlayout/main.cpp b/examples/customlayout/main.cpp index 7dc3640f2..e2605031a 100644 --- a/examples/customlayout/main.cpp +++ b/examples/customlayout/main.cpp @@ -13,7 +13,7 @@ #include "border.h" #include "card.h" -#include +#include #include #include #include diff --git a/examples/dclock/main.cpp b/examples/dclock/main.cpp index 27a9f96dd..9fa8e011d 100644 --- a/examples/dclock/main.cpp +++ b/examples/dclock/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "dclock.h" -#include +#include int main( int argc, char **argv ) diff --git a/examples/demo/dnd/listview.cpp b/examples/demo/dnd/listview.cpp index e97a03ea0..6b66d242e 100644 --- a/examples/demo/dnd/listview.cpp +++ b/examples/demo/dnd/listview.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "listview.h" #include "dnd.h" diff --git a/examples/demo/dnd/styledbutton.cpp b/examples/demo/dnd/styledbutton.cpp index ee393a106..532c66cca 100644 --- a/examples/demo/dnd/styledbutton.cpp +++ b/examples/demo/dnd/styledbutton.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/demo/frame.cpp b/examples/demo/frame.cpp index 85375eb55..2c4105330 100644 --- a/examples/demo/frame.cpp +++ b/examples/demo/frame.cpp @@ -9,7 +9,7 @@ #include "frame.h" -#include +#include #include #include #include diff --git a/examples/demo/i18n/i18n.cpp b/examples/demo/i18n/i18n.cpp index 87678dfa1..b9ed9da7e 100644 --- a/examples/demo/i18n/i18n.cpp +++ b/examples/demo/i18n/i18n.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/demo/main.cpp b/examples/demo/main.cpp index 7be7d2483..381e44aae 100644 --- a/examples/demo/main.cpp +++ b/examples/demo/main.cpp @@ -17,7 +17,7 @@ #include "dnd/dnd.h" #include "i18n/i18n.h" -#include +#include #if defined(TQT_MODULE_OPENGL) #include "opengl/glworkspace.h" @@ -37,7 +37,7 @@ #include -#include +#include #include #include diff --git a/examples/demo/qasteroids/toplevel.cpp b/examples/demo/qasteroids/toplevel.cpp index 5eb9a9c87..ca6db89ef 100644 --- a/examples/demo/qasteroids/toplevel.cpp +++ b/examples/demo/qasteroids/toplevel.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include "toplevel.h" #include "ledmeter.h" diff --git a/examples/demo/qasteroids/view.cpp b/examples/demo/qasteroids/view.cpp index 8b7ceeed3..e0ee429af 100644 --- a/examples/demo/qasteroids/view.cpp +++ b/examples/demo/qasteroids/view.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/examples/demo/textdrawing/helpwindow.cpp b/examples/demo/textdrawing/helpwindow.cpp index 8804a513a..88d54f5b0 100644 --- a/examples/demo/textdrawing/helpwindow.cpp +++ b/examples/demo/textdrawing/helpwindow.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/demo/textdrawing/textedit.cpp b/examples/demo/textdrawing/textedit.cpp index 65239fc79..c002de194 100644 --- a/examples/demo/textdrawing/textedit.cpp +++ b/examples/demo/textdrawing/textedit.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/desktop/desktop.cpp b/examples/desktop/desktop.cpp index 4e9a54445..68b8f1513 100644 --- a/examples/desktop/desktop.cpp +++ b/examples/desktop/desktop.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/dirview/dirview.cpp b/examples/dirview/dirview.cpp index 351c01d6b..1dc9483aa 100644 --- a/examples/dirview/dirview.cpp +++ b/examples/dirview/dirview.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include static const char* folder_closed_xpm[]={ diff --git a/examples/dirview/main.cpp b/examples/dirview/main.cpp index 50727fe07..2b0a570bb 100644 --- a/examples/dirview/main.cpp +++ b/examples/dirview/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "dirview.h" diff --git a/examples/distributor/distributor.ui.h b/examples/distributor/distributor.ui.h index 1c1ee2b8f..992783330 100644 --- a/examples/distributor/distributor.ui.h +++ b/examples/distributor/distributor.ui.h @@ -7,7 +7,7 @@ ** place of a destructor. *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/distributor/main.cpp b/examples/distributor/main.cpp index 37c51c80f..a8618abee 100644 --- a/examples/distributor/main.cpp +++ b/examples/distributor/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "distributor.h" int main( int argc, char ** argv ) diff --git a/examples/dragdrop/main.cpp b/examples/dragdrop/main.cpp index 64e457653..661c8a52d 100644 --- a/examples/dragdrop/main.cpp +++ b/examples/dragdrop/main.cpp @@ -9,7 +9,7 @@ ** *****************************************************************************/ -#include +#include #include "dropsite.h" #include "secret.h" #include diff --git a/examples/drawdemo/drawdemo.cpp b/examples/drawdemo/drawdemo.cpp index 6f34c746f..cbcdb4436 100644 --- a/examples/drawdemo/drawdemo.cpp +++ b/examples/drawdemo/drawdemo.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include // diff --git a/examples/drawlines/connect.cpp b/examples/drawlines/connect.cpp index 37c8a4690..2e4000944 100644 --- a/examples/drawlines/connect.cpp +++ b/examples/drawlines/connect.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include diff --git a/examples/extension/main.cpp b/examples/extension/main.cpp index 0bcaef440..dbcf30630 100644 --- a/examples/extension/main.cpp +++ b/examples/extension/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "mainform.h" int main( int argc, char ** argv ) diff --git a/examples/extension/mainform.ui.h b/examples/extension/mainform.ui.h index 6ff472c56..68a6368c6 100644 --- a/examples/extension/mainform.ui.h +++ b/examples/extension/mainform.ui.h @@ -7,7 +7,7 @@ *****************************************************************************/ #include "dialogform.h" #include "extension.h" -#include +#include #include #include diff --git a/examples/fileiconview/main.cpp b/examples/fileiconview/main.cpp index b6d628236..6af1f9b1d 100644 --- a/examples/fileiconview/main.cpp +++ b/examples/fileiconview/main.cpp @@ -10,7 +10,7 @@ #include "mainwindow.h" #include "tqfileiconview.h" -#include +#include int main( int argc, char **argv ) diff --git a/examples/fileiconview/tqfileiconview.cpp b/examples/fileiconview/tqfileiconview.cpp index ea3524bc1..3b56bead6 100644 --- a/examples/fileiconview/tqfileiconview.cpp +++ b/examples/fileiconview/tqfileiconview.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/fonts/simple-tqfont-demo/simple-tqfont-demo.cpp b/examples/fonts/simple-tqfont-demo/simple-tqfont-demo.cpp index aa12a5055..3c3551c4e 100644 --- a/examples/fonts/simple-tqfont-demo/simple-tqfont-demo.cpp +++ b/examples/fonts/simple-tqfont-demo/simple-tqfont-demo.cpp @@ -1,7 +1,7 @@ #include "viewer.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/forever/forever.cpp b/examples/forever/forever.cpp index 54fe49b6d..61dea7ecf 100644 --- a/examples/forever/forever.cpp +++ b/examples/forever/forever.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include // defines rand() function #include "forever.h" diff --git a/examples/gridview/gridview.cpp b/examples/gridview/gridview.cpp index 928641ed8..971084e2c 100644 --- a/examples/gridview/gridview.cpp +++ b/examples/gridview/gridview.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include diff --git a/examples/hello/main.cpp b/examples/hello/main.cpp index 22608f099..6c3dc617b 100644 --- a/examples/hello/main.cpp +++ b/examples/hello/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "hello.h" -#include +#include /* diff --git a/examples/helpdemo/main.cpp b/examples/helpdemo/main.cpp index f632cfc28..e6904ec73 100644 --- a/examples/helpdemo/main.cpp +++ b/examples/helpdemo/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "helpdemo.h" int main( int argc, char ** argv ) diff --git a/examples/helpsystem/main.cpp b/examples/helpsystem/main.cpp index aa99b8d22..70c67bfa7 100644 --- a/examples/helpsystem/main.cpp +++ b/examples/helpsystem/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "mainwindow.h" diff --git a/examples/helpsystem/mainwindow.cpp b/examples/helpsystem/mainwindow.cpp index 573e335d5..cac242c3f 100644 --- a/examples/helpsystem/mainwindow.cpp +++ b/examples/helpsystem/mainwindow.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/helpsystem/whatsthis.cpp b/examples/helpsystem/whatsthis.cpp index 113dbc10c..d57da1449 100644 --- a/examples/helpsystem/whatsthis.cpp +++ b/examples/helpsystem/whatsthis.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/helpviewer/helpwindow.cpp b/examples/helpviewer/helpwindow.cpp index 121cd8a03..b85eae3b9 100644 --- a/examples/helpviewer/helpwindow.cpp +++ b/examples/helpviewer/helpwindow.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/helpviewer/main.cpp b/examples/helpviewer/main.cpp index 55483c3dc..ee2e7ad85 100644 --- a/examples/helpviewer/main.cpp +++ b/examples/helpviewer/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "helpwindow.h" -#include +#include #include #include diff --git a/examples/i18n/main.cpp b/examples/i18n/main.cpp index 6774ca42d..ef41d3756 100644 --- a/examples/i18n/main.cpp +++ b/examples/i18n/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/i18n/mywidget.cpp b/examples/i18n/mywidget.cpp index 076a3d08c..b0aec85bb 100644 --- a/examples/i18n/mywidget.cpp +++ b/examples/i18n/mywidget.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "mywidget.h" diff --git a/examples/iconview/main.cpp b/examples/iconview/main.cpp index fdb83feb0..476985a97 100644 --- a/examples/iconview/main.cpp +++ b/examples/iconview/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/examples/iconview/simple_dd/main.h b/examples/iconview/simple_dd/main.h index 032da5eb2..e3fcdf512 100644 --- a/examples/iconview/simple_dd/main.h +++ b/examples/iconview/simple_dd/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/layout/layout.cpp b/examples/layout/layout.cpp index 1256afa3b..18fd487fe 100644 --- a/examples/layout/layout.cpp +++ b/examples/layout/layout.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/life/life.cpp b/examples/life/life.cpp index 83caded9d..ff02ff851 100644 --- a/examples/life/life.cpp +++ b/examples/life/life.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include // The main game of life widget diff --git a/examples/life/lifedlg.cpp b/examples/life/lifedlg.cpp index 9bc47e8b1..7f549e845 100644 --- a/examples/life/lifedlg.cpp +++ b/examples/life/lifedlg.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "lifedlg.h" -#include +#include #include #include #include diff --git a/examples/life/main.cpp b/examples/life/main.cpp index 61003a51c..ce545e638 100644 --- a/examples/life/main.cpp +++ b/examples/life/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "lifedlg.h" -#include +#include #include void usage() diff --git a/examples/lineedits/main.cpp b/examples/lineedits/main.cpp index a311cf48e..0320e0c1a 100644 --- a/examples/lineedits/main.cpp +++ b/examples/lineedits/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "lineedits.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/listbox/main.cpp b/examples/listbox/main.cpp index 1eae11227..61652cd23 100644 --- a/examples/listbox/main.cpp +++ b/examples/listbox/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "listbox.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/listboxcombo/main.cpp b/examples/listboxcombo/main.cpp index 6b41a65c4..93ffece38 100644 --- a/examples/listboxcombo/main.cpp +++ b/examples/listboxcombo/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "listboxcombo.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/listviews/main.cpp b/examples/listviews/main.cpp index e32831647..ee1c2a8a1 100644 --- a/examples/listviews/main.cpp +++ b/examples/listviews/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "listviews.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/mdi/application.cpp b/examples/mdi/application.cpp index 5d3cff556..33301eb8e 100644 --- a/examples/mdi/application.cpp +++ b/examples/mdi/application.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/mdi/main.cpp b/examples/mdi/main.cpp index 07fd5d76c..451f14f19 100644 --- a/examples/mdi/main.cpp +++ b/examples/mdi/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "application.h" int main( int argc, char ** argv ) { diff --git a/examples/menu/menu.cpp b/examples/menu/menu.cpp index 1c1af8f93..c36092790 100644 --- a/examples/menu/menu.cpp +++ b/examples/menu/menu.cpp @@ -10,7 +10,7 @@ #include "menu.h" #include #include -#include +#include #include #include #include diff --git a/examples/movies/main.cpp b/examples/movies/main.cpp index 39cc3e337..aab17832c 100644 --- a/examples/movies/main.cpp +++ b/examples/movies/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/network/archivesearch/archivedialog.ui b/examples/network/archivesearch/archivedialog.ui index 637961456..55b4a59b0 100644 --- a/examples/network/archivesearch/archivedialog.ui +++ b/examples/network/archivesearch/archivedialog.ui @@ -115,7 +115,7 @@ tqhttp.h tqurl.h tqmessagebox.h - ntqapplication.h + tqapplication.h tqcursor.h tqregexp.h archivedialog.ui.h diff --git a/examples/network/archivesearch/main.cpp b/examples/network/archivesearch/main.cpp index 53e7e9289..e2683ffe6 100644 --- a/examples/network/archivesearch/main.cpp +++ b/examples/network/archivesearch/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "archivedialog.h" -#include +#include int main(int argc, char **argv) { diff --git a/examples/network/clientserver/client/client.cpp b/examples/network/clientserver/client/client.cpp index 8e80a8a90..ce3d96767 100644 --- a/examples/network/clientserver/client/client.cpp +++ b/examples/network/clientserver/client/client.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/examples/network/clientserver/server/server.cpp b/examples/network/clientserver/server/server.cpp index 97a164ba7..9f8d82a7f 100644 --- a/examples/network/clientserver/server/server.cpp +++ b/examples/network/clientserver/server/server.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/examples/network/ftpclient/ftpmainwindow.ui.h b/examples/network/ftpclient/ftpmainwindow.ui.h index ce6ff78b2..8580b7b69 100644 --- a/examples/network/ftpclient/ftpmainwindow.ui.h +++ b/examples/network/ftpclient/ftpmainwindow.ui.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "connectdialog.h" #include "ftpviewitem.h" diff --git a/examples/network/ftpclient/main.cpp b/examples/network/ftpclient/main.cpp index 1a231a714..b743c5b2e 100644 --- a/examples/network/ftpclient/main.cpp +++ b/examples/network/ftpclient/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "ftpmainwindow.h" int main( int argc, char **argv ) diff --git a/examples/network/httpd/httpd.cpp b/examples/network/httpd/httpd.cpp index 722354cd6..dc65fb9e0 100644 --- a/examples/network/httpd/httpd.cpp +++ b/examples/network/httpd/httpd.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/network/infoprotocol/infoclient/client.cpp b/examples/network/infoprotocol/infoclient/client.cpp index eb35d96be..45d961136 100644 --- a/examples/network/infoprotocol/infoclient/client.cpp +++ b/examples/network/infoprotocol/infoclient/client.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/examples/network/infoprotocol/infoclient/main.cpp b/examples/network/infoprotocol/infoclient/main.cpp index 014887949..cd9fffbbc 100644 --- a/examples/network/infoprotocol/infoclient/main.cpp +++ b/examples/network/infoprotocol/infoclient/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "client.h" diff --git a/examples/network/infoprotocol/infoserver/main.cpp b/examples/network/infoprotocol/infoserver/main.cpp index ecb2a361f..b37776a7a 100644 --- a/examples/network/infoprotocol/infoserver/main.cpp +++ b/examples/network/infoprotocol/infoserver/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "server.h" diff --git a/examples/network/infoprotocol/infoserver/server.cpp b/examples/network/infoprotocol/infoserver/server.cpp index 7e69d9791..967115c46 100644 --- a/examples/network/infoprotocol/infoserver/server.cpp +++ b/examples/network/infoprotocol/infoserver/server.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/network/infoprotocol/infourlclient/client.cpp b/examples/network/infoprotocol/infourlclient/client.cpp index 29afa91c8..72b45ca28 100644 --- a/examples/network/infoprotocol/infourlclient/client.cpp +++ b/examples/network/infoprotocol/infourlclient/client.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/network/infoprotocol/infourlclient/main.cpp b/examples/network/infoprotocol/infourlclient/main.cpp index 08bd2e660..06824e5d9 100644 --- a/examples/network/infoprotocol/infourlclient/main.cpp +++ b/examples/network/infoprotocol/infourlclient/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "qip.h" #include "client.h" diff --git a/examples/network/mail/main.cpp b/examples/network/mail/main.cpp index c45a2a944..52393ad1c 100644 --- a/examples/network/mail/main.cpp +++ b/examples/network/mail/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "composer.h" diff --git a/examples/network/mail/smtp.cpp b/examples/network/mail/smtp.cpp index dd396ce2b..afc9879ee 100644 --- a/examples/network/mail/smtp.cpp +++ b/examples/network/mail/smtp.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/network/networkprotocol/main.cpp b/examples/network/networkprotocol/main.cpp index 76f8fce5a..0293f16c2 100644 --- a/examples/network/networkprotocol/main.cpp +++ b/examples/network/networkprotocol/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "nntp.h" diff --git a/examples/network/remotecontrol/ipcserver.cpp b/examples/network/remotecontrol/ipcserver.cpp index 80c340b8d..c6218e203 100644 --- a/examples/network/remotecontrol/ipcserver.cpp +++ b/examples/network/remotecontrol/ipcserver.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include class IpcSocket : public TQSocket { diff --git a/examples/network/remotecontrol/main.cpp b/examples/network/remotecontrol/main.cpp index 914d56855..437173088 100644 --- a/examples/network/remotecontrol/main.cpp +++ b/examples/network/remotecontrol/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "startup.h" diff --git a/examples/opengl/box/globjwin.cpp b/examples/opengl/box/globjwin.cpp index 3297504b0..624bad846 100644 --- a/examples/opengl/box/globjwin.cpp +++ b/examples/opengl/box/globjwin.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include "globjwin.h" #include "glbox.h" diff --git a/examples/opengl/box/main.cpp b/examples/opengl/box/main.cpp index 62b46122d..3f8ae251c 100644 --- a/examples/opengl/box/main.cpp +++ b/examples/opengl/box/main.cpp @@ -17,7 +17,7 @@ // #include "globjwin.h" -#include +#include #include /* diff --git a/examples/opengl/gear/gear.cpp b/examples/opengl/gear/gear.cpp index 6b901b47e..96152eedd 100644 --- a/examples/opengl/gear/gear.cpp +++ b/examples/opengl/gear/gear.cpp @@ -14,7 +14,7 @@ // #include -#include +#include #include #if defined(Q_CC_MSVC) diff --git a/examples/opengl/glpixmap/globjwin.cpp b/examples/opengl/glpixmap/globjwin.cpp index 28f2caf7e..0917110ff 100644 --- a/examples/opengl/glpixmap/globjwin.cpp +++ b/examples/opengl/glpixmap/globjwin.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/opengl/glpixmap/main.cpp b/examples/opengl/glpixmap/main.cpp index 4dd6665d1..aed08f22d 100644 --- a/examples/opengl/glpixmap/main.cpp +++ b/examples/opengl/glpixmap/main.cpp @@ -17,7 +17,7 @@ // #include "globjwin.h" -#include +#include #include /* diff --git a/examples/opengl/overlay/globjwin.cpp b/examples/opengl/overlay/globjwin.cpp index 1beb9f0e0..04ca2059c 100644 --- a/examples/opengl/overlay/globjwin.cpp +++ b/examples/opengl/overlay/globjwin.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "globjwin.h" #include "glteapots.h" diff --git a/examples/opengl/overlay/glteapots.cpp b/examples/opengl/overlay/glteapots.cpp index 6d0d5b568..83d4cc3a0 100644 --- a/examples/opengl/overlay/glteapots.cpp +++ b/examples/opengl/overlay/glteapots.cpp @@ -48,7 +48,7 @@ ****************************************************************************/ #include "glteapots.h" -#include +#include #if defined(Q_CC_MSVC) #pragma warning(disable:4305) // init: truncation from const double to float diff --git a/examples/opengl/overlay/main.cpp b/examples/opengl/overlay/main.cpp index 9e7d9c7b0..5fb9e06bb 100644 --- a/examples/opengl/overlay/main.cpp +++ b/examples/opengl/overlay/main.cpp @@ -17,7 +17,7 @@ // #include "globjwin.h" -#include +#include #include #include diff --git a/examples/opengl/overlay_x11/README.X11-OVERLAYS b/examples/opengl/overlay_x11/README.X11-OVERLAYS index 7d014bbca..83a2cd68b 100644 --- a/examples/opengl/overlay_x11/README.X11-OVERLAYS +++ b/examples/opengl/overlay_x11/README.X11-OVERLAYS @@ -61,7 +61,7 @@ color, so that the OpenGL image shows through except where explicitly overpainted. Note: To use this technique, you must not use the "ManyColor" or -"TrueColor" ColorSpec for the QApplication, because this will force +"TrueColor" ColorSpec for the TQApplication, because this will force the normal TQt widgets to use a TrueColor visual, which will typically be in the main plane, not in the overlay plane as desired. diff --git a/examples/opengl/overlay_x11/main.cpp b/examples/opengl/overlay_x11/main.cpp index dce8ffec9..e98e04074 100644 --- a/examples/opengl/overlay_x11/main.cpp +++ b/examples/opengl/overlay_x11/main.cpp @@ -10,7 +10,7 @@ ** *****************************************************************************/ -#include +#include #include "gearwidget.h" #include "rubberbandwidget.h" diff --git a/examples/opengl/sharedbox/globjwin.cpp b/examples/opengl/sharedbox/globjwin.cpp index ddf8c16d7..cc85082e3 100644 --- a/examples/opengl/sharedbox/globjwin.cpp +++ b/examples/opengl/sharedbox/globjwin.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include "globjwin.h" #include "glbox.h" diff --git a/examples/opengl/sharedbox/main.cpp b/examples/opengl/sharedbox/main.cpp index 4dd6665d1..aed08f22d 100644 --- a/examples/opengl/sharedbox/main.cpp +++ b/examples/opengl/sharedbox/main.cpp @@ -17,7 +17,7 @@ // #include "globjwin.h" -#include +#include #include /* diff --git a/examples/opengl/texture/globjwin.cpp b/examples/opengl/texture/globjwin.cpp index 363e8c2e2..7dd752afb 100644 --- a/examples/opengl/texture/globjwin.cpp +++ b/examples/opengl/texture/globjwin.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include "globjwin.h" #include "gltexobj.h" diff --git a/examples/opengl/texture/main.cpp b/examples/opengl/texture/main.cpp index 499e016e7..572049d10 100644 --- a/examples/opengl/texture/main.cpp +++ b/examples/opengl/texture/main.cpp @@ -15,7 +15,7 @@ // #include "globjwin.h" -#include +#include #include /* diff --git a/examples/picture/picture.cpp b/examples/picture/picture.cpp index acf305ad5..db8b164fe 100644 --- a/examples/picture/picture.cpp +++ b/examples/picture/picture.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/popup/popup.cpp b/examples/popup/popup.cpp index 17a2dae04..2da484310 100644 --- a/examples/popup/popup.cpp +++ b/examples/popup/popup.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "popup.h" -#include +#include #include FancyPopup::FancyPopup( TQWidget* parent, const char* name ): diff --git a/examples/process/process.cpp b/examples/process/process.cpp index 1365b5b0d..dcdc39e15 100644 --- a/examples/process/process.cpp +++ b/examples/process/process.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/progress/progress.cpp b/examples/progress/progress.cpp index 225e27b7b..02b4efd8a 100644 --- a/examples/progress/progress.cpp +++ b/examples/progress/progress.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/examples/progressbar/main.cpp b/examples/progressbar/main.cpp index 7ab78c69e..7dcf14647 100644 --- a/examples/progressbar/main.cpp +++ b/examples/progressbar/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "progressbar.h" -#include +#include int main(int argc,char **argv) { diff --git a/examples/qfd/fontdisplayer.cpp b/examples/qfd/fontdisplayer.cpp index 6d6de8c26..331261dcc 100644 --- a/examples/qfd/fontdisplayer.cpp +++ b/examples/qfd/fontdisplayer.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "fontdisplayer.h" -#include +#include #include #include #include diff --git a/examples/qfd/qfd.cpp b/examples/qfd/qfd.cpp index d5e3dd84d..f334e7ccb 100644 --- a/examples/qfd/qfd.cpp +++ b/examples/qfd/qfd.cpp @@ -9,7 +9,7 @@ #include "fontdisplayer.h" -#include +#include #include #include #include diff --git a/examples/qmag/qmag.cpp b/examples/qmag/qmag.cpp index efca57ef7..9b648a5a2 100644 --- a/examples/qmag/qmag.cpp +++ b/examples/qmag/qmag.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include diff --git a/examples/qwerty/main.cpp b/examples/qwerty/main.cpp index 90a1c0d45..0b4d8ea3d 100644 --- a/examples/qwerty/main.cpp +++ b/examples/qwerty/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "qwerty.h" diff --git a/examples/qwerty/qwerty.cpp b/examples/qwerty/qwerty.cpp index c6f363811..368d12d95 100644 --- a/examples/qwerty/qwerty.cpp +++ b/examples/qwerty/qwerty.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "qwerty.h" -#include +#include #include #include #include diff --git a/examples/rangecontrols/main.cpp b/examples/rangecontrols/main.cpp index 091163cc5..5d60bdbf5 100644 --- a/examples/rangecontrols/main.cpp +++ b/examples/rangecontrols/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "rangecontrols.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/regexptester/main.cpp b/examples/regexptester/main.cpp index c52c8373b..a31305feb 100644 --- a/examples/regexptester/main.cpp +++ b/examples/regexptester/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "regexptester.h" int main(int argc, char **argv) diff --git a/examples/regexptester/regexptester.cpp b/examples/regexptester/regexptester.cpp index 96fabcdb4..0c4e2f3e5 100644 --- a/examples/regexptester/regexptester.cpp +++ b/examples/regexptester/regexptester.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/examples/richtext/main.cpp b/examples/richtext/main.cpp index d8aa15746..89b0f6ea9 100644 --- a/examples/richtext/main.cpp +++ b/examples/richtext/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "richtext.h" -#include +#include int main( int argc, char **argv ) { diff --git a/examples/richtext/richtext.cpp b/examples/richtext/richtext.cpp index dea4366c4..3e8d4811b 100644 --- a/examples/richtext/richtext.cpp +++ b/examples/richtext/richtext.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include static const char* sayings[] = { "Saying 1:
      " diff --git a/examples/rot13/rot13.cpp b/examples/rot13/rot13.cpp index 4fb44d167..e7daf7ed1 100644 --- a/examples/rot13/rot13.cpp +++ b/examples/rot13/rot13.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include Rot13::Rot13() diff --git a/examples/scribble/main.cpp b/examples/scribble/main.cpp index 962f75b97..705a197a4 100644 --- a/examples/scribble/main.cpp +++ b/examples/scribble/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "scribble.h" -#include +#include int main( int argc, char **argv ) diff --git a/examples/scribble/scribble.cpp b/examples/scribble/scribble.cpp index 04f931421..e5a5651a8 100644 --- a/examples/scribble/scribble.cpp +++ b/examples/scribble/scribble.cpp @@ -9,7 +9,7 @@ #include "scribble.h" -#include +#include #include #include #include diff --git a/examples/scrollview/scrollview.cpp b/examples/scrollview/scrollview.cpp index 0eacabe58..41eb117fe 100644 --- a/examples/scrollview/scrollview.cpp +++ b/examples/scrollview/scrollview.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/examples/showimg/main.cpp b/examples/showimg/main.cpp index 63a8d2216..c5ac5defc 100644 --- a/examples/showimg/main.cpp +++ b/examples/showimg/main.cpp @@ -9,7 +9,7 @@ #include "showimg.h" #include "imagefip.h" -#include +#include #include int main( int argc, char **argv ) diff --git a/examples/showimg/showimg.cpp b/examples/showimg/showimg.cpp index 52e2576e0..09baf5c9f 100644 --- a/examples/showimg/showimg.cpp +++ b/examples/showimg/showimg.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include diff --git a/examples/sound/sound.cpp b/examples/sound/sound.cpp index 8333f464e..c350a4107 100644 --- a/examples/sound/sound.cpp +++ b/examples/sound/sound.cpp @@ -14,7 +14,7 @@ // #include "sound.h" -#include +#include #include #include diff --git a/examples/splitter/splitter.cpp b/examples/splitter/splitter.cpp index cb43f1c0f..b160aa76b 100644 --- a/examples/splitter/splitter.cpp +++ b/examples/splitter/splitter.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/blob/main.cpp b/examples/sql/blob/main.cpp index 21b2845eb..029696ad8 100644 --- a/examples/sql/blob/main.cpp +++ b/examples/sql/blob/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/basicbrowsing/main.cpp b/examples/sql/overview/basicbrowsing/main.cpp index 5485ef5a4..d5c25981b 100644 --- a/examples/sql/overview/basicbrowsing/main.cpp +++ b/examples/sql/overview/basicbrowsing/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/basicbrowsing2/main.cpp b/examples/sql/overview/basicbrowsing2/main.cpp index f70915cdc..2eebd53cf 100644 --- a/examples/sql/overview/basicbrowsing2/main.cpp +++ b/examples/sql/overview/basicbrowsing2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/basicdatamanip/main.cpp b/examples/sql/overview/basicdatamanip/main.cpp index f6be7828f..b3204abdc 100644 --- a/examples/sql/overview/basicdatamanip/main.cpp +++ b/examples/sql/overview/basicdatamanip/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/connect1/main.cpp b/examples/sql/overview/connect1/main.cpp index 87c15975f..cb195aafd 100644 --- a/examples/sql/overview/connect1/main.cpp +++ b/examples/sql/overview/connect1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "../connection.h" diff --git a/examples/sql/overview/create_connections/main.cpp b/examples/sql/overview/create_connections/main.cpp index 9d8197619..9cd10689f 100644 --- a/examples/sql/overview/create_connections/main.cpp +++ b/examples/sql/overview/create_connections/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "../connection.h" diff --git a/examples/sql/overview/custom1/main.h b/examples/sql/overview/custom1/main.h index d7878c528..fe397c689 100644 --- a/examples/sql/overview/custom1/main.h +++ b/examples/sql/overview/custom1/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/delete/main.cpp b/examples/sql/overview/delete/main.cpp index a9c2697cb..d0b36db37 100644 --- a/examples/sql/overview/delete/main.cpp +++ b/examples/sql/overview/delete/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/extract/main.cpp b/examples/sql/overview/extract/main.cpp index 38da57b1e..bc20ab6a6 100644 --- a/examples/sql/overview/extract/main.cpp +++ b/examples/sql/overview/extract/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/form1/main.cpp b/examples/sql/overview/form1/main.cpp index 73069a64e..d08b5c110 100644 --- a/examples/sql/overview/form1/main.cpp +++ b/examples/sql/overview/form1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/form2/main.h b/examples/sql/overview/form2/main.h index 4e1122605..212c77429 100644 --- a/examples/sql/overview/form2/main.h +++ b/examples/sql/overview/form2/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/insert/main.cpp b/examples/sql/overview/insert/main.cpp index c90072fb5..a5933a4b7 100644 --- a/examples/sql/overview/insert/main.cpp +++ b/examples/sql/overview/insert/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/insert2/main.cpp b/examples/sql/overview/insert2/main.cpp index e7ff98ade..c411d3f55 100644 --- a/examples/sql/overview/insert2/main.cpp +++ b/examples/sql/overview/insert2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/navigating/main.cpp b/examples/sql/overview/navigating/main.cpp index 3dcc274a1..a9cacab3c 100644 --- a/examples/sql/overview/navigating/main.cpp +++ b/examples/sql/overview/navigating/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/order1/main.cpp b/examples/sql/overview/order1/main.cpp index d114a7c2a..291094e50 100644 --- a/examples/sql/overview/order1/main.cpp +++ b/examples/sql/overview/order1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/order2/main.cpp b/examples/sql/overview/order2/main.cpp index 7e473708f..e098f47f8 100644 --- a/examples/sql/overview/order2/main.cpp +++ b/examples/sql/overview/order2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/retrieve1/main.cpp b/examples/sql/overview/retrieve1/main.cpp index 3b746c273..d6d4f0db3 100644 --- a/examples/sql/overview/retrieve1/main.cpp +++ b/examples/sql/overview/retrieve1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/retrieve2/main.cpp b/examples/sql/overview/retrieve2/main.cpp index baa9d8543..4f4e1e234 100644 --- a/examples/sql/overview/retrieve2/main.cpp +++ b/examples/sql/overview/retrieve2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/subclass1/main.cpp b/examples/sql/overview/subclass1/main.cpp index 4ecb394bd..d167e3fe2 100644 --- a/examples/sql/overview/subclass1/main.cpp +++ b/examples/sql/overview/subclass1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/subclass2/main.h b/examples/sql/overview/subclass2/main.h index 3d4f2951a..c3047ee92 100644 --- a/examples/sql/overview/subclass2/main.h +++ b/examples/sql/overview/subclass2/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/subclass3/main.h b/examples/sql/overview/subclass3/main.h index b9138b85e..f888f83bc 100644 --- a/examples/sql/overview/subclass3/main.h +++ b/examples/sql/overview/subclass3/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/subclass4/main.h b/examples/sql/overview/subclass4/main.h index b9138b85e..f888f83bc 100644 --- a/examples/sql/overview/subclass4/main.h +++ b/examples/sql/overview/subclass4/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/overview/subclass5/main.h b/examples/sql/overview/subclass5/main.h index 13d3b3697..64d71c90b 100644 --- a/examples/sql/overview/subclass5/main.h +++ b/examples/sql/overview/subclass5/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/table1/main.cpp b/examples/sql/overview/table1/main.cpp index 72b84b1cc..d7e4eea5a 100644 --- a/examples/sql/overview/table1/main.cpp +++ b/examples/sql/overview/table1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/table2/main.cpp b/examples/sql/overview/table2/main.cpp index 8b8fcb176..35515a6a0 100644 --- a/examples/sql/overview/table2/main.cpp +++ b/examples/sql/overview/table2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/table3/main.h b/examples/sql/overview/table3/main.h index b93e94b1d..546600bd8 100644 --- a/examples/sql/overview/table3/main.h +++ b/examples/sql/overview/table3/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/table4/main.h b/examples/sql/overview/table4/main.h index 46cbdc71d..d1d81894d 100644 --- a/examples/sql/overview/table4/main.h +++ b/examples/sql/overview/table4/main.h @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/sql/overview/update/main.cpp b/examples/sql/overview/update/main.cpp index e4782d8b1..389721634 100644 --- a/examples/sql/overview/update/main.cpp +++ b/examples/sql/overview/update/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include "../connection.h" diff --git a/examples/sql/sqltable/main.cpp b/examples/sql/sqltable/main.cpp index 86f6ac898..29cebe51b 100644 --- a/examples/sql/sqltable/main.cpp +++ b/examples/sql/sqltable/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/tabdialog/main.cpp b/examples/tabdialog/main.cpp index 45af41623..1cfd671b2 100644 --- a/examples/tabdialog/main.cpp +++ b/examples/tabdialog/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "tabdialog.h" -#include +#include #include int main( int argc, char **argv ) diff --git a/examples/tabdialog/tabdialog.cpp b/examples/tabdialog/tabdialog.cpp index 1d4059901..d9029063b 100644 --- a/examples/tabdialog/tabdialog.cpp +++ b/examples/tabdialog/tabdialog.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include TabDialog::TabDialog( TQWidget *parent, const char *name, const TQString &_filename ) : TQTabDialog( parent, name ), filename( _filename ), fileinfo( filename ) diff --git a/examples/table/bigtable/main.cpp b/examples/table/bigtable/main.cpp index 3bb5b9f71..94f4b3621 100644 --- a/examples/table/bigtable/main.cpp +++ b/examples/table/bigtable/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include // Table size diff --git a/examples/table/small-table-demo/main.cpp b/examples/table/small-table-demo/main.cpp index fbd577f85..896a6e54f 100644 --- a/examples/table/small-table-demo/main.cpp +++ b/examples/table/small-table-demo/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/table/statistics/main.cpp b/examples/table/statistics/main.cpp index 1b09b75f0..25098e89b 100644 --- a/examples/table/statistics/main.cpp +++ b/examples/table/statistics/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "statistics.h" -#include +#include int main( int argc, char **argv ) { TQApplication a(argc,argv); diff --git a/examples/tablet/canvas.cpp b/examples/tablet/canvas.cpp index cccf38ace..4ef7d0040 100644 --- a/examples/tablet/canvas.cpp +++ b/examples/tablet/canvas.cpp @@ -9,7 +9,7 @@ #include "canvas.h" -#include +#include #include #include #include diff --git a/examples/tablet/main.cpp b/examples/tablet/main.cpp index 0524cac21..8ae5c850b 100644 --- a/examples/tablet/main.cpp +++ b/examples/tablet/main.cpp @@ -9,7 +9,7 @@ #include "scribble.h" #include "tabletstats.h" -#include +#include #include diff --git a/examples/tablet/scribble.cpp b/examples/tablet/scribble.cpp index df1968c70..b3a98190c 100644 --- a/examples/tablet/scribble.cpp +++ b/examples/tablet/scribble.cpp @@ -10,7 +10,7 @@ #include "canvas.h" #include "scribble.h" -#include +#include #include #include #include diff --git a/examples/tetrix/qtetrix.cpp b/examples/tetrix/qtetrix.cpp index 24ee17139..868c4fddc 100644 --- a/examples/tetrix/qtetrix.cpp +++ b/examples/tetrix/qtetrix.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "qtetrix.h" -#include +#include #include #include diff --git a/examples/tetrix/tqdragapp.h b/examples/tetrix/tqdragapp.h index c710bd974..263f16577 100644 --- a/examples/tetrix/tqdragapp.h +++ b/examples/tetrix/tqdragapp.h @@ -10,7 +10,7 @@ #ifndef TQDRAGAPP_H #define TQDRAGAPP_H -#include "ntqapplication.h" +#include "tqapplication.h" class TQDragger; diff --git a/examples/textedit/main.cpp b/examples/textedit/main.cpp index afa86f3dc..e4ec47648 100644 --- a/examples/textedit/main.cpp +++ b/examples/textedit/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "textedit.h" int main( int argc, char ** argv ) diff --git a/examples/textedit/textedit.cpp b/examples/textedit/textedit.cpp index 34d9a2a41..afcb0a4e8 100644 --- a/examples/textedit/textedit.cpp +++ b/examples/textedit/textedit.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/themes/main.cpp b/examples/themes/main.cpp index 74ea035a7..0ba0080bf 100644 --- a/examples/themes/main.cpp +++ b/examples/themes/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "themes.h" diff --git a/examples/themes/metal.cpp b/examples/themes/metal.cpp index 9d0e6fc2a..19ec19ff3 100644 --- a/examples/themes/metal.cpp +++ b/examples/themes/metal.cpp @@ -11,7 +11,7 @@ #ifndef TQT_NO_STYLE_WINDOWS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcombobox.h" #include "tqpainter.h" #include "tqdrawutil.h" // for now diff --git a/examples/themes/themes.cpp b/examples/themes/themes.cpp index 396354ce7..be0751f5b 100644 --- a/examples/themes/themes.cpp +++ b/examples/themes/themes.cpp @@ -20,7 +20,7 @@ #include "../richtext/richtext.h" #include -#include +#include #include #include #include diff --git a/examples/themes/wood.cpp b/examples/themes/wood.cpp index b9ce0c89f..50e191975 100644 --- a/examples/themes/wood.cpp +++ b/examples/themes/wood.cpp @@ -11,7 +11,7 @@ #ifndef TQT_NO_STYLE_WINDOWS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcombobox.h" #include "tqpainter.h" #include "tqdrawutil.h" // for now diff --git a/examples/thread/prodcons/prodcons.cpp b/examples/thread/prodcons/prodcons.cpp index ed980d551..cea949940 100644 --- a/examples/thread/prodcons/prodcons.cpp +++ b/examples/thread/prodcons/prodcons.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/thread/semaphores/main.cpp b/examples/thread/semaphores/main.cpp index ea32cca60..76d3599ea 100644 --- a/examples/thread/semaphores/main.cpp +++ b/examples/thread/semaphores/main.cpp @@ -6,7 +6,7 @@ ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ -#include +#include #include #include #include diff --git a/examples/tictac/main.cpp b/examples/tictac/main.cpp index 5ea8e1a36..87e5688c1 100644 --- a/examples/tictac/main.cpp +++ b/examples/tictac/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "tictac.h" diff --git a/examples/tictac/tictac.cpp b/examples/tictac/tictac.cpp index 613aa93a9..dec6fe33c 100644 --- a/examples/tictac/tictac.cpp +++ b/examples/tictac/tictac.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "tictac.h" -#include +#include #include #include #include diff --git a/examples/tooltip/main.cpp b/examples/tooltip/main.cpp index 78313a4d1..da92da605 100644 --- a/examples/tooltip/main.cpp +++ b/examples/tooltip/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "tooltip.h" int main( int argc, char ** argv ) diff --git a/examples/tooltip/tooltip.cpp b/examples/tooltip/tooltip.cpp index d7406fa88..897b7c654 100644 --- a/examples/tooltip/tooltip.cpp +++ b/examples/tooltip/tooltip.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "tooltip.h" -#include +#include #include #include diff --git a/examples/toplevel/main.cpp b/examples/toplevel/main.cpp index f8742fd2a..dcc979485 100644 --- a/examples/toplevel/main.cpp +++ b/examples/toplevel/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "options.h" int main( int argc, char ** argv ) diff --git a/examples/tqdir/tqdir.cpp b/examples/tqdir/tqdir.cpp index 0ea524713..dc087f73a 100644 --- a/examples/tqdir/tqdir.cpp +++ b/examples/tqdir/tqdir.cpp @@ -10,7 +10,7 @@ #include "../dirview/dirview.h" #include "tqdir.h" -#include +#include #include #include #include diff --git a/examples/tux/tux.cpp b/examples/tux/tux.cpp index 3a25b6228..36e116ec7 100644 --- a/examples/tux/tux.cpp +++ b/examples/tux/tux.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/examples/widgets/main.cpp b/examples/widgets/main.cpp index b09ada41a..e72a28237 100644 --- a/examples/widgets/main.cpp +++ b/examples/widgets/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "widgets.h" diff --git a/examples/widgets/widgets.cpp b/examples/widgets/widgets.cpp index 9ceabd8bf..e98a52b50 100644 --- a/examples/widgets/widgets.cpp +++ b/examples/widgets/widgets.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include // Standard TQt widgets diff --git a/examples/wizard/main.cpp b/examples/wizard/main.cpp index 3f08e99e9..f49c18303 100644 --- a/examples/wizard/main.cpp +++ b/examples/wizard/main.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "wizard.h" -#include +#include int main(int argc,char **argv) { diff --git a/examples/wizard/wizard.cpp b/examples/wizard/wizard.cpp index 62d4226e9..88da99e8a 100644 --- a/examples/wizard/wizard.cpp +++ b/examples/wizard/wizard.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include Wizard::Wizard( TQWidget *parent, const char *name ) : TQWizard( parent, name, TRUE ) diff --git a/examples/xform/xform.cpp b/examples/xform/xform.cpp index 71a4eed86..41bfb74d4 100644 --- a/examples/xform/xform.cpp +++ b/examples/xform/xform.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include diff --git a/examples/xml/outliner/main.cpp b/examples/xml/outliner/main.cpp index 0f7848e44..de234f410 100644 --- a/examples/xml/outliner/main.cpp +++ b/examples/xml/outliner/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "outlinetree.h" int main( int argc, char **argv ) diff --git a/examples/xml/tagreader-with-features/tagreader.cpp b/examples/xml/tagreader-with-features/tagreader.cpp index 7e7aa5f13..9715ef8a5 100644 --- a/examples/xml/tagreader-with-features/tagreader.cpp +++ b/examples/xml/tagreader-with-features/tagreader.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "structureparser.h" -#include +#include #include #include #include diff --git a/include/ntqapplication.h b/include/ntqapplication.h deleted file mode 120000 index 7199f5958..000000000 --- a/include/ntqapplication.h +++ /dev/null @@ -1 +0,0 @@ -../src/kernel/ntqapplication.h \ No newline at end of file diff --git a/include/private/qapplication_p.h b/include/private/qapplication_p.h deleted file mode 120000 index fe8446e40..000000000 --- a/include/private/qapplication_p.h +++ /dev/null @@ -1 +0,0 @@ -../../src/kernel/qapplication_p.h \ No newline at end of file diff --git a/include/private/tqapplication_p.h b/include/private/tqapplication_p.h new file mode 120000 index 000000000..b4f919e2a --- /dev/null +++ b/include/private/tqapplication_p.h @@ -0,0 +1 @@ +../../src/kernel/tqapplication_p.h \ No newline at end of file diff --git a/include/qconfig-dist.h b/include/qconfig-dist.h deleted file mode 120000 index b5530b913..000000000 --- a/include/qconfig-dist.h +++ /dev/null @@ -1 +0,0 @@ -../src/tools/qconfig-dist.h \ No newline at end of file diff --git a/include/qconfig-large.h b/include/qconfig-large.h deleted file mode 120000 index 9964ee677..000000000 --- a/include/qconfig-large.h +++ /dev/null @@ -1 +0,0 @@ -../src/tools/qconfig-large.h \ No newline at end of file diff --git a/include/qconfig-medium.h b/include/qconfig-medium.h deleted file mode 120000 index 58c70bf2e..000000000 --- a/include/qconfig-medium.h +++ /dev/null @@ -1 +0,0 @@ -../src/tools/qconfig-medium.h \ No newline at end of file diff --git a/include/qconfig-minimal.h b/include/qconfig-minimal.h deleted file mode 120000 index 40f6bc36c..000000000 --- a/include/qconfig-minimal.h +++ /dev/null @@ -1 +0,0 @@ -../src/tools/qconfig-minimal.h \ No newline at end of file diff --git a/include/qconfig-small.h b/include/qconfig-small.h deleted file mode 120000 index ed3ee45a2..000000000 --- a/include/qconfig-small.h +++ /dev/null @@ -1 +0,0 @@ -../src/tools/qconfig-small.h \ No newline at end of file diff --git a/include/tqapplication.h b/include/tqapplication.h new file mode 120000 index 000000000..cc0178e08 --- /dev/null +++ b/include/tqapplication.h @@ -0,0 +1 @@ +../src/kernel/tqapplication.h \ No newline at end of file diff --git a/include/tqconfig-dist.h b/include/tqconfig-dist.h new file mode 120000 index 000000000..1fef17007 --- /dev/null +++ b/include/tqconfig-dist.h @@ -0,0 +1 @@ +../src/tools/tqconfig-dist.h \ No newline at end of file diff --git a/include/tqconfig-large.h b/include/tqconfig-large.h new file mode 120000 index 000000000..cc46c60c0 --- /dev/null +++ b/include/tqconfig-large.h @@ -0,0 +1 @@ +../src/tools/tqconfig-large.h \ No newline at end of file diff --git a/include/tqconfig-medium.h b/include/tqconfig-medium.h new file mode 120000 index 000000000..c4e2e520c --- /dev/null +++ b/include/tqconfig-medium.h @@ -0,0 +1 @@ +../src/tools/tqconfig-medium.h \ No newline at end of file diff --git a/include/tqconfig-minimal.h b/include/tqconfig-minimal.h new file mode 120000 index 000000000..4d494b3e6 --- /dev/null +++ b/include/tqconfig-minimal.h @@ -0,0 +1 @@ +../src/tools/tqconfig-minimal.h \ No newline at end of file diff --git a/include/tqconfig-small.h b/include/tqconfig-small.h new file mode 120000 index 000000000..80bdbdc68 --- /dev/null +++ b/include/tqconfig-small.h @@ -0,0 +1 @@ +../src/tools/tqconfig-small.h \ No newline at end of file diff --git a/plugins/src/accessible/widgets/tqaccessiblewidget.cpp b/plugins/src/accessible/widgets/tqaccessiblewidget.cpp index 232ff05f8..6c5f30307 100644 --- a/plugins/src/accessible/widgets/tqaccessiblewidget.cpp +++ b/plugins/src/accessible/widgets/tqaccessiblewidget.cpp @@ -1,6 +1,6 @@ #include "tqaccessiblewidget.h" -#include +#include #include #include #include diff --git a/plugins/src/codecs/cn/main.cpp b/plugins/src/codecs/cn/main.cpp index 4263b5745..3c9064c6a 100644 --- a/plugins/src/codecs/cn/main.cpp +++ b/plugins/src/codecs/cn/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include diff --git a/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp b/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp index c9c7b6a52..33822a2b0 100644 --- a/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp +++ b/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp @@ -45,7 +45,7 @@ const int XKeyRelease = KeyRelease; #include "qplatformdefs.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidget.h" #include "tqstring.h" #include "tqptrlist.h" @@ -63,7 +63,7 @@ const int XKeyRelease = KeyRelease; // #define QT_XIM_DEBUG -// from qapplication_x11.cpp +// from tqapplication_x11.cpp static XIM qt_xim = 0; extern XIMStyle qt_xim_style; extern XIMStyle qt_xim_preferred_style; diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index cf47f314b..d689cd863 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -9,7 +9,7 @@ QOBJS=tqstring.o tqtextstream.o tqiodevice.o tqglobal.o tqgdict.o tqcstring.o \ tqdatastream.o tqgarray.o tqbuffer.o tqglist.o tqptrcollection.o tqfile.o \ tqfile_unix.o tqregexp.o tqgvector.o tqgcache.o tqbitarray.o tqdir.o tquuid.o \ tqfileinfo_unix.o tqdir_unix.o tqfileinfo.o tqdatetime.o tqstringlist.o tqmap.o \ - qconfig.o tqunicodetables.o tqsettings.o tqlocale.o @QMAKE_QTOBJS@ + tqconfig.o tqunicodetables.o tqsettings.o tqlocale.o @QMAKE_QTOBJS@ #all sources, used for the depend target DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp qtmd5.cpp generators/makefile.cpp generators/unix/unixmake2.cpp \ @@ -28,7 +28,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp qtmd5.cpp generators/makef @SOURCE_PATH@/src/tools/tquuid.cpp @SOURCE_PATH@/src/tools/tqfileinfo_unix.cpp \ @SOURCE_PATH@/src/tools/tqdir_unix.cpp @SOURCE_PATH@/src/tools/tqfileinfo.cpp \ @SOURCE_PATH@/src/tools/tqdatetime.cpp @SOURCE_PATH@/src/tools/tqstringlist.cpp \ - @SOURCE_PATH@/src/tools/tqmap.cpp @SOURCE_PATH@/src/tools/qconfig.cpp \ + @SOURCE_PATH@/src/tools/tqmap.cpp @SOURCE_PATH@/src/tools/tqconfig.cpp \ @SOURCE_PATH@/src/tools/tqsettings.cpp @SOURCE_PATH@/src/tools/tqurl.cpp \ @SOURCE_PATH@/src/tools/tqsettings_mac.cpp @SOURCE_PATH@/src/tools/tqlocale.cpp @@ -150,8 +150,8 @@ tqstringlist.o: @SOURCE_PATH@/src/tools/tqstringlist.cpp tqmap.o: @SOURCE_PATH@/src/tools/tqmap.cpp $(CXX) -c -o $@ $(CXXFLAGS) @SOURCE_PATH@/src/tools/tqmap.cpp -qconfig.o: @BUILD_PATH@/src/tools/qconfig.cpp - $(CXX) -c -o $@ $(CXXFLAGS) @BUILD_PATH@/src/tools/qconfig.cpp +tqconfig.o: @BUILD_PATH@/src/tools/tqconfig.cpp + $(CXX) -c -o $@ $(CXXFLAGS) @BUILD_PATH@/src/tools/tqconfig.cpp winmakefile.o: generators/win32/winmakefile.cpp $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/winmakefile.cpp diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index cfb7b43d2..74fd9a5f7 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -22,7 +22,7 @@ OBJS=project.o main.o makefile.o unixmake.o unixmake2.o borland_bmake.o mingw_ma QTOBJS=tqstring.o tquuid.o tqtextstream.o tqiodevice.o tqglobal.o tqgdict.o tqcstring.o tqdatastream.o \ tqgarray.o tqbuffer.o tqglist.o tqptrcollection.o tqfile.o tqfile_win.o tqregexp.o tqgvector.o \ tqgcache.o tqbitarray.o tqdir.o tqfileinfo_win.o tqdir_win.o tqfileinfo.o tqdatetime.o \ - tqstringlist.o tqmap.o tqlibrary.o tqlibrary_win.o qconfig.o tqsettings.o tqsettings_win.o tqunicodetables.o \ + tqstringlist.o tqmap.o tqlibrary.o tqlibrary_win.o tqconfig.o tqsettings.o tqsettings_win.o tqunicodetables.o \ tqlocale.o @@ -43,8 +43,8 @@ distclean:: clean .cpp.o: $(CXX) $(CXXFLAGS) $< -qconfig.o: ..\src\tools\qconfig.cpp - $(CXX) $(CXXFLAGS) ..\src\tools\qconfig.cpp +tqconfig.o: ..\src\tools\tqconfig.cpp + $(CXX) $(CXXFLAGS) ..\src\tools\tqconfig.cpp tqlibrary.o: ..\src\tools\tqlibrary.cpp $(CXX) $(CXXFLAGS) ..\src\tools\tqlibrary.cpp diff --git a/qmake/book/qmake-pch.leaf b/qmake/book/qmake-pch.leaf index f848c2c22..616e1004a 100644 --- a/qmake/book/qmake-pch.leaf +++ b/qmake/book/qmake-pch.leaf @@ -56,7 +56,7 @@ like this: #include #include #include - #include // TQt includes + #include // TQt includes #include #include #include "thirdparty/include/libmain.h" diff --git a/qmake/examples/precompile/main.cpp b/qmake/examples/precompile/main.cpp index 37ffa3492..0c8218040 100644 --- a/qmake/examples/precompile/main.cpp +++ b/qmake/examples/precompile/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include "myobject.h" diff --git a/qmake/examples/precompile/stable.h b/qmake/examples/precompile/stable.h index ade98ba33..a62e50179 100644 --- a/qmake/examples/precompile/stable.h +++ b/qmake/examples/precompile/stable.h @@ -4,7 +4,7 @@ /* Add C++ includes here */ # include -# include +# include # include # include #endif diff --git a/qmake/examples/tutorial/main.cpp b/qmake/examples/tutorial/main.cpp index 70015ff41..a908c9710 100644 --- a/qmake/examples/tutorial/main.cpp +++ b/qmake/examples/tutorial/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "hello.h" int main( int argc, char **argv ) diff --git a/src/3rdparty/sqlite/config.h b/src/3rdparty/sqlite/config.h index 0a06d8eb6..d1ed89897 100644 --- a/src/3rdparty/sqlite/config.h +++ b/src/3rdparty/sqlite/config.h @@ -1,5 +1,5 @@ #include -#include +#include #ifndef TQT_POINTER_SIZE # ifdef Q_OS_WIN32 diff --git a/src/3rdparty/sqlite/trolltech.patch b/src/3rdparty/sqlite/trolltech.patch index 715155b46..6c9ca90bd 100644 --- a/src/3rdparty/sqlite/trolltech.patch +++ b/src/3rdparty/sqlite/trolltech.patch @@ -4,7 +4,7 @@ diff -du ./config.h /home/harald/troll/qt-3.3/src/3rdparty/sqlite/config.h @@ -1 +1,23 @@ -#define SQLITE_PTR_SZ 4 +#include -+#include ++#include + +#ifndef TQT_POINTER_SIZE +# ifdef Q_OS_WIN32 diff --git a/src/canvas/tqcanvas.cpp b/src/canvas/tqcanvas.cpp index d784553e4..7b32564ed 100644 --- a/src/canvas/tqcanvas.cpp +++ b/src/canvas/tqcanvas.cpp @@ -40,7 +40,7 @@ #include "tqcanvas.h" #ifndef TQT_NO_CANVAS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitmap.h" #include "tqimage.h" #include "tqptrdict.h" diff --git a/src/codecs/tqtextcodecfactory.cpp b/src/codecs/tqtextcodecfactory.cpp index 36782644f..b3895360c 100644 --- a/src/codecs/tqtextcodecfactory.cpp +++ b/src/codecs/tqtextcodecfactory.cpp @@ -43,7 +43,7 @@ #ifndef TQT_NO_TEXTCODEC #ifndef TQT_NO_COMPONENT -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcleanuphandler.h" #include #include "tqtextcodecinterface_p.h" diff --git a/src/dialogs/tqcolordialog.cpp b/src/dialogs/tqcolordialog.cpp index feaefb010..43e77866f 100644 --- a/src/dialogs/tqcolordialog.cpp +++ b/src/dialogs/tqcolordialog.cpp @@ -53,7 +53,7 @@ #include "tqvalidator.h" #include "tqdragobject.h" #include "tqgridview.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqsettings.h" #include "tqpopupmenu.h" diff --git a/src/dialogs/tqdialog.cpp b/src/dialogs/tqdialog.cpp index 919a1ed38..277a1b4ca 100644 --- a/src/dialogs/tqdialog.cpp +++ b/src/dialogs/tqdialog.cpp @@ -44,7 +44,7 @@ #include "tqpushbutton.h" #include "tqfocusdata.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqobjectlist.h" #include "tqwidgetlist.h" #include "tqlayout.h" @@ -675,7 +675,7 @@ bool TQDialog::event( TQEvent *e ) extern "C" { int XSetTransientForHint( Display *, unsigned long, unsigned long ); } #include #undef FocusIn -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern Atom qt_net_wm_full_placement; extern bool qt_net_supports(Atom atom); #endif // TQ_WS_X11 diff --git a/src/dialogs/tqerrormessage.cpp b/src/dialogs/tqerrormessage.cpp index f99db2c7a..12013b0f6 100644 --- a/src/dialogs/tqerrormessage.cpp +++ b/src/dialogs/tqerrormessage.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_ERRORMESSAGE -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcheckbox.h" #include "tqdict.h" #include "tqlabel.h" diff --git a/src/dialogs/tqfiledialog.cpp b/src/dialogs/tqfiledialog.cpp index 23a6d7f12..de4754ec4 100644 --- a/src/dialogs/tqfiledialog.cpp +++ b/src/dialogs/tqfiledialog.cpp @@ -54,8 +54,8 @@ #ifndef TQT_NO_FILEDIALOG -#include "private/qapplication_p.h" -#include "ntqapplication.h" +#include "private/tqapplication_p.h" +#include "tqapplication.h" #include "tqbitmap.h" #include "tqbuttongroup.h" #include "tqcheckbox.h" @@ -3405,7 +3405,7 @@ void TQFileDialog::rereadDir() \sa selectedFilter() */ -extern bool tqt_resolve_symlinks; // defined in qapplication.cpp +extern bool tqt_resolve_symlinks; // defined in tqapplication.cpp bool TQ_EXPORT tqt_use_native_dialogs = TRUE; /*! diff --git a/src/dialogs/tqfontdialog.cpp b/src/dialogs/tqfontdialog.cpp index 0fb122cee..40c9f3de5 100644 --- a/src/dialogs/tqfontdialog.cpp +++ b/src/dialogs/tqfontdialog.cpp @@ -53,7 +53,7 @@ #include "tqvgroupbox.h" #include "tqhgroupbox.h" #include "tqlabel.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqfontdatabase.h" #include "tqstyle.h" #include diff --git a/src/dialogs/tqinputdialog.cpp b/src/dialogs/tqinputdialog.cpp index b23bbaeaf..a58d9a2dc 100644 --- a/src/dialogs/tqinputdialog.cpp +++ b/src/dialogs/tqinputdialog.cpp @@ -50,7 +50,7 @@ #include "tqcombobox.h" #include "tqwidgetstack.h" #include "tqvalidator.h" -#include "ntqapplication.h" +#include "tqapplication.h" class TQInputDialogPrivate { diff --git a/src/dialogs/tqmessagebox.cpp b/src/dialogs/tqmessagebox.cpp index 2a7178260..b90840cf7 100644 --- a/src/dialogs/tqmessagebox.cpp +++ b/src/dialogs/tqmessagebox.cpp @@ -46,7 +46,7 @@ #include "tqlabel.h" #include "tqpushbutton.h" #include "tqimage.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqobjectlist.h" #if defined(QT_ACCESSIBILITY_SUPPORT) diff --git a/src/dialogs/tqmessagebox.h b/src/dialogs/tqmessagebox.h index a8b563830..cb0933f81 100644 --- a/src/dialogs/tqmessagebox.h +++ b/src/dialogs/tqmessagebox.h @@ -200,7 +200,7 @@ private: // Disabled copy constructor and operator= /* * Macro to be used at the beginning of main(), e.g. * -* #include +* #include * #include * int main( int argc, char**argv ) * { diff --git a/src/dialogs/tqprintdialog.cpp b/src/dialogs/tqprintdialog.cpp index a82ae4ee4..8430f2cbc 100644 --- a/src/dialogs/tqprintdialog.cpp +++ b/src/dialogs/tqprintdialog.cpp @@ -56,7 +56,7 @@ #include "tqbuttongroup.h" #include "tqradiobutton.h" #include "tqspinbox.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqheader.h" #include "tqstyle.h" #include "tqstring.h" @@ -724,11 +724,11 @@ static void parseSpoolInterface( TQListView * printers ) // Every unix must have its own. It's a standard. Here is AIX. static void parseQconfig( TQListView * printers ) { - TQFile qconfig( TQString::fromLatin1("/etc/qconfig") ); - if ( !qconfig.open( IO_ReadOnly ) ) + TQFile tqconfig( TQString::fromLatin1("/etc/tqconfig") ); + if ( !tqconfig.open( IO_ReadOnly ) ) return; - TQTextStream ts( &qconfig ); + TQTextStream ts( &tqconfig ); TQString line; TQString stanzaName; // either a queue or a device name diff --git a/src/dialogs/tqprogressdialog.cpp b/src/dialogs/tqprogressdialog.cpp index 27d2f78bf..262dbd85b 100644 --- a/src/dialogs/tqprogressdialog.cpp +++ b/src/dialogs/tqprogressdialog.cpp @@ -46,7 +46,7 @@ #include "tqpainter.h" #include "tqdrawutil.h" #include "tqdatetime.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqpushbutton.h" #include "tqcursor.h" diff --git a/src/dialogs/tqtabdialog.cpp b/src/dialogs/tqtabdialog.cpp index f3ae9a744..b312ccc64 100644 --- a/src/dialogs/tqtabdialog.cpp +++ b/src/dialogs/tqtabdialog.cpp @@ -48,7 +48,7 @@ #include "tqpushbutton.h" #include "tqpainter.h" #include "tqpixmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqtabwidget.h" #include "tqwidgetstack.h" #include "tqlayout.h" diff --git a/src/dialogs/tqwizard.cpp b/src/dialogs/tqwizard.cpp index 233857250..78b7431b2 100644 --- a/src/dialogs/tqwizard.cpp +++ b/src/dialogs/tqwizard.cpp @@ -47,7 +47,7 @@ #include "tqcursor.h" #include "tqlabel.h" #include "tqwidgetstack.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqptrlist.h" #include "tqpainter.h" #include "tqaccel.h" diff --git a/src/inputmethod/tqinputcontextfactory.cpp b/src/inputmethod/tqinputcontextfactory.cpp index e6f1fb3af..6ed340c60 100644 --- a/src/inputmethod/tqinputcontextfactory.cpp +++ b/src/inputmethod/tqinputcontextfactory.cpp @@ -41,7 +41,7 @@ #ifndef TQT_NO_IM -#include "ntqapplication.h" +#include "tqapplication.h" #ifdef TQT_THREAD_SUPPORT #include diff --git a/src/kernel/ntqapplication.h b/src/kernel/ntqapplication.h deleted file mode 100644 index 0e884583e..000000000 --- a/src/kernel/ntqapplication.h +++ /dev/null @@ -1,532 +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 "tqdesktopwidget.h" -#include "tqasciidict.h" -#include "tqpalette.h" -#include "tqtranslator.h" -#include "tqstrlist.h" -#include "tqstringlist.h" -#endif // QT_H - -class TQSessionManager; -class TQStyle; -class TQTranslator; -class TQEventLoop; -#if defined(TQ_WS_X11) -class TQIMEvent; -#endif - -#ifdef TQT_THREAD_SUPPORT -class TQMutex; -class TQThread; -#endif // TQT_THREAD_SUPPORT - - -class TQApplication; -extern TQ_EXPORT TQApplication *tqApp; // global application object - - -class TQ_EXPORT TQApplication : public TQObject -{ - TQ_OBJECT -public: - TQApplication( int &argc, char **argv ); - TQApplication( int &argc, char **argv, bool GUIenabled ); - TQApplication( int &argc, char **argv, bool GUIenabled, bool SMenabled ); - enum Type { Tty, GuiClient, GuiServer }; - TQApplication( int &argc, char **argv, Type ); -#if defined(TQ_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 TQT_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 TQT_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 TQT_NO_PALETTE - static TQPalette palette( const TQWidget* = 0 ); - static TQPalette palette( TQStringList ); - 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 TQT_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 TQT_NO_TRANSLATION -# ifndef TQT_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 TQT_NO_DIR - TQString applicationDirPath(); - TQString applicationFilePath(); -#endif -#ifndef TQT_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 TQT_NO_WHEELEVENT - static void setWheelScrollLines( int ); - static int wheelScrollLines(); -#endif - static void setGlobalStrut( const TQSize & ); - static TQSize globalStrut(); - -#ifndef TQT_NO_COMPONENT - static void setLibraryPaths( const TQStringList & ); - static TQStringList libraryPaths(); - static void addLibraryPath( const TQString & ); - static void removeLibraryPath( const TQString & ); -#endif // TQT_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(TQ_WS_MAC) - virtual bool macEventFilter( EventHandlerCallRef, EventRef ); -#endif -#if defined(TQ_WS_WIN) - virtual bool winEventFilter( MSG * ); -#endif -#if defined(TQ_WS_X11) - virtual bool x11EventFilter( XEvent * ); - virtual int x11ClientMessage( TQWidget*, XEvent*, bool passive_only); - int x11ProcessEvent( XEvent* ); -#endif - -#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) - static WindowsVersion winVersion(); -#elif defined(Q_OS_MAC) - static MacintoshVersion macVersion(); -#endif -#if defined(TQ_WS_WIN) - void winFocus( TQWidget *, bool ); - static void winMouseButtonUp(); -#endif - -#ifndef TQT_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(TQ_WS_X11) -#if !defined(TQT_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(TQT_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(); - -protected: - bool event(TQEvent *); - -private: - void construct( int &argc, char **argv, Type, bool enable_sm ); - void initialize( int, char **, bool enable_sm = true ); - void init_precmdline(); - void process_cmdline( int* argcptr, char ** argv ); - bool internalNotify( TQObject *, TQEvent * ); - -#if defined(TQ_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 tqt_init(int *, char **, TQApplication::Type); -#endif - -#if defined(TQ_WS_X11) -private slots: - void postIMEvent( TQObject *receiver, TQIMEvent *event ); -#endif - -public: -#ifdef TQT_THREAD_SUPPORT - static TQMutex *tqt_mutex; -#endif // TQT_THREAD_SUPPORT - -private: - int app_argc; - char **app_argv; - bool quit_now; - int quit_code; - static TQStyle *app_style; - static int app_cspec; -#ifndef TQT_NO_PALETTE - static TQPalette *app_pal; -#endif - static TQFont *app_font; -#ifndef TQT_NO_CURSOR - static TQCursor *app_cursor; -#endif -#ifndef TQT_THREAD_SUPPORT - static TQEventLoop* eventloop; -#endif - 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 TQT_NO_SESSIONMANAGER - TQSessionManager *session_manager; - TQString session_id; - static TQString* session_key; - bool is_session_restored; -#endif -#if defined(TQ_WS_X11) -#if !defined (TQT_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 TQT_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 TQObject; - friend class TQWidget; - friend class TQETWidget; - friend class TQDialog; - friend class TQAccelManager; - friend class TQEvent; -#ifdef TQT_THREAD_SUPPORT - friend class TQThread; -#endif // TQT_THREAD_SUPPORT - friend class TQTranslator; - friend class TQEventLoop; - friend TQ_EXPORT void tqt_ucm_initialize( TQApplication * ); -#if defined(TQ_WS_WIN) - friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* ); -#endif -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQApplication( const TQApplication & ); - TQApplication &operator=( const TQApplication & ); -#endif - -private: - static TQEventLoop* currentEventLoop(); - -public: -#ifdef TQT_THREAD_SUPPORT - static TQThread* guiThread(); - static void threadTerminationHandler( TQThread * ); -#endif - static bool isGuiThread(); -}; - -inline int TQApplication::argc() const -{ - return app_argc; -} - -inline char **TQApplication::argv() const -{ - return app_argv; -} - -#ifndef TQT_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 TQT_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; -} - -#ifdef TQT_NO_TRANSLATION -// Simple versions -inline TQString TQApplication::translate( const char *, const char *sourceText, - const char *, Encoding encoding ) const -{ -#ifndef TQT_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.cpp b/src/kernel/qapplication.cpp deleted file mode 100644 index db0fa0278..000000000 --- a/src/kernel/qapplication.cpp +++ /dev/null @@ -1,4969 +0,0 @@ -/**************************************************************************** -** -** Implementation 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. -** -**********************************************************************/ - -#include "tqobjectlist.h" -#include "ntqapplication.h" -#include "tqeventloop.h" -#include "tqeventloop_p.h" -#include "tqwidget.h" -#include "tqwidgetlist.h" -#include "tqwidgetintdict.h" -#include "tqptrdict.h" -#include "tqcleanuphandler.h" - -#include "tqtranslator.h" -#include "tqtextcodec.h" -#include "tqsessionmanager.h" -#include "tqdragobject.h" -#include "tqclipboard.h" -#include "tqcursor.h" -#include "tqstyle.h" -#include "tqstylefactory.h" -#include "tqfile.h" -#include "tqmessagebox.h" -#include "tqdir.h" -#include "tqfileinfo.h" -#ifdef TQ_WS_WIN -#include "tqinputcontext_p.h" -#endif -#include "tqfontdata_p.h" - -#if defined(TQT_THREAD_SUPPORT) -# include "tqmutex.h" -# include "tqthread.h" -# include -#endif // TQT_THREAD_SUPPORT - -#include - -#ifdef truncate -# undef truncate -#endif - -/*! - \class TQApplication ntqapplication.h - \brief The TQApplication class manages the GUI application's control - flow and main settings. - - \ingroup application - \mainclass - - It contains the main event loop, where all events from the window - system and other sources are processed and dispatched. It also - handles the application's initialization and finalization, and - provides session management. It also handles most system-wide and - application-wide settings. - - For any GUI application that uses TQt, there is precisely one - TQApplication object, no matter whether the application has 0, 1, 2 - or more windows at any time. - - The TQApplication object is accessible through the global pointer \c - tqApp. Its main areas of responsibility are: - \list - - \i It initializes the application with the user's desktop settings - such as palette(), font() and doubleClickInterval(). It keeps track - of these properties in case the user changes the desktop globally, for - example through some kind of control panel. - - \i It performs event handling, meaning that it receives events - from the underlying window system and dispatches them to the relevant - widgets. By using sendEvent() and postEvent() you can send your own - events to widgets. - - \i It parses common command line arguments and sets its internal - state accordingly. See the \link TQApplication::TQApplication() - constructor documentation\endlink below for more details about this. - - \i It defines the application's look and feel, which is - encapsulated in a TQStyle object. This can be changed at runtime - with setStyle(). - - \i It specifies how the application is to allocate colors. - See setColorSpec() for details. - - \i It provides localization of strings that are visible to the user - via translate(). - - \i It provides some magical objects like the desktop() and the - clipboard(). - - \i It knows about the application's windows. You can ask which - widget is at a certain position using widgetAt(), get a list of - topLevelWidgets() and closeAllWindows(), etc. - - \i It manages the application's mouse cursor handling, - see setOverrideCursor() and setGlobalMouseTracking(). - - \i On the X window system, it provides functions to flush and sync - the communication stream, see flushX() and syncX(). - - \i It provides support for sophisticated \link - session.html session management \endlink. This makes it possible - for applications to terminate gracefully when the user logs out, to - cancel a shutdown process if termination isn't possible and even to - preserve the entire application's state for a future session. See - isSessionRestored(), sessionId() and commitData() and saveState() - for details. - - \endlist - - The Application walk-through - example contains a typical complete main() that does the usual - things with TQApplication. - - Since the TQApplication object does so much initialization, it - must be created before any other objects related to the user - interface are created. - - Since it also deals with common command line arguments, it is - usually a good idea to create it \e before any interpretation or - modification of \c argv is done in the application itself. (Note - also that for X11, setMainWidget() may change the main widget - according to the \c -geometry option. To preserve this - functionality, you must set your defaults before setMainWidget() and - any overrides after.) - - \table - \header \i21 Groups of functions - \row - \i System settings - \i - desktopSettingsAware(), - setDesktopSettingsAware(), - cursorFlashTime(), - setCursorFlashTime(), - doubleClickInterval(), - setDoubleClickInterval(), - wheelScrollLines(), - setWheelScrollLines(), - palette(), - setPalette(), - font(), - setFont(), - fontMetrics(). - - \row - \i Event handling - \i - exec(), - processEvents(), - enter_loop(), - exit_loop(), - exit(), - quit(). - sendEvent(), - postEvent(), - sendPostedEvents(), - removePostedEvents(), - hasPendingEvents(), - notify(), - macEventFilter(), - x11EventFilter(), - x11ProcessEvent(), - winEventFilter(). - - \row - \i GUI Styles - \i - style(), - setStyle(), - polish(). - - \row - \i Color usage - \i - colorSpec(), - setColorSpec(), - - \row - \i Text handling - \i - installTranslator(), - removeTranslator() - translate(). - - \row - \i Widgets - \i - mainWidget(), - setMainWidget(), - allWidgets(), - topLevelWidgets(), - desktop(), - activePopupWidget(), - activeModalWidget(), - clipboard(), - focusWidget(), - winFocus(), - activeWindow(), - widgetAt(). - - \row - \i Advanced cursor handling - \i - hasGlobalMouseTracking(), - setGlobalMouseTracking(), - overrideCursor(), - setOverrideCursor(), - restoreOverrideCursor(). - - \row - \i X Window System synchronization - \i - flushX(), - syncX(). - - \row - \i Session management - \i - isSessionRestored(), - sessionId(), - commitData(), - saveState(). - - \row - \i Threading - \i - lock(), unlock(), locked(), tryLock(), - wakeUpGuiThread() - - \row - \i Miscellaneous - \i - closeAllWindows(), - startingUp(), - closingDown(), - type(). - \endtable - - \e {Non-GUI programs:} While TQt is not optimized or - designed for writing non-GUI programs, it's possible to use - \link tools.html some of its classes \endlink without creating a - TQApplication. This can be useful if you wish to share code between - a non-GUI server and a GUI client. - - \headerfile tqnamespace.h - \headerfile tqwindowdefs.h - \headerfile tqglobal.h -*/ - -/*! \enum TQt::HANDLE - \internal -*/ - -/*! - \enum TQApplication::Type - - \value Tty a console application - \value GuiClient a GUI client application - \value GuiServer a GUI server application -*/ - -/*! - \enum TQApplication::ColorSpec - - \value NormalColor the default color allocation policy - \value CustomColor the same as NormalColor for X11; allocates colors - to a palette on demand under Windows - \value ManyColor the right choice for applications that use thousands of - colors - - See setColorSpec() for full details. -*/ - -/* - The tqt_init() and tqt_cleanup() functions are implemented in the - qapplication_xyz.cpp file. -*/ - -void tqt_init( int *, char **, TQApplication::Type ); -void tqt_cleanup(); -#if defined(TQ_WS_X11) -void tqt_init( Display* dpy, TQt::HANDLE, TQt::HANDLE ); -void tqt_init( int *, char **, Display* dpy, TQt::HANDLE, TQt::HANDLE ); -#endif -TQ_EXPORT bool tqt_tryModalHelper( TQWidget *widget, TQWidget **rettop ); - -TQApplication *tqApp = 0; // global application object - -TQStyle *TQApplication::app_style = 0; // default application style -bool tqt_explicit_app_style = FALSE; // style explicitly set by programmer - -int TQApplication::app_cspec = TQApplication::NormalColor; -#ifndef TQT_NO_PALETTE -TQPalette *TQApplication::app_pal = 0; // default application palette -#endif -TQFont *TQApplication::app_font = 0; // default application font -bool tqt_app_has_font = FALSE; -#ifndef TQT_NO_CURSOR -TQCursor *TQApplication::app_cursor = 0; // default application cursor -#endif -int TQApplication::app_tracking = 0; // global mouse tracking -bool TQApplication::is_app_running = FALSE; // app starting up if FALSE -bool TQApplication::is_app_closing = FALSE; // app closing down if TRUE -int TQApplication::loop_level = 0; // event loop level -TQWidget *TQApplication::main_widget = 0; // main application widget -TQWidget *TQApplication::focus_widget = 0; // has keyboard input focus -TQWidget *TQApplication::active_window = 0; // toplevel with keyboard focus -bool TQApplication::obey_desktop_settings = TRUE; // use winsys resources -int TQApplication::cursor_flash_time = 1000; // text caret flash time -int TQApplication::mouse_double_click_time = 400; // mouse dbl click limit -#ifndef TQT_NO_WHEELEVENT -int TQApplication::wheel_scroll_lines = 3; // number of lines to scroll -#endif -bool tqt_is_gui_used; -bool TQ_EXPORT tqt_resolve_symlinks = TRUE; -bool TQ_EXPORT tqt_tab_all_widgets = TRUE; -TQRect tqt_maxWindowRect; -static int drag_time = 500; -static int drag_distance = 4; -static bool reverse_layout = FALSE; -TQSize TQApplication::app_strut = TQSize( 0,0 ); // no default application strut -bool TQApplication::animate_ui = TRUE; -bool TQApplication::animate_menu = FALSE; -bool TQApplication::fade_menu = FALSE; -bool TQApplication::animate_combo = FALSE; -bool TQApplication::animate_tooltip = FALSE; -bool TQApplication::fade_tooltip = FALSE; -bool TQApplication::animate_toolbox = FALSE; -bool TQApplication::widgetCount = FALSE; -TQApplication::Type tqt_appType=TQApplication::Tty; -#ifndef TQT_NO_COMPONENT -TQStringList *TQApplication::app_libpaths = 0; -#endif -bool TQApplication::metaComposeUnicode = FALSE; -int TQApplication::composedUnicode = 0; - -#ifdef TQT_THREAD_SUPPORT -TQMutex *TQApplication::tqt_mutex = 0; -TQMutex *tqt_sharedStringMutex = 0; -TQ_EXPORT TQMutex * tqt_sharedMetaObjectMutex = 0; - -#ifdef QT_USE_GLIBMAINLOOP -TQMutex *tqt_timerListMutex = 0; -#endif // QT_USE_GLIBMAINLOOP - -static TQt::HANDLE tqt_application_thread_id = 0; -TQ_EXPORT TQt::HANDLE tqt_get_application_thread_id() -{ - return tqt_application_thread_id; -} -#endif // TQT_THREAD_SUPPORT - -#ifndef TQT_THREAD_SUPPORT -TQEventLoop *TQApplication::eventloop = 0; // application event loop -#endif - -#ifdef TQT_THREAD_SUPPORT -TQEventLoop* TQApplication::currentEventLoop() { - TQThread* thread = TQThread::currentThreadObject(); - if (thread) { - if (thread->d) { - return thread->d->eventLoop; - } - } - return NULL; -} -#else -TQEventLoop* TQApplication::currentEventLoop() { - return TQApplication::eventloop; -} -#endif - -#ifndef TQT_NO_ACCEL -extern bool tqt_dispatchAccelEvent( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp -extern bool tqt_tryComposeUnicode( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp -#endif - -#if defined(QT_TABLET_SUPPORT) -bool chokeMouse = FALSE; -#endif - -void tqt_setMaxWindowRect(const TQRect& r) -{ - tqt_maxWindowRect = r; - // Re-resize any maximized windows - TQWidgetList* l = TQApplication::topLevelWidgets(); - if ( l ) { - TQWidget *w = l->first(); - while ( w ) { - if ( w->isVisible() && w->isMaximized() ) - { - w->showNormal(); //#### flicker - w->showMaximized(); - } - w = l->next(); - } - delete l; - } -} - -typedef void (*VFPTR)(); -typedef TQValueList TQVFuncList; -static TQVFuncList *postRList = 0; // list of post routines - -/*! - \relates TQApplication - - Adds a global routine that will be called from the TQApplication - destructor. This function is normally used to add cleanup routines - for program-wide functionality. - - The function given by \a p should take no arguments and return - nothing, like this: - \code - static int *global_ptr = 0; - - static void cleanup_ptr() - { - delete [] global_ptr; - global_ptr = 0; - } - - void init_ptr() - { - global_ptr = new int[100]; // allocate data - tqAddPostRoutine( cleanup_ptr ); // delete later - } - \endcode - - Note that for an application- or module-wide cleanup, - tqAddPostRoutine() is often not suitable. People have a tendency to - make such modules dynamically loaded, and then unload those modules - long before the TQApplication destructor is called, for example. - - For modules and libraries, using a reference-counted initialization - manager or TQt' parent-child delete mechanism may be better. Here is - an example of a private class which uses the parent-child mechanism - to call a cleanup function at the right time: - - \code - class MyPrivateInitStuff: public TQObject { - private: - MyPrivateInitStuff( TQObject * parent ): TQObject( parent) { - // initialization goes here - } - MyPrivateInitStuff * p; - - public: - static MyPrivateInitStuff * initStuff( TQObject * parent ) { - if ( !p ) - p = new MyPrivateInitStuff( parent ); - return p; - } - - ~MyPrivateInitStuff() { - // cleanup (the "post routine") goes here - } - } - \endcode - - By selecting the right parent widget/object, this can often be made - to clean up the module's data at the exact right moment. -*/ - -TQ_EXPORT void tqAddPostRoutine( TQtCleanUpFunction p) -{ - if ( !postRList ) { - postRList = new TQVFuncList; - TQ_CHECK_PTR( postRList ); - } - postRList->prepend( p ); -} - - -TQ_EXPORT void tqRemovePostRoutine( TQtCleanUpFunction p ) -{ - if ( !postRList ) return; - TQVFuncList::Iterator it = postRList->begin(); - while ( it != postRList->end() ) { - if ( *it == p ) { - postRList->remove( it ); - it = postRList->begin(); - } else { - ++it; - } - } -} - -// Default application palettes and fonts (per widget type) -TQAsciiDict *TQApplication::app_palettes = 0; -TQAsciiDict *TQApplication::app_fonts = 0; - -#ifndef TQT_NO_SESSIONMANAGER -TQString *TQApplication::session_key = 0; // ## session key. Should be a member in 4.0 -#endif -TQWidgetList *TQApplication::popupWidgets = 0; // has keyboard input focus - -TQDesktopWidget *tqt_desktopWidget = 0; // root window widgets -#ifndef TQT_NO_CLIPBOARD -TQClipboard *tqt_clipboard = 0; // global clipboard object -#endif -TQWidgetList * tqt_modal_stack=0; // stack of modal widgets - -#ifdef TQT_THREAD_SUPPORT - -// thread wrapper for the main() thread -class TQCoreApplicationThread : public TQThread -{ -public: - inline TQCoreApplicationThread() - { -#ifdef QT_CHECK_STATE - if ( tqt_gui_thread_self ) - tqWarning( "TQCoreApplicationThread: there should be exactly one main thread object" ); -#endif - tqt_gui_thread_self = this; - - TQThreadInstance::setCurrentThread(this); - - // thread should be running and not finished for the lifetime - // of the application (even if TQCoreApplication goes away) - d->running = true; - d->finished = false; - d->eventLoop = NULL; - } - - inline ~TQCoreApplicationThread() - { - tqt_gui_thread_self = nullptr; - - // avoid warning from TQThread - d->running = false; - // do some cleanup, namely clean up the thread-local storage associated with the GUI thread - TQThreadInstance::finishGuiThread(d); - } - - static TQCoreApplicationThread* self() { return tqt_gui_thread_self; } - -private: - inline void run() - { - // this function should never be called, it is implemented - // only so that we can instantiate the object - tqFatal("TQCoreApplicationThread: internal error"); - } - - static TQCoreApplicationThread* tqt_gui_thread_self; -}; - -TQCoreApplicationThread* TQCoreApplicationThread::tqt_gui_thread_self = nullptr; - -// construct exactly one instance of the core thread with static storage duration. Do it static -// rather than in the heap as we need it to be properly destroyed on the exit from the program. -static TQCoreApplicationThread tqt_main_thread; -#endif - -// Definitions for posted events -struct TQPostEvent { - TQPostEvent( TQObject *r, TQEvent *e ): receiver( r ), event( e ) {} - ~TQPostEvent() { delete event; } - TQObject *receiver; - TQEvent *event; -}; - -class TQ_EXPORT TQPostEventList : public TQPtrList -{ -public: - TQPostEventList(bool with_mutex = false) : TQPtrList(), m_mutex(nullptr) - { -#ifdef TQT_THREAD_SUPPORT - if (with_mutex) - { - m_mutex = new TQMutex(TRUE); - } -#endif - } - - ~TQPostEventList() - { - if (m_mutex) - { - delete m_mutex; - m_mutex = nullptr; - } - clear(); - } - - TQMutex* mutex() const { return m_mutex; } - -private: - TQMutex *m_mutex; - - TQPostEventList(const TQPostEventList &) = delete; - TQPostEventList &operator=(const TQPostEventList &) = delete; -}; - -class TQ_EXPORT TQPostEventListIt : public TQPtrListIterator -{ -public: - TQPostEventListIt( const TQPostEventList &l ) : TQPtrListIterator(l) {} - TQPostEventListIt &operator=(const TQPostEventListIt &i) -{ - return (TQPostEventListIt&)TQPtrListIterator::operator=(i); } -}; - -// The global list and its pointer are initialized in different functions -// to optimize access to the list pointer in normal usage -static TQPostEventList* InitGlobalPostedEventsList() -{ - static TQPostEventList _globalEventList(true); - _globalEventList.setAutoDelete(TRUE); - return &_globalEventList; -} - -static TQPostEventList* GlobalPostedEvents() -{ - static TQPostEventList *_globalPostedEvents = InitGlobalPostedEventsList(); - return _globalPostedEvents; -} - -uint qGlobalPostedEventsCount() -{ -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker locker( GlobalPostedEvents()->mutex() ); -#endif // TQT_THREAD_SUPPORT - - return GlobalPostedEvents()->count(); -} - -#ifndef TQT_NO_PALETTE -TQPalette *tqt_std_pal = 0; - -void tqt_create_std_palette() -{ - if ( tqt_std_pal ) - delete tqt_std_pal; - - TQColor standardLightGray( 192, 192, 192 ); - TQColor light( 255, 255, 255 ); - TQColor dark( standardLightGray.dark( 150 ) ); - TQColorGroup std_act( TQt::black, standardLightGray, - light, dark, TQt::gray, - TQt::black, TQt::white ); - TQColorGroup std_dis( TQt::darkGray, standardLightGray, - light, dark, TQt::gray, - TQt::darkGray, std_act.background() ); - TQColorGroup std_inact( TQt::black, standardLightGray, - light, dark, TQt::gray, - TQt::black, TQt::white ); - tqt_std_pal = new TQPalette( std_act, std_dis, std_inact ); -} - -static void tqt_fix_tooltips() -{ - // No resources for this yet (unlike on Windows). - TQColorGroup cg( TQt::black, TQColor(255,255,220), - TQColor(96,96,96), TQt::black, TQt::black, - TQt::black, TQColor(255,255,220) ); - TQPalette pal( cg, cg, cg ); - TQApplication::setPalette( pal, TRUE, "TQTipLabel"); -} -#endif - -void TQApplication::process_cmdline( int* argcptr, char ** argv ) -{ - // process platform-indep command line - if ( !tqt_is_gui_used || !*argcptr) - return; - - int argc = *argcptr; - int i, j; - - j = 1; - for ( i=1; i= 0 ) { - if ( !session_key ) - session_key = new TQString; - *session_key = session_id.mid( p +1 ); - session_id = session_id.left( p ); - } - is_session_restored = TRUE; - } -#endif - } else if ( qstrcmp(arg, "-reverse") == 0 ) { - setReverseLayout( TRUE ); - } else if ( qstrcmp(arg, "-widgetcount") == 0 ) { - widgetCount = TRUE;; - } else { - argv[j++] = argv[i]; - } -#ifndef TQT_NO_STYLE - if ( !s.isEmpty() ) { - setStyle( s ); - } -#endif - } - - if(j < argc) { -#ifdef TQ_WS_MACX - static char* empty = "\0"; - argv[j] = empty; -#else - argv[j] = 0; -#endif - *argcptr = j; - } -} - -/*! - Initializes the window system and constructs an application object - with \a argc command line arguments in \a argv. - - The global \c tqApp pointer refers to this application object. Only - one application object should be created. - - This application object must be constructed before any \link - TQPaintDevice paint devices\endlink (including widgets, pixmaps, bitmaps - etc.). - - Note that \a argc and \a argv might be changed. TQt removes command - line arguments that it recognizes. The modified \a argc and \a argv - can also be accessed later with \c tqApp->argc() and \c tqApp->argv(). - The documentation for argv() contains a detailed description of how - to process command line arguments. - - TQt debugging options (not available if TQt was compiled with the - TQT_NO_DEBUG flag defined): - \list - \i -nograb, tells TQt that it must never grab the mouse or the keyboard. - \i -dograb (only under X11), running under a debugger can cause - an implicit -nograb, use -dograb to override. - \i -sync (only under X11), switches to synchronous mode for - debugging. - \endlist - - See \link debug.html Debugging Techniques \endlink for a more - detailed explanation. - - All TQt programs automatically support the following command line options: - \list - \i -reverse causes text to be formatted for right-to-left languages - rather than in the usual left-to-right direction. - \i -style= \e style, sets the application GUI style. Possible values - are \c motif, \c windows, and \c platinum. If you compiled TQt - with additional styles or have additional styles as plugins these - will be available to the \c -style command line option. - \i -style \e style, is the same as listed above. - \i -session= \e session, restores the application from an earlier - \link session.html session \endlink. - \i -session \e session, is the same as listed above. - \i -widgetcount, prints debug message at the end about number of widgets left - undestroyed and maximum number of widgets existed at the same time - \endlist - - The X11 version of TQt also supports some traditional X11 - command line options: - \list - \i -display \e display, sets the X display (default is $DISPLAY). - \i -geometry \e geometry, sets the client geometry of the - \link setMainWidget() main widget\endlink. - \i -fn or \c -font \e font, defines the application font. The - font should be specified using an X logical font description. - \i -bg or \c -background \e color, sets the default background color - and an application palette (light and dark shades are calculated). - \i -fg or \c -foreground \e color, sets the default foreground color. - \i -btn or \c -button \e color, sets the default button color. - \i -name \e name, sets the application name. - \i -title \e title, sets the application title (caption). - \i -visual \c TrueColor, forces the application to use a TrueColor visual - on an 8-bit display. - \i -ncols \e count, limits the number of colors allocated in the - color cube on an 8-bit display, if the application is using the - \c TQApplication::ManyColor color specification. If \e count is - 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, - and 6 of blue); for other values, a cube - approximately proportional to a 2x3x1 cube is used. - \i -cmap, causes the application to install a private color map - on an 8-bit display. - \endlist - - \sa argc(), argv() -*/ - -//######### BINARY COMPATIBILITY constructor -TQApplication::TQApplication( int &argc, char **argv ) -{ - construct( argc, argv, GuiClient, true ); -} - -/*! - Constructs an application object with \a argc command line arguments - in \a argv. If \a GUIenabled is TRUE, a GUI application is - constructed, otherwise a non-GUI (console) application is created. - - Set \a GUIenabled to FALSE for programs without a graphical user - interface that should be able to run without a window system. - - On X11, the window system is initialized if \a GUIenabled is TRUE. - If \a GUIenabled is FALSE, the application does not connect to the - X-server. - On Windows and Macintosh, currently the window system is always - initialized, regardless of the value of GUIenabled. This may change in - future versions of TQt. - - The following example shows how to create an application that - uses a graphical interface when available. - \code - int main( int argc, char **argv ) - { -#ifdef TQ_WS_X11 - bool useGUI = getenv( "DISPLAY" ) != 0; -#else - bool useGUI = TRUE; -#endif - TQApplication app(argc, argv, useGUI); - - if ( useGUI ) { - //start GUI version - ... - } else { - //start non-GUI version - ... - } - return app.exec(); - } -\endcode -*/ - -TQApplication::TQApplication( int &argc, char **argv, bool GUIenabled ) -{ - construct( argc, argv, GUIenabled ? GuiClient : Tty, true ); -} - -/*! - Constructs an application object with \a argc command line arguments - in \a argv. If \a GUIenabled is TRUE, a GUI application is - constructed, otherwise a non-GUI (console) application is created. - If \a SMEnabled is TRUE, session management support is enabled (default). - - Set \a GUIenabled to FALSE for programs without a graphical user - interface that should be able to run without a window system. - - Set \a SMEnabled to FALSE to disable session management. - Session management cannot be enabled at a later time if disabled here. - - On X11, the window system is initialized if \a GUIenabled is TRUE. - If \a GUIenabled is FALSE, the application does not connect to the - X-server. - On Windows and Macintosh, currently the window system is always - initialized, regardless of the value of GUIenabled. This may change in - future versions of TQt. - - The following example shows how to create an application that - uses a graphical interface when available. - \code - int main( int argc, char **argv ) - { -#ifdef TQ_WS_X11 - bool useGUI = getenv( "DISPLAY" ) != 0; -#else - bool useGUI = TRUE; -#endif - TQApplication app(argc, argv, useGUI); - - if ( useGUI ) { - //start GUI version - ... - } else { - //start non-GUI version - ... - } - return app.exec(); - } -\endcode -*/ - -TQApplication::TQApplication( int &argc, char **argv, bool GUIenabled, bool SMenabled ) -{ - construct( argc, argv, GUIenabled ? GuiClient : Tty, SMenabled ); -} - -/*! - Constructs an application object with \a argc command line arguments - in \a argv. -*/ -TQApplication::TQApplication( int &argc, char **argv, Type type ) -{ - construct( argc, argv, type, true ); -} - -TQ_EXPORT void tqt_ucm_initialize( TQApplication *theApp ) -{ - if ( tqApp ) - return; - int argc = theApp->argc(); - char **argv = theApp->argv(); - theApp->construct( argc, argv, tqApp->type(), true ); - - Q_ASSERT( tqApp == theApp ); -} - -void TQApplication::construct( int &argc, char **argv, Type type, bool enable_sm ) -{ - tqt_appType = type; - tqt_is_gui_used = (type != Tty); - init_precmdline(); - static const char *empty = ""; - if ( argc == 0 || argv == 0 ) { - argc = 0; - argv = (char **)∅ // ouch! careful with TQApplication::argv()! - } - app_argc = argc; - app_argv = argv; - - tqt_init( &argc, argv, type ); // Must be called before initialize() - process_cmdline( &argc, argv ); - initialize( argc, argv, enable_sm ); - if ( tqt_is_gui_used ) - tqt_maxWindowRect = desktop()->rect(); - if ( currentEventLoop() ) - currentEventLoop()->appStartingUp(); -} - -/*! - Returns the type of application, Tty, GuiClient or GuiServer. -*/ - -TQApplication::Type TQApplication::type() const -{ - return tqt_appType; -} - -#if defined(TQ_WS_X11) -/*! - Create an application, given an already open display \a dpy. If \a - visual and \a colormap are non-zero, the application will use those as - the default Visual and Colormap contexts. - - \warning TQt only supports TrueColor visuals at depths higher than 8 - bits-per-pixel. - - This is available only on X11. -*/ - -TQApplication::TQApplication( Display* dpy, HANDLE visual, HANDLE colormap ) -{ - static int aargc = 1; - // ### a string literal is a cont char* - // ### using it as a char* is wrong and could lead to segfaults - // ### if aargv is modified someday - static char *aargv[] = { (char*)"unknown", 0 }; - - app_argc = aargc; - app_argv = aargv; - - tqt_appType = GuiClient; - tqt_is_gui_used = TRUE; - tqt_appType = GuiClient; - init_precmdline(); - // ... no command line. - - if ( ! dpy ) { -#ifdef QT_CHECK_STATE - tqWarning( "TQApplication: invalid Display* argument." ); -#endif // QT_CHECK_STATE - - tqt_init( &aargc, aargv, GuiClient ); - } else { - tqt_init( dpy, visual, colormap ); - } - - initialize( aargc, aargv ); - - if ( tqt_is_gui_used ) - tqt_maxWindowRect = desktop()->rect(); - if ( currentEventLoop() ) - currentEventLoop()->appStartingUp(); -} - -/*! - Create an application, given an already open display \a dpy and using - \a argc command line arguments in \a argv. If \a - visual and \a colormap are non-zero, the application will use those as - the default Visual and Colormap contexts. - - \warning TQt only supports TrueColor visuals at depths higher than 8 - bits-per-pixel. - - This is available only on X11. - -*/ -TQApplication::TQApplication(Display *dpy, int argc, char **argv, - HANDLE visual, HANDLE colormap) -{ - tqt_appType = GuiClient; - tqt_is_gui_used = TRUE; - tqt_appType = GuiClient; - init_precmdline(); - - app_argc = argc; - app_argv = argv; - - if ( ! dpy ) { -#ifdef QT_CHECK_STATE - tqWarning( "TQApplication: invalid Display* argument." ); -#endif // QT_CHECK_STATE - - tqt_init( &argc, argv, GuiClient ); - } else { - tqt_init( &argc, argv, dpy, visual, colormap ); - } - - process_cmdline( &argc, argv ); - initialize(argc, argv); - - if ( tqt_is_gui_used ) - tqt_maxWindowRect = desktop()->rect(); - if ( currentEventLoop() ) - currentEventLoop()->appStartingUp(); -} - - -#endif // TQ_WS_X11 - -#ifdef TQT_THREAD_SUPPORT -TQThread* TQApplication::guiThread() { - return TQCoreApplicationThread::self(); -} - -bool TQApplication::isGuiThread() { - return (TQThread::currentThreadObject() == guiThread()); -} -#else -bool TQApplication::isGuiThread() { - return true; -} -#endif - -void TQApplication::init_precmdline() -{ - translators = 0; - is_app_closing = FALSE; -#ifndef TQT_NO_SESSIONMANAGER - is_session_restored = FALSE; -#endif -#if defined(QT_CHECK_STATE) - if ( tqApp ) - tqWarning( "TQApplication: There should be max one application object" ); -#endif - tqApp = (TQApplication*)this; -} - -/*! - Initializes the TQApplication object, called from the constructors. -*/ - -void TQApplication::initialize( int argc, char **argv, bool enable_sm ) -{ -#ifdef TQT_THREAD_SUPPORT - tqt_mutex = new TQMutex( TRUE ); - tqt_sharedStringMutex = new TQMutex( TRUE ); - tqt_sharedMetaObjectMutex = new TQMutex( TRUE ); -#ifdef QT_USE_GLIBMAINLOOP - tqt_timerListMutex = new TQMutex( TRUE ); -#endif // QT_USE_GLIBMAINLOOP - tqt_application_thread_id = TQThread::currentThread(); -#endif // TQT_THREAD_SUPPORT - - app_argc = argc; - app_argv = argv; - quit_now = FALSE; - quit_code = 0; - TQWidget::createMapper(); // create widget mapper -#ifndef TQT_NO_PALETTE - (void) palette(); // trigger creation of application palette -#endif - is_app_running = TRUE; // no longer starting up - -#ifndef TQT_NO_SESSIONMANAGER - if (enable_sm) { - // connect to the session manager - if ( !session_key ) - session_key = new TQString; - session_manager = new TQSessionManager( tqApp, session_id, *session_key ); - } - else { - session_manager = 0; - } -#endif - -} - - -/***************************************************************************** - Functions returning the active popup and modal widgets. - *****************************************************************************/ - -/*! - Returns the active popup widget. - - A popup widget is a special top level widget that sets the \c - WType_Popup widget flag, e.g. the TQPopupMenu widget. When the - application opens a popup widget, all events are sent to the popup. - Normal widgets and modal widgets cannot be accessed before the popup - widget is closed. - - Only other popup widgets may be opened when a popup widget is shown. - The popup widgets are organized in a stack. This function returns - the active popup widget at the top of the stack. - - \sa activeModalWidget(), topLevelWidgets() -*/ - -TQWidget *TQApplication::activePopupWidget() -{ - return popupWidgets ? popupWidgets->getLast() : 0; -} - - -/*! - Returns the active modal widget. - - A modal widget is a special top level widget which is a subclass of - TQDialog that specifies the modal parameter of the constructor as - TRUE. A modal widget must be closed before the user can continue - with other parts of the program. - - Modal widgets are organized in a stack. This function returns - the active modal widget at the top of the stack. - - \sa activePopupWidget(), topLevelWidgets() -*/ - -TQWidget *TQApplication::activeModalWidget() -{ - return tqt_modal_stack ? tqt_modal_stack->getFirst() : 0; -} - -/*! - Cleans up any window system resources that were allocated by this - application. Sets the global variable \c tqApp to 0. -*/ - -TQApplication::~TQApplication() -{ -#ifndef TQT_NO_CLIPBOARD - // flush clipboard contents - if ( tqt_clipboard ) { - TQCustomEvent event( TQEvent::Clipboard ); - TQApplication::sendEvent( tqt_clipboard, &event ); - } -#endif - - if ( currentEventLoop() ) - currentEventLoop()->appClosingDown(); - if ( postRList ) { - TQVFuncList::Iterator it = postRList->begin(); - while ( it != postRList->end() ) { // call post routines - (**it)(); - postRList->remove( it ); - it = postRList->begin(); - } - delete postRList; - postRList = 0; - } - - TQObject *tipmanager = child( "toolTipManager", "TQTipManager", FALSE ); - delete tipmanager; - - delete tqt_desktopWidget; - tqt_desktopWidget = 0; - is_app_closing = TRUE; - - // Due to hacks to speed up TQStyle engine (see git hash 523c1fd99) TQObjects now contain a - // reference to TQStyleControlElementData object which among other contain TQFont members. - // But for a proper cleanup all fonts should be destroyed before disconnecting from X11 (in - // tqt_cleanup()). So we will have to cleanup up the data explicitly. - cleanupControlElementData(); - -#ifndef TQT_NO_CLIPBOARD - delete tqt_clipboard; - tqt_clipboard = 0; -#endif - TQWidget::destroyMapper(); -#ifndef TQT_NO_PALETTE - delete tqt_std_pal; - tqt_std_pal = 0; - delete app_pal; - app_pal = 0; - delete app_palettes; - app_palettes = 0; -#endif - delete app_font; - app_font = 0; - delete app_fonts; - app_fonts = 0; -#ifndef TQT_NO_STYLE - delete app_style; - app_style = 0; -#endif -#ifndef TQT_NO_CURSOR - delete app_cursor; - app_cursor = 0; -#endif -#ifndef TQT_NO_TRANSLATION - delete translators; -#endif - -#ifndef TQT_NO_DRAGANDDROP - extern TQDragManager *qt_dnd_manager; - delete qt_dnd_manager; -#endif - - tqt_cleanup(); - -#ifndef TQT_NO_COMPONENT - delete app_libpaths; - app_libpaths = 0; -#endif - -#ifdef TQT_THREAD_SUPPORT - delete tqt_mutex; - tqt_mutex = 0; -#endif // TQT_THREAD_SUPPORT - - if( tqApp == this ) { - if ( postedEvents ) - removePostedEvents( this ); - tqApp = 0; - } - is_app_running = FALSE; - - if ( widgetCount ) { - tqDebug( "Widgets left: %i Max widgets: %i \n", TQWidget::instanceCounter, TQWidget::maxInstances ); - } -#ifndef TQT_NO_SESSIONMANAGER - if ( session_manager ) { - delete session_manager; - } - session_manager = 0; - if ( session_key ) { - delete session_key; - } - session_key = 0; -#endif //TQT_NO_SESSIONMANAGER - -#ifdef TQT_THREAD_SUPPORT - delete tqt_sharedMetaObjectMutex; - tqt_sharedMetaObjectMutex = 0; - delete tqt_sharedStringMutex; - tqt_sharedStringMutex = 0; -#ifdef QT_USE_GLIBMAINLOOP - delete tqt_timerListMutex; - tqt_timerListMutex = 0; -#endif // QT_USE_GLIBMAINLOOP -#endif // TQT_THREAD_SUPPORT - - tqt_explicit_app_style = FALSE; - tqt_app_has_font = FALSE; - app_tracking = 0; - obey_desktop_settings = TRUE; - cursor_flash_time = 1000; - mouse_double_click_time = 400; -#ifndef TQT_NO_WHEELEVENT - wheel_scroll_lines = 3; -#endif - drag_time = 500; - drag_distance = 4; - reverse_layout = FALSE; - app_strut = TQSize( 0, 0 ); - animate_ui = TRUE; - animate_menu = FALSE; - fade_menu = FALSE; - animate_combo = FALSE; - animate_tooltip = FALSE; - fade_tooltip = FALSE; - widgetCount = FALSE; -} - - -/*! - \fn int TQApplication::argc() const - - Returns the number of command line arguments. - - The documentation for argv() describes how to process command line - arguments. - - \sa argv(), TQApplication::TQApplication() -*/ - -/*! - \fn char **TQApplication::argv() const - - Returns the command line argument vector. - - \c argv()[0] is the program name, \c argv()[1] is the first - argument and \c argv()[argc()-1] is the last argument. - - A TQApplication object is constructed by passing \e argc and \e - argv from the \c main() function. Some of the arguments may be - recognized as TQt options and removed from the argument vector. For - example, the X11 version of TQt knows about \c -display, \c -font - and a few more options. - - Example: - \code - // showargs.cpp - displays program arguments in a list box - - #include - #include - - int main( int argc, char **argv ) - { - TQApplication a( argc, argv ); - TQListBox b; - a.setMainWidget( &b ); - for ( int i = 0; i < a.argc(); i++ ) // a.argc() == argc - b.insertItem( a.argv()[i] ); // a.argv()[i] == argv[i] - b.show(); - return a.exec(); - } - \endcode - - If you run \c{showargs -display unix:0 -font 9x15bold hello world} - under X11, the list box contains the three strings "showargs", - "hello" and "world". - - TQt provides a global pointer, \c tqApp, that points to the - TQApplication object, and through which you can access argc() and - argv() in functions other than main(). - - \sa argc(), TQApplication::TQApplication() -*/ - -/*! - \fn void TQApplication::setArgs( int argc, char **argv ) - \internal -*/ - - -#ifndef TQT_NO_STYLE - -static TQString *qt_style_override = 0; - -/*! - Returns the application's style object. - - \sa setStyle(), TQStyle -*/ -TQStyle& TQApplication::style() -{ -#ifndef TQT_NO_STYLE - if ( app_style ) - return *app_style; - if ( !tqt_is_gui_used ) - tqFatal( "No style available in non-gui applications!" ); - -#if defined(TQ_WS_X11) - if(!qt_style_override) - x11_initialize_style(); // run-time search for default style -#endif - if ( !app_style ) { - // Compile-time search for default style - // - TQString style; - if ( qt_style_override ) { - style = *qt_style_override; - delete qt_style_override; - qt_style_override = 0; - } else { -# if defined(TQ_WS_WIN) && defined(Q_OS_TEMP) - style = "PocketPC"; -#elif defined(TQ_WS_WIN) - if ( qWinVersion() >= TQt::WV_XP && qWinVersion() < TQt::WV_NT_based ) - style = "WindowsXP"; - else - style = "Windows"; // default styles for Windows -#elif defined(TQ_WS_X11) && defined(Q_OS_SOLARIS) - style = "CDE"; // default style for X11 on Solaris -#elif defined(TQ_WS_X11) && defined(Q_OS_IRIX) - style = "SGI"; // default style for X11 on IRIX -#elif defined(TQ_WS_X11) - style = "Motif"; // default style for X11 -#elif defined(TQ_WS_MAC) - style = "Macintosh"; // default style for all Mac's -#endif - } - app_style = TQStyleFactory::create( style ); - if ( !app_style && // platform default style not available, try alternatives - !(app_style = TQStyleFactory::create( "Windows" ) ) && - !(app_style = TQStyleFactory::create( "Platinum" ) ) && - !(app_style = TQStyleFactory::create( "MotifPlus" ) ) && - !(app_style = TQStyleFactory::create( "Motif" ) ) && - !(app_style = TQStyleFactory::create( "CDE" ) ) && - !(app_style = TQStyleFactory::create( "Aqua" ) ) && - !(app_style = TQStyleFactory::create( "SGI" ) ) && - !(app_style = TQStyleFactory::create( "Compact" ) ) -#ifndef TQT_NO_STRINGLIST - && !(app_style = TQStyleFactory::create( TQStyleFactory::keys()[0] ) ) -#endif - ) - tqFatal( "No %s style available!", style.latin1() ); - } - - TQPalette app_pal_copy ( *app_pal ); - app_style->polish( *app_pal ); - - if ( is_app_running && !is_app_closing && (*app_pal != app_pal_copy) ) { - TQEvent e( TQEvent::ApplicationPaletteChange ); - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // for all widgets... - ++it; - sendEvent( w, &e ); - } - } - - app_style->polish( tqApp ); -#endif - return *app_style; -} - -/*! - Sets the application's GUI style to \a style. Ownership of the style - object is transferred to TQApplication, so TQApplication will delete - the style object on application exit or when a new style is set. - - Example usage: - \code - TQApplication::setStyle( new TQWindowsStyle ); - \endcode - - When switching application styles, the color palette is set back to - the initial colors or the system defaults. This is necessary since - certain styles have to adapt the color palette to be fully - style-guide compliant. - - \sa style(), TQStyle, setPalette(), desktopSettingsAware() -*/ -void TQApplication::setStyle( TQStyle *style ) -{ - TQStyle* old = app_style; - app_style = style; -#ifdef TQ_WS_X11 - tqt_explicit_app_style = TRUE; -#endif // TQ_WS_X11 - - if ( startingUp() ) { - delete old; - return; - } - - // clean up the old style - if (old) { - if ( is_app_running && !is_app_closing ) { - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // for all widgets... - ++it; - if ( !w->testWFlags(WType_Desktop) && // except desktop - w->testWState(WState_Polished) ) { // has been polished - old->unPolish(w); - } - } - } - old->unPolish( tqApp ); - } - - // take care of possible palette requirements of certain gui - // styles. Do it before polishing the application since the style - // might call TQApplication::setStyle() itself - if ( !tqt_std_pal ) - tqt_create_std_palette(); - TQPalette tmpPal = *tqt_std_pal; - setPalette( tmpPal, TRUE ); - - // initialize the application with the new style - app_style->polish( tqApp ); - - // re-polish existing widgets if necessary - if (old) { - if ( is_app_running && !is_app_closing ) { - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // for all widgets... - ++it; - if ( !w->testWFlags(WType_Desktop) ) { // except desktop - if ( w->testWState(WState_Polished) ) - app_style->polish(w); // repolish - w->styleChange( *old ); - if ( w->isVisible() ){ - w->update(); - } - } - } - } - delete old; - } -} - -/*! - \overload - - Requests a TQStyle object for \a style from the TQStyleFactory. - - The string must be one of the TQStyleFactory::keys(), typically one - of "windows", "motif", "cde", "motifplus", "platinum", "sgi" and - "compact". Depending on the platform, "windowsxp", "aqua" or - "macintosh" may be available. - - A later call to the TQApplication constructor will override the - requested style when a "-style" option is passed in as a commandline - parameter. - - Returns 0 if an unknown \a style is passed, otherwise the TQStyle object - returned is set as the application's GUI style. -*/ -TQStyle* TQApplication::setStyle( const TQString& style ) -{ -#ifdef TQ_WS_X11 - tqt_explicit_app_style = TRUE; -#endif // TQ_WS_X11 - - if ( startingUp() ) { - if(qt_style_override) - *qt_style_override = style; - else - qt_style_override = new TQString(style); - return 0; - } - TQStyle *s = TQStyleFactory::create( style ); - if ( !s ) - return 0; - - setStyle( s ); - return s; -} - -#endif - - -#if 1 /* OBSOLETE */ - -TQApplication::ColorMode TQApplication::colorMode() -{ - return (TQApplication::ColorMode)app_cspec; -} - -void TQApplication::setColorMode( TQApplication::ColorMode mode ) -{ - app_cspec = mode; -} -#endif - - -/*! - Returns the color specification. - \sa TQApplication::setColorSpec() - */ - -int TQApplication::colorSpec() -{ - return app_cspec; -} - -/*! - Sets the color specification for the application to \a spec. - - The color specification controls how the application allocates colors - when run on a display with a limited amount of colors, e.g. 8 bit / 256 - color displays. - - The color specification must be set before you create the TQApplication - object. - - The options are: - \list - \i TQApplication::NormalColor. - This is the default color allocation strategy. Use this option if - your application uses buttons, menus, texts and pixmaps with few - colors. With this option, the application uses system global - colors. This works fine for most applications under X11, but on - Windows machines it may cause dithering of non-standard colors. - \i TQApplication::CustomColor. - Use this option if your application needs a small number of custom - colors. On X11, this option is the same as NormalColor. On Windows, TQt - creates a Windows palette, and allocates colors to it on demand. - \i TQApplication::ManyColor. - Use this option if your application is very color hungry - (e.g. it requires thousands of colors). - Under X11 the effect is: - \list - \i For 256-color displays which have at best a 256 color true color - visual, the default visual is used, and colors are allocated - from a color cube. The color cube is the 6x6x6 (216 color) "Web - palette"*, but the number of colors can be changed - by the \e -ncols option. The user can force the application to - use the true color visual with the \link - TQApplication::TQApplication() -visual \endlink option. - \i For 256-color displays which have a true color visual with more - than 256 colors, use that visual. Silicon Graphics X servers - have this feature, for example. They provide an 8 bit visual - by default but can deliver true color when asked. - \endlist - On Windows, TQt creates a Windows palette, and fills it with a color cube. - \endlist - - Be aware that the CustomColor and ManyColor choices may lead to colormap - flashing: The foreground application gets (most) of the available - colors, while the background windows will look less attractive. - - Example: - \code - int main( int argc, char **argv ) - { - TQApplication::setColorSpec( TQApplication::ManyColor ); - TQApplication a( argc, argv ); - ... - } - \endcode - - TQColor provides more functionality for controlling color allocation and - freeing up certain colors. See TQColor::enterAllocContext() for more - information. - - To check what mode you end up with, call TQColor::numBitPlanes() once - the TQApplication object exists. A value greater than 8 (typically - 16, 24 or 32) means true color. - - * The color cube used by TQt has 216 colors whose red, - green, and blue components always have one of the following values: - 0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF. - - \sa colorSpec(), TQColor::numBitPlanes(), TQColor::enterAllocContext() */ - -void TQApplication::setColorSpec( int spec ) -{ -#if defined(QT_CHECK_STATE) - if ( tqApp ) { - tqWarning( "TQApplication::setColorSpec: This function must be " - "called before the TQApplication object is created" ); - } -#endif - app_cspec = spec; -} - -/*! - \fn TQSize TQApplication::globalStrut() - - Returns the application's global strut. - - The strut is a size object whose dimensions are the minimum that any - GUI element that the user can interact with should have. For example - no button should be resized to be smaller than the global strut size. - - \sa setGlobalStrut() -*/ - -/*! - Sets the application's global strut to \a strut. - - The strut is a size object whose dimensions are the minimum that any - GUI element that the user can interact with should have. For example - no button should be resized to be smaller than the global strut size. - - The strut size should be considered when reimplementing GUI controls - that may be used on touch-screens or similar IO-devices. - - Example: - \code - TQSize& WidgetClass::sizeHint() const - { - return TQSize( 80, 25 ).expandedTo( TQApplication::globalStrut() ); - } - \endcode - - \sa globalStrut() -*/ - -void TQApplication::setGlobalStrut( const TQSize& strut ) -{ - app_strut = strut; -} - -#if defined( TQ_WS_WIN ) || defined( TQ_WS_MAC ) -extern const char *tqAppFileName(); -#endif - -#ifndef TQT_NO_DIR -#ifndef TQ_WS_WIN -static TQString resolveSymlinks( const TQString& path, int depth = 0 ) -{ - bool foundLink = FALSE; - TQString linkTarget; - TQString part = path; - int slashPos = path.length(); - - // too deep; we give up - if ( depth == 128 ) - return TQString::null; - - do { - part = part.left( slashPos ); - TQFileInfo fileInfo( part ); - if ( fileInfo.isSymLink() ) { - foundLink = TRUE; - linkTarget = fileInfo.readLink(); - break; - } - } while ( (slashPos = part.findRev('/')) != -1 ); - - if ( foundLink ) { - TQString path2; - if ( linkTarget[0] == '/' ) { - path2 = linkTarget; - if ( slashPos < (int) path.length() ) - path2 += "/" + path.right( path.length() - slashPos - 1 ); - } else { - TQString relPath; - relPath = part.left( part.findRev('/') + 1 ) + linkTarget; - if ( slashPos < (int) path.length() ) { - if ( !linkTarget.endsWith( "/" ) ) - relPath += "/"; - relPath += path.right( path.length() - slashPos - 1 ); - } - path2 = TQDir::current().absFilePath( relPath ); - } - path2 = TQDir::cleanDirPath( path2 ); - return resolveSymlinks( path2, depth + 1 ); - } else { - return path; - } -} -#endif // TQ_WS_WIN - -/*! - Returns the directory that contains the application executable. - - For example, if you have installed TQt in the \c{C:\Trolltech\TQt} - directory, and you run the \c{demo} example, this function will - return "C:/Trolltech/TQt/examples/demo". - - On Mac OS X this will point to the directory actually containing the - executable, which may be inside of an application bundle (if the - application is bundled). - - \warning On Unix, this function assumes that argv[0] contains the file - name of the executable (which it normally does). It also assumes that - the current directory hasn't been changed by the application. - - \sa applicationFilePath() -*/ -TQString TQApplication::applicationDirPath() -{ - return TQFileInfo( applicationFilePath() ).dirPath(); -} - -/*! - Returns the file path of the application executable. - - For example, if you have installed TQt in the \c{C:\Trolltech\TQt} - directory, and you run the \c{demo} example, this function will - return "C:/Trolltech/TQt/examples/demo/demo.exe". - - \warning On Unix, this function assumes that argv[0] contains the file - name of the executable (which it normally does). It also assumes that - the current directory hasn't been changed by the application. - - \sa applicationDirPath() -*/ -TQString TQApplication::applicationFilePath() -{ -#if defined( TQ_WS_WIN ) - TQFileInfo filePath; - QT_WA({ - WCHAR module_name[256]; - GetModuleFileNameW(0, module_name, sizeof(module_name)); - filePath = TQString::fromUcs2((const unsigned short *)module_name); - }, { - char module_name[256]; - GetModuleFileNameA(0, module_name, sizeof(module_name)); - filePath = TQString::fromLocal8Bit(module_name); - }); - - return filePath.filePath(); -#elif defined( TQ_WS_MAC ) - return TQDir::cleanDirPath( TQFile::decodeName( tqAppFileName() ) ); -#else - TQString argv0 = TQFile::decodeName( argv()[0] ); - TQString absPath; - - if ( argv0[0] == '/' ) { - /* - If argv0 starts with a slash, it is already an absolute - file path. - */ - absPath = argv0; - } else if ( argv0.find('/') != -1 ) { - /* - If argv0 contains one or more slashes, it is a file path - relative to the current directory. - */ - absPath = TQDir::current().absFilePath( argv0 ); - } else { - /* - Otherwise, the file path has to be determined using the - PATH environment variable. - */ - char *pEnv = getenv( "PATH" ); - TQStringList paths( TQStringList::split(TQChar(':'), pEnv) ); - TQStringList::const_iterator p = paths.begin(); - while ( p != paths.end() ) { - TQString candidate = TQDir::current().absFilePath( *p + "/" + argv0 ); - if ( TQFile::exists(candidate) ) { - absPath = candidate; - break; - } - ++p; - } - } - - absPath = TQDir::cleanDirPath( absPath ); - if ( TQFile::exists(absPath) ) { - return resolveSymlinks( absPath ); - } else { - return TQString::null; - } -#endif -} -#endif // TQT_NO_DIR - -#ifndef TQT_NO_COMPONENT - -/*! - Returns a list of paths that the application will search when - dynamically loading libraries. - The installation directory for plugins is the only entry if no - paths have been set. The default installation directory for plugins - is \c INSTALL/plugins, where \c INSTALL is the directory where TQt was - installed. The directory of the application executable (NOT the - working directory) is also added to the plugin paths. - - If you want to iterate over the list, you should iterate over a - copy, e.g. - \code - TQStringList list = app.libraryPaths(); - TQStringList::Iterator it = list.begin(); - while( it != list.end() ) { - myProcessing( *it ); - ++it; - } - \endcode - - See the \link plugins-howto.html plugins documentation\endlink for a - description of how the library paths are used. - - \sa setLibraryPaths(), addLibraryPath(), removeLibraryPath(), TQLibrary -*/ -TQStringList TQApplication::libraryPaths() -{ - if ( !app_libpaths ) { - app_libpaths = new TQStringList; - TQString installPathPlugins = TQString::fromLocal8Bit(tqInstallPathPlugins()); - if ( TQFile::exists(installPathPlugins) ) { -#ifdef TQ_WS_WIN - installPathPlugins.replace('\\', '/'); -#endif - app_libpaths->append(installPathPlugins); - } - - TQString app_location; - if (tqApp) - app_location = tqApp->applicationFilePath(); -#ifdef TQ_WS_WIN - else { - app_location = TQString(tqAppFileName()); - app_location.replace('\\', '/'); - } -#endif - if (!app_location.isEmpty()) { - app_location.truncate( app_location.findRev( '/' ) ); - if ( app_location != tqInstallPathPlugins() && TQFile::exists( app_location ) ) - app_libpaths->append( app_location ); - } - } - return *app_libpaths; -} - - -/*! - Sets the list of directories to search when loading libraries to \a paths. - All existing paths will be deleted and the path list will consist of the - paths given in \a paths. - - \sa libraryPaths(), addLibraryPath(), removeLibraryPath(), TQLibrary - */ -void TQApplication::setLibraryPaths( const TQStringList &paths ) -{ - delete app_libpaths; - app_libpaths = new TQStringList( paths ); -} - -/*! - Append \a path to the end of the library path list. If \a path is - empty or already in the path list, the path list is not changed. - - The default path list consists of a single entry, the installation - directory for plugins. The default installation directory for plugins - is \c INSTALL/plugins, where \c INSTALL is the directory where TQt was - installed. - - \sa removeLibraryPath(), libraryPaths(), setLibraryPaths() - */ -void TQApplication::addLibraryPath( const TQString &path ) -{ - if ( path.isEmpty() ) - return; - - // make sure that library paths is initialized - libraryPaths(); - - if ( !app_libpaths->contains( path ) ) - app_libpaths->prepend( path ); -} - -/*! - Removes \a path from the library path list. If \a path is empty or not - in the path list, the list is not changed. - - \sa addLibraryPath(), libraryPaths(), setLibraryPaths() -*/ -void TQApplication::removeLibraryPath( const TQString &path ) -{ - if ( path.isEmpty() ) - return; - - // make sure that library paths is initialized - libraryPaths(); - - if ( app_libpaths->contains( path ) ) - app_libpaths->remove( path ); -} -#endif //TQT_NO_COMPONENT - -/*! - Returns the application palette. - - If a widget is passed in \a w, the default palette for the - widget's class is returned. This may or may not be the application - palette. In most cases there isn't a special palette for certain - types of widgets, but one notable exception is the popup menu under - Windows, if the user has defined a special background color for - menus in the display settings. - - \sa setPalette(), TQWidget::palette() -*/ -#ifndef TQT_NO_PALETTE -TQPalette TQApplication::palette(const TQWidget* w) -{ -#if defined(QT_CHECK_STATE) - if ( !tqApp ) - tqWarning( "TQApplication::palette: This function can only be " - "called after the TQApplication object has been created" ); -#endif - if ( !app_pal ) { - if ( !tqt_std_pal ) - tqt_create_std_palette(); - app_pal = new TQPalette( *tqt_std_pal ); - tqt_fix_tooltips(); - } - - if ( w && app_palettes ) { - TQPalette* wp = app_palettes->find( w->className() ); - if ( wp ) - return *wp; - TQAsciiDictIterator it( *app_palettes ); - const char* name; - while ( (name=it.currentKey()) != 0 ) { - if ( w->inherits( name ) ) - return *it.current(); - ++it; - } - } - return *app_pal; -} - -TQPalette TQApplication::palette(TQStringList objectTypeList) -{ -#if defined(QT_CHECK_STATE) - if ( !tqApp ) - tqWarning( "TQApplication::palette: This function can only be " - "called after the TQApplication object has been created" ); -#endif - if ( !app_pal ) { - if ( !tqt_std_pal ) - tqt_create_std_palette(); - app_pal = new TQPalette( *tqt_std_pal ); - tqt_fix_tooltips(); - } - - if ( (objectTypeList.count() > 0) && app_palettes ) { - TQPalette* wp = app_palettes->find( objectTypeList[objectTypeList.count()-1] ); - if ( wp ) { - return *wp; - } - TQAsciiDictIterator it( *app_palettes ); - const char* name; - while ( (name=it.currentKey()) != 0 ) { - if ( objectTypeList.contains(name) ) { - return *it.current(); - } - ++it; - } - } - return *app_pal; -} - -/*! - Changes the default application palette to \a palette. If \a - informWidgets is TRUE, then existing widgets are informed about the - change and may adjust themselves to the new application - setting. If \a informWidgets is FALSE, the change only affects newly - created widgets. - - If \a className is passed, the change applies only to widgets that - inherit \a className (as reported by TQObject::inherits()). If - \a className is left 0, the change affects all widgets, thus overriding - any previously set class specific palettes. - - The palette may be changed according to the current GUI style in - TQStyle::polish(). - - \sa TQWidget::setPalette(), palette(), TQStyle::polish() -*/ - -void TQApplication::setPalette( const TQPalette &palette, bool informWidgets, - const char* className ) -{ - TQPalette pal = palette; - TQPalette *oldpal = 0; -#ifndef TQT_NO_STYLE - if ( !startingUp() ) // on startup this has been done already - tqApp->style().polish( pal ); // NB: non-const reference -#endif - bool all = FALSE; - if ( !className ) { - if ( !app_pal ) { - app_pal = new TQPalette( pal ); - TQ_CHECK_PTR( app_pal ); - } else { - *app_pal = pal; - } - all = app_palettes != 0; - delete app_palettes; - app_palettes = 0; - tqt_fix_tooltips(); - } else { - if ( !app_palettes ) { - app_palettes = new TQAsciiDict; - TQ_CHECK_PTR( app_palettes ); - app_palettes->setAutoDelete( TRUE ); - } - oldpal = app_palettes->find( className ); - app_palettes->insert( className, new TQPalette( pal ) ); - } - if ( informWidgets && is_app_running && !is_app_closing ) { - if ( !oldpal || ( *oldpal != pal ) ) { - TQEvent e( TQEvent::ApplicationPaletteChange ); - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // for all widgets... - ++it; - if ( all || (!className && w->isTopLevel() ) || w->inherits(className) ) // matching class - sendEvent( w, &e ); - } - } - } -} - -#endif // TQT_NO_PALETTE - -/*! - Returns the default font for the widget \a w, or the default - application font if \a w is 0. - - \sa setFont(), fontMetrics(), TQWidget::font() -*/ - -TQFont TQApplication::font( const TQWidget *w ) -{ - if ( w && app_fonts ) { - TQFont* wf = app_fonts->find( w->className() ); - if ( wf ) - return *wf; - TQAsciiDictIterator it( *app_fonts ); - const char* name; - while ( (name=it.currentKey()) != 0 ) { - if ( w->inherits( name ) ) - return *it.current(); - ++it; - } - } - if ( !app_font ) { - app_font = new TQFont( "Helvetica" ); - TQ_CHECK_PTR( app_font ); - } - return *app_font; -} - -/*! Changes the default application font to \a font. If \a - informWidgets is TRUE, then existing widgets are informed about the - change and may adjust themselves to the new application - setting. If \a informWidgets is FALSE, the change only affects newly - created widgets. If \a className is passed, the change applies only - to classes that inherit \a className (as reported by - TQObject::inherits()). - - On application start-up, the default font depends on the window - system. It can vary depending on both the window system version and - the locale. This function lets you override the default font; but - overriding may be a bad idea because, for example, some locales need - extra-large fonts to support their special characters. - - \sa font(), fontMetrics(), TQWidget::setFont() -*/ - -void TQApplication::setFont( const TQFont &font, bool informWidgets, - const char* className ) -{ - bool all = FALSE; - if ( !className ) { - tqt_app_has_font = TRUE; - if ( !app_font ) { - app_font = new TQFont( font ); - TQ_CHECK_PTR( app_font ); - } else { - *app_font = font; - } - - // make sure the application font is complete - app_font->detach(); - app_font->d->mask = TQFontPrivate::Complete; - - all = app_fonts != 0; - delete app_fonts; - app_fonts = 0; - } else { - if (!app_fonts){ - app_fonts = new TQAsciiDict; - TQ_CHECK_PTR( app_fonts ); - app_fonts->setAutoDelete( TRUE ); - } - TQFont* fnt = new TQFont(font); - TQ_CHECK_PTR( fnt ); - app_fonts->insert(className, fnt); - } - if ( informWidgets && is_app_running && !is_app_closing ) { - TQEvent e( TQEvent::ApplicationFontChange ); - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // for all widgets... - ++it; - if ( all || (!className && w->isTopLevel() ) || w->inherits(className) ) // matching class - sendEvent( w, &e ); - } - } -} - - -/*! - Initialization of the appearance of the widget \a w \e before it is first - shown. - - Usually widgets call this automatically when they are polished. It - may be used to do some style-based central customization of widgets. - - Note that you are not limited to the public functions of TQWidget. - Instead, based on meta information like TQObject::className() you are - able to customize any kind of widget. - - \sa TQStyle::polish(), TQWidget::polish(), setPalette(), setFont() -*/ - -void TQApplication::polish( TQWidget *w ) -{ -#ifndef TQT_NO_STYLE - w->style().polish( w ); -#endif -} - - -/*! - Returns a list of the top level widgets in the application. - - The list is created using \c new and must be deleted by the caller. - - The list is empty (TQPtrList::isEmpty()) if there are no top level - widgets. - - Note that some of the top level widgets may be hidden, for example - the tooltip if no tooltip is currently shown. - - Example: - \code - // Show all hidden top level widgets. - TQWidgetList *list = TQApplication::topLevelWidgets(); - TQWidgetListIt it( *list ); // iterate over the widgets - TQWidget * w; - while ( (w=it.current()) != 0 ) { // for each top level widget... - ++it; - if ( !w->isVisible() ) - w->show(); - } - delete list; // delete the list, not the widgets - \endcode - - \warning Delete the list as soon you have finished using it. - The widgets in the list may be deleted by someone else at any time. - - \sa allWidgets(), TQWidget::isTopLevel(), TQWidget::isVisible(), - TQPtrList::isEmpty() -*/ - -TQWidgetList *TQApplication::topLevelWidgets() -{ - return TQWidget::tlwList(); -} - -/*! - Returns a list of all the widgets in the application. - - The list is created using \c new and must be deleted by the caller. - - The list is empty (TQPtrList::isEmpty()) if there are no widgets. - - Note that some of the widgets may be hidden. - - Example that updates all widgets: - \code - TQWidgetList *list = TQApplication::allWidgets(); - TQWidgetListIt it( *list ); // iterate over the widgets - TQWidget * w; - while ( (w=it.current()) != 0 ) { // for each widget... - ++it; - w->update(); - } - delete list; // delete the list, not the widgets - \endcode - - The TQWidgetList class is defined in the \c tqwidgetlist.h header - file. - - \warning Delete the list as soon as you have finished using it. - The widgets in the list may be deleted by someone else at any time. - - \sa topLevelWidgets(), TQWidget::isVisible(), TQPtrList::isEmpty(), -*/ - -TQWidgetList *TQApplication::allWidgets() -{ - return TQWidget::wList(); -} - -/*! - \fn TQWidget *TQApplication::focusWidget() const - - Returns the application widget that has the keyboard input focus, or - 0 if no widget in this application has the focus. - - \sa TQWidget::setFocus(), TQWidget::hasFocus(), activeWindow() -*/ - -/*! - \fn TQWidget *TQApplication::activeWindow() const - - Returns the application top-level window that has the keyboard input - focus, or 0 if no application window has the focus. Note that - there might be an activeWindow() even if there is no focusWidget(), - for example if no widget in that window accepts key events. - - \sa TQWidget::setFocus(), TQWidget::hasFocus(), focusWidget() -*/ - -/*! - Returns display (screen) font metrics for the application font. - - \sa font(), setFont(), TQWidget::fontMetrics(), TQPainter::fontMetrics() -*/ - -TQFontMetrics TQApplication::fontMetrics() -{ - return desktop()->fontMetrics(); -} - - - -/*! - Tells the application to exit with return code 0 (success). - Equivalent to calling TQApplication::exit( 0 ). - - It's common to connect the lastWindowClosed() signal to quit(), and - you also often connect e.g. TQButton::clicked() or signals in - TQAction, TQPopupMenu or TQMenuBar to it. - - Example: - \code - TQPushButton *quitButton = new TQPushButton( "Quit" ); - connect( quitButton, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); - \endcode - - \sa exit() aboutToQuit() lastWindowClosed() TQAction -*/ - -void TQApplication::quit() -{ - TQApplication::exit( 0 ); -} - - -/*! - Closes all top-level windows. - - This function is particularly useful for applications with many - top-level windows. It could, for example, be connected to a "Quit" - entry in the file menu as shown in the following code example: - - \code - // the "Quit" menu entry should try to close all windows - TQPopupMenu* file = new TQPopupMenu( this ); - file->insertItem( "&Quit", tqApp, TQ_SLOT(closeAllWindows()), CTRL+Key_Q ); - - // when the last window is closed, the application should quit - connect( tqApp, TQ_SIGNAL( lastWindowClosed() ), tqApp, TQ_SLOT( quit() ) ); - \endcode - - The windows are closed in random order, until one window does not - accept the close event. - - \sa TQWidget::close(), TQWidget::closeEvent(), lastWindowClosed(), - quit(), topLevelWidgets(), TQWidget::isTopLevel() - - */ -void TQApplication::closeAllWindows() -{ - bool did_close = TRUE; - TQWidget *w; - while((w = activeModalWidget()) && did_close) { - if(w->isHidden()) - break; - did_close = w->close(); - } - TQWidgetList *list = TQApplication::topLevelWidgets(); - for ( w = list->first(); did_close && w; ) { - if ( !w->isHidden() ) { - did_close = w->close(); - delete list; - list = TQApplication::topLevelWidgets(); - w = list->first(); - } else { - w = list->next(); - } - } - delete list; -} - -/*! - Displays a simple message box about TQt. The message includes the - version number of TQt being used by the application. - - This is useful for inclusion in the Help menu of an application. - See the examples/menu/menu.cpp example. - - This function is a convenience slot for TQMessageBox::aboutTQt(). -*/ -void TQApplication::aboutTQt() -{ -#ifndef TQT_NO_MESSAGEBOX - TQMessageBox::aboutTQt( mainWidget() ); -#endif // TQT_NO_MESSAGEBOX -} - - -/*! - \fn void TQApplication::lastWindowClosed() - - This signal is emitted when the user has closed the last - top level window. - - The signal is very useful when your application has many top level - widgets but no main widget. You can then connect it to the quit() - slot. - - For convenience, this signal is \e not emitted for transient top level - widgets such as popup menus and dialogs. - - \sa mainWidget(), topLevelWidgets(), TQWidget::isTopLevel(), TQWidget::close() -*/ - -/*! - \fn void TQApplication::aboutToQuit() - - This signal is emitted when the application is about to quit the - main event loop, e.g. when the event loop level drops to zero. - This may happen either after a call to quit() from inside the - application or when the users shuts down the entire desktop session. - - The signal is particularly useful if your application has to do some - last-second cleanup. Note that no user interaction is possible in - this state. - - \sa quit() -*/ - - -/*! - \fn void TQApplication::guiThreadAwake() - - This signal is emitted after the event loop returns from a function - that could block. - - \sa wakeUpGuiThread() -*/ - - -/*! - \fn bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event ) - - Sends event \a event directly to receiver \a receiver, using the - notify() function. Returns the value that was returned from the event - handler. - - The event is \e not deleted when the event has been sent. The normal - approach is to create the event on the stack, e.g. - \code - TQMouseEvent me( TQEvent::MouseButtonPress, pos, 0, 0 ); - TQApplication::sendEvent( mainWindow, &me ); - \endcode - If you create the event on the heap you must delete it. - - \sa postEvent(), notify() -*/ - -bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event ) { - if ( event ) event->spont = FALSE; - return tqApp ? tqApp->notify( receiver, event ) : FALSE; -} - -bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event ) { - if ( event ) event->spont = TRUE; - return tqApp ? tqApp->notify( receiver, event ) : FALSE; -} - -/*! - Sends event \a e to \a receiver: \a {receiver}->event(\a e). - Returns the value that is returned from the receiver's event handler. - - For certain types of events (e.g. mouse and key events), - the event will be propagated to the receiver's parent and so on up to - the top-level object if the receiver is not interested in the event - (i.e., it returns FALSE). - - There are five different ways that events can be processed; - reimplementing this virtual function is just one of them. All five - approaches are listed below: - \list 1 - \i Reimplementing this function. This is very powerful, providing - complete control; but only one subclass can be tqApp. - - \i Installing an event filter on tqApp. Such an event filter is able - to process all events for all widgets, so it's just as powerful as - reimplementing notify(); furthermore, it's possible to have more - than one application-global event filter. Global event filters even - see mouse events for \link TQWidget::isEnabled() disabled - widgets, \endlink and if \link setGlobalMouseTracking() global mouse - tracking \endlink is enabled, as well as mouse move events for all - widgets. - - \i Reimplementing TQObject::event() (as TQWidget does). If you do - this you get Tab key presses, and you get to see the events before - any widget-specific event filters. - - \i Installing an event filter on the object. Such an event filter - gets all the events except Tab and Shift-Tab key presses. - - \i Reimplementing paintEvent(), mousePressEvent() and so - on. This is the commonest, easiest and least powerful way. - \endlist - - \sa TQObject::event(), installEventFilter() -*/ - -bool TQApplication::notify( TQObject *receiver, TQEvent *e ) -{ - // no events are delivered after ~TQApplication() has started - if ( is_app_closing ) { - return FALSE; - } - - if ( receiver == 0 ) { // serious error -#if defined(QT_CHECK_NULL) - tqWarning( "TQApplication::notify: Unexpected null receiver" ); -#endif - return FALSE; - } - - if ( receiver && (e->type() == TQEvent::Destroy) ) { - return TRUE; - } - - if ( e->type() == TQEvent::ChildRemoved && receiver->postedEvents) { -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker locker( GlobalPostedEvents()->mutex() ); -#endif // TQT_THREAD_SUPPORT - - // the TQObject destructor calls TQObject::removeChild, which calls - // TQApplication::sendEvent() directly. this can happen while the event - // loop is in the middle of posting events, and when we get here, we may - // not have any more posted events for this object. - if ( receiver->postedEvents ) { - // if this is a child remove event and the child insert - // hasn't been dispatched yet, kill that insert - TQPostEventList * l = receiver->postedEvents; - TQObject * c = ((TQChildEvent*)e)->child(); - TQPostEvent * pe; - l->first(); - while( ( pe = l->current()) != 0 ) { - if ( pe->event && pe->receiver == receiver && - pe->event->type() == TQEvent::ChildInserted && - ((TQChildEvent*)pe->event)->child() == c ) { - pe->event->posted = FALSE; - delete pe->event; - pe->event = 0; - l->remove(); - continue; - } - l->next(); - } - } - } - - bool res = FALSE; - if ( !receiver->isWidgetType() ) { - res = internalNotify( receiver, e ); - } - else switch ( e->type() ) { -#ifndef TQT_NO_ACCEL - case TQEvent::Accel: - { - TQKeyEvent* key = (TQKeyEvent*) e; - res = internalNotify( receiver, e ); - - if ( !res && !key->isAccepted() ) { - res = tqt_dispatchAccelEvent( (TQWidget*)receiver, key ); - } - - // next lines are for compatibility with TQt <= 3.0.x: old - // TQAccel was listening on toplevel widgets - if ( !res && !key->isAccepted() && !((TQWidget*)receiver)->isTopLevel() ) { - res = internalNotify( ((TQWidget*)receiver)->topLevelWidget(), e ); - } - } - break; -#endif //TQT_NO_ACCEL - case TQEvent::KeyPress: - case TQEvent::KeyRelease: - case TQEvent::AccelOverride: - { - TQWidget* w = (TQWidget*)receiver; - TQKeyEvent* key = (TQKeyEvent*) e; -#ifndef TQT_NO_ACCEL - if ( tqt_tryComposeUnicode( w, key ) ) - break; -#endif - bool def = key->isAccepted(); - while ( w ) { - if ( def ) - key->accept(); - else - key->ignore(); - res = internalNotify( w, e ); - if ( res || key->isAccepted() ) - break; - w = w->parentWidget( TRUE ); - } - } - break; - case TQEvent::MouseButtonPress: - if ( e->spontaneous() ) { - TQWidget* fw = (TQWidget*)receiver; - while ( fw->focusProxy() ) - fw = fw->focusProxy(); - if ( fw->isEnabled() && fw->focusPolicy() & TQWidget::ClickFocus ) { - TQFocusEvent::setReason( TQFocusEvent::Mouse); - fw->setFocus(); - TQFocusEvent::resetReason(); - } - } - // fall through intended - case TQEvent::MouseButtonRelease: - case TQEvent::MouseButtonDblClick: - case TQEvent::MouseMove: - { - TQWidget* w = (TQWidget*)receiver; - TQMouseEvent* mouse = (TQMouseEvent*) e; - TQPoint relpos = mouse->pos(); - while ( w ) { - TQMouseEvent me(mouse->type(), relpos, mouse->globalPos(), mouse->button(), mouse->state()); - me.spont = mouse->spontaneous(); - res = internalNotify( w, w == receiver ? mouse : &me ); - e->spont = FALSE; - if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) - break; - - relpos += w->pos(); - w = w->parentWidget(); - } - if ( res ) - mouse->accept(); - else - mouse->ignore(); - } - break; -#ifndef TQT_NO_WHEELEVENT - case TQEvent::Wheel: - { - if ( e->spontaneous() ) { - TQWidget* fw = (TQWidget*)receiver; - while ( fw->focusProxy() ) - fw = fw->focusProxy(); - if ( fw->isEnabled() && (fw->focusPolicy() & TQWidget::WheelFocus) == TQWidget::WheelFocus ) { - TQFocusEvent::setReason( TQFocusEvent::Mouse); - fw->setFocus(); - TQFocusEvent::resetReason(); - } - } - - TQWidget* w = (TQWidget*)receiver; - TQWheelEvent* wheel = (TQWheelEvent*) e; - TQPoint relpos = wheel->pos(); - while ( w ) { - TQWheelEvent we(relpos, wheel->globalPos(), wheel->delta(), wheel->state(), wheel->orientation()); - we.spont = wheel->spontaneous(); - res = internalNotify( w, w == receiver ? wheel : &we ); - e->spont = FALSE; - if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) - break; - - relpos += w->pos(); - w = w->parentWidget(); - } - if ( res ) - wheel->accept(); - else - wheel->ignore(); - } - break; -#endif - case TQEvent::ContextMenu: - { - TQWidget* w = (TQWidget*)receiver; - TQContextMenuEvent *context = (TQContextMenuEvent*) e; - TQPoint relpos = context->pos(); - while ( w ) { - TQContextMenuEvent ce(context->reason(), relpos, context->globalPos(), context->state()); - ce.spont = e->spontaneous(); - res = internalNotify( w, w == receiver ? context : &ce ); - e->spont = FALSE; - - if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) - break; - - relpos += w->pos(); - w = w->parentWidget(); - } - if ( res ) - context->accept(); - else - context->ignore(); - } - break; -#if defined (QT_TABLET_SUPPORT) - case TQEvent::TabletMove: - case TQEvent::TabletPress: - case TQEvent::TabletRelease: - { - TQWidget *w = (TQWidget*)receiver; - TQTabletEvent *tablet = (TQTabletEvent*)e; - TQPoint relpos = tablet->pos(); - while ( w ) { - TQTabletEvent te(tablet->pos(), tablet->globalPos(), tablet->device(), - tablet->pressure(), tablet->xTilt(), tablet->yTilt(), - tablet->uniqueId()); - te.spont = e->spontaneous(); - res = internalNotify( w, w == receiver ? tablet : &te ); - e->spont = FALSE; - if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) - break; - - relpos += w->pos(); - w = w->parentWidget(); - } - if ( res ) - tablet->accept(); - else - tablet->ignore(); - chokeMouse = tablet->isAccepted(); - } - break; -#endif - default: - res = internalNotify( receiver, e ); - break; - } - - return res; -} - -/*!\reimp - -*/ -bool TQApplication::event( TQEvent *e ) -{ - if(e->type() == TQEvent::Close) { - TQCloseEvent *ce = (TQCloseEvent*)e; - ce->accept(); - closeAllWindows(); - - TQWidgetList *list = topLevelWidgets(); - for(TQWidget *w = list->first(); w; w = list->next()) { - if ( !w->isHidden() && !w->isDesktop() && !w->isPopup() && - (!w->isDialog() || !w->parentWidget())) { - ce->ignore(); - break; - } - } - if(ce->isAccepted()) - return TRUE; - } else if (e->type() == TQEvent::Quit) { - quit(); - return TRUE; - } - return TQObject::event(e); -} - -#define HOVER_SENSITIVE_WIDGET_SELECT if ( widget->inherits("TQPushButton") \ - || widget->inherits("TQComboBox") \ - || widget->inherits("TQSpinWidget") \ - || widget->inherits("TQCheckBox") \ - || widget->inherits("TQRadioButton") \ - || widget->inherits("TQToolButton") \ - || widget->inherits("TQSlider") \ - || widget->inherits("TQScrollBar") \ - || widget->inherits("TQTabBar") \ - || widget->inherits("TQDockWindowHandle") \ - || widget->inherits("TQSplitterHandle") ) - -#define FOCUS_SENSITIVE_WIDGET_SELECT if ( widget->inherits("TQLineEdit") ) -#define FOCUS_SENSITIVE_PARENT_WIDGET_SELECT if ( widget->parentWidget() && widget->parentWidget()->inherits("TQSpinWidget") ) - -/*!\internal - - Helper function called by notify() - */ -bool TQApplication::internalNotify( TQObject *receiver, TQEvent * e) -{ - if ( eventFilters ) { - TQObjectListIt it( *eventFilters ); - TQObject *obj; - while ( (obj=it.current()) != 0 ) { // send to all filters - ++it; // until one returns TRUE - if ( obj->eventFilter(receiver,e) ) - return TRUE; - } - } - - bool consumed = FALSE; - bool handled = FALSE; - if ( receiver->isWidgetType() ) { - TQWidget *widget = (TQWidget*)receiver; - - // toggle HasMouse widget state on enter and leave - if ( e->type() == TQEvent::Enter || e->type() == TQEvent::DragEnter ) { - widget->setWState( WState_HasMouse ); - HOVER_SENSITIVE_WIDGET_SELECT { - widget->repaint(false); - } - } - else if ( e->type() == TQEvent::Leave || e->type() == TQEvent::DragLeave ) { - widget->clearWState( WState_HasMouse ); - HOVER_SENSITIVE_WIDGET_SELECT { - widget->repaint(false); - } - } - - // repaint information entry widgets on focus set/unset - if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) { - FOCUS_SENSITIVE_WIDGET_SELECT { - widget->repaint(false); - } - FOCUS_SENSITIVE_PARENT_WIDGET_SELECT { - widget->parentWidget()->repaint(false); - } - } - - // throw away any mouse-tracking-only mouse events - if ( e->type() == TQEvent::MouseMove && - (((TQMouseEvent*)e)->state()&TQMouseEvent::MouseButtonMask) == 0 && - !widget->hasMouseTracking() ) { - handled = TRUE; - consumed = TRUE; - } else if ( !widget->isEnabled() ) { // throw away mouse events to disabled widgets - switch(e->type()) { - case TQEvent::MouseButtonPress: - case TQEvent::MouseButtonRelease: - case TQEvent::MouseButtonDblClick: - case TQEvent::MouseMove: - ( (TQMouseEvent*) e)->ignore(); - handled = TRUE; - consumed = TRUE; - break; -#ifndef TQT_NO_DRAGANDDROP - case TQEvent::DragEnter: - case TQEvent::DragMove: - ( (TQDragMoveEvent*) e)->ignore(); - handled = TRUE; - break; - - case TQEvent::DragLeave: - case TQEvent::DragResponse: - handled = TRUE; - break; - - case TQEvent::Drop: - ( (TQDropEvent*) e)->ignore(); - handled = TRUE; - break; -#endif -#ifndef TQT_NO_WHEELEVENT - case TQEvent::Wheel: - ( (TQWheelEvent*) e)->ignore(); - handled = TRUE; - break; -#endif - case TQEvent::ContextMenu: - ( (TQContextMenuEvent*) e)->ignore(); - handled = TRUE; - break; - default: - break; - } - } - - } - - if (!handled) { -#if defined(TQT_THREAD_SUPPORT) - int locklevel = 0; - int llcount; - if (TQApplication::tqt_mutex) { - TQApplication::tqt_mutex->lock(); // 1 of 2 - locklevel = tqt_mutex->level() - 1; - for (llcount=0; llcountunlock(); - } - TQApplication::tqt_mutex->unlock(); // 2 of 2 - } -#endif - consumed = receiver->event( e ); -#if defined(TQT_THREAD_SUPPORT) - if (TQApplication::tqt_mutex) { - for (llcount=0; llcountlock(); - } - } -#endif - } - e->spont = FALSE; - return consumed; -} - -/*! - Returns TRUE if an application object has not been created yet; - otherwise returns FALSE. - - \sa closingDown() -*/ - -bool TQApplication::startingUp() -{ - return !is_app_running; -} - -/*! - Returns TRUE if the application objects are being destroyed; - otherwise returns FALSE. - - \sa startingUp() -*/ - -bool TQApplication::closingDown() -{ - return is_app_closing; -} - - -/*! - Processes pending events, for 3 seconds or until there are no more - events to process, whichever is shorter. - - You can call this function occasionally when your program is busy - performing a long operation (e.g. copying a file). - - \sa exec(), TQTimer, TQEventLoop::processEvents() -*/ - -void TQApplication::processEvents() -{ - processEvents( 3000 ); -} - -/*! - \overload - - Processes pending events for \a maxtime milliseconds or until - there are no more events to process, whichever is shorter. - - You can call this function occasionally when you program is busy - doing a long operation (e.g. copying a file). - - \sa exec(), TQTimer, TQEventLoop::processEvents() -*/ -void TQApplication::processEvents( int maxtime ) -{ - eventLoop()->processEvents( TQEventLoop::AllEvents, maxtime ); -} - -/*! \obsolete - Waits for an event to occur, processes it, then returns. - - This function is useful for adapting TQt to situations where the - event processing must be grafted onto existing program loops. - - Using this function in new applications may be an indication of design - problems. - - \sa processEvents(), exec(), TQTimer -*/ - -void TQApplication::processOneEvent() -{ - eventLoop()->processEvents( TQEventLoop::AllEvents | - TQEventLoop::WaitForMore ); -} - -/***************************************************************************** - Main event loop wrappers - *****************************************************************************/ - -/*! - Returns the application event loop. This function will return - zero if called during and after destroying TQApplication. - - To create your own instance of TQEventLoop or TQEventLoop subclass create - it before you create the TQApplication object. - - \sa TQEventLoop -*/ -TQEventLoop *TQApplication::eventLoop() -{ - if ( !currentEventLoop() && !is_app_closing ) { - (void) new TQEventLoop( tqApp, "default event loop" ); - } - return currentEventLoop(); -} - - -/*! - Enters the main event loop and waits until exit() is called or the - main widget is destroyed, and returns the value that was set to - exit() (which is 0 if exit() is called via quit()). - - It is necessary to call this function to start event handling. The - main event loop receives events from the window system and - dispatches these to the application widgets. - - Generally speaking, no user interaction can take place before - calling exec(). As a special case, modal widgets like TQMessageBox - can be used before calling exec(), because modal widgets call - exec() to start a local event loop. - - To make your application perform idle processing, i.e. executing a - special function whenever there are no pending events, use a - TQTimer with 0 timeout. More advanced idle processing schemes can - be achieved using processEvents(). - - \sa quit(), exit(), processEvents(), setMainWidget() -*/ -int TQApplication::exec() -{ - return eventLoop()->exec(); -} - -/*! - Tells the application to exit with a return code. - - After this function has been called, the application leaves the main - event loop and returns from the call to exec(). The exec() function - returns \a retcode. - - By convention, a \a retcode of 0 means success, and any non-zero - value indicates an error. - - Note that unlike the C library function of the same name, this - function \e does return to the caller -- it is event processing that - stops. - - \sa quit(), exec() -*/ -void TQApplication::exit( int retcode ) -{ -#ifdef TQT_THREAD_SUPPORT - TQThread* thread = tqApp->guiThread(); - if (thread) { - if (thread->d) { - if (thread->d->eventLoop) { - thread->d->eventLoop->exit( retcode ); - } - } - } -#else - tqApp->eventLoop()->exit( retcode ); -#endif // TQT_THREAD_SUPPORT -} - -/*! - \obsolete - - This function enters the main event loop (recursively). Do not call - it unless you really know what you are doing. - - Use TQApplication::eventLoop()->enterLoop() instead. - -*/ -int TQApplication::enter_loop() -{ - return eventLoop()->enterLoop(); -} - -/*! - \obsolete - - This function exits from a recursive call to the main event loop. - Do not call it unless you are an expert. - - Use TQApplication::eventLoop()->exitLoop() instead. - -*/ -void TQApplication::exit_loop() -{ - eventLoop()->exitLoop(); -} - -/*! - \obsolete - - Returns the current loop level. - - Use TQApplication::eventLoop()->loopLevel() instead. - -*/ -int TQApplication::loopLevel() const -{ - return eventLoop()->loopLevel(); -} - -/*! - - Wakes up the GUI thread. - - \sa guiThreadAwake() \link threads.html Thread Support in TQt\endlink -*/ -void TQApplication::wakeUpGuiThread() -{ - eventLoop()->wakeUp(); -} - -/*! - This function returns TRUE if there are pending events; otherwise - returns FALSE. Pending events can be either from the window system - or posted events using TQApplication::postEvent(). -*/ -bool TQApplication::hasPendingEvents() -{ - return eventLoop()->hasPendingEvents(); -} - -#if !defined(TQ_WS_X11) - -// The doc and X implementation of these functions is in qapplication_x11.cpp - -void TQApplication::flushX() {} // do nothing - -void TQApplication::syncX() {} // do nothing - -#endif - -/*! - \fn void TQApplication::setWinStyleHighlightColor( const TQColor & ) - \obsolete - - Sets the color used to mark selections in windows style for all widgets - in the application. Will repaint all widgets if the color is changed. - - The default color is \c darkBlue. - \sa winStyleHighlightColor() -*/ - -/*! - \fn const TQColor& TQApplication::winStyleHighlightColor() - \obsolete - - Returns the color used to mark selections in windows style. - - \sa setWinStyleHighlightColor() -*/ - -/*! - Returns the version of the Windows operating system that is running: - - \list - \i TQt::WV_95 - Windows 95 - \i TQt::WV_98 - Windows 98 - \i TQt::WV_Me - Windows Me - \i TQt::WV_NT - Windows NT 4.x - \i TQt::WV_2000 - Windows 2000 (NT5) - \i TQt::WV_XP - Windows XP - \i TQt::WV_2003 - Windows Server 2003 family - \i TQt::WV_CE - Windows CE - \i TQt::WV_CENET - Windows CE.NET - \endlist - - Note that this function is implemented for the Windows version - of TQt only. -*/ - -#if defined(Q_OS_CYGWIN) -TQt::WindowsVersion TQApplication::winVersion() -{ - return qt_winver; -} -#endif - -#ifndef TQT_NO_TRANSLATION - -bool qt_detectRTLLanguage() -{ - return TQApplication::tr( "QT_LAYOUT_DIRECTION", - "Translate this string to the string 'LTR' in left-to-right" - " languages or to 'RTL' in right-to-left languages (such as Hebrew" - " and Arabic) to get proper widget layout." ) == "RTL"; -} - -/*! - Adds the message file \a mf to the list of message files to be used - for translations. - - Multiple message files can be installed. Translations are searched - for in the last installed message file, then the one from last, and - so on, back to the first installed message file. The search stops as - soon as a matching translation is found. - - \sa removeTranslator() translate() TQTranslator::load() -*/ - -void TQApplication::installTranslator( TQTranslator * mf ) -{ - if ( !mf ) - return; - if ( !translators ) - translators = new TQValueList; - - translators->prepend( mf ); - -#ifndef TQT_NO_TRANSLATION_BUILDER - if ( mf->isEmpty() ) - return; -#endif - - // hook to set the layout direction of dialogs - setReverseLayout( qt_detectRTLLanguage() ); - - TQWidgetList *list = topLevelWidgets(); - TQWidgetListIt it( *list ); - TQWidget *w; - while ( ( w=it.current() ) != 0 ) { - ++it; - if (!w->isDesktop()) - postEvent( w, new TQEvent( TQEvent::LanguageChange ) ); - } - delete list; -} - -/*! - Removes the message file \a mf from the list of message files used by - this application. (It does not delete the message file from the file - system.) - - \sa installTranslator() translate(), TQObject::tr() -*/ - -void TQApplication::removeTranslator( TQTranslator * mf ) -{ - if ( !translators || !mf ) - return; - - if ( translators->remove( mf ) && ! tqApp->closingDown() ) { - setReverseLayout( qt_detectRTLLanguage() ); - - TQWidgetList *list = topLevelWidgets(); - TQWidgetListIt it( *list ); - TQWidget *w; - while ( ( w=it.current() ) != 0 ) { - ++it; - postEvent( w, new TQEvent( TQEvent::LanguageChange ) ); - } - delete list; - } -} - -#ifndef TQT_NO_TEXTCODEC -/*! \obsolete - This is the same as TQTextCodec::setCodecForTr(). -*/ -void TQApplication::setDefaultCodec( TQTextCodec* codec ) -{ - TQTextCodec::setCodecForTr( codec ); -} - -/*! \obsolete - Returns TQTextCodec::codecForTr(). -*/ -TQTextCodec* TQApplication::defaultCodec() const -{ - return TQTextCodec::codecForTr(); -} -#endif //TQT_NO_TEXTCODEC - -/*! \enum TQApplication::Encoding - - This enum type defines the 8-bit encoding of character string - arguments to translate(): - - \value DefaultCodec - the encoding specified by - TQTextCodec::codecForTr() (Latin-1 if none has been set) - \value UnicodeUTF8 - UTF-8 - - \sa TQObject::tr(), TQObject::trUtf8(), TQString::fromUtf8() -*/ - -/*! \reentrant - Returns the translation text for \a sourceText, by querying the - installed messages files. The message files are searched from the most - recently installed message file back to the first installed message - file. - - TQObject::tr() and TQObject::trUtf8() provide this functionality more - conveniently. - - \a context is typically a class name (e.g., "MyDialog") and - \a sourceText is either English text or a short identifying text, if - the output text will be very long (as for help texts). - - \a comment is a disambiguating comment, for when the same \a - sourceText is used in different roles within the same context. By - default, it is null. \a encoding indicates the 8-bit encoding of - character stings - - See the \l TQTranslator documentation for more information about - contexts and comments. - - If none of the message files contain a translation for \a - sourceText in \a context, this function returns a TQString - equivalent of \a sourceText. The encoding of \a sourceText is - specified by \e encoding; it defaults to \c DefaultCodec. - - This function is not virtual. You can use alternative translation - techniques by subclassing \l TQTranslator. - - \warning This method is reentrant only if all translators are - installed \e before calling this method. Installing or removing - translators while performing translations is not supported. Doing - so will most likely result in crashes or other undesirable behavior. - - \sa TQObject::tr() installTranslator() defaultCodec() -*/ - -TQString TQApplication::translate( const char * context, const char * sourceText, - const char * comment, Encoding encoding ) const -{ - if ( !sourceText ) - return TQString::null; - - if ( translators ) { - TQValueList::iterator it; - TQTranslator * mf; - TQString result; - for ( it = translators->begin(); it != translators->end(); ++it ) { - mf = *it; - result = mf->findMessage( context, sourceText, comment ).translation(); - if ( !result.isNull() ) - return result; - } - } -#ifndef TQT_NO_TEXTCODEC - if ( encoding == UnicodeUTF8 ) - return TQString::fromUtf8( sourceText ); - else if ( TQTextCodec::codecForTr() != 0 ) - return TQTextCodec::codecForTr()->toUnicode( sourceText ); - else -#endif - return TQString::fromLatin1( sourceText ); -} - -#endif - -/***************************************************************************** - TQApplication management of posted events - *****************************************************************************/ - -//see also notify(), which does the removal of ChildInserted when ChildRemoved. - -/*! - Adds the event \a event with the object \a receiver as the receiver of the - event, to an event queue and returns immediately. - - The event must be allocated on the heap since the post event queue - will take ownership of the event and delete it once it has been posted. - - When control returns to the main event loop, all events that are - stored in the queue will be sent using the notify() function. - - \threadsafe - - \sa sendEvent(), notify() -*/ - -void TQApplication::postEvent( TQObject *receiver, TQEvent *event ) -{ - if ( receiver == 0 ) { -#if defined(QT_CHECK_NULL) - tqWarning( "TQApplication::postEvent: Unexpected null receiver" ); -#endif - delete event; - return; - } - -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker locker( GlobalPostedEvents()->mutex() ); -#endif // TQT_THREAD_SUPPORT - - if ( !receiver->postedEvents ) { - receiver->postedEvents = new TQPostEventList; - } - TQPostEventList * l = receiver->postedEvents; - - // if this is one of the compressible events, do compression - if ( event->type() == TQEvent::Paint || - event->type() == TQEvent::LayoutHint || - event->type() == TQEvent::Resize || - event->type() == TQEvent::Move || - event->type() == TQEvent::LanguageChange ) { - l->first(); - TQPostEvent * cur = 0; - for ( ;; ) { - while ( (cur=l->current()) != 0 && - ( cur->receiver != receiver || - cur->event == 0 || - cur->event->type() != event->type() ) ) - l->next(); - if ( l->current() != 0 ) { - if ( cur->event->type() == TQEvent::Paint ) { - TQPaintEvent * p = (TQPaintEvent*)(cur->event); - if ( p->erase != ((TQPaintEvent*)event)->erase ) { - l->next(); - continue; - } - p->reg = p->reg.unite( ((TQPaintEvent *)event)->reg ); - p->rec = p->rec.unite( ((TQPaintEvent *)event)->rec ); - delete event; - return; - } else if ( cur->event->type() == TQEvent::LayoutHint ) { - delete event; - return; - } else if ( cur->event->type() == TQEvent::Resize ) { - ((TQResizeEvent *)(cur->event))->s = ((TQResizeEvent *)event)->s; - delete event; - return; - } else if ( cur->event->type() == TQEvent::Move ) { - ((TQMoveEvent *)(cur->event))->p = ((TQMoveEvent *)event)->p; - delete event; - return; - } else if ( cur->event->type() == TQEvent::LanguageChange ) { - delete event; - return; - } - } - break; - }; - } - -#if !defined(TQT_NO_IM) - // if this is one of the compressible IM events, do compression - else if ( event->type() == TQEvent::IMCompose ) { - l->last(); - TQPostEvent * cur = 0; - for ( ;; ) { - while ( (cur=l->current()) != 0 && - ( cur->receiver != receiver || - cur->event == 0 || - cur->event->type() != event->type() || - cur->event->type() != TQEvent::IMStart ) ) - l->prev(); - if ( l->current() != 0 ) { - // IMCompose must not be compressed with another one - // beyond its IMStart boundary - if ( cur->event->type() == TQEvent::IMStart ) { - break; - } else if ( cur->event->type() == TQEvent::IMCompose ) { - TQIMComposeEvent * e = (TQIMComposeEvent *)(cur->event); - *e = *(TQIMComposeEvent *)event; - delete event; - return; - } - } - break; - }; - } -#endif - - // if no compression could be done, just append something - event->posted = TRUE; - TQPostEvent * pe = new TQPostEvent( receiver, event ); - l->append( pe ); - GlobalPostedEvents()->append( pe ); - -#ifdef TQT_THREAD_SUPPORT - // Wake up the receiver thread event loop - TQThread* thread = receiver->contextThreadObject(); - if (thread) { - if (thread->d) { - if (thread->d->eventLoop) { - thread->d->eventLoop->wakeUp(); - return; - } - } - } - if ( event->type() == TQEvent::MetaCall ) { - return; - } -#endif - - if (currentEventLoop()) { - currentEventLoop()->wakeUp(); - } -} - - -/*! \overload - - Dispatches all posted events, i.e. empties the event queue. -*/ -void TQApplication::sendPostedEvents() -{ - sendPostedEvents( 0, 0 ); -} - - - -/*! - Immediately dispatches all events which have been previously queued - with TQApplication::postEvent() and which are for the object \a receiver - and have the event type \a event_type. - - Note that events from the window system are \e not dispatched by this - function, but by processEvents(). - - If \a receiver is null, the events of \a event_type are sent for all - objects. If \a event_type is 0, all the events are sent for \a receiver. -*/ - -void TQApplication::sendPostedEvents( TQObject *receiver, int event_type ) -{ - // Make sure the object hierarchy is stable before processing events - // to avoid endless loops - if ( receiver == 0 && event_type == 0 ) { - sendPostedEvents( 0, TQEvent::ChildInserted ); - } - -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker locker( GlobalPostedEvents()->mutex() ); -#endif - - bool sent = TRUE; - while ( sent ) { - sent = FALSE; - - if (receiver && !receiver->postedEvents) { - return; - } - - // if we have a receiver, use the local list. Otherwise, use the - // global list - TQPostEventList * l = receiver ? receiver->postedEvents : GlobalPostedEvents(); - - // okay. here is the tricky loop. be careful about optimizing - // this, it looks the way it does for good reasons. - TQPostEventListIt it( *l ); - TQPostEvent *pe; - while ( (pe=it.current()) != 0 ) { - ++it; - Q_ASSERT(pe->receiver); - if ( pe->event // hasn't been sent yet - && ( receiver == 0 // we send to all receivers - || receiver == pe->receiver ) // we send to THAT receiver - && ( event_type == 0 // we send all types - || event_type == pe->event->type() ) // we send THAT type - && ( !pe->receiver->wasDeleted ) // don't send if receiver was deleted -#ifdef TQT_THREAD_SUPPORT - // only send if active thread is receiver object owning thread - && ( pe->receiver->contextThreadObject() == TQThread::currentThreadObject() ) -#endif - ) { - // first, we diddle the event so that we can deliver - // it, and that noone will try to touch it later. - pe->event->posted = FALSE; - TQEvent * e = pe->event; - TQObject * r = pe->receiver; - pe->event = 0; - - // next, update the data structure so that we're ready - // for the next event. - - // look for the local list, and take whatever we're - // delivering out of it. r->postedEvents maybe *l - if ( r->postedEvents ) { - r->postedEvents->removeRef( pe ); - // if possible, get rid of that list. this is not - // ideal - we will create and delete a list for - // each update() call. it would be better if we'd - // leave the list empty here, and delete it - // somewhere else if it isn't being used. - if ( r->postedEvents->isEmpty() ) { - delete r->postedEvents; - r->postedEvents = 0; - } - } - -#ifdef TQT_THREAD_SUPPORT - if ( locker.mutex() ) locker.mutex()->unlock(); -#endif // TQT_THREAD_SUPPORT - // after all that work, it's time to deliver the event. - if ( e->type() == TQEvent::Paint && r->isWidgetType() ) { - TQWidget * w = (TQWidget*)r; - TQPaintEvent * p = (TQPaintEvent*)e; - if ( w->isVisible() ) { - w->repaint( p->reg, p->erase ); - } - } else { - sent = TRUE; - TQApplication::sendEvent( r, e ); - } -#ifdef TQT_THREAD_SUPPORT - if ( locker.mutex() ) locker.mutex()->lock(); -#endif // TQT_THREAD_SUPPORT - - delete e; - // careful when adding anything below this point - the - // sendEvent() call might invalidate any invariants this - // function depends on. - } - } - - // clear the global list, i.e. remove everything that was - // delivered. - if ( l == GlobalPostedEvents() ) { - GlobalPostedEvents()->first(); - while( (pe=GlobalPostedEvents()->current()) != 0 ) { - if ( pe->event ) { - GlobalPostedEvents()->next(); - } - else { - GlobalPostedEvents()->remove(); - } - } - } - } -} - -/*! - Removes all events posted using postEvent() for \a receiver. - - The events are \e not dispatched, instead they are removed from the - queue. You should never need to call this function. If you do call it, - be aware that killing events may cause \a receiver to break one or - more invariants. - - \threadsafe -*/ - -void TQApplication::removePostedEvents( TQObject *receiver ) -{ - removePostedEvents( receiver, 0 ); -} - -/*! - Removes all events that have the event type \a event_type posted - using postEvent() for \a receiver. - - The events are \e not dispatched, instead they are removed from the - queue. - - If \a event_type is 0, all the events are removed from the queue. - - \threadsafe -*/ - -void TQApplication::removePostedEvents( TQObject *receiver, int event_type ) -{ - if ( !receiver ) { - return; - } - -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker locker( GlobalPostedEvents()->mutex() ); -#endif // TQT_THREAD_SUPPORT - - // the TQObject destructor calls this function directly. this can - // happen while the event loop is in the middle of posting events, - // and when we get here, we may not have any more posted events - // for this object. - if ( !receiver->postedEvents ) { - return; - } - - // iterate over the object-specifc list and delete the events. - // leave the TQPostEvent objects; they'll be deleted by - // sendPostedEvents(). - TQPostEventList * l = receiver->postedEvents; - l->first(); - TQPostEvent * pe; - while( (pe=l->current()) != 0 ) { - if ( !event_type || pe->event->type() == event_type ) { - if ( pe->event ) { - pe->event->posted = FALSE; - delete pe->event; - pe->event = 0; - } - l->remove(); - } else { - l->next(); - } - } - if ( !event_type || !l->count() ) { - receiver->postedEvents = 0; - delete l; - } -} - - -/*! - Removes \a event from the queue of posted events, and emits a - warning message if appropriate. - - \warning This function can be \e really slow. Avoid using it, if - possible. - - \threadsafe -*/ - -void TQApplication::removePostedEvent( TQEvent * event ) -{ - if ( !event || !event->posted ) { - return; - } - -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker locker( GlobalPostedEvents()->mutex() ); -#endif // TQT_THREAD_SUPPORT - - TQPostEventListIt it( *GlobalPostedEvents() ); - TQPostEvent * pe; - while( (pe = it.current()) != 0 ) { - ++it; - if ( pe->event == event ) { -#if defined(QT_DEBUG) - const char *n; - switch ( event->type() ) { - case TQEvent::Timer: - n = "Timer"; - break; - case TQEvent::MouseButtonPress: - n = "MouseButtonPress"; - break; - case TQEvent::MouseButtonRelease: - n = "MouseButtonRelease"; - break; - case TQEvent::MouseButtonDblClick: - n = "MouseButtonDblClick"; - break; - case TQEvent::MouseMove: - n = "MouseMove"; - break; -#ifndef TQT_NO_WHEELEVENT - case TQEvent::Wheel: - n = "Wheel"; - break; -#endif - case TQEvent::KeyPress: - n = "KeyPress"; - break; - case TQEvent::KeyRelease: - n = "KeyRelease"; - break; - case TQEvent::FocusIn: - n = "FocusIn"; - break; - case TQEvent::FocusOut: - n = "FocusOut"; - break; - case TQEvent::Enter: - n = "Enter"; - break; - case TQEvent::Leave: - n = "Leave"; - break; - case TQEvent::Paint: - n = "Paint"; - break; - case TQEvent::Move: - n = "Move"; - break; - case TQEvent::Resize: - n = "Resize"; - break; - case TQEvent::Create: - n = "Create"; - break; - case TQEvent::Destroy: - n = "Destroy"; - break; - case TQEvent::Close: - n = "Close"; - break; - case TQEvent::Quit: - n = "Quit"; - break; - default: - n = ""; - break; - } - tqWarning("TQEvent: Warning: %s event deleted while posted to %s %s", - n, - pe->receiver ? pe->receiver->className() : "null", - pe->receiver ? pe->receiver->name() : "object" ); - // note the beautiful uglehack if !pe->receiver :) -#endif - event->posted = FALSE; - delete pe->event; - pe->event = 0; - return; - } - } -} - -#ifdef TQT_THREAD_SUPPORT -static void tqThreadTerminationHandlerRecursive( TQObject* object, TQThread* originThread, TQThread* destinationThread ) { - TQThread* objectThread = object->contextThreadObject(); - if (objectThread && (objectThread == originThread)) { - TQThread::CleanupType cleanupType = objectThread->cleanupType(); - if (cleanupType == TQThread::CleanupMergeObjects) { - object->moveToThread(destinationThread); - } - else if (cleanupType == TQThread::CleanupNone) { - // Do nothing -#if defined(QT_DEBUG) - tqDebug( "TQApplication::threadTerminationHandler: object %p still owned by thread %p at thread termination!", object, objectThread); -#endif // QT_DEBUG - } - else { - // Do nothing -#if defined(QT_DEBUG) - tqDebug( "TQApplication::threadTerminationHandler: invalid thread termination cleanup type %d specified", cleanupType); -#endif // QT_DEBUG - } - } - TQObjectList children = object->childrenListObject(); - TQObject *childObject; - for ( childObject = children.first(); childObject; childObject = children.next() ) { - tqThreadTerminationHandlerRecursive(childObject, originThread, destinationThread); - } -} - -/*!\internal - - Migrates all objects from the specified thread in preparation - for thread destruction. - */ -void TQApplication::threadTerminationHandler( TQThread *originThread ) { - TQMutexLocker locker( tqt_mutex ); - TQThread* destinationThread = guiThread(); - const TQObjectList* objects = TQObject::objectTrees(); - for ( TQObjectListIt objectit( *objects ) ; *objectit; ++objectit ) { - tqThreadTerminationHandlerRecursive((*objectit), originThread, destinationThread); - } -} -#endif // TQT_THREAD_SUPPORT - -/*!\internal - - Sets the active window in reaction to a system event. Call this - from the platform specific event handlers. - - It sets the activeWindow() and focusWidget() attributes and sends - proper WindowActivate/WindowDeactivate and FocusIn/FocusOut events - to all appropriate widgets. - - \sa activeWindow() - */ -void TQApplication::setActiveWindow( TQWidget* act ) -{ - TQWidget* window = act?act->topLevelWidget():0; - - if ( active_window == window ) - return; - - // first the activation/deactivation events - if ( active_window ) { - TQWidgetList deacts; -#ifndef TQT_NO_STYLE - if ( style().styleHint(TQStyle::SH_Widget_ShareActivation, active_window ) ) { - TQWidgetList *list = topLevelWidgets(); - if ( list ) { - for ( TQWidget *w = list->first(); w; w = list->next() ) { - if ( w->isVisible() && w->isActiveWindow() ) - deacts.append(w); - } - delete list; - } - } else -#endif - deacts.append(active_window); - active_window = 0; - TQEvent e( TQEvent::WindowDeactivate ); - for(TQWidget *w = deacts.first(); w; w = deacts.next()) - TQApplication::sendSpontaneousEvent( w, &e ); - } - - active_window = window; - if ( active_window ) { - TQEvent e( TQEvent::WindowActivate ); - TQWidgetList acts; -#ifndef TQT_NO_STYLE - if ( style().styleHint(TQStyle::SH_Widget_ShareActivation, active_window ) ) { - TQWidgetList *list = topLevelWidgets(); - if ( list ) { - for ( TQWidget *w = list->first(); w; w = list->next() ) { - if ( w->isVisible() && w->isActiveWindow() ) - acts.append(w); - } - delete list; - } - } else -#endif - acts.append(active_window); - for(TQWidget *w = acts.first(); w; w = acts.next()) - TQApplication::sendSpontaneousEvent( w, &e ); - } - - // then focus events - TQFocusEvent::setReason( TQFocusEvent::ActiveWindow ); - if ( !active_window && focus_widget ) { - TQFocusEvent out( TQEvent::FocusOut ); - TQWidget *tmp = focus_widget; - focus_widget = 0; -#ifdef TQ_WS_WIN - TQInputContext::accept( tmp ); -#elif defined(TQ_WS_X11) - tmp->unfocusInputContext(); -#endif - TQApplication::sendSpontaneousEvent( tmp, &out ); - } else if ( active_window ) { - TQWidget *w = active_window->focusWidget(); - if ( w && w->focusPolicy() != TQWidget::NoFocus ) - w->setFocus(); - else - active_window->focusNextPrevChild( TRUE ); - } - TQFocusEvent::resetReason(); -} - - -/*!\internal - - Creates the proper Enter/Leave event when widget \a enter is entered - and widget \a leave is left. - */ -TQ_EXPORT void tqt_dispatchEnterLeave( TQWidget* enter, TQWidget* leave ) { -#if 0 - if ( leave ) { - TQEvent e( TQEvent::Leave ); - TQApplication::sendEvent( leave, & e ); - } - if ( enter ) { - TQEvent e( TQEvent::Enter ); - TQApplication::sendEvent( enter, & e ); - } - return; -#endif - - TQWidget* w ; - if ( !enter && !leave ) - return; - TQWidgetList leaveList; - TQWidgetList enterList; - - bool sameWindow = leave && enter && leave->topLevelWidget() == enter->topLevelWidget(); - if ( leave && !sameWindow ) { - w = leave; - do { - leaveList.append( w ); - } while ( (w = w->parentWidget( TRUE ) ) ); - } - if ( enter && !sameWindow ) { - w = enter; - do { - enterList.prepend( w ); - } while ( (w = w->parentWidget(TRUE) ) ); - } - if ( sameWindow ) { - int enterDepth = 0; - int leaveDepth = 0; - w = enter; - while ( ( w = w->parentWidget( TRUE ) ) ) - enterDepth++; - w = leave; - while ( ( w = w->parentWidget( TRUE ) ) ) - leaveDepth++; - TQWidget* wenter = enter; - TQWidget* wleave = leave; - while ( enterDepth > leaveDepth ) { - wenter = wenter->parentWidget(); - enterDepth--; - } - while ( leaveDepth > enterDepth ) { - wleave = wleave->parentWidget(); - leaveDepth--; - } - while ( !wenter->isTopLevel() && wenter != wleave ) { - wenter = wenter->parentWidget(); - wleave = wleave->parentWidget(); - } - - w = leave; - while ( w != wleave ) { - leaveList.append( w ); - w = w->parentWidget(); - } - w = enter; - while ( w != wenter ) { - enterList.prepend( w ); - w = w->parentWidget(); - } - } - - TQEvent leaveEvent( TQEvent::Leave ); - for ( w = leaveList.first(); w; w = leaveList.next() ) { - if ( !tqApp->activeModalWidget() || tqt_tryModalHelper( w, 0 )) - TQApplication::sendEvent( w, &leaveEvent ); - } - TQEvent enterEvent( TQEvent::Enter ); - for ( w = enterList.first(); w; w = enterList.next() ) { - if ( !tqApp->activeModalWidget() || tqt_tryModalHelper( w, 0 )) - TQApplication::sendEvent( w, &enterEvent ); - } -} - - -#ifdef TQ_WS_MACX -extern TQWidget *tqt_tryModalHelperMac( TQWidget * top ); //qapplication_mac.cpp -#endif - - -/*!\internal - - Called from qapplication_.cpp, returns TRUE - if the widget should accept the event. - */ -TQ_EXPORT bool tqt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { - TQWidget *modal=0, *top=TQApplication::activeModalWidget(); - if ( rettop ) *rettop = top; - - if ( tqApp->activePopupWidget() ) - return TRUE; - -#ifdef TQ_WS_MACX - top = tqt_tryModalHelperMac( top ); - if ( rettop ) *rettop = top; -#endif - - TQWidget* groupLeader = widget; - widget = widget->topLevelWidget(); - - if ( widget->testWFlags(TQt::WShowModal) ) // widget is modal - modal = widget; - if ( !top || modal == top ) // don't block event - return TRUE; - - TQWidget * p = widget->parentWidget(); // Check if the active modal widget is a parent of our widget - while ( p ) { - if ( p == top ) - return TRUE; - p = p->parentWidget(); - } - - while ( groupLeader && !groupLeader->testWFlags( TQt::WGroupLeader ) ) - groupLeader = groupLeader->parentWidget(); - - if ( groupLeader ) { - // Does groupLeader have a child in tqt_modal_stack? - bool unrelated = TRUE; - modal = tqt_modal_stack->first(); - while (modal && unrelated) { - TQWidget* p = modal->parentWidget(); - while ( p && p != groupLeader && !p->testWFlags( TQt::WGroupLeader) ) { - p = p->parentWidget(); - } - modal = tqt_modal_stack->next(); - if ( p == groupLeader ) unrelated = FALSE; - } - - if ( unrelated ) - return TRUE; // don't block event - } - return FALSE; -} - - -/*! - Returns the desktop widget (also called the root window). - - The desktop widget is useful for obtaining the size of the screen. - It may also be possible to draw on the desktop. We recommend against - assuming that it's possible to draw on the desktop, since this does - not work on all operating systems. - - \code - TQDesktopWidget *d = TQApplication::desktop(); - int w = d->width(); // returns desktop width - int h = d->height(); // returns desktop height - \endcode -*/ - -TQDesktopWidget *TQApplication::desktop() -{ - if ( !tqt_desktopWidget || // not created yet - !tqt_desktopWidget->isDesktop() ) { // reparented away - tqt_desktopWidget = new TQDesktopWidget(); - TQ_CHECK_PTR( tqt_desktopWidget ); - } - return tqt_desktopWidget; -} - -#ifndef TQT_NO_CLIPBOARD -/*! - Returns a pointer to the application global clipboard. -*/ -TQClipboard *TQApplication::clipboard() -{ - if ( tqt_clipboard == 0 ) { - tqt_clipboard = new TQClipboard; - TQ_CHECK_PTR( tqt_clipboard ); - } - return tqt_clipboard; -} -#endif // TQT_NO_CLIPBOARD - -/*! - By default, TQt will try to use the current standard colors, fonts - etc., from the underlying window system's desktop settings, - and use them for all relevant widgets. This behavior can be switched off - by calling this function with \a on set to FALSE. - - This static function must be called before creating the TQApplication - object, like this: - - \code - int main( int argc, char** argv ) { - TQApplication::setDesktopSettingsAware( FALSE ); // I know better than the user - TQApplication myApp( argc, argv ); // Use default fonts & colors - ... - } - \endcode - - \sa desktopSettingsAware() -*/ - -void TQApplication::setDesktopSettingsAware( bool on ) -{ - obey_desktop_settings = on; -} - -/*! - Returns the value set by setDesktopSettingsAware(); by default TRUE. - - \sa setDesktopSettingsAware() -*/ - -bool TQApplication::desktopSettingsAware() -{ - return obey_desktop_settings; -} - -/*! \fn void TQApplication::lock() - - Lock the TQt Library Mutex. If another thread has already locked the - mutex, the calling thread will block until the other thread has - unlocked the mutex. - - \sa unlock() locked() \link threads.html Thread Support in TQt\endlink -*/ - - -/*! \fn void TQApplication::unlock(bool wakeUpGui) - - Unlock the TQt Library Mutex. If \a wakeUpGui is TRUE (the default), - then the GUI thread will be woken with TQApplication::wakeUpGuiThread(). - - \sa lock(), locked() \link threads.html Thread Support in TQt\endlink -*/ - - -/*! \fn bool TQApplication::locked() - - Returns TRUE if the TQt Library Mutex is locked by a different thread; - otherwise returns FALSE. - - \warning Due to different implementations of recursive mutexes on - the supported platforms, calling this function from the same thread - that previously locked the mutex will give undefined results. - - \sa lock() unlock() \link threads.html Thread Support in TQt\endlink -*/ - -/*! \fn bool TQApplication::tryLock() - - Attempts to lock the TQt Library Mutex, and returns immediately. If - the lock was obtained, this function returns TRUE. If another thread - has locked the mutex, this function returns FALSE, instead of - waiting for the lock to become available. - - The mutex must be unlocked with unlock() before another thread can - successfully lock it. - - \sa lock(), unlock() \link threads.html Thread Support in TQt\endlink -*/ - -#if defined(TQT_THREAD_SUPPORT) -void TQApplication::lock() -{ - tqt_mutex->lock(); -} - -void TQApplication::unlock(bool wakeUpGui) -{ - tqt_mutex->unlock(); - - if (wakeUpGui) - wakeUpGuiThread(); -} - -bool TQApplication::locked() -{ - return tqt_mutex->locked(); -} - -bool TQApplication::tryLock() -{ - return tqt_mutex->tryLock(); -} -#endif - - -/*! - \fn bool TQApplication::isSessionRestored() const - - Returns TRUE if the application has been restored from an earlier - \link session.html session\endlink; otherwise returns FALSE. - - \sa sessionId(), commitData(), saveState() -*/ - - -/*! - \fn TQString TQApplication::sessionId() const - - Returns the current \link session.html session's\endlink identifier. - - If the application has been restored from an earlier session, this - identifier is the same as it was in that previous session. - - The session identifier is guaranteed to be unique both for different - applications and for different instances of the same application. - - \sa isSessionRestored(), sessionKey(), commitData(), saveState() - */ - -/*! - \fn TQString TQApplication::sessionKey() const - - Returns the session key in the current \link session.html - session\endlink. - - If the application has been restored from an earlier session, this - key is the same as it was when the previous session ended. - - The session key changes with every call of commitData() or - saveState(). - - \sa isSessionRestored(), sessionId(), commitData(), saveState() - */ - - -/*! - \fn void TQApplication::commitData( TQSessionManager& sm ) - - This function deals with \link session.html session - management\endlink. It is invoked when the TQSessionManager wants the - application to commit all its data. - - Usually this means saving all open files, after getting - permission from the user. Furthermore you may want to provide a means - by which the user can cancel the shutdown. - - Note that you should not exit the application within this function. - Instead, the session manager may or may not do this afterwards, - depending on the context. - - \warning Within this function, no user interaction is possible, \e - unless you ask the session manager \a sm for explicit permission. - See TQSessionManager::allowsInteraction() and - TQSessionManager::allowsErrorInteraction() for details and example - usage. - - The default implementation requests interaction and sends a close - event to all visible top level widgets. If any event was - rejected, the shutdown is canceled. - - \sa isSessionRestored(), sessionId(), saveState(), \link session.html the Session Management overview\endlink -*/ -#ifndef TQT_NO_SESSIONMANAGER -void TQApplication::commitData( TQSessionManager& sm ) -{ - - if ( sm.allowsInteraction() ) { - TQWidgetList done; - TQWidgetList *list = TQApplication::topLevelWidgets(); - bool cancelled = FALSE; - TQWidget* w = list->first(); - while ( !cancelled && w ) { - if ( !w->isHidden() ) { - TQCloseEvent e; - sendEvent( w, &e ); - cancelled = !e.isAccepted(); - if ( !cancelled ) - done.append( w ); - delete list; // one never knows... - list = TQApplication::topLevelWidgets(); - w = list->first(); - } else { - w = list->next(); - } - while ( w && done.containsRef( w ) ) - w = list->next(); - } - delete list; - if ( cancelled ) - sm.cancel(); - } -} - - -/*! - \fn void TQApplication::saveState( TQSessionManager& sm ) - - This function deals with \link session.html session - management\endlink. It is invoked when the - \link TQSessionManager session manager \endlink wants the application - to preserve its state for a future session. - - For example, a text editor would create a temporary file that - includes the current contents of its edit buffers, the location of - the cursor and other aspects of the current editing session. - - Note that you should never exit the application within this - function. Instead, the session manager may or may not do this - afterwards, depending on the context. Futhermore, most session - managers will very likely request a saved state immediately after - the application has been started. This permits the session manager - to learn about the application's restart policy. - - \warning Within this function, no user interaction is possible, \e - unless you ask the session manager \a sm for explicit permission. - See TQSessionManager::allowsInteraction() and - TQSessionManager::allowsErrorInteraction() for details. - - \sa isSessionRestored(), sessionId(), commitData(), \link session.html the Session Management overview\endlink -*/ - -void TQApplication::saveState( TQSessionManager& /* sm */ ) -{ -} -#endif //TQT_NO_SESSIONMANAGER -/*! - Sets the time after which a drag should start to \a ms ms. - - \sa startDragTime() -*/ - -void TQApplication::setStartDragTime( int ms ) -{ - drag_time = ms; -} - -/*! - If you support drag and drop in you application and a drag should - start after a mouse click and after a certain time elapsed, you - should use the value which this method returns as the delay (in ms). - - TQt also uses this delay internally, e.g. in TQTextEdit and TQLineEdit, - for starting a drag. - - The default value is 500 ms. - - \sa setStartDragTime(), startDragDistance() -*/ - -int TQApplication::startDragTime() -{ - return drag_time; -} - -/*! - Sets the distance after which a drag should start to \a l pixels. - - \sa startDragDistance() -*/ - -void TQApplication::setStartDragDistance( int l ) -{ - drag_distance = l; -} - -/*! - If you support drag and drop in you application and a drag should - start after a mouse click and after moving the mouse a certain - distance, you should use the value which this method returns as the - distance. - - For example, if the mouse position of the click is stored in \c - startPos and the current position (e.g. in the mouse move event) is - \c currPos, you can find out if a drag should be started with code - like this: - \code - if ( ( startPos - currPos ).manhattanLength() > - TQApplication::startDragDistance() ) - startTheDrag(); - \endcode - - TQt uses this value internally, e.g. in TQFileDialog. - - The default value is 4 pixels. - - \sa setStartDragDistance(), startDragTime(), TQPoint::manhattanLength() -*/ - -int TQApplication::startDragDistance() -{ - return drag_distance; -} - -/*! - If \a b is TRUE, all dialogs and widgets will be laid out in a - mirrored fashion, as required by right to left languages such as - Arabic and Hebrew. If \a b is FALSE, dialogs and widgets are laid - out left to right. - - Changing this flag in runtime does not cause a relayout of already - instantiated widgets. - - \sa reverseLayout() -*/ -void TQApplication::setReverseLayout( bool b ) -{ - if ( reverse_layout == b ) - return; - - reverse_layout = b; - - TQWidgetList *list = topLevelWidgets(); - TQWidgetListIt it( *list ); - TQWidget *w; - while ( ( w=it.current() ) != 0 ) { - ++it; - postEvent( w, new TQEvent( TQEvent::LayoutDirectionChange ) ); - } - delete list; -} - -/*! - Returns TRUE if all dialogs and widgets will be laid out in a - mirrored (right to left) fashion. Returns FALSE if dialogs and - widgets will be laid out left to right. - - \sa setReverseLayout() -*/ -bool TQApplication::reverseLayout() -{ - return reverse_layout; -} - - -/*! - \class TQSessionManager tqsessionmanager.h - \brief The TQSessionManager class provides access to the session manager. - - \ingroup application - \ingroup environment - - The session manager is responsible for session management, most - importantly for interruption and resumption. A "session" is a kind - of record of the state of the system, e.g. which applications were - run at start up and which applications are currently running. The - session manager is used to save the session, e.g. when the machine - is shut down; and to restore a session, e.g. when the machine is - started up. Use TQSettings to save and restore an individual - application's settings, e.g. window positions, recently used files, - etc. - - TQSessionManager provides an interface between the application and - the session manager so that the program can work well with the - session manager. In TQt, session management requests for action - are handled by the two virtual functions TQApplication::commitData() - and TQApplication::saveState(). Both provide a reference to - a session manager object as argument, to allow the application - to communicate with the session manager. - - During a session management action (i.e. within commitData() and - saveState()), no user interaction is possible \e unless the - application got explicit permission from the session manager. You - ask for permission by calling allowsInteraction() or, if it's really - urgent, allowsErrorInteraction(). TQt does not enforce this, but the - session manager may. - - You can try to abort the shutdown process by calling cancel(). The - default commitData() function does this if some top-level window - rejected its closeEvent(). - - For sophisticated session managers provided on Unix/X11, TQSessionManager - offers further possibilites to fine-tune an application's session - management behavior: setRestartCommand(), setDiscardCommand(), - setRestartHint(), setProperty(), requestPhase2(). See the respective - function descriptions for further details. -*/ - -/*! \enum TQSessionManager::RestartHint - - This enum type defines the circumstances under which this - application wants to be restarted by the session manager. The - current values are - - \value RestartIfRunning if the application is still running when - the session is shut down, it wants to be restarted at the start of - the next session. - - \value RestartAnyway the application wants to be started at the - start of the next session, no matter what. (This is useful for - utilities that run just after startup and then quit.) - - \value RestartImmediately the application wants to be started - immediately whenever it is not running. - - \value RestartNever the application does not want to be restarted - automatically. - - The default hint is \c RestartIfRunning. -*/ - - -/*! - \fn TQString TQSessionManager::sessionId() const - - Returns the identifier of the current session. - - If the application has been restored from an earlier session, this - identifier is the same as it was in that earlier session. - - \sa sessionKey(), TQApplication::sessionId() - */ - -/*! - \fn TQString TQSessionManager::sessionKey() const - - Returns the session key in the current session. - - If the application has been restored from an earlier session, this - key is the same as it was when the previous session ended. - - The session key changes with every call of commitData() or - saveState(). - - \sa sessionId(), TQApplication::sessionKey() - */ - -// ### Note: This function is undocumented, since it is #ifdef'd. - -/*! - \fn void* TQSessionManager::handle() const - - X11 only: returns a handle to the current \c SmcConnection. -*/ - - -/*! - \fn bool TQSessionManager::allowsInteraction() - - Asks the session manager for permission to interact with the - user. Returns TRUE if interaction is permitted; otherwise - returns FALSE. - - The rationale behind this mechanism is to make it possible to - synchronize user interaction during a shutdown. Advanced session - managers may ask all applications simultaneously to commit their - data, resulting in a much faster shutdown. - - When the interaction is completed we strongly recommend releasing the - user interaction semaphore with a call to release(). This way, other - applications may get the chance to interact with the user while your - application is still busy saving data. (The semaphore is implicitly - released when the application exits.) - - If the user decides to cancel the shutdown process during the - interaction phase, you must tell the session manager that this has - happened by calling cancel(). - - Here's an example of how an application's TQApplication::commitData() - might be implemented: - -\code -void MyApplication::commitData( TQSessionManager& sm ) { - if ( sm.allowsInteraction() ) { - switch ( TQMessageBox::warning( - yourMainWindow, - tr("Application Name"), - tr("Save changes to document Foo?"), - tr("&Yes"), - tr("&No"), - tr("Cancel"), - 0, 2) ) { - case 0: // yes - sm.release(); - // save document here; if saving fails, call sm.cancel() - break; - case 1: // continue without saving - break; - default: // cancel - sm.cancel(); - break; - } - } else { - // we did not get permission to interact, then - // do something reasonable instead. - } -} -\endcode - - If an error occurred within the application while saving its data, - you may want to try allowsErrorInteraction() instead. - - \sa TQApplication::commitData(), release(), cancel() -*/ - - -/*! - \fn bool TQSessionManager::allowsErrorInteraction() - - This is similar to allowsInteraction(), but also tells the session - manager that an error occurred. Session managers may give error - interaction request higher priority, which means that it is more likely - that an error interaction is permitted. However, you are still not - guaranteed that the session manager will allow interaction. - - \sa allowsInteraction(), release(), cancel() -*/ - -/*! - \fn void TQSessionManager::release() - - Releases the session manager's interaction semaphore after an - interaction phase. - - \sa allowsInteraction(), allowsErrorInteraction() -*/ - -/*! - \fn void TQSessionManager::cancel() - - Tells the session manager to cancel the shutdown process. Applications - should not call this function without first asking the user. - - \sa allowsInteraction(), allowsErrorInteraction() - -*/ - -/*! - \fn void TQSessionManager::setRestartHint( RestartHint hint ) - - Sets the application's restart hint to \a hint. On application - startup the hint is set to \c RestartIfRunning. - - Note that these flags are only hints, a session manager may or may - not respect them. - - We recommend setting the restart hint in TQApplication::saveState() - because most session managers perform a checkpoint shortly after an - application's startup. - - \sa restartHint() -*/ - -/*! - \fn TQSessionManager::RestartHint TQSessionManager::restartHint() const - - Returns the application's current restart hint. The default is - \c RestartIfRunning. - - \sa setRestartHint() -*/ - -/*! - \fn void TQSessionManager::setRestartCommand( const TQStringList& command ) - - If the session manager is capable of restoring sessions it will - execute \a command in order to restore the application. The command - defaults to - - \code - appname -session id - \endcode - - The \c -session option is mandatory; otherwise TQApplication cannot - tell whether it has been restored or what the current session - identifier is. See TQApplication::isSessionRestored() and - TQApplication::sessionId() for details. - - If your application is very simple, it may be possible to store the - entire application state in additional command line options. This - is usually a very bad idea because command lines are often limited - to a few hundred bytes. Instead, use TQSettings, or temporary files - or a database for this purpose. By marking the data with the unique - sessionId(), you will be able to restore the application in a future - session. - - \sa restartCommand(), setDiscardCommand(), setRestartHint() -*/ - -/*! - \fn TQStringList TQSessionManager::restartCommand() const - - Returns the currently set restart command. - - Note that if you want to iterate over the list, you should - iterate over a copy, e.g. - \code - TQStringList list = mySession.restartCommand(); - TQStringList::Iterator it = list.begin(); - while( it != list.end() ) { - myProcessing( *it ); - ++it; - } - \endcode - - \sa setRestartCommand(), restartHint() -*/ - -/*! - \fn void TQSessionManager::setDiscardCommand( const TQStringList& ) - - \sa discardCommand(), setRestartCommand() -*/ - - -/*! - \fn TQStringList TQSessionManager::discardCommand() const - - Returns the currently set discard command. - - Note that if you want to iterate over the list, you should - iterate over a copy, e.g. - \code - TQStringList list = mySession.discardCommand(); - TQStringList::Iterator it = list.begin(); - while( it != list.end() ) { - myProcessing( *it ); - ++it; - } - \endcode - - \sa setDiscardCommand(), restartCommand(), setRestartCommand() -*/ - -/*! - \overload void TQSessionManager::setManagerProperty( const TQString& name, - const TQString& value ) - - Low-level write access to the application's identification and state - records are kept in the session manager. - - The property called \a name has its value set to the string \a value. -*/ - -/*! - \fn void TQSessionManager::setManagerProperty( const TQString& name, - const TQStringList& value ) - - Low-level write access to the application's identification and state - record are kept in the session manager. - - The property called \a name has its value set to the string list \a value. -*/ - -/*! - \fn bool TQSessionManager::isPhase2() const - - Returns TRUE if the session manager is currently performing a second - session management phase; otherwise returns FALSE. - - \sa requestPhase2() -*/ - -/*! - \fn void TQSessionManager::requestPhase2() - - Requests a second session management phase for the application. The - application may then return immediately from the - TQApplication::commitData() or TQApplication::saveState() function, - and they will be called again once most or all other applications have - finished their session management. - - The two phases are useful for applications such as the X11 window manager - that need to store information about another application's windows - and therefore have to wait until these applications have completed their - respective session management tasks. - - Note that if another application has requested a second phase it - may get called before, simultaneously with, or after your - application's second phase. - - \sa isPhase2() -*/ - -/*! - \fn int TQApplication::horizontalAlignment( int align ) - - Strips out vertical alignment flags and transforms an - alignment \a align of AlignAuto into AlignLeft or - AlignRight according to the language used. The other horizontal - alignment flags are left untouched. -*/ - - -/***************************************************************************** - Stubbed session management support - *****************************************************************************/ -#ifndef TQT_NO_SESSIONMANAGER -#if defined( TQT_NO_SM_SUPPORT ) || defined( TQ_WS_WIN ) || defined( TQ_WS_MAC ) - -class TQSessionManagerData -{ -public: - TQStringList restartCommand; - TQStringList discardCommand; - TQString sessionId; - TQString sessionKey; - TQSessionManager::RestartHint restartHint; -}; - -TQSessionManager* qt_session_manager_self = 0; -TQSessionManager::TQSessionManager( TQApplication * app, TQString &id, TQString &key ) - : TQObject( app, "qt_sessionmanager" ) -{ - qt_session_manager_self = this; - d = new TQSessionManagerData; -#if defined(TQ_WS_WIN) && !defined(Q_OS_TEMP) - wchar_t guidstr[40]; - GUID guid; - CoCreateGuid( &guid ); - StringFromGUID2(guid, guidstr, 40); - id = TQString::fromUcs2((ushort*)guidstr); - CoCreateGuid( &guid ); - StringFromGUID2(guid, guidstr, 40); - key = TQString::fromUcs2((ushort*)guidstr); -#endif - d->sessionId = id; - d->sessionKey = key; - d->restartHint = RestartIfRunning; -} - -TQSessionManager::~TQSessionManager() -{ - delete d; - qt_session_manager_self = 0; -} - -TQString TQSessionManager::sessionId() const -{ - return d->sessionId; -} - -TQString TQSessionManager::sessionKey() const -{ - return d->sessionKey; -} - - -#if defined(TQ_WS_X11) || defined(TQ_WS_MAC) -void* TQSessionManager::handle() const -{ - return 0; -} -#endif - -#if !defined(TQ_WS_WIN) -bool TQSessionManager::allowsInteraction() -{ - return TRUE; -} - -bool TQSessionManager::allowsErrorInteraction() -{ - return TRUE; -} -void TQSessionManager::release() -{ -} - -void TQSessionManager::cancel() -{ -} -#endif - - -void TQSessionManager::setRestartHint( TQSessionManager::RestartHint hint) -{ - d->restartHint = hint; -} - -TQSessionManager::RestartHint TQSessionManager::restartHint() const -{ - return d->restartHint; -} - -void TQSessionManager::setRestartCommand( const TQStringList& command) -{ - d->restartCommand = command; -} - -TQStringList TQSessionManager::restartCommand() const -{ - return d->restartCommand; -} - -void TQSessionManager::setDiscardCommand( const TQStringList& command) -{ - d->discardCommand = command; -} - -TQStringList TQSessionManager::discardCommand() const -{ - return d->discardCommand; -} - -void TQSessionManager::setManagerProperty( const TQString&, const TQString&) -{ -} - -void TQSessionManager::setManagerProperty( const TQString&, const TQStringList& ) -{ -} - -bool TQSessionManager::isPhase2() const -{ - return FALSE; -} - -void TQSessionManager::requestPhase2() -{ -} - -#endif // TQT_NO_SM_SUPPORT -#endif //TQT_NO_SESSIONMANAGER diff --git a/src/kernel/qapplication_p.h b/src/kernel/qapplication_p.h deleted file mode 100644 index 08911eae7..000000000 --- a/src/kernel/qapplication_p.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Definition of some TQt private functions. -** -** Created : 000228 -** -** 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 TQAPPLICATION_P_H -#define TQAPPLICATION_P_H - - -// -// W A R N I N G -// ------------- -// -// This file is not part of the TQt API. It exists for the convenience -// of qapplication_*.cpp, tqwidget*.cpp, tqcolor_x11.cpp, tqfiledialog.cpp -// and many other. This header file may change from version to version -// without notice, or even be removed. -// -// We mean it. -// -// - -#ifndef QT_H -#endif // QT_H - -class TQWidget; -class TQObject; -class TQClipboard; -class TQKeyEvent; -class TQMouseEvent; -class TQWheelEvent; - -extern TQ_EXPORT bool tqt_modal_state(); -extern TQ_EXPORT void tqt_enter_modal( TQWidget* ); -extern TQ_EXPORT void tqt_leave_modal( TQWidget* ); - -extern bool tqt_is_gui_used; -#ifndef TQT_NO_CLIPBOARD -extern TQClipboard *tqt_clipboard; -#endif - -#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) -extern TQt::WindowsVersion qt_winver; -const int QT_TABLET_NPACKETQSIZE = 128; -# ifdef Q_OS_TEMP - extern DWORD qt_cever; -# endif -#elif defined (Q_OS_MAC) -extern TQt::MacintoshVersion qt_macver; -#endif - -#if defined (TQ_WS_X11) -extern int qt_ncols_option; -#endif - - -extern void tqt_dispatchEnterLeave( TQWidget*, TQWidget* ); -extern bool tqt_tryModalHelper( TQWidget *, TQWidget ** = 0 ); - -#endif diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp deleted file mode 100644 index ec94e78b5..000000000 --- a/src/kernel/qapplication_x11.cpp +++ /dev/null @@ -1,6732 +0,0 @@ -/**************************************************************************** -** -** Implementation of X11 startup routines and event handling -** -** 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. -** -**********************************************************************/ - -// ### 4.0: examine TQ_EXPORT's below. The respective symbols had all -// been in use (e.g. in the KDE wm ) before the introduction of a version -// map. One might want to turn some of them into propert public API and -// provide a proper alternative for others. See also the exports in -// qapplication_win.cpp which suggest a unification. - -#include "qplatformdefs.h" - -// POSIX Large File Support redefines open -> open64 -#if defined(open) -# undef open -#endif - -// Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED. -#if defined(connect) -# undef connect -#endif - -// POSIX Large File Support redefines truncate -> truncate64 -#if defined(truncate) -# undef truncate -#endif - -#include "ntqapplication.h" -#include "qapplication_p.h" -#include "tqcolor_p.h" -#include "tqcursor.h" -#include "tqwidget.h" -#include "tqwidget_p.h" -#include "tqobjectlist.h" -#include "tqwidgetlist.h" -#include "tqwidgetintdict.h" -#include "tqbitarray.h" -#include "tqpainter.h" -#include "tqpixmapcache.h" -#include "tqdatetime.h" -#include "tqtextcodec.h" -#include "tqdatastream.h" -#include "tqbuffer.h" -#include "tqsocketnotifier.h" -#include "tqsessionmanager.h" -#include "tqvaluelist.h" -#include "tqdict.h" -#include "tqguardedptr.h" -#include "tqclipboard.h" -#include "tqwhatsthis.h" // ######## dependency -#include "tqsettings.h" -#include "tqstylefactory.h" -#include "tqfileinfo.h" - -// Input method stuff - UNFINISHED -#ifndef TQT_NO_IM -#include "tqinputcontext.h" -#endif // TQT_NO_IM -#include "tqinternal_p.h" // shared double buffer cleanup - -#if defined(TQT_THREAD_SUPPORT) -# include "tqthread.h" -#endif - -#if defined(QT_DEBUG) && defined(Q_OS_LINUX) -# include "tqfile.h" -#endif - -#include "tqt_x11_p.h" - -#if !defined(TQT_NO_XFTFREETYPE) -// XFree86 4.0.3 implementation is missing XftInitFtLibrary forward -extern "C" Bool XftInitFtLibrary(void); -#endif - -#include -#include -#include -#include -#include - -//#define X_NOT_BROKEN -#ifdef X_NOT_BROKEN -// Some X libraries are built with setlocale #defined to _Xsetlocale, -// even though library users are then built WITHOUT such a definition. -// This creates a problem - TQt might setlocale() one value, but then -// X looks and doesn't see the value TQt set. The solution here is to -// implement _Xsetlocale just in case X calls it - redirecting it to -// the real libC version. -// -# ifndef setlocale -extern "C" char *_Xsetlocale(int category, const char *locale); -char *_Xsetlocale(int category, const char *locale) -{ - //tqDebug("_Xsetlocale(%d,%s),category,locale"); - return setlocale(category,locale); -} -# endif // setlocale -#endif // X_NOT_BROKEN - - -// resolve the conflict between X11's FocusIn and TQEvent::FocusIn -const int XFocusOut = FocusOut; -const int XFocusIn = FocusIn; -#undef FocusOut -#undef FocusIn - -const int XKeyPress = KeyPress; -const int XKeyRelease = KeyRelease; -#undef KeyPress -#undef KeyRelease - - -// Fix old X libraries -#ifndef XK_KP_Home -#define XK_KP_Home 0xFF95 -#endif -#ifndef XK_KP_Left -#define XK_KP_Left 0xFF96 -#endif -#ifndef XK_KP_Up -#define XK_KP_Up 0xFF97 -#endif -#ifndef XK_KP_Right -#define XK_KP_Right 0xFF98 -#endif -#ifndef XK_KP_Down -#define XK_KP_Down 0xFF99 -#endif -#ifndef XK_KP_Prior -#define XK_KP_Prior 0xFF9A -#endif -#ifndef XK_KP_Next -#define XK_KP_Next 0xFF9B -#endif -#ifndef XK_KP_End -#define XK_KP_End 0xFF9C -#endif -#ifndef XK_KP_Insert -#define XK_KP_Insert 0xFF9E -#endif -#ifndef XK_KP_Delete -#define XK_KP_Delete 0xFF9F -#endif - - -/***************************************************************************** - Internal variables and functions - *****************************************************************************/ -static const char *appName; // application name -static const char *appClass; // application class -static const char *appFont = 0; // application font -static const char *appBGCol = 0; // application bg color -static const char *appFGCol = 0; // application fg color -static const char *appBTNCol = 0; // application btn color -static const char *mwGeometry = 0; // main widget geometry -static const char *mwTitle = 0; // main widget title -//Ming-Che 10/10 -TQ_EXPORT char *qt_ximServer = 0; // XIM Server will connect to -static bool mwIconic = FALSE; // main widget iconified -//Ming-Che 10/10 -static Display *appDpy = 0; // X11 application display -static char *appDpyName = 0; // X11 display name -static bool appForeignDpy = FALSE; // we didn't create display -static bool appSync = FALSE; // X11 synchronization -#if defined(QT_DEBUG) -static bool appNoGrab = FALSE; // X11 grabbing enabled -static bool appDoGrab = FALSE; // X11 grabbing override (gdb) -#endif -static int appScreen; // X11 screen number -static int appScreenCount; // X11 screen count -static bool app_save_rootinfo = FALSE; // save root info -static bool app_do_modal = FALSE; // modal mode -static Window curWin = 0; // current window - -static GC* app_gc_ro = 0; // read-only GC -static GC* app_gc_tmp = 0; // temporary GC -static GC* app_gc_ro_m = 0; // read-only GC (monochrome) -static GC* app_gc_tmp_m = 0; // temporary GC (monochrome) -// symbols needed by extern TQXEmbed class -TQ_EXPORT Atom tqt_wm_protocols = 0; // window manager protocols -TQ_EXPORT Atom tqt_wm_delete_window = 0; // delete window protocol -TQ_EXPORT Atom tqt_wm_take_focus = 0; // take focus window protocol - -Atom qt_qt_scrolldone = 0; // scroll synchronization -Atom qt_net_wm_context_help = 0; // context help -Atom qt_net_wm_ping = 0; // _NET_WM_PING protocol - -static Atom qt_xsetroot_id = 0; -Atom qt_xa_clipboard = 0; -Atom qt_selection_property = 0; -Atom tqt_clipboard_sentinel = 0; -Atom qt_selection_sentinel = 0; -TQ_EXPORT Atom tqt_wm_state = 0; -Atom qt_wm_change_state = 0; -static Atom qt_settings_timestamp = 0; // TQt >=3 settings timestamp -static Atom qt_input_encoding = 0; // TQt desktop properties -static Atom qt_resource_manager = 0; // X11 Resource manager -Atom qt_sizegrip = 0; // sizegrip -Atom qt_wm_client_leader = 0; -TQ_EXPORT Atom tqt_window_role = 0; -TQ_EXPORT Atom tqt_sm_client_id = 0; -Atom qt_xa_motif_wm_hints = 0; -Atom qt_cde_running = 0; -Atom qt_twin_running = 0; -Atom qt_kwm_running = 0; -Atom qt_gbackground_properties = 0; -Atom qt_x_incr = 0; -Atom qt_utf8_string = 0; - -// detect broken window managers -Atom qt_sgi_desks_manager = 0; -bool qt_broken_wm = FALSE; -static void qt_detect_broken_window_manager(); - -// NET WM support -Atom qt_net_supported = 0; -Atom qt_net_wm_name = 0; -Atom qt_net_wm_icon_name = 0; -Atom qt_net_virtual_roots = 0; -Atom qt_net_workarea = 0; -Atom qt_net_wm_state = 0; -Atom qt_net_wm_state_modal = 0; -Atom qt_net_wm_state_max_v = 0; -Atom qt_net_wm_state_max_h = 0; -Atom qt_net_wm_state_fullscreen = 0; -Atom qt_net_wm_state_above = 0; -Atom qt_net_wm_action = 0; -Atom qt_net_wm_action_move = 0; -Atom qt_net_wm_action_resize = 0; -Atom qt_net_wm_action_minimize = 0; -Atom qt_net_wm_action_shade = 0; -Atom qt_net_wm_action_stick = 0; -Atom qt_net_wm_action_max_h = 0; -Atom qt_net_wm_action_max_v = 0; -Atom qt_net_wm_action_fullscreen = 0; -Atom qt_net_wm_action_change_desktop = 0; -Atom qt_net_wm_action_close = 0; -Atom qt_net_wm_action_above = 0; -Atom qt_net_wm_action_below = 0; -Atom qt_net_wm_window_type = 0; -Atom qt_net_wm_window_type_normal = 0; -Atom qt_net_wm_window_type_dialog = 0; -Atom qt_net_wm_window_type_toolbar = 0; -Atom qt_net_wm_window_type_menu = 0; -Atom qt_net_wm_window_type_utility = 0; -Atom qt_net_wm_window_type_splash = 0; -Atom qt_net_wm_window_type_override = 0; // KDE extension -Atom qt_net_wm_window_type_dropdown_menu = 0; -Atom qt_net_wm_window_type_popup_menu = 0; -Atom qt_net_wm_window_type_tooltip = 0; -Atom qt_net_wm_window_type_combo = 0; -Atom qt_net_wm_window_type_dnd = 0; -Atom qt_net_wm_frame_strut = 0; // KDE extension -Atom qt_net_wm_state_stays_on_top = 0; // KDE extension -Atom qt_net_wm_pid = 0; -Atom qt_net_wm_user_time = 0; -Atom qt_net_wm_full_placement = 0; // KDE extension -// Enlightenment support -Atom qt_enlightenment_desktop = 0; - -// window managers list of supported "stuff" -Atom *qt_net_supported_list = 0; -// list of virtual root windows -Window *qt_net_virtual_root_list = 0; - - -// X11 SYNC support -#ifndef TQT_NO_XSYNC -Atom qt_net_wm_sync_request_counter = 0; -Atom qt_net_wm_sync_request = 0; -#endif - -// client leader window -Window qt_x11_wm_client_leader = 0; - -// function to update the workarea of the screen - in tqdesktopwidget_x11.cpp -extern void qt_desktopwidget_update_workarea(); - -// current focus model -static const int FocusModel_Unknown = -1; -static const int FocusModel_Other = 0; -static const int FocusModel_PointerRoot = 1; -static int qt_focus_model = -1; - -#ifndef TQT_NO_XRANDR -// TRUE if TQt is compiled w/ XRandR support and XRandR exists on the connected -// Display -bool qt_use_xrandr = FALSE; -static int xrandr_eventbase; -#endif - -// TRUE if TQt is compiled w/ XRender support and XRender exists on the connected -// Display -TQ_EXPORT bool tqt_use_xrender = FALSE; - -#ifndef TQT_NO_XSYNC -// True if SYNC extension exists on the connected display -bool qt_use_xsync = FALSE; -static int xsync_eventbase; -static int xsync_errorbase; -#endif - -// modifier masks for alt/meta - detected when the application starts -static long qt_alt_mask = 0; -static long qt_meta_mask = 0; -// modifier mask to remove mode switch from modifiers that have alt/meta set -// this problem manifests itself on HP/UX 10.20 at least, and without it -// modifiers do not work at all... -static long qt_mode_switch_remove_mask = 0; - -// flags for extensions for special Languages, currently only for RTL languages -static bool qt_use_rtl_extensions = FALSE; -TQ_EXPORT bool tqt_hebrew_keyboard_hack = FALSE; - -static Window mouseActWindow = 0; // window where mouse is -static int mouseButtonPressed = 0; // last mouse button pressed -static int mouseButtonState = 0; // mouse button state -static Time mouseButtonPressTime = 0; // when was a button pressed -static short mouseXPos, mouseYPos; // mouse pres position in act window -static short mouseGlobalXPos, mouseGlobalYPos; // global mouse press position - -extern TQWidgetList *tqt_modal_stack; // stack of modal widgets -static bool ignoreNextMouseReleaseEvent = FALSE; // ignore the next mouse release - // event if return from a modal - // widget - -static TQWidget *popupButtonFocus = 0; -static TQWidget *popupOfPopupButtonFocus = 0; -static bool popupCloseDownMode = FALSE; -static bool popupGrabOk; - -static bool sm_blockUserInput = FALSE; // session management - -int qt_xfocusout_grab_counter = 0; - -#if defined (QT_TABLET_SUPPORT) -// since XInput event classes aren't created until we actually open an XInput -// device, here is a static list that we will use later on... -const int INVALID_EVENT = -1; -const int TOTAL_XINPUT_EVENTS = 7; - -XDevice *devStylus = NULL; -XDevice *devEraser = NULL; -XEventClass event_list_stylus[TOTAL_XINPUT_EVENTS]; -XEventClass event_list_eraser[TOTAL_XINPUT_EVENTS]; - -int qt_curr_events_stylus = 0; -int qt_curr_events_eraser = 0; - -// well, luckily we only need to do this once. -static int xinput_motion = INVALID_EVENT; -static int xinput_key_press = INVALID_EVENT; -static int xinput_key_release = INVALID_EVENT; -static int xinput_button_press = INVALID_EVENT; -static int xinput_button_release = INVALID_EVENT; - -// making this assumption on XFree86, since we can only use 1 device, -// the pressure for the eraser and the stylus should be the same, if they aren't -// well, they certainly have a strange pen then... -static int max_pressure; -extern bool chokeMouse; -#endif - -// last timestamp read from TQSettings -static uint appliedstamp = 0; - - -typedef int (*QX11EventFilter) (XEvent*); -QX11EventFilter tqt_set_x11_event_filter(QX11EventFilter filter); - -static QX11EventFilter qt_x11_event_filter = 0; -TQ_EXPORT QX11EventFilter tqt_set_x11_event_filter(QX11EventFilter filter) -{ - QX11EventFilter old_filter = qt_x11_event_filter; - qt_x11_event_filter = filter; - return old_filter; -} -static bool qt_x11EventFilter( XEvent* ev ) -{ - if ( qt_x11_event_filter && qt_x11_event_filter( ev ) ) - return TRUE; - return tqApp->x11EventFilter( ev ); -} - - - - - -#if !defined(TQT_NO_XIM) -//XIM qt_xim = 0; -TQ_EXPORT XIMStyle qt_xim_style = 0; -TQ_EXPORT XIMStyle qt_xim_preferred_style = 0; -static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing; -#endif - -TQ_EXPORT int qt_ximComposingKeycode=0; -TQ_EXPORT TQTextCodec * qt_input_mapper = 0; - -TQ_EXPORT Time tqt_x_time = CurrentTime; -TQ_EXPORT Time tqt_x_user_time = CurrentTime; -extern bool qt_check_clipboard_sentinel(); //def in tqclipboard_x11.cpp -extern bool qt_check_selection_sentinel(); //def in tqclipboard_x11.cpp - -static void qt_save_rootinfo(); -bool tqt_try_modal( TQWidget *, XEvent * ); - -int qt_ncols_option = 216; // used in tqcolor_x11.cpp -int qt_visual_option = -1; -bool qt_cmap_option = FALSE; -TQWidget *qt_button_down = 0; // widget got last button-down - -extern bool tqt_tryAccelEvent( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp - -struct TQScrollInProgress { - static long serial; - TQScrollInProgress( TQWidget* w, int x, int y ) : - id( serial++ ), scrolled_widget( w ), dx( x ), dy( y ) {} - long id; - TQWidget* scrolled_widget; - int dx, dy; -}; -long TQScrollInProgress::serial=0; -static TQPtrList *sip_list = 0; - - -// stuff in qt_xdnd.cpp -// setup -extern void qt_xdnd_setup(); -// x event handling -extern void qt_handle_xdnd_enter( TQWidget *, const XEvent *, bool ); -extern void qt_handle_xdnd_position( TQWidget *, const XEvent *, bool ); -extern void qt_handle_xdnd_status( TQWidget *, const XEvent *, bool ); -extern void qt_handle_xdnd_leave( TQWidget *, const XEvent *, bool ); -extern void qt_handle_xdnd_drop( TQWidget *, const XEvent *, bool ); -extern void qt_handle_xdnd_finished( TQWidget *, const XEvent *, bool ); -extern void qt_xdnd_handle_selection_request( const XSelectionRequestEvent * ); -extern bool qt_xdnd_handle_badwindow(); - -extern void qt_motifdnd_handle_msg( TQWidget *, const XEvent *, bool ); -extern void qt_x11_motifdnd_init(); - -// client message atoms -extern Atom qt_xdnd_enter; -extern Atom qt_xdnd_position; -extern Atom qt_xdnd_status; -extern Atom qt_xdnd_leave; -extern Atom qt_xdnd_drop; -extern Atom qt_xdnd_finished; -// xdnd selection atom -extern Atom qt_xdnd_selection; -extern bool qt_xdnd_dragging; - -// gui or non-gui from qapplication.cpp -extern bool tqt_is_gui_used; -extern bool tqt_app_has_font; - -static bool qt_x11_cmdline_font = false; - - -extern bool tqt_resolve_symlinks; // from qapplication.cpp - -// Paint event clipping magic -extern void qt_set_paintevent_clipping( TQPaintDevice* dev, const TQRegion& region); -extern void qt_clear_paintevent_clipping(); - - -// Palette handling -extern TQPalette *tqt_std_pal; -extern void tqt_create_std_palette(); - -void qt_x11_intern_atom( const char *, Atom * ); - -static TQPtrList* deferred_map_list = 0; -static void qt_deferred_map_cleanup() -{ - delete deferred_map_list; - deferred_map_list = 0; -} -void qt_deferred_map_add( TQWidget* w) -{ - if ( !deferred_map_list ) { - deferred_map_list = new TQPtrList; - tqAddPostRoutine( qt_deferred_map_cleanup ); - } - deferred_map_list->append( w ); -} -void qt_deferred_map_take( TQWidget* w ) -{ - if (deferred_map_list ) { - deferred_map_list->remove( w ); - } -} -bool qt_deferred_map_contains( TQWidget* w ) -{ - if (!deferred_map_list) - return FALSE; - else - return deferred_map_list->contains( w ); -} - - -class TQETWidget : public TQWidget // event translator widget -{ -public: - void setWState( WFlags f ) { TQWidget::setWState(f); } - void clearWState( WFlags f ) { TQWidget::clearWState(f); } - void setWFlags( WFlags f ) { TQWidget::setWFlags(f); } - void clearWFlags( WFlags f ) { TQWidget::clearWFlags(f); } - bool translateMouseEvent( const XEvent * ); - bool translateKeyEventInternal( const XEvent *, int& count, TQString& text, int& state, char& ascii, int &code, TQEvent::Type &type, bool willRepeat=FALSE, bool statefulTranslation=TRUE ); - bool translateKeyEvent( const XEvent *, bool grab ); - bool translatePaintEvent( const XEvent * ); - bool translateConfigEvent( const XEvent * ); - bool translateCloseEvent( const XEvent * ); - bool translateScrollDoneEvent( const XEvent * ); - bool translateWheelEvent( int global_x, int global_y, int delta, int state, Orientation orient ); -#if defined (QT_TABLET_SUPPORT) - bool translateXinputEvent( const XEvent* ); -#endif - bool translatePropertyEvent(const XEvent *); -}; - - - - -// ************************************************************************ -// Input Method support -// ************************************************************************ - -/*! - An identifier name of the default input method. -*/ -TQString TQApplication::defaultIM = "imsw-multi"; - - -/*! - This function handles the query about location of the widget - holding the TQInputContext instance for widget \a w. - - The input context is used for text input to widget \a w. By - default, it returns the top-level widget of \a w. - - If you want to change the mapping of widget \w to TQInputContext - instance, reimplement both this function and - TQApplication::icHolderWidgets(). For example, suppose a tabbed web - browser. The browser should allocate a input context per tab - widget because users may switch the tabs and input a new text - during previous input contexts live. - - See also 'Sharing input context between text widgets' and 'Preedit - preservation' section of the class description of TQInputContext. - - \sa TQInputContext, icHolderWidgets() -*/ -TQWidget *TQApplication::locateICHolderWidget( TQWidget *w ) -{ - return w->topLevelWidget(); -} - - -/*! - This function returns all widgets holding TQInputContext. - - By default, This function returns top-level widgets. So if you - want to change the mapping of a widget to TQInputContext instance, - you must override this function and locateICHolderWidget(). - - \sa locateICHolderWidget() -*/ -TQWidgetList *TQApplication::icHolderWidgets() -{ - return TQApplication::topLevelWidgets(); -} - - -/*! - This function replaces all TQInputContext instances in the - application. The function's argument is the identifier name of - the newly selected input method. -*/ -void TQApplication::changeAllInputContext( const TQString &identifierName ) -{ - TQWidgetList *list = tqApp->icHolderWidgets(); - TQWidgetListIt it(*list); - while(it.current()) { - it.current()->changeInputContext( identifierName ); - ++it; - } - delete list; - - // defaultIM = identifierName ; // Change of defaultIM -- default input method -- may be enabled. -} - - -/*! - \internal - This is an internal function, you should never call this. - - \sa TQInputContext::imEventGenerated() -*/ -void TQApplication::postIMEvent( TQObject *receiver, TQIMEvent *event ) -{ - if ( event->type() == TQEvent::IMCompose ) { - // enable event compression to reduce preedit flicker on fast - // typing - postEvent( receiver, event ); - } else { - // cancel queued preedit update - if ( event->type() == TQEvent::IMEnd ) - removePostedEvents( receiver, TQEvent::IMCompose ); - - // to avoid event receiving order inversion between TQKeyEvent - // and TQIMEvent, we must send IMStart and IMEnd via - // sendEvent(). - sendEvent( receiver, event ); - delete event; - } -} - - -/*! - This function returns the identifier name of the default input - method in this Application. The value is identical to the value of - TQApplication::defaultIM. -*/ -TQString TQApplication::defaultInputMethod() -{ - return TQApplication::defaultIM; -} - - -#if !defined(TQT_NO_IM_EXTENSIONS) -/*! \internal - Creates the application input method. -*/ -void TQApplication::create_im() -{ -#ifndef TQT_NO_XIM - if ( ! qt_xim_preferred_style ) // no configured input style, use the default - qt_xim_preferred_style = xim_default_style; -#endif // TQT_NO_XIM -} - - -/*! \internal - Closes the application input method. -*/ -void TQApplication::close_im() -{ - TQWidgetList *list = tqApp->icHolderWidgets(); - TQWidgetListIt it(*list); - while(it.current()) { - it.current()->destroyInputContext(); - ++it; - } - delete list; -} - -#else - -/*! \internal - Creates the application input method. -*/ -void TQApplication::create_xim() -{ -#ifndef TQT_NO_XIM - if ( ! qt_xim_preferred_style ) // no configured input style, use the default - qt_xim_preferred_style = xim_default_style; -#endif // TQT_NO_XIM - - TQWidgetList *list= tqApp->topLevelWidgets(); - TQWidgetListIt it(*list); - TQWidget * w; - while( (w=it.current()) != 0 ) { - ++it; - w->createTLSysExtra(); - } - delete list; -} - - - /*! \internal - Closes the application input method. - */ -void TQApplication::close_xim() -{ -#ifndef TQT_NO_XIM - // Calling XCloseIM gives a Purify FMR error - // XCloseIM( qt_xim ); - // We prefer a less serious memory leak - - // if ( qt_xim ) - // qt_xim = 0; - -#endif // TQT_NO_XIM - TQWidgetList *list = tqApp->topLevelWidgets(); - TQWidgetListIt it(*list); - while(it.current()) { - it.current()->destroyInputContext(); - ++it; - } - delete list; -} -#endif - -/***************************************************************************** - Default X error handlers - *****************************************************************************/ - -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif - -static bool x11_ignore_badwindow; -static bool x11_badwindow; - - // starts to ignore bad window errors from X -void qt_ignore_badwindow() -{ - x11_ignore_badwindow = TRUE; - x11_badwindow = FALSE; -} - - // ends ignoring bad window errors and returns whether an error - // had happen. -bool qt_badwindow() -{ - x11_ignore_badwindow = FALSE; - return x11_badwindow; -} - -static int (*original_x_errhandler)( Display *dpy, XErrorEvent * ); -static int (*original_xio_errhandler)( Display *dpy ); - -static int qt_x_errhandler( Display *dpy, XErrorEvent *err ) -{ - if ( err->error_code == BadWindow ) { - x11_badwindow = TRUE; - if ( err->request_code == 25 /* X_SendEvent */ && - qt_xdnd_handle_badwindow() ) - return 0; - if ( x11_ignore_badwindow ) - return 0; - } else if ( err->error_code == BadMatch && - err->request_code == 42 /* X_SetInputFocus */ ) { - return 0; - } - - char errstr[256]; - XGetErrorText( dpy, err->error_code, errstr, 256 ); - tqWarning( "X Error: %s %d\n" - " Major opcode: %d\n" - " Minor opcode: %d\n" - " Resource id: 0x%lx", - errstr, err->error_code, - err->request_code, - err->minor_code, - err->resourceid ); - - // ### we really should distinguish between severe, non-severe and - // ### application specific errors - - return 0; -} - - -static int qt_xio_errhandler( Display * ) -{ - tqWarning( "%s: Fatal IO error: client killed", appName ); - tqApp = 0; - exit( 1 ); - //### give the application a chance for a proper shutdown instead, - //### exit(1) doesn't help. - return 0; -} - -#if defined(Q_C_CALLBACKS) -} -#endif - - -// Memory leak: if the app exits before tqt_init_internal(), this dict -// isn't released correctly. -static TQAsciiDict *atoms_to_be_created = 0; -static bool create_atoms_now = 0; - -/***************************************************************************** - qt_x11_intern_atom() - efficiently interns an atom, now or later. - - If the application is being initialized, this function stores the - adddress of the atom and tqt_init_internal will do the actual work - quickly. If the application is running, the atom is created here. - - Neither argument may point to temporary variables. - *****************************************************************************/ - -void qt_x11_intern_atom( const char *name, Atom *result) -{ - if ( !name || !result || *result ) - return; - - if ( create_atoms_now ) { - *result = XInternAtom( appDpy, name, False ); - } else { - if ( !atoms_to_be_created ) { - atoms_to_be_created = new TQAsciiDict; - atoms_to_be_created->setAutoDelete( FALSE ); - } - atoms_to_be_created->insert( name, result ); - *result = 0; - } -} - - -static void tqt_x11_process_intern_atoms() -{ - if ( atoms_to_be_created ) { -#if defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6) - int i = atoms_to_be_created->count(); - Atom * res = (Atom *)malloc( i * sizeof( Atom ) ); - Atom ** resp = (Atom **)malloc( i * sizeof( Atom* ) ); - char ** names = (char **)malloc( i * sizeof(const char*)); - - i = 0; - TQAsciiDictIterator it( *atoms_to_be_created ); - while( it.current() ) { - res[i] = 0; - resp[i] = it.current(); - names[i] = tqstrdup(it.currentKey()); - i++; - ++it; - } - XInternAtoms( appDpy, names, i, False, res ); - while( i ) { - i--; - delete [] names[i]; - if ( res[i] && resp[i] ) - *(resp[i]) = res[i]; - } - free( res ); - free( resp ); - free( names ); -#else - TQAsciiDictIterator it( *atoms_to_be_created ); - Atom * result; - const char * name; - while( (result = it.current()) != 0 ) { - name = it.currentKey(); - ++it; - *result = XInternAtom( appDpy, name, False ); - } -#endif - delete atoms_to_be_created; - atoms_to_be_created = 0; - create_atoms_now = TRUE; - } -} - - -/*! \internal - apply the settings to the application -*/ -bool TQApplication::x11_apply_settings() -{ - if (! tqt_std_pal) - tqt_create_std_palette(); - - Atom type; - int format; - long offset = 0; - unsigned long nitems, after = 1; - unsigned char *data = 0; - TQDateTime timestamp, settingsstamp; - bool update_timestamp = FALSE; - - if (XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow( 0 ), - qt_settings_timestamp, 0, 0, - False, AnyPropertyType, &type, &format, &nitems, - &after, &data) == Success && format == 8) { - if (data) - XFree(data); - - TQBuffer ts; - ts.open(IO_WriteOnly); - - while (after > 0) { - XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow( 0 ), - qt_settings_timestamp, - offset, 1024, False, AnyPropertyType, - &type, &format, &nitems, &after, &data); - if (format == 8) { - ts.writeBlock((const char *) data, nitems); - offset += nitems / 4; - } - - XFree(data); - } - - TQDataStream d(ts.buffer(), IO_ReadOnly); - d >> timestamp; - } - - TQSettings settings; - settingsstamp = settings.lastModificationTime( "/qt/font" ); - if (! settingsstamp.isValid()) - return FALSE; - - if ( appliedstamp && appliedstamp == settingsstamp.toTime_t() ) - return TRUE; - appliedstamp = settingsstamp.toTime_t(); - - if (! timestamp.isValid() || settingsstamp > timestamp) - update_timestamp = TRUE; - - /* - TQt settings. This is now they are written into the datastream. - - /qt/Palette/ * - TQPalette - /qt/font - TQFont - /qt/libraryPath - TQStringList - /qt/style - TQString - /qt/doubleClickInterval - int - /qt/cursorFlashTime - int - /qt/wheelScrollLines - int - /qt/colorSpec - TQString - /qt/defaultCodec - TQString - /qt/globalStrut - TQSize - /qt/GUIEffects - TQStringList - /qt/Font Substitutions/ * - TQStringList - /qt/Font Substitutions/... - TQStringList - */ - - TQString str; - TQStringList strlist; - int i, num; - TQPalette pal(TQApplication::palette()); - strlist = settings.readListEntry("/qt/Palette/active"); - if (strlist.count() == TQColorGroup::NColorRoles) { - for (i = 0; i < TQColorGroup::NColorRoles; i++) - pal.setColor(TQPalette::Active, (TQColorGroup::ColorRole) i, - TQColor(strlist[i])); - } - strlist = settings.readListEntry("/qt/Palette/inactive"); - if (strlist.count() == TQColorGroup::NColorRoles) { - for (i = 0; i < TQColorGroup::NColorRoles; i++) - pal.setColor(TQPalette::Inactive, (TQColorGroup::ColorRole) i, - TQColor(strlist[i])); - } - strlist = settings.readListEntry("/qt/Palette/disabled"); - if (strlist.count() == TQColorGroup::NColorRoles) { - for (i = 0; i < TQColorGroup::NColorRoles; i++) - pal.setColor(TQPalette::Disabled, (TQColorGroup::ColorRole) i, - TQColor(strlist[i])); - } - - // workaround for KDE 3.0, which messes up the buttonText value of - // the disabled palette in TQSettings - if ( pal.disabled().buttonText() == pal.active().buttonText() ) { - pal.setColor( TQPalette::Disabled, TQColorGroup::ButtonText, - pal.disabled().foreground() ); - } - - if (pal != *tqt_std_pal && pal != TQApplication::palette()) { - TQApplication::setPalette(pal, TRUE); - *tqt_std_pal = pal; - } - - TQFont font(TQApplication::font()); - if ( !tqt_app_has_font && !qt_x11_cmdline_font ) { - // read new font - str = settings.readEntry("/qt/font"); - if (! str.isNull() && ! str.isEmpty()) { - font.fromString(str); - - if (font != TQApplication::font()) - TQApplication::setFont(font, TRUE); - } - } - - // read library (ie. plugin) path list - TQString libpathkey = - TQString("/qt/%1.%2/libraryPath").arg( TQT_VERSION >> 16 ).arg( (TQT_VERSION & 0xff00 ) >> 8 ); - TQStringList pathlist = settings.readListEntry(libpathkey, ':'); - if (! pathlist.isEmpty()) { - TQStringList::ConstIterator it = pathlist.begin(); - while (it != pathlist.end()) - TQApplication::addLibraryPath(*it++); - } - - // read new TQStyle - extern bool tqt_explicit_app_style; // defined in qapplication.cpp - TQString stylename = settings.readEntry( "/qt/style" ); - if ( !stylename.isEmpty() && !tqt_explicit_app_style ) { - TQApplication::setStyle( stylename ); - // took the style from the user settings, so mark the explicit flag FALSE - tqt_explicit_app_style = FALSE; - } - - num = - settings.readNumEntry("/qt/doubleClickInterval", - TQApplication::doubleClickInterval()); - TQApplication::setDoubleClickInterval(num); - - num = - settings.readNumEntry("/qt/cursorFlashTime", - TQApplication::cursorFlashTime()); - TQApplication::setCursorFlashTime(num); - - num = - settings.readNumEntry("/qt/wheelScrollLines", - TQApplication::wheelScrollLines()); - TQApplication::setWheelScrollLines(num); - - TQString colorspec = settings.readEntry("/qt/colorSpec", "default"); - if (colorspec == "normal") - TQApplication::setColorSpec(TQApplication::NormalColor); - else if (colorspec == "custom") - TQApplication::setColorSpec(TQApplication::CustomColor); - else if (colorspec == "many") - TQApplication::setColorSpec(TQApplication::ManyColor); - else if (colorspec != "default") - colorspec = "default"; - - TQString defaultcodec = settings.readEntry("/qt/defaultCodec", "none"); - if (defaultcodec != "none") { - TQTextCodec *codec = TQTextCodec::codecForName(defaultcodec); - if (codec) - tqApp->setDefaultCodec(codec); - } - - TQStringList strut = settings.readListEntry("/qt/globalStrut"); - if (! strut.isEmpty()) { - if (strut.count() == 2) { - TQSize sz(strut[0].toUInt(), strut[1].toUInt()); - - if (sz.isValid()) - TQApplication::setGlobalStrut(sz); - } - } - - TQStringList effects = settings.readListEntry("/qt/GUIEffects"); - - TQApplication::setEffectEnabled( TQt::UI_General, effects.contains("general") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, effects.contains("animatemenu") ); - TQApplication::setEffectEnabled( TQt::UI_FadeMenu, effects.contains("fademenu") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, effects.contains("animatecombo") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, effects.contains("animatetooltip") ); - TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, effects.contains("fadetooltip") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateToolBox, effects.contains("animatetoolbox") ); - - TQStringList fontsubs = - settings.entryList("/qt/Font Substitutions"); - if (!fontsubs.isEmpty()) { - TQStringList subs; - TQString fam, skey; - TQStringList::Iterator it = fontsubs.begin(); - while (it != fontsubs.end()) { - fam = (*it++); - skey = "/qt/Font Substitutions/" + fam; - subs = settings.readListEntry(skey); - TQFont::insertSubstitutions(fam, subs); - } - } - - qt_broken_wm = - settings.readBoolEntry("/qt/brokenWindowManager", qt_broken_wm); - - tqt_resolve_symlinks = - settings.readBoolEntry("/qt/resolveSymlinks", TRUE); - - qt_use_rtl_extensions = - settings.readBoolEntry("/qt/useRtlExtensions", FALSE); - -#ifndef TQT_NO_XIM - if (qt_xim_preferred_style == 0) { - TQString ximInputStyle = - settings.readEntry( "/qt/XIMInputStyle", - TQString::fromLatin1( "On The Spot" ) ).lower(); - if ( ximInputStyle == "over the spot" ) - qt_xim_preferred_style = XIMPreeditPosition | XIMStatusNothing; - else if ( ximInputStyle == "off the spot" ) - qt_xim_preferred_style = XIMPreeditArea | XIMStatusArea; - else if ( ximInputStyle == "root" ) - qt_xim_preferred_style = XIMPreeditNothing | XIMStatusNothing; - else // ximInputStyle == "on the spot" or others - qt_xim_preferred_style = XIMPreeditCallbacks | XIMStatusNothing; - } -#endif - -#ifndef TQT_NO_IM - /* - The identifier name of an input method is acquired from the - configuration file as a default. If a environment variable - "TQT_IM_SWITCHER" is not empty it will overwrite the - configuration file. The "imsw-multi" becomes the default if the entry - is not configured. - */ - if ( getenv( "TQT_IM_SWITCHER" ) ) - defaultIM = getenv( "TQT_IM_SWITCHER" ); -#ifndef TQT_NO_IM_EXTENSIONS - else - defaultIM = settings.readEntry( "/qt/DefaultInputMethodSwitcher", "imsw-multi" ); -#endif - - // defaultIM is restricted to be an IM-switcher. An IM-switcher - // has a 'imsw-' prefix - if ( ! defaultIM.startsWith( "imsw-" ) ) { - defaultIM = "imsw-multi"; - } -#endif - - if (update_timestamp) { - TQBuffer stamp; - TQDataStream s(stamp.buffer(), IO_WriteOnly); - s << settingsstamp; - - XChangeProperty(appDpy, TQPaintDevice::x11AppRootWindow( 0 ), - qt_settings_timestamp, qt_settings_timestamp, 8, - PropModeReplace, (unsigned char *) stamp.buffer().data(), - stamp.buffer().size()); - } - - return TRUE; -} - - -// read the _QT_INPUT_ENCODING property and apply the settings to -// the application -static void qt_set_input_encoding() -{ - Atom type; - int format; - ulong nitems, after = 1; - const char *data; - - int e = XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), - qt_input_encoding, 0, 1024, - False, XA_STRING, &type, &format, &nitems, - &after, (unsigned char**)&data ); - if ( e != Success || !nitems || type == None ) { - // Always use the locale codec, since we have no examples of non-local - // XIMs, and since we cannot get a sensible answer about the encoding - // from the XIM. - qt_input_mapper = TQTextCodec::codecForLocale(); - - } else { - if ( !tqstricmp( data, "locale" ) ) - qt_input_mapper = TQTextCodec::codecForLocale(); - else - qt_input_mapper = TQTextCodec::codecForName( data ); - // make sure we have an input codec - if( !qt_input_mapper ) - qt_input_mapper = TQTextCodec::codecForName( "ISO 8859-1" ); - } - if ( qt_input_mapper->mibEnum() == 11 ) // 8859-8 - qt_input_mapper = TQTextCodec::codecForName( "ISO 8859-8-I"); - if( data ) - XFree( (char *)data ); -} - -// set font, foreground and background from x11 resources. The -// arguments may override the resource settings. -static void qt_set_x11_resources( const char* font = 0, const char* fg = 0, - const char* bg = 0, const char* button = 0 ) -{ - if ( !tqt_std_pal ) - tqt_create_std_palette(); - - TQCString resFont, resFG, resBG, resEF, sysFont; - - TQApplication::setEffectEnabled( TQt::UI_General, FALSE); - TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, FALSE); - TQApplication::setEffectEnabled( TQt::UI_FadeMenu, FALSE); - TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, FALSE ); - TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, FALSE ); - TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, FALSE ); - TQApplication::setEffectEnabled( TQt::UI_AnimateToolBox, FALSE ); - - if ( TQApplication::desktopSettingsAware() && !TQApplication::x11_apply_settings() ) { - int format; - ulong nitems, after = 1; - TQCString res; - long offset = 0; - Atom type = None; - - while (after > 0) { - uchar *data; - XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow( 0 ), - qt_resource_manager, - offset, 8192, False, AnyPropertyType, - &type, &format, &nitems, &after, - &data ); - res += (char*)data; - offset += 2048; // offset is in 32bit quantities... 8192/4 == 2048 - if ( data ) - XFree( (char *)data ); - } - - TQCString key, value; - int l = 0, r; - TQCString apn = appName; - TQCString apc = appClass; - int apnl = apn.length(); - int apcl = apc.length(); - int resl = res.length(); - - while (l < resl) { - r = res.find( '\n', l ); - if ( r < 0 ) - r = resl; - while ( isspace((uchar) res[l]) ) - l++; - bool mine = FALSE; - if ( res[l] == '*' && - (res[l+1] == 'f' || res[l+1] == 'b' || res[l+1] == 'g' || - res[l+1] == 'F' || res[l+1] == 'B' || res[l+1] == 'G' || - res[l+1] == 's' || res[l+1] == 'S' ) ) { - // OPTIMIZED, since we only want "*[fbgs].." - - TQCString item = res.mid( l, r - l ).simplifyWhiteSpace(); - int i = item.find( ":" ); - key = item.left( i ).stripWhiteSpace().mid(1).lower(); - value = item.right( item.length() - i - 1 ).stripWhiteSpace(); - mine = TRUE; - } else if ( res[l] == appName[0] || (appClass && res[l] == appClass[0]) ) { - if (res.mid(l,apnl) == apn && (res[l+apnl] == '.' || res[l+apnl] == '*')) { - TQCString item = res.mid( l, r - l ).simplifyWhiteSpace(); - int i = item.find( ":" ); - key = item.left( i ).stripWhiteSpace().mid(apnl+1).lower(); - value = item.right( item.length() - i - 1 ).stripWhiteSpace(); - mine = TRUE; - } else if (res.mid(l,apcl) == apc && (res[l+apcl] == '.' || res[l+apcl] == '*')) { - TQCString item = res.mid( l, r - l ).simplifyWhiteSpace(); - int i = item.find( ":" ); - key = item.left( i ).stripWhiteSpace().mid(apcl+1).lower(); - value = item.right( item.length() - i - 1 ).stripWhiteSpace(); - mine = TRUE; - } - } - - if ( mine ) { - if ( !font && key == "systemfont") - sysFont = value.left( value.findRev(':') ).copy(); - if ( !font && key == "font") - resFont = value.copy(); - else if ( !fg && key == "foreground" ) - resFG = value.copy(); - else if ( !bg && key == "background") - resBG = value.copy(); - else if ( key == "guieffects") - resEF = value.copy(); - // NOTE: if you add more, change the [fbg] stuff above - } - - l = r + 1; - } - } - if ( !sysFont.isEmpty() ) - resFont = sysFont; - if ( resFont.isEmpty() ) - resFont = font; - if ( resFG.isEmpty() ) - resFG = fg; - if ( resBG.isEmpty() ) - resBG = bg; - if ( (!tqt_app_has_font || qt_x11_cmdline_font) && !resFont.isEmpty() ) { // set application font - TQFont fnt; - fnt.setRawName( resFont ); - - // the font we get may actually be an alias for another font, - // so we reset the application font to the real font info. - if ( ! fnt.exactMatch() ) { - TQFontInfo fontinfo( fnt ); - fnt.setFamily( fontinfo.family() ); - fnt.setRawMode( fontinfo.rawMode() ); - - if ( ! fnt.rawMode() ) { - fnt.setItalic( fontinfo.italic() ); - fnt.setWeight( fontinfo.weight() ); - fnt.setUnderline( fontinfo.underline() ); - fnt.setStrikeOut( fontinfo.strikeOut() ); - fnt.setStyleHint( fontinfo.styleHint() ); - - if ( fnt.pointSize() <= 0 && fnt.pixelSize() <= 0 ) - // size is all wrong... fix it - fnt.setPointSize( (int) ( ( fontinfo.pixelSize() * 72. / - (float) TQPaintDevice::x11AppDpiY() ) + - 0.5 ) ); - } - } - - if ( fnt != TQApplication::font() ) { - TQApplication::setFont( fnt, TRUE ); - } - } - - if ( button || !resBG.isEmpty() || !resFG.isEmpty() ) {// set app colors - TQColor btn; - TQColor bg; - TQColor fg; - if ( !resBG.isEmpty() ) - bg = TQColor(TQString(resBG)); - else - bg = tqt_std_pal->active().background(); - if ( !resFG.isEmpty() ) - fg = TQColor(TQString(resFG)); - else - fg = tqt_std_pal->active().foreground(); - if ( button ) - btn = TQColor( button ); - else if ( !resBG.isEmpty() ) - btn = bg; - else - btn = tqt_std_pal->active().button(); - - int h,s,v; - fg.hsv(&h,&s,&v); - TQColor base = TQt::white; - bool bright_mode = FALSE; - if (v >= 255-50) { - base = btn.dark(150); - bright_mode = TRUE; - } - - TQColorGroup cg( fg, btn, btn.light(), - btn.dark(), btn.dark(150), fg, TQt::white, base, bg ); - if (bright_mode) { - cg.setColor( TQColorGroup::HighlightedText, base ); - cg.setColor( TQColorGroup::Highlight, TQt::white ); - } else { - cg.setColor( TQColorGroup::HighlightedText, TQt::white ); - cg.setColor( TQColorGroup::Highlight, TQt::darkBlue ); - } - TQColor disabled( (fg.red()+btn.red())/2, - (fg.green()+btn.green())/2, - (fg.blue()+btn.blue())/2); - TQColorGroup dcg( disabled, btn, btn.light( 125 ), btn.dark(), btn.dark(150), - disabled, TQt::white, TQt::white, bg ); - if (bright_mode) { - dcg.setColor( TQColorGroup::HighlightedText, base ); - dcg.setColor( TQColorGroup::Highlight, TQt::white ); - } else { - dcg.setColor( TQColorGroup::HighlightedText, TQt::white ); - dcg.setColor( TQColorGroup::Highlight, TQt::darkBlue ); - } - TQPalette pal( cg, dcg, cg ); - if ( pal != *tqt_std_pal && pal != TQApplication::palette() ) - TQApplication::setPalette( pal, TRUE ); - *tqt_std_pal = pal; - } - - if ( !resEF.isEmpty() ) { - TQStringList effects = TQStringList::split(" ",resEF); - TQApplication::setEffectEnabled( TQt::UI_General, effects.contains("general") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, effects.contains("animatemenu") ); - TQApplication::setEffectEnabled( TQt::UI_FadeMenu, effects.contains("fademenu") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, effects.contains("animatecombo") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, effects.contains("animatetooltip") ); - TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, effects.contains("fadetooltip") ); - TQApplication::setEffectEnabled( TQt::UI_AnimateToolBox, effects.contains("animatetoolbox") ); - } -} - - -static void qt_detect_broken_window_manager() -{ - Atom type; - int format; - ulong nitems, after; - uchar *data = 0; - - // look for SGI's 4Dwm - int e = XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), - qt_sgi_desks_manager, 0, 1, False, XA_WINDOW, - &type, &format, &nitems, &after, &data); - if (data) - XFree(data); - - if (e == Success && type == XA_WINDOW && format == 32 && nitems == 1 && after == 0) { - // detected SGI 4Dwm - qt_broken_wm = TRUE; - } -} - - -// update the supported array -void qt_get_net_supported() -{ - Atom type; - int format; - long offset = 0; - unsigned long nitems, after; - unsigned char *data = 0; - - int e = XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), - qt_net_supported, 0, 0, - False, XA_ATOM, &type, &format, &nitems, &after, &data); - if (data) - XFree(data); - - if (qt_net_supported_list) - delete [] qt_net_supported_list; - qt_net_supported_list = 0; - - if (e == Success && type == XA_ATOM && format == 32) { - TQBuffer ts; - ts.open(IO_WriteOnly); - - while (after > 0) { - XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), - qt_net_supported, offset, 1024, - False, XA_ATOM, &type, &format, &nitems, &after, &data); - - if (type == XA_ATOM && format == 32) { - ts.writeBlock((const char *) data, nitems * sizeof(long)); - offset += nitems; - } else - after = 0; - if (data) - XFree(data); - } - - // compute nitems - TQByteArray buffer(ts.buffer()); - nitems = buffer.size() / sizeof(Atom); - qt_net_supported_list = new Atom[nitems + 1]; - Atom *a = (Atom *) buffer.data(); - uint i; - for (i = 0; i < nitems; i++) - qt_net_supported_list[i] = a[i]; - qt_net_supported_list[nitems] = 0; - } -} - - -bool qt_net_supports(Atom atom) -{ - if (! qt_net_supported_list) - return FALSE; - - bool supported = FALSE; - int i = 0; - while (qt_net_supported_list[i] != 0) { - if (qt_net_supported_list[i++] == atom) { - supported = TRUE; - break; - } - } - - return supported; -} - - -// update the virtual roots array -void qt_get_net_virtual_roots() -{ - if (qt_net_virtual_root_list) - delete [] qt_net_virtual_root_list; - qt_net_virtual_root_list = 0; - - if (! qt_net_supports(qt_net_virtual_roots)) - return; - - Atom type; - int format; - long offset = 0; - unsigned long nitems, after; - unsigned char *data; - - int e = XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), - qt_net_virtual_roots, 0, 0, - False, XA_ATOM, &type, &format, &nitems, &after, &data); - if (data) - XFree(data); - - if (e == Success && type == XA_ATOM && format == 32) { - TQBuffer ts; - ts.open(IO_WriteOnly); - - while (after > 0) { - XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), - qt_net_virtual_roots, offset, 1024, - False, XA_ATOM, &type, &format, &nitems, &after, &data); - - if (type == XA_ATOM && format == 32) { - ts.writeBlock((const char *) data, nitems * 4); - offset += nitems; - } else - after = 0; - if (data) - XFree(data); - } - - // compute nitems - TQByteArray buffer(ts.buffer()); - nitems = buffer.size() / sizeof(Window); - qt_net_virtual_root_list = new Window[nitems + 1]; - Window *a = (Window *) buffer.data(); - uint i; - for (i = 0; i < nitems; i++) - qt_net_virtual_root_list[i] = a[i]; - qt_net_virtual_root_list[nitems] = 0; - } -} - -void qt_x11_create_wm_client_leader() -{ - if ( qt_x11_wm_client_leader ) return; - - qt_x11_wm_client_leader = - XCreateSimpleWindow( TQPaintDevice::x11AppDisplay(), - TQPaintDevice::x11AppRootWindow(), - 0, 0, 1, 1, 0, 0, 0 ); - - // set client leader property to itself - XChangeProperty( TQPaintDevice::x11AppDisplay(), - qt_x11_wm_client_leader, qt_wm_client_leader, - XA_WINDOW, 32, PropModeReplace, - (unsigned char *)&qt_x11_wm_client_leader, 1 ); - - // If we are session managed, inform the window manager about it - TQCString session = tqApp->sessionId().latin1(); - if ( !session.isEmpty() ) { - XChangeProperty( TQPaintDevice::x11AppDisplay(), - qt_x11_wm_client_leader, tqt_sm_client_id, - XA_STRING, 8, PropModeReplace, - (unsigned char *)session.data(), session.length() ); - } -} - -static void qt_net_update_user_time(TQWidget *tlw) -{ - XChangeProperty(TQPaintDevice::x11AppDisplay(), tlw->winId(), qt_net_wm_user_time, XA_CARDINAL, - 32, PropModeReplace, (unsigned char *) &tqt_x_user_time, 1); -} - -static void qt_check_focus_model() -{ - Window fw = None; - int unused; - XGetInputFocus( appDpy, &fw, &unused ); - if ( fw == PointerRoot ) - qt_focus_model = FocusModel_PointerRoot; - else - qt_focus_model = FocusModel_Other; -} - - -/* - Returns a truecolor visual (if there is one). 8-bit TrueColor visuals - are ignored, unless the user has explicitly requested -visual TrueColor. - The SGI X server usually has an 8 bit default visual, but the application - can also ask for a truecolor visual. This is what we do if - TQApplication::colorSpec() is TQApplication::ManyColor. -*/ - -static Visual *find_truecolor_visual( Display *dpy, int scr, int *depth, int *ncols ) -{ - XVisualInfo *vi, rvi; - int best=0, n, i; - rvi.c_class = TrueColor; - rvi.screen = scr; - vi = XGetVisualInfo( dpy, VisualClassMask | VisualScreenMask, - &rvi, &n ); - if ( vi ) { - for ( i=0; i vi[best].depth ) - best = i; - } - } - Visual *v = DefaultVisual(dpy,scr); - if ( !vi || (vi[best].visualid == XVisualIDFromVisual(v)) || - (vi[best].depth <= 8 && qt_visual_option != TrueColor) ) - { - *depth = DefaultDepth(dpy,scr); - *ncols = DisplayCells(dpy,scr); - } else { - v = vi[best].visual; - *depth = vi[best].depth; - *ncols = vi[best].colormap_size; - } - if ( vi ) - XFree( (char *)vi ); - return v; -} - -static KeySym qt_x11_keycode_to_keysym(Display *dpy, KeyCode kc) { -#ifndef TQT_NO_XKB - return XkbKeycodeToKeysym(dpy, kc, 0, 0); -#else - KeySym rv = NoSymbol; - int keysyms_per_keycode; - KeySym *keysym_p = XGetKeyboardMapping(dpy, kc, 1, &keysyms_per_keycode); - if (keysyms_per_keycode>0) { //< Should always be true unless X server is bugged - rv = keysym_p[0]; - } - XFree(keysym_p); - - return rv; -#endif // TQT_NO_XKB -} - -/***************************************************************************** - tqt_init() - initializes TQt for X11 - *****************************************************************************/ - -#define XK_MISCELLANY -#define XK_LATIN1 -#define XK_KOREAN -#define XK_XKB_KEYS -#include - -// ### This should be static but it isn't because of the friend declaration -// ### in tqpaintdevice.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 tqt_init_internal( int *argcptr, char **argv, - Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) -{ - setlocale( LC_ALL, "" ); // use correct char set mapping - setlocale( LC_NUMERIC, "C" ); // make sprintf()/scanf() work - -#if defined(TQT_THREAD_SUPPORT) - if (( tqt_is_gui_used ) && ( !display )) { - // If TQt is running standalone with a GUI, initialize X11 threading - XInitThreads(); - } -#endif - - if ( display && ((!argcptr) || (!argv)) ) { - // TQt part of other application - - appForeignDpy = TRUE; - appDpy = display; - - // Set application name and class - appName = tqstrdup( "TQt-subapplication" ); - char *app_class = 0; - if (argv) { - const char* p = strrchr( argv[0], '/' ); - app_class = tqstrdup(p ? p + 1 : argv[0]); - if (app_class[0]) - app_class[0] = toupper(app_class[0]); - } - appClass = app_class; - - // Install default error handlers - original_x_errhandler = XSetErrorHandler( qt_x_errhandler ); - original_xio_errhandler = XSetIOErrorHandler( qt_xio_errhandler ); - } else { - // TQt controls everything (default) - - int argc = *argcptr; - int j; - - // Install default error handlers - original_x_errhandler = XSetErrorHandler( qt_x_errhandler ); - original_xio_errhandler = XSetIOErrorHandler( qt_xio_errhandler ); - - // Set application name and class - char *app_class = 0; - if (argv) { - const char *p = strrchr( argv[0], '/' ); - appName = p ? p + 1 : argv[0]; - app_class = tqstrdup(appName); - if (app_class[0]) - app_class[0] = toupper(app_class[0]); - } - appClass = app_class; - - // Get command line params - j = argc ? 1 : 0; - for ( int i=1; i 0 ) { - if ( c == '/' ) - s.truncate( 0 ); - else - s += (char)c; - } - if ( s == "gdb" ) { - appNoGrab = TRUE; - tqDebug( "TQt: gdb: -nograb added to command-line options.\n" - "\t Use the -dograb option to enforce grabbing." ); - } - f.close(); - } - } -#endif - if ( display ) { - // Display connection already opened by another application - - appForeignDpy = TRUE; - appDpy = display; - } - else { - // Connect to X server - - if( tqt_is_gui_used ) { - if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) { - tqWarning( "%s: cannot connect to X server %s", appName, - XDisplayName(appDpyName) ); - tqApp = 0; - exit( 1 ); - } - - if ( appSync ) // if "-sync" argument - XSynchronize( appDpy, TRUE ); - } - } - } - // Common code, regardless of whether display is foreign. - - // Get X parameters - - if( tqt_is_gui_used ) { - appScreen = DefaultScreen(appDpy); - appScreenCount = ScreenCount(appDpy); - - TQPaintDevice::x_appdisplay = appDpy; - TQPaintDevice::x_appscreen = appScreen; - - // allocate the arrays for the TQPaintDevice data - TQPaintDevice::x_appdepth_arr = new int[ appScreenCount ]; - TQPaintDevice::x_appcells_arr = new int[ appScreenCount ]; - TQPaintDevice::x_approotwindow_arr = new TQt::HANDLE[ appScreenCount ]; - TQPaintDevice::x_appcolormap_arr = new TQt::HANDLE[ appScreenCount ]; - TQPaintDevice::x_appdefcolormap_arr = new bool[ appScreenCount ]; - TQPaintDevice::x_appvisual_arr = new void*[ appScreenCount ]; - TQPaintDevice::x_appdefvisual_arr = new bool[ appScreenCount ]; - TQ_CHECK_PTR( TQPaintDevice::x_appdepth_arr ); - TQ_CHECK_PTR( TQPaintDevice::x_appcells_arr ); - TQ_CHECK_PTR( TQPaintDevice::x_approotwindow_arr ); - TQ_CHECK_PTR( TQPaintDevice::x_appcolormap_arr ); - TQ_CHECK_PTR( TQPaintDevice::x_appdefcolormap_arr ); - TQ_CHECK_PTR( TQPaintDevice::x_appvisual_arr ); - TQ_CHECK_PTR( TQPaintDevice::x_appdefvisual_arr ); - - int screen; - TQString serverVendor( ServerVendor( appDpy) ); - if (serverVendor.contains("XFree86") && VendorRelease(appDpy) < 40300000) - tqt_hebrew_keyboard_hack = TRUE; - - for ( screen = 0; screen < appScreenCount; ++screen ) { - TQPaintDevice::x_appdepth_arr[ screen ] = DefaultDepth(appDpy, screen); - TQPaintDevice::x_appcells_arr[ screen ] = DisplayCells(appDpy, screen); - TQPaintDevice::x_approotwindow_arr[ screen ] = RootWindow(appDpy, screen); - - // setup the visual and colormap for each screen - Visual *vis = 0; - if ( visual && screen == appScreen ) { - // use the provided visual on the default screen only - vis = (Visual *) visual; - - // figure out the depth of the visual we are using - XVisualInfo *vi, rvi; - int n; - rvi.visualid = XVisualIDFromVisual(vis); - rvi.screen = screen; - vi = XGetVisualInfo( appDpy, VisualIDMask | VisualScreenMask, &rvi, &n ); - if (vi) { - TQPaintDevice::x_appdepth_arr[ screen ] = vi->depth; - TQPaintDevice::x_appcells_arr[ screen ] = vi->visual->map_entries; - TQPaintDevice::x_appvisual_arr[ screen ] = vi->visual; - TQPaintDevice::x_appdefvisual_arr[ screen ] = FALSE; - XFree(vi); - } else { - // couldn't get info about the visual, use the default instead - vis = 0; - } - } - - if (!vis) { - // use the default visual - vis = DefaultVisual(appDpy, screen); - TQPaintDevice::x_appdefvisual_arr[ screen ] = TRUE; - - if ( qt_visual_option == TrueColor || - TQApplication::colorSpec() == TQApplication::ManyColor ) { - // find custom visual - - int d, c; - vis = find_truecolor_visual( appDpy, screen, &d, &c ); - TQPaintDevice::x_appdepth_arr[ screen ] = d; - TQPaintDevice::x_appcells_arr[ screen ] = c; - - TQPaintDevice::x_appvisual_arr[ screen ] = vis; - TQPaintDevice::x_appdefvisual_arr[ screen ] = - (XVisualIDFromVisual(vis) == - XVisualIDFromVisual(DefaultVisual(appDpy, screen))); - } - - TQPaintDevice::x_appvisual_arr[ screen ] = vis; - } - - // we assume that 8bpp == pseudocolor, but this is not - // always the case (according to the X server), so we need - // to make sure that our internal data is setup in a way - // that is compatible with our assumptions - if ( vis->c_class == TrueColor && - TQPaintDevice::x_appdepth_arr[ screen ] == 8 && - TQPaintDevice::x_appcells_arr[ screen ] == 8 ) - TQPaintDevice::x_appcells_arr[ screen ] = 256; - - if ( colormap && screen == appScreen ) { - // use the provided colormap for the default screen only - TQPaintDevice::x_appcolormap_arr[ screen ] = colormap; - TQPaintDevice::x_appdefcolormap_arr[ screen ] = FALSE; - } else { - if ( vis->c_class == TrueColor ) { - TQPaintDevice::x_appdefcolormap_arr[ screen ] = - TQPaintDevice::x_appdefvisual_arr[ screen ]; - } else { - TQPaintDevice::x_appdefcolormap_arr[ screen ] = - !qt_cmap_option && TQPaintDevice::x_appdefvisual_arr[ screen ]; - } - - if ( TQPaintDevice::x_appdefcolormap_arr[ screen ] ) { - // use default colormap - XStandardColormap *stdcmap; - VisualID vid = - XVisualIDFromVisual((Visual *) - TQPaintDevice::x_appvisual_arr[ screen ]); - int i, count; - - TQPaintDevice::x_appcolormap_arr[ screen ] = 0; - - if ( ! serverVendor.contains( "Hewlett-Packard" ) ) { - // on HPUX 10.20 local displays, the RGB_DEFAULT_MAP colormap - // doesn't give us correct colors. Why this happens, I have - // no clue, so we disable this for HPUX - if (XGetRGBColormaps(appDpy, - TQPaintDevice::x11AppRootWindow( screen ), - &stdcmap, &count, XA_RGB_DEFAULT_MAP)) { - i = 0; - while (i < count && - TQPaintDevice::x_appcolormap_arr[ screen ] == 0) { - if (stdcmap[i].visualid == vid) { - TQPaintDevice::x_appcolormap_arr[ screen ] = - stdcmap[i].colormap; - } - i++; - } - - XFree( (char *)stdcmap ); - } - } - - if (TQPaintDevice::x_appcolormap_arr[ screen ] == 0) { - TQPaintDevice::x_appcolormap_arr[ screen ] = - DefaultColormap(appDpy, screen); - } - } else { - // create a custom colormap - TQPaintDevice::x_appcolormap_arr[ screen ] = - XCreateColormap(appDpy, TQPaintDevice::x11AppRootWindow( screen ), - vis, AllocNone); - } - } - } - - // Set X paintdevice parameters for the default screen - TQPaintDevice::x_appdepth = TQPaintDevice::x_appdepth_arr[ appScreen ]; - TQPaintDevice::x_appcells = TQPaintDevice::x_appcells_arr[ appScreen ]; - TQPaintDevice::x_approotwindow = TQPaintDevice::x_approotwindow_arr[ appScreen ]; - TQPaintDevice::x_appcolormap = TQPaintDevice::x_appcolormap_arr[ appScreen ]; - TQPaintDevice::x_appdefcolormap = TQPaintDevice::x_appdefcolormap_arr[ appScreen ]; - TQPaintDevice::x_appvisual = TQPaintDevice::x_appvisual_arr[ appScreen ]; - TQPaintDevice::x_appdefvisual = TQPaintDevice::x_appdefvisual_arr[ appScreen ]; - - // Support protocols - - qt_x11_intern_atom( "WM_PROTOCOLS", &tqt_wm_protocols ); - qt_x11_intern_atom( "WM_DELETE_WINDOW", &tqt_wm_delete_window ); - qt_x11_intern_atom( "WM_STATE", &tqt_wm_state ); - qt_x11_intern_atom( "WM_CHANGE_STATE", &qt_wm_change_state ); - qt_x11_intern_atom( "WM_TAKE_FOCUS", &tqt_wm_take_focus ); - qt_x11_intern_atom( "WM_CLIENT_LEADER", &qt_wm_client_leader); - qt_x11_intern_atom( "WM_WINDOW_ROLE", &tqt_window_role); - qt_x11_intern_atom( "SM_CLIENT_ID", &tqt_sm_client_id); - qt_x11_intern_atom( "CLIPBOARD", &qt_xa_clipboard ); - qt_x11_intern_atom( "RESOURCE_MANAGER", &qt_resource_manager ); - qt_x11_intern_atom( "INCR", &qt_x_incr ); - qt_x11_intern_atom( "_XSETROOT_ID", &qt_xsetroot_id ); - qt_x11_intern_atom( "_QT_SELECTION", &qt_selection_property ); - qt_x11_intern_atom( "_QT_CLIPBOARD_SENTINEL", &tqt_clipboard_sentinel ); - qt_x11_intern_atom( "_QT_SELECTION_SENTINEL", &qt_selection_sentinel ); - qt_x11_intern_atom( "_QT_SCROLL_DONE", &qt_qt_scrolldone ); - qt_x11_intern_atom( "_QT_INPUT_ENCODING", &qt_input_encoding ); - qt_x11_intern_atom( "_QT_SIZEGRIP", &qt_sizegrip ); - qt_x11_intern_atom( "_NET_WM_CONTEXT_HELP", &qt_net_wm_context_help ); - qt_x11_intern_atom( "_NET_WM_PING", &qt_net_wm_ping ); - qt_x11_intern_atom( "_MOTIF_WM_HINTS", &qt_xa_motif_wm_hints ); - qt_x11_intern_atom( "DTWM_IS_RUNNING", &qt_cde_running ); - qt_x11_intern_atom( "KWIN_RUNNING", &qt_twin_running ); - qt_x11_intern_atom( "KWM_RUNNING", &qt_kwm_running ); - qt_x11_intern_atom( "GNOME_BACKGROUND_PROPERTIES", &qt_gbackground_properties ); - - TQString atomname("_QT_SETTINGS_TIMESTAMP_"); - atomname += XDisplayName(appDpyName); - qt_x11_intern_atom( atomname.latin1(), &qt_settings_timestamp ); - - qt_x11_intern_atom( "_NET_SUPPORTED", &qt_net_supported ); - qt_x11_intern_atom( "_NET_VIRTUAL_ROOTS", &qt_net_virtual_roots ); - qt_x11_intern_atom( "_NET_WORKAREA", &qt_net_workarea ); - qt_x11_intern_atom( "_NET_WM_STATE", &qt_net_wm_state ); - qt_x11_intern_atom( "_NET_WM_STATE_MODAL", &qt_net_wm_state_modal ); - qt_x11_intern_atom( "_NET_WM_STATE_MAXIMIZED_VERT", &qt_net_wm_state_max_v ); - qt_x11_intern_atom( "_NET_WM_STATE_MAXIMIZED_HORZ", &qt_net_wm_state_max_h ); - qt_x11_intern_atom( "_NET_WM_STATE_FULLSCREEN", &qt_net_wm_state_fullscreen ); - qt_x11_intern_atom( "_NET_WM_STATE_ABOVE", &qt_net_wm_state_above ); - qt_x11_intern_atom( "_NET_WM_ALLOWED_ACTIONS", &qt_net_wm_action ); - qt_x11_intern_atom( "_NET_WM_ACTION_MOVE", &qt_net_wm_action_move ); - qt_x11_intern_atom( "_NET_WM_ACTION_RESIZE", &qt_net_wm_action_resize ); - qt_x11_intern_atom( "_NET_WM_ACTION_MINIMIZE", &qt_net_wm_action_minimize ); - qt_x11_intern_atom( "_NET_WM_ACTION_SHADE", &qt_net_wm_action_shade ); - qt_x11_intern_atom( "_NET_WM_ACTION_STICK", &qt_net_wm_action_stick ); - qt_x11_intern_atom( "_NET_WM_ACTION_MAXIMIZE_HORZ", &qt_net_wm_action_max_h ); - qt_x11_intern_atom( "_NET_WM_ACTION_MAXIMIZE_VERT", &qt_net_wm_action_max_v ); - qt_x11_intern_atom( "_NET_WM_ACTION_FULLSCREEN", &qt_net_wm_action_fullscreen ); - qt_x11_intern_atom( "_NET_WM_ACTION_CHANGE_DESKTOP", &qt_net_wm_action_change_desktop ); - qt_x11_intern_atom( "_NET_WM_ACTION_CLOSE", &qt_net_wm_action_close ); - qt_x11_intern_atom( "_NET_WM_ACTION_ABOVE", &qt_net_wm_action_above ); - qt_x11_intern_atom( "_NET_WM_ACTION_BELOW", &qt_net_wm_action_below ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE", &qt_net_wm_window_type ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_NORMAL", &qt_net_wm_window_type_normal ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_DIALOG", &qt_net_wm_window_type_dialog ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_TOOLBAR", &qt_net_wm_window_type_toolbar ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_MENU", &qt_net_wm_window_type_menu ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_UTILITY", &qt_net_wm_window_type_utility ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_SPLASH", &qt_net_wm_window_type_splash ); - qt_x11_intern_atom( "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", &qt_net_wm_window_type_override ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", &qt_net_wm_window_type_dropdown_menu ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_POPUP_MENU", &qt_net_wm_window_type_popup_menu ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_TOOLTIP", &qt_net_wm_window_type_tooltip ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_COMBO", &qt_net_wm_window_type_combo ); - qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_DND", &qt_net_wm_window_type_dnd ); - qt_x11_intern_atom( "_KDE_NET_WM_FRAME_STRUT", &qt_net_wm_frame_strut ); - qt_x11_intern_atom( "_NET_WM_STATE_STAYS_ON_TOP", - &qt_net_wm_state_stays_on_top ); - qt_x11_intern_atom( "_NET_WM_PID", &qt_net_wm_pid ); - qt_x11_intern_atom( "_NET_WM_USER_TIME", &qt_net_wm_user_time ); - qt_x11_intern_atom( "_NET_WM_FULL_PLACEMENT", &qt_net_wm_full_placement ); - qt_x11_intern_atom( "ENLIGHTENMENT_DESKTOP", &qt_enlightenment_desktop ); - qt_x11_intern_atom( "_NET_WM_NAME", &qt_net_wm_name ); - qt_x11_intern_atom( "_NET_WM_ICON_NAME", &qt_net_wm_icon_name ); - qt_x11_intern_atom( "UTF8_STRING", &qt_utf8_string ); - qt_x11_intern_atom( "_SGI_DESKS_MANAGER", &qt_sgi_desks_manager ); - -#ifndef TQT_NO_XSYNC - qt_x11_intern_atom( "_NET_WM_SYNC_REQUEST_COUNTER", &qt_net_wm_sync_request_counter ); - qt_x11_intern_atom( "_NET_WM_SYNC_REQUEST", &qt_net_wm_sync_request ); -#endif - - qt_xdnd_setup(); - qt_x11_motifdnd_init(); - - // Finally create all atoms - tqt_x11_process_intern_atoms(); - - // look for broken window managers - qt_detect_broken_window_manager(); - - // initialize NET lists - qt_get_net_supported(); - qt_get_net_virtual_roots(); - -#ifndef TQT_NO_XRANDR - // See if XRandR is supported on the connected display - int xrandr_errorbase; - Q_UNUSED( xrandr_eventbase ); - if ( XRRQueryExtension( appDpy, &xrandr_eventbase, &xrandr_errorbase ) ) { - // XRandR is supported - qt_use_xrandr = TRUE; - } -#endif // TQT_NO_XRANDR - -#ifndef TQT_NO_XRENDER - // See if XRender is supported on the connected display - int xrender_eventbase, xrender_errorbase; - if (XRenderQueryExtension(appDpy, &xrender_eventbase, &xrender_errorbase)) { - // XRender is supported, let's see if we have a PictFormat for the - // default visual - XRenderPictFormat *format = - XRenderFindVisualFormat(appDpy, - (Visual *) TQPaintDevice::x_appvisual); - tqt_use_xrender = (format != 0) && (TQPaintDevice::x_appdepth != 8); - } -#endif // TQT_NO_XRENDER - -#ifndef TQT_NO_XSYNC - // Try to initialize SYNC extension on the connected display - int xsync_major, xsync_minor; - if ( XSyncQueryExtension( appDpy, &xsync_eventbase, &xsync_errorbase ) && - XSyncInitialize( appDpy, &xsync_major, &xsync_minor ) ) { - qt_use_xsync = TRUE; - } -#endif - -#ifndef TQT_NO_XKB - // If XKB is detected, set the GrabsUseXKBState option so input method - // compositions continue to work (ie. deadkeys) - unsigned int state = XkbPCF_GrabsUseXKBStateMask; - (void) XkbSetPerClientControls(appDpy, state, &state); -#endif - -#if !defined(TQT_NO_XFTFREETYPE) - // defined in tqfont_x11.cpp - extern bool tqt_has_xft; -#ifndef QT_XFT2 - if (!tqt_use_xrender) - tqt_has_xft = FALSE; - else -#endif - tqt_has_xft = XftInit(0) && XftInitFtLibrary(); - - if (tqt_has_xft) { - char *dpi_str = XGetDefault(appDpy, "Xft", "dpi"); - if (dpi_str) { - // use a custom DPI - char *end = 0; - int dpi = strtol(dpi_str, &end, 0); - if (dpi_str != end) { - for (int s = 0; s < ScreenCount(appDpy); ++s) { - TQPaintDevice::x11SetAppDpiX(dpi, s); - TQPaintDevice::x11SetAppDpiY(dpi, s); - } - } - } - } -#endif // TQT_NO_XFTFREETYPE - - // look at the modifier mapping, and get the correct masks for alt/meta - // find the alt/meta masks - XModifierKeymap *map = XGetModifierMapping(appDpy); - if (map) { - int i, maskIndex = 0, mapIndex = 0; - for (maskIndex = 0; maskIndex < 8; maskIndex++) { - for (i = 0; i < map->max_keypermod; i++) { - if (map->modifiermap[mapIndex]) { - KeySym sym = qt_x11_keycode_to_keysym(appDpy, map->modifiermap[ mapIndex ]); - if ( qt_alt_mask == 0 && - ( sym == XK_Alt_L || sym == XK_Alt_R ) ) { - qt_alt_mask = 1 << maskIndex; - } - if ( qt_meta_mask == 0 && - (sym == XK_Meta_L || sym == XK_Meta_R ) ) { - qt_meta_mask = 1 << maskIndex; - } - } - mapIndex++; - } - } - - // not look for mode_switch in qt_alt_mask and qt_meta_mask - if it is - // present in one or both, then we set qt_mode_switch_remove_mask. - // see TQETWidget::translateKeyEventInternal for an explanation - // of why this is needed - mapIndex = 0; - for ( maskIndex = 0; maskIndex < 8; maskIndex++ ) { - if ( qt_alt_mask != ( 1 << maskIndex ) && - qt_meta_mask != ( 1 << maskIndex ) ) { - for ( i = 0; i < map->max_keypermod; i++ ) - mapIndex++; - continue; - } - - for ( i = 0; i < map->max_keypermod; i++ ) { - if ( map->modifiermap[ mapIndex ] ) { - KeySym sym = qt_x11_keycode_to_keysym(appDpy, map->modifiermap[ mapIndex ]); - if ( sym == XK_Mode_switch ) { - qt_mode_switch_remove_mask |= 1 << maskIndex; - } - } - mapIndex++; - } - } - - XFreeModifiermap(map); - } else { - // assume defaults - qt_alt_mask = Mod1Mask; - qt_meta_mask = Mod4Mask; - qt_mode_switch_remove_mask = 0; - } - - // Misc. initialization - - TQColor::initialize(); - TQFont::initialize(); - TQCursor::initialize(); - TQPainter::initialize(); - } - -#if defined(TQT_THREAD_SUPPORT) - TQThread::initialize(); -#endif - - if( tqt_is_gui_used ) { - tqApp->setName( appName ); - - int screen; - for ( screen = 0; screen < appScreenCount; ++screen ) { - XSelectInput( appDpy, TQPaintDevice::x11AppRootWindow( screen ), - KeymapStateMask | EnterWindowMask | LeaveWindowMask | - PropertyChangeMask ); - -#ifndef TQT_NO_XRANDR - if (qt_use_xrandr) - XRRSelectInput( appDpy, TQPaintDevice::x11AppRootWindow( screen ), True ); -#endif // TQT_NO_XRANDR - } - } - - if ( tqt_is_gui_used ) { - qt_set_input_encoding(); - - qt_set_x11_resources( appFont, appFGCol, appBGCol, appBTNCol); - - // be smart about the size of the default font. most X servers have helvetica - // 12 point available at 2 resolutions: - // 75dpi (12 pixels) and 100dpi (17 pixels). - // At 95 DPI, a 12 point font should be 16 pixels tall - in which case a 17 - // pixel font is a closer match than a 12 pixel font - int ptsz = - (int) ( ( ( TQPaintDevice::x11AppDpiY() >= 95 ? 17. : 12. ) * - 72. / (float) TQPaintDevice::x11AppDpiY() ) + 0.5 ); - - if ( !tqt_app_has_font && !qt_x11_cmdline_font ) { - TQFont f( "Helvetica", ptsz ); - TQApplication::setFont( f ); - } - -#if !defined(TQT_NO_IM) -#if !defined(TQT_NO_IM_EXTENSIONS) - TQApplication::create_im(); -#else - TQApplication::create_xim(); -#endif -#endif - -#if defined (QT_TABLET_SUPPORT) - int ndev, - i, - j; - bool gotStylus, - gotEraser; - XDeviceInfo *devices, *devs; - XInputClassInfo *ip; - XAnyClassPtr any; - XValuatorInfoPtr v; - XAxisInfoPtr a; - XDevice *dev; - XEventClass *ev_class; - int curr_event_count; - -#if !defined(Q_OS_IRIX) - // XFree86 divides a stylus and eraser into 2 devices, so we must do for both... - const TQString XFREENAMESTYLUS = "stylus"; - const TQString XFREENAMEPEN = "pen"; - const TQString XFREENAMEERASER = "eraser"; -#endif - - devices = XListInputDevices( appDpy, &ndev); - if ( devices == NULL ) { - tqWarning( "Failed to get list of devices" ); - ndev = -1; - } - dev = NULL; - for ( devs = devices, i = 0; i < ndev; i++, devs++ ) { - gotEraser = FALSE; -#if defined(Q_OS_IRIX) - - gotStylus = ( !strncmp(devs->name, - WACOM_NAME, sizeof(WACOM_NAME) - 1) ); -#else - TQString devName = devs->name; - devName = devName.lower(); - gotStylus = ( devName.startsWith(XFREENAMEPEN) - || devName.startsWith(XFREENAMESTYLUS) ); - if ( !gotStylus ) - gotEraser = devName.startsWith( XFREENAMEERASER ); - -#endif - if ( gotStylus || gotEraser ) { - // I only wanted to do this once, so wrap pointers around these - curr_event_count = 0; - - if ( gotStylus ) { - devStylus = XOpenDevice( appDpy, devs->id ); - dev = devStylus; - ev_class = event_list_stylus; - } else if ( gotEraser ) { - devEraser = XOpenDevice( appDpy, devs->id ); - dev = devEraser; - ev_class = event_list_eraser; - } - if ( dev == NULL ) { - tqWarning( "Failed to open device" ); - } else { - if ( dev->num_classes > 0 ) { - for ( ip = dev->classes, j = 0; j < devs->num_classes; - ip++, j++ ) { - switch ( ip->input_class ) { - case KeyClass: - DeviceKeyPress( dev, xinput_key_press, - ev_class[curr_event_count] ); - curr_event_count++; - DeviceKeyRelease( dev, xinput_key_release, - ev_class[curr_event_count] ); - curr_event_count++; - break; - case ButtonClass: - DeviceButtonPress( dev, xinput_button_press, - ev_class[curr_event_count] ); - curr_event_count++; - DeviceButtonRelease( dev, xinput_button_release, - ev_class[curr_event_count] ); - curr_event_count++; - break; - case ValuatorClass: - // I'm only going to be interested in motion when the - // stylus is already down anyway! - DeviceMotionNotify( dev, xinput_motion, - ev_class[curr_event_count] ); - curr_event_count++; - break; - default: - break; - } - } - } - } - // get the min/max value for pressure! - any = (XAnyClassPtr) ( devs->inputclassinfo ); - if ( dev == devStylus ) { - qt_curr_events_stylus = curr_event_count; - for (j = 0; j < devs->num_classes; j++) { - if ( any->c_class == ValuatorClass ) { - v = (XValuatorInfoPtr) any; - a = (XAxisInfoPtr) ((char *) v + - sizeof (XValuatorInfo)); -#if defined (Q_OS_IRIX) - max_pressure = a[WAC_PRESSURE_I].max_value; -#else - max_pressure = a[2].max_value; -#endif - // got the max pressure no need to go further... - break; - } - any = (XAnyClassPtr) ((char *) any + any->length); - } - } else { - qt_curr_events_eraser = curr_event_count; - } - // at this point we are assuming there is only one - // wacom device... -#if defined (Q_OS_IRIX) - if ( devStylus != NULL ) { -#else - if ( devStylus != NULL && devEraser != NULL ) { -#endif - break; - } - } - } // end for loop - XFreeDeviceList( devices ); -#endif // QT_TABLET_SUPPORT - - } else { - // read some non-GUI settings when not using the X server... - - if ( TQApplication::desktopSettingsAware() ) { - TQSettings settings; - - // read library (ie. plugin) path list - TQString libpathkey = TQString("/qt/%1.%2/libraryPath") - .arg( TQT_VERSION >> 16 ) - .arg( (TQT_VERSION & 0xff00 ) >> 8 ); - TQStringList pathlist = - settings.readListEntry(libpathkey, ':'); - if (! pathlist.isEmpty()) { - TQStringList::ConstIterator it = pathlist.begin(); - while (it != pathlist.end()) - TQApplication::addLibraryPath(*it++); - } - - TQString defaultcodec = settings.readEntry("/qt/defaultCodec", "none"); - if (defaultcodec != "none") { - TQTextCodec *codec = TQTextCodec::codecForName(defaultcodec); - if (codec) - tqApp->setDefaultCodec(codec); - } - - tqt_resolve_symlinks = - settings.readBoolEntry("/qt/resolveSymlinks", TRUE); - } - } - } - - -#ifndef TQT_NO_STYLE - // run-time search for default style -void TQApplication::x11_initialize_style() -{ - Atom type; - int format; - unsigned long length, after; - uchar *data; - if ( !app_style && - XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), qt_twin_running, - 0, 1, False, AnyPropertyType, &type, &format, &length, - &after, &data ) == Success && length ) { - if ( data ) XFree( (char *)data ); - // twin is there. check if KDE's styles are available, - // otherwise use windows style - if ( (app_style = TQStyleFactory::create("highcolor") ) == 0 ) - app_style = TQStyleFactory::create("windows"); - } - if ( !app_style && - XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), qt_kwm_running, - 0, 1, False, AnyPropertyType, &type, &format, &length, - &after, &data ) == Success && length ) { - if ( data ) XFree( (char *)data ); - app_style = TQStyleFactory::create("windows"); - } - if ( !app_style && - XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), qt_cde_running, - 0, 1, False, AnyPropertyType, &type, &format, &length, - &after, &data ) == Success && length ) { - // DTWM is running, meaning most likely CDE is running... - if ( data ) XFree( (char *) data ); - app_style = TQStyleFactory::create( "cde" ); - } - // maybe another desktop? - if ( !app_style && - XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), - qt_gbackground_properties, 0, 1, False, AnyPropertyType, - &type, &format, &length, &after, &data ) == Success && - length ) { - if ( data ) XFree( (char *)data ); - // default to MotifPlus with hovering - app_style = TQStyleFactory::create("motifplus" ); - } -} -#endif - -void tqt_init( int *argcptr, char **argv, TQApplication::Type ) -{ - tqt_init_internal( argcptr, argv, 0, 0, 0 ); -} - -void tqt_init( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) -{ - tqt_init_internal( 0, 0, display, visual, colormap ); -} - -void tqt_init( int *argcptr, char **argv, Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) -{ - tqt_init_internal( argcptr, argv, display, visual, colormap ); -} - - -/***************************************************************************** - tqt_cleanup() - cleans up when the application is finished - *****************************************************************************/ - -void tqt_cleanup() -{ - appliedstamp = 0; - - if ( app_save_rootinfo ) // root window must keep state - qt_save_rootinfo(); - - if ( tqt_is_gui_used ) { - TQPixmapCache::clear(); - TQPainter::cleanup(); - TQCursor::cleanup(); - TQFont::cleanup(); - TQColor::cleanup(); - TQSharedDoubleBuffer::cleanup(); - } -#if defined(TQT_THREAD_SUPPORT) - TQThread::cleanup(); -#endif - -#if defined (QT_TABLET_SUPPORT) - if ( devStylus != NULL ) - XCloseDevice( appDpy, devStylus ); - if ( devEraser != NULL ) - XCloseDevice( appDpy, devEraser ); -#endif - -#if !defined(TQT_NO_IM) -#if !defined(TQT_NO_IM_EXTENSIONS) - TQApplication::close_im(); -#else - TQApplication::close_xim(); -#endif -#endif - - if ( tqt_is_gui_used ) { - int screen; - for ( screen = 0; screen < appScreenCount; screen++ ) { - if ( ! TQPaintDevice::x11AppDefaultColormap( screen ) ) - XFreeColormap( TQPaintDevice::x11AppDisplay(), - TQPaintDevice::x11AppColormap( screen ) ); - } - } - -#define QT_CLEANUP_GC(g) if (g) { for (int i=0;i= appScreenCount ) { - tqDebug("invalid screen %d %d", scrn, appScreenCount ); - TQWidget* bla = 0; - bla->setName("hello"); - } - GC gc; - if ( monochrome ) { - if ( !app_gc_ro_m ) // create GC for bitmap - memset( (app_gc_ro_m = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); - if ( !app_gc_ro_m[scrn] ) - app_gc_ro_m[scrn] = create_gc( scrn, TRUE ); - gc = app_gc_ro_m[scrn]; - } else { // create standard GC - if ( !app_gc_ro ) - memset( (app_gc_ro = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); - if ( !app_gc_ro[scrn] ) - app_gc_ro[scrn] = create_gc( scrn, FALSE ); - gc = app_gc_ro[scrn]; - } - return gc; -} - -GC tqt_xget_temp_gc( int scrn, bool monochrome ) // get temporary GC -{ - if ( scrn < 0 || scrn >= appScreenCount ) { - tqDebug("invalid screen (tmp) %d %d", scrn, appScreenCount ); - TQWidget* bla = 0; - bla->setName("hello"); - } - GC gc; - if ( monochrome ) { - if ( !app_gc_tmp_m ) // create GC for bitmap - memset( (app_gc_tmp_m = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); - if ( !app_gc_tmp_m[scrn] ) - app_gc_tmp_m[scrn] = create_gc( scrn, TRUE ); - gc = app_gc_tmp_m[scrn]; - } else { // create standard GC - if ( !app_gc_tmp ) - memset( (app_gc_tmp = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); - if ( !app_gc_tmp[scrn] ) - app_gc_tmp[scrn] = create_gc( scrn, FALSE ); - gc = app_gc_tmp[scrn]; - } - return gc; -} - - -/***************************************************************************** - Platform specific TQApplication members - *****************************************************************************/ - -/*! - \fn TQWidget *TQApplication::mainWidget() const - - Returns the main application widget, or 0 if there is no main - widget. - - \sa setMainWidget() -*/ - -/*! - Sets the application's main widget to \a mainWidget. - - In most respects the main widget is like any other widget, except - that if it is closed, the application exits. Note that - TQApplication does \e not take ownership of the \a mainWidget, so - if you create your main widget on the heap you must delete it - yourself. - - You need not have a main widget; connecting lastWindowClosed() to - quit() is an alternative. - - For X11, this function also resizes and moves the main widget - according to the \e -geometry command-line option, so you should - set the default geometry (using \l TQWidget::setGeometry()) before - calling setMainWidget(). - - \sa mainWidget(), exec(), quit() -*/ - -void TQApplication::setMainWidget( TQWidget *mainWidget ) -{ -#if defined(QT_CHECK_STATE) - if ( mainWidget && mainWidget->parentWidget() && - ! mainWidget->parentWidget()->isDesktop() ) - tqWarning( "TQApplication::setMainWidget(): New main widget (%s/%s) " - "has a parent!", - mainWidget->className(), mainWidget->name() ); -#endif - main_widget = mainWidget; - if ( main_widget ) { // give WM command line - XSetWMProperties( main_widget->x11Display(), main_widget->winId(), - 0, 0, app_argv, app_argc, 0, 0, 0 ); - if ( mwTitle ) - XStoreName( main_widget->x11Display(), main_widget->winId(), (char*)mwTitle ); - if ( mwGeometry ) { // parse geometry - int x, y; - int w, h; - int m = XParseGeometry( (char*)mwGeometry, &x, &y, (uint*)&w, (uint*)&h ); - TQSize minSize = main_widget->minimumSize(); - TQSize maxSize = main_widget->maximumSize(); - if ( (m & XValue) == 0 ) - x = main_widget->geometry().x(); - if ( (m & YValue) == 0 ) - y = main_widget->geometry().y(); - if ( (m & WidthValue) == 0 ) - w = main_widget->width(); - if ( (m & HeightValue) == 0 ) - h = main_widget->height(); - w = TQMIN(w,maxSize.width()); - h = TQMIN(h,maxSize.height()); - w = TQMAX(w,minSize.width()); - h = TQMAX(h,minSize.height()); - if ( (m & XNegative) ) { - x = desktop()->width() + x - w; - qt_widget_tlw_gravity = NorthEastGravity; - } - if ( (m & YNegative) ) { - y = desktop()->height() + y - h; - qt_widget_tlw_gravity = (m & XNegative) ? SouthEastGravity : SouthWestGravity; - } - main_widget->setGeometry( x, y, w, h ); - } - } -} - -#ifndef TQT_NO_CURSOR - -/***************************************************************************** - TQApplication cursor stack - *****************************************************************************/ - -extern void tqt_x11_enforce_cursor( TQWidget * w ); - -typedef TQPtrList TQCursorList; - -static TQCursorList *cursorStack = 0; - -/*! - \fn TQCursor *TQApplication::overrideCursor() - - Returns the active application override cursor. - - This function returns 0 if no application cursor has been defined - (i.e. the internal cursor stack is empty). - - \sa setOverrideCursor(), restoreOverrideCursor() -*/ - -/*! - Sets the application override cursor to \a cursor. - - Application override cursors are intended for showing the user - that the application is in a special state, for example during an - operation that might take some time. - - This cursor will be displayed in all the application's widgets - until restoreOverrideCursor() or another setOverrideCursor() is - called. - - Application cursors are stored on an internal stack. - setOverrideCursor() pushes the cursor onto the stack, and - restoreOverrideCursor() pops the active cursor off the stack. - Every setOverrideCursor() must eventually be followed by a - corresponding restoreOverrideCursor(), otherwise the stack will - never be emptied. - - If \a replace is TRUE, the new cursor will replace the last - override cursor (the stack keeps its depth). If \a replace is - FALSE, the new stack is pushed onto the top of the stack. - - Example: - \code - TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); - calculateHugeMandelbrot(); // lunch time... - TQApplication::restoreOverrideCursor(); - \endcode - - \sa overrideCursor(), restoreOverrideCursor(), TQWidget::setCursor() -*/ - -void TQApplication::setOverrideCursor( const TQCursor &cursor, bool replace ) -{ - if ( !cursorStack ) { - cursorStack = new TQCursorList; - TQ_CHECK_PTR( cursorStack ); - cursorStack->setAutoDelete( TRUE ); - } - app_cursor = new TQCursor( cursor ); - TQ_CHECK_PTR( app_cursor ); - if ( replace ) - cursorStack->removeLast(); - cursorStack->append( app_cursor ); - - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // for all widgets that have - if ( w->testWState( WState_OwnCursor ) ) - tqt_x11_enforce_cursor( w ); - ++it; - } - XFlush( appDpy ); // make X execute it NOW -} - -/*! - Undoes the last setOverrideCursor(). - - If setOverrideCursor() has been called twice, calling - restoreOverrideCursor() will activate the first cursor set. - Calling this function a second time restores the original widgets' - cursors. - - \sa setOverrideCursor(), overrideCursor(). -*/ - -void TQApplication::restoreOverrideCursor() -{ - if ( !cursorStack ) // no cursor stack - return; - cursorStack->removeLast(); - app_cursor = cursorStack->last(); - if ( TQWidget::mapper != 0 && !closingDown() ) { - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { // set back to original cursors - if ( w->testWState( WState_OwnCursor ) ) - tqt_x11_enforce_cursor( w ); - ++it; - } - XFlush( appDpy ); - } - if ( !app_cursor ) { - delete cursorStack; - cursorStack = 0; - } -} - -#endif - -/*! - \fn bool TQApplication::hasGlobalMouseTracking() - - Returns TRUE if global mouse tracking is enabled; otherwise - returns FALSE. - - \sa setGlobalMouseTracking() -*/ - -/*! - Enables global mouse tracking if \a enable is TRUE, or disables it - if \a enable is FALSE. - - Enabling global mouse tracking makes it possible for widget event - filters or application event filters to get all mouse move events, - even when no button is depressed. This is useful for special GUI - elements, e.g. tooltips. - - Global mouse tracking does not affect widgets and their - mouseMoveEvent(). For a widget to get mouse move events when no - button is depressed, it must do TQWidget::setMouseTracking(TRUE). - - This function uses an internal counter. Each - setGlobalMouseTracking(TRUE) must have a corresponding - setGlobalMouseTracking(FALSE): - \code - // at this point global mouse tracking is off - TQApplication::setGlobalMouseTracking( TRUE ); - TQApplication::setGlobalMouseTracking( TRUE ); - TQApplication::setGlobalMouseTracking( FALSE ); - // at this point it's still on - TQApplication::setGlobalMouseTracking( FALSE ); - // but now it's off - \endcode - - \sa hasGlobalMouseTracking(), TQWidget::hasMouseTracking() -*/ - -void TQApplication::setGlobalMouseTracking( bool enable ) -{ - bool tellAllWidgets; - if ( enable ) { - tellAllWidgets = (++app_tracking == 1); - } else { - tellAllWidgets = (--app_tracking == 0); - } - if ( tellAllWidgets ) { - TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); - TQWidget *w; - while ( (w=it.current()) ) { - if ( app_tracking > 0 ) { // switch on - if ( !w->testWState(WState_MouseTracking) ) { - w->setMouseTracking( TRUE ); - w->clearWState( WState_MouseTracking ); - } - } else { // switch off - if ( !w->testWState(WState_MouseTracking) ) { - w->setWState( WState_MouseTracking ); - w->setMouseTracking( FALSE ); - } - } - ++it; - } - } -} - - -/***************************************************************************** - Routines to find a TQt widget from a screen position - *****************************************************************************/ - -Window qt_x11_findClientWindow( Window win, Atom property, bool leaf ) -{ - Atom type = None; - int format, i; - ulong nitems, after; - uchar *data; - Window root, parent, target=0, *children=0; - uint nchildren; - if ( XGetWindowProperty( appDpy, win, property, 0, 0, FALSE, AnyPropertyType, - &type, &format, &nitems, &after, &data ) == Success ) { - if ( data ) - XFree( (char *)data ); - if ( type ) - return win; - } - if ( !XQueryTree(appDpy,win,&root,&parent,&children,&nchildren) ) { - if ( children ) - XFree( (char *)children ); - return 0; - } - for ( i=nchildren-1; !target && i >= 0; i-- ) - target = qt_x11_findClientWindow( children[i], property, leaf ); - if ( children ) - XFree( (char *)children ); - return target; -} - - -/*! - Returns a pointer to the widget at global screen position \a - (x, y), or 0 if there is no TQt widget there. - - If \a child is FALSE and there is a child widget at position \a - (x, y), the top-level widget containing it is returned. If \a child - is TRUE the child widget at position \a (x, y) is returned. - - This function is normally rather slow. - - \sa TQCursor::pos(), TQWidget::grabMouse(), TQWidget::grabKeyboard() -*/ - -TQWidget *TQApplication::widgetAt( int x, int y, bool child ) -{ - int screen = TQCursor::x11Screen(); - int lx, ly; - - Window target; - if ( !XTranslateCoordinates(appDpy, - TQPaintDevice::x11AppRootWindow(screen), - TQPaintDevice::x11AppRootWindow(screen), - x, y, &lx, &ly, &target) ) { - return 0; - } - if ( !target || target == TQPaintDevice::x11AppRootWindow(screen) ) - return 0; - TQWidget *w, *c; - w = TQWidget::find( (WId)target ); - - if ( !w ) { - qt_ignore_badwindow(); - target = qt_x11_findClientWindow( target, tqt_wm_state, TRUE ); - if (qt_badwindow() ) - return 0; - w = TQWidget::find( (WId)target ); -#if 0 - if ( !w ) { - // Perhaps the widgets at (x,y) is inside a foreign application? - // Search all toplevel widgets to see if one is within target - TQWidgetList *list = topLevelWidgets(); - TQWidget *widget = list->first(); - while ( widget && !w ) { - Window ctarget = target; - if ( widget->isVisible() && !widget->isDesktop() ) { - Window wid = widget->winId(); - while ( ctarget && !w ) { - XTranslateCoordinates(appDpy, - TQPaintDevice::x11AppRootWindow(screen), - ctarget, x, y, &lx, &ly, &ctarget); - if ( ctarget == wid ) { - // Found - w = widget; - XTranslateCoordinates(appDpy, - TQPaintDevice::x11AppRootWindow(screen), - ctarget, x, y, &lx, &ly, &ctarget); - } - } - } - widget = list->next(); - } - delete list; - } -#endif - } - if ( child && w ) { - if ( (c = w->childAt( w->mapFromGlobal(TQPoint(x, y ) ) ) ) ) - return c; - } - return w; -} - -/*! - \overload TQWidget *TQApplication::widgetAt( const TQPoint &pos, bool child ) - - Returns a pointer to the widget at global screen position \a pos, - or 0 if there is no TQt widget there. - - If \a child is FALSE and there is a child widget at position \a - pos, the top-level widget containing it is returned. If \a child - is TRUE the child widget at position \a pos is returned. -*/ - - -/*! - Flushes the X event queue in the X11 implementation. This normally - returns almost immediately. Does nothing on other platforms. - - \sa syncX() -*/ - -void TQApplication::flushX() -{ - if ( appDpy ) - XFlush( appDpy ); -} - -/*! - Flushes the window system specific event queues. - - If you are doing graphical changes inside a loop that does not - return to the event loop on asynchronous window systems like X11 - or double buffered window systems like MacOS X, and you want to - visualize these changes immediately (e.g. Splash Screens), call - this function. - - \sa flushX() sendPostedEvents() TQPainter::flush() -*/ - -void TQApplication::flush() -{ - flushX(); -} - -/*! - Synchronizes with the X server in the X11 implementation. This - normally takes some time. Does nothing on other platforms. - - \sa flushX() -*/ - -void TQApplication::syncX() -{ - if ( appDpy ) - XSync( appDpy, False ); // don't discard events -} - - -/*! - Sounds the bell, using the default volume and sound. -*/ - -void TQApplication::beep() -{ - if ( appDpy ) - XBell( appDpy, 0 ); -} - - - -/***************************************************************************** - Special lookup functions for windows that have been reparented recently - *****************************************************************************/ - -static TQWidgetIntDict *wPRmapper = 0; // alternative widget mapper - -void qPRCreate( const TQWidget *widget, Window oldwin ) -{ // TQWidget::reparent mechanism - if ( !wPRmapper ) { - wPRmapper = new TQWidgetIntDict; - TQ_CHECK_PTR( wPRmapper ); - } - wPRmapper->insert( (long)oldwin, widget ); // add old window to mapper - TQETWidget *w = (TQETWidget *)widget; - w->setWState( TQt::WState_Reparented ); // set reparented flag -} - -void qPRCleanup( TQWidget *widget ) -{ - TQETWidget *etw = (TQETWidget *)widget; - if ( !(wPRmapper && etw->testWState(TQt::WState_Reparented)) ) - return; // not a reparented widget - TQWidgetIntDictIt it(*wPRmapper); - TQWidget *w; - while ( (w=it.current()) ) { - int key = it.currentKey(); - ++it; - if ( w == etw ) { // found widget - etw->clearWState( TQt::WState_Reparented ); // clear flag - wPRmapper->remove( key );// old window no longer needed - if ( wPRmapper->count() == 0 ) { // became empty - delete wPRmapper; // then reset alt mapper - wPRmapper = 0; - return; - } - } - } -} - -static TQETWidget *qPRFindWidget( Window oldwin ) -{ - return wPRmapper ? (TQETWidget*)wPRmapper->find((long)oldwin) : 0; -} - -/*! - \internal -*/ -int TQApplication::x11ClientMessage(TQWidget* w, XEvent* event, bool passive_only) -{ - TQETWidget *widget = (TQETWidget*)w; - if ( event->xclient.format == 32 && event->xclient.message_type ) { - if ( event->xclient.message_type == tqt_wm_protocols ) { - Atom a = event->xclient.data.l[0]; - if ( a == tqt_wm_delete_window ) { - if ( passive_only ) return 0; - widget->translateCloseEvent(event); - } - else if ( a == tqt_wm_take_focus ) { - TQWidget * amw = activeModalWidget(); - if ( (ulong) event->xclient.data.l[1] > tqt_x_time ) - tqt_x_time = event->xclient.data.l[1]; - if ( amw && amw != widget ) { - TQWidget* groupLeader = widget; - while ( groupLeader && !groupLeader->testWFlags( TQt::WGroupLeader ) - && groupLeader != amw ) - groupLeader = groupLeader->parentWidget(); - if ( !groupLeader ) { - TQWidget *p = amw->parentWidget(); - while (p && p != widget) - p = p->parentWidget(); - if (!p || !qt_net_supported_list) - amw->raise(); // help broken window managers - amw->setActiveWindow(); - } - } -#ifndef TQT_NO_WHATSTHIS - } else if ( a == qt_net_wm_context_help ) { - TQWhatsThis::enterWhatsThisMode(); -#endif // TQT_NO_WHATSTHIS - } else if ( a == qt_net_wm_ping ) { - // avoid send/reply loops - Window root = TQPaintDevice::x11AppRootWindow( w->x11Screen() ); - if (event->xclient.window != root) { - event->xclient.window = root; - XSendEvent( event->xclient.display, event->xclient.window, - False, SubstructureNotifyMask|SubstructureRedirectMask, event ); - } -#ifndef TQT_NO_XSYNC - } else if (a == qt_net_wm_sync_request ) { - widget->handleSyncRequest( event ); -#endif - } - } else if ( event->xclient.message_type == qt_qt_scrolldone ) { - widget->translateScrollDoneEvent(event); - } else if ( event->xclient.message_type == qt_xdnd_position ) { - qt_handle_xdnd_position( widget, event, passive_only ); - } else if ( event->xclient.message_type == qt_xdnd_enter ) { - qt_handle_xdnd_enter( widget, event, passive_only ); - } else if ( event->xclient.message_type == qt_xdnd_status ) { - qt_handle_xdnd_status( widget, event, passive_only ); - } else if ( event->xclient.message_type == qt_xdnd_leave ) { - qt_handle_xdnd_leave( widget, event, passive_only ); - } else if ( event->xclient.message_type == qt_xdnd_drop ) { - qt_handle_xdnd_drop( widget, event, passive_only ); - } else if ( event->xclient.message_type == qt_xdnd_finished ) { - qt_handle_xdnd_finished( widget, event, passive_only ); - } else { - if ( passive_only ) return 0; - // All other are interactions - } - } else { - qt_motifdnd_handle_msg( widget, event, passive_only ); - } - - return 0; -} - -/*! - This function does the core processing of individual X - \a{event}s, normally by dispatching TQt events to the right - destination. - - It returns 1 if the event was consumed by special handling, 0 if - the \a event was consumed by normal handling, and -1 if the \a - event was for an unrecognized widget. - - \sa x11EventFilter() -*/ -int TQApplication::x11ProcessEvent( XEvent* event ) -{ - switch ( event->type ) { - case ButtonPress: - ignoreNextMouseReleaseEvent = FALSE; - tqt_x_user_time = event->xbutton.time; - // fallthrough intended - case ButtonRelease: - tqt_x_time = event->xbutton.time; - break; - case MotionNotify: - tqt_x_time = event->xmotion.time; - break; - case XKeyPress: - tqt_x_user_time = event->xkey.time; - // fallthrough intended - case XKeyRelease: - tqt_x_time = event->xkey.time; - break; - case PropertyNotify: - tqt_x_time = event->xproperty.time; - break; - case EnterNotify: - case LeaveNotify: - tqt_x_time = event->xcrossing.time; - break; - case SelectionClear: - tqt_x_time = event->xselectionclear.time; - break; - default: - break; - } - - TQETWidget *widget = (TQETWidget*)TQWidget::find( (WId)event->xany.window ); - - if ( wPRmapper ) { // just did a widget reparent? - if ( widget == 0 ) { // not in std widget mapper - switch ( event->type ) { // only for mouse/key events - case ButtonPress: - case ButtonRelease: - case MotionNotify: - case XKeyPress: - case XKeyRelease: - widget = qPRFindWidget( event->xany.window ); - break; - } - } - else if ( widget->testWState(WState_Reparented) ) - qPRCleanup( widget ); // remove from alt mapper - } - - TQETWidget *keywidget=0; - bool grabbed=FALSE; - if ( event->type==XKeyPress || event->type==XKeyRelease ) { - keywidget = (TQETWidget*)TQWidget::keyboardGrabber(); - if ( keywidget ) { - grabbed = TRUE; - } else { - if ( focus_widget ) - keywidget = (TQETWidget*)focus_widget; - if ( !keywidget ) { - if ( inPopupMode() ) // no focus widget, see if we have a popup - keywidget = (TQETWidget*) activePopupWidget(); - else if ( widget ) - keywidget = (TQETWidget*)widget->topLevelWidget(); - } - } - } - -#ifndef TQT_NO_IM - // Filtering input events by the input context. It has to be taken - // place before any other key event consumers such as eventfilters - // and accelerators because some input methods require quite - // various key combination and sequences. It often conflicts with - // accelerators and so on, so we must give the input context the - // filtering opportunity first to ensure all input methods work - // properly regardless of application design. - -// #ifndef TQT_NO_IM_EXTENSIONS - if( keywidget && keywidget->isEnabled() && keywidget->isInputMethodEnabled() ) { -// #else -// if( keywidget && keywidget->isEnabled() ) { -// #endif - if( ( event->type==XKeyPress || event->type==XKeyRelease ) && - sm_blockUserInput ) // block user interaction during session management - return TRUE; - - // for XIM handling - TQInputContext *qic = keywidget->getInputContext(); - if( qic && qic->x11FilterEvent( keywidget, event ) ) - return TRUE; - - // filterEvent() accepts TQEvent *event rather than preexpanded key - // event attribute values. This is intended to pass other IM-related - // events in future. The IM-related events are supposed as - // TQWheelEvent, TQTabletEvent and so on. Other non IM-related events - // should not be forwarded to input contexts to prevent weird event - // handling. - if ( ( event->type == XKeyPress || event->type == XKeyRelease ) ) { - int code = -1; - int count = 0; - int state; - char ascii = 0; - TQEvent::Type type; - TQString text; - - keywidget->translateKeyEventInternal( event, count, text, - state, ascii, code, type, - FALSE, FALSE ); - - // both key press/release is required for some complex - // input methods. don't eliminate anything. - TQKeyEvent keyevent( type, code, ascii, state, text, FALSE, count ); - - if( qic && qic->filterEvent( &keyevent ) ) - return TRUE; - } - } else -#endif // TQT_NO_IM - { - if ( XFilterEvent( event, None ) ) - return TRUE; - } - - if ( qt_x11EventFilter(event) ) // send through app filter - return 1; - - if ( event->type == MappingNotify ) { // keyboard mapping changed - XRefreshKeyboardMapping( &event->xmapping ); - return 0; - } - - if ( event->type == PropertyNotify ) { // some properties changed - if ( event->xproperty.window == TQPaintDevice::x11AppRootWindow( 0 ) ) { - // root properties for the first screen - if ( event->xproperty.atom == tqt_clipboard_sentinel ) { - if (qt_check_clipboard_sentinel() ) - emit clipboard()->dataChanged(); - } else if ( event->xproperty.atom == qt_selection_sentinel ) { - if (qt_check_selection_sentinel() ) - emit clipboard()->selectionChanged(); - } else if ( obey_desktop_settings ) { - if ( event->xproperty.atom == qt_resource_manager ) - qt_set_x11_resources(); - else if ( event->xproperty.atom == qt_settings_timestamp ) - TQApplication::x11_apply_settings(); - } - } - if ( event->xproperty.window == TQPaintDevice::x11AppRootWindow() ) { - // root properties for the default screen - if ( event->xproperty.atom == qt_input_encoding ) { - qt_set_input_encoding(); - } else if ( event->xproperty.atom == qt_net_supported ) { - qt_get_net_supported(); - } else if ( event->xproperty.atom == qt_net_virtual_roots ) { - qt_get_net_virtual_roots(); - } else if ( event->xproperty.atom == qt_net_workarea ) { - qt_desktopwidget_update_workarea(); - } - } else if ( widget ) { - widget->translatePropertyEvent(event); - } else { - return -1; // don't know this window - } - return 0; - } - -#ifndef TQT_NO_XRANDR - // XRandR doesn't care if TQt doesn't know about the widget, so handle XRandR stuff before the !widget check below - if (event->type == xrandr_eventbase + RRScreenChangeNotify - || ( event->type == ConfigureNotify && event->xconfigure.window == TQPaintDevice::x11AppRootWindow())) { - // update Xlib internals with the latest screen configuration - XRRUpdateConfiguration(event); - - // update the size for desktop widget - int scr = XRRRootToScreen( appDpy, event->xany.window ); - TQWidget *w = desktop()->screen( scr ); - - if (w) { - int widgetScr = -1; - // make sure the specified widget is on the same screen that received the XRandR event - XWindowAttributes widgetAttr; - XGetWindowAttributes(appDpy, w->winId(), &widgetAttr); - if (widgetAttr.screen) { - widgetScr = XScreenNumberOfScreen(widgetAttr.screen); - } - - if ((widgetScr < 0) || (widgetScr == scr)) { - TQSize oldSize( w->size() ); - w->crect.setWidth( DisplayWidth( appDpy, scr ) ); - w->crect.setHeight( DisplayHeight( appDpy, scr ) ); - if ( w->size() != oldSize ) { - TQResizeEvent e( w->size(), oldSize ); - TQApplication::sendEvent( w, &e ); - emit desktop()->resized( scr ); - } - } - } - } -#endif // TQT_NO_XRANDR - - if ( !widget ) { // don't know this windows - TQWidget* popup = TQApplication::activePopupWidget(); - if ( popup ) { - - /* - That is more than suboptimal. The real solution should - do some keyevent and buttonevent translation, so that - the popup still continues to work as the user expects. - Unfortunately this translation is currently only - possible with a known widget. I'll change that soon - (Matthias). - */ - - // Danger - make sure we don't lock the server - switch ( event->type ) { - case ButtonPress: - case ButtonRelease: - case XKeyPress: - case XKeyRelease: - do { - popup->close(); - } while ( (popup = tqApp->activePopupWidget()) ); - return 1; - } - } - return -1; - } - - if ( event->type == XKeyPress || event->type == XKeyRelease ) - widget = keywidget; // send XKeyEvents through keywidget->x11Event() - - if ( app_do_modal ) // modal event handling - if ( !tqt_try_modal(widget, event) ) { - if ( event->type == ClientMessage ) - x11ClientMessage( widget, event, TRUE ); - return 1; - } - - - if ( widget->x11Event(event) ) // send through widget filter - return 1; -#if defined (QT_TABLET_SUPPORT) - if ( event->type == xinput_motion || - event->type == xinput_button_release || - event->type == xinput_button_press ) { - widget->translateXinputEvent( event ); - return 0; - } -#endif - - switch ( event->type ) { - - case ButtonRelease: // mouse event - if ( ignoreNextMouseReleaseEvent ) { - ignoreNextMouseReleaseEvent = FALSE; - break; - } - // fall through intended - case ButtonPress: - if (event->xbutton.root != RootWindow(widget->x11Display(), widget->x11Screen()) - && ! qt_xdnd_dragging) { - while ( activePopupWidget() ) - activePopupWidget()->close(); - return 1; - } - if (event->type == ButtonPress) - qt_net_update_user_time(widget->topLevelWidget()); - // fall through intended - case MotionNotify: -#if defined(QT_TABLET_SUPPORT) - if ( !chokeMouse ) { -#endif - widget->translateMouseEvent( event ); -#if defined(QT_TABLET_SUPPORT) - } else { - chokeMouse = FALSE; - } -#endif - break; - - case XKeyPress: // keyboard event - qt_net_update_user_time(widget->topLevelWidget()); - // fallthrough intended - case XKeyRelease: - { - if ( keywidget && keywidget->isEnabled() ) { // should always exist - // tqDebug( "sending key event" ); - keywidget->translateKeyEvent( event, grabbed ); - } - break; - } - - case GraphicsExpose: - case Expose: // paint event - widget->translatePaintEvent( event ); - break; - - case ConfigureNotify: // window move/resize event - if ( event->xconfigure.event == event->xconfigure.window ) - widget->translateConfigEvent( event ); - break; - - case XFocusIn: { // got focus - if ( widget->isDesktop() ) - break; - if ( inPopupMode() ) // some delayed focus event to ignore - break; - if ( !widget->isTopLevel() ) - break; - if ( event->xfocus.detail != NotifyAncestor && - event->xfocus.detail != NotifyInferior && - event->xfocus.detail != NotifyNonlinear ) - break; - widget->createInputContext(); - setActiveWindow( widget ); - if ( qt_focus_model == FocusModel_PointerRoot ) { - // We got real input focus from somewhere, but we were in PointerRoot - // mode, so we don't trust this event. Check the focus model to make - // sure we know what focus mode we are using... - qt_check_focus_model(); - } - } - break; - - case XFocusOut: // lost focus - if ( widget->isDesktop() ) - break; - if ( !widget->isTopLevel() ) - break; - if ( event->xfocus.mode == NotifyGrab ) - qt_xfocusout_grab_counter++; - if ( event->xfocus.mode != NotifyNormal ) - break; - if ( event->xfocus.detail != NotifyAncestor && - event->xfocus.detail != NotifyNonlinearVirtual && - event->xfocus.detail != NotifyNonlinear ) - break; - if ( !inPopupMode() && widget == active_window ) - setActiveWindow( 0 ); - break; - - case EnterNotify: { // enter window - if ( TQWidget::mouseGrabber() && widget != TQWidget::mouseGrabber() ) - break; - if ( inPopupMode() && widget->topLevelWidget() != activePopupWidget() ) - break; - if ( event->xcrossing.mode != NotifyNormal || - event->xcrossing.detail == NotifyVirtual || - event->xcrossing.detail == NotifyNonlinearVirtual ) - break; - if ( event->xcrossing.focus && - !widget->isDesktop() && !widget->isActiveWindow() ) { - if ( qt_focus_model == FocusModel_Unknown ) // check focus model - qt_check_focus_model(); - if ( qt_focus_model == FocusModel_PointerRoot ) // PointerRoot mode - setActiveWindow( widget ); - } - tqt_dispatchEnterLeave( widget, TQWidget::find( curWin ) ); - curWin = widget->winId(); - widget->translateMouseEvent( event ); //we don't get MotionNotify, emulate it - } - break; - - case LeaveNotify: { // leave window - if ( TQWidget::mouseGrabber() && widget != TQWidget::mouseGrabber() ) - break; - if ( curWin && widget->winId() != curWin ) - break; - if ( event->xcrossing.mode != NotifyNormal ) - break; - if ( !widget->isDesktop() ) - widget->translateMouseEvent( event ); //we don't get MotionNotify, emulate it - - TQWidget* enter = 0; - XEvent ev; - while ( XCheckMaskEvent( widget->x11Display(), EnterWindowMask | LeaveWindowMask , &ev ) - && !qt_x11EventFilter( &ev )) { - TQWidget* event_widget = TQWidget::find( ev.xcrossing.window ); - if( event_widget && event_widget->x11Event( &ev ) ) - break; - if ( ev.type == LeaveNotify && ev.xcrossing.mode == NotifyNormal ){ - enter = event_widget; - XPutBackEvent( widget->x11Display(), &ev ); - break; - } - if ( ev.xcrossing.mode != NotifyNormal || - ev.xcrossing.detail == NotifyVirtual || - ev.xcrossing.detail == NotifyNonlinearVirtual ) - continue; - enter = event_widget; - if ( ev.xcrossing.focus && - enter && !enter->isDesktop() && !enter->isActiveWindow() ) { - if ( qt_focus_model == FocusModel_Unknown ) // check focus model - qt_check_focus_model(); - if ( qt_focus_model == FocusModel_PointerRoot ) // PointerRoot mode - setActiveWindow( enter ); - } - break; - } - - if ( ( ! enter || enter->isDesktop() ) && - event->xcrossing.focus && widget == active_window && - qt_focus_model == FocusModel_PointerRoot // PointerRoot mode - ) { - setActiveWindow( 0 ); - } - - if ( !curWin ) - tqt_dispatchEnterLeave( widget, 0 ); - - tqt_dispatchEnterLeave( enter, widget ); - curWin = enter ? enter->winId() : 0; - } - break; - - case UnmapNotify: // window hidden - if ( widget->isTopLevel() && widget->isShown() ) { - widget->topData()->spont_unmapped = 1; - TQHideEvent e; - TQApplication::sendSpontaneousEvent( widget, &e ); - widget->hideChildren( TRUE ); - } - break; - - case MapNotify: // window shown - if ( widget->isTopLevel() && - widget->topData()->spont_unmapped ) { - widget->topData()->spont_unmapped = 0; - widget->showChildren( TRUE ); - TQShowEvent e; - TQApplication::sendSpontaneousEvent( widget, &e ); - } - break; - - case ClientMessage: // client message - return x11ClientMessage(widget,event,False); - - case ReparentNotify: // window manager reparents - while ( XCheckTypedWindowEvent( widget->x11Display(), - widget->winId(), - ReparentNotify, - event ) ) - ; // skip old reparent events - if ( event->xreparent.parent == TQPaintDevice::x11AppRootWindow() ) { - if ( widget->isTopLevel() ) { - widget->topData()->parentWinId = event->xreparent.parent; - if ( qt_deferred_map_contains( widget ) ) { - qt_deferred_map_take( widget ); - XMapWindow( appDpy, widget->winId() ); - } - } - } else - // store the parent. Useful for many things, embedding for instance. - widget->topData()->parentWinId = event->xreparent.parent; - if ( widget->isTopLevel() ) { - // the widget frame strut should also be invalidated - widget->topData()->fleft = widget->topData()->fright = - widget->topData()->ftop = widget->topData()->fbottom = 0; - - if ( qt_focus_model != FocusModel_Unknown ) { - // toplevel reparented... - TQWidget *newparent = TQWidget::find( event->xreparent.parent ); - if ( ! newparent || newparent->isDesktop() ) { - // we dont' know about the new parent (or we've been - // reparented to root), perhaps a window manager - // has been (re)started? reset the focus model to unknown - qt_focus_model = FocusModel_Unknown; - } - } - } - break; - - case SelectionRequest: { - XSelectionRequestEvent *req = &event->xselectionrequest; - if (! req) - break; - - if ( qt_xdnd_selection && req->selection == qt_xdnd_selection ) { - qt_xdnd_handle_selection_request( req ); - - } else if (tqt_clipboard) { - TQCustomEvent e( TQEvent::Clipboard, event ); - TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); - } - break; - } - case SelectionClear: { - XSelectionClearEvent *req = &event->xselectionclear; - // don't deliver dnd events to the clipboard, it gets confused - if (! req || ( qt_xdnd_selection && req->selection ) == qt_xdnd_selection) - break; - - if (tqt_clipboard) { - TQCustomEvent e( TQEvent::Clipboard, event ); - TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); - } - break; - } - - case SelectionNotify: { - XSelectionEvent *req = &event->xselection; - // don't deliver dnd events to the clipboard, it gets confused - if (! req || ( qt_xdnd_selection && req->selection ) == qt_xdnd_selection) - break; - - if (tqt_clipboard) { - TQCustomEvent e( TQEvent::Clipboard, event ); - TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); - } - break; - } - - default: - break; - } - - return 0; -} - -/*! - This virtual function is only implemented under X11. - - If you create an application that inherits TQApplication and - reimplement this function, you get direct access to all X events - that the are received from the X server. - - Return TRUE if you want to stop the event from being processed. - Return FALSE for normal event dispatching. - - \sa x11ProcessEvent() -*/ - -bool TQApplication::x11EventFilter( XEvent * ) -{ - return FALSE; -} - - - -/***************************************************************************** - Modal widgets; Since Xlib has little support for this we roll our own - modal widget mechanism. - A modal widget without a parent becomes application-modal. - A modal widget with a parent becomes modal to its parent and grandparents.. - - tqt_enter_modal() - Enters modal state - Arguments: - TQWidget *widget A modal widget - - tqt_leave_modal() - Leaves modal state for a widget - Arguments: - TQWidget *widget A modal widget - *****************************************************************************/ - -bool tqt_modal_state() -{ - return app_do_modal; -} - -void tqt_enter_modal( TQWidget *widget ) -{ - if ( !tqt_modal_stack ) { // create modal stack - tqt_modal_stack = new TQWidgetList; - TQ_CHECK_PTR( tqt_modal_stack ); - } - if (widget->parentWidget()) { - TQEvent e(TQEvent::WindowBlocked); - TQApplication::sendEvent(widget->parentWidget(), &e); - } - - tqt_dispatchEnterLeave( 0, TQWidget::find((WId)curWin) ); - tqt_modal_stack->insert( 0, widget ); - app_do_modal = TRUE; - curWin = 0; - ignoreNextMouseReleaseEvent = FALSE; -} - - -void tqt_leave_modal( TQWidget *widget ) -{ - if ( tqt_modal_stack && tqt_modal_stack->removeRef(widget) ) { - if ( tqt_modal_stack->isEmpty() ) { - delete tqt_modal_stack; - tqt_modal_stack = 0; - TQPoint p( TQCursor::pos() ); - TQWidget* w = TQApplication::widgetAt( p.x(), p.y(), TRUE ); - tqt_dispatchEnterLeave( w, TQWidget::find( curWin ) ); // send synthetic enter event - curWin = w? w->winId() : 0; - } - } - app_do_modal = tqt_modal_stack != 0; - ignoreNextMouseReleaseEvent = TRUE; - - if (widget->parentWidget()) { - TQEvent e(TQEvent::WindowUnblocked); - TQApplication::sendEvent(widget->parentWidget(), &e); - } -} - - -TQ_EXPORT bool tqt_try_modal( TQWidget *widget, XEvent *event ) -{ - if (qt_xdnd_dragging) { - // allow mouse events while DnD is active - switch (event->type) { - case ButtonPress: - case ButtonRelease: - case MotionNotify: - return TRUE; - default: - break; - } - } - - if ( tqt_tryModalHelper( widget ) ) - return TRUE; - - bool block_event = FALSE; - switch ( event->type ) { - case ButtonPress: // disallow mouse/key events - case ButtonRelease: - case MotionNotify: - case XKeyPress: - case XKeyRelease: - case EnterNotify: - case LeaveNotify: - case ClientMessage: - block_event = TRUE; - break; - default: - break; - } - - return !block_event; -} - - -/***************************************************************************** - Popup widget mechanism - - openPopup() - Adds a widget to the list of popup widgets - Arguments: - TQWidget *widget The popup widget to be added - - closePopup() - Removes a widget from the list of popup widgets - Arguments: - TQWidget *widget The popup widget to be removed - *****************************************************************************/ - - -static int openPopupCount = 0; -void TQApplication::openPopup( TQWidget *popup ) -{ - openPopupCount++; - if ( !popupWidgets ) { // create list - popupWidgets = new TQWidgetList; - TQ_CHECK_PTR( popupWidgets ); - } - popupWidgets->append( popup ); // add to end of list - - if ( popupWidgets->count() == 1 && !qt_nograb() ){ // grab mouse/keyboard - int r = XGrabKeyboard( popup->x11Display(), popup->winId(), FALSE, - GrabModeSync, GrabModeAsync, CurrentTime ); - if ( (popupGrabOk = (r == GrabSuccess)) ) { - r = XGrabPointer( popup->x11Display(), popup->winId(), TRUE, - (uint)(ButtonPressMask | ButtonReleaseMask | - ButtonMotionMask | EnterWindowMask | - LeaveWindowMask | PointerMotionMask), - GrabModeSync, GrabModeAsync, - None, None, CurrentTime ); - - if ( (popupGrabOk = (r == GrabSuccess)) ) - XAllowEvents( popup->x11Display(), SyncPointer, CurrentTime ); - else - XUngrabKeyboard( popup->x11Display(), CurrentTime ); - } - } else if ( popupGrabOk ) { - XAllowEvents( popup->x11Display(), SyncPointer, CurrentTime ); - } - - // popups are not focus-handled by the window system (the first - // popup grabbed the keyboard), so we have to do that manually: A - // new popup gets the focus - TQFocusEvent::setReason( TQFocusEvent::Popup ); - if ( popup->focusWidget()) - popup->focusWidget()->setFocus(); - else - popup->setFocus(); - TQFocusEvent::resetReason(); -} - -void TQApplication::closePopup( TQWidget *popup ) -{ - if ( !popupWidgets ) - return; - popupWidgets->removeRef( popup ); - if (popup == popupOfPopupButtonFocus) { - popupButtonFocus = 0; - popupOfPopupButtonFocus = 0; - } - if ( popupWidgets->count() == 0 ) { // this was the last popup - popupCloseDownMode = TRUE; // control mouse events - delete popupWidgets; - popupWidgets = 0; - if ( !qt_nograb() && popupGrabOk ) { // grabbing not disabled - if ( mouseButtonState != 0 - || popup->geometry(). contains(TQPoint(mouseGlobalXPos, mouseGlobalYPos) ) ) - { // mouse release event or inside - XAllowEvents( popup->x11Display(), AsyncPointer, - CurrentTime ); - } else { // mouse press event - mouseButtonPressTime -= 10000; // avoid double click - XAllowEvents( popup->x11Display(), ReplayPointer,CurrentTime ); - } - XUngrabPointer( popup->x11Display(), CurrentTime ); - XFlush( popup->x11Display() ); - } - if ( active_window ) { - TQFocusEvent::setReason( TQFocusEvent::Popup ); - if ( active_window->focusWidget() ) - active_window->focusWidget()->setFocus(); - else - active_window->setFocus(); - TQFocusEvent::resetReason(); - } - } else { - // popups are not focus-handled by the window system (the - // first popup grabbed the keyboard), so we have to do that - // manually: A popup was closed, so the previous popup gets - // the focus. - TQFocusEvent::setReason( TQFocusEvent::Popup ); - TQWidget* aw = popupWidgets->getLast(); - if (aw->focusWidget()) - aw->focusWidget()->setFocus(); - else - aw->setFocus(); - TQFocusEvent::resetReason(); - if ( popupWidgets->count() == 1 && !qt_nograb() ){ // grab mouse/keyboard - int r = XGrabKeyboard( aw->x11Display(), aw->winId(), FALSE, - GrabModeSync, GrabModeAsync, CurrentTime ); - if ( (popupGrabOk = (r == GrabSuccess)) ) { - r = XGrabPointer( aw->x11Display(), aw->winId(), TRUE, - (uint)(ButtonPressMask | ButtonReleaseMask | - ButtonMotionMask | EnterWindowMask | - LeaveWindowMask | PointerMotionMask), - GrabModeSync, GrabModeAsync, - None, None, CurrentTime ); - - if ( (popupGrabOk = (r == GrabSuccess)) ) - XAllowEvents( aw->x11Display(), SyncPointer, CurrentTime ); - } - } - } -} - -/***************************************************************************** - Event translation; translates X11 events to TQt events - *****************************************************************************/ - -// -// Mouse event translation -// -// Xlib doesn't give mouse double click events, so we generate them by -// comparing window, time and position between two mouse press events. -// - -// -// Keyboard event translation -// - -int qt_x11_translateButtonState( int s ) -{ - int bst = 0; - if ( s & Button1Mask ) - bst |= TQt::LeftButton; - if ( s & Button2Mask ) - bst |= TQt::MidButton; - if ( s & Button3Mask ) - bst |= TQt::RightButton; - if ( s & ShiftMask ) - bst |= TQt::ShiftButton; - if ( s & ControlMask ) - bst |= TQt::ControlButton; - if ( s & qt_alt_mask ) - bst |= TQt::AltButton; - if ( s & qt_meta_mask ) - bst |= TQt::MetaButton; - return bst; -} - -bool TQETWidget::translateMouseEvent( const XEvent *event ) -{ - static bool manualGrab = FALSE; - TQEvent::Type type; // event parameters - TQPoint pos; - TQPoint globalPos; - int button = 0; - int state; - XEvent nextEvent; - - if ( sm_blockUserInput ) // block user interaction during session management - return TRUE; - - static int x_root_save = -1, y_root_save = -1; - - if ( event->type == MotionNotify ) { // mouse move - if (event->xmotion.root != RootWindow(appDpy, x11Screen()) && - ! qt_xdnd_dragging ) - return FALSE; - - XMotionEvent lastMotion = event->xmotion; - while( XPending( appDpy ) ) { // compres mouse moves - XNextEvent( appDpy, &nextEvent ); - if ( nextEvent.type == ConfigureNotify - || nextEvent.type == PropertyNotify - || nextEvent.type == Expose - || nextEvent.type == NoExpose ) { - tqApp->x11ProcessEvent( &nextEvent ); - continue; - } else if ( nextEvent.type != MotionNotify || - nextEvent.xmotion.window != event->xmotion.window || - nextEvent.xmotion.state != event->xmotion.state ) { - XPutBackEvent( appDpy, &nextEvent ); - break; - } - if ( !qt_x11EventFilter(&nextEvent) - && !x11Event( &nextEvent ) ) // send event through filter - lastMotion = nextEvent.xmotion; - else - break; - } - type = TQEvent::MouseMove; - pos.rx() = lastMotion.x; - pos.ry() = lastMotion.y; - globalPos.rx() = lastMotion.x_root; - globalPos.ry() = lastMotion.y_root; - state = qt_x11_translateButtonState( lastMotion.state ); - if ( qt_button_down && (state & (LeftButton | - MidButton | - RightButton ) ) == 0 ) - qt_button_down = 0; - - // throw away mouse move events that are sent multiple times to the same - // position - bool throw_away = FALSE; - if ( x_root_save == globalPos.x() && - y_root_save == globalPos.y() ) - throw_away = TRUE; - x_root_save = globalPos.x(); - y_root_save = globalPos.y(); - if ( throw_away ) - return TRUE; - } else if ( event->type == EnterNotify || event->type == LeaveNotify) { - XEvent *xevent = (XEvent *)event; - //unsigned int xstate = event->xcrossing.state; - type = TQEvent::MouseMove; - pos.rx() = xevent->xcrossing.x; - pos.ry() = xevent->xcrossing.y; - globalPos.rx() = xevent->xcrossing.x_root; - globalPos.ry() = xevent->xcrossing.y_root; - state = qt_x11_translateButtonState( xevent->xcrossing.state ); - if ( qt_button_down && (state & (LeftButton | - MidButton | - RightButton ) ) == 0 ) - qt_button_down = 0; - if ( !qt_button_down ) - state = state & ~(LeftButton | MidButton | RightButton ); - } else { // button press or release - pos.rx() = event->xbutton.x; - pos.ry() = event->xbutton.y; - globalPos.rx() = event->xbutton.x_root; - globalPos.ry() = event->xbutton.y_root; - state = qt_x11_translateButtonState( event->xbutton.state ); - switch ( event->xbutton.button ) { - case Button1: button = LeftButton; break; - case Button2: button = MidButton; break; - case Button3: button = RightButton; break; - case Button4: - case Button5: - case 6: - case 7: - // the fancy mouse wheel. - - // take care about grabbing. We do this here since it - // is clear that we return anyway - if ( tqApp->inPopupMode() && popupGrabOk ) - XAllowEvents( x11Display(), SyncPointer, CurrentTime ); - - // We are only interested in ButtonPress. - if (event->type == ButtonPress ){ - - // compress wheel events (the X Server will simply - // send a button press for each single notch, - // regardless whether the application can catch up - // or not) - int delta = 1; - XEvent xevent; - while ( XCheckTypedWindowEvent(x11Display(),winId(), - ButtonPress,&xevent) ){ - if (xevent.xbutton.button != event->xbutton.button){ - XPutBackEvent(x11Display(), &xevent); - break; - } - delta++; - } - - // the delta is defined as multiples of - // WHEEL_DELTA, which is set to 120. Future wheels - // may offer a finer-resolution. A positive delta - // indicates forward rotation, a negative one - // backward rotation respectively. - int btn = event->xbutton.button; - delta *= 120 * ( (btn == Button4 || btn == 6) ? 1 : -1 ); - bool hor = ( ( (btn == Button4 || btn == Button5) && (state&AltButton) ) || - (btn == 6 || btn == 7) ); - translateWheelEvent( globalPos.x(), globalPos.y(), delta, state, (hor)?Horizontal:Vertical ); - } - return TRUE; - - // history navigation buttons - case 8: button = HistoryBackButton; break; - case 9: button = HistoryForwardButton; break; - } - if ( event->type == ButtonPress ) { // mouse button pressed -#if defined(Q_OS_IRIX) && defined(QT_TABLET_SUPPORT) - XEvent myEv; - if ( XCheckTypedEvent( appDpy, xinput_button_press, &myEv ) ) { - if ( translateXinputEvent( &myEv ) ) { - //Spontaneous event sent. Check if we need to continue. - if ( chokeMouse ) { - chokeMouse = FALSE; - return FALSE; - } - } - } -#endif - qt_button_down = childAt( pos ); //magic for masked widgets - if ( !qt_button_down || !qt_button_down->testWFlags(WMouseNoMask) ) - qt_button_down = this; - if ( mouseActWindow == event->xbutton.window && - mouseButtonPressed == button && - (long)event->xbutton.time -(long)mouseButtonPressTime - < TQApplication::doubleClickInterval() && - TQABS(event->xbutton.x - mouseXPos) < 5 && - TQABS(event->xbutton.y - mouseYPos) < 5 ) { - type = TQEvent::MouseButtonDblClick; - mouseButtonPressTime -= 2000; // no double-click next time - } else { - type = TQEvent::MouseButtonPress; - mouseButtonPressTime = event->xbutton.time; - } - mouseButtonPressed = button; // save event params for - mouseXPos = pos.x(); // future double click tests - mouseYPos = pos.y(); - mouseGlobalXPos = globalPos.x(); - mouseGlobalYPos = globalPos.y(); - } else { // mouse button released -#if defined(Q_OS_IRIX) && defined(QT_TABLET_SUPPORT) - XEvent myEv; - if ( XCheckTypedEvent( appDpy, xinput_button_release, &myEv ) ) { - if ( translateXinputEvent( &myEv ) ) { - //Spontaneous event sent. Check if we need to continue. - if ( chokeMouse ) { - chokeMouse = FALSE; - return FALSE; - } - } - } -#endif - if ( manualGrab ) { // release manual grab - manualGrab = FALSE; - XUngrabPointer( x11Display(), CurrentTime ); - XFlush( x11Display() ); - } - - type = TQEvent::MouseButtonRelease; - } - } - mouseActWindow = winId(); // save some event params - mouseButtonState = state; - if ( type == 0 ) // don't send event - return FALSE; - - if ( tqApp->inPopupMode() ) { // in popup mode - TQWidget *popup = tqApp->activePopupWidget(); - if ( popup != this ) { - if ( testWFlags(WType_Popup) && rect().contains(pos) ) - popup = this; - else // send to last popup - pos = popup->mapFromGlobal( globalPos ); - } - bool releaseAfter = FALSE; - TQWidget *popupChild = popup->childAt( pos ); - TQWidget *popupTarget = popupChild ? popupChild : popup; - - if (popup != popupOfPopupButtonFocus){ - popupButtonFocus = 0; - popupOfPopupButtonFocus = 0; - } - - if ( !popupTarget->isEnabled() ) { - if ( popupGrabOk ) - XAllowEvents( x11Display(), SyncPointer, CurrentTime ); - } - - switch ( type ) { - case TQEvent::MouseButtonPress: - case TQEvent::MouseButtonDblClick: - popupButtonFocus = popupChild; - popupOfPopupButtonFocus = popup; - break; - case TQEvent::MouseButtonRelease: - releaseAfter = TRUE; - break; - default: - break; // nothing for mouse move - } - - Display* dpy = x11Display(); // store display, send() may destroy us - - - int oldOpenPopupCount = openPopupCount; - - if ( popupButtonFocus ) { - TQMouseEvent e( type, popupButtonFocus->mapFromGlobal(globalPos), - globalPos, button, state ); - TQApplication::sendSpontaneousEvent( popupButtonFocus, &e ); - if ( releaseAfter ) { - popupButtonFocus = 0; - popupOfPopupButtonFocus = 0; - } - } else if ( popupChild ) { - TQMouseEvent e( type, popupChild->mapFromGlobal(globalPos), - globalPos, button, state ); - TQApplication::sendSpontaneousEvent( popupChild, &e ); - } else { - TQMouseEvent e( type, pos, globalPos, button, state ); - TQApplication::sendSpontaneousEvent( popup, &e ); - } - - if ( type == TQEvent::MouseButtonPress && button == RightButton && ( openPopupCount == oldOpenPopupCount ) ) { - TQWidget *popupEvent = popup; - if(popupButtonFocus) - popupEvent = popupButtonFocus; - else if(popupChild) - popupEvent = popupChild; - TQContextMenuEvent e( TQContextMenuEvent::Mouse, pos, globalPos, state ); - TQApplication::sendSpontaneousEvent( popupEvent, &e ); - } - - if ( releaseAfter ) - qt_button_down = 0; - - if ( tqApp->inPopupMode() ) { // still in popup mode - if ( popupGrabOk ) - XAllowEvents( dpy, SyncPointer, CurrentTime ); - } else { - if ( type != TQEvent::MouseButtonRelease && state != 0 && - TQWidget::find((WId)mouseActWindow) ) { - manualGrab = TRUE; // need to manually grab - XGrabPointer( dpy, mouseActWindow, False, - (uint)(ButtonPressMask | ButtonReleaseMask | - ButtonMotionMask | - EnterWindowMask | LeaveWindowMask), - GrabModeAsync, GrabModeAsync, - None, None, CurrentTime ); - } - } - - } else { - TQWidget *widget = this; - TQWidget *w = TQWidget::mouseGrabber(); - if ( !w ) - w = qt_button_down; - if ( w && w != this ) { - widget = w; - pos = w->mapFromGlobal( globalPos ); - } - - if ( popupCloseDownMode ) { - popupCloseDownMode = FALSE; - if ( testWFlags(WType_Popup) ) // ignore replayed event - return TRUE; - } - - if ( type == TQEvent::MouseButtonRelease && - (state & (~button) & ( LeftButton | - MidButton | - RightButton)) == 0 ) { - qt_button_down = 0; - } - - int oldOpenPopupCount = openPopupCount; - - TQMouseEvent e( type, pos, globalPos, button, state ); - TQApplication::sendSpontaneousEvent( widget, &e ); - - if ( type == TQEvent::MouseButtonPress && button == RightButton && ( openPopupCount == oldOpenPopupCount ) ) { - TQContextMenuEvent e( TQContextMenuEvent::Mouse, pos, globalPos, state ); - TQApplication::sendSpontaneousEvent( widget, &e ); - } - } - return TRUE; -} - - -// -// Wheel event translation -// -bool TQETWidget::translateWheelEvent( int global_x, int global_y, int delta, int state, Orientation orient ) -{ - // send the event to the widget or its ancestors - { - TQWidget* popup = tqApp->activePopupWidget(); - if ( popup && topLevelWidget() != popup ) - popup->close(); - TQWheelEvent e( mapFromGlobal(TQPoint( global_x, global_y)), - TQPoint(global_x, global_y), delta, state, orient ); - if ( TQApplication::sendSpontaneousEvent( this, &e ) ) - return TRUE; - } - - // send the event to the widget that has the focus or its ancestors, if different - TQWidget *w = this; - if ( w != tqApp->focusWidget() && ( w = tqApp->focusWidget() ) ) { - TQWidget* popup = tqApp->activePopupWidget(); - if ( popup && w != popup ) - popup->hide(); - TQWheelEvent e( mapFromGlobal(TQPoint( global_x, global_y)), - TQPoint(global_x, global_y), delta, state, orient ); - if ( TQApplication::sendSpontaneousEvent( w, &e ) ) - return TRUE; - } - return FALSE; -} - - -// -// XInput Translation Event -// -#if defined (QT_TABLET_SUPPORT) -bool TQETWidget::translateXinputEvent( const XEvent *ev ) -{ -#if defined (Q_OS_IRIX) - // Wacom has put defines in their wacom.h file so it would be quite wise - // to use them, need to think of a decent way of not using - // it when it doesn't exist... - XDeviceState *s; - XInputClass *iClass; - XValuatorState *vs; - int j; -#endif - TQWidget *w = this; - TQPoint global, - curr; - static int pressure = 0; - static int xTilt = 0, - yTilt = 0; - int deviceType = TQTabletEvent::NoDevice; - TQPair tId; - XEvent xinputMotionEvent; - XEvent mouseMotionEvent; -#if defined (Q_OS_IRIX) - XDevice *dev; -#endif - const XDeviceMotionEvent *motion = 0; - XDeviceButtonEvent *button = 0; - TQEvent::Type t; - - if ( ev->type == xinput_motion ) { - motion = (const XDeviceMotionEvent*)ev; - for (;;) { - if (!XCheckTypedWindowEvent(x11Display(), winId(), MotionNotify, &mouseMotionEvent)) - break; - if (!XCheckTypedWindowEvent(x11Display(), winId(), xinput_motion, &xinputMotionEvent)) { - XPutBackEvent(x11Display(), &mouseMotionEvent); - break; - } - if (mouseMotionEvent.xmotion.time != motion->time) { - XPutBackEvent(x11Display(), &mouseMotionEvent); - XPutBackEvent(x11Display(), &xinputMotionEvent); - break; - } - motion = ((const XDeviceMotionEvent*)&xinputMotionEvent); - } - t = TQEvent::TabletMove; - curr = TQPoint( motion->x, motion->y ); - } else { - if ( ev->type == xinput_button_press ) { - t = TQEvent::TabletPress; - } else { - t = TQEvent::TabletRelease; - } - button = (XDeviceButtonEvent*)ev; -/* - tqDebug( "\n\nXInput Button Event" ); - tqDebug( "serial:\t%d", button->serial ); - tqDebug( "send_event:\t%d", button->send_event ); - tqDebug( "display:\t%p", button->display ); - tqDebug( "window:\t%d", button->window ); - tqDebug( "deviceID:\t%d", button->deviceid ); - tqDebug( "root:\t%d", button->root ); - tqDebug( "subwindot:\t%d", button->subwindow ); - tqDebug( "x:\t%d", button->x ); - tqDebug( "y:\t%d", button->y ); - tqDebug( "x_root:\t%d", button->x_root ); - tqDebug( "y_root:\t%d", button->y_root ); - tqDebug( "state:\t%d", button->state ); - tqDebug( "button:\t%d", button->button ); - tqDebug( "same_screen:\t%d", button->same_screen ); - tqDebug( "time:\t%d", button->time ); -*/ - curr = TQPoint( button->x, button->y ); - } -#if defined(Q_OS_IRIX) - // default... - dev = devStylus; -#else - if ( ev->type == xinput_motion ) { - if ( motion->deviceid == devStylus->device_id ) { - deviceType = TQTabletEvent::Stylus; - } else if ( motion->deviceid == devEraser->device_id ) { - deviceType = TQTabletEvent::Eraser; - } - } else { - if ( button->deviceid == devStylus->device_id ) { - deviceType = TQTabletEvent::Stylus; - } else if ( button->deviceid == devEraser->device_id ) { - deviceType = TQTabletEvent::Eraser; - } - } -#endif - - const int PRESSURE_LEVELS = 255; - // we got the maximum pressure at start time, since various tablets have - // varying levels of distinguishing pressure changes, let's standardize and - // scale everything to 256 different levels... - static int scaleFactor = -1; - if ( scaleFactor == -1 ) { - if ( max_pressure > PRESSURE_LEVELS ) - scaleFactor = max_pressure / PRESSURE_LEVELS; - else - scaleFactor = PRESSURE_LEVELS / max_pressure; - } -#if defined (Q_OS_IRIX) - s = XQueryDeviceState( appDpy, dev ); - if ( s == NULL ) - return FALSE; - iClass = s->data; - for ( j = 0; j < s->num_classes; j++ ) { - if ( iClass->c_class == ValuatorClass ) { - vs = (XValuatorState *)iClass; - // figure out what device we have, based on bitmasking... - if ( vs->valuators[WAC_TRANSDUCER_I] - & WAC_TRANSDUCER_PROX_MSK ) { - switch ( vs->valuators[WAC_TRANSDUCER_I] - & WAC_TRANSDUCER_MSK ) { - case WAC_PUCK_ID: - deviceType = TQTabletEvent::Puck; - break; - case WAC_STYLUS_ID: - deviceType = TQTabletEvent::Stylus; - break; - case WAC_ERASER_ID: - deviceType = TQTabletEvent::Eraser; - break; - } - // Get a Unique Id for the device, Wacom gives us this ability - tId.first = vs->valuators[WAC_TRANSDUCER_I] & WAC_TRANSDUCER_ID_MSK; - tId.second = vs->valuators[WAC_SERIAL_NUM_I]; - } else - deviceType = TQTabletEvent::NoDevice; - // apparently Wacom needs a cast for the +/- values to make sense - xTilt = short(vs->valuators[WAC_XTILT_I]); - yTilt = short(vs->valuators[WAC_YTILT_I]); - if ( max_pressure > PRESSURE_LEVELS ) - pressure = vs->valuators[WAC_PRESSURE_I] / scaleFactor; - else - pressure = vs->valuators[WAC_PRESSURE_I] * scaleFactor; - global = TQPoint( vs->valuators[WAC_XCOORD_I], - vs->valuators[WAC_YCOORD_I] ); - break; - } - iClass = (XInputClass*)((char*)iClass + iClass->length); - } - XFreeDeviceState( s ); -#else - if ( motion ) { - xTilt = short(motion->axis_data[3]); - yTilt = short(motion->axis_data[4]); - if ( max_pressure > PRESSURE_LEVELS ) - pressure = motion->axis_data[2] / scaleFactor; - else - pressure = motion->axis_data[2] * scaleFactor; - global = TQPoint( motion->axis_data[0], motion->axis_data[1] ); - } else { - xTilt = short(button->axis_data[3]); - yTilt = short(button->axis_data[4]); - if ( max_pressure > PRESSURE_LEVELS ) - pressure = button->axis_data[2] / scaleFactor; - else - pressure = button->axis_data[2] * scaleFactor; - global = TQPoint( button->axis_data[0], button->axis_data[1] ); - } - // The only way to get these Ids is to scan the XFree86 log, which I'm not going to do. - tId.first = tId.second = -1; -#endif - - TQTabletEvent e( t, curr, global, deviceType, pressure, xTilt, yTilt, tId ); - TQApplication::sendSpontaneousEvent( w, &e ); - return TRUE; -} -#endif - -bool TQETWidget::translatePropertyEvent(const XEvent *event) -{ - if (!isTopLevel()) return TRUE; - - Atom ret; - int format, e; - unsigned char *data = 0; - unsigned long nitems, after; - - if (event->xproperty.atom == qt_net_wm_frame_strut) { - topData()->fleft = topData()->fright = topData()->ftop = topData()->fbottom = 0; - fstrut_dirty = 1; - - if (event->xproperty.state == PropertyNewValue) { - e = XGetWindowProperty(appDpy, event->xproperty.window, qt_net_wm_frame_strut, - 0, 4, // struts are 4 longs - False, XA_CARDINAL, &ret, &format, &nitems, &after, &data); - - if (e == Success && ret == XA_CARDINAL && - format == 32 && nitems == 4) { - long *strut = (long *) data; - topData()->fleft = strut[0]; - topData()->fright = strut[1]; - topData()->ftop = strut[2]; - topData()->fbottom = strut[3]; - fstrut_dirty = 0; - } - } - } else if (event->xproperty.atom == qt_net_wm_state) { - bool max = FALSE; - bool full = FALSE; - - if (event->xproperty.state == PropertyNewValue) { - // using length of 1024 should be safe for all current and - // possible NET states... - e = XGetWindowProperty(appDpy, event->xproperty.window, qt_net_wm_state, 0, 1024, - False, XA_ATOM, &ret, &format, &nitems, &after, &data); - - if (e == Success && ret == XA_ATOM && format == 32 && nitems > 0) { - Atom *states = (Atom *) data; - - unsigned long i; - for (i = 0; i < nitems; i++) { - if (states[i] == qt_net_wm_state_max_v || states[i] == qt_net_wm_state_max_h) - max = TRUE; - else if (states[i] == qt_net_wm_state_fullscreen) - full = TRUE; - } - } - } - - bool send_event = FALSE; - - if (qt_net_supports(qt_net_wm_state_max_v) - && qt_net_supports(qt_net_wm_state_max_h)) { - if (max && !isMaximized()) { - setWState(WState_Maximized); - send_event = TRUE; - } else if (!max && isMaximized()) { - clearWState(WState_Maximized); - send_event = TRUE; - } - } - - if (qt_net_supports(qt_net_wm_state_fullscreen)) { - if (full && !isFullScreen()) { - setWState(WState_FullScreen); - send_event = TRUE; - } else if (!full && isFullScreen()) { - clearWState(WState_FullScreen); - send_event = TRUE; - } - } - - if (send_event) { - TQEvent e(TQEvent::WindowStateChange); - TQApplication::sendSpontaneousEvent(this, &e); - } - } else if (event->xproperty.atom == tqt_wm_state) { - // the widget frame strut should also be invalidated - topData()->fleft = topData()->fright = topData()->ftop = topData()->fbottom = 0; - fstrut_dirty = 1; - - if (event->xproperty.state == PropertyDelete) { - // the window manager has removed the WM State property, - // so it is now in the withdrawn state (ICCCM 4.1.3.1) and - // we are free to reuse this window - topData()->parentWinId = 0; - // map the window if we were waiting for a transition to - // withdrawn - if ( qt_deferred_map_contains( this ) ) { - qt_deferred_map_take( this ); - XMapWindow( appDpy, winId() ); - } - } else if (topData()->parentWinId != TQPaintDevice::x11AppRootWindow(x11Screen())) { - // the window manager has changed the WM State property... - // we are wanting to see if we are withdrawn so that we - // can reuse this window... we only do this check *IF* we - // haven't been reparented to root - (the parentWinId != - // TQPaintDevice::x11AppRootWindow(x11Screen())) check - // above - - e = XGetWindowProperty(appDpy, winId(), tqt_wm_state, 0, 2, False, tqt_wm_state, - &ret, &format, &nitems, &after, &data ); - - if (e == Success && ret == tqt_wm_state && format == 32 && nitems > 0) { - long *state = (long *) data; - switch (state[0]) { - case WithdrawnState: - // if we are in the withdrawn state, we are free - // to reuse this window provided we remove the - // WM_STATE property (ICCCM 4.1.3.1) - XDeleteProperty(appDpy, winId(), tqt_wm_state); - - // set the parent id to zero, so that show() will - // work again - topData()->parentWinId = 0; - // map the window if we were waiting for a - // transition to withdrawn - if ( qt_deferred_map_contains( this ) ) { - qt_deferred_map_take( this ); - XMapWindow( appDpy, winId() ); - } - break; - - case IconicState: - if (!isMinimized()) { - // window was minimized - setWState(WState_Minimized); - TQEvent e(TQEvent::WindowStateChange); - TQApplication::sendSpontaneousEvent(this, &e); - } - break; - - default: - if (isMinimized()) { - // window was un-minimized - clearWState(WState_Minimized); - TQEvent e(TQEvent::WindowStateChange); - TQApplication::sendSpontaneousEvent(this, &e); - } - break; - } - } - } - } - - if (data) - XFree(data); - - return TRUE; -} - -#ifndef XK_ISO_Left_Tab -#define XK_ISO_Left_Tab 0xFE20 -#endif - -// the next lines are taken from XFree > 4.0 (X11/XF86keysyms.h), defining some special -// multimedia keys. They are included here as not every system has them. -#define XF86XK_Standby 0x1008FF10 -#define XF86XK_AudioLowerVolume 0x1008FF11 -#define XF86XK_AudioMute 0x1008FF12 -#define XF86XK_AudioRaiseVolume 0x1008FF13 -#define XF86XK_AudioPlay 0x1008FF14 -#define XF86XK_AudioStop 0x1008FF15 -#define XF86XK_AudioPrev 0x1008FF16 -#define XF86XK_AudioNext 0x1008FF17 -#define XF86XK_HomePage 0x1008FF18 -#define XF86XK_Calculator 0x1008FF1D -#define XF86XK_Mail 0x1008FF19 -#define XF86XK_Start 0x1008FF1A -#define XF86XK_Search 0x1008FF1B -#define XF86XK_AudioRecord 0x1008FF1C -#define XF86XK_Back 0x1008FF26 -#define XF86XK_Forward 0x1008FF27 -#define XF86XK_Stop 0x1008FF28 -#define XF86XK_Refresh 0x1008FF29 -#define XF86XK_Favorites 0x1008FF30 -#define XF86XK_AudioPause 0x1008FF31 -#define XF86XK_AudioMedia 0x1008FF32 -#define XF86XK_MyComputer 0x1008FF33 -#define XF86XK_OpenURL 0x1008FF38 -#define XF86XK_Launch0 0x1008FF40 -#define XF86XK_Launch1 0x1008FF41 -#define XF86XK_Launch2 0x1008FF42 -#define XF86XK_Launch3 0x1008FF43 -#define XF86XK_Launch4 0x1008FF44 -#define XF86XK_Launch5 0x1008FF45 -#define XF86XK_Launch6 0x1008FF46 -#define XF86XK_Launch7 0x1008FF47 -#define XF86XK_Launch8 0x1008FF48 -#define XF86XK_Launch9 0x1008FF49 -#define XF86XK_LaunchA 0x1008FF4A -#define XF86XK_LaunchB 0x1008FF4B -#define XF86XK_LaunchC 0x1008FF4C -#define XF86XK_LaunchD 0x1008FF4D -#define XF86XK_LaunchE 0x1008FF4E -#define XF86XK_LaunchF 0x1008FF4F -#define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */ -#define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */ -#define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */ -#define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */ -#define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */ -// end of XF86keysyms.h - - - -static const KeySym KeyTbl[] = { // keyboard mapping table - XK_Escape, TQt::Key_Escape, // misc keys - XK_Tab, TQt::Key_Tab, - XK_ISO_Left_Tab, TQt::Key_Backtab, - XK_BackSpace, TQt::Key_Backspace, - XK_Return, TQt::Key_Return, - XK_Insert, TQt::Key_Insert, - XK_KP_Insert, TQt::Key_Insert, - XK_Delete, TQt::Key_Delete, - XK_KP_Delete, TQt::Key_Delete, - XK_Clear, TQt::Key_Delete, - XK_Pause, TQt::Key_Pause, - XK_Print, TQt::Key_Print, - XK_KP_Begin, TQt::Key_Clear, - 0x1005FF60, TQt::Key_SysReq, // hardcoded Sun SysReq - 0x1007ff00, TQt::Key_SysReq, // hardcoded X386 SysReq - XK_Home, TQt::Key_Home, // cursor movement - XK_End, TQt::Key_End, - XK_Left, TQt::Key_Left, - XK_Up, TQt::Key_Up, - XK_Right, TQt::Key_Right, - XK_Down, TQt::Key_Down, - XK_Prior, TQt::Key_Prior, - XK_Next, TQt::Key_Next, - XK_KP_Home, TQt::Key_Home, - XK_KP_End, TQt::Key_End, - XK_KP_Left, TQt::Key_Left, - XK_KP_Up, TQt::Key_Up, - XK_KP_Right, TQt::Key_Right, - XK_KP_Down, TQt::Key_Down, - XK_KP_Prior, TQt::Key_Prior, - XK_KP_Next, TQt::Key_Next, - XK_Shift_L, TQt::Key_Shift, // modifiers - XK_Shift_R, TQt::Key_Shift, - XK_Shift_Lock, TQt::Key_Shift, - XK_Control_L, TQt::Key_Control, - XK_Control_R, TQt::Key_Control, - XK_Meta_L, TQt::Key_Meta, - XK_Meta_R, TQt::Key_Meta, - XK_Alt_L, TQt::Key_Alt, - XK_Alt_R, TQt::Key_Alt, - XK_Caps_Lock, TQt::Key_CapsLock, - XK_Num_Lock, TQt::Key_NumLock, - XK_Scroll_Lock, TQt::Key_ScrollLock, - XK_KP_Space, TQt::Key_Space, // numeric keypad - XK_KP_Tab, TQt::Key_Tab, - XK_KP_Enter, TQt::Key_Enter, - XK_KP_Equal, TQt::Key_Equal, - XK_KP_Multiply, TQt::Key_Asterisk, - XK_KP_Add, TQt::Key_Plus, - XK_KP_Separator, TQt::Key_Comma, - XK_KP_Subtract, TQt::Key_Minus, - XK_KP_Decimal, TQt::Key_Period, - XK_KP_Divide, TQt::Key_Slash, - XK_Super_L, TQt::Key_Super_L, - XK_Super_R, TQt::Key_Super_R, - XK_Menu, TQt::Key_Menu, - XK_Hyper_L, TQt::Key_Hyper_L, - XK_Hyper_R, TQt::Key_Hyper_R, - XK_Help, TQt::Key_Help, - 0x1000FF74, TQt::Key_BackTab, // hardcoded HP backtab - 0x1005FF10, TQt::Key_F11, // hardcoded Sun F36 (labeled F11) - 0x1005FF11, TQt::Key_F12, // hardcoded Sun F37 (labeled F12) - - // International input method support keys - - // International & multi-key character composition - XK_Multi_key, TQt::Key_Multi_key, - XK_Codeinput, TQt::Key_Codeinput, - XK_SingleCandidate, TQt::Key_SingleCandidate, - XK_MultipleCandidate, TQt::Key_MultipleCandidate, - XK_PreviousCandidate, TQt::Key_PreviousCandidate, - - // Misc Functions - XK_Mode_switch, TQt::Key_Mode_switch, - //XK_script_switch, TQt::Key_script_switch, - XK_script_switch, TQt::Key_Mode_switch, - - // Japanese keyboard support - XK_Kanji, TQt::Key_Kanji, - XK_Muhenkan, TQt::Key_Muhenkan, - //XK_Henkan_Mode, TQt::Key_Henkan_Mode, - XK_Henkan_Mode, TQt::Key_Henkan, - XK_Henkan, TQt::Key_Henkan, - XK_Romaji, TQt::Key_Romaji, - XK_Hiragana, TQt::Key_Hiragana, - XK_Katakana, TQt::Key_Katakana, - XK_Hiragana_Katakana, TQt::Key_Hiragana_Katakana, - XK_Zenkaku, TQt::Key_Zenkaku, - XK_Hankaku, TQt::Key_Hankaku, - XK_Zenkaku_Hankaku, TQt::Key_Zenkaku_Hankaku, - XK_Touroku, TQt::Key_Touroku, - XK_Massyo, TQt::Key_Massyo, - XK_Kana_Lock, TQt::Key_Kana_Lock, - XK_Kana_Shift, TQt::Key_Kana_Shift, - XK_Eisu_Shift, TQt::Key_Eisu_Shift, - XK_Eisu_toggle, TQt::Key_Eisu_toggle, - //XK_Kanji_Bangou, TQt::Key_Kanji_Bangou, - //XK_Zen_Koho, TQt::Key_Zen_Koho, - //XK_Mae_Koho, TQt::Key_Mae_Koho, - XK_Kanji_Bangou, TQt::Key_Codeinput, - XK_Zen_Koho, TQt::Key_MultipleCandidate, - XK_Mae_Koho, TQt::Key_PreviousCandidate, - -#ifdef XK_KOREAN - // Korean keyboard support - XK_Hangul, TQt::Key_Hangul, - XK_Hangul_Start, TQt::Key_Hangul_Start, - XK_Hangul_End, TQt::Key_Hangul_End, - XK_Hangul_Hanja, TQt::Key_Hangul_Hanja, - XK_Hangul_Jamo, TQt::Key_Hangul_Jamo, - XK_Hangul_Romaja, TQt::Key_Hangul_Romaja, - //XK_Hangul_Codeinput, TQt::Key_Hangul_Codeinput, - XK_Hangul_Codeinput, TQt::Key_Codeinput, - XK_Hangul_Jeonja, TQt::Key_Hangul_Jeonja, - XK_Hangul_Banja, TQt::Key_Hangul_Banja, - XK_Hangul_PreHanja, TQt::Key_Hangul_PreHanja, - XK_Hangul_PostHanja, TQt::Key_Hangul_PostHanja, - //XK_Hangul_SingleCandidate, TQt::Key_Hangul_SingleCandidate, - //XK_Hangul_MultipleCandidate, TQt::Key_Hangul_MultipleCandidate, - //XK_Hangul_PreviousCandidate, TQt::Key_Hangul_PreviousCandidate, - XK_Hangul_SingleCandidate, TQt::Key_SingleCandidate, - XK_Hangul_MultipleCandidate, TQt::Key_MultipleCandidate, - XK_Hangul_PreviousCandidate, TQt::Key_PreviousCandidate, - XK_Hangul_Special, TQt::Key_Hangul_Special, - //XK_Hangul_switch, TQt::Key_Hangul_switch, - XK_Hangul_switch, TQt::Key_Mode_switch, -#endif // XK_KOREAN - - // dead keys - XK_dead_grave, TQt::Key_Dead_Grave, - XK_dead_acute, TQt::Key_Dead_Acute, - XK_dead_circumflex, TQt::Key_Dead_Circumflex, - XK_dead_tilde, TQt::Key_Dead_Tilde, - XK_dead_macron, TQt::Key_Dead_Macron, - XK_dead_breve, TQt::Key_Dead_Breve, - XK_dead_abovedot, TQt::Key_Dead_Abovedot, - XK_dead_diaeresis, TQt::Key_Dead_Diaeresis, - XK_dead_abovering, TQt::Key_Dead_Abovering, - XK_dead_doubleacute, TQt::Key_Dead_Doubleacute, - XK_dead_caron, TQt::Key_Dead_Caron, - XK_dead_cedilla, TQt::Key_Dead_Cedilla, - XK_dead_ogonek, TQt::Key_Dead_Ogonek, - XK_dead_iota, TQt::Key_Dead_Iota, - XK_dead_voiced_sound, TQt::Key_Dead_Voiced_Sound, - XK_dead_semivoiced_sound, TQt::Key_Dead_Semivoiced_Sound, - XK_dead_belowdot, TQt::Key_Dead_Belowdot, - XK_dead_hook, TQt::Key_Dead_Hook, - XK_dead_horn, TQt::Key_Dead_Horn, - - // Special multimedia keys - // currently only tested with MS internet keyboard - - // browsing keys - XF86XK_Back, TQt::Key_Back, - XF86XK_Forward, TQt::Key_Forward, - XF86XK_Stop, TQt::Key_Stop, - XF86XK_Refresh, TQt::Key_Refresh, - XF86XK_Favorites, TQt::Key_Favorites, - XF86XK_AudioMedia, TQt::Key_LaunchMedia, - XF86XK_OpenURL, TQt::Key_OpenUrl, - XF86XK_HomePage, TQt::Key_HomePage, - XF86XK_Search, TQt::Key_Search, - - // media keys - XF86XK_AudioLowerVolume, TQt::Key_VolumeDown, - XF86XK_AudioMute, TQt::Key_VolumeMute, - XF86XK_AudioRaiseVolume, TQt::Key_VolumeUp, - XF86XK_AudioPlay, TQt::Key_MediaPlay, - XF86XK_AudioStop, TQt::Key_MediaStop, - XF86XK_AudioPrev, TQt::Key_MediaPrev, - XF86XK_AudioNext, TQt::Key_MediaNext, - XF86XK_AudioRecord, TQt::Key_MediaRecord, - - // launch keys - XF86XK_Mail, TQt::Key_LaunchMail, - XF86XK_MyComputer, TQt::Key_Launch0, - XF86XK_Calculator, TQt::Key_Launch1, - XF86XK_Standby, TQt::Key_Standby, - - XF86XK_Launch0, TQt::Key_Launch2, - XF86XK_Launch1, TQt::Key_Launch3, - XF86XK_Launch2, TQt::Key_Launch4, - XF86XK_Launch3, TQt::Key_Launch5, - XF86XK_Launch4, TQt::Key_Launch6, - XF86XK_Launch5, TQt::Key_Launch7, - XF86XK_Launch6, TQt::Key_Launch8, - XF86XK_Launch7, TQt::Key_Launch9, - XF86XK_Launch8, TQt::Key_LaunchA, - XF86XK_Launch9, TQt::Key_LaunchB, - XF86XK_LaunchA, TQt::Key_LaunchC, - XF86XK_LaunchB, TQt::Key_LaunchD, - XF86XK_LaunchC, TQt::Key_LaunchE, - XF86XK_LaunchD, TQt::Key_LaunchF, - XF86XK_MonBrightnessUp, TQt::Key_MonBrightnessUp, - XF86XK_MonBrightnessDown, TQt::Key_MonBrightnessDown, - XF86XK_KbdLightOnOff, TQt::Key_KeyboardLightOnOff, - XF86XK_KbdBrightnessUp, TQt::Key_KeyboardBrightnessUp, - XF86XK_KbdBrightnessDown, TQt::Key_KeyboardBrightnessDown, - - 0, 0 -}; - - -static TQIntDict *keyDict = 0; -static TQIntDict *textDict = 0; - -static void deleteKeyDicts() -{ - if ( keyDict ) - delete keyDict; - keyDict = 0; - if ( textDict ) - delete textDict; - textDict = 0; -} - -#if !defined(TQT_NO_XIM) -static const unsigned short katakanaKeysymsToUnicode[] = { - 0x0000, 0x3002, 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1, - 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3, - 0x30FC, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, - 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, - 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, - 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, - 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, - 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x309B, 0x309C -}; - -static const unsigned short cyrillicKeysymsToUnicode[] = { - 0x0000, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x0000, 0x045e, 0x045f, - 0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x0000, 0x040e, 0x040f, - 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, - 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, - 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, - 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a -}; - -static const unsigned short greekKeysymsToUnicode[] = { - 0x0000, 0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c, - 0x038e, 0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015, - 0x0000, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc, - 0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, - 0x03a0, 0x03a1, 0x03a3, 0x0000, 0x03a4, 0x03a5, 0x03a6, 0x03a7, - 0x03a8, 0x03a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, - 0x03c0, 0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7, - 0x03c8, 0x03c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static const unsigned short technicalKeysymsToUnicode[] = { - 0x0000, 0x23B7, 0x250C, 0x2500, 0x2320, 0x2321, 0x2502, 0x23A1, - 0x23A3, 0x23A4, 0x23A6, 0x239B, 0x239D, 0x239E, 0x23A0, 0x23A8, - 0x23AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222B, - 0x2234, 0x221D, 0x221E, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000, - 0x223C, 0x2243, 0x0000, 0x0000, 0x0000, 0x21D4, 0x21D2, 0x2261, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x0000, - 0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222A, 0x2227, 0x2228, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000, - 0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193, 0x0000 -}; - -static const unsigned short specialKeysymsToUnicode[] = { - 0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x0000, 0x0000, - 0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA, - 0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C, - 0x2502, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static const unsigned short publishingKeysymsToUnicode[] = { - 0x0000, 0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009, - 0x200a, 0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025, - 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a, - 0x2105, 0x0000, 0x0000, 0x2012, 0x2329, 0x0000, 0x232a, 0x0000, - 0x0000, 0x0000, 0x0000, 0x215b, 0x215c, 0x215d, 0x215e, 0x0000, - 0x0000, 0x2122, 0x2613, 0x0000, 0x25c1, 0x25b7, 0x25cb, 0x25af, - 0x2018, 0x2019, 0x201c, 0x201d, 0x211e, 0x0000, 0x2032, 0x2033, - 0x0000, 0x271d, 0x0000, 0x25ac, 0x25c0, 0x25b6, 0x25cf, 0x25ae, - 0x25e6, 0x25ab, 0x25ad, 0x25b3, 0x25bd, 0x2606, 0x2022, 0x25aa, - 0x25b2, 0x25bc, 0x261c, 0x261e, 0x2663, 0x2666, 0x2665, 0x0000, - 0x2720, 0x2020, 0x2021, 0x2713, 0x2717, 0x266f, 0x266d, 0x2642, - 0x2640, 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e, 0x0000 -}; - -static const unsigned short aplKeysymsToUnicode[] = { - 0x0000, 0x0000, 0x0000, 0x003c, 0x0000, 0x0000, 0x003e, 0x0000, - 0x2228, 0x2227, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x00af, 0x0000, 0x22a5, 0x2229, 0x230a, 0x0000, 0x005f, 0x0000, - 0x0000, 0x0000, 0x2218, 0x0000, 0x2395, 0x0000, 0x22a4, 0x25cb, - 0x0000, 0x0000, 0x0000, 0x2308, 0x0000, 0x0000, 0x222a, 0x0000, - 0x2283, 0x0000, 0x2282, 0x0000, 0x22a2, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x22a3, 0x0000, 0x0000, 0x0000 -}; - -static const unsigned short koreanKeysymsToUnicode[] = { - 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, - 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, - 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, - 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f, - 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, - 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f, - 0x3160, 0x3161, 0x3162, 0x3163, 0x11a8, 0x11a9, 0x11aa, 0x11ab, - 0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3, - 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb, - 0x11bc, 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x316d, - 0x3171, 0x3178, 0x317f, 0x3181, 0x3184, 0x3186, 0x318d, 0x318e, - 0x11eb, 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9 -}; - - -static TQChar keysymToUnicode(unsigned char byte3, unsigned char byte4) -{ - if ( byte3 == 0x04 ) { - // katakana - if ( byte4 > 0xa0 && byte4 < 0xe0 ) - return TQChar( katakanaKeysymsToUnicode[byte4 - 0xa0] ); - else if ( byte4 == 0x7e ) - return TQChar( 0x203e ); // Overline - } else if ( byte3 == 0x06 ) { - // russian, use lookup table - if ( byte4 > 0xa0 ) - return TQChar( cyrillicKeysymsToUnicode[byte4 - 0xa0] ); - } else if ( byte3 == 0x07 ) { - // greek - if ( byte4 > 0xa0 ) - return TQChar( greekKeysymsToUnicode[byte4 - 0xa0] ); - } else if ( byte3 == 0x08 ) { - // technical - if ( byte4 > 0xa0 ) - return TQChar( technicalKeysymsToUnicode[byte4 - 0xa0] ); - } else if ( byte3 == 0x09 ) { - // special - if ( byte4 >= 0xe0 ) - return TQChar( specialKeysymsToUnicode[byte4 - 0xe0] ); - } else if ( byte3 == 0x0a ) { - // publishing - if ( byte4 > 0xa0 ) - return TQChar( publishingKeysymsToUnicode[byte4 - 0xa0] ); - } else if ( byte3 == 0x0b ) { - // APL - if ( byte4 > 0xa0 ) - return TQChar( aplKeysymsToUnicode[byte4 - 0xa0] ); - } else if ( byte3 == 0x0e ) { - // Korean - if ( byte4 > 0xa0 ) - return TQChar( koreanKeysymsToUnicode[byte4 - 0xa0] ); - } - return TQChar(0x0); -} -#endif - - -bool TQETWidget::translateKeyEventInternal( const XEvent *event, int& count, - TQString& text, - int& state, - char& ascii, int& code, TQEvent::Type &type, bool willRepeat, bool statefulTranslation ) -{ - TQTextCodec *mapper = qt_input_mapper; - // some XmbLookupString implementations don't return buffer overflow correctly, - // so we increase the input buffer to allow for long strings... - // 256 chars * 2 bytes + 1 null-term == 513 bytes - TQCString chars(513); - TQChar converted; - KeySym key = 0; - - if ( !keyDict ) { - keyDict = new TQIntDict( 13 ); - keyDict->setAutoDelete( FALSE ); - textDict = new TQIntDict( 13 ); - textDict->setAutoDelete( FALSE ); - tqAddPostRoutine( deleteKeyDicts ); - } - - XKeyEvent xkeyevent = event->xkey; - - // save the modifier state, we will use the keystate uint later by passing - // it to qt_x11_translateButtonState - uint keystate = event->xkey.state; - // remove the modifiers where mode_switch exists... HPUX machines seem - // to have alt *AND* mode_switch both in Mod1Mask, which causes - // XLookupString to return things like '�' (aring) for ALT-A. This - // completely breaks modifiers. If we remove the modifier for Mode_switch, - // then things work correctly... - xkeyevent.state &= ~qt_mode_switch_remove_mask; - - type = (event->type == XKeyPress) - ? TQEvent::KeyPress : TQEvent::KeyRelease; -#if defined(TQT_NO_XIM) - - count = XLookupString( &xkeyevent, chars.data(), chars.size(), &key, 0 ); - - if ( count == 1 ) - ascii = chars[0]; - -#else - // Implementation for X11R5 and newer, using XIM - - int keycode = event->xkey.keycode; - - if ( type == TQEvent::KeyPress ) { - bool mb=FALSE; - // commit string handling is done by - // TQXIMInputContext::x11FilterEvent() and are passed to - // widgets via TQIMEvent regardless of XIM style, so the - // following code is commented out. -#if 0 - if ( qt_xim ) { - TQTLWExtra* xd = tlw->topData(); - TQInputContext *qic = (TQInputContext *) xd->xic; - if ( qic ) { - mb=TRUE; - count = qic->lookupString(&xkeyevent, chars, &key, &status); - } - } -#endif - if ( !mb ) { - count = XLookupString( &xkeyevent, - chars.data(), chars.size(), &key, 0 ); - } - if ( count && !keycode ) { - keycode = qt_ximComposingKeycode; - qt_ximComposingKeycode = 0; - } - if ( key ) - keyDict->replace( keycode, (void*)key ); - // all keysyms smaller than that are actally keys that can be mapped - // to unicode chars - if ( count == 0 && key < 0xff00 ) { - unsigned char byte3 = (unsigned char )(key >> 8); - int mib = -1; - switch( byte3 ) { - case 0: // Latin 1 - case 1: // Latin 2 - case 2: //latin 3 - case 3: // latin4 - mib = byte3 + 4; break; - case 5: // arabic - mib = 82; break; - case 12: // Hebrew - mib = 85; break; - case 13: // Thai - mib = 2259; break; - case 4: // kana - case 6: // cyrillic - case 7: // greek - case 8: // technical, no mapping here at the moment - case 9: // Special - case 10: // Publishing - case 11: // APL - case 14: // Korean, no mapping - mib = -1; // manual conversion - mapper = 0; - converted = keysymToUnicode( byte3, key & 0xff ); - case 0x20: - // currency symbols - if ( key >= 0x20a0 && key <= 0x20ac ) { - mib = -1; // manual conversion - mapper = 0; - converted = (uint)key; - } - break; - default: - break; - } - if ( mib != -1 ) { - mapper = TQTextCodec::codecForMib( mib ); - chars[0] = (unsigned char) (key & 0xff); // get only the fourth bit for conversion later - count++; - } - } else if ( key >= 0x1000000 && key <= 0x100ffff ) { - converted = (ushort) (key - 0x1000000); - mapper = 0; - } - if ( count < (int)chars.size()-1 ) - chars[count] = '\0'; - if ( count == 1 ) { - ascii = chars[0]; - // +256 so we can store all eight-bit codes, including ascii 0, - // and independent of whether char is signed or not. - textDict->replace( keycode, (void*)(long)(256+ascii) ); - } - } else { - key = (int)(long)keyDict->find( keycode ); - if ( key ) - if( !willRepeat && statefulTranslation ) // Take out key of dictionary only if this call. - keyDict->take( keycode ); - long s = (long)textDict->find( keycode ); - if ( s ) { - if( statefulTranslation ) - textDict->take( keycode ); - ascii = (char)(s-256); - } - } -#endif // !TQT_NO_XIM - - state = qt_x11_translateButtonState( keystate ); - - static int directionKeyEvent = 0; - static unsigned int lastWinId = 0; - if ( qt_use_rtl_extensions && type == TQEvent::KeyRelease && statefulTranslation ) { - if (directionKeyEvent == Key_Direction_R || directionKeyEvent == Key_Direction_L ) { - type = TQEvent::KeyPress; - code = directionKeyEvent; - chars[0] = 0; - directionKeyEvent = 0; - lastWinId = 0; - return TRUE; - } else { - directionKeyEvent = 0; - lastWinId = 0; - } - } - - // Watch for keypresses and if its a key belonging to the Ctrl-Shift - // direction-changing accel, remember it. - // We keep track of those keys instead of using the event's state - // (to figure out whether the Ctrl modifier is held while Shift is pressed, - // or Shift is held while Ctrl is pressed) since the 'state' doesn't tell - // us whether the modifier held is Left or Right. - if ( qt_use_rtl_extensions && type == TQEvent::KeyPress && statefulTranslation ) { - if (key == XK_Control_L || key == XK_Control_R || key == XK_Shift_L || key == XK_Shift_R) { - if (!directionKeyEvent) { - directionKeyEvent = key; - // This code exists in order to check that - // the event is occurred in the same widget. - lastWinId = winId(); - } - } else { - // this can no longer be a direction-changing accel. - // if any other key was pressed. - directionKeyEvent = Key_Space; - } - } - - // Commentary in X11/keysymdef says that X codes match ASCII, so it - // is safe to use the locale functions to process X codes in ISO8859-1. - // - // This is mainly for compatibility - applications should not use the - // TQt keycodes between 128 and 255, but should rather use the - // TQKeyEvent::text(). - // - if ( key < 128 || (key < 256 && (!qt_input_mapper || qt_input_mapper->mibEnum()==4)) ) { - code = isprint((int)key) ? toupper((int)key) : 0; // upper-case key, if known - } else if ( key >= XK_F1 && key <= XK_F35 ) { - code = Key_F1 + ((int)key - XK_F1); // function keys - } else if ( key >= XK_KP_0 && key <= XK_KP_9) { - code = Key_0 + ((int)key - XK_KP_0); // numeric keypad keys - state |= Keypad; - } else { - int i = 0; // any other keys - while ( KeyTbl[i] ) { - if ( key == KeyTbl[i] ) { - code = (int)KeyTbl[i+1]; - break; - } - i += 2; - } - switch ( key ) { - case XK_KP_Insert: - case XK_KP_Delete: - case XK_KP_Home: - case XK_KP_End: - case XK_KP_Left: - case XK_KP_Up: - case XK_KP_Right: - case XK_KP_Down: - case XK_KP_Prior: - case XK_KP_Next: - case XK_KP_Space: - case XK_KP_Tab: - case XK_KP_Enter: - case XK_KP_Equal: - case XK_KP_Multiply: - case XK_KP_Add: - case XK_KP_Separator: - case XK_KP_Subtract: - case XK_KP_Decimal: - case XK_KP_Divide: - state |= Keypad; - break; - default: - break; - } - - if ( code == Key_Tab && - (state & ShiftButton) == ShiftButton ) { - // map shift+tab to shift+backtab, TQAccel knows about it - // and will handle it. - code = Key_Backtab; - chars[0] = 0; - } - - if ( qt_use_rtl_extensions && type == TQEvent::KeyPress && statefulTranslation ) { - if ( directionKeyEvent && lastWinId == winId() ) { - if ( ( key == XK_Shift_L && directionKeyEvent == XK_Control_L ) || - ( key == XK_Control_L && directionKeyEvent == XK_Shift_L ) ) { - directionKeyEvent = Key_Direction_L; - } else if ( ( key == XK_Shift_R && directionKeyEvent == XK_Control_R ) || - ( key == XK_Control_R && directionKeyEvent == XK_Shift_R ) ) { - directionKeyEvent = Key_Direction_R; - } - } - else if ( directionKeyEvent == Key_Direction_L || directionKeyEvent == Key_Direction_R ) { - directionKeyEvent = Key_Space; // invalid - } - } - } - -#if 0 -#ifndef Q_EE - static int c = 0; - extern void qt_dialog_default_key(); -#define Q_EE(x) c = (c == x || (!c && x == 0x1000) )? x+1 : 0 - if ( tlw && state == '0' ) { - switch ( code ) { - case 0x4f: Q_EE(Key_Backtab); break; - case 0x52: Q_EE(Key_Tab); break; - case 0x54: Q_EE(Key_Escape); break; - case 0x4c: - if (c == Key_Return ) - qt_dialog_default_key(); - else - Q_EE(Key_Backspace); - break; - } - } -#undef Q_EE -#endif -#endif - - // convert chars (8bit) to text (unicode). - if ( mapper ) - text = mapper->toUnicode(chars,count); - else if ( !mapper && converted.unicode() != 0x0 ) - text = converted; - else - text = chars; - return TRUE; -} - - -struct qt_auto_repeat_data -{ - // match the window and keycode with timestamp delta of 10ms - Window window; - KeyCode keycode; - Time timestamp; - - // queue scanner state - bool release; - bool error; -}; - -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif - -static Bool qt_keypress_scanner(Display *, XEvent *event, XPointer arg) -{ - if (event->type != XKeyPress && event->type != XKeyRelease) - return FALSE; - - qt_auto_repeat_data *d = (qt_auto_repeat_data *) arg; - if (d->error || - event->xkey.window != d->window || - event->xkey.keycode != d->keycode) { - d->error = TRUE; - return FALSE; - } - - if (event->type == XKeyPress) { - d->error = (! d->release || event->xkey.time - d->timestamp > 10); - return (! d->error); - } - - // must be XKeyRelease event - if (d->release) { - // found a second release - d->error = TRUE; - return FALSE; - } - - // found a single release - d->release = TRUE; - d->timestamp = event->xkey.time; - - return FALSE; -} - -static Bool qt_keyrelease_scanner(Display *, XEvent *event, XPointer arg) -{ - const qt_auto_repeat_data *d = (const qt_auto_repeat_data *) arg; - return (event->type == XKeyRelease && - event->xkey.window == d->window && - event->xkey.keycode == d->keycode); -} - -#if defined(Q_C_CALLBACKS) -} -#endif - -bool TQETWidget::translateKeyEvent( const XEvent *event, bool grab ) -{ - int code = -1; - int count = 0; - int state; - char ascii = 0; - - if ( sm_blockUserInput ) // block user interaction during session management - return TRUE; - - Display *dpy = x11Display(); - - if ( !isEnabled() ) - return TRUE; - - TQEvent::Type type; - bool autor = FALSE; - TQString text; - - translateKeyEventInternal( event, count, text, state, ascii, code, type, - qt_mode_switch_remove_mask != 0 ); - - static uint curr_autorep = 0; - // was this the last auto-repeater? - qt_auto_repeat_data auto_repeat_data; - auto_repeat_data.window = event->xkey.window; - auto_repeat_data.keycode = event->xkey.keycode; - auto_repeat_data.timestamp = event->xkey.time; - - if ( event->type == XKeyPress ) { - if ( curr_autorep == event->xkey.keycode ) { - autor = TRUE; - curr_autorep = 0; - } - } else { - // look ahead for auto-repeat - XEvent nextpress; - - auto_repeat_data.release = TRUE; - auto_repeat_data.error = FALSE; - if (XCheckIfEvent(dpy, &nextpress, &qt_keypress_scanner, - (XPointer) &auto_repeat_data)) { - autor = TRUE; - - // Put it back... we COULD send the event now and not need - // the static curr_autorep variable. - XPutBackEvent(dpy,&nextpress); - } - curr_autorep = autor ? event->xkey.keycode : 0; - } - - // process accelerators before doing key compression - if ( type == TQEvent::KeyPress && !grab ) { - // send accel events if the keyboard is not grabbed - TQKeyEvent a( type, code, ascii, state, text, autor, - TQMAX( TQMAX(count,1), int(text.length())) ); - if ( tqt_tryAccelEvent( this, &a ) ) - return TRUE; - } - - long save = 0; - if ( qt_mode_switch_remove_mask != 0 ) { - save = qt_mode_switch_remove_mask; - qt_mode_switch_remove_mask = 0; - - // translate the key event again, but this time apply any Mode_switch - // modifiers - translateKeyEventInternal( event, count, text, state, ascii, code, type ); - } - -#ifndef TQT_NO_IM - TQInputContext *qic = getInputContext(); -#endif - - // compress keys - if ( !text.isEmpty() && testWState(WState_CompressKeys) && -#ifndef TQT_NO_IM - // Ordinary input methods require discrete key events to work - // properly, so key compression has to be disabled when input - // context exists. - // - // And further consideration, some complex input method - // require all key press/release events discretely even if - // the input method awares of key compression and compressed - // keys are ordinary alphabets. For example, the uim project - // is planning to implement "combinational shift" feature for - // a Japanese input method, uim-skk. It will work as follows. - // - // 1. press "r" - // 2. press "u" - // 3. release both "r" and "u" in arbitrary order - // 4. above key sequence generates "Ru" - // - // Of course further consideration about other participants - // such as key repeat mechanism is required to implement such - // feature. - ! qic && -#endif // TQT_NO_IM - // do not compress keys if the key event we just got above matches - // one of the key ranges used to compute stopCompression - ! ( ( code >= Key_Escape && code <= Key_SysReq ) || - ( code >= Key_Home && code <= Key_Next ) || - ( code >= Key_Super_L && code <= Key_Direction_R ) || - ( ( code == 0 ) && ( ascii == '\n' ) ) ) ) { - // the widget wants key compression so it gets it - int codeIntern = -1; - int countIntern = 0; - int stateIntern; - char asciiIntern = 0; - XEvent evRelease; - XEvent evPress; - - // sync the event queue, this makes key compress work better - XSync( dpy, FALSE ); - - for (;;) { - TQString textIntern; - if ( !XCheckTypedWindowEvent(dpy,event->xkey.window, - XKeyRelease,&evRelease) ) - break; - if ( !XCheckTypedWindowEvent(dpy,event->xkey.window, - XKeyPress,&evPress) ) { - XPutBackEvent(dpy, &evRelease); - break; - } - TQEvent::Type t; - translateKeyEventInternal( &evPress, countIntern, textIntern, - stateIntern, asciiIntern, codeIntern, t ); - // use stopCompression to stop key compression for the following - // key event ranges: - bool stopCompression = - // 1) misc keys - ( codeIntern >= Key_Escape && codeIntern <= Key_SysReq ) || - // 2) cursor movement - ( codeIntern >= Key_Home && codeIntern <= Key_Next ) || - // 3) extra keys - ( codeIntern >= Key_Super_L && codeIntern <= Key_Direction_R ) || - // 4) something that a) doesn't translate to text or b) translates - // to newline text - ((codeIntern == 0) && (asciiIntern == '\n')); - if (stateIntern == state && !textIntern.isEmpty() && !stopCompression) { - text += textIntern; - count += countIntern; - } else { - XPutBackEvent(dpy, &evPress); - XPutBackEvent(dpy, &evRelease); - break; - } - } - } - - if ( save != 0 ) - qt_mode_switch_remove_mask = save; - - // autorepeat compression makes sense for all widgets (Windows - // does it automatically .... ) - if ( event->type == XKeyPress && text.length() <= 1 -#ifndef TQT_NO_IM - // input methods need discrete key events - && ! qic -#endif// TQT_NO_IM - ) { - XEvent dummy; - - for (;;) { - auto_repeat_data.release = FALSE; - auto_repeat_data.error = FALSE; - if (! XCheckIfEvent(dpy, &dummy, &qt_keypress_scanner, - (XPointer) &auto_repeat_data)) - break; - if (! XCheckIfEvent(dpy, &dummy, &qt_keyrelease_scanner, - (XPointer) &auto_repeat_data)) - break; - - count++; - if (!text.isEmpty()) - text += text[0]; - } - } - - if (code == 0 && ascii == '\n') { - code = Key_Return; - ascii = '\r'; - text = "\r"; - } - - // try the menukey first - if ( type == TQEvent::KeyPress && code == TQt::Key_Menu ) { - TQContextMenuEvent e( TQContextMenuEvent::Keyboard, TQPoint( 5, 5 ), mapToGlobal( TQPoint( 5, 5 ) ), 0 ); - TQApplication::sendSpontaneousEvent( this, &e ); - if( e.isAccepted() ) - return TRUE; - } - - TQKeyEvent e( type, code, ascii, state, text, autor, - TQMAX(TQMAX(count,1), int(text.length())) ); - return TQApplication::sendSpontaneousEvent( this, &e ); -} - - -// -// Paint event translation -// -// When receiving many expose events, we compress them (union of all expose -// rectangles) into one event which is sent to the widget. - -struct PaintEventInfo { - Window window; -}; - -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif - -static Bool isPaintOrScrollDoneEvent( Display *, XEvent *ev, XPointer a ) -{ - PaintEventInfo *info = (PaintEventInfo *)a; - if ( ev->type == Expose || ev->type == GraphicsExpose - || ( ev->type == ClientMessage - && ev->xclient.message_type == qt_qt_scrolldone ) ) - { - if ( ev->xexpose.window == info->window ) - return True; - } - return False; -} - -#if defined(Q_C_CALLBACKS) -} -#endif - - -// declared above: static TQPtrList *sip_list = 0; - -void qt_insert_sip( TQWidget* scrolled_widget, int dx, int dy ) -{ - if ( !sip_list ) { - sip_list = new TQPtrList; - sip_list->setAutoDelete( TRUE ); - } - - TQScrollInProgress* sip = new TQScrollInProgress( scrolled_widget, dx, dy ); - sip_list->append( sip ); - - XClientMessageEvent client_message = {}; - client_message.type = ClientMessage; - client_message.window = scrolled_widget->winId(); - client_message.format = 32; - client_message.message_type = qt_qt_scrolldone; - client_message.data.l[0] = sip->id; - - XSendEvent( appDpy, scrolled_widget->winId(), False, NoEventMask, - (XEvent*)&client_message ); -} - -int qt_sip_count( TQWidget* scrolled_widget ) -{ - if ( !sip_list ) - return 0; - - int sips=0; - - for (TQScrollInProgress* sip = sip_list->first(); - sip; sip=sip_list->next()) - { - if ( sip->scrolled_widget == scrolled_widget ) - sips++; - } - - return sips; -} - -static -bool translateBySips( TQWidget* that, TQRect& paintRect ) -{ - if ( sip_list ) { - int dx=0, dy=0; - int sips=0; - for (TQScrollInProgress* sip = sip_list->first(); - sip; sip=sip_list->next()) - { - if ( sip->scrolled_widget == that ) { - if ( sips ) { - dx += sip->dx; - dy += sip->dy; - } - sips++; - } - } - if ( sips > 1 ) { - paintRect.moveBy( dx, dy ); - return TRUE; - } - } - return FALSE; -} - -bool TQETWidget::translatePaintEvent( const XEvent *event ) -{ - setWState( WState_Exposed ); - TQRect paintRect( event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height ); - bool merging_okay = !testWFlags(WPaintClever); - XEvent xevent; - PaintEventInfo info; - info.window = winId(); - bool should_clip = translateBySips( this, paintRect ); - - TQRegion paintRegion( paintRect ); - - if ( merging_okay ) { - // WARNING: this is O(number_of_events * number_of_matching_events) - while ( XCheckIfEvent(x11Display(),&xevent,isPaintOrScrollDoneEvent, - (XPointer)&info) && - !qt_x11EventFilter(&xevent) && - !x11Event( &xevent ) ) // send event through filter - { - if ( xevent.type == Expose || xevent.type == GraphicsExpose ) { - TQRect exposure(xevent.xexpose.x, - xevent.xexpose.y, - xevent.xexpose.width, - xevent.xexpose.height); - if ( translateBySips( this, exposure ) ) - should_clip = TRUE; - paintRegion = paintRegion.unite( exposure ); - } else { - translateScrollDoneEvent( &xevent ); - } - } - } - - if ( should_clip ) { - paintRegion = paintRegion.intersect( rect() ); - if ( paintRegion.isEmpty() ) - return TRUE; - } - - TQPaintEvent e( paintRegion ); - setWState( WState_InPaintEvent ); - if ( !isTopLevel() && backgroundOrigin() != WidgetOrigin ) - erase( paintRegion ); - qt_set_paintevent_clipping( this, paintRegion ); - TQApplication::sendSpontaneousEvent( this, &e ); - qt_clear_paintevent_clipping(); - clearWState( WState_InPaintEvent ); - return TRUE; -} - -// -// Scroll-done event translation. -// - -bool TQETWidget::translateScrollDoneEvent( const XEvent *event ) -{ - if ( !sip_list ) return FALSE; - - long id = event->xclient.data.l[0]; - - // Remove any scroll-in-progress record for the given id. - for (TQScrollInProgress* sip = sip_list->first(); sip; sip=sip_list->next()) { - if ( sip->id == id ) { - sip_list->remove( sip_list->current() ); - return TRUE; - } - } - - return FALSE; -} - -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif -#ifndef TQT_NO_XSYNC -static Bool qt_net_wm_sync_request_scanner(Display*, XEvent* event, XPointer arg) -{ - return (event->type == ClientMessage && event->xclient.window == *(Window*)arg - && event->xclient.message_type == tqt_wm_protocols - && ((unsigned int)event->xclient.data.l[ 0 ]) == qt_net_wm_sync_request ); -} -#endif - -#if defined(Q_C_CALLBACKS) -} -#endif - -// -// ConfigureNotify (window move and resize) event translation - -bool TQETWidget::translateConfigEvent( const XEvent *event ) -{ - // config pending is only set on resize, see tqwidget_x11.cpp, internalSetGeometry() - bool was_resize = testWState( WState_ConfigPending ); - - clearWState(WState_ConfigPending); - - if ( isTopLevel() ) { - TQPoint newCPos( geometry().topLeft() ); - TQSize newSize( event->xconfigure.width, event->xconfigure.height ); - - bool trust = (topData()->parentWinId == None || - topData()->parentWinId == TQPaintDevice::x11AppRootWindow()); - - if (event->xconfigure.send_event || trust ) { - // if a ConfigureNotify comes from a real sendevent request, we can - // trust its values. - newCPos.rx() = event->xconfigure.x + event->xconfigure.border_width; - newCPos.ry() = event->xconfigure.y + event->xconfigure.border_width; - } - - if ( isVisible() ) - TQApplication::syncX(); - - if (! extra || extra->compress_events) { - // ConfigureNotify compression for faster opaque resizing - XEvent otherEvent; - int compressed_configs = 0; - while ( XCheckTypedWindowEvent( x11Display(), winId(), ConfigureNotify, - &otherEvent ) ) { - if ( qt_x11EventFilter( &otherEvent ) ) - continue; - - if (x11Event( &otherEvent ) ) - continue; - - if ( otherEvent.xconfigure.event != otherEvent.xconfigure.window ) - continue; - - newSize.setWidth( otherEvent.xconfigure.width ); - newSize.setHeight( otherEvent.xconfigure.height ); - - if ( otherEvent.xconfigure.send_event || trust ) { - newCPos.rx() = otherEvent.xconfigure.x + - otherEvent.xconfigure.border_width; - newCPos.ry() = otherEvent.xconfigure.y + - otherEvent.xconfigure.border_width; - } - ++compressed_configs; - } -#ifndef TQT_NO_XSYNC - // _NET_WM_SYNC_REQUEST compression - Window wid = winId(); - while ( compressed_configs && - XCheckIfEvent( x11Display(), &otherEvent, - qt_net_wm_sync_request_scanner, (XPointer)&wid ) ) { - handleSyncRequest( (void*)&otherEvent ); - --compressed_configs; - } -#endif - } - - TQRect cr ( geometry() ); - if ( newSize != cr.size() ) { // size changed - was_resize = TRUE; - TQSize oldSize = size(); - cr.setSize( newSize ); - crect = cr; - - if ( isVisible() ) { - TQResizeEvent e( newSize, oldSize ); - TQApplication::sendSpontaneousEvent( this, &e ); - } else { - TQResizeEvent * e = new TQResizeEvent( newSize, oldSize ); - TQApplication::postEvent( this, e ); - } - } - - if ( newCPos != cr.topLeft() ) { // compare with cpos (exluding frame) - TQPoint oldPos = geometry().topLeft(); - cr.moveTopLeft( newCPos ); - crect = cr; - if ( isVisible() ) { - TQMoveEvent e( newCPos, oldPos ); // pos (including frame), not cpos - TQApplication::sendSpontaneousEvent( this, &e ); - } else { - TQMoveEvent * e = new TQMoveEvent( newCPos, oldPos ); - TQApplication::postEvent( this, e ); - } - } - } else { - XEvent xevent; - while ( XCheckTypedWindowEvent(x11Display(),winId(), ConfigureNotify,&xevent) && - !qt_x11EventFilter(&xevent) && - !x11Event( &xevent ) ) // send event through filter - ; - } - - bool transbg = backgroundOrigin() != WidgetOrigin; - // we ignore NorthWestGravity at the moment for reversed layout - if ( transbg || - (!testWFlags( WStaticContents ) && - testWState( WState_Exposed ) && was_resize ) || - TQApplication::reverseLayout() ) { - // remove unnecessary paint events from the queue - XEvent xevent; - while ( XCheckTypedWindowEvent( x11Display(), winId(), Expose, &xevent ) && - ! qt_x11EventFilter( &xevent ) && - ! x11Event( &xevent ) ) // send event through filter - ; - repaint( !testWFlags(WResizeNoErase) || transbg ); - } - - incrementSyncCounter(); - - return TRUE; -} - - -// -// Close window event translation. -// -bool TQETWidget::translateCloseEvent( const XEvent * ) -{ - return close(FALSE); -} - - -/*! - Sets the text cursor's flash (blink) time to \a msecs - milliseconds. The flash time is the time required to display, - invert and restore the caret display. Usually the text cursor is - displayed for \a msecs/2 milliseconds, then hidden for \a msecs/2 - milliseconds, but this may vary. - - Note that on Microsoft Windows, calling this function sets the - cursor flash time for all windows. - - \sa cursorFlashTime() -*/ -void TQApplication::setCursorFlashTime( int msecs ) -{ - cursor_flash_time = msecs; -} - - -/*! - Returns the text cursor's flash (blink) time in milliseconds. The - flash time is the time required to display, invert and restore the - caret display. - - The default value on X11 is 1000 milliseconds. On Windows, the - control panel value is used. - - Widgets should not cache this value since it may be changed at any - time by the user changing the global desktop settings. - - \sa setCursorFlashTime() -*/ -int TQApplication::cursorFlashTime() -{ - return cursor_flash_time; -} - -/*! - Sets the time limit that distinguishes a double click from two - consecutive mouse clicks to \a ms milliseconds. - - Note that on Microsoft Windows, calling this function sets the - double click interval for all windows. - - \sa doubleClickInterval() -*/ - -void TQApplication::setDoubleClickInterval( int ms ) -{ - mouse_double_click_time = ms; -} - - -/*! - Returns the maximum duration for a double click. - - The default value on X11 is 400 milliseconds. On Windows, the - control panel value is used. - - \sa setDoubleClickInterval() -*/ - -int TQApplication::doubleClickInterval() -{ - return mouse_double_click_time; -} - - -/*! - Sets the number of lines to scroll when the mouse wheel is rotated - to \a n. - - If this number exceeds the number of visible lines in a certain - widget, the widget should interpret the scroll operation as a - single page up / page down operation instead. - - \sa wheelScrollLines() -*/ -void TQApplication::setWheelScrollLines( int n ) -{ - wheel_scroll_lines = n; -} - -/*! - Returns the number of lines to scroll when the mouse wheel is - rotated. - - \sa setWheelScrollLines() -*/ -int TQApplication::wheelScrollLines() -{ - return wheel_scroll_lines; -} - -/*! - Enables the UI effect \a effect if \a enable is TRUE, otherwise - the effect will not be used. - - Note: All effects are disabled on screens running at less than - 16-bit color depth. - - \sa isEffectEnabled(), TQt::UIEffect, setDesktopSettingsAware() -*/ -void TQApplication::setEffectEnabled( TQt::UIEffect effect, bool enable ) -{ - switch (effect) { - case UI_AnimateMenu: - if ( enable ) fade_menu = FALSE; - animate_menu = enable; - break; - case UI_FadeMenu: - if ( enable ) - animate_menu = TRUE; - fade_menu = enable; - break; - case UI_AnimateCombo: - animate_combo = enable; - break; - case UI_AnimateTooltip: - if ( enable ) fade_tooltip = FALSE; - animate_tooltip = enable; - break; - case UI_FadeTooltip: - if ( enable ) - animate_tooltip = TRUE; - fade_tooltip = enable; - break; - case UI_AnimateToolBox: - animate_toolbox = enable; - break; - default: - animate_ui = enable; - break; - } -} - -/*! - Returns TRUE if \a effect is enabled; otherwise returns FALSE. - - By default, TQt will try to use the desktop settings. Call - setDesktopSettingsAware(FALSE) to prevent this. - - Note: All effects are disabled on screens running at less than - 16-bit color depth. - - \sa setEffectEnabled(), TQt::UIEffect -*/ -bool TQApplication::isEffectEnabled( TQt::UIEffect effect ) -{ - if ( TQColor::numBitPlanes() < 16 || !animate_ui ) - return FALSE; - - switch( effect ) { - case UI_AnimateMenu: - return animate_menu; - case UI_FadeMenu: - return fade_menu; - case UI_AnimateCombo: - return animate_combo; - case UI_AnimateTooltip: - return animate_tooltip; - case UI_FadeTooltip: - return fade_tooltip; - case UI_AnimateToolBox: - return animate_toolbox; - default: - return animate_ui; - } -} - -/***************************************************************************** - Session management support - *****************************************************************************/ - -#ifndef TQT_NO_SM_SUPPORT - -#include - -class TQSessionManagerData -{ -public: - TQSessionManagerData( TQSessionManager* mgr, TQString& id, TQString& key ) - : sm( mgr ), sessionId( id ), sessionKey( key ) {} - TQSessionManager* sm; - TQStringList restartCommand; - TQStringList discardCommand; - TQString& sessionId; - TQString& sessionKey; - TQSessionManager::RestartHint restartHint; -}; - -class TQSmSocketReceiver : public TQObject -{ - TQ_OBJECT -public: - TQSmSocketReceiver( int socket ) - : TQObject(0,0) - { - TQSocketNotifier* sn = new TQSocketNotifier( socket, TQSocketNotifier::Read, this ); - connect( sn, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( socketActivated(int) ) ); - } - -public slots: - void socketActivated(int); -}; - - -static SmcConn smcConnection = 0; -static bool sm_interactionActive; -static bool sm_smActive; -static int sm_interactStyle; -static int sm_saveType; -static bool sm_cancel; -// static bool sm_waitingForPhase2; ### never used?!? -static bool sm_waitingForInteraction; -static bool sm_isshutdown; -// static bool sm_shouldbefast; ### never used?!? -static bool sm_phase2; -static bool sm_in_phase2; - -static TQSmSocketReceiver* sm_receiver = 0; - -static void resetSmState(); -static void sm_setProperty( const char* name, const char* type, - int num_vals, SmPropValue* vals); -static void sm_saveYourselfCallback( SmcConn smcConn, SmPointer clientData, - int saveType, Bool shutdown , int interactStyle, Bool fast); -static void sm_saveYourselfPhase2Callback( SmcConn smcConn, SmPointer clientData ) ; -static void sm_dieCallback( SmcConn smcConn, SmPointer clientData ) ; -static void sm_shutdownCancelledCallback( SmcConn smcConn, SmPointer clientData ); -static void sm_saveCompleteCallback( SmcConn smcConn, SmPointer clientData ); -static void sm_interactCallback( SmcConn smcConn, SmPointer clientData ); -static void sm_performSaveYourself( TQSessionManagerData* ); - -static void resetSmState() -{ -// sm_waitingForPhase2 = FALSE; ### never used?!? - sm_waitingForInteraction = FALSE; - sm_interactionActive = FALSE; - sm_interactStyle = SmInteractStyleNone; - sm_smActive = FALSE; - sm_blockUserInput = FALSE; - sm_isshutdown = FALSE; -// sm_shouldbefast = FALSE; ### never used?!? - sm_phase2 = FALSE; - sm_in_phase2 = FALSE; -} - - -// theoretically it's possible to set several properties at once. For -// simplicity, however, we do just one property at a time -static void sm_setProperty( const char* name, const char* type, - int num_vals, SmPropValue* vals) -{ - if (num_vals ) { - SmProp prop; - prop.name = (char*)name; - prop.type = (char*)type; - prop.num_vals = num_vals; - prop.vals = vals; - - SmProp* props[1]; - props[0] = ∝ - SmcSetProperties( smcConnection, 1, props ); - } - else { - char* names[1]; - names[0] = (char*) name; - SmcDeleteProperties( smcConnection, 1, names ); - } -} - -static void sm_setProperty( const TQString& name, const TQString& value) -{ - SmPropValue prop; - prop.length = value.length(); - prop.value = (SmPointer) value.latin1(); - sm_setProperty( name.latin1(), SmARRAY8, 1, &prop ); -} - -static void sm_setProperty( const TQString& name, const TQStringList& value) -{ - SmPropValue *prop = new SmPropValue[ value.count() ]; - int count = 0; - for ( TQStringList::ConstIterator it = value.begin(); it != value.end(); ++it ) { - prop[ count ].length = (*it).length(); - prop[ count ].value = (char*)(*it).latin1(); - ++count; - } - sm_setProperty( name.latin1(), SmLISTofARRAY8, count, prop ); - delete [] prop; -} - - -// workaround for broken libsm, see below -struct QT_smcConn { - unsigned int save_yourself_in_progress : 1; - unsigned int shutdown_in_progress : 1; -}; - -static void sm_saveYourselfCallback( SmcConn smcConn, SmPointer clientData, - int saveType, Bool shutdown , int interactStyle, Bool /*fast*/) -{ - if (smcConn != smcConnection ) - return; - sm_cancel = FALSE; - sm_smActive = TRUE; - sm_isshutdown = shutdown; - sm_saveType = saveType; - sm_interactStyle = interactStyle; -// sm_shouldbefast = fast; ### never used?!? - - // ugly workaround for broken libSM. libSM should do that _before_ - // actually invoking the callback in sm_process.c - ( (QT_smcConn*)smcConn )->save_yourself_in_progress = TRUE; - if ( sm_isshutdown ) - ( (QT_smcConn*)smcConn )->shutdown_in_progress = TRUE; - - sm_performSaveYourself( (TQSessionManagerData*) clientData ); - if ( !sm_isshutdown ) // we cannot expect a confirmation message in that case - resetSmState(); -} - -static void sm_performSaveYourself( TQSessionManagerData* smd ) -{ - if ( sm_isshutdown ) - sm_blockUserInput = TRUE; - - TQSessionManager* sm = smd->sm; - - // generate a new session key - timeval tv; - gettimeofday( &tv, 0 ); - smd->sessionKey = TQString::number( tv.tv_sec ) + "_" + TQString::number(tv.tv_usec); - - // tell the session manager about our program in best POSIX style - sm_setProperty( SmProgram, TQString( tqApp->argv()[0] ) ); - // tell the session manager about our user as well. - struct passwd* entry = getpwuid( geteuid() ); - if ( entry ) - sm_setProperty( SmUserID, TQString::fromLatin1( entry->pw_name ) ); - - // generate a restart and discard command that makes sense - TQStringList restart; - restart << tqApp->argv()[0] << "-session" << smd->sessionId + "_" + smd->sessionKey; - if (tqstricmp(tqAppName(), tqAppClass()) != 0) - restart << "-name" << tqAppName(); - sm->setRestartCommand( restart ); - TQStringList discard; - sm->setDiscardCommand( discard ); - - switch ( sm_saveType ) { - case SmSaveBoth: - tqApp->commitData( *sm ); - if ( sm_isshutdown && sm_cancel) - break; // we cancelled the shutdown, no need to save state - // fall through - case SmSaveLocal: - tqApp->saveState( *sm ); - break; - case SmSaveGlobal: - tqApp->commitData( *sm ); - break; - default: - break; - } - - if ( sm_phase2 && !sm_in_phase2 ) { - SmcRequestSaveYourselfPhase2( smcConnection, sm_saveYourselfPhase2Callback, (SmPointer*) smd ); - sm_blockUserInput = FALSE; - } - else { - // close eventual interaction monitors and cancel the - // shutdown, if required. Note that we can only cancel when - // performing a shutdown, it does not work for checkpoints - if ( sm_interactionActive ) { - SmcInteractDone( smcConnection, sm_isshutdown && sm_cancel); - sm_interactionActive = FALSE; - } - else if ( sm_cancel && sm_isshutdown ) { - if ( sm->allowsErrorInteraction() ) { - SmcInteractDone( smcConnection, True ); - sm_interactionActive = FALSE; - } - } - - // set restart and discard command in session manager - sm_setProperty( SmRestartCommand, sm->restartCommand() ); - sm_setProperty( SmDiscardCommand, sm->discardCommand() ); - - // set the restart hint - SmPropValue prop; - prop.length = sizeof( int ); - int value = sm->restartHint(); - prop.value = (SmPointer) &value; - sm_setProperty( SmRestartStyleHint, SmCARD8, 1, &prop ); - - // we are done - SmcSaveYourselfDone( smcConnection, !sm_cancel ); - } -} - -static void sm_dieCallback( SmcConn smcConn, SmPointer /* clientData */) -{ - if (smcConn != smcConnection ) - return; - resetSmState(); - TQEvent quitEvent(TQEvent::Quit); - TQApplication::sendEvent(tqApp, &quitEvent); -} - -static void sm_shutdownCancelledCallback( SmcConn smcConn, SmPointer /* clientData */) -{ - if (smcConn != smcConnection ) - return; - if ( sm_waitingForInteraction ) - tqApp->exit_loop(); - resetSmState(); -} - -static void sm_saveCompleteCallback( SmcConn smcConn, SmPointer /*clientData */) -{ - if (smcConn != smcConnection ) - return; - resetSmState(); -} - -static void sm_interactCallback( SmcConn smcConn, SmPointer /* clientData */ ) -{ - if (smcConn != smcConnection ) - return; - if ( sm_waitingForInteraction ) - tqApp->exit_loop(); -} - -static void sm_saveYourselfPhase2Callback( SmcConn smcConn, SmPointer clientData ) -{ - if (smcConn != smcConnection ) - return; - sm_in_phase2 = TRUE; - sm_performSaveYourself( (TQSessionManagerData*) clientData ); -} - - -void TQSmSocketReceiver::socketActivated(int) -{ - IceProcessMessages( SmcGetIceConnection( smcConnection ), 0, 0); -} - - -#undef Bool -#include "qapplication_x11.moc" - -TQSessionManager::TQSessionManager( TQApplication * app, TQString &id, TQString& key ) - : TQObject( app, "session manager" ) -{ - d = new TQSessionManagerData( this, id, key ); - d->restartHint = RestartIfRunning; - - resetSmState(); - char cerror[256]; - char* myId = 0; - char* prevId = (char*)id.latin1(); // we know what we are doing - - SmcCallbacks cb; - cb.save_yourself.callback = sm_saveYourselfCallback; - cb.save_yourself.client_data = (SmPointer) d; - cb.die.callback = sm_dieCallback; - cb.die.client_data = (SmPointer) d; - cb.save_complete.callback = sm_saveCompleteCallback; - cb.save_complete.client_data = (SmPointer) d; - cb.shutdown_cancelled.callback = sm_shutdownCancelledCallback; - cb.shutdown_cancelled.client_data = (SmPointer) d; - - // avoid showing a warning message below - const char* session_manager = getenv("SESSION_MANAGER"); - if ( !session_manager || !session_manager[0] ) - return; - - smcConnection = SmcOpenConnection( 0, 0, 1, 0, - SmcSaveYourselfProcMask | - SmcDieProcMask | - SmcSaveCompleteProcMask | - SmcShutdownCancelledProcMask, - &cb, - prevId, - &myId, - 256, cerror ); - - id = TQString::fromLatin1( myId ); - ::free( myId ); // it was allocated by C - - TQString error = cerror; - if (!smcConnection ) { - tqWarning("Session management error: %s", error.latin1() ); - } - else { - sm_receiver = new TQSmSocketReceiver( IceConnectionNumber( SmcGetIceConnection( smcConnection ) ) ); - } -} - -TQSessionManager::~TQSessionManager() -{ - if ( smcConnection ) - SmcCloseConnection( smcConnection, 0, 0 ); - smcConnection = 0; - delete sm_receiver; - delete d; -} - -TQString TQSessionManager::sessionId() const -{ - return d->sessionId; -} - -TQString TQSessionManager::sessionKey() const -{ - return d->sessionKey; -} - - -void* TQSessionManager::handle() const -{ - return (void*) smcConnection; -} - - -bool TQSessionManager::allowsInteraction() -{ - if ( sm_interactionActive ) - return TRUE; - - if ( sm_waitingForInteraction ) - return FALSE; - - if ( sm_interactStyle == SmInteractStyleAny ) { - sm_waitingForInteraction = SmcInteractRequest( smcConnection, SmDialogNormal, - sm_interactCallback, (SmPointer*) this ); - } - if ( sm_waitingForInteraction ) { - tqApp->enter_loop(); - sm_waitingForInteraction = FALSE; - if ( sm_smActive ) { // not cancelled - sm_interactionActive = TRUE; - sm_blockUserInput = FALSE; - return TRUE; - } - } - return FALSE; -} - -bool TQSessionManager::allowsErrorInteraction() -{ - if ( sm_interactionActive ) - return TRUE; - - if ( sm_waitingForInteraction ) - return FALSE; - - if ( sm_interactStyle == SmInteractStyleAny || sm_interactStyle == SmInteractStyleErrors ) { - sm_waitingForInteraction = SmcInteractRequest( smcConnection, SmDialogError, - sm_interactCallback, (SmPointer*) this ); - } - if ( sm_waitingForInteraction ) { - tqApp->enter_loop(); - sm_waitingForInteraction = FALSE; - if ( sm_smActive ) { // not cancelled - sm_interactionActive = TRUE; - sm_blockUserInput = FALSE; - return TRUE; - } - } - return FALSE; -} - -void TQSessionManager::release() -{ - if ( sm_interactionActive ) { - SmcInteractDone( smcConnection, False ); - sm_interactionActive = FALSE; - if ( sm_smActive && sm_isshutdown ) - sm_blockUserInput = TRUE; - } -} - -void TQSessionManager::cancel() -{ - sm_cancel = TRUE; -} - -void TQSessionManager::setRestartHint( TQSessionManager::RestartHint hint) -{ - d->restartHint = hint; -} - -TQSessionManager::RestartHint TQSessionManager::restartHint() const -{ - return d->restartHint; -} - -void TQSessionManager::setRestartCommand( const TQStringList& command) -{ - d->restartCommand = command; -} - -TQStringList TQSessionManager::restartCommand() const -{ - return d->restartCommand; -} - -void TQSessionManager::setDiscardCommand( const TQStringList& command) -{ - d->discardCommand = command; -} - -TQStringList TQSessionManager::discardCommand() const -{ - return d->discardCommand; -} - -void TQSessionManager::setManagerProperty( const TQString& name, const TQString& value) -{ - SmPropValue prop; - prop.length = value.length(); - prop.value = (SmPointer) value.utf8().data(); - sm_setProperty( name.latin1(), SmARRAY8, 1, &prop ); -} - -void TQSessionManager::setManagerProperty( const TQString& name, const TQStringList& value) -{ - SmPropValue *prop = new SmPropValue[ value.count() ]; - int count = 0; - for ( TQStringList::ConstIterator it = value.begin(); it != value.end(); ++it ) { - prop[ count ].length = (*it).length(); - prop[ count ].value = (char*)(*it).utf8().data(); - ++count; - } - sm_setProperty( name.latin1(), SmLISTofARRAY8, count, prop ); - delete [] prop; -} - -bool TQSessionManager::isPhase2() const -{ - return sm_in_phase2; -} - -void TQSessionManager::requestPhase2() -{ - sm_phase2 = TRUE; -} - - -#endif // TQT_NO_SM_SUPPORT diff --git a/src/kernel/qdnd_x11.cpp b/src/kernel/qdnd_x11.cpp index 571045f48..57bdcffd4 100644 --- a/src/kernel/qdnd_x11.cpp +++ b/src/kernel/qdnd_x11.cpp @@ -40,7 +40,7 @@ #include "qplatformdefs.h" -#include "ntqapplication.h" +#include "tqapplication.h" #ifndef TQT_NO_DRAGANDDROP diff --git a/src/kernel/qt_kernel.pri b/src/kernel/qt_kernel.pri index 84a383a5d..05d5c8cd7 100644 --- a/src/kernel/qt_kernel.pri +++ b/src/kernel/qt_kernel.pri @@ -5,8 +5,8 @@ kernel { HEADERS += \ $$KERNEL_H/tqaccel.h \ $$KERNEL_P/tqucomextra_p.h \ - $$KERNEL_H/ntqapplication.h \ - $$KERNEL_P/qapplication_p.h \ + $$KERNEL_H/tqapplication.h \ + $$KERNEL_P/tqapplication_p.h \ $$KERNEL_H/tqasyncimageio.h \ $$KERNEL_H/tqasyncio.h \ $$KERNEL_H/tqbitmap.h \ @@ -110,7 +110,7 @@ kernel { HEADERS+=$$KERNEL_P/tqeventloop_glib_p.h } - win32:SOURCES += $$KERNEL_CPP/qapplication_win.cpp \ + win32:SOURCES += $$KERNEL_CPP/tqapplication_win.cpp \ $$KERNEL_CPP/tqclipboard_win.cpp \ $$KERNEL_CPP/tqcolor_win.cpp \ $$KERNEL_CPP/tqcursor_win.cpp \ @@ -133,7 +133,7 @@ kernel { $$KERNEL_CPP/tqfontengine_win.cpp unix:x11 { - SOURCES += $$KERNEL_CPP/qapplication_x11.cpp \ + SOURCES += $$KERNEL_CPP/tqapplication_x11.cpp \ $$KERNEL_CPP/tqclipboard_x11.cpp \ $$KERNEL_CPP/tqcolor_x11.cpp \ $$KERNEL_CPP/tqcursor_x11.cpp \ @@ -163,7 +163,7 @@ kernel { exists(tqsound_mac.cpp):SOURCES += $$KERNEL_CPP/tqsound_mac.cpp } !embedded:!x11:mac { - SOURCES += $$KERNEL_CPP/qapplication_mac.cpp \ + SOURCES += $$KERNEL_CPP/tqapplication_mac.cpp \ $$KERNEL_CPP/tqclipboard_mac.cpp \ $$KERNEL_CPP/tqcolor_mac.cpp \ $$KERNEL_CPP/tqcursor_mac.cpp \ @@ -196,7 +196,7 @@ kernel { SOURCES += $$KERNEL_CPP/tqabstractlayout.cpp \ $$KERNEL_CPP/tqucomextra.cpp \ $$KERNEL_CPP/tqaccel.cpp \ - $$KERNEL_CPP/qapplication.cpp \ + $$KERNEL_CPP/tqapplication.cpp \ $$KERNEL_CPP/tqasyncimageio.cpp \ $$KERNEL_CPP/tqasyncio.cpp \ $$KERNEL_CPP/tqbitmap.cpp \ diff --git a/src/kernel/qt_pch.h b/src/kernel/qt_pch.h index 1420944ef..073f01b50 100644 --- a/src/kernel/qt_pch.h +++ b/src/kernel/qt_pch.h @@ -23,7 +23,7 @@ # endif #include // I must be first! #include // All moc genereated code has this include -#include +#include #include #include #include diff --git a/src/kernel/qtaddons_x11.cpp b/src/kernel/qtaddons_x11.cpp index 089466ec7..c1d83e805 100644 --- a/src/kernel/qtaddons_x11.cpp +++ b/src/kernel/qtaddons_x11.cpp @@ -32,7 +32,7 @@ #include #include -extern bool tqt_use_xrender; // defined in qapplication_x11.cpp +extern bool tqt_use_xrender; // defined in tqapplication_x11.cpp extern "C" { diff --git a/src/kernel/tqabstractlayout.cpp b/src/kernel/tqabstractlayout.cpp index 3f881ddbb..cbace549d 100644 --- a/src/kernel/tqabstractlayout.cpp +++ b/src/kernel/tqabstractlayout.cpp @@ -41,7 +41,7 @@ #include "tqlayout.h" #ifndef TQT_NO_LAYOUT -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqlayoutengine_p.h" #include "tqmenubar.h" #include "tqtoolbar.h" diff --git a/src/kernel/tqaccel.cpp b/src/kernel/tqaccel.cpp index ef6b665e6..6569aa8dc 100644 --- a/src/kernel/tqaccel.cpp +++ b/src/kernel/tqaccel.cpp @@ -43,7 +43,7 @@ #ifndef TQT_NO_ACCEL #include "tqsignal.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidget.h" #include "tqptrlist.h" #include "tqwhatsthis.h" diff --git a/src/kernel/tqaccessible.cpp b/src/kernel/tqaccessible.cpp index 5a43e402b..174e16633 100644 --- a/src/kernel/tqaccessible.cpp +++ b/src/kernel/tqaccessible.cpp @@ -43,7 +43,7 @@ #include "tqptrdict.h" #include "tqmetaobject.h" #include -#include "ntqapplication.h" +#include "tqapplication.h" #include /*! diff --git a/src/kernel/tqapplication.cpp b/src/kernel/tqapplication.cpp new file mode 100644 index 000000000..1cc5bf140 --- /dev/null +++ b/src/kernel/tqapplication.cpp @@ -0,0 +1,4969 @@ +/**************************************************************************** +** +** Implementation 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. +** +**********************************************************************/ + +#include "tqobjectlist.h" +#include "tqapplication.h" +#include "tqeventloop.h" +#include "tqeventloop_p.h" +#include "tqwidget.h" +#include "tqwidgetlist.h" +#include "tqwidgetintdict.h" +#include "tqptrdict.h" +#include "tqcleanuphandler.h" + +#include "tqtranslator.h" +#include "tqtextcodec.h" +#include "tqsessionmanager.h" +#include "tqdragobject.h" +#include "tqclipboard.h" +#include "tqcursor.h" +#include "tqstyle.h" +#include "tqstylefactory.h" +#include "tqfile.h" +#include "tqmessagebox.h" +#include "tqdir.h" +#include "tqfileinfo.h" +#ifdef TQ_WS_WIN +#include "tqinputcontext_p.h" +#endif +#include "tqfontdata_p.h" + +#if defined(TQT_THREAD_SUPPORT) +# include "tqmutex.h" +# include "tqthread.h" +# include +#endif // TQT_THREAD_SUPPORT + +#include + +#ifdef truncate +# undef truncate +#endif + +/*! + \class TQApplication tqapplication.h + \brief The TQApplication class manages the GUI application's control + flow and main settings. + + \ingroup application + \mainclass + + It contains the main event loop, where all events from the window + system and other sources are processed and dispatched. It also + handles the application's initialization and finalization, and + provides session management. It also handles most system-wide and + application-wide settings. + + For any GUI application that uses TQt, there is precisely one + TQApplication object, no matter whether the application has 0, 1, 2 + or more windows at any time. + + The TQApplication object is accessible through the global pointer \c + tqApp. Its main areas of responsibility are: + \list + + \i It initializes the application with the user's desktop settings + such as palette(), font() and doubleClickInterval(). It keeps track + of these properties in case the user changes the desktop globally, for + example through some kind of control panel. + + \i It performs event handling, meaning that it receives events + from the underlying window system and dispatches them to the relevant + widgets. By using sendEvent() and postEvent() you can send your own + events to widgets. + + \i It parses common command line arguments and sets its internal + state accordingly. See the \link TQApplication::TQApplication() + constructor documentation\endlink below for more details about this. + + \i It defines the application's look and feel, which is + encapsulated in a TQStyle object. This can be changed at runtime + with setStyle(). + + \i It specifies how the application is to allocate colors. + See setColorSpec() for details. + + \i It provides localization of strings that are visible to the user + via translate(). + + \i It provides some magical objects like the desktop() and the + clipboard(). + + \i It knows about the application's windows. You can ask which + widget is at a certain position using widgetAt(), get a list of + topLevelWidgets() and closeAllWindows(), etc. + + \i It manages the application's mouse cursor handling, + see setOverrideCursor() and setGlobalMouseTracking(). + + \i On the X window system, it provides functions to flush and sync + the communication stream, see flushX() and syncX(). + + \i It provides support for sophisticated \link + session.html session management \endlink. This makes it possible + for applications to terminate gracefully when the user logs out, to + cancel a shutdown process if termination isn't possible and even to + preserve the entire application's state for a future session. See + isSessionRestored(), sessionId() and commitData() and saveState() + for details. + + \endlist + + The Application walk-through + example contains a typical complete main() that does the usual + things with TQApplication. + + Since the TQApplication object does so much initialization, it + must be created before any other objects related to the user + interface are created. + + Since it also deals with common command line arguments, it is + usually a good idea to create it \e before any interpretation or + modification of \c argv is done in the application itself. (Note + also that for X11, setMainWidget() may change the main widget + according to the \c -geometry option. To preserve this + functionality, you must set your defaults before setMainWidget() and + any overrides after.) + + \table + \header \i21 Groups of functions + \row + \i System settings + \i + desktopSettingsAware(), + setDesktopSettingsAware(), + cursorFlashTime(), + setCursorFlashTime(), + doubleClickInterval(), + setDoubleClickInterval(), + wheelScrollLines(), + setWheelScrollLines(), + palette(), + setPalette(), + font(), + setFont(), + fontMetrics(). + + \row + \i Event handling + \i + exec(), + processEvents(), + enter_loop(), + exit_loop(), + exit(), + quit(). + sendEvent(), + postEvent(), + sendPostedEvents(), + removePostedEvents(), + hasPendingEvents(), + notify(), + macEventFilter(), + x11EventFilter(), + x11ProcessEvent(), + winEventFilter(). + + \row + \i GUI Styles + \i + style(), + setStyle(), + polish(). + + \row + \i Color usage + \i + colorSpec(), + setColorSpec(), + + \row + \i Text handling + \i + installTranslator(), + removeTranslator() + translate(). + + \row + \i Widgets + \i + mainWidget(), + setMainWidget(), + allWidgets(), + topLevelWidgets(), + desktop(), + activePopupWidget(), + activeModalWidget(), + clipboard(), + focusWidget(), + winFocus(), + activeWindow(), + widgetAt(). + + \row + \i Advanced cursor handling + \i + hasGlobalMouseTracking(), + setGlobalMouseTracking(), + overrideCursor(), + setOverrideCursor(), + restoreOverrideCursor(). + + \row + \i X Window System synchronization + \i + flushX(), + syncX(). + + \row + \i Session management + \i + isSessionRestored(), + sessionId(), + commitData(), + saveState(). + + \row + \i Threading + \i + lock(), unlock(), locked(), tryLock(), + wakeUpGuiThread() + + \row + \i Miscellaneous + \i + closeAllWindows(), + startingUp(), + closingDown(), + type(). + \endtable + + \e {Non-GUI programs:} While TQt is not optimized or + designed for writing non-GUI programs, it's possible to use + \link tools.html some of its classes \endlink without creating a + TQApplication. This can be useful if you wish to share code between + a non-GUI server and a GUI client. + + \headerfile tqnamespace.h + \headerfile tqwindowdefs.h + \headerfile tqglobal.h +*/ + +/*! \enum TQt::HANDLE + \internal +*/ + +/*! + \enum TQApplication::Type + + \value Tty a console application + \value GuiClient a GUI client application + \value GuiServer a GUI server application +*/ + +/*! + \enum TQApplication::ColorSpec + + \value NormalColor the default color allocation policy + \value CustomColor the same as NormalColor for X11; allocates colors + to a palette on demand under Windows + \value ManyColor the right choice for applications that use thousands of + colors + + See setColorSpec() for full details. +*/ + +/* + The tqt_init() and tqt_cleanup() functions are implemented in the + tqapplication_xyz.cpp file. +*/ + +void tqt_init( int *, char **, TQApplication::Type ); +void tqt_cleanup(); +#if defined(TQ_WS_X11) +void tqt_init( Display* dpy, TQt::HANDLE, TQt::HANDLE ); +void tqt_init( int *, char **, Display* dpy, TQt::HANDLE, TQt::HANDLE ); +#endif +TQ_EXPORT bool tqt_tryModalHelper( TQWidget *widget, TQWidget **rettop ); + +TQApplication *tqApp = 0; // global application object + +TQStyle *TQApplication::app_style = 0; // default application style +bool tqt_explicit_app_style = FALSE; // style explicitly set by programmer + +int TQApplication::app_cspec = TQApplication::NormalColor; +#ifndef TQT_NO_PALETTE +TQPalette *TQApplication::app_pal = 0; // default application palette +#endif +TQFont *TQApplication::app_font = 0; // default application font +bool tqt_app_has_font = FALSE; +#ifndef TQT_NO_CURSOR +TQCursor *TQApplication::app_cursor = 0; // default application cursor +#endif +int TQApplication::app_tracking = 0; // global mouse tracking +bool TQApplication::is_app_running = FALSE; // app starting up if FALSE +bool TQApplication::is_app_closing = FALSE; // app closing down if TRUE +int TQApplication::loop_level = 0; // event loop level +TQWidget *TQApplication::main_widget = 0; // main application widget +TQWidget *TQApplication::focus_widget = 0; // has keyboard input focus +TQWidget *TQApplication::active_window = 0; // toplevel with keyboard focus +bool TQApplication::obey_desktop_settings = TRUE; // use winsys resources +int TQApplication::cursor_flash_time = 1000; // text caret flash time +int TQApplication::mouse_double_click_time = 400; // mouse dbl click limit +#ifndef TQT_NO_WHEELEVENT +int TQApplication::wheel_scroll_lines = 3; // number of lines to scroll +#endif +bool tqt_is_gui_used; +bool TQ_EXPORT tqt_resolve_symlinks = TRUE; +bool TQ_EXPORT tqt_tab_all_widgets = TRUE; +TQRect tqt_maxWindowRect; +static int drag_time = 500; +static int drag_distance = 4; +static bool reverse_layout = FALSE; +TQSize TQApplication::app_strut = TQSize( 0,0 ); // no default application strut +bool TQApplication::animate_ui = TRUE; +bool TQApplication::animate_menu = FALSE; +bool TQApplication::fade_menu = FALSE; +bool TQApplication::animate_combo = FALSE; +bool TQApplication::animate_tooltip = FALSE; +bool TQApplication::fade_tooltip = FALSE; +bool TQApplication::animate_toolbox = FALSE; +bool TQApplication::widgetCount = FALSE; +TQApplication::Type tqt_appType=TQApplication::Tty; +#ifndef TQT_NO_COMPONENT +TQStringList *TQApplication::app_libpaths = 0; +#endif +bool TQApplication::metaComposeUnicode = FALSE; +int TQApplication::composedUnicode = 0; + +#ifdef TQT_THREAD_SUPPORT +TQMutex *TQApplication::tqt_mutex = 0; +TQMutex *tqt_sharedStringMutex = 0; +TQ_EXPORT TQMutex * tqt_sharedMetaObjectMutex = 0; + +#ifdef QT_USE_GLIBMAINLOOP +TQMutex *tqt_timerListMutex = 0; +#endif // QT_USE_GLIBMAINLOOP + +static TQt::HANDLE tqt_application_thread_id = 0; +TQ_EXPORT TQt::HANDLE tqt_get_application_thread_id() +{ + return tqt_application_thread_id; +} +#endif // TQT_THREAD_SUPPORT + +#ifndef TQT_THREAD_SUPPORT +TQEventLoop *TQApplication::eventloop = 0; // application event loop +#endif + +#ifdef TQT_THREAD_SUPPORT +TQEventLoop* TQApplication::currentEventLoop() { + TQThread* thread = TQThread::currentThreadObject(); + if (thread) { + if (thread->d) { + return thread->d->eventLoop; + } + } + return NULL; +} +#else +TQEventLoop* TQApplication::currentEventLoop() { + return TQApplication::eventloop; +} +#endif + +#ifndef TQT_NO_ACCEL +extern bool tqt_dispatchAccelEvent( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp +extern bool tqt_tryComposeUnicode( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp +#endif + +#if defined(QT_TABLET_SUPPORT) +bool chokeMouse = FALSE; +#endif + +void tqt_setMaxWindowRect(const TQRect& r) +{ + tqt_maxWindowRect = r; + // Re-resize any maximized windows + TQWidgetList* l = TQApplication::topLevelWidgets(); + if ( l ) { + TQWidget *w = l->first(); + while ( w ) { + if ( w->isVisible() && w->isMaximized() ) + { + w->showNormal(); //#### flicker + w->showMaximized(); + } + w = l->next(); + } + delete l; + } +} + +typedef void (*VFPTR)(); +typedef TQValueList TQVFuncList; +static TQVFuncList *postRList = 0; // list of post routines + +/*! + \relates TQApplication + + Adds a global routine that will be called from the TQApplication + destructor. This function is normally used to add cleanup routines + for program-wide functionality. + + The function given by \a p should take no arguments and return + nothing, like this: + \code + static int *global_ptr = 0; + + static void cleanup_ptr() + { + delete [] global_ptr; + global_ptr = 0; + } + + void init_ptr() + { + global_ptr = new int[100]; // allocate data + tqAddPostRoutine( cleanup_ptr ); // delete later + } + \endcode + + Note that for an application- or module-wide cleanup, + tqAddPostRoutine() is often not suitable. People have a tendency to + make such modules dynamically loaded, and then unload those modules + long before the TQApplication destructor is called, for example. + + For modules and libraries, using a reference-counted initialization + manager or TQt' parent-child delete mechanism may be better. Here is + an example of a private class which uses the parent-child mechanism + to call a cleanup function at the right time: + + \code + class MyPrivateInitStuff: public TQObject { + private: + MyPrivateInitStuff( TQObject * parent ): TQObject( parent) { + // initialization goes here + } + MyPrivateInitStuff * p; + + public: + static MyPrivateInitStuff * initStuff( TQObject * parent ) { + if ( !p ) + p = new MyPrivateInitStuff( parent ); + return p; + } + + ~MyPrivateInitStuff() { + // cleanup (the "post routine") goes here + } + } + \endcode + + By selecting the right parent widget/object, this can often be made + to clean up the module's data at the exact right moment. +*/ + +TQ_EXPORT void tqAddPostRoutine( TQtCleanUpFunction p) +{ + if ( !postRList ) { + postRList = new TQVFuncList; + TQ_CHECK_PTR( postRList ); + } + postRList->prepend( p ); +} + + +TQ_EXPORT void tqRemovePostRoutine( TQtCleanUpFunction p ) +{ + if ( !postRList ) return; + TQVFuncList::Iterator it = postRList->begin(); + while ( it != postRList->end() ) { + if ( *it == p ) { + postRList->remove( it ); + it = postRList->begin(); + } else { + ++it; + } + } +} + +// Default application palettes and fonts (per widget type) +TQAsciiDict *TQApplication::app_palettes = 0; +TQAsciiDict *TQApplication::app_fonts = 0; + +#ifndef TQT_NO_SESSIONMANAGER +TQString *TQApplication::session_key = 0; // ## session key. Should be a member in 4.0 +#endif +TQWidgetList *TQApplication::popupWidgets = 0; // has keyboard input focus + +TQDesktopWidget *tqt_desktopWidget = 0; // root window widgets +#ifndef TQT_NO_CLIPBOARD +TQClipboard *tqt_clipboard = 0; // global clipboard object +#endif +TQWidgetList * tqt_modal_stack=0; // stack of modal widgets + +#ifdef TQT_THREAD_SUPPORT + +// thread wrapper for the main() thread +class TQCoreApplicationThread : public TQThread +{ +public: + inline TQCoreApplicationThread() + { +#ifdef QT_CHECK_STATE + if ( tqt_gui_thread_self ) + tqWarning( "TQCoreApplicationThread: there should be exactly one main thread object" ); +#endif + tqt_gui_thread_self = this; + + TQThreadInstance::setCurrentThread(this); + + // thread should be running and not finished for the lifetime + // of the application (even if TQCoreApplication goes away) + d->running = true; + d->finished = false; + d->eventLoop = NULL; + } + + inline ~TQCoreApplicationThread() + { + tqt_gui_thread_self = nullptr; + + // avoid warning from TQThread + d->running = false; + // do some cleanup, namely clean up the thread-local storage associated with the GUI thread + TQThreadInstance::finishGuiThread(d); + } + + static TQCoreApplicationThread* self() { return tqt_gui_thread_self; } + +private: + inline void run() + { + // this function should never be called, it is implemented + // only so that we can instantiate the object + tqFatal("TQCoreApplicationThread: internal error"); + } + + static TQCoreApplicationThread* tqt_gui_thread_self; +}; + +TQCoreApplicationThread* TQCoreApplicationThread::tqt_gui_thread_self = nullptr; + +// construct exactly one instance of the core thread with static storage duration. Do it static +// rather than in the heap as we need it to be properly destroyed on the exit from the program. +static TQCoreApplicationThread tqt_main_thread; +#endif + +// Definitions for posted events +struct TQPostEvent { + TQPostEvent( TQObject *r, TQEvent *e ): receiver( r ), event( e ) {} + ~TQPostEvent() { delete event; } + TQObject *receiver; + TQEvent *event; +}; + +class TQ_EXPORT TQPostEventList : public TQPtrList +{ +public: + TQPostEventList(bool with_mutex = false) : TQPtrList(), m_mutex(nullptr) + { +#ifdef TQT_THREAD_SUPPORT + if (with_mutex) + { + m_mutex = new TQMutex(TRUE); + } +#endif + } + + ~TQPostEventList() + { + if (m_mutex) + { + delete m_mutex; + m_mutex = nullptr; + } + clear(); + } + + TQMutex* mutex() const { return m_mutex; } + +private: + TQMutex *m_mutex; + + TQPostEventList(const TQPostEventList &) = delete; + TQPostEventList &operator=(const TQPostEventList &) = delete; +}; + +class TQ_EXPORT TQPostEventListIt : public TQPtrListIterator +{ +public: + TQPostEventListIt( const TQPostEventList &l ) : TQPtrListIterator(l) {} + TQPostEventListIt &operator=(const TQPostEventListIt &i) +{ + return (TQPostEventListIt&)TQPtrListIterator::operator=(i); } +}; + +// The global list and its pointer are initialized in different functions +// to optimize access to the list pointer in normal usage +static TQPostEventList* InitGlobalPostedEventsList() +{ + static TQPostEventList _globalEventList(true); + _globalEventList.setAutoDelete(TRUE); + return &_globalEventList; +} + +static TQPostEventList* GlobalPostedEvents() +{ + static TQPostEventList *_globalPostedEvents = InitGlobalPostedEventsList(); + return _globalPostedEvents; +} + +uint qGlobalPostedEventsCount() +{ +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker locker( GlobalPostedEvents()->mutex() ); +#endif // TQT_THREAD_SUPPORT + + return GlobalPostedEvents()->count(); +} + +#ifndef TQT_NO_PALETTE +TQPalette *tqt_std_pal = 0; + +void tqt_create_std_palette() +{ + if ( tqt_std_pal ) + delete tqt_std_pal; + + TQColor standardLightGray( 192, 192, 192 ); + TQColor light( 255, 255, 255 ); + TQColor dark( standardLightGray.dark( 150 ) ); + TQColorGroup std_act( TQt::black, standardLightGray, + light, dark, TQt::gray, + TQt::black, TQt::white ); + TQColorGroup std_dis( TQt::darkGray, standardLightGray, + light, dark, TQt::gray, + TQt::darkGray, std_act.background() ); + TQColorGroup std_inact( TQt::black, standardLightGray, + light, dark, TQt::gray, + TQt::black, TQt::white ); + tqt_std_pal = new TQPalette( std_act, std_dis, std_inact ); +} + +static void tqt_fix_tooltips() +{ + // No resources for this yet (unlike on Windows). + TQColorGroup cg( TQt::black, TQColor(255,255,220), + TQColor(96,96,96), TQt::black, TQt::black, + TQt::black, TQColor(255,255,220) ); + TQPalette pal( cg, cg, cg ); + TQApplication::setPalette( pal, TRUE, "TQTipLabel"); +} +#endif + +void TQApplication::process_cmdline( int* argcptr, char ** argv ) +{ + // process platform-indep command line + if ( !tqt_is_gui_used || !*argcptr) + return; + + int argc = *argcptr; + int i, j; + + j = 1; + for ( i=1; i= 0 ) { + if ( !session_key ) + session_key = new TQString; + *session_key = session_id.mid( p +1 ); + session_id = session_id.left( p ); + } + is_session_restored = TRUE; + } +#endif + } else if ( qstrcmp(arg, "-reverse") == 0 ) { + setReverseLayout( TRUE ); + } else if ( qstrcmp(arg, "-widgetcount") == 0 ) { + widgetCount = TRUE;; + } else { + argv[j++] = argv[i]; + } +#ifndef TQT_NO_STYLE + if ( !s.isEmpty() ) { + setStyle( s ); + } +#endif + } + + if(j < argc) { +#ifdef TQ_WS_MACX + static char* empty = "\0"; + argv[j] = empty; +#else + argv[j] = 0; +#endif + *argcptr = j; + } +} + +/*! + Initializes the window system and constructs an application object + with \a argc command line arguments in \a argv. + + The global \c tqApp pointer refers to this application object. Only + one application object should be created. + + This application object must be constructed before any \link + TQPaintDevice paint devices\endlink (including widgets, pixmaps, bitmaps + etc.). + + Note that \a argc and \a argv might be changed. TQt removes command + line arguments that it recognizes. The modified \a argc and \a argv + can also be accessed later with \c tqApp->argc() and \c tqApp->argv(). + The documentation for argv() contains a detailed description of how + to process command line arguments. + + TQt debugging options (not available if TQt was compiled with the + TQT_NO_DEBUG flag defined): + \list + \i -nograb, tells TQt that it must never grab the mouse or the keyboard. + \i -dograb (only under X11), running under a debugger can cause + an implicit -nograb, use -dograb to override. + \i -sync (only under X11), switches to synchronous mode for + debugging. + \endlist + + See \link debug.html Debugging Techniques \endlink for a more + detailed explanation. + + All TQt programs automatically support the following command line options: + \list + \i -reverse causes text to be formatted for right-to-left languages + rather than in the usual left-to-right direction. + \i -style= \e style, sets the application GUI style. Possible values + are \c motif, \c windows, and \c platinum. If you compiled TQt + with additional styles or have additional styles as plugins these + will be available to the \c -style command line option. + \i -style \e style, is the same as listed above. + \i -session= \e session, restores the application from an earlier + \link session.html session \endlink. + \i -session \e session, is the same as listed above. + \i -widgetcount, prints debug message at the end about number of widgets left + undestroyed and maximum number of widgets existed at the same time + \endlist + + The X11 version of TQt also supports some traditional X11 + command line options: + \list + \i -display \e display, sets the X display (default is $DISPLAY). + \i -geometry \e geometry, sets the client geometry of the + \link setMainWidget() main widget\endlink. + \i -fn or \c -font \e font, defines the application font. The + font should be specified using an X logical font description. + \i -bg or \c -background \e color, sets the default background color + and an application palette (light and dark shades are calculated). + \i -fg or \c -foreground \e color, sets the default foreground color. + \i -btn or \c -button \e color, sets the default button color. + \i -name \e name, sets the application name. + \i -title \e title, sets the application title (caption). + \i -visual \c TrueColor, forces the application to use a TrueColor visual + on an 8-bit display. + \i -ncols \e count, limits the number of colors allocated in the + color cube on an 8-bit display, if the application is using the + \c TQApplication::ManyColor color specification. If \e count is + 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, + and 6 of blue); for other values, a cube + approximately proportional to a 2x3x1 cube is used. + \i -cmap, causes the application to install a private color map + on an 8-bit display. + \endlist + + \sa argc(), argv() +*/ + +//######### BINARY COMPATIBILITY constructor +TQApplication::TQApplication( int &argc, char **argv ) +{ + construct( argc, argv, GuiClient, true ); +} + +/*! + Constructs an application object with \a argc command line arguments + in \a argv. If \a GUIenabled is TRUE, a GUI application is + constructed, otherwise a non-GUI (console) application is created. + + Set \a GUIenabled to FALSE for programs without a graphical user + interface that should be able to run without a window system. + + On X11, the window system is initialized if \a GUIenabled is TRUE. + If \a GUIenabled is FALSE, the application does not connect to the + X-server. + On Windows and Macintosh, currently the window system is always + initialized, regardless of the value of GUIenabled. This may change in + future versions of TQt. + + The following example shows how to create an application that + uses a graphical interface when available. + \code + int main( int argc, char **argv ) + { +#ifdef TQ_WS_X11 + bool useGUI = getenv( "DISPLAY" ) != 0; +#else + bool useGUI = TRUE; +#endif + TQApplication app(argc, argv, useGUI); + + if ( useGUI ) { + //start GUI version + ... + } else { + //start non-GUI version + ... + } + return app.exec(); + } +\endcode +*/ + +TQApplication::TQApplication( int &argc, char **argv, bool GUIenabled ) +{ + construct( argc, argv, GUIenabled ? GuiClient : Tty, true ); +} + +/*! + Constructs an application object with \a argc command line arguments + in \a argv. If \a GUIenabled is TRUE, a GUI application is + constructed, otherwise a non-GUI (console) application is created. + If \a SMEnabled is TRUE, session management support is enabled (default). + + Set \a GUIenabled to FALSE for programs without a graphical user + interface that should be able to run without a window system. + + Set \a SMEnabled to FALSE to disable session management. + Session management cannot be enabled at a later time if disabled here. + + On X11, the window system is initialized if \a GUIenabled is TRUE. + If \a GUIenabled is FALSE, the application does not connect to the + X-server. + On Windows and Macintosh, currently the window system is always + initialized, regardless of the value of GUIenabled. This may change in + future versions of TQt. + + The following example shows how to create an application that + uses a graphical interface when available. + \code + int main( int argc, char **argv ) + { +#ifdef TQ_WS_X11 + bool useGUI = getenv( "DISPLAY" ) != 0; +#else + bool useGUI = TRUE; +#endif + TQApplication app(argc, argv, useGUI); + + if ( useGUI ) { + //start GUI version + ... + } else { + //start non-GUI version + ... + } + return app.exec(); + } +\endcode +*/ + +TQApplication::TQApplication( int &argc, char **argv, bool GUIenabled, bool SMenabled ) +{ + construct( argc, argv, GUIenabled ? GuiClient : Tty, SMenabled ); +} + +/*! + Constructs an application object with \a argc command line arguments + in \a argv. +*/ +TQApplication::TQApplication( int &argc, char **argv, Type type ) +{ + construct( argc, argv, type, true ); +} + +TQ_EXPORT void tqt_ucm_initialize( TQApplication *theApp ) +{ + if ( tqApp ) + return; + int argc = theApp->argc(); + char **argv = theApp->argv(); + theApp->construct( argc, argv, tqApp->type(), true ); + + Q_ASSERT( tqApp == theApp ); +} + +void TQApplication::construct( int &argc, char **argv, Type type, bool enable_sm ) +{ + tqt_appType = type; + tqt_is_gui_used = (type != Tty); + init_precmdline(); + static const char *empty = ""; + if ( argc == 0 || argv == 0 ) { + argc = 0; + argv = (char **)∅ // ouch! careful with TQApplication::argv()! + } + app_argc = argc; + app_argv = argv; + + tqt_init( &argc, argv, type ); // Must be called before initialize() + process_cmdline( &argc, argv ); + initialize( argc, argv, enable_sm ); + if ( tqt_is_gui_used ) + tqt_maxWindowRect = desktop()->rect(); + if ( currentEventLoop() ) + currentEventLoop()->appStartingUp(); +} + +/*! + Returns the type of application, Tty, GuiClient or GuiServer. +*/ + +TQApplication::Type TQApplication::type() const +{ + return tqt_appType; +} + +#if defined(TQ_WS_X11) +/*! + Create an application, given an already open display \a dpy. If \a + visual and \a colormap are non-zero, the application will use those as + the default Visual and Colormap contexts. + + \warning TQt only supports TrueColor visuals at depths higher than 8 + bits-per-pixel. + + This is available only on X11. +*/ + +TQApplication::TQApplication( Display* dpy, HANDLE visual, HANDLE colormap ) +{ + static int aargc = 1; + // ### a string literal is a cont char* + // ### using it as a char* is wrong and could lead to segfaults + // ### if aargv is modified someday + static char *aargv[] = { (char*)"unknown", 0 }; + + app_argc = aargc; + app_argv = aargv; + + tqt_appType = GuiClient; + tqt_is_gui_used = TRUE; + tqt_appType = GuiClient; + init_precmdline(); + // ... no command line. + + if ( ! dpy ) { +#ifdef QT_CHECK_STATE + tqWarning( "TQApplication: invalid Display* argument." ); +#endif // QT_CHECK_STATE + + tqt_init( &aargc, aargv, GuiClient ); + } else { + tqt_init( dpy, visual, colormap ); + } + + initialize( aargc, aargv ); + + if ( tqt_is_gui_used ) + tqt_maxWindowRect = desktop()->rect(); + if ( currentEventLoop() ) + currentEventLoop()->appStartingUp(); +} + +/*! + Create an application, given an already open display \a dpy and using + \a argc command line arguments in \a argv. If \a + visual and \a colormap are non-zero, the application will use those as + the default Visual and Colormap contexts. + + \warning TQt only supports TrueColor visuals at depths higher than 8 + bits-per-pixel. + + This is available only on X11. + +*/ +TQApplication::TQApplication(Display *dpy, int argc, char **argv, + HANDLE visual, HANDLE colormap) +{ + tqt_appType = GuiClient; + tqt_is_gui_used = TRUE; + tqt_appType = GuiClient; + init_precmdline(); + + app_argc = argc; + app_argv = argv; + + if ( ! dpy ) { +#ifdef QT_CHECK_STATE + tqWarning( "TQApplication: invalid Display* argument." ); +#endif // QT_CHECK_STATE + + tqt_init( &argc, argv, GuiClient ); + } else { + tqt_init( &argc, argv, dpy, visual, colormap ); + } + + process_cmdline( &argc, argv ); + initialize(argc, argv); + + if ( tqt_is_gui_used ) + tqt_maxWindowRect = desktop()->rect(); + if ( currentEventLoop() ) + currentEventLoop()->appStartingUp(); +} + + +#endif // TQ_WS_X11 + +#ifdef TQT_THREAD_SUPPORT +TQThread* TQApplication::guiThread() { + return TQCoreApplicationThread::self(); +} + +bool TQApplication::isGuiThread() { + return (TQThread::currentThreadObject() == guiThread()); +} +#else +bool TQApplication::isGuiThread() { + return true; +} +#endif + +void TQApplication::init_precmdline() +{ + translators = 0; + is_app_closing = FALSE; +#ifndef TQT_NO_SESSIONMANAGER + is_session_restored = FALSE; +#endif +#if defined(QT_CHECK_STATE) + if ( tqApp ) + tqWarning( "TQApplication: There should be max one application object" ); +#endif + tqApp = (TQApplication*)this; +} + +/*! + Initializes the TQApplication object, called from the constructors. +*/ + +void TQApplication::initialize( int argc, char **argv, bool enable_sm ) +{ +#ifdef TQT_THREAD_SUPPORT + tqt_mutex = new TQMutex( TRUE ); + tqt_sharedStringMutex = new TQMutex( TRUE ); + tqt_sharedMetaObjectMutex = new TQMutex( TRUE ); +#ifdef QT_USE_GLIBMAINLOOP + tqt_timerListMutex = new TQMutex( TRUE ); +#endif // QT_USE_GLIBMAINLOOP + tqt_application_thread_id = TQThread::currentThread(); +#endif // TQT_THREAD_SUPPORT + + app_argc = argc; + app_argv = argv; + quit_now = FALSE; + quit_code = 0; + TQWidget::createMapper(); // create widget mapper +#ifndef TQT_NO_PALETTE + (void) palette(); // trigger creation of application palette +#endif + is_app_running = TRUE; // no longer starting up + +#ifndef TQT_NO_SESSIONMANAGER + if (enable_sm) { + // connect to the session manager + if ( !session_key ) + session_key = new TQString; + session_manager = new TQSessionManager( tqApp, session_id, *session_key ); + } + else { + session_manager = 0; + } +#endif + +} + + +/***************************************************************************** + Functions returning the active popup and modal widgets. + *****************************************************************************/ + +/*! + Returns the active popup widget. + + A popup widget is a special top level widget that sets the \c + WType_Popup widget flag, e.g. the TQPopupMenu widget. When the + application opens a popup widget, all events are sent to the popup. + Normal widgets and modal widgets cannot be accessed before the popup + widget is closed. + + Only other popup widgets may be opened when a popup widget is shown. + The popup widgets are organized in a stack. This function returns + the active popup widget at the top of the stack. + + \sa activeModalWidget(), topLevelWidgets() +*/ + +TQWidget *TQApplication::activePopupWidget() +{ + return popupWidgets ? popupWidgets->getLast() : 0; +} + + +/*! + Returns the active modal widget. + + A modal widget is a special top level widget which is a subclass of + TQDialog that specifies the modal parameter of the constructor as + TRUE. A modal widget must be closed before the user can continue + with other parts of the program. + + Modal widgets are organized in a stack. This function returns + the active modal widget at the top of the stack. + + \sa activePopupWidget(), topLevelWidgets() +*/ + +TQWidget *TQApplication::activeModalWidget() +{ + return tqt_modal_stack ? tqt_modal_stack->getFirst() : 0; +} + +/*! + Cleans up any window system resources that were allocated by this + application. Sets the global variable \c tqApp to 0. +*/ + +TQApplication::~TQApplication() +{ +#ifndef TQT_NO_CLIPBOARD + // flush clipboard contents + if ( tqt_clipboard ) { + TQCustomEvent event( TQEvent::Clipboard ); + TQApplication::sendEvent( tqt_clipboard, &event ); + } +#endif + + if ( currentEventLoop() ) + currentEventLoop()->appClosingDown(); + if ( postRList ) { + TQVFuncList::Iterator it = postRList->begin(); + while ( it != postRList->end() ) { // call post routines + (**it)(); + postRList->remove( it ); + it = postRList->begin(); + } + delete postRList; + postRList = 0; + } + + TQObject *tipmanager = child( "toolTipManager", "TQTipManager", FALSE ); + delete tipmanager; + + delete tqt_desktopWidget; + tqt_desktopWidget = 0; + is_app_closing = TRUE; + + // Due to hacks to speed up TQStyle engine (see git hash 523c1fd99) TQObjects now contain a + // reference to TQStyleControlElementData object which among other contain TQFont members. + // But for a proper cleanup all fonts should be destroyed before disconnecting from X11 (in + // tqt_cleanup()). So we will have to cleanup up the data explicitly. + cleanupControlElementData(); + +#ifndef TQT_NO_CLIPBOARD + delete tqt_clipboard; + tqt_clipboard = 0; +#endif + TQWidget::destroyMapper(); +#ifndef TQT_NO_PALETTE + delete tqt_std_pal; + tqt_std_pal = 0; + delete app_pal; + app_pal = 0; + delete app_palettes; + app_palettes = 0; +#endif + delete app_font; + app_font = 0; + delete app_fonts; + app_fonts = 0; +#ifndef TQT_NO_STYLE + delete app_style; + app_style = 0; +#endif +#ifndef TQT_NO_CURSOR + delete app_cursor; + app_cursor = 0; +#endif +#ifndef TQT_NO_TRANSLATION + delete translators; +#endif + +#ifndef TQT_NO_DRAGANDDROP + extern TQDragManager *qt_dnd_manager; + delete qt_dnd_manager; +#endif + + tqt_cleanup(); + +#ifndef TQT_NO_COMPONENT + delete app_libpaths; + app_libpaths = 0; +#endif + +#ifdef TQT_THREAD_SUPPORT + delete tqt_mutex; + tqt_mutex = 0; +#endif // TQT_THREAD_SUPPORT + + if( tqApp == this ) { + if ( postedEvents ) + removePostedEvents( this ); + tqApp = 0; + } + is_app_running = FALSE; + + if ( widgetCount ) { + tqDebug( "Widgets left: %i Max widgets: %i \n", TQWidget::instanceCounter, TQWidget::maxInstances ); + } +#ifndef TQT_NO_SESSIONMANAGER + if ( session_manager ) { + delete session_manager; + } + session_manager = 0; + if ( session_key ) { + delete session_key; + } + session_key = 0; +#endif //TQT_NO_SESSIONMANAGER + +#ifdef TQT_THREAD_SUPPORT + delete tqt_sharedMetaObjectMutex; + tqt_sharedMetaObjectMutex = 0; + delete tqt_sharedStringMutex; + tqt_sharedStringMutex = 0; +#ifdef QT_USE_GLIBMAINLOOP + delete tqt_timerListMutex; + tqt_timerListMutex = 0; +#endif // QT_USE_GLIBMAINLOOP +#endif // TQT_THREAD_SUPPORT + + tqt_explicit_app_style = FALSE; + tqt_app_has_font = FALSE; + app_tracking = 0; + obey_desktop_settings = TRUE; + cursor_flash_time = 1000; + mouse_double_click_time = 400; +#ifndef TQT_NO_WHEELEVENT + wheel_scroll_lines = 3; +#endif + drag_time = 500; + drag_distance = 4; + reverse_layout = FALSE; + app_strut = TQSize( 0, 0 ); + animate_ui = TRUE; + animate_menu = FALSE; + fade_menu = FALSE; + animate_combo = FALSE; + animate_tooltip = FALSE; + fade_tooltip = FALSE; + widgetCount = FALSE; +} + + +/*! + \fn int TQApplication::argc() const + + Returns the number of command line arguments. + + The documentation for argv() describes how to process command line + arguments. + + \sa argv(), TQApplication::TQApplication() +*/ + +/*! + \fn char **TQApplication::argv() const + + Returns the command line argument vector. + + \c argv()[0] is the program name, \c argv()[1] is the first + argument and \c argv()[argc()-1] is the last argument. + + A TQApplication object is constructed by passing \e argc and \e + argv from the \c main() function. Some of the arguments may be + recognized as TQt options and removed from the argument vector. For + example, the X11 version of TQt knows about \c -display, \c -font + and a few more options. + + Example: + \code + // showargs.cpp - displays program arguments in a list box + + #include + #include + + int main( int argc, char **argv ) + { + TQApplication a( argc, argv ); + TQListBox b; + a.setMainWidget( &b ); + for ( int i = 0; i < a.argc(); i++ ) // a.argc() == argc + b.insertItem( a.argv()[i] ); // a.argv()[i] == argv[i] + b.show(); + return a.exec(); + } + \endcode + + If you run \c{showargs -display unix:0 -font 9x15bold hello world} + under X11, the list box contains the three strings "showargs", + "hello" and "world". + + TQt provides a global pointer, \c tqApp, that points to the + TQApplication object, and through which you can access argc() and + argv() in functions other than main(). + + \sa argc(), TQApplication::TQApplication() +*/ + +/*! + \fn void TQApplication::setArgs( int argc, char **argv ) + \internal +*/ + + +#ifndef TQT_NO_STYLE + +static TQString *qt_style_override = 0; + +/*! + Returns the application's style object. + + \sa setStyle(), TQStyle +*/ +TQStyle& TQApplication::style() +{ +#ifndef TQT_NO_STYLE + if ( app_style ) + return *app_style; + if ( !tqt_is_gui_used ) + tqFatal( "No style available in non-gui applications!" ); + +#if defined(TQ_WS_X11) + if(!qt_style_override) + x11_initialize_style(); // run-time search for default style +#endif + if ( !app_style ) { + // Compile-time search for default style + // + TQString style; + if ( qt_style_override ) { + style = *qt_style_override; + delete qt_style_override; + qt_style_override = 0; + } else { +# if defined(TQ_WS_WIN) && defined(Q_OS_TEMP) + style = "PocketPC"; +#elif defined(TQ_WS_WIN) + if ( qWinVersion() >= TQt::WV_XP && qWinVersion() < TQt::WV_NT_based ) + style = "WindowsXP"; + else + style = "Windows"; // default styles for Windows +#elif defined(TQ_WS_X11) && defined(Q_OS_SOLARIS) + style = "CDE"; // default style for X11 on Solaris +#elif defined(TQ_WS_X11) && defined(Q_OS_IRIX) + style = "SGI"; // default style for X11 on IRIX +#elif defined(TQ_WS_X11) + style = "Motif"; // default style for X11 +#elif defined(TQ_WS_MAC) + style = "Macintosh"; // default style for all Mac's +#endif + } + app_style = TQStyleFactory::create( style ); + if ( !app_style && // platform default style not available, try alternatives + !(app_style = TQStyleFactory::create( "Windows" ) ) && + !(app_style = TQStyleFactory::create( "Platinum" ) ) && + !(app_style = TQStyleFactory::create( "MotifPlus" ) ) && + !(app_style = TQStyleFactory::create( "Motif" ) ) && + !(app_style = TQStyleFactory::create( "CDE" ) ) && + !(app_style = TQStyleFactory::create( "Aqua" ) ) && + !(app_style = TQStyleFactory::create( "SGI" ) ) && + !(app_style = TQStyleFactory::create( "Compact" ) ) +#ifndef TQT_NO_STRINGLIST + && !(app_style = TQStyleFactory::create( TQStyleFactory::keys()[0] ) ) +#endif + ) + tqFatal( "No %s style available!", style.latin1() ); + } + + TQPalette app_pal_copy ( *app_pal ); + app_style->polish( *app_pal ); + + if ( is_app_running && !is_app_closing && (*app_pal != app_pal_copy) ) { + TQEvent e( TQEvent::ApplicationPaletteChange ); + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // for all widgets... + ++it; + sendEvent( w, &e ); + } + } + + app_style->polish( tqApp ); +#endif + return *app_style; +} + +/*! + Sets the application's GUI style to \a style. Ownership of the style + object is transferred to TQApplication, so TQApplication will delete + the style object on application exit or when a new style is set. + + Example usage: + \code + TQApplication::setStyle( new TQWindowsStyle ); + \endcode + + When switching application styles, the color palette is set back to + the initial colors or the system defaults. This is necessary since + certain styles have to adapt the color palette to be fully + style-guide compliant. + + \sa style(), TQStyle, setPalette(), desktopSettingsAware() +*/ +void TQApplication::setStyle( TQStyle *style ) +{ + TQStyle* old = app_style; + app_style = style; +#ifdef TQ_WS_X11 + tqt_explicit_app_style = TRUE; +#endif // TQ_WS_X11 + + if ( startingUp() ) { + delete old; + return; + } + + // clean up the old style + if (old) { + if ( is_app_running && !is_app_closing ) { + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // for all widgets... + ++it; + if ( !w->testWFlags(WType_Desktop) && // except desktop + w->testWState(WState_Polished) ) { // has been polished + old->unPolish(w); + } + } + } + old->unPolish( tqApp ); + } + + // take care of possible palette requirements of certain gui + // styles. Do it before polishing the application since the style + // might call TQApplication::setStyle() itself + if ( !tqt_std_pal ) + tqt_create_std_palette(); + TQPalette tmpPal = *tqt_std_pal; + setPalette( tmpPal, TRUE ); + + // initialize the application with the new style + app_style->polish( tqApp ); + + // re-polish existing widgets if necessary + if (old) { + if ( is_app_running && !is_app_closing ) { + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // for all widgets... + ++it; + if ( !w->testWFlags(WType_Desktop) ) { // except desktop + if ( w->testWState(WState_Polished) ) + app_style->polish(w); // repolish + w->styleChange( *old ); + if ( w->isVisible() ){ + w->update(); + } + } + } + } + delete old; + } +} + +/*! + \overload + + Requests a TQStyle object for \a style from the TQStyleFactory. + + The string must be one of the TQStyleFactory::keys(), typically one + of "windows", "motif", "cde", "motifplus", "platinum", "sgi" and + "compact". Depending on the platform, "windowsxp", "aqua" or + "macintosh" may be available. + + A later call to the TQApplication constructor will override the + requested style when a "-style" option is passed in as a commandline + parameter. + + Returns 0 if an unknown \a style is passed, otherwise the TQStyle object + returned is set as the application's GUI style. +*/ +TQStyle* TQApplication::setStyle( const TQString& style ) +{ +#ifdef TQ_WS_X11 + tqt_explicit_app_style = TRUE; +#endif // TQ_WS_X11 + + if ( startingUp() ) { + if(qt_style_override) + *qt_style_override = style; + else + qt_style_override = new TQString(style); + return 0; + } + TQStyle *s = TQStyleFactory::create( style ); + if ( !s ) + return 0; + + setStyle( s ); + return s; +} + +#endif + + +#if 1 /* OBSOLETE */ + +TQApplication::ColorMode TQApplication::colorMode() +{ + return (TQApplication::ColorMode)app_cspec; +} + +void TQApplication::setColorMode( TQApplication::ColorMode mode ) +{ + app_cspec = mode; +} +#endif + + +/*! + Returns the color specification. + \sa TQApplication::setColorSpec() + */ + +int TQApplication::colorSpec() +{ + return app_cspec; +} + +/*! + Sets the color specification for the application to \a spec. + + The color specification controls how the application allocates colors + when run on a display with a limited amount of colors, e.g. 8 bit / 256 + color displays. + + The color specification must be set before you create the TQApplication + object. + + The options are: + \list + \i TQApplication::NormalColor. + This is the default color allocation strategy. Use this option if + your application uses buttons, menus, texts and pixmaps with few + colors. With this option, the application uses system global + colors. This works fine for most applications under X11, but on + Windows machines it may cause dithering of non-standard colors. + \i TQApplication::CustomColor. + Use this option if your application needs a small number of custom + colors. On X11, this option is the same as NormalColor. On Windows, TQt + creates a Windows palette, and allocates colors to it on demand. + \i TQApplication::ManyColor. + Use this option if your application is very color hungry + (e.g. it requires thousands of colors). + Under X11 the effect is: + \list + \i For 256-color displays which have at best a 256 color true color + visual, the default visual is used, and colors are allocated + from a color cube. The color cube is the 6x6x6 (216 color) "Web + palette"*, but the number of colors can be changed + by the \e -ncols option. The user can force the application to + use the true color visual with the \link + TQApplication::TQApplication() -visual \endlink option. + \i For 256-color displays which have a true color visual with more + than 256 colors, use that visual. Silicon Graphics X servers + have this feature, for example. They provide an 8 bit visual + by default but can deliver true color when asked. + \endlist + On Windows, TQt creates a Windows palette, and fills it with a color cube. + \endlist + + Be aware that the CustomColor and ManyColor choices may lead to colormap + flashing: The foreground application gets (most) of the available + colors, while the background windows will look less attractive. + + Example: + \code + int main( int argc, char **argv ) + { + TQApplication::setColorSpec( TQApplication::ManyColor ); + TQApplication a( argc, argv ); + ... + } + \endcode + + TQColor provides more functionality for controlling color allocation and + freeing up certain colors. See TQColor::enterAllocContext() for more + information. + + To check what mode you end up with, call TQColor::numBitPlanes() once + the TQApplication object exists. A value greater than 8 (typically + 16, 24 or 32) means true color. + + * The color cube used by TQt has 216 colors whose red, + green, and blue components always have one of the following values: + 0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF. + + \sa colorSpec(), TQColor::numBitPlanes(), TQColor::enterAllocContext() */ + +void TQApplication::setColorSpec( int spec ) +{ +#if defined(QT_CHECK_STATE) + if ( tqApp ) { + tqWarning( "TQApplication::setColorSpec: This function must be " + "called before the TQApplication object is created" ); + } +#endif + app_cspec = spec; +} + +/*! + \fn TQSize TQApplication::globalStrut() + + Returns the application's global strut. + + The strut is a size object whose dimensions are the minimum that any + GUI element that the user can interact with should have. For example + no button should be resized to be smaller than the global strut size. + + \sa setGlobalStrut() +*/ + +/*! + Sets the application's global strut to \a strut. + + The strut is a size object whose dimensions are the minimum that any + GUI element that the user can interact with should have. For example + no button should be resized to be smaller than the global strut size. + + The strut size should be considered when reimplementing GUI controls + that may be used on touch-screens or similar IO-devices. + + Example: + \code + TQSize& WidgetClass::sizeHint() const + { + return TQSize( 80, 25 ).expandedTo( TQApplication::globalStrut() ); + } + \endcode + + \sa globalStrut() +*/ + +void TQApplication::setGlobalStrut( const TQSize& strut ) +{ + app_strut = strut; +} + +#if defined( TQ_WS_WIN ) || defined( TQ_WS_MAC ) +extern const char *tqAppFileName(); +#endif + +#ifndef TQT_NO_DIR +#ifndef TQ_WS_WIN +static TQString resolveSymlinks( const TQString& path, int depth = 0 ) +{ + bool foundLink = FALSE; + TQString linkTarget; + TQString part = path; + int slashPos = path.length(); + + // too deep; we give up + if ( depth == 128 ) + return TQString::null; + + do { + part = part.left( slashPos ); + TQFileInfo fileInfo( part ); + if ( fileInfo.isSymLink() ) { + foundLink = TRUE; + linkTarget = fileInfo.readLink(); + break; + } + } while ( (slashPos = part.findRev('/')) != -1 ); + + if ( foundLink ) { + TQString path2; + if ( linkTarget[0] == '/' ) { + path2 = linkTarget; + if ( slashPos < (int) path.length() ) + path2 += "/" + path.right( path.length() - slashPos - 1 ); + } else { + TQString relPath; + relPath = part.left( part.findRev('/') + 1 ) + linkTarget; + if ( slashPos < (int) path.length() ) { + if ( !linkTarget.endsWith( "/" ) ) + relPath += "/"; + relPath += path.right( path.length() - slashPos - 1 ); + } + path2 = TQDir::current().absFilePath( relPath ); + } + path2 = TQDir::cleanDirPath( path2 ); + return resolveSymlinks( path2, depth + 1 ); + } else { + return path; + } +} +#endif // TQ_WS_WIN + +/*! + Returns the directory that contains the application executable. + + For example, if you have installed TQt in the \c{C:\Trolltech\TQt} + directory, and you run the \c{demo} example, this function will + return "C:/Trolltech/TQt/examples/demo". + + On Mac OS X this will point to the directory actually containing the + executable, which may be inside of an application bundle (if the + application is bundled). + + \warning On Unix, this function assumes that argv[0] contains the file + name of the executable (which it normally does). It also assumes that + the current directory hasn't been changed by the application. + + \sa applicationFilePath() +*/ +TQString TQApplication::applicationDirPath() +{ + return TQFileInfo( applicationFilePath() ).dirPath(); +} + +/*! + Returns the file path of the application executable. + + For example, if you have installed TQt in the \c{C:\Trolltech\TQt} + directory, and you run the \c{demo} example, this function will + return "C:/Trolltech/TQt/examples/demo/demo.exe". + + \warning On Unix, this function assumes that argv[0] contains the file + name of the executable (which it normally does). It also assumes that + the current directory hasn't been changed by the application. + + \sa applicationDirPath() +*/ +TQString TQApplication::applicationFilePath() +{ +#if defined( TQ_WS_WIN ) + TQFileInfo filePath; + QT_WA({ + WCHAR module_name[256]; + GetModuleFileNameW(0, module_name, sizeof(module_name)); + filePath = TQString::fromUcs2((const unsigned short *)module_name); + }, { + char module_name[256]; + GetModuleFileNameA(0, module_name, sizeof(module_name)); + filePath = TQString::fromLocal8Bit(module_name); + }); + + return filePath.filePath(); +#elif defined( TQ_WS_MAC ) + return TQDir::cleanDirPath( TQFile::decodeName( tqAppFileName() ) ); +#else + TQString argv0 = TQFile::decodeName( argv()[0] ); + TQString absPath; + + if ( argv0[0] == '/' ) { + /* + If argv0 starts with a slash, it is already an absolute + file path. + */ + absPath = argv0; + } else if ( argv0.find('/') != -1 ) { + /* + If argv0 contains one or more slashes, it is a file path + relative to the current directory. + */ + absPath = TQDir::current().absFilePath( argv0 ); + } else { + /* + Otherwise, the file path has to be determined using the + PATH environment variable. + */ + char *pEnv = getenv( "PATH" ); + TQStringList paths( TQStringList::split(TQChar(':'), pEnv) ); + TQStringList::const_iterator p = paths.begin(); + while ( p != paths.end() ) { + TQString candidate = TQDir::current().absFilePath( *p + "/" + argv0 ); + if ( TQFile::exists(candidate) ) { + absPath = candidate; + break; + } + ++p; + } + } + + absPath = TQDir::cleanDirPath( absPath ); + if ( TQFile::exists(absPath) ) { + return resolveSymlinks( absPath ); + } else { + return TQString::null; + } +#endif +} +#endif // TQT_NO_DIR + +#ifndef TQT_NO_COMPONENT + +/*! + Returns a list of paths that the application will search when + dynamically loading libraries. + The installation directory for plugins is the only entry if no + paths have been set. The default installation directory for plugins + is \c INSTALL/plugins, where \c INSTALL is the directory where TQt was + installed. The directory of the application executable (NOT the + working directory) is also added to the plugin paths. + + If you want to iterate over the list, you should iterate over a + copy, e.g. + \code + TQStringList list = app.libraryPaths(); + TQStringList::Iterator it = list.begin(); + while( it != list.end() ) { + myProcessing( *it ); + ++it; + } + \endcode + + See the \link plugins-howto.html plugins documentation\endlink for a + description of how the library paths are used. + + \sa setLibraryPaths(), addLibraryPath(), removeLibraryPath(), TQLibrary +*/ +TQStringList TQApplication::libraryPaths() +{ + if ( !app_libpaths ) { + app_libpaths = new TQStringList; + TQString installPathPlugins = TQString::fromLocal8Bit(tqInstallPathPlugins()); + if ( TQFile::exists(installPathPlugins) ) { +#ifdef TQ_WS_WIN + installPathPlugins.replace('\\', '/'); +#endif + app_libpaths->append(installPathPlugins); + } + + TQString app_location; + if (tqApp) + app_location = tqApp->applicationFilePath(); +#ifdef TQ_WS_WIN + else { + app_location = TQString(tqAppFileName()); + app_location.replace('\\', '/'); + } +#endif + if (!app_location.isEmpty()) { + app_location.truncate( app_location.findRev( '/' ) ); + if ( app_location != tqInstallPathPlugins() && TQFile::exists( app_location ) ) + app_libpaths->append( app_location ); + } + } + return *app_libpaths; +} + + +/*! + Sets the list of directories to search when loading libraries to \a paths. + All existing paths will be deleted and the path list will consist of the + paths given in \a paths. + + \sa libraryPaths(), addLibraryPath(), removeLibraryPath(), TQLibrary + */ +void TQApplication::setLibraryPaths( const TQStringList &paths ) +{ + delete app_libpaths; + app_libpaths = new TQStringList( paths ); +} + +/*! + Append \a path to the end of the library path list. If \a path is + empty or already in the path list, the path list is not changed. + + The default path list consists of a single entry, the installation + directory for plugins. The default installation directory for plugins + is \c INSTALL/plugins, where \c INSTALL is the directory where TQt was + installed. + + \sa removeLibraryPath(), libraryPaths(), setLibraryPaths() + */ +void TQApplication::addLibraryPath( const TQString &path ) +{ + if ( path.isEmpty() ) + return; + + // make sure that library paths is initialized + libraryPaths(); + + if ( !app_libpaths->contains( path ) ) + app_libpaths->prepend( path ); +} + +/*! + Removes \a path from the library path list. If \a path is empty or not + in the path list, the list is not changed. + + \sa addLibraryPath(), libraryPaths(), setLibraryPaths() +*/ +void TQApplication::removeLibraryPath( const TQString &path ) +{ + if ( path.isEmpty() ) + return; + + // make sure that library paths is initialized + libraryPaths(); + + if ( app_libpaths->contains( path ) ) + app_libpaths->remove( path ); +} +#endif //TQT_NO_COMPONENT + +/*! + Returns the application palette. + + If a widget is passed in \a w, the default palette for the + widget's class is returned. This may or may not be the application + palette. In most cases there isn't a special palette for certain + types of widgets, but one notable exception is the popup menu under + Windows, if the user has defined a special background color for + menus in the display settings. + + \sa setPalette(), TQWidget::palette() +*/ +#ifndef TQT_NO_PALETTE +TQPalette TQApplication::palette(const TQWidget* w) +{ +#if defined(QT_CHECK_STATE) + if ( !tqApp ) + tqWarning( "TQApplication::palette: This function can only be " + "called after the TQApplication object has been created" ); +#endif + if ( !app_pal ) { + if ( !tqt_std_pal ) + tqt_create_std_palette(); + app_pal = new TQPalette( *tqt_std_pal ); + tqt_fix_tooltips(); + } + + if ( w && app_palettes ) { + TQPalette* wp = app_palettes->find( w->className() ); + if ( wp ) + return *wp; + TQAsciiDictIterator it( *app_palettes ); + const char* name; + while ( (name=it.currentKey()) != 0 ) { + if ( w->inherits( name ) ) + return *it.current(); + ++it; + } + } + return *app_pal; +} + +TQPalette TQApplication::palette(TQStringList objectTypeList) +{ +#if defined(QT_CHECK_STATE) + if ( !tqApp ) + tqWarning( "TQApplication::palette: This function can only be " + "called after the TQApplication object has been created" ); +#endif + if ( !app_pal ) { + if ( !tqt_std_pal ) + tqt_create_std_palette(); + app_pal = new TQPalette( *tqt_std_pal ); + tqt_fix_tooltips(); + } + + if ( (objectTypeList.count() > 0) && app_palettes ) { + TQPalette* wp = app_palettes->find( objectTypeList[objectTypeList.count()-1] ); + if ( wp ) { + return *wp; + } + TQAsciiDictIterator it( *app_palettes ); + const char* name; + while ( (name=it.currentKey()) != 0 ) { + if ( objectTypeList.contains(name) ) { + return *it.current(); + } + ++it; + } + } + return *app_pal; +} + +/*! + Changes the default application palette to \a palette. If \a + informWidgets is TRUE, then existing widgets are informed about the + change and may adjust themselves to the new application + setting. If \a informWidgets is FALSE, the change only affects newly + created widgets. + + If \a className is passed, the change applies only to widgets that + inherit \a className (as reported by TQObject::inherits()). If + \a className is left 0, the change affects all widgets, thus overriding + any previously set class specific palettes. + + The palette may be changed according to the current GUI style in + TQStyle::polish(). + + \sa TQWidget::setPalette(), palette(), TQStyle::polish() +*/ + +void TQApplication::setPalette( const TQPalette &palette, bool informWidgets, + const char* className ) +{ + TQPalette pal = palette; + TQPalette *oldpal = 0; +#ifndef TQT_NO_STYLE + if ( !startingUp() ) // on startup this has been done already + tqApp->style().polish( pal ); // NB: non-const reference +#endif + bool all = FALSE; + if ( !className ) { + if ( !app_pal ) { + app_pal = new TQPalette( pal ); + TQ_CHECK_PTR( app_pal ); + } else { + *app_pal = pal; + } + all = app_palettes != 0; + delete app_palettes; + app_palettes = 0; + tqt_fix_tooltips(); + } else { + if ( !app_palettes ) { + app_palettes = new TQAsciiDict; + TQ_CHECK_PTR( app_palettes ); + app_palettes->setAutoDelete( TRUE ); + } + oldpal = app_palettes->find( className ); + app_palettes->insert( className, new TQPalette( pal ) ); + } + if ( informWidgets && is_app_running && !is_app_closing ) { + if ( !oldpal || ( *oldpal != pal ) ) { + TQEvent e( TQEvent::ApplicationPaletteChange ); + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // for all widgets... + ++it; + if ( all || (!className && w->isTopLevel() ) || w->inherits(className) ) // matching class + sendEvent( w, &e ); + } + } + } +} + +#endif // TQT_NO_PALETTE + +/*! + Returns the default font for the widget \a w, or the default + application font if \a w is 0. + + \sa setFont(), fontMetrics(), TQWidget::font() +*/ + +TQFont TQApplication::font( const TQWidget *w ) +{ + if ( w && app_fonts ) { + TQFont* wf = app_fonts->find( w->className() ); + if ( wf ) + return *wf; + TQAsciiDictIterator it( *app_fonts ); + const char* name; + while ( (name=it.currentKey()) != 0 ) { + if ( w->inherits( name ) ) + return *it.current(); + ++it; + } + } + if ( !app_font ) { + app_font = new TQFont( "Helvetica" ); + TQ_CHECK_PTR( app_font ); + } + return *app_font; +} + +/*! Changes the default application font to \a font. If \a + informWidgets is TRUE, then existing widgets are informed about the + change and may adjust themselves to the new application + setting. If \a informWidgets is FALSE, the change only affects newly + created widgets. If \a className is passed, the change applies only + to classes that inherit \a className (as reported by + TQObject::inherits()). + + On application start-up, the default font depends on the window + system. It can vary depending on both the window system version and + the locale. This function lets you override the default font; but + overriding may be a bad idea because, for example, some locales need + extra-large fonts to support their special characters. + + \sa font(), fontMetrics(), TQWidget::setFont() +*/ + +void TQApplication::setFont( const TQFont &font, bool informWidgets, + const char* className ) +{ + bool all = FALSE; + if ( !className ) { + tqt_app_has_font = TRUE; + if ( !app_font ) { + app_font = new TQFont( font ); + TQ_CHECK_PTR( app_font ); + } else { + *app_font = font; + } + + // make sure the application font is complete + app_font->detach(); + app_font->d->mask = TQFontPrivate::Complete; + + all = app_fonts != 0; + delete app_fonts; + app_fonts = 0; + } else { + if (!app_fonts){ + app_fonts = new TQAsciiDict; + TQ_CHECK_PTR( app_fonts ); + app_fonts->setAutoDelete( TRUE ); + } + TQFont* fnt = new TQFont(font); + TQ_CHECK_PTR( fnt ); + app_fonts->insert(className, fnt); + } + if ( informWidgets && is_app_running && !is_app_closing ) { + TQEvent e( TQEvent::ApplicationFontChange ); + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // for all widgets... + ++it; + if ( all || (!className && w->isTopLevel() ) || w->inherits(className) ) // matching class + sendEvent( w, &e ); + } + } +} + + +/*! + Initialization of the appearance of the widget \a w \e before it is first + shown. + + Usually widgets call this automatically when they are polished. It + may be used to do some style-based central customization of widgets. + + Note that you are not limited to the public functions of TQWidget. + Instead, based on meta information like TQObject::className() you are + able to customize any kind of widget. + + \sa TQStyle::polish(), TQWidget::polish(), setPalette(), setFont() +*/ + +void TQApplication::polish( TQWidget *w ) +{ +#ifndef TQT_NO_STYLE + w->style().polish( w ); +#endif +} + + +/*! + Returns a list of the top level widgets in the application. + + The list is created using \c new and must be deleted by the caller. + + The list is empty (TQPtrList::isEmpty()) if there are no top level + widgets. + + Note that some of the top level widgets may be hidden, for example + the tooltip if no tooltip is currently shown. + + Example: + \code + // Show all hidden top level widgets. + TQWidgetList *list = TQApplication::topLevelWidgets(); + TQWidgetListIt it( *list ); // iterate over the widgets + TQWidget * w; + while ( (w=it.current()) != 0 ) { // for each top level widget... + ++it; + if ( !w->isVisible() ) + w->show(); + } + delete list; // delete the list, not the widgets + \endcode + + \warning Delete the list as soon you have finished using it. + The widgets in the list may be deleted by someone else at any time. + + \sa allWidgets(), TQWidget::isTopLevel(), TQWidget::isVisible(), + TQPtrList::isEmpty() +*/ + +TQWidgetList *TQApplication::topLevelWidgets() +{ + return TQWidget::tlwList(); +} + +/*! + Returns a list of all the widgets in the application. + + The list is created using \c new and must be deleted by the caller. + + The list is empty (TQPtrList::isEmpty()) if there are no widgets. + + Note that some of the widgets may be hidden. + + Example that updates all widgets: + \code + TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetListIt it( *list ); // iterate over the widgets + TQWidget * w; + while ( (w=it.current()) != 0 ) { // for each widget... + ++it; + w->update(); + } + delete list; // delete the list, not the widgets + \endcode + + The TQWidgetList class is defined in the \c tqwidgetlist.h header + file. + + \warning Delete the list as soon as you have finished using it. + The widgets in the list may be deleted by someone else at any time. + + \sa topLevelWidgets(), TQWidget::isVisible(), TQPtrList::isEmpty(), +*/ + +TQWidgetList *TQApplication::allWidgets() +{ + return TQWidget::wList(); +} + +/*! + \fn TQWidget *TQApplication::focusWidget() const + + Returns the application widget that has the keyboard input focus, or + 0 if no widget in this application has the focus. + + \sa TQWidget::setFocus(), TQWidget::hasFocus(), activeWindow() +*/ + +/*! + \fn TQWidget *TQApplication::activeWindow() const + + Returns the application top-level window that has the keyboard input + focus, or 0 if no application window has the focus. Note that + there might be an activeWindow() even if there is no focusWidget(), + for example if no widget in that window accepts key events. + + \sa TQWidget::setFocus(), TQWidget::hasFocus(), focusWidget() +*/ + +/*! + Returns display (screen) font metrics for the application font. + + \sa font(), setFont(), TQWidget::fontMetrics(), TQPainter::fontMetrics() +*/ + +TQFontMetrics TQApplication::fontMetrics() +{ + return desktop()->fontMetrics(); +} + + + +/*! + Tells the application to exit with return code 0 (success). + Equivalent to calling TQApplication::exit( 0 ). + + It's common to connect the lastWindowClosed() signal to quit(), and + you also often connect e.g. TQButton::clicked() or signals in + TQAction, TQPopupMenu or TQMenuBar to it. + + Example: + \code + TQPushButton *quitButton = new TQPushButton( "Quit" ); + connect( quitButton, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); + \endcode + + \sa exit() aboutToQuit() lastWindowClosed() TQAction +*/ + +void TQApplication::quit() +{ + TQApplication::exit( 0 ); +} + + +/*! + Closes all top-level windows. + + This function is particularly useful for applications with many + top-level windows. It could, for example, be connected to a "Quit" + entry in the file menu as shown in the following code example: + + \code + // the "Quit" menu entry should try to close all windows + TQPopupMenu* file = new TQPopupMenu( this ); + file->insertItem( "&Quit", tqApp, TQ_SLOT(closeAllWindows()), CTRL+Key_Q ); + + // when the last window is closed, the application should quit + connect( tqApp, TQ_SIGNAL( lastWindowClosed() ), tqApp, TQ_SLOT( quit() ) ); + \endcode + + The windows are closed in random order, until one window does not + accept the close event. + + \sa TQWidget::close(), TQWidget::closeEvent(), lastWindowClosed(), + quit(), topLevelWidgets(), TQWidget::isTopLevel() + + */ +void TQApplication::closeAllWindows() +{ + bool did_close = TRUE; + TQWidget *w; + while((w = activeModalWidget()) && did_close) { + if(w->isHidden()) + break; + did_close = w->close(); + } + TQWidgetList *list = TQApplication::topLevelWidgets(); + for ( w = list->first(); did_close && w; ) { + if ( !w->isHidden() ) { + did_close = w->close(); + delete list; + list = TQApplication::topLevelWidgets(); + w = list->first(); + } else { + w = list->next(); + } + } + delete list; +} + +/*! + Displays a simple message box about TQt. The message includes the + version number of TQt being used by the application. + + This is useful for inclusion in the Help menu of an application. + See the examples/menu/menu.cpp example. + + This function is a convenience slot for TQMessageBox::aboutTQt(). +*/ +void TQApplication::aboutTQt() +{ +#ifndef TQT_NO_MESSAGEBOX + TQMessageBox::aboutTQt( mainWidget() ); +#endif // TQT_NO_MESSAGEBOX +} + + +/*! + \fn void TQApplication::lastWindowClosed() + + This signal is emitted when the user has closed the last + top level window. + + The signal is very useful when your application has many top level + widgets but no main widget. You can then connect it to the quit() + slot. + + For convenience, this signal is \e not emitted for transient top level + widgets such as popup menus and dialogs. + + \sa mainWidget(), topLevelWidgets(), TQWidget::isTopLevel(), TQWidget::close() +*/ + +/*! + \fn void TQApplication::aboutToQuit() + + This signal is emitted when the application is about to quit the + main event loop, e.g. when the event loop level drops to zero. + This may happen either after a call to quit() from inside the + application or when the users shuts down the entire desktop session. + + The signal is particularly useful if your application has to do some + last-second cleanup. Note that no user interaction is possible in + this state. + + \sa quit() +*/ + + +/*! + \fn void TQApplication::guiThreadAwake() + + This signal is emitted after the event loop returns from a function + that could block. + + \sa wakeUpGuiThread() +*/ + + +/*! + \fn bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event ) + + Sends event \a event directly to receiver \a receiver, using the + notify() function. Returns the value that was returned from the event + handler. + + The event is \e not deleted when the event has been sent. The normal + approach is to create the event on the stack, e.g. + \code + TQMouseEvent me( TQEvent::MouseButtonPress, pos, 0, 0 ); + TQApplication::sendEvent( mainWindow, &me ); + \endcode + If you create the event on the heap you must delete it. + + \sa postEvent(), notify() +*/ + +bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event ) { + if ( event ) event->spont = FALSE; + return tqApp ? tqApp->notify( receiver, event ) : FALSE; +} + +bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event ) { + if ( event ) event->spont = TRUE; + return tqApp ? tqApp->notify( receiver, event ) : FALSE; +} + +/*! + Sends event \a e to \a receiver: \a {receiver}->event(\a e). + Returns the value that is returned from the receiver's event handler. + + For certain types of events (e.g. mouse and key events), + the event will be propagated to the receiver's parent and so on up to + the top-level object if the receiver is not interested in the event + (i.e., it returns FALSE). + + There are five different ways that events can be processed; + reimplementing this virtual function is just one of them. All five + approaches are listed below: + \list 1 + \i Reimplementing this function. This is very powerful, providing + complete control; but only one subclass can be tqApp. + + \i Installing an event filter on tqApp. Such an event filter is able + to process all events for all widgets, so it's just as powerful as + reimplementing notify(); furthermore, it's possible to have more + than one application-global event filter. Global event filters even + see mouse events for \link TQWidget::isEnabled() disabled + widgets, \endlink and if \link setGlobalMouseTracking() global mouse + tracking \endlink is enabled, as well as mouse move events for all + widgets. + + \i Reimplementing TQObject::event() (as TQWidget does). If you do + this you get Tab key presses, and you get to see the events before + any widget-specific event filters. + + \i Installing an event filter on the object. Such an event filter + gets all the events except Tab and Shift-Tab key presses. + + \i Reimplementing paintEvent(), mousePressEvent() and so + on. This is the commonest, easiest and least powerful way. + \endlist + + \sa TQObject::event(), installEventFilter() +*/ + +bool TQApplication::notify( TQObject *receiver, TQEvent *e ) +{ + // no events are delivered after ~TQApplication() has started + if ( is_app_closing ) { + return FALSE; + } + + if ( receiver == 0 ) { // serious error +#if defined(QT_CHECK_NULL) + tqWarning( "TQApplication::notify: Unexpected null receiver" ); +#endif + return FALSE; + } + + if ( receiver && (e->type() == TQEvent::Destroy) ) { + return TRUE; + } + + if ( e->type() == TQEvent::ChildRemoved && receiver->postedEvents) { +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker locker( GlobalPostedEvents()->mutex() ); +#endif // TQT_THREAD_SUPPORT + + // the TQObject destructor calls TQObject::removeChild, which calls + // TQApplication::sendEvent() directly. this can happen while the event + // loop is in the middle of posting events, and when we get here, we may + // not have any more posted events for this object. + if ( receiver->postedEvents ) { + // if this is a child remove event and the child insert + // hasn't been dispatched yet, kill that insert + TQPostEventList * l = receiver->postedEvents; + TQObject * c = ((TQChildEvent*)e)->child(); + TQPostEvent * pe; + l->first(); + while( ( pe = l->current()) != 0 ) { + if ( pe->event && pe->receiver == receiver && + pe->event->type() == TQEvent::ChildInserted && + ((TQChildEvent*)pe->event)->child() == c ) { + pe->event->posted = FALSE; + delete pe->event; + pe->event = 0; + l->remove(); + continue; + } + l->next(); + } + } + } + + bool res = FALSE; + if ( !receiver->isWidgetType() ) { + res = internalNotify( receiver, e ); + } + else switch ( e->type() ) { +#ifndef TQT_NO_ACCEL + case TQEvent::Accel: + { + TQKeyEvent* key = (TQKeyEvent*) e; + res = internalNotify( receiver, e ); + + if ( !res && !key->isAccepted() ) { + res = tqt_dispatchAccelEvent( (TQWidget*)receiver, key ); + } + + // next lines are for compatibility with TQt <= 3.0.x: old + // TQAccel was listening on toplevel widgets + if ( !res && !key->isAccepted() && !((TQWidget*)receiver)->isTopLevel() ) { + res = internalNotify( ((TQWidget*)receiver)->topLevelWidget(), e ); + } + } + break; +#endif //TQT_NO_ACCEL + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::AccelOverride: + { + TQWidget* w = (TQWidget*)receiver; + TQKeyEvent* key = (TQKeyEvent*) e; +#ifndef TQT_NO_ACCEL + if ( tqt_tryComposeUnicode( w, key ) ) + break; +#endif + bool def = key->isAccepted(); + while ( w ) { + if ( def ) + key->accept(); + else + key->ignore(); + res = internalNotify( w, e ); + if ( res || key->isAccepted() ) + break; + w = w->parentWidget( TRUE ); + } + } + break; + case TQEvent::MouseButtonPress: + if ( e->spontaneous() ) { + TQWidget* fw = (TQWidget*)receiver; + while ( fw->focusProxy() ) + fw = fw->focusProxy(); + if ( fw->isEnabled() && fw->focusPolicy() & TQWidget::ClickFocus ) { + TQFocusEvent::setReason( TQFocusEvent::Mouse); + fw->setFocus(); + TQFocusEvent::resetReason(); + } + } + // fall through intended + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseMove: + { + TQWidget* w = (TQWidget*)receiver; + TQMouseEvent* mouse = (TQMouseEvent*) e; + TQPoint relpos = mouse->pos(); + while ( w ) { + TQMouseEvent me(mouse->type(), relpos, mouse->globalPos(), mouse->button(), mouse->state()); + me.spont = mouse->spontaneous(); + res = internalNotify( w, w == receiver ? mouse : &me ); + e->spont = FALSE; + if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) + break; + + relpos += w->pos(); + w = w->parentWidget(); + } + if ( res ) + mouse->accept(); + else + mouse->ignore(); + } + break; +#ifndef TQT_NO_WHEELEVENT + case TQEvent::Wheel: + { + if ( e->spontaneous() ) { + TQWidget* fw = (TQWidget*)receiver; + while ( fw->focusProxy() ) + fw = fw->focusProxy(); + if ( fw->isEnabled() && (fw->focusPolicy() & TQWidget::WheelFocus) == TQWidget::WheelFocus ) { + TQFocusEvent::setReason( TQFocusEvent::Mouse); + fw->setFocus(); + TQFocusEvent::resetReason(); + } + } + + TQWidget* w = (TQWidget*)receiver; + TQWheelEvent* wheel = (TQWheelEvent*) e; + TQPoint relpos = wheel->pos(); + while ( w ) { + TQWheelEvent we(relpos, wheel->globalPos(), wheel->delta(), wheel->state(), wheel->orientation()); + we.spont = wheel->spontaneous(); + res = internalNotify( w, w == receiver ? wheel : &we ); + e->spont = FALSE; + if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) + break; + + relpos += w->pos(); + w = w->parentWidget(); + } + if ( res ) + wheel->accept(); + else + wheel->ignore(); + } + break; +#endif + case TQEvent::ContextMenu: + { + TQWidget* w = (TQWidget*)receiver; + TQContextMenuEvent *context = (TQContextMenuEvent*) e; + TQPoint relpos = context->pos(); + while ( w ) { + TQContextMenuEvent ce(context->reason(), relpos, context->globalPos(), context->state()); + ce.spont = e->spontaneous(); + res = internalNotify( w, w == receiver ? context : &ce ); + e->spont = FALSE; + + if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) + break; + + relpos += w->pos(); + w = w->parentWidget(); + } + if ( res ) + context->accept(); + else + context->ignore(); + } + break; +#if defined (QT_TABLET_SUPPORT) + case TQEvent::TabletMove: + case TQEvent::TabletPress: + case TQEvent::TabletRelease: + { + TQWidget *w = (TQWidget*)receiver; + TQTabletEvent *tablet = (TQTabletEvent*)e; + TQPoint relpos = tablet->pos(); + while ( w ) { + TQTabletEvent te(tablet->pos(), tablet->globalPos(), tablet->device(), + tablet->pressure(), tablet->xTilt(), tablet->yTilt(), + tablet->uniqueId()); + te.spont = e->spontaneous(); + res = internalNotify( w, w == receiver ? tablet : &te ); + e->spont = FALSE; + if (res || w->isTopLevel() || w->testWFlags(WNoMousePropagation)) + break; + + relpos += w->pos(); + w = w->parentWidget(); + } + if ( res ) + tablet->accept(); + else + tablet->ignore(); + chokeMouse = tablet->isAccepted(); + } + break; +#endif + default: + res = internalNotify( receiver, e ); + break; + } + + return res; +} + +/*!\reimp + +*/ +bool TQApplication::event( TQEvent *e ) +{ + if(e->type() == TQEvent::Close) { + TQCloseEvent *ce = (TQCloseEvent*)e; + ce->accept(); + closeAllWindows(); + + TQWidgetList *list = topLevelWidgets(); + for(TQWidget *w = list->first(); w; w = list->next()) { + if ( !w->isHidden() && !w->isDesktop() && !w->isPopup() && + (!w->isDialog() || !w->parentWidget())) { + ce->ignore(); + break; + } + } + if(ce->isAccepted()) + return TRUE; + } else if (e->type() == TQEvent::Quit) { + quit(); + return TRUE; + } + return TQObject::event(e); +} + +#define HOVER_SENSITIVE_WIDGET_SELECT if ( widget->inherits("TQPushButton") \ + || widget->inherits("TQComboBox") \ + || widget->inherits("TQSpinWidget") \ + || widget->inherits("TQCheckBox") \ + || widget->inherits("TQRadioButton") \ + || widget->inherits("TQToolButton") \ + || widget->inherits("TQSlider") \ + || widget->inherits("TQScrollBar") \ + || widget->inherits("TQTabBar") \ + || widget->inherits("TQDockWindowHandle") \ + || widget->inherits("TQSplitterHandle") ) + +#define FOCUS_SENSITIVE_WIDGET_SELECT if ( widget->inherits("TQLineEdit") ) +#define FOCUS_SENSITIVE_PARENT_WIDGET_SELECT if ( widget->parentWidget() && widget->parentWidget()->inherits("TQSpinWidget") ) + +/*!\internal + + Helper function called by notify() + */ +bool TQApplication::internalNotify( TQObject *receiver, TQEvent * e) +{ + if ( eventFilters ) { + TQObjectListIt it( *eventFilters ); + TQObject *obj; + while ( (obj=it.current()) != 0 ) { // send to all filters + ++it; // until one returns TRUE + if ( obj->eventFilter(receiver,e) ) + return TRUE; + } + } + + bool consumed = FALSE; + bool handled = FALSE; + if ( receiver->isWidgetType() ) { + TQWidget *widget = (TQWidget*)receiver; + + // toggle HasMouse widget state on enter and leave + if ( e->type() == TQEvent::Enter || e->type() == TQEvent::DragEnter ) { + widget->setWState( WState_HasMouse ); + HOVER_SENSITIVE_WIDGET_SELECT { + widget->repaint(false); + } + } + else if ( e->type() == TQEvent::Leave || e->type() == TQEvent::DragLeave ) { + widget->clearWState( WState_HasMouse ); + HOVER_SENSITIVE_WIDGET_SELECT { + widget->repaint(false); + } + } + + // repaint information entry widgets on focus set/unset + if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) { + FOCUS_SENSITIVE_WIDGET_SELECT { + widget->repaint(false); + } + FOCUS_SENSITIVE_PARENT_WIDGET_SELECT { + widget->parentWidget()->repaint(false); + } + } + + // throw away any mouse-tracking-only mouse events + if ( e->type() == TQEvent::MouseMove && + (((TQMouseEvent*)e)->state()&TQMouseEvent::MouseButtonMask) == 0 && + !widget->hasMouseTracking() ) { + handled = TRUE; + consumed = TRUE; + } else if ( !widget->isEnabled() ) { // throw away mouse events to disabled widgets + switch(e->type()) { + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseMove: + ( (TQMouseEvent*) e)->ignore(); + handled = TRUE; + consumed = TRUE; + break; +#ifndef TQT_NO_DRAGANDDROP + case TQEvent::DragEnter: + case TQEvent::DragMove: + ( (TQDragMoveEvent*) e)->ignore(); + handled = TRUE; + break; + + case TQEvent::DragLeave: + case TQEvent::DragResponse: + handled = TRUE; + break; + + case TQEvent::Drop: + ( (TQDropEvent*) e)->ignore(); + handled = TRUE; + break; +#endif +#ifndef TQT_NO_WHEELEVENT + case TQEvent::Wheel: + ( (TQWheelEvent*) e)->ignore(); + handled = TRUE; + break; +#endif + case TQEvent::ContextMenu: + ( (TQContextMenuEvent*) e)->ignore(); + handled = TRUE; + break; + default: + break; + } + } + + } + + if (!handled) { +#if defined(TQT_THREAD_SUPPORT) + int locklevel = 0; + int llcount; + if (TQApplication::tqt_mutex) { + TQApplication::tqt_mutex->lock(); // 1 of 2 + locklevel = tqt_mutex->level() - 1; + for (llcount=0; llcountunlock(); + } + TQApplication::tqt_mutex->unlock(); // 2 of 2 + } +#endif + consumed = receiver->event( e ); +#if defined(TQT_THREAD_SUPPORT) + if (TQApplication::tqt_mutex) { + for (llcount=0; llcountlock(); + } + } +#endif + } + e->spont = FALSE; + return consumed; +} + +/*! + Returns TRUE if an application object has not been created yet; + otherwise returns FALSE. + + \sa closingDown() +*/ + +bool TQApplication::startingUp() +{ + return !is_app_running; +} + +/*! + Returns TRUE if the application objects are being destroyed; + otherwise returns FALSE. + + \sa startingUp() +*/ + +bool TQApplication::closingDown() +{ + return is_app_closing; +} + + +/*! + Processes pending events, for 3 seconds or until there are no more + events to process, whichever is shorter. + + You can call this function occasionally when your program is busy + performing a long operation (e.g. copying a file). + + \sa exec(), TQTimer, TQEventLoop::processEvents() +*/ + +void TQApplication::processEvents() +{ + processEvents( 3000 ); +} + +/*! + \overload + + Processes pending events for \a maxtime milliseconds or until + there are no more events to process, whichever is shorter. + + You can call this function occasionally when you program is busy + doing a long operation (e.g. copying a file). + + \sa exec(), TQTimer, TQEventLoop::processEvents() +*/ +void TQApplication::processEvents( int maxtime ) +{ + eventLoop()->processEvents( TQEventLoop::AllEvents, maxtime ); +} + +/*! \obsolete + Waits for an event to occur, processes it, then returns. + + This function is useful for adapting TQt to situations where the + event processing must be grafted onto existing program loops. + + Using this function in new applications may be an indication of design + problems. + + \sa processEvents(), exec(), TQTimer +*/ + +void TQApplication::processOneEvent() +{ + eventLoop()->processEvents( TQEventLoop::AllEvents | + TQEventLoop::WaitForMore ); +} + +/***************************************************************************** + Main event loop wrappers + *****************************************************************************/ + +/*! + Returns the application event loop. This function will return + zero if called during and after destroying TQApplication. + + To create your own instance of TQEventLoop or TQEventLoop subclass create + it before you create the TQApplication object. + + \sa TQEventLoop +*/ +TQEventLoop *TQApplication::eventLoop() +{ + if ( !currentEventLoop() && !is_app_closing ) { + (void) new TQEventLoop( tqApp, "default event loop" ); + } + return currentEventLoop(); +} + + +/*! + Enters the main event loop and waits until exit() is called or the + main widget is destroyed, and returns the value that was set to + exit() (which is 0 if exit() is called via quit()). + + It is necessary to call this function to start event handling. The + main event loop receives events from the window system and + dispatches these to the application widgets. + + Generally speaking, no user interaction can take place before + calling exec(). As a special case, modal widgets like TQMessageBox + can be used before calling exec(), because modal widgets call + exec() to start a local event loop. + + To make your application perform idle processing, i.e. executing a + special function whenever there are no pending events, use a + TQTimer with 0 timeout. More advanced idle processing schemes can + be achieved using processEvents(). + + \sa quit(), exit(), processEvents(), setMainWidget() +*/ +int TQApplication::exec() +{ + return eventLoop()->exec(); +} + +/*! + Tells the application to exit with a return code. + + After this function has been called, the application leaves the main + event loop and returns from the call to exec(). The exec() function + returns \a retcode. + + By convention, a \a retcode of 0 means success, and any non-zero + value indicates an error. + + Note that unlike the C library function of the same name, this + function \e does return to the caller -- it is event processing that + stops. + + \sa quit(), exec() +*/ +void TQApplication::exit( int retcode ) +{ +#ifdef TQT_THREAD_SUPPORT + TQThread* thread = tqApp->guiThread(); + if (thread) { + if (thread->d) { + if (thread->d->eventLoop) { + thread->d->eventLoop->exit( retcode ); + } + } + } +#else + tqApp->eventLoop()->exit( retcode ); +#endif // TQT_THREAD_SUPPORT +} + +/*! + \obsolete + + This function enters the main event loop (recursively). Do not call + it unless you really know what you are doing. + + Use TQApplication::eventLoop()->enterLoop() instead. + +*/ +int TQApplication::enter_loop() +{ + return eventLoop()->enterLoop(); +} + +/*! + \obsolete + + This function exits from a recursive call to the main event loop. + Do not call it unless you are an expert. + + Use TQApplication::eventLoop()->exitLoop() instead. + +*/ +void TQApplication::exit_loop() +{ + eventLoop()->exitLoop(); +} + +/*! + \obsolete + + Returns the current loop level. + + Use TQApplication::eventLoop()->loopLevel() instead. + +*/ +int TQApplication::loopLevel() const +{ + return eventLoop()->loopLevel(); +} + +/*! + + Wakes up the GUI thread. + + \sa guiThreadAwake() \link threads.html Thread Support in TQt\endlink +*/ +void TQApplication::wakeUpGuiThread() +{ + eventLoop()->wakeUp(); +} + +/*! + This function returns TRUE if there are pending events; otherwise + returns FALSE. Pending events can be either from the window system + or posted events using TQApplication::postEvent(). +*/ +bool TQApplication::hasPendingEvents() +{ + return eventLoop()->hasPendingEvents(); +} + +#if !defined(TQ_WS_X11) + +// The doc and X implementation of these functions is in tqapplication_x11.cpp + +void TQApplication::flushX() {} // do nothing + +void TQApplication::syncX() {} // do nothing + +#endif + +/*! + \fn void TQApplication::setWinStyleHighlightColor( const TQColor & ) + \obsolete + + Sets the color used to mark selections in windows style for all widgets + in the application. Will repaint all widgets if the color is changed. + + The default color is \c darkBlue. + \sa winStyleHighlightColor() +*/ + +/*! + \fn const TQColor& TQApplication::winStyleHighlightColor() + \obsolete + + Returns the color used to mark selections in windows style. + + \sa setWinStyleHighlightColor() +*/ + +/*! + Returns the version of the Windows operating system that is running: + + \list + \i TQt::WV_95 - Windows 95 + \i TQt::WV_98 - Windows 98 + \i TQt::WV_Me - Windows Me + \i TQt::WV_NT - Windows NT 4.x + \i TQt::WV_2000 - Windows 2000 (NT5) + \i TQt::WV_XP - Windows XP + \i TQt::WV_2003 - Windows Server 2003 family + \i TQt::WV_CE - Windows CE + \i TQt::WV_CENET - Windows CE.NET + \endlist + + Note that this function is implemented for the Windows version + of TQt only. +*/ + +#if defined(Q_OS_CYGWIN) +TQt::WindowsVersion TQApplication::winVersion() +{ + return qt_winver; +} +#endif + +#ifndef TQT_NO_TRANSLATION + +bool qt_detectRTLLanguage() +{ + return TQApplication::tr( "QT_LAYOUT_DIRECTION", + "Translate this string to the string 'LTR' in left-to-right" + " languages or to 'RTL' in right-to-left languages (such as Hebrew" + " and Arabic) to get proper widget layout." ) == "RTL"; +} + +/*! + Adds the message file \a mf to the list of message files to be used + for translations. + + Multiple message files can be installed. Translations are searched + for in the last installed message file, then the one from last, and + so on, back to the first installed message file. The search stops as + soon as a matching translation is found. + + \sa removeTranslator() translate() TQTranslator::load() +*/ + +void TQApplication::installTranslator( TQTranslator * mf ) +{ + if ( !mf ) + return; + if ( !translators ) + translators = new TQValueList; + + translators->prepend( mf ); + +#ifndef TQT_NO_TRANSLATION_BUILDER + if ( mf->isEmpty() ) + return; +#endif + + // hook to set the layout direction of dialogs + setReverseLayout( qt_detectRTLLanguage() ); + + TQWidgetList *list = topLevelWidgets(); + TQWidgetListIt it( *list ); + TQWidget *w; + while ( ( w=it.current() ) != 0 ) { + ++it; + if (!w->isDesktop()) + postEvent( w, new TQEvent( TQEvent::LanguageChange ) ); + } + delete list; +} + +/*! + Removes the message file \a mf from the list of message files used by + this application. (It does not delete the message file from the file + system.) + + \sa installTranslator() translate(), TQObject::tr() +*/ + +void TQApplication::removeTranslator( TQTranslator * mf ) +{ + if ( !translators || !mf ) + return; + + if ( translators->remove( mf ) && ! tqApp->closingDown() ) { + setReverseLayout( qt_detectRTLLanguage() ); + + TQWidgetList *list = topLevelWidgets(); + TQWidgetListIt it( *list ); + TQWidget *w; + while ( ( w=it.current() ) != 0 ) { + ++it; + postEvent( w, new TQEvent( TQEvent::LanguageChange ) ); + } + delete list; + } +} + +#ifndef TQT_NO_TEXTCODEC +/*! \obsolete + This is the same as TQTextCodec::setCodecForTr(). +*/ +void TQApplication::setDefaultCodec( TQTextCodec* codec ) +{ + TQTextCodec::setCodecForTr( codec ); +} + +/*! \obsolete + Returns TQTextCodec::codecForTr(). +*/ +TQTextCodec* TQApplication::defaultCodec() const +{ + return TQTextCodec::codecForTr(); +} +#endif //TQT_NO_TEXTCODEC + +/*! \enum TQApplication::Encoding + + This enum type defines the 8-bit encoding of character string + arguments to translate(): + + \value DefaultCodec - the encoding specified by + TQTextCodec::codecForTr() (Latin-1 if none has been set) + \value UnicodeUTF8 - UTF-8 + + \sa TQObject::tr(), TQObject::trUtf8(), TQString::fromUtf8() +*/ + +/*! \reentrant + Returns the translation text for \a sourceText, by querying the + installed messages files. The message files are searched from the most + recently installed message file back to the first installed message + file. + + TQObject::tr() and TQObject::trUtf8() provide this functionality more + conveniently. + + \a context is typically a class name (e.g., "MyDialog") and + \a sourceText is either English text or a short identifying text, if + the output text will be very long (as for help texts). + + \a comment is a disambiguating comment, for when the same \a + sourceText is used in different roles within the same context. By + default, it is null. \a encoding indicates the 8-bit encoding of + character stings + + See the \l TQTranslator documentation for more information about + contexts and comments. + + If none of the message files contain a translation for \a + sourceText in \a context, this function returns a TQString + equivalent of \a sourceText. The encoding of \a sourceText is + specified by \e encoding; it defaults to \c DefaultCodec. + + This function is not virtual. You can use alternative translation + techniques by subclassing \l TQTranslator. + + \warning This method is reentrant only if all translators are + installed \e before calling this method. Installing or removing + translators while performing translations is not supported. Doing + so will most likely result in crashes or other undesirable behavior. + + \sa TQObject::tr() installTranslator() defaultCodec() +*/ + +TQString TQApplication::translate( const char * context, const char * sourceText, + const char * comment, Encoding encoding ) const +{ + if ( !sourceText ) + return TQString::null; + + if ( translators ) { + TQValueList::iterator it; + TQTranslator * mf; + TQString result; + for ( it = translators->begin(); it != translators->end(); ++it ) { + mf = *it; + result = mf->findMessage( context, sourceText, comment ).translation(); + if ( !result.isNull() ) + return result; + } + } +#ifndef TQT_NO_TEXTCODEC + if ( encoding == UnicodeUTF8 ) + return TQString::fromUtf8( sourceText ); + else if ( TQTextCodec::codecForTr() != 0 ) + return TQTextCodec::codecForTr()->toUnicode( sourceText ); + else +#endif + return TQString::fromLatin1( sourceText ); +} + +#endif + +/***************************************************************************** + TQApplication management of posted events + *****************************************************************************/ + +//see also notify(), which does the removal of ChildInserted when ChildRemoved. + +/*! + Adds the event \a event with the object \a receiver as the receiver of the + event, to an event queue and returns immediately. + + The event must be allocated on the heap since the post event queue + will take ownership of the event and delete it once it has been posted. + + When control returns to the main event loop, all events that are + stored in the queue will be sent using the notify() function. + + \threadsafe + + \sa sendEvent(), notify() +*/ + +void TQApplication::postEvent( TQObject *receiver, TQEvent *event ) +{ + if ( receiver == 0 ) { +#if defined(QT_CHECK_NULL) + tqWarning( "TQApplication::postEvent: Unexpected null receiver" ); +#endif + delete event; + return; + } + +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker locker( GlobalPostedEvents()->mutex() ); +#endif // TQT_THREAD_SUPPORT + + if ( !receiver->postedEvents ) { + receiver->postedEvents = new TQPostEventList; + } + TQPostEventList * l = receiver->postedEvents; + + // if this is one of the compressible events, do compression + if ( event->type() == TQEvent::Paint || + event->type() == TQEvent::LayoutHint || + event->type() == TQEvent::Resize || + event->type() == TQEvent::Move || + event->type() == TQEvent::LanguageChange ) { + l->first(); + TQPostEvent * cur = 0; + for ( ;; ) { + while ( (cur=l->current()) != 0 && + ( cur->receiver != receiver || + cur->event == 0 || + cur->event->type() != event->type() ) ) + l->next(); + if ( l->current() != 0 ) { + if ( cur->event->type() == TQEvent::Paint ) { + TQPaintEvent * p = (TQPaintEvent*)(cur->event); + if ( p->erase != ((TQPaintEvent*)event)->erase ) { + l->next(); + continue; + } + p->reg = p->reg.unite( ((TQPaintEvent *)event)->reg ); + p->rec = p->rec.unite( ((TQPaintEvent *)event)->rec ); + delete event; + return; + } else if ( cur->event->type() == TQEvent::LayoutHint ) { + delete event; + return; + } else if ( cur->event->type() == TQEvent::Resize ) { + ((TQResizeEvent *)(cur->event))->s = ((TQResizeEvent *)event)->s; + delete event; + return; + } else if ( cur->event->type() == TQEvent::Move ) { + ((TQMoveEvent *)(cur->event))->p = ((TQMoveEvent *)event)->p; + delete event; + return; + } else if ( cur->event->type() == TQEvent::LanguageChange ) { + delete event; + return; + } + } + break; + }; + } + +#if !defined(TQT_NO_IM) + // if this is one of the compressible IM events, do compression + else if ( event->type() == TQEvent::IMCompose ) { + l->last(); + TQPostEvent * cur = 0; + for ( ;; ) { + while ( (cur=l->current()) != 0 && + ( cur->receiver != receiver || + cur->event == 0 || + cur->event->type() != event->type() || + cur->event->type() != TQEvent::IMStart ) ) + l->prev(); + if ( l->current() != 0 ) { + // IMCompose must not be compressed with another one + // beyond its IMStart boundary + if ( cur->event->type() == TQEvent::IMStart ) { + break; + } else if ( cur->event->type() == TQEvent::IMCompose ) { + TQIMComposeEvent * e = (TQIMComposeEvent *)(cur->event); + *e = *(TQIMComposeEvent *)event; + delete event; + return; + } + } + break; + }; + } +#endif + + // if no compression could be done, just append something + event->posted = TRUE; + TQPostEvent * pe = new TQPostEvent( receiver, event ); + l->append( pe ); + GlobalPostedEvents()->append( pe ); + +#ifdef TQT_THREAD_SUPPORT + // Wake up the receiver thread event loop + TQThread* thread = receiver->contextThreadObject(); + if (thread) { + if (thread->d) { + if (thread->d->eventLoop) { + thread->d->eventLoop->wakeUp(); + return; + } + } + } + if ( event->type() == TQEvent::MetaCall ) { + return; + } +#endif + + if (currentEventLoop()) { + currentEventLoop()->wakeUp(); + } +} + + +/*! \overload + + Dispatches all posted events, i.e. empties the event queue. +*/ +void TQApplication::sendPostedEvents() +{ + sendPostedEvents( 0, 0 ); +} + + + +/*! + Immediately dispatches all events which have been previously queued + with TQApplication::postEvent() and which are for the object \a receiver + and have the event type \a event_type. + + Note that events from the window system are \e not dispatched by this + function, but by processEvents(). + + If \a receiver is null, the events of \a event_type are sent for all + objects. If \a event_type is 0, all the events are sent for \a receiver. +*/ + +void TQApplication::sendPostedEvents( TQObject *receiver, int event_type ) +{ + // Make sure the object hierarchy is stable before processing events + // to avoid endless loops + if ( receiver == 0 && event_type == 0 ) { + sendPostedEvents( 0, TQEvent::ChildInserted ); + } + +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker locker( GlobalPostedEvents()->mutex() ); +#endif + + bool sent = TRUE; + while ( sent ) { + sent = FALSE; + + if (receiver && !receiver->postedEvents) { + return; + } + + // if we have a receiver, use the local list. Otherwise, use the + // global list + TQPostEventList * l = receiver ? receiver->postedEvents : GlobalPostedEvents(); + + // okay. here is the tricky loop. be careful about optimizing + // this, it looks the way it does for good reasons. + TQPostEventListIt it( *l ); + TQPostEvent *pe; + while ( (pe=it.current()) != 0 ) { + ++it; + Q_ASSERT(pe->receiver); + if ( pe->event // hasn't been sent yet + && ( receiver == 0 // we send to all receivers + || receiver == pe->receiver ) // we send to THAT receiver + && ( event_type == 0 // we send all types + || event_type == pe->event->type() ) // we send THAT type + && ( !pe->receiver->wasDeleted ) // don't send if receiver was deleted +#ifdef TQT_THREAD_SUPPORT + // only send if active thread is receiver object owning thread + && ( pe->receiver->contextThreadObject() == TQThread::currentThreadObject() ) +#endif + ) { + // first, we diddle the event so that we can deliver + // it, and that noone will try to touch it later. + pe->event->posted = FALSE; + TQEvent * e = pe->event; + TQObject * r = pe->receiver; + pe->event = 0; + + // next, update the data structure so that we're ready + // for the next event. + + // look for the local list, and take whatever we're + // delivering out of it. r->postedEvents maybe *l + if ( r->postedEvents ) { + r->postedEvents->removeRef( pe ); + // if possible, get rid of that list. this is not + // ideal - we will create and delete a list for + // each update() call. it would be better if we'd + // leave the list empty here, and delete it + // somewhere else if it isn't being used. + if ( r->postedEvents->isEmpty() ) { + delete r->postedEvents; + r->postedEvents = 0; + } + } + +#ifdef TQT_THREAD_SUPPORT + if ( locker.mutex() ) locker.mutex()->unlock(); +#endif // TQT_THREAD_SUPPORT + // after all that work, it's time to deliver the event. + if ( e->type() == TQEvent::Paint && r->isWidgetType() ) { + TQWidget * w = (TQWidget*)r; + TQPaintEvent * p = (TQPaintEvent*)e; + if ( w->isVisible() ) { + w->repaint( p->reg, p->erase ); + } + } else { + sent = TRUE; + TQApplication::sendEvent( r, e ); + } +#ifdef TQT_THREAD_SUPPORT + if ( locker.mutex() ) locker.mutex()->lock(); +#endif // TQT_THREAD_SUPPORT + + delete e; + // careful when adding anything below this point - the + // sendEvent() call might invalidate any invariants this + // function depends on. + } + } + + // clear the global list, i.e. remove everything that was + // delivered. + if ( l == GlobalPostedEvents() ) { + GlobalPostedEvents()->first(); + while( (pe=GlobalPostedEvents()->current()) != 0 ) { + if ( pe->event ) { + GlobalPostedEvents()->next(); + } + else { + GlobalPostedEvents()->remove(); + } + } + } + } +} + +/*! + Removes all events posted using postEvent() for \a receiver. + + The events are \e not dispatched, instead they are removed from the + queue. You should never need to call this function. If you do call it, + be aware that killing events may cause \a receiver to break one or + more invariants. + + \threadsafe +*/ + +void TQApplication::removePostedEvents( TQObject *receiver ) +{ + removePostedEvents( receiver, 0 ); +} + +/*! + Removes all events that have the event type \a event_type posted + using postEvent() for \a receiver. + + The events are \e not dispatched, instead they are removed from the + queue. + + If \a event_type is 0, all the events are removed from the queue. + + \threadsafe +*/ + +void TQApplication::removePostedEvents( TQObject *receiver, int event_type ) +{ + if ( !receiver ) { + return; + } + +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker locker( GlobalPostedEvents()->mutex() ); +#endif // TQT_THREAD_SUPPORT + + // the TQObject destructor calls this function directly. this can + // happen while the event loop is in the middle of posting events, + // and when we get here, we may not have any more posted events + // for this object. + if ( !receiver->postedEvents ) { + return; + } + + // iterate over the object-specifc list and delete the events. + // leave the TQPostEvent objects; they'll be deleted by + // sendPostedEvents(). + TQPostEventList * l = receiver->postedEvents; + l->first(); + TQPostEvent * pe; + while( (pe=l->current()) != 0 ) { + if ( !event_type || pe->event->type() == event_type ) { + if ( pe->event ) { + pe->event->posted = FALSE; + delete pe->event; + pe->event = 0; + } + l->remove(); + } else { + l->next(); + } + } + if ( !event_type || !l->count() ) { + receiver->postedEvents = 0; + delete l; + } +} + + +/*! + Removes \a event from the queue of posted events, and emits a + warning message if appropriate. + + \warning This function can be \e really slow. Avoid using it, if + possible. + + \threadsafe +*/ + +void TQApplication::removePostedEvent( TQEvent * event ) +{ + if ( !event || !event->posted ) { + return; + } + +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker locker( GlobalPostedEvents()->mutex() ); +#endif // TQT_THREAD_SUPPORT + + TQPostEventListIt it( *GlobalPostedEvents() ); + TQPostEvent * pe; + while( (pe = it.current()) != 0 ) { + ++it; + if ( pe->event == event ) { +#if defined(QT_DEBUG) + const char *n; + switch ( event->type() ) { + case TQEvent::Timer: + n = "Timer"; + break; + case TQEvent::MouseButtonPress: + n = "MouseButtonPress"; + break; + case TQEvent::MouseButtonRelease: + n = "MouseButtonRelease"; + break; + case TQEvent::MouseButtonDblClick: + n = "MouseButtonDblClick"; + break; + case TQEvent::MouseMove: + n = "MouseMove"; + break; +#ifndef TQT_NO_WHEELEVENT + case TQEvent::Wheel: + n = "Wheel"; + break; +#endif + case TQEvent::KeyPress: + n = "KeyPress"; + break; + case TQEvent::KeyRelease: + n = "KeyRelease"; + break; + case TQEvent::FocusIn: + n = "FocusIn"; + break; + case TQEvent::FocusOut: + n = "FocusOut"; + break; + case TQEvent::Enter: + n = "Enter"; + break; + case TQEvent::Leave: + n = "Leave"; + break; + case TQEvent::Paint: + n = "Paint"; + break; + case TQEvent::Move: + n = "Move"; + break; + case TQEvent::Resize: + n = "Resize"; + break; + case TQEvent::Create: + n = "Create"; + break; + case TQEvent::Destroy: + n = "Destroy"; + break; + case TQEvent::Close: + n = "Close"; + break; + case TQEvent::Quit: + n = "Quit"; + break; + default: + n = ""; + break; + } + tqWarning("TQEvent: Warning: %s event deleted while posted to %s %s", + n, + pe->receiver ? pe->receiver->className() : "null", + pe->receiver ? pe->receiver->name() : "object" ); + // note the beautiful uglehack if !pe->receiver :) +#endif + event->posted = FALSE; + delete pe->event; + pe->event = 0; + return; + } + } +} + +#ifdef TQT_THREAD_SUPPORT +static void tqThreadTerminationHandlerRecursive( TQObject* object, TQThread* originThread, TQThread* destinationThread ) { + TQThread* objectThread = object->contextThreadObject(); + if (objectThread && (objectThread == originThread)) { + TQThread::CleanupType cleanupType = objectThread->cleanupType(); + if (cleanupType == TQThread::CleanupMergeObjects) { + object->moveToThread(destinationThread); + } + else if (cleanupType == TQThread::CleanupNone) { + // Do nothing +#if defined(QT_DEBUG) + tqDebug( "TQApplication::threadTerminationHandler: object %p still owned by thread %p at thread termination!", object, objectThread); +#endif // QT_DEBUG + } + else { + // Do nothing +#if defined(QT_DEBUG) + tqDebug( "TQApplication::threadTerminationHandler: invalid thread termination cleanup type %d specified", cleanupType); +#endif // QT_DEBUG + } + } + TQObjectList children = object->childrenListObject(); + TQObject *childObject; + for ( childObject = children.first(); childObject; childObject = children.next() ) { + tqThreadTerminationHandlerRecursive(childObject, originThread, destinationThread); + } +} + +/*!\internal + + Migrates all objects from the specified thread in preparation + for thread destruction. + */ +void TQApplication::threadTerminationHandler( TQThread *originThread ) { + TQMutexLocker locker( tqt_mutex ); + TQThread* destinationThread = guiThread(); + const TQObjectList* objects = TQObject::objectTrees(); + for ( TQObjectListIt objectit( *objects ) ; *objectit; ++objectit ) { + tqThreadTerminationHandlerRecursive((*objectit), originThread, destinationThread); + } +} +#endif // TQT_THREAD_SUPPORT + +/*!\internal + + Sets the active window in reaction to a system event. Call this + from the platform specific event handlers. + + It sets the activeWindow() and focusWidget() attributes and sends + proper WindowActivate/WindowDeactivate and FocusIn/FocusOut events + to all appropriate widgets. + + \sa activeWindow() + */ +void TQApplication::setActiveWindow( TQWidget* act ) +{ + TQWidget* window = act?act->topLevelWidget():0; + + if ( active_window == window ) + return; + + // first the activation/deactivation events + if ( active_window ) { + TQWidgetList deacts; +#ifndef TQT_NO_STYLE + if ( style().styleHint(TQStyle::SH_Widget_ShareActivation, active_window ) ) { + TQWidgetList *list = topLevelWidgets(); + if ( list ) { + for ( TQWidget *w = list->first(); w; w = list->next() ) { + if ( w->isVisible() && w->isActiveWindow() ) + deacts.append(w); + } + delete list; + } + } else +#endif + deacts.append(active_window); + active_window = 0; + TQEvent e( TQEvent::WindowDeactivate ); + for(TQWidget *w = deacts.first(); w; w = deacts.next()) + TQApplication::sendSpontaneousEvent( w, &e ); + } + + active_window = window; + if ( active_window ) { + TQEvent e( TQEvent::WindowActivate ); + TQWidgetList acts; +#ifndef TQT_NO_STYLE + if ( style().styleHint(TQStyle::SH_Widget_ShareActivation, active_window ) ) { + TQWidgetList *list = topLevelWidgets(); + if ( list ) { + for ( TQWidget *w = list->first(); w; w = list->next() ) { + if ( w->isVisible() && w->isActiveWindow() ) + acts.append(w); + } + delete list; + } + } else +#endif + acts.append(active_window); + for(TQWidget *w = acts.first(); w; w = acts.next()) + TQApplication::sendSpontaneousEvent( w, &e ); + } + + // then focus events + TQFocusEvent::setReason( TQFocusEvent::ActiveWindow ); + if ( !active_window && focus_widget ) { + TQFocusEvent out( TQEvent::FocusOut ); + TQWidget *tmp = focus_widget; + focus_widget = 0; +#ifdef TQ_WS_WIN + TQInputContext::accept( tmp ); +#elif defined(TQ_WS_X11) + tmp->unfocusInputContext(); +#endif + TQApplication::sendSpontaneousEvent( tmp, &out ); + } else if ( active_window ) { + TQWidget *w = active_window->focusWidget(); + if ( w && w->focusPolicy() != TQWidget::NoFocus ) + w->setFocus(); + else + active_window->focusNextPrevChild( TRUE ); + } + TQFocusEvent::resetReason(); +} + + +/*!\internal + + Creates the proper Enter/Leave event when widget \a enter is entered + and widget \a leave is left. + */ +TQ_EXPORT void tqt_dispatchEnterLeave( TQWidget* enter, TQWidget* leave ) { +#if 0 + if ( leave ) { + TQEvent e( TQEvent::Leave ); + TQApplication::sendEvent( leave, & e ); + } + if ( enter ) { + TQEvent e( TQEvent::Enter ); + TQApplication::sendEvent( enter, & e ); + } + return; +#endif + + TQWidget* w ; + if ( !enter && !leave ) + return; + TQWidgetList leaveList; + TQWidgetList enterList; + + bool sameWindow = leave && enter && leave->topLevelWidget() == enter->topLevelWidget(); + if ( leave && !sameWindow ) { + w = leave; + do { + leaveList.append( w ); + } while ( (w = w->parentWidget( TRUE ) ) ); + } + if ( enter && !sameWindow ) { + w = enter; + do { + enterList.prepend( w ); + } while ( (w = w->parentWidget(TRUE) ) ); + } + if ( sameWindow ) { + int enterDepth = 0; + int leaveDepth = 0; + w = enter; + while ( ( w = w->parentWidget( TRUE ) ) ) + enterDepth++; + w = leave; + while ( ( w = w->parentWidget( TRUE ) ) ) + leaveDepth++; + TQWidget* wenter = enter; + TQWidget* wleave = leave; + while ( enterDepth > leaveDepth ) { + wenter = wenter->parentWidget(); + enterDepth--; + } + while ( leaveDepth > enterDepth ) { + wleave = wleave->parentWidget(); + leaveDepth--; + } + while ( !wenter->isTopLevel() && wenter != wleave ) { + wenter = wenter->parentWidget(); + wleave = wleave->parentWidget(); + } + + w = leave; + while ( w != wleave ) { + leaveList.append( w ); + w = w->parentWidget(); + } + w = enter; + while ( w != wenter ) { + enterList.prepend( w ); + w = w->parentWidget(); + } + } + + TQEvent leaveEvent( TQEvent::Leave ); + for ( w = leaveList.first(); w; w = leaveList.next() ) { + if ( !tqApp->activeModalWidget() || tqt_tryModalHelper( w, 0 )) + TQApplication::sendEvent( w, &leaveEvent ); + } + TQEvent enterEvent( TQEvent::Enter ); + for ( w = enterList.first(); w; w = enterList.next() ) { + if ( !tqApp->activeModalWidget() || tqt_tryModalHelper( w, 0 )) + TQApplication::sendEvent( w, &enterEvent ); + } +} + + +#ifdef TQ_WS_MACX +extern TQWidget *tqt_tryModalHelperMac( TQWidget * top ); //tqapplication_mac.cpp +#endif + + +/*!\internal + + Called from tqapplication_.cpp, returns TRUE + if the widget should accept the event. + */ +TQ_EXPORT bool tqt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { + TQWidget *modal=0, *top=TQApplication::activeModalWidget(); + if ( rettop ) *rettop = top; + + if ( tqApp->activePopupWidget() ) + return TRUE; + +#ifdef TQ_WS_MACX + top = tqt_tryModalHelperMac( top ); + if ( rettop ) *rettop = top; +#endif + + TQWidget* groupLeader = widget; + widget = widget->topLevelWidget(); + + if ( widget->testWFlags(TQt::WShowModal) ) // widget is modal + modal = widget; + if ( !top || modal == top ) // don't block event + return TRUE; + + TQWidget * p = widget->parentWidget(); // Check if the active modal widget is a parent of our widget + while ( p ) { + if ( p == top ) + return TRUE; + p = p->parentWidget(); + } + + while ( groupLeader && !groupLeader->testWFlags( TQt::WGroupLeader ) ) + groupLeader = groupLeader->parentWidget(); + + if ( groupLeader ) { + // Does groupLeader have a child in tqt_modal_stack? + bool unrelated = TRUE; + modal = tqt_modal_stack->first(); + while (modal && unrelated) { + TQWidget* p = modal->parentWidget(); + while ( p && p != groupLeader && !p->testWFlags( TQt::WGroupLeader) ) { + p = p->parentWidget(); + } + modal = tqt_modal_stack->next(); + if ( p == groupLeader ) unrelated = FALSE; + } + + if ( unrelated ) + return TRUE; // don't block event + } + return FALSE; +} + + +/*! + Returns the desktop widget (also called the root window). + + The desktop widget is useful for obtaining the size of the screen. + It may also be possible to draw on the desktop. We recommend against + assuming that it's possible to draw on the desktop, since this does + not work on all operating systems. + + \code + TQDesktopWidget *d = TQApplication::desktop(); + int w = d->width(); // returns desktop width + int h = d->height(); // returns desktop height + \endcode +*/ + +TQDesktopWidget *TQApplication::desktop() +{ + if ( !tqt_desktopWidget || // not created yet + !tqt_desktopWidget->isDesktop() ) { // reparented away + tqt_desktopWidget = new TQDesktopWidget(); + TQ_CHECK_PTR( tqt_desktopWidget ); + } + return tqt_desktopWidget; +} + +#ifndef TQT_NO_CLIPBOARD +/*! + Returns a pointer to the application global clipboard. +*/ +TQClipboard *TQApplication::clipboard() +{ + if ( tqt_clipboard == 0 ) { + tqt_clipboard = new TQClipboard; + TQ_CHECK_PTR( tqt_clipboard ); + } + return tqt_clipboard; +} +#endif // TQT_NO_CLIPBOARD + +/*! + By default, TQt will try to use the current standard colors, fonts + etc., from the underlying window system's desktop settings, + and use them for all relevant widgets. This behavior can be switched off + by calling this function with \a on set to FALSE. + + This static function must be called before creating the TQApplication + object, like this: + + \code + int main( int argc, char** argv ) { + TQApplication::setDesktopSettingsAware( FALSE ); // I know better than the user + TQApplication myApp( argc, argv ); // Use default fonts & colors + ... + } + \endcode + + \sa desktopSettingsAware() +*/ + +void TQApplication::setDesktopSettingsAware( bool on ) +{ + obey_desktop_settings = on; +} + +/*! + Returns the value set by setDesktopSettingsAware(); by default TRUE. + + \sa setDesktopSettingsAware() +*/ + +bool TQApplication::desktopSettingsAware() +{ + return obey_desktop_settings; +} + +/*! \fn void TQApplication::lock() + + Lock the TQt Library Mutex. If another thread has already locked the + mutex, the calling thread will block until the other thread has + unlocked the mutex. + + \sa unlock() locked() \link threads.html Thread Support in TQt\endlink +*/ + + +/*! \fn void TQApplication::unlock(bool wakeUpGui) + + Unlock the TQt Library Mutex. If \a wakeUpGui is TRUE (the default), + then the GUI thread will be woken with TQApplication::wakeUpGuiThread(). + + \sa lock(), locked() \link threads.html Thread Support in TQt\endlink +*/ + + +/*! \fn bool TQApplication::locked() + + Returns TRUE if the TQt Library Mutex is locked by a different thread; + otherwise returns FALSE. + + \warning Due to different implementations of recursive mutexes on + the supported platforms, calling this function from the same thread + that previously locked the mutex will give undefined results. + + \sa lock() unlock() \link threads.html Thread Support in TQt\endlink +*/ + +/*! \fn bool TQApplication::tryLock() + + Attempts to lock the TQt Library Mutex, and returns immediately. If + the lock was obtained, this function returns TRUE. If another thread + has locked the mutex, this function returns FALSE, instead of + waiting for the lock to become available. + + The mutex must be unlocked with unlock() before another thread can + successfully lock it. + + \sa lock(), unlock() \link threads.html Thread Support in TQt\endlink +*/ + +#if defined(TQT_THREAD_SUPPORT) +void TQApplication::lock() +{ + tqt_mutex->lock(); +} + +void TQApplication::unlock(bool wakeUpGui) +{ + tqt_mutex->unlock(); + + if (wakeUpGui) + wakeUpGuiThread(); +} + +bool TQApplication::locked() +{ + return tqt_mutex->locked(); +} + +bool TQApplication::tryLock() +{ + return tqt_mutex->tryLock(); +} +#endif + + +/*! + \fn bool TQApplication::isSessionRestored() const + + Returns TRUE if the application has been restored from an earlier + \link session.html session\endlink; otherwise returns FALSE. + + \sa sessionId(), commitData(), saveState() +*/ + + +/*! + \fn TQString TQApplication::sessionId() const + + Returns the current \link session.html session's\endlink identifier. + + If the application has been restored from an earlier session, this + identifier is the same as it was in that previous session. + + The session identifier is guaranteed to be unique both for different + applications and for different instances of the same application. + + \sa isSessionRestored(), sessionKey(), commitData(), saveState() + */ + +/*! + \fn TQString TQApplication::sessionKey() const + + Returns the session key in the current \link session.html + session\endlink. + + If the application has been restored from an earlier session, this + key is the same as it was when the previous session ended. + + The session key changes with every call of commitData() or + saveState(). + + \sa isSessionRestored(), sessionId(), commitData(), saveState() + */ + + +/*! + \fn void TQApplication::commitData( TQSessionManager& sm ) + + This function deals with \link session.html session + management\endlink. It is invoked when the TQSessionManager wants the + application to commit all its data. + + Usually this means saving all open files, after getting + permission from the user. Furthermore you may want to provide a means + by which the user can cancel the shutdown. + + Note that you should not exit the application within this function. + Instead, the session manager may or may not do this afterwards, + depending on the context. + + \warning Within this function, no user interaction is possible, \e + unless you ask the session manager \a sm for explicit permission. + See TQSessionManager::allowsInteraction() and + TQSessionManager::allowsErrorInteraction() for details and example + usage. + + The default implementation requests interaction and sends a close + event to all visible top level widgets. If any event was + rejected, the shutdown is canceled. + + \sa isSessionRestored(), sessionId(), saveState(), \link session.html the Session Management overview\endlink +*/ +#ifndef TQT_NO_SESSIONMANAGER +void TQApplication::commitData( TQSessionManager& sm ) +{ + + if ( sm.allowsInteraction() ) { + TQWidgetList done; + TQWidgetList *list = TQApplication::topLevelWidgets(); + bool cancelled = FALSE; + TQWidget* w = list->first(); + while ( !cancelled && w ) { + if ( !w->isHidden() ) { + TQCloseEvent e; + sendEvent( w, &e ); + cancelled = !e.isAccepted(); + if ( !cancelled ) + done.append( w ); + delete list; // one never knows... + list = TQApplication::topLevelWidgets(); + w = list->first(); + } else { + w = list->next(); + } + while ( w && done.containsRef( w ) ) + w = list->next(); + } + delete list; + if ( cancelled ) + sm.cancel(); + } +} + + +/*! + \fn void TQApplication::saveState( TQSessionManager& sm ) + + This function deals with \link session.html session + management\endlink. It is invoked when the + \link TQSessionManager session manager \endlink wants the application + to preserve its state for a future session. + + For example, a text editor would create a temporary file that + includes the current contents of its edit buffers, the location of + the cursor and other aspects of the current editing session. + + Note that you should never exit the application within this + function. Instead, the session manager may or may not do this + afterwards, depending on the context. Futhermore, most session + managers will very likely request a saved state immediately after + the application has been started. This permits the session manager + to learn about the application's restart policy. + + \warning Within this function, no user interaction is possible, \e + unless you ask the session manager \a sm for explicit permission. + See TQSessionManager::allowsInteraction() and + TQSessionManager::allowsErrorInteraction() for details. + + \sa isSessionRestored(), sessionId(), commitData(), \link session.html the Session Management overview\endlink +*/ + +void TQApplication::saveState( TQSessionManager& /* sm */ ) +{ +} +#endif //TQT_NO_SESSIONMANAGER +/*! + Sets the time after which a drag should start to \a ms ms. + + \sa startDragTime() +*/ + +void TQApplication::setStartDragTime( int ms ) +{ + drag_time = ms; +} + +/*! + If you support drag and drop in you application and a drag should + start after a mouse click and after a certain time elapsed, you + should use the value which this method returns as the delay (in ms). + + TQt also uses this delay internally, e.g. in TQTextEdit and TQLineEdit, + for starting a drag. + + The default value is 500 ms. + + \sa setStartDragTime(), startDragDistance() +*/ + +int TQApplication::startDragTime() +{ + return drag_time; +} + +/*! + Sets the distance after which a drag should start to \a l pixels. + + \sa startDragDistance() +*/ + +void TQApplication::setStartDragDistance( int l ) +{ + drag_distance = l; +} + +/*! + If you support drag and drop in you application and a drag should + start after a mouse click and after moving the mouse a certain + distance, you should use the value which this method returns as the + distance. + + For example, if the mouse position of the click is stored in \c + startPos and the current position (e.g. in the mouse move event) is + \c currPos, you can find out if a drag should be started with code + like this: + \code + if ( ( startPos - currPos ).manhattanLength() > + TQApplication::startDragDistance() ) + startTheDrag(); + \endcode + + TQt uses this value internally, e.g. in TQFileDialog. + + The default value is 4 pixels. + + \sa setStartDragDistance(), startDragTime(), TQPoint::manhattanLength() +*/ + +int TQApplication::startDragDistance() +{ + return drag_distance; +} + +/*! + If \a b is TRUE, all dialogs and widgets will be laid out in a + mirrored fashion, as required by right to left languages such as + Arabic and Hebrew. If \a b is FALSE, dialogs and widgets are laid + out left to right. + + Changing this flag in runtime does not cause a relayout of already + instantiated widgets. + + \sa reverseLayout() +*/ +void TQApplication::setReverseLayout( bool b ) +{ + if ( reverse_layout == b ) + return; + + reverse_layout = b; + + TQWidgetList *list = topLevelWidgets(); + TQWidgetListIt it( *list ); + TQWidget *w; + while ( ( w=it.current() ) != 0 ) { + ++it; + postEvent( w, new TQEvent( TQEvent::LayoutDirectionChange ) ); + } + delete list; +} + +/*! + Returns TRUE if all dialogs and widgets will be laid out in a + mirrored (right to left) fashion. Returns FALSE if dialogs and + widgets will be laid out left to right. + + \sa setReverseLayout() +*/ +bool TQApplication::reverseLayout() +{ + return reverse_layout; +} + + +/*! + \class TQSessionManager tqsessionmanager.h + \brief The TQSessionManager class provides access to the session manager. + + \ingroup application + \ingroup environment + + The session manager is responsible for session management, most + importantly for interruption and resumption. A "session" is a kind + of record of the state of the system, e.g. which applications were + run at start up and which applications are currently running. The + session manager is used to save the session, e.g. when the machine + is shut down; and to restore a session, e.g. when the machine is + started up. Use TQSettings to save and restore an individual + application's settings, e.g. window positions, recently used files, + etc. + + TQSessionManager provides an interface between the application and + the session manager so that the program can work well with the + session manager. In TQt, session management requests for action + are handled by the two virtual functions TQApplication::commitData() + and TQApplication::saveState(). Both provide a reference to + a session manager object as argument, to allow the application + to communicate with the session manager. + + During a session management action (i.e. within commitData() and + saveState()), no user interaction is possible \e unless the + application got explicit permission from the session manager. You + ask for permission by calling allowsInteraction() or, if it's really + urgent, allowsErrorInteraction(). TQt does not enforce this, but the + session manager may. + + You can try to abort the shutdown process by calling cancel(). The + default commitData() function does this if some top-level window + rejected its closeEvent(). + + For sophisticated session managers provided on Unix/X11, TQSessionManager + offers further possibilites to fine-tune an application's session + management behavior: setRestartCommand(), setDiscardCommand(), + setRestartHint(), setProperty(), requestPhase2(). See the respective + function descriptions for further details. +*/ + +/*! \enum TQSessionManager::RestartHint + + This enum type defines the circumstances under which this + application wants to be restarted by the session manager. The + current values are + + \value RestartIfRunning if the application is still running when + the session is shut down, it wants to be restarted at the start of + the next session. + + \value RestartAnyway the application wants to be started at the + start of the next session, no matter what. (This is useful for + utilities that run just after startup and then quit.) + + \value RestartImmediately the application wants to be started + immediately whenever it is not running. + + \value RestartNever the application does not want to be restarted + automatically. + + The default hint is \c RestartIfRunning. +*/ + + +/*! + \fn TQString TQSessionManager::sessionId() const + + Returns the identifier of the current session. + + If the application has been restored from an earlier session, this + identifier is the same as it was in that earlier session. + + \sa sessionKey(), TQApplication::sessionId() + */ + +/*! + \fn TQString TQSessionManager::sessionKey() const + + Returns the session key in the current session. + + If the application has been restored from an earlier session, this + key is the same as it was when the previous session ended. + + The session key changes with every call of commitData() or + saveState(). + + \sa sessionId(), TQApplication::sessionKey() + */ + +// ### Note: This function is undocumented, since it is #ifdef'd. + +/*! + \fn void* TQSessionManager::handle() const + + X11 only: returns a handle to the current \c SmcConnection. +*/ + + +/*! + \fn bool TQSessionManager::allowsInteraction() + + Asks the session manager for permission to interact with the + user. Returns TRUE if interaction is permitted; otherwise + returns FALSE. + + The rationale behind this mechanism is to make it possible to + synchronize user interaction during a shutdown. Advanced session + managers may ask all applications simultaneously to commit their + data, resulting in a much faster shutdown. + + When the interaction is completed we strongly recommend releasing the + user interaction semaphore with a call to release(). This way, other + applications may get the chance to interact with the user while your + application is still busy saving data. (The semaphore is implicitly + released when the application exits.) + + If the user decides to cancel the shutdown process during the + interaction phase, you must tell the session manager that this has + happened by calling cancel(). + + Here's an example of how an application's TQApplication::commitData() + might be implemented: + +\code +void MyApplication::commitData( TQSessionManager& sm ) { + if ( sm.allowsInteraction() ) { + switch ( TQMessageBox::warning( + yourMainWindow, + tr("Application Name"), + tr("Save changes to document Foo?"), + tr("&Yes"), + tr("&No"), + tr("Cancel"), + 0, 2) ) { + case 0: // yes + sm.release(); + // save document here; if saving fails, call sm.cancel() + break; + case 1: // continue without saving + break; + default: // cancel + sm.cancel(); + break; + } + } else { + // we did not get permission to interact, then + // do something reasonable instead. + } +} +\endcode + + If an error occurred within the application while saving its data, + you may want to try allowsErrorInteraction() instead. + + \sa TQApplication::commitData(), release(), cancel() +*/ + + +/*! + \fn bool TQSessionManager::allowsErrorInteraction() + + This is similar to allowsInteraction(), but also tells the session + manager that an error occurred. Session managers may give error + interaction request higher priority, which means that it is more likely + that an error interaction is permitted. However, you are still not + guaranteed that the session manager will allow interaction. + + \sa allowsInteraction(), release(), cancel() +*/ + +/*! + \fn void TQSessionManager::release() + + Releases the session manager's interaction semaphore after an + interaction phase. + + \sa allowsInteraction(), allowsErrorInteraction() +*/ + +/*! + \fn void TQSessionManager::cancel() + + Tells the session manager to cancel the shutdown process. Applications + should not call this function without first asking the user. + + \sa allowsInteraction(), allowsErrorInteraction() + +*/ + +/*! + \fn void TQSessionManager::setRestartHint( RestartHint hint ) + + Sets the application's restart hint to \a hint. On application + startup the hint is set to \c RestartIfRunning. + + Note that these flags are only hints, a session manager may or may + not respect them. + + We recommend setting the restart hint in TQApplication::saveState() + because most session managers perform a checkpoint shortly after an + application's startup. + + \sa restartHint() +*/ + +/*! + \fn TQSessionManager::RestartHint TQSessionManager::restartHint() const + + Returns the application's current restart hint. The default is + \c RestartIfRunning. + + \sa setRestartHint() +*/ + +/*! + \fn void TQSessionManager::setRestartCommand( const TQStringList& command ) + + If the session manager is capable of restoring sessions it will + execute \a command in order to restore the application. The command + defaults to + + \code + appname -session id + \endcode + + The \c -session option is mandatory; otherwise TQApplication cannot + tell whether it has been restored or what the current session + identifier is. See TQApplication::isSessionRestored() and + TQApplication::sessionId() for details. + + If your application is very simple, it may be possible to store the + entire application state in additional command line options. This + is usually a very bad idea because command lines are often limited + to a few hundred bytes. Instead, use TQSettings, or temporary files + or a database for this purpose. By marking the data with the unique + sessionId(), you will be able to restore the application in a future + session. + + \sa restartCommand(), setDiscardCommand(), setRestartHint() +*/ + +/*! + \fn TQStringList TQSessionManager::restartCommand() const + + Returns the currently set restart command. + + Note that if you want to iterate over the list, you should + iterate over a copy, e.g. + \code + TQStringList list = mySession.restartCommand(); + TQStringList::Iterator it = list.begin(); + while( it != list.end() ) { + myProcessing( *it ); + ++it; + } + \endcode + + \sa setRestartCommand(), restartHint() +*/ + +/*! + \fn void TQSessionManager::setDiscardCommand( const TQStringList& ) + + \sa discardCommand(), setRestartCommand() +*/ + + +/*! + \fn TQStringList TQSessionManager::discardCommand() const + + Returns the currently set discard command. + + Note that if you want to iterate over the list, you should + iterate over a copy, e.g. + \code + TQStringList list = mySession.discardCommand(); + TQStringList::Iterator it = list.begin(); + while( it != list.end() ) { + myProcessing( *it ); + ++it; + } + \endcode + + \sa setDiscardCommand(), restartCommand(), setRestartCommand() +*/ + +/*! + \overload void TQSessionManager::setManagerProperty( const TQString& name, + const TQString& value ) + + Low-level write access to the application's identification and state + records are kept in the session manager. + + The property called \a name has its value set to the string \a value. +*/ + +/*! + \fn void TQSessionManager::setManagerProperty( const TQString& name, + const TQStringList& value ) + + Low-level write access to the application's identification and state + record are kept in the session manager. + + The property called \a name has its value set to the string list \a value. +*/ + +/*! + \fn bool TQSessionManager::isPhase2() const + + Returns TRUE if the session manager is currently performing a second + session management phase; otherwise returns FALSE. + + \sa requestPhase2() +*/ + +/*! + \fn void TQSessionManager::requestPhase2() + + Requests a second session management phase for the application. The + application may then return immediately from the + TQApplication::commitData() or TQApplication::saveState() function, + and they will be called again once most or all other applications have + finished their session management. + + The two phases are useful for applications such as the X11 window manager + that need to store information about another application's windows + and therefore have to wait until these applications have completed their + respective session management tasks. + + Note that if another application has requested a second phase it + may get called before, simultaneously with, or after your + application's second phase. + + \sa isPhase2() +*/ + +/*! + \fn int TQApplication::horizontalAlignment( int align ) + + Strips out vertical alignment flags and transforms an + alignment \a align of AlignAuto into AlignLeft or + AlignRight according to the language used. The other horizontal + alignment flags are left untouched. +*/ + + +/***************************************************************************** + Stubbed session management support + *****************************************************************************/ +#ifndef TQT_NO_SESSIONMANAGER +#if defined( TQT_NO_SM_SUPPORT ) || defined( TQ_WS_WIN ) || defined( TQ_WS_MAC ) + +class TQSessionManagerData +{ +public: + TQStringList restartCommand; + TQStringList discardCommand; + TQString sessionId; + TQString sessionKey; + TQSessionManager::RestartHint restartHint; +}; + +TQSessionManager* qt_session_manager_self = 0; +TQSessionManager::TQSessionManager( TQApplication * app, TQString &id, TQString &key ) + : TQObject( app, "qt_sessionmanager" ) +{ + qt_session_manager_self = this; + d = new TQSessionManagerData; +#if defined(TQ_WS_WIN) && !defined(Q_OS_TEMP) + wchar_t guidstr[40]; + GUID guid; + CoCreateGuid( &guid ); + StringFromGUID2(guid, guidstr, 40); + id = TQString::fromUcs2((ushort*)guidstr); + CoCreateGuid( &guid ); + StringFromGUID2(guid, guidstr, 40); + key = TQString::fromUcs2((ushort*)guidstr); +#endif + d->sessionId = id; + d->sessionKey = key; + d->restartHint = RestartIfRunning; +} + +TQSessionManager::~TQSessionManager() +{ + delete d; + qt_session_manager_self = 0; +} + +TQString TQSessionManager::sessionId() const +{ + return d->sessionId; +} + +TQString TQSessionManager::sessionKey() const +{ + return d->sessionKey; +} + + +#if defined(TQ_WS_X11) || defined(TQ_WS_MAC) +void* TQSessionManager::handle() const +{ + return 0; +} +#endif + +#if !defined(TQ_WS_WIN) +bool TQSessionManager::allowsInteraction() +{ + return TRUE; +} + +bool TQSessionManager::allowsErrorInteraction() +{ + return TRUE; +} +void TQSessionManager::release() +{ +} + +void TQSessionManager::cancel() +{ +} +#endif + + +void TQSessionManager::setRestartHint( TQSessionManager::RestartHint hint) +{ + d->restartHint = hint; +} + +TQSessionManager::RestartHint TQSessionManager::restartHint() const +{ + return d->restartHint; +} + +void TQSessionManager::setRestartCommand( const TQStringList& command) +{ + d->restartCommand = command; +} + +TQStringList TQSessionManager::restartCommand() const +{ + return d->restartCommand; +} + +void TQSessionManager::setDiscardCommand( const TQStringList& command) +{ + d->discardCommand = command; +} + +TQStringList TQSessionManager::discardCommand() const +{ + return d->discardCommand; +} + +void TQSessionManager::setManagerProperty( const TQString&, const TQString&) +{ +} + +void TQSessionManager::setManagerProperty( const TQString&, const TQStringList& ) +{ +} + +bool TQSessionManager::isPhase2() const +{ + return FALSE; +} + +void TQSessionManager::requestPhase2() +{ +} + +#endif // TQT_NO_SM_SUPPORT +#endif //TQT_NO_SESSIONMANAGER diff --git a/src/kernel/tqapplication.h b/src/kernel/tqapplication.h new file mode 100644 index 000000000..0e884583e --- /dev/null +++ b/src/kernel/tqapplication.h @@ -0,0 +1,532 @@ +/**************************************************************************** +** +** 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 "tqdesktopwidget.h" +#include "tqasciidict.h" +#include "tqpalette.h" +#include "tqtranslator.h" +#include "tqstrlist.h" +#include "tqstringlist.h" +#endif // QT_H + +class TQSessionManager; +class TQStyle; +class TQTranslator; +class TQEventLoop; +#if defined(TQ_WS_X11) +class TQIMEvent; +#endif + +#ifdef TQT_THREAD_SUPPORT +class TQMutex; +class TQThread; +#endif // TQT_THREAD_SUPPORT + + +class TQApplication; +extern TQ_EXPORT TQApplication *tqApp; // global application object + + +class TQ_EXPORT TQApplication : public TQObject +{ + TQ_OBJECT +public: + TQApplication( int &argc, char **argv ); + TQApplication( int &argc, char **argv, bool GUIenabled ); + TQApplication( int &argc, char **argv, bool GUIenabled, bool SMenabled ); + enum Type { Tty, GuiClient, GuiServer }; + TQApplication( int &argc, char **argv, Type ); +#if defined(TQ_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 TQT_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 TQT_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 TQT_NO_PALETTE + static TQPalette palette( const TQWidget* = 0 ); + static TQPalette palette( TQStringList ); + 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 TQT_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 TQT_NO_TRANSLATION +# ifndef TQT_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 TQT_NO_DIR + TQString applicationDirPath(); + TQString applicationFilePath(); +#endif +#ifndef TQT_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 TQT_NO_WHEELEVENT + static void setWheelScrollLines( int ); + static int wheelScrollLines(); +#endif + static void setGlobalStrut( const TQSize & ); + static TQSize globalStrut(); + +#ifndef TQT_NO_COMPONENT + static void setLibraryPaths( const TQStringList & ); + static TQStringList libraryPaths(); + static void addLibraryPath( const TQString & ); + static void removeLibraryPath( const TQString & ); +#endif // TQT_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(TQ_WS_MAC) + virtual bool macEventFilter( EventHandlerCallRef, EventRef ); +#endif +#if defined(TQ_WS_WIN) + virtual bool winEventFilter( MSG * ); +#endif +#if defined(TQ_WS_X11) + virtual bool x11EventFilter( XEvent * ); + virtual int x11ClientMessage( TQWidget*, XEvent*, bool passive_only); + int x11ProcessEvent( XEvent* ); +#endif + +#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) + static WindowsVersion winVersion(); +#elif defined(Q_OS_MAC) + static MacintoshVersion macVersion(); +#endif +#if defined(TQ_WS_WIN) + void winFocus( TQWidget *, bool ); + static void winMouseButtonUp(); +#endif + +#ifndef TQT_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(TQ_WS_X11) +#if !defined(TQT_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(TQT_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(); + +protected: + bool event(TQEvent *); + +private: + void construct( int &argc, char **argv, Type, bool enable_sm ); + void initialize( int, char **, bool enable_sm = true ); + void init_precmdline(); + void process_cmdline( int* argcptr, char ** argv ); + bool internalNotify( TQObject *, TQEvent * ); + +#if defined(TQ_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 tqt_init(int *, char **, TQApplication::Type); +#endif + +#if defined(TQ_WS_X11) +private slots: + void postIMEvent( TQObject *receiver, TQIMEvent *event ); +#endif + +public: +#ifdef TQT_THREAD_SUPPORT + static TQMutex *tqt_mutex; +#endif // TQT_THREAD_SUPPORT + +private: + int app_argc; + char **app_argv; + bool quit_now; + int quit_code; + static TQStyle *app_style; + static int app_cspec; +#ifndef TQT_NO_PALETTE + static TQPalette *app_pal; +#endif + static TQFont *app_font; +#ifndef TQT_NO_CURSOR + static TQCursor *app_cursor; +#endif +#ifndef TQT_THREAD_SUPPORT + static TQEventLoop* eventloop; +#endif + 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 TQT_NO_SESSIONMANAGER + TQSessionManager *session_manager; + TQString session_id; + static TQString* session_key; + bool is_session_restored; +#endif +#if defined(TQ_WS_X11) +#if !defined (TQT_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 TQT_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 TQObject; + friend class TQWidget; + friend class TQETWidget; + friend class TQDialog; + friend class TQAccelManager; + friend class TQEvent; +#ifdef TQT_THREAD_SUPPORT + friend class TQThread; +#endif // TQT_THREAD_SUPPORT + friend class TQTranslator; + friend class TQEventLoop; + friend TQ_EXPORT void tqt_ucm_initialize( TQApplication * ); +#if defined(TQ_WS_WIN) + friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* ); +#endif +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQApplication( const TQApplication & ); + TQApplication &operator=( const TQApplication & ); +#endif + +private: + static TQEventLoop* currentEventLoop(); + +public: +#ifdef TQT_THREAD_SUPPORT + static TQThread* guiThread(); + static void threadTerminationHandler( TQThread * ); +#endif + static bool isGuiThread(); +}; + +inline int TQApplication::argc() const +{ + return app_argc; +} + +inline char **TQApplication::argv() const +{ + return app_argv; +} + +#ifndef TQT_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 TQT_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; +} + +#ifdef TQT_NO_TRANSLATION +// Simple versions +inline TQString TQApplication::translate( const char *, const char *sourceText, + const char *, Encoding encoding ) const +{ +#ifndef TQT_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/tqapplication_p.h b/src/kernel/tqapplication_p.h new file mode 100644 index 000000000..742870dc3 --- /dev/null +++ b/src/kernel/tqapplication_p.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Definition of some TQt private functions. +** +** Created : 000228 +** +** 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 TQAPPLICATION_P_H +#define TQAPPLICATION_P_H + + +// +// W A R N I N G +// ------------- +// +// This file is not part of the TQt API. It exists for the convenience +// of tqapplication_*.cpp, tqwidget*.cpp, tqcolor_x11.cpp, tqfiledialog.cpp +// and many other. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// +// + +#ifndef QT_H +#endif // QT_H + +class TQWidget; +class TQObject; +class TQClipboard; +class TQKeyEvent; +class TQMouseEvent; +class TQWheelEvent; + +extern TQ_EXPORT bool tqt_modal_state(); +extern TQ_EXPORT void tqt_enter_modal( TQWidget* ); +extern TQ_EXPORT void tqt_leave_modal( TQWidget* ); + +extern bool tqt_is_gui_used; +#ifndef TQT_NO_CLIPBOARD +extern TQClipboard *tqt_clipboard; +#endif + +#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) +extern TQt::WindowsVersion qt_winver; +const int QT_TABLET_NPACKETQSIZE = 128; +# ifdef Q_OS_TEMP + extern DWORD qt_cever; +# endif +#elif defined (Q_OS_MAC) +extern TQt::MacintoshVersion qt_macver; +#endif + +#if defined (TQ_WS_X11) +extern int qt_ncols_option; +#endif + + +extern void tqt_dispatchEnterLeave( TQWidget*, TQWidget* ); +extern bool tqt_tryModalHelper( TQWidget *, TQWidget ** = 0 ); + +#endif diff --git a/src/kernel/tqapplication_x11.cpp b/src/kernel/tqapplication_x11.cpp new file mode 100644 index 000000000..6744532f4 --- /dev/null +++ b/src/kernel/tqapplication_x11.cpp @@ -0,0 +1,6732 @@ +/**************************************************************************** +** +** Implementation of X11 startup routines and event handling +** +** 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. +** +**********************************************************************/ + +// ### 4.0: examine TQ_EXPORT's below. The respective symbols had all +// been in use (e.g. in the KDE wm ) before the introduction of a version +// map. One might want to turn some of them into propert public API and +// provide a proper alternative for others. See also the exports in +// tqapplication_win.cpp which suggest a unification. + +#include "qplatformdefs.h" + +// POSIX Large File Support redefines open -> open64 +#if defined(open) +# undef open +#endif + +// Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED. +#if defined(connect) +# undef connect +#endif + +// POSIX Large File Support redefines truncate -> truncate64 +#if defined(truncate) +# undef truncate +#endif + +#include "tqapplication.h" +#include "tqapplication_p.h" +#include "tqcolor_p.h" +#include "tqcursor.h" +#include "tqwidget.h" +#include "tqwidget_p.h" +#include "tqobjectlist.h" +#include "tqwidgetlist.h" +#include "tqwidgetintdict.h" +#include "tqbitarray.h" +#include "tqpainter.h" +#include "tqpixmapcache.h" +#include "tqdatetime.h" +#include "tqtextcodec.h" +#include "tqdatastream.h" +#include "tqbuffer.h" +#include "tqsocketnotifier.h" +#include "tqsessionmanager.h" +#include "tqvaluelist.h" +#include "tqdict.h" +#include "tqguardedptr.h" +#include "tqclipboard.h" +#include "tqwhatsthis.h" // ######## dependency +#include "tqsettings.h" +#include "tqstylefactory.h" +#include "tqfileinfo.h" + +// Input method stuff - UNFINISHED +#ifndef TQT_NO_IM +#include "tqinputcontext.h" +#endif // TQT_NO_IM +#include "tqinternal_p.h" // shared double buffer cleanup + +#if defined(TQT_THREAD_SUPPORT) +# include "tqthread.h" +#endif + +#if defined(QT_DEBUG) && defined(Q_OS_LINUX) +# include "tqfile.h" +#endif + +#include "tqt_x11_p.h" + +#if !defined(TQT_NO_XFTFREETYPE) +// XFree86 4.0.3 implementation is missing XftInitFtLibrary forward +extern "C" Bool XftInitFtLibrary(void); +#endif + +#include +#include +#include +#include +#include + +//#define X_NOT_BROKEN +#ifdef X_NOT_BROKEN +// Some X libraries are built with setlocale #defined to _Xsetlocale, +// even though library users are then built WITHOUT such a definition. +// This creates a problem - TQt might setlocale() one value, but then +// X looks and doesn't see the value TQt set. The solution here is to +// implement _Xsetlocale just in case X calls it - redirecting it to +// the real libC version. +// +# ifndef setlocale +extern "C" char *_Xsetlocale(int category, const char *locale); +char *_Xsetlocale(int category, const char *locale) +{ + //tqDebug("_Xsetlocale(%d,%s),category,locale"); + return setlocale(category,locale); +} +# endif // setlocale +#endif // X_NOT_BROKEN + + +// resolve the conflict between X11's FocusIn and TQEvent::FocusIn +const int XFocusOut = FocusOut; +const int XFocusIn = FocusIn; +#undef FocusOut +#undef FocusIn + +const int XKeyPress = KeyPress; +const int XKeyRelease = KeyRelease; +#undef KeyPress +#undef KeyRelease + + +// Fix old X libraries +#ifndef XK_KP_Home +#define XK_KP_Home 0xFF95 +#endif +#ifndef XK_KP_Left +#define XK_KP_Left 0xFF96 +#endif +#ifndef XK_KP_Up +#define XK_KP_Up 0xFF97 +#endif +#ifndef XK_KP_Right +#define XK_KP_Right 0xFF98 +#endif +#ifndef XK_KP_Down +#define XK_KP_Down 0xFF99 +#endif +#ifndef XK_KP_Prior +#define XK_KP_Prior 0xFF9A +#endif +#ifndef XK_KP_Next +#define XK_KP_Next 0xFF9B +#endif +#ifndef XK_KP_End +#define XK_KP_End 0xFF9C +#endif +#ifndef XK_KP_Insert +#define XK_KP_Insert 0xFF9E +#endif +#ifndef XK_KP_Delete +#define XK_KP_Delete 0xFF9F +#endif + + +/***************************************************************************** + Internal variables and functions + *****************************************************************************/ +static const char *appName; // application name +static const char *appClass; // application class +static const char *appFont = 0; // application font +static const char *appBGCol = 0; // application bg color +static const char *appFGCol = 0; // application fg color +static const char *appBTNCol = 0; // application btn color +static const char *mwGeometry = 0; // main widget geometry +static const char *mwTitle = 0; // main widget title +//Ming-Che 10/10 +TQ_EXPORT char *qt_ximServer = 0; // XIM Server will connect to +static bool mwIconic = FALSE; // main widget iconified +//Ming-Che 10/10 +static Display *appDpy = 0; // X11 application display +static char *appDpyName = 0; // X11 display name +static bool appForeignDpy = FALSE; // we didn't create display +static bool appSync = FALSE; // X11 synchronization +#if defined(QT_DEBUG) +static bool appNoGrab = FALSE; // X11 grabbing enabled +static bool appDoGrab = FALSE; // X11 grabbing override (gdb) +#endif +static int appScreen; // X11 screen number +static int appScreenCount; // X11 screen count +static bool app_save_rootinfo = FALSE; // save root info +static bool app_do_modal = FALSE; // modal mode +static Window curWin = 0; // current window + +static GC* app_gc_ro = 0; // read-only GC +static GC* app_gc_tmp = 0; // temporary GC +static GC* app_gc_ro_m = 0; // read-only GC (monochrome) +static GC* app_gc_tmp_m = 0; // temporary GC (monochrome) +// symbols needed by extern TQXEmbed class +TQ_EXPORT Atom tqt_wm_protocols = 0; // window manager protocols +TQ_EXPORT Atom tqt_wm_delete_window = 0; // delete window protocol +TQ_EXPORT Atom tqt_wm_take_focus = 0; // take focus window protocol + +Atom qt_qt_scrolldone = 0; // scroll synchronization +Atom qt_net_wm_context_help = 0; // context help +Atom qt_net_wm_ping = 0; // _NET_WM_PING protocol + +static Atom qt_xsetroot_id = 0; +Atom qt_xa_clipboard = 0; +Atom qt_selection_property = 0; +Atom tqt_clipboard_sentinel = 0; +Atom qt_selection_sentinel = 0; +TQ_EXPORT Atom tqt_wm_state = 0; +Atom qt_wm_change_state = 0; +static Atom qt_settings_timestamp = 0; // TQt >=3 settings timestamp +static Atom qt_input_encoding = 0; // TQt desktop properties +static Atom qt_resource_manager = 0; // X11 Resource manager +Atom qt_sizegrip = 0; // sizegrip +Atom qt_wm_client_leader = 0; +TQ_EXPORT Atom tqt_window_role = 0; +TQ_EXPORT Atom tqt_sm_client_id = 0; +Atom qt_xa_motif_wm_hints = 0; +Atom qt_cde_running = 0; +Atom qt_twin_running = 0; +Atom qt_kwm_running = 0; +Atom qt_gbackground_properties = 0; +Atom qt_x_incr = 0; +Atom qt_utf8_string = 0; + +// detect broken window managers +Atom qt_sgi_desks_manager = 0; +bool qt_broken_wm = FALSE; +static void qt_detect_broken_window_manager(); + +// NET WM support +Atom qt_net_supported = 0; +Atom qt_net_wm_name = 0; +Atom qt_net_wm_icon_name = 0; +Atom qt_net_virtual_roots = 0; +Atom qt_net_workarea = 0; +Atom qt_net_wm_state = 0; +Atom qt_net_wm_state_modal = 0; +Atom qt_net_wm_state_max_v = 0; +Atom qt_net_wm_state_max_h = 0; +Atom qt_net_wm_state_fullscreen = 0; +Atom qt_net_wm_state_above = 0; +Atom qt_net_wm_action = 0; +Atom qt_net_wm_action_move = 0; +Atom qt_net_wm_action_resize = 0; +Atom qt_net_wm_action_minimize = 0; +Atom qt_net_wm_action_shade = 0; +Atom qt_net_wm_action_stick = 0; +Atom qt_net_wm_action_max_h = 0; +Atom qt_net_wm_action_max_v = 0; +Atom qt_net_wm_action_fullscreen = 0; +Atom qt_net_wm_action_change_desktop = 0; +Atom qt_net_wm_action_close = 0; +Atom qt_net_wm_action_above = 0; +Atom qt_net_wm_action_below = 0; +Atom qt_net_wm_window_type = 0; +Atom qt_net_wm_window_type_normal = 0; +Atom qt_net_wm_window_type_dialog = 0; +Atom qt_net_wm_window_type_toolbar = 0; +Atom qt_net_wm_window_type_menu = 0; +Atom qt_net_wm_window_type_utility = 0; +Atom qt_net_wm_window_type_splash = 0; +Atom qt_net_wm_window_type_override = 0; // KDE extension +Atom qt_net_wm_window_type_dropdown_menu = 0; +Atom qt_net_wm_window_type_popup_menu = 0; +Atom qt_net_wm_window_type_tooltip = 0; +Atom qt_net_wm_window_type_combo = 0; +Atom qt_net_wm_window_type_dnd = 0; +Atom qt_net_wm_frame_strut = 0; // KDE extension +Atom qt_net_wm_state_stays_on_top = 0; // KDE extension +Atom qt_net_wm_pid = 0; +Atom qt_net_wm_user_time = 0; +Atom qt_net_wm_full_placement = 0; // KDE extension +// Enlightenment support +Atom qt_enlightenment_desktop = 0; + +// window managers list of supported "stuff" +Atom *qt_net_supported_list = 0; +// list of virtual root windows +Window *qt_net_virtual_root_list = 0; + + +// X11 SYNC support +#ifndef TQT_NO_XSYNC +Atom qt_net_wm_sync_request_counter = 0; +Atom qt_net_wm_sync_request = 0; +#endif + +// client leader window +Window qt_x11_wm_client_leader = 0; + +// function to update the workarea of the screen - in tqdesktopwidget_x11.cpp +extern void qt_desktopwidget_update_workarea(); + +// current focus model +static const int FocusModel_Unknown = -1; +static const int FocusModel_Other = 0; +static const int FocusModel_PointerRoot = 1; +static int qt_focus_model = -1; + +#ifndef TQT_NO_XRANDR +// TRUE if TQt is compiled w/ XRandR support and XRandR exists on the connected +// Display +bool qt_use_xrandr = FALSE; +static int xrandr_eventbase; +#endif + +// TRUE if TQt is compiled w/ XRender support and XRender exists on the connected +// Display +TQ_EXPORT bool tqt_use_xrender = FALSE; + +#ifndef TQT_NO_XSYNC +// True if SYNC extension exists on the connected display +bool qt_use_xsync = FALSE; +static int xsync_eventbase; +static int xsync_errorbase; +#endif + +// modifier masks for alt/meta - detected when the application starts +static long qt_alt_mask = 0; +static long qt_meta_mask = 0; +// modifier mask to remove mode switch from modifiers that have alt/meta set +// this problem manifests itself on HP/UX 10.20 at least, and without it +// modifiers do not work at all... +static long qt_mode_switch_remove_mask = 0; + +// flags for extensions for special Languages, currently only for RTL languages +static bool qt_use_rtl_extensions = FALSE; +TQ_EXPORT bool tqt_hebrew_keyboard_hack = FALSE; + +static Window mouseActWindow = 0; // window where mouse is +static int mouseButtonPressed = 0; // last mouse button pressed +static int mouseButtonState = 0; // mouse button state +static Time mouseButtonPressTime = 0; // when was a button pressed +static short mouseXPos, mouseYPos; // mouse pres position in act window +static short mouseGlobalXPos, mouseGlobalYPos; // global mouse press position + +extern TQWidgetList *tqt_modal_stack; // stack of modal widgets +static bool ignoreNextMouseReleaseEvent = FALSE; // ignore the next mouse release + // event if return from a modal + // widget + +static TQWidget *popupButtonFocus = 0; +static TQWidget *popupOfPopupButtonFocus = 0; +static bool popupCloseDownMode = FALSE; +static bool popupGrabOk; + +static bool sm_blockUserInput = FALSE; // session management + +int qt_xfocusout_grab_counter = 0; + +#if defined (QT_TABLET_SUPPORT) +// since XInput event classes aren't created until we actually open an XInput +// device, here is a static list that we will use later on... +const int INVALID_EVENT = -1; +const int TOTAL_XINPUT_EVENTS = 7; + +XDevice *devStylus = NULL; +XDevice *devEraser = NULL; +XEventClass event_list_stylus[TOTAL_XINPUT_EVENTS]; +XEventClass event_list_eraser[TOTAL_XINPUT_EVENTS]; + +int qt_curr_events_stylus = 0; +int qt_curr_events_eraser = 0; + +// well, luckily we only need to do this once. +static int xinput_motion = INVALID_EVENT; +static int xinput_key_press = INVALID_EVENT; +static int xinput_key_release = INVALID_EVENT; +static int xinput_button_press = INVALID_EVENT; +static int xinput_button_release = INVALID_EVENT; + +// making this assumption on XFree86, since we can only use 1 device, +// the pressure for the eraser and the stylus should be the same, if they aren't +// well, they certainly have a strange pen then... +static int max_pressure; +extern bool chokeMouse; +#endif + +// last timestamp read from TQSettings +static uint appliedstamp = 0; + + +typedef int (*QX11EventFilter) (XEvent*); +QX11EventFilter tqt_set_x11_event_filter(QX11EventFilter filter); + +static QX11EventFilter qt_x11_event_filter = 0; +TQ_EXPORT QX11EventFilter tqt_set_x11_event_filter(QX11EventFilter filter) +{ + QX11EventFilter old_filter = qt_x11_event_filter; + qt_x11_event_filter = filter; + return old_filter; +} +static bool qt_x11EventFilter( XEvent* ev ) +{ + if ( qt_x11_event_filter && qt_x11_event_filter( ev ) ) + return TRUE; + return tqApp->x11EventFilter( ev ); +} + + + + + +#if !defined(TQT_NO_XIM) +//XIM qt_xim = 0; +TQ_EXPORT XIMStyle qt_xim_style = 0; +TQ_EXPORT XIMStyle qt_xim_preferred_style = 0; +static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing; +#endif + +TQ_EXPORT int qt_ximComposingKeycode=0; +TQ_EXPORT TQTextCodec * qt_input_mapper = 0; + +TQ_EXPORT Time tqt_x_time = CurrentTime; +TQ_EXPORT Time tqt_x_user_time = CurrentTime; +extern bool qt_check_clipboard_sentinel(); //def in tqclipboard_x11.cpp +extern bool qt_check_selection_sentinel(); //def in tqclipboard_x11.cpp + +static void qt_save_rootinfo(); +bool tqt_try_modal( TQWidget *, XEvent * ); + +int qt_ncols_option = 216; // used in tqcolor_x11.cpp +int qt_visual_option = -1; +bool qt_cmap_option = FALSE; +TQWidget *qt_button_down = 0; // widget got last button-down + +extern bool tqt_tryAccelEvent( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp + +struct TQScrollInProgress { + static long serial; + TQScrollInProgress( TQWidget* w, int x, int y ) : + id( serial++ ), scrolled_widget( w ), dx( x ), dy( y ) {} + long id; + TQWidget* scrolled_widget; + int dx, dy; +}; +long TQScrollInProgress::serial=0; +static TQPtrList *sip_list = 0; + + +// stuff in qt_xdnd.cpp +// setup +extern void qt_xdnd_setup(); +// x event handling +extern void qt_handle_xdnd_enter( TQWidget *, const XEvent *, bool ); +extern void qt_handle_xdnd_position( TQWidget *, const XEvent *, bool ); +extern void qt_handle_xdnd_status( TQWidget *, const XEvent *, bool ); +extern void qt_handle_xdnd_leave( TQWidget *, const XEvent *, bool ); +extern void qt_handle_xdnd_drop( TQWidget *, const XEvent *, bool ); +extern void qt_handle_xdnd_finished( TQWidget *, const XEvent *, bool ); +extern void qt_xdnd_handle_selection_request( const XSelectionRequestEvent * ); +extern bool qt_xdnd_handle_badwindow(); + +extern void qt_motifdnd_handle_msg( TQWidget *, const XEvent *, bool ); +extern void qt_x11_motifdnd_init(); + +// client message atoms +extern Atom qt_xdnd_enter; +extern Atom qt_xdnd_position; +extern Atom qt_xdnd_status; +extern Atom qt_xdnd_leave; +extern Atom qt_xdnd_drop; +extern Atom qt_xdnd_finished; +// xdnd selection atom +extern Atom qt_xdnd_selection; +extern bool qt_xdnd_dragging; + +// gui or non-gui from tqapplication.cpp +extern bool tqt_is_gui_used; +extern bool tqt_app_has_font; + +static bool qt_x11_cmdline_font = false; + + +extern bool tqt_resolve_symlinks; // from tqapplication.cpp + +// Paint event clipping magic +extern void qt_set_paintevent_clipping( TQPaintDevice* dev, const TQRegion& region); +extern void qt_clear_paintevent_clipping(); + + +// Palette handling +extern TQPalette *tqt_std_pal; +extern void tqt_create_std_palette(); + +void qt_x11_intern_atom( const char *, Atom * ); + +static TQPtrList* deferred_map_list = 0; +static void qt_deferred_map_cleanup() +{ + delete deferred_map_list; + deferred_map_list = 0; +} +void qt_deferred_map_add( TQWidget* w) +{ + if ( !deferred_map_list ) { + deferred_map_list = new TQPtrList; + tqAddPostRoutine( qt_deferred_map_cleanup ); + } + deferred_map_list->append( w ); +} +void qt_deferred_map_take( TQWidget* w ) +{ + if (deferred_map_list ) { + deferred_map_list->remove( w ); + } +} +bool qt_deferred_map_contains( TQWidget* w ) +{ + if (!deferred_map_list) + return FALSE; + else + return deferred_map_list->contains( w ); +} + + +class TQETWidget : public TQWidget // event translator widget +{ +public: + void setWState( WFlags f ) { TQWidget::setWState(f); } + void clearWState( WFlags f ) { TQWidget::clearWState(f); } + void setWFlags( WFlags f ) { TQWidget::setWFlags(f); } + void clearWFlags( WFlags f ) { TQWidget::clearWFlags(f); } + bool translateMouseEvent( const XEvent * ); + bool translateKeyEventInternal( const XEvent *, int& count, TQString& text, int& state, char& ascii, int &code, TQEvent::Type &type, bool willRepeat=FALSE, bool statefulTranslation=TRUE ); + bool translateKeyEvent( const XEvent *, bool grab ); + bool translatePaintEvent( const XEvent * ); + bool translateConfigEvent( const XEvent * ); + bool translateCloseEvent( const XEvent * ); + bool translateScrollDoneEvent( const XEvent * ); + bool translateWheelEvent( int global_x, int global_y, int delta, int state, Orientation orient ); +#if defined (QT_TABLET_SUPPORT) + bool translateXinputEvent( const XEvent* ); +#endif + bool translatePropertyEvent(const XEvent *); +}; + + + + +// ************************************************************************ +// Input Method support +// ************************************************************************ + +/*! + An identifier name of the default input method. +*/ +TQString TQApplication::defaultIM = "imsw-multi"; + + +/*! + This function handles the query about location of the widget + holding the TQInputContext instance for widget \a w. + + The input context is used for text input to widget \a w. By + default, it returns the top-level widget of \a w. + + If you want to change the mapping of widget \w to TQInputContext + instance, reimplement both this function and + TQApplication::icHolderWidgets(). For example, suppose a tabbed web + browser. The browser should allocate a input context per tab + widget because users may switch the tabs and input a new text + during previous input contexts live. + + See also 'Sharing input context between text widgets' and 'Preedit + preservation' section of the class description of TQInputContext. + + \sa TQInputContext, icHolderWidgets() +*/ +TQWidget *TQApplication::locateICHolderWidget( TQWidget *w ) +{ + return w->topLevelWidget(); +} + + +/*! + This function returns all widgets holding TQInputContext. + + By default, This function returns top-level widgets. So if you + want to change the mapping of a widget to TQInputContext instance, + you must override this function and locateICHolderWidget(). + + \sa locateICHolderWidget() +*/ +TQWidgetList *TQApplication::icHolderWidgets() +{ + return TQApplication::topLevelWidgets(); +} + + +/*! + This function replaces all TQInputContext instances in the + application. The function's argument is the identifier name of + the newly selected input method. +*/ +void TQApplication::changeAllInputContext( const TQString &identifierName ) +{ + TQWidgetList *list = tqApp->icHolderWidgets(); + TQWidgetListIt it(*list); + while(it.current()) { + it.current()->changeInputContext( identifierName ); + ++it; + } + delete list; + + // defaultIM = identifierName ; // Change of defaultIM -- default input method -- may be enabled. +} + + +/*! + \internal + This is an internal function, you should never call this. + + \sa TQInputContext::imEventGenerated() +*/ +void TQApplication::postIMEvent( TQObject *receiver, TQIMEvent *event ) +{ + if ( event->type() == TQEvent::IMCompose ) { + // enable event compression to reduce preedit flicker on fast + // typing + postEvent( receiver, event ); + } else { + // cancel queued preedit update + if ( event->type() == TQEvent::IMEnd ) + removePostedEvents( receiver, TQEvent::IMCompose ); + + // to avoid event receiving order inversion between TQKeyEvent + // and TQIMEvent, we must send IMStart and IMEnd via + // sendEvent(). + sendEvent( receiver, event ); + delete event; + } +} + + +/*! + This function returns the identifier name of the default input + method in this Application. The value is identical to the value of + TQApplication::defaultIM. +*/ +TQString TQApplication::defaultInputMethod() +{ + return TQApplication::defaultIM; +} + + +#if !defined(TQT_NO_IM_EXTENSIONS) +/*! \internal + Creates the application input method. +*/ +void TQApplication::create_im() +{ +#ifndef TQT_NO_XIM + if ( ! qt_xim_preferred_style ) // no configured input style, use the default + qt_xim_preferred_style = xim_default_style; +#endif // TQT_NO_XIM +} + + +/*! \internal + Closes the application input method. +*/ +void TQApplication::close_im() +{ + TQWidgetList *list = tqApp->icHolderWidgets(); + TQWidgetListIt it(*list); + while(it.current()) { + it.current()->destroyInputContext(); + ++it; + } + delete list; +} + +#else + +/*! \internal + Creates the application input method. +*/ +void TQApplication::create_xim() +{ +#ifndef TQT_NO_XIM + if ( ! qt_xim_preferred_style ) // no configured input style, use the default + qt_xim_preferred_style = xim_default_style; +#endif // TQT_NO_XIM + + TQWidgetList *list= tqApp->topLevelWidgets(); + TQWidgetListIt it(*list); + TQWidget * w; + while( (w=it.current()) != 0 ) { + ++it; + w->createTLSysExtra(); + } + delete list; +} + + + /*! \internal + Closes the application input method. + */ +void TQApplication::close_xim() +{ +#ifndef TQT_NO_XIM + // Calling XCloseIM gives a Purify FMR error + // XCloseIM( qt_xim ); + // We prefer a less serious memory leak + + // if ( qt_xim ) + // qt_xim = 0; + +#endif // TQT_NO_XIM + TQWidgetList *list = tqApp->topLevelWidgets(); + TQWidgetListIt it(*list); + while(it.current()) { + it.current()->destroyInputContext(); + ++it; + } + delete list; +} +#endif + +/***************************************************************************** + Default X error handlers + *****************************************************************************/ + +#if defined(Q_C_CALLBACKS) +extern "C" { +#endif + +static bool x11_ignore_badwindow; +static bool x11_badwindow; + + // starts to ignore bad window errors from X +void qt_ignore_badwindow() +{ + x11_ignore_badwindow = TRUE; + x11_badwindow = FALSE; +} + + // ends ignoring bad window errors and returns whether an error + // had happen. +bool qt_badwindow() +{ + x11_ignore_badwindow = FALSE; + return x11_badwindow; +} + +static int (*original_x_errhandler)( Display *dpy, XErrorEvent * ); +static int (*original_xio_errhandler)( Display *dpy ); + +static int qt_x_errhandler( Display *dpy, XErrorEvent *err ) +{ + if ( err->error_code == BadWindow ) { + x11_badwindow = TRUE; + if ( err->request_code == 25 /* X_SendEvent */ && + qt_xdnd_handle_badwindow() ) + return 0; + if ( x11_ignore_badwindow ) + return 0; + } else if ( err->error_code == BadMatch && + err->request_code == 42 /* X_SetInputFocus */ ) { + return 0; + } + + char errstr[256]; + XGetErrorText( dpy, err->error_code, errstr, 256 ); + tqWarning( "X Error: %s %d\n" + " Major opcode: %d\n" + " Minor opcode: %d\n" + " Resource id: 0x%lx", + errstr, err->error_code, + err->request_code, + err->minor_code, + err->resourceid ); + + // ### we really should distinguish between severe, non-severe and + // ### application specific errors + + return 0; +} + + +static int qt_xio_errhandler( Display * ) +{ + tqWarning( "%s: Fatal IO error: client killed", appName ); + tqApp = 0; + exit( 1 ); + //### give the application a chance for a proper shutdown instead, + //### exit(1) doesn't help. + return 0; +} + +#if defined(Q_C_CALLBACKS) +} +#endif + + +// Memory leak: if the app exits before tqt_init_internal(), this dict +// isn't released correctly. +static TQAsciiDict *atoms_to_be_created = 0; +static bool create_atoms_now = 0; + +/***************************************************************************** + qt_x11_intern_atom() - efficiently interns an atom, now or later. + + If the application is being initialized, this function stores the + adddress of the atom and tqt_init_internal will do the actual work + quickly. If the application is running, the atom is created here. + + Neither argument may point to temporary variables. + *****************************************************************************/ + +void qt_x11_intern_atom( const char *name, Atom *result) +{ + if ( !name || !result || *result ) + return; + + if ( create_atoms_now ) { + *result = XInternAtom( appDpy, name, False ); + } else { + if ( !atoms_to_be_created ) { + atoms_to_be_created = new TQAsciiDict; + atoms_to_be_created->setAutoDelete( FALSE ); + } + atoms_to_be_created->insert( name, result ); + *result = 0; + } +} + + +static void tqt_x11_process_intern_atoms() +{ + if ( atoms_to_be_created ) { +#if defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6) + int i = atoms_to_be_created->count(); + Atom * res = (Atom *)malloc( i * sizeof( Atom ) ); + Atom ** resp = (Atom **)malloc( i * sizeof( Atom* ) ); + char ** names = (char **)malloc( i * sizeof(const char*)); + + i = 0; + TQAsciiDictIterator it( *atoms_to_be_created ); + while( it.current() ) { + res[i] = 0; + resp[i] = it.current(); + names[i] = tqstrdup(it.currentKey()); + i++; + ++it; + } + XInternAtoms( appDpy, names, i, False, res ); + while( i ) { + i--; + delete [] names[i]; + if ( res[i] && resp[i] ) + *(resp[i]) = res[i]; + } + free( res ); + free( resp ); + free( names ); +#else + TQAsciiDictIterator it( *atoms_to_be_created ); + Atom * result; + const char * name; + while( (result = it.current()) != 0 ) { + name = it.currentKey(); + ++it; + *result = XInternAtom( appDpy, name, False ); + } +#endif + delete atoms_to_be_created; + atoms_to_be_created = 0; + create_atoms_now = TRUE; + } +} + + +/*! \internal + apply the settings to the application +*/ +bool TQApplication::x11_apply_settings() +{ + if (! tqt_std_pal) + tqt_create_std_palette(); + + Atom type; + int format; + long offset = 0; + unsigned long nitems, after = 1; + unsigned char *data = 0; + TQDateTime timestamp, settingsstamp; + bool update_timestamp = FALSE; + + if (XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow( 0 ), + qt_settings_timestamp, 0, 0, + False, AnyPropertyType, &type, &format, &nitems, + &after, &data) == Success && format == 8) { + if (data) + XFree(data); + + TQBuffer ts; + ts.open(IO_WriteOnly); + + while (after > 0) { + XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow( 0 ), + qt_settings_timestamp, + offset, 1024, False, AnyPropertyType, + &type, &format, &nitems, &after, &data); + if (format == 8) { + ts.writeBlock((const char *) data, nitems); + offset += nitems / 4; + } + + XFree(data); + } + + TQDataStream d(ts.buffer(), IO_ReadOnly); + d >> timestamp; + } + + TQSettings settings; + settingsstamp = settings.lastModificationTime( "/qt/font" ); + if (! settingsstamp.isValid()) + return FALSE; + + if ( appliedstamp && appliedstamp == settingsstamp.toTime_t() ) + return TRUE; + appliedstamp = settingsstamp.toTime_t(); + + if (! timestamp.isValid() || settingsstamp > timestamp) + update_timestamp = TRUE; + + /* + TQt settings. This is now they are written into the datastream. + + /qt/Palette/ * - TQPalette + /qt/font - TQFont + /qt/libraryPath - TQStringList + /qt/style - TQString + /qt/doubleClickInterval - int + /qt/cursorFlashTime - int + /qt/wheelScrollLines - int + /qt/colorSpec - TQString + /qt/defaultCodec - TQString + /qt/globalStrut - TQSize + /qt/GUIEffects - TQStringList + /qt/Font Substitutions/ * - TQStringList + /qt/Font Substitutions/... - TQStringList + */ + + TQString str; + TQStringList strlist; + int i, num; + TQPalette pal(TQApplication::palette()); + strlist = settings.readListEntry("/qt/Palette/active"); + if (strlist.count() == TQColorGroup::NColorRoles) { + for (i = 0; i < TQColorGroup::NColorRoles; i++) + pal.setColor(TQPalette::Active, (TQColorGroup::ColorRole) i, + TQColor(strlist[i])); + } + strlist = settings.readListEntry("/qt/Palette/inactive"); + if (strlist.count() == TQColorGroup::NColorRoles) { + for (i = 0; i < TQColorGroup::NColorRoles; i++) + pal.setColor(TQPalette::Inactive, (TQColorGroup::ColorRole) i, + TQColor(strlist[i])); + } + strlist = settings.readListEntry("/qt/Palette/disabled"); + if (strlist.count() == TQColorGroup::NColorRoles) { + for (i = 0; i < TQColorGroup::NColorRoles; i++) + pal.setColor(TQPalette::Disabled, (TQColorGroup::ColorRole) i, + TQColor(strlist[i])); + } + + // workaround for KDE 3.0, which messes up the buttonText value of + // the disabled palette in TQSettings + if ( pal.disabled().buttonText() == pal.active().buttonText() ) { + pal.setColor( TQPalette::Disabled, TQColorGroup::ButtonText, + pal.disabled().foreground() ); + } + + if (pal != *tqt_std_pal && pal != TQApplication::palette()) { + TQApplication::setPalette(pal, TRUE); + *tqt_std_pal = pal; + } + + TQFont font(TQApplication::font()); + if ( !tqt_app_has_font && !qt_x11_cmdline_font ) { + // read new font + str = settings.readEntry("/qt/font"); + if (! str.isNull() && ! str.isEmpty()) { + font.fromString(str); + + if (font != TQApplication::font()) + TQApplication::setFont(font, TRUE); + } + } + + // read library (ie. plugin) path list + TQString libpathkey = + TQString("/qt/%1.%2/libraryPath").arg( TQT_VERSION >> 16 ).arg( (TQT_VERSION & 0xff00 ) >> 8 ); + TQStringList pathlist = settings.readListEntry(libpathkey, ':'); + if (! pathlist.isEmpty()) { + TQStringList::ConstIterator it = pathlist.begin(); + while (it != pathlist.end()) + TQApplication::addLibraryPath(*it++); + } + + // read new TQStyle + extern bool tqt_explicit_app_style; // defined in tqapplication.cpp + TQString stylename = settings.readEntry( "/qt/style" ); + if ( !stylename.isEmpty() && !tqt_explicit_app_style ) { + TQApplication::setStyle( stylename ); + // took the style from the user settings, so mark the explicit flag FALSE + tqt_explicit_app_style = FALSE; + } + + num = + settings.readNumEntry("/qt/doubleClickInterval", + TQApplication::doubleClickInterval()); + TQApplication::setDoubleClickInterval(num); + + num = + settings.readNumEntry("/qt/cursorFlashTime", + TQApplication::cursorFlashTime()); + TQApplication::setCursorFlashTime(num); + + num = + settings.readNumEntry("/qt/wheelScrollLines", + TQApplication::wheelScrollLines()); + TQApplication::setWheelScrollLines(num); + + TQString colorspec = settings.readEntry("/qt/colorSpec", "default"); + if (colorspec == "normal") + TQApplication::setColorSpec(TQApplication::NormalColor); + else if (colorspec == "custom") + TQApplication::setColorSpec(TQApplication::CustomColor); + else if (colorspec == "many") + TQApplication::setColorSpec(TQApplication::ManyColor); + else if (colorspec != "default") + colorspec = "default"; + + TQString defaultcodec = settings.readEntry("/qt/defaultCodec", "none"); + if (defaultcodec != "none") { + TQTextCodec *codec = TQTextCodec::codecForName(defaultcodec); + if (codec) + tqApp->setDefaultCodec(codec); + } + + TQStringList strut = settings.readListEntry("/qt/globalStrut"); + if (! strut.isEmpty()) { + if (strut.count() == 2) { + TQSize sz(strut[0].toUInt(), strut[1].toUInt()); + + if (sz.isValid()) + TQApplication::setGlobalStrut(sz); + } + } + + TQStringList effects = settings.readListEntry("/qt/GUIEffects"); + + TQApplication::setEffectEnabled( TQt::UI_General, effects.contains("general") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, effects.contains("animatemenu") ); + TQApplication::setEffectEnabled( TQt::UI_FadeMenu, effects.contains("fademenu") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, effects.contains("animatecombo") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, effects.contains("animatetooltip") ); + TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, effects.contains("fadetooltip") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateToolBox, effects.contains("animatetoolbox") ); + + TQStringList fontsubs = + settings.entryList("/qt/Font Substitutions"); + if (!fontsubs.isEmpty()) { + TQStringList subs; + TQString fam, skey; + TQStringList::Iterator it = fontsubs.begin(); + while (it != fontsubs.end()) { + fam = (*it++); + skey = "/qt/Font Substitutions/" + fam; + subs = settings.readListEntry(skey); + TQFont::insertSubstitutions(fam, subs); + } + } + + qt_broken_wm = + settings.readBoolEntry("/qt/brokenWindowManager", qt_broken_wm); + + tqt_resolve_symlinks = + settings.readBoolEntry("/qt/resolveSymlinks", TRUE); + + qt_use_rtl_extensions = + settings.readBoolEntry("/qt/useRtlExtensions", FALSE); + +#ifndef TQT_NO_XIM + if (qt_xim_preferred_style == 0) { + TQString ximInputStyle = + settings.readEntry( "/qt/XIMInputStyle", + TQString::fromLatin1( "On The Spot" ) ).lower(); + if ( ximInputStyle == "over the spot" ) + qt_xim_preferred_style = XIMPreeditPosition | XIMStatusNothing; + else if ( ximInputStyle == "off the spot" ) + qt_xim_preferred_style = XIMPreeditArea | XIMStatusArea; + else if ( ximInputStyle == "root" ) + qt_xim_preferred_style = XIMPreeditNothing | XIMStatusNothing; + else // ximInputStyle == "on the spot" or others + qt_xim_preferred_style = XIMPreeditCallbacks | XIMStatusNothing; + } +#endif + +#ifndef TQT_NO_IM + /* + The identifier name of an input method is acquired from the + configuration file as a default. If a environment variable + "TQT_IM_SWITCHER" is not empty it will overwrite the + configuration file. The "imsw-multi" becomes the default if the entry + is not configured. + */ + if ( getenv( "TQT_IM_SWITCHER" ) ) + defaultIM = getenv( "TQT_IM_SWITCHER" ); +#ifndef TQT_NO_IM_EXTENSIONS + else + defaultIM = settings.readEntry( "/qt/DefaultInputMethodSwitcher", "imsw-multi" ); +#endif + + // defaultIM is restricted to be an IM-switcher. An IM-switcher + // has a 'imsw-' prefix + if ( ! defaultIM.startsWith( "imsw-" ) ) { + defaultIM = "imsw-multi"; + } +#endif + + if (update_timestamp) { + TQBuffer stamp; + TQDataStream s(stamp.buffer(), IO_WriteOnly); + s << settingsstamp; + + XChangeProperty(appDpy, TQPaintDevice::x11AppRootWindow( 0 ), + qt_settings_timestamp, qt_settings_timestamp, 8, + PropModeReplace, (unsigned char *) stamp.buffer().data(), + stamp.buffer().size()); + } + + return TRUE; +} + + +// read the _QT_INPUT_ENCODING property and apply the settings to +// the application +static void qt_set_input_encoding() +{ + Atom type; + int format; + ulong nitems, after = 1; + const char *data; + + int e = XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), + qt_input_encoding, 0, 1024, + False, XA_STRING, &type, &format, &nitems, + &after, (unsigned char**)&data ); + if ( e != Success || !nitems || type == None ) { + // Always use the locale codec, since we have no examples of non-local + // XIMs, and since we cannot get a sensible answer about the encoding + // from the XIM. + qt_input_mapper = TQTextCodec::codecForLocale(); + + } else { + if ( !tqstricmp( data, "locale" ) ) + qt_input_mapper = TQTextCodec::codecForLocale(); + else + qt_input_mapper = TQTextCodec::codecForName( data ); + // make sure we have an input codec + if( !qt_input_mapper ) + qt_input_mapper = TQTextCodec::codecForName( "ISO 8859-1" ); + } + if ( qt_input_mapper->mibEnum() == 11 ) // 8859-8 + qt_input_mapper = TQTextCodec::codecForName( "ISO 8859-8-I"); + if( data ) + XFree( (char *)data ); +} + +// set font, foreground and background from x11 resources. The +// arguments may override the resource settings. +static void qt_set_x11_resources( const char* font = 0, const char* fg = 0, + const char* bg = 0, const char* button = 0 ) +{ + if ( !tqt_std_pal ) + tqt_create_std_palette(); + + TQCString resFont, resFG, resBG, resEF, sysFont; + + TQApplication::setEffectEnabled( TQt::UI_General, FALSE); + TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, FALSE); + TQApplication::setEffectEnabled( TQt::UI_FadeMenu, FALSE); + TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, FALSE ); + TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, FALSE ); + TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, FALSE ); + TQApplication::setEffectEnabled( TQt::UI_AnimateToolBox, FALSE ); + + if ( TQApplication::desktopSettingsAware() && !TQApplication::x11_apply_settings() ) { + int format; + ulong nitems, after = 1; + TQCString res; + long offset = 0; + Atom type = None; + + while (after > 0) { + uchar *data; + XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow( 0 ), + qt_resource_manager, + offset, 8192, False, AnyPropertyType, + &type, &format, &nitems, &after, + &data ); + res += (char*)data; + offset += 2048; // offset is in 32bit quantities... 8192/4 == 2048 + if ( data ) + XFree( (char *)data ); + } + + TQCString key, value; + int l = 0, r; + TQCString apn = appName; + TQCString apc = appClass; + int apnl = apn.length(); + int apcl = apc.length(); + int resl = res.length(); + + while (l < resl) { + r = res.find( '\n', l ); + if ( r < 0 ) + r = resl; + while ( isspace((uchar) res[l]) ) + l++; + bool mine = FALSE; + if ( res[l] == '*' && + (res[l+1] == 'f' || res[l+1] == 'b' || res[l+1] == 'g' || + res[l+1] == 'F' || res[l+1] == 'B' || res[l+1] == 'G' || + res[l+1] == 's' || res[l+1] == 'S' ) ) { + // OPTIMIZED, since we only want "*[fbgs].." + + TQCString item = res.mid( l, r - l ).simplifyWhiteSpace(); + int i = item.find( ":" ); + key = item.left( i ).stripWhiteSpace().mid(1).lower(); + value = item.right( item.length() - i - 1 ).stripWhiteSpace(); + mine = TRUE; + } else if ( res[l] == appName[0] || (appClass && res[l] == appClass[0]) ) { + if (res.mid(l,apnl) == apn && (res[l+apnl] == '.' || res[l+apnl] == '*')) { + TQCString item = res.mid( l, r - l ).simplifyWhiteSpace(); + int i = item.find( ":" ); + key = item.left( i ).stripWhiteSpace().mid(apnl+1).lower(); + value = item.right( item.length() - i - 1 ).stripWhiteSpace(); + mine = TRUE; + } else if (res.mid(l,apcl) == apc && (res[l+apcl] == '.' || res[l+apcl] == '*')) { + TQCString item = res.mid( l, r - l ).simplifyWhiteSpace(); + int i = item.find( ":" ); + key = item.left( i ).stripWhiteSpace().mid(apcl+1).lower(); + value = item.right( item.length() - i - 1 ).stripWhiteSpace(); + mine = TRUE; + } + } + + if ( mine ) { + if ( !font && key == "systemfont") + sysFont = value.left( value.findRev(':') ).copy(); + if ( !font && key == "font") + resFont = value.copy(); + else if ( !fg && key == "foreground" ) + resFG = value.copy(); + else if ( !bg && key == "background") + resBG = value.copy(); + else if ( key == "guieffects") + resEF = value.copy(); + // NOTE: if you add more, change the [fbg] stuff above + } + + l = r + 1; + } + } + if ( !sysFont.isEmpty() ) + resFont = sysFont; + if ( resFont.isEmpty() ) + resFont = font; + if ( resFG.isEmpty() ) + resFG = fg; + if ( resBG.isEmpty() ) + resBG = bg; + if ( (!tqt_app_has_font || qt_x11_cmdline_font) && !resFont.isEmpty() ) { // set application font + TQFont fnt; + fnt.setRawName( resFont ); + + // the font we get may actually be an alias for another font, + // so we reset the application font to the real font info. + if ( ! fnt.exactMatch() ) { + TQFontInfo fontinfo( fnt ); + fnt.setFamily( fontinfo.family() ); + fnt.setRawMode( fontinfo.rawMode() ); + + if ( ! fnt.rawMode() ) { + fnt.setItalic( fontinfo.italic() ); + fnt.setWeight( fontinfo.weight() ); + fnt.setUnderline( fontinfo.underline() ); + fnt.setStrikeOut( fontinfo.strikeOut() ); + fnt.setStyleHint( fontinfo.styleHint() ); + + if ( fnt.pointSize() <= 0 && fnt.pixelSize() <= 0 ) + // size is all wrong... fix it + fnt.setPointSize( (int) ( ( fontinfo.pixelSize() * 72. / + (float) TQPaintDevice::x11AppDpiY() ) + + 0.5 ) ); + } + } + + if ( fnt != TQApplication::font() ) { + TQApplication::setFont( fnt, TRUE ); + } + } + + if ( button || !resBG.isEmpty() || !resFG.isEmpty() ) {// set app colors + TQColor btn; + TQColor bg; + TQColor fg; + if ( !resBG.isEmpty() ) + bg = TQColor(TQString(resBG)); + else + bg = tqt_std_pal->active().background(); + if ( !resFG.isEmpty() ) + fg = TQColor(TQString(resFG)); + else + fg = tqt_std_pal->active().foreground(); + if ( button ) + btn = TQColor( button ); + else if ( !resBG.isEmpty() ) + btn = bg; + else + btn = tqt_std_pal->active().button(); + + int h,s,v; + fg.hsv(&h,&s,&v); + TQColor base = TQt::white; + bool bright_mode = FALSE; + if (v >= 255-50) { + base = btn.dark(150); + bright_mode = TRUE; + } + + TQColorGroup cg( fg, btn, btn.light(), + btn.dark(), btn.dark(150), fg, TQt::white, base, bg ); + if (bright_mode) { + cg.setColor( TQColorGroup::HighlightedText, base ); + cg.setColor( TQColorGroup::Highlight, TQt::white ); + } else { + cg.setColor( TQColorGroup::HighlightedText, TQt::white ); + cg.setColor( TQColorGroup::Highlight, TQt::darkBlue ); + } + TQColor disabled( (fg.red()+btn.red())/2, + (fg.green()+btn.green())/2, + (fg.blue()+btn.blue())/2); + TQColorGroup dcg( disabled, btn, btn.light( 125 ), btn.dark(), btn.dark(150), + disabled, TQt::white, TQt::white, bg ); + if (bright_mode) { + dcg.setColor( TQColorGroup::HighlightedText, base ); + dcg.setColor( TQColorGroup::Highlight, TQt::white ); + } else { + dcg.setColor( TQColorGroup::HighlightedText, TQt::white ); + dcg.setColor( TQColorGroup::Highlight, TQt::darkBlue ); + } + TQPalette pal( cg, dcg, cg ); + if ( pal != *tqt_std_pal && pal != TQApplication::palette() ) + TQApplication::setPalette( pal, TRUE ); + *tqt_std_pal = pal; + } + + if ( !resEF.isEmpty() ) { + TQStringList effects = TQStringList::split(" ",resEF); + TQApplication::setEffectEnabled( TQt::UI_General, effects.contains("general") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, effects.contains("animatemenu") ); + TQApplication::setEffectEnabled( TQt::UI_FadeMenu, effects.contains("fademenu") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, effects.contains("animatecombo") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, effects.contains("animatetooltip") ); + TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, effects.contains("fadetooltip") ); + TQApplication::setEffectEnabled( TQt::UI_AnimateToolBox, effects.contains("animatetoolbox") ); + } +} + + +static void qt_detect_broken_window_manager() +{ + Atom type; + int format; + ulong nitems, after; + uchar *data = 0; + + // look for SGI's 4Dwm + int e = XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), + qt_sgi_desks_manager, 0, 1, False, XA_WINDOW, + &type, &format, &nitems, &after, &data); + if (data) + XFree(data); + + if (e == Success && type == XA_WINDOW && format == 32 && nitems == 1 && after == 0) { + // detected SGI 4Dwm + qt_broken_wm = TRUE; + } +} + + +// update the supported array +void qt_get_net_supported() +{ + Atom type; + int format; + long offset = 0; + unsigned long nitems, after; + unsigned char *data = 0; + + int e = XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), + qt_net_supported, 0, 0, + False, XA_ATOM, &type, &format, &nitems, &after, &data); + if (data) + XFree(data); + + if (qt_net_supported_list) + delete [] qt_net_supported_list; + qt_net_supported_list = 0; + + if (e == Success && type == XA_ATOM && format == 32) { + TQBuffer ts; + ts.open(IO_WriteOnly); + + while (after > 0) { + XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), + qt_net_supported, offset, 1024, + False, XA_ATOM, &type, &format, &nitems, &after, &data); + + if (type == XA_ATOM && format == 32) { + ts.writeBlock((const char *) data, nitems * sizeof(long)); + offset += nitems; + } else + after = 0; + if (data) + XFree(data); + } + + // compute nitems + TQByteArray buffer(ts.buffer()); + nitems = buffer.size() / sizeof(Atom); + qt_net_supported_list = new Atom[nitems + 1]; + Atom *a = (Atom *) buffer.data(); + uint i; + for (i = 0; i < nitems; i++) + qt_net_supported_list[i] = a[i]; + qt_net_supported_list[nitems] = 0; + } +} + + +bool qt_net_supports(Atom atom) +{ + if (! qt_net_supported_list) + return FALSE; + + bool supported = FALSE; + int i = 0; + while (qt_net_supported_list[i] != 0) { + if (qt_net_supported_list[i++] == atom) { + supported = TRUE; + break; + } + } + + return supported; +} + + +// update the virtual roots array +void qt_get_net_virtual_roots() +{ + if (qt_net_virtual_root_list) + delete [] qt_net_virtual_root_list; + qt_net_virtual_root_list = 0; + + if (! qt_net_supports(qt_net_virtual_roots)) + return; + + Atom type; + int format; + long offset = 0; + unsigned long nitems, after; + unsigned char *data; + + int e = XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), + qt_net_virtual_roots, 0, 0, + False, XA_ATOM, &type, &format, &nitems, &after, &data); + if (data) + XFree(data); + + if (e == Success && type == XA_ATOM && format == 32) { + TQBuffer ts; + ts.open(IO_WriteOnly); + + while (after > 0) { + XGetWindowProperty(appDpy, TQPaintDevice::x11AppRootWindow(), + qt_net_virtual_roots, offset, 1024, + False, XA_ATOM, &type, &format, &nitems, &after, &data); + + if (type == XA_ATOM && format == 32) { + ts.writeBlock((const char *) data, nitems * 4); + offset += nitems; + } else + after = 0; + if (data) + XFree(data); + } + + // compute nitems + TQByteArray buffer(ts.buffer()); + nitems = buffer.size() / sizeof(Window); + qt_net_virtual_root_list = new Window[nitems + 1]; + Window *a = (Window *) buffer.data(); + uint i; + for (i = 0; i < nitems; i++) + qt_net_virtual_root_list[i] = a[i]; + qt_net_virtual_root_list[nitems] = 0; + } +} + +void qt_x11_create_wm_client_leader() +{ + if ( qt_x11_wm_client_leader ) return; + + qt_x11_wm_client_leader = + XCreateSimpleWindow( TQPaintDevice::x11AppDisplay(), + TQPaintDevice::x11AppRootWindow(), + 0, 0, 1, 1, 0, 0, 0 ); + + // set client leader property to itself + XChangeProperty( TQPaintDevice::x11AppDisplay(), + qt_x11_wm_client_leader, qt_wm_client_leader, + XA_WINDOW, 32, PropModeReplace, + (unsigned char *)&qt_x11_wm_client_leader, 1 ); + + // If we are session managed, inform the window manager about it + TQCString session = tqApp->sessionId().latin1(); + if ( !session.isEmpty() ) { + XChangeProperty( TQPaintDevice::x11AppDisplay(), + qt_x11_wm_client_leader, tqt_sm_client_id, + XA_STRING, 8, PropModeReplace, + (unsigned char *)session.data(), session.length() ); + } +} + +static void qt_net_update_user_time(TQWidget *tlw) +{ + XChangeProperty(TQPaintDevice::x11AppDisplay(), tlw->winId(), qt_net_wm_user_time, XA_CARDINAL, + 32, PropModeReplace, (unsigned char *) &tqt_x_user_time, 1); +} + +static void qt_check_focus_model() +{ + Window fw = None; + int unused; + XGetInputFocus( appDpy, &fw, &unused ); + if ( fw == PointerRoot ) + qt_focus_model = FocusModel_PointerRoot; + else + qt_focus_model = FocusModel_Other; +} + + +/* + Returns a truecolor visual (if there is one). 8-bit TrueColor visuals + are ignored, unless the user has explicitly requested -visual TrueColor. + The SGI X server usually has an 8 bit default visual, but the application + can also ask for a truecolor visual. This is what we do if + TQApplication::colorSpec() is TQApplication::ManyColor. +*/ + +static Visual *find_truecolor_visual( Display *dpy, int scr, int *depth, int *ncols ) +{ + XVisualInfo *vi, rvi; + int best=0, n, i; + rvi.c_class = TrueColor; + rvi.screen = scr; + vi = XGetVisualInfo( dpy, VisualClassMask | VisualScreenMask, + &rvi, &n ); + if ( vi ) { + for ( i=0; i vi[best].depth ) + best = i; + } + } + Visual *v = DefaultVisual(dpy,scr); + if ( !vi || (vi[best].visualid == XVisualIDFromVisual(v)) || + (vi[best].depth <= 8 && qt_visual_option != TrueColor) ) + { + *depth = DefaultDepth(dpy,scr); + *ncols = DisplayCells(dpy,scr); + } else { + v = vi[best].visual; + *depth = vi[best].depth; + *ncols = vi[best].colormap_size; + } + if ( vi ) + XFree( (char *)vi ); + return v; +} + +static KeySym qt_x11_keycode_to_keysym(Display *dpy, KeyCode kc) { +#ifndef TQT_NO_XKB + return XkbKeycodeToKeysym(dpy, kc, 0, 0); +#else + KeySym rv = NoSymbol; + int keysyms_per_keycode; + KeySym *keysym_p = XGetKeyboardMapping(dpy, kc, 1, &keysyms_per_keycode); + if (keysyms_per_keycode>0) { //< Should always be true unless X server is bugged + rv = keysym_p[0]; + } + XFree(keysym_p); + + return rv; +#endif // TQT_NO_XKB +} + +/***************************************************************************** + tqt_init() - initializes TQt for X11 + *****************************************************************************/ + +#define XK_MISCELLANY +#define XK_LATIN1 +#define XK_KOREAN +#define XK_XKB_KEYS +#include + +// ### This should be static but it isn't because of the friend declaration +// ### in tqpaintdevice.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 tqt_init_internal( int *argcptr, char **argv, + Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) +{ + setlocale( LC_ALL, "" ); // use correct char set mapping + setlocale( LC_NUMERIC, "C" ); // make sprintf()/scanf() work + +#if defined(TQT_THREAD_SUPPORT) + if (( tqt_is_gui_used ) && ( !display )) { + // If TQt is running standalone with a GUI, initialize X11 threading + XInitThreads(); + } +#endif + + if ( display && ((!argcptr) || (!argv)) ) { + // TQt part of other application + + appForeignDpy = TRUE; + appDpy = display; + + // Set application name and class + appName = tqstrdup( "TQt-subapplication" ); + char *app_class = 0; + if (argv) { + const char* p = strrchr( argv[0], '/' ); + app_class = tqstrdup(p ? p + 1 : argv[0]); + if (app_class[0]) + app_class[0] = toupper(app_class[0]); + } + appClass = app_class; + + // Install default error handlers + original_x_errhandler = XSetErrorHandler( qt_x_errhandler ); + original_xio_errhandler = XSetIOErrorHandler( qt_xio_errhandler ); + } else { + // TQt controls everything (default) + + int argc = *argcptr; + int j; + + // Install default error handlers + original_x_errhandler = XSetErrorHandler( qt_x_errhandler ); + original_xio_errhandler = XSetIOErrorHandler( qt_xio_errhandler ); + + // Set application name and class + char *app_class = 0; + if (argv) { + const char *p = strrchr( argv[0], '/' ); + appName = p ? p + 1 : argv[0]; + app_class = tqstrdup(appName); + if (app_class[0]) + app_class[0] = toupper(app_class[0]); + } + appClass = app_class; + + // Get command line params + j = argc ? 1 : 0; + for ( int i=1; i 0 ) { + if ( c == '/' ) + s.truncate( 0 ); + else + s += (char)c; + } + if ( s == "gdb" ) { + appNoGrab = TRUE; + tqDebug( "TQt: gdb: -nograb added to command-line options.\n" + "\t Use the -dograb option to enforce grabbing." ); + } + f.close(); + } + } +#endif + if ( display ) { + // Display connection already opened by another application + + appForeignDpy = TRUE; + appDpy = display; + } + else { + // Connect to X server + + if( tqt_is_gui_used ) { + if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) { + tqWarning( "%s: cannot connect to X server %s", appName, + XDisplayName(appDpyName) ); + tqApp = 0; + exit( 1 ); + } + + if ( appSync ) // if "-sync" argument + XSynchronize( appDpy, TRUE ); + } + } + } + // Common code, regardless of whether display is foreign. + + // Get X parameters + + if( tqt_is_gui_used ) { + appScreen = DefaultScreen(appDpy); + appScreenCount = ScreenCount(appDpy); + + TQPaintDevice::x_appdisplay = appDpy; + TQPaintDevice::x_appscreen = appScreen; + + // allocate the arrays for the TQPaintDevice data + TQPaintDevice::x_appdepth_arr = new int[ appScreenCount ]; + TQPaintDevice::x_appcells_arr = new int[ appScreenCount ]; + TQPaintDevice::x_approotwindow_arr = new TQt::HANDLE[ appScreenCount ]; + TQPaintDevice::x_appcolormap_arr = new TQt::HANDLE[ appScreenCount ]; + TQPaintDevice::x_appdefcolormap_arr = new bool[ appScreenCount ]; + TQPaintDevice::x_appvisual_arr = new void*[ appScreenCount ]; + TQPaintDevice::x_appdefvisual_arr = new bool[ appScreenCount ]; + TQ_CHECK_PTR( TQPaintDevice::x_appdepth_arr ); + TQ_CHECK_PTR( TQPaintDevice::x_appcells_arr ); + TQ_CHECK_PTR( TQPaintDevice::x_approotwindow_arr ); + TQ_CHECK_PTR( TQPaintDevice::x_appcolormap_arr ); + TQ_CHECK_PTR( TQPaintDevice::x_appdefcolormap_arr ); + TQ_CHECK_PTR( TQPaintDevice::x_appvisual_arr ); + TQ_CHECK_PTR( TQPaintDevice::x_appdefvisual_arr ); + + int screen; + TQString serverVendor( ServerVendor( appDpy) ); + if (serverVendor.contains("XFree86") && VendorRelease(appDpy) < 40300000) + tqt_hebrew_keyboard_hack = TRUE; + + for ( screen = 0; screen < appScreenCount; ++screen ) { + TQPaintDevice::x_appdepth_arr[ screen ] = DefaultDepth(appDpy, screen); + TQPaintDevice::x_appcells_arr[ screen ] = DisplayCells(appDpy, screen); + TQPaintDevice::x_approotwindow_arr[ screen ] = RootWindow(appDpy, screen); + + // setup the visual and colormap for each screen + Visual *vis = 0; + if ( visual && screen == appScreen ) { + // use the provided visual on the default screen only + vis = (Visual *) visual; + + // figure out the depth of the visual we are using + XVisualInfo *vi, rvi; + int n; + rvi.visualid = XVisualIDFromVisual(vis); + rvi.screen = screen; + vi = XGetVisualInfo( appDpy, VisualIDMask | VisualScreenMask, &rvi, &n ); + if (vi) { + TQPaintDevice::x_appdepth_arr[ screen ] = vi->depth; + TQPaintDevice::x_appcells_arr[ screen ] = vi->visual->map_entries; + TQPaintDevice::x_appvisual_arr[ screen ] = vi->visual; + TQPaintDevice::x_appdefvisual_arr[ screen ] = FALSE; + XFree(vi); + } else { + // couldn't get info about the visual, use the default instead + vis = 0; + } + } + + if (!vis) { + // use the default visual + vis = DefaultVisual(appDpy, screen); + TQPaintDevice::x_appdefvisual_arr[ screen ] = TRUE; + + if ( qt_visual_option == TrueColor || + TQApplication::colorSpec() == TQApplication::ManyColor ) { + // find custom visual + + int d, c; + vis = find_truecolor_visual( appDpy, screen, &d, &c ); + TQPaintDevice::x_appdepth_arr[ screen ] = d; + TQPaintDevice::x_appcells_arr[ screen ] = c; + + TQPaintDevice::x_appvisual_arr[ screen ] = vis; + TQPaintDevice::x_appdefvisual_arr[ screen ] = + (XVisualIDFromVisual(vis) == + XVisualIDFromVisual(DefaultVisual(appDpy, screen))); + } + + TQPaintDevice::x_appvisual_arr[ screen ] = vis; + } + + // we assume that 8bpp == pseudocolor, but this is not + // always the case (according to the X server), so we need + // to make sure that our internal data is setup in a way + // that is compatible with our assumptions + if ( vis->c_class == TrueColor && + TQPaintDevice::x_appdepth_arr[ screen ] == 8 && + TQPaintDevice::x_appcells_arr[ screen ] == 8 ) + TQPaintDevice::x_appcells_arr[ screen ] = 256; + + if ( colormap && screen == appScreen ) { + // use the provided colormap for the default screen only + TQPaintDevice::x_appcolormap_arr[ screen ] = colormap; + TQPaintDevice::x_appdefcolormap_arr[ screen ] = FALSE; + } else { + if ( vis->c_class == TrueColor ) { + TQPaintDevice::x_appdefcolormap_arr[ screen ] = + TQPaintDevice::x_appdefvisual_arr[ screen ]; + } else { + TQPaintDevice::x_appdefcolormap_arr[ screen ] = + !qt_cmap_option && TQPaintDevice::x_appdefvisual_arr[ screen ]; + } + + if ( TQPaintDevice::x_appdefcolormap_arr[ screen ] ) { + // use default colormap + XStandardColormap *stdcmap; + VisualID vid = + XVisualIDFromVisual((Visual *) + TQPaintDevice::x_appvisual_arr[ screen ]); + int i, count; + + TQPaintDevice::x_appcolormap_arr[ screen ] = 0; + + if ( ! serverVendor.contains( "Hewlett-Packard" ) ) { + // on HPUX 10.20 local displays, the RGB_DEFAULT_MAP colormap + // doesn't give us correct colors. Why this happens, I have + // no clue, so we disable this for HPUX + if (XGetRGBColormaps(appDpy, + TQPaintDevice::x11AppRootWindow( screen ), + &stdcmap, &count, XA_RGB_DEFAULT_MAP)) { + i = 0; + while (i < count && + TQPaintDevice::x_appcolormap_arr[ screen ] == 0) { + if (stdcmap[i].visualid == vid) { + TQPaintDevice::x_appcolormap_arr[ screen ] = + stdcmap[i].colormap; + } + i++; + } + + XFree( (char *)stdcmap ); + } + } + + if (TQPaintDevice::x_appcolormap_arr[ screen ] == 0) { + TQPaintDevice::x_appcolormap_arr[ screen ] = + DefaultColormap(appDpy, screen); + } + } else { + // create a custom colormap + TQPaintDevice::x_appcolormap_arr[ screen ] = + XCreateColormap(appDpy, TQPaintDevice::x11AppRootWindow( screen ), + vis, AllocNone); + } + } + } + + // Set X paintdevice parameters for the default screen + TQPaintDevice::x_appdepth = TQPaintDevice::x_appdepth_arr[ appScreen ]; + TQPaintDevice::x_appcells = TQPaintDevice::x_appcells_arr[ appScreen ]; + TQPaintDevice::x_approotwindow = TQPaintDevice::x_approotwindow_arr[ appScreen ]; + TQPaintDevice::x_appcolormap = TQPaintDevice::x_appcolormap_arr[ appScreen ]; + TQPaintDevice::x_appdefcolormap = TQPaintDevice::x_appdefcolormap_arr[ appScreen ]; + TQPaintDevice::x_appvisual = TQPaintDevice::x_appvisual_arr[ appScreen ]; + TQPaintDevice::x_appdefvisual = TQPaintDevice::x_appdefvisual_arr[ appScreen ]; + + // Support protocols + + qt_x11_intern_atom( "WM_PROTOCOLS", &tqt_wm_protocols ); + qt_x11_intern_atom( "WM_DELETE_WINDOW", &tqt_wm_delete_window ); + qt_x11_intern_atom( "WM_STATE", &tqt_wm_state ); + qt_x11_intern_atom( "WM_CHANGE_STATE", &qt_wm_change_state ); + qt_x11_intern_atom( "WM_TAKE_FOCUS", &tqt_wm_take_focus ); + qt_x11_intern_atom( "WM_CLIENT_LEADER", &qt_wm_client_leader); + qt_x11_intern_atom( "WM_WINDOW_ROLE", &tqt_window_role); + qt_x11_intern_atom( "SM_CLIENT_ID", &tqt_sm_client_id); + qt_x11_intern_atom( "CLIPBOARD", &qt_xa_clipboard ); + qt_x11_intern_atom( "RESOURCE_MANAGER", &qt_resource_manager ); + qt_x11_intern_atom( "INCR", &qt_x_incr ); + qt_x11_intern_atom( "_XSETROOT_ID", &qt_xsetroot_id ); + qt_x11_intern_atom( "_QT_SELECTION", &qt_selection_property ); + qt_x11_intern_atom( "_QT_CLIPBOARD_SENTINEL", &tqt_clipboard_sentinel ); + qt_x11_intern_atom( "_QT_SELECTION_SENTINEL", &qt_selection_sentinel ); + qt_x11_intern_atom( "_QT_SCROLL_DONE", &qt_qt_scrolldone ); + qt_x11_intern_atom( "_QT_INPUT_ENCODING", &qt_input_encoding ); + qt_x11_intern_atom( "_QT_SIZEGRIP", &qt_sizegrip ); + qt_x11_intern_atom( "_NET_WM_CONTEXT_HELP", &qt_net_wm_context_help ); + qt_x11_intern_atom( "_NET_WM_PING", &qt_net_wm_ping ); + qt_x11_intern_atom( "_MOTIF_WM_HINTS", &qt_xa_motif_wm_hints ); + qt_x11_intern_atom( "DTWM_IS_RUNNING", &qt_cde_running ); + qt_x11_intern_atom( "KWIN_RUNNING", &qt_twin_running ); + qt_x11_intern_atom( "KWM_RUNNING", &qt_kwm_running ); + qt_x11_intern_atom( "GNOME_BACKGROUND_PROPERTIES", &qt_gbackground_properties ); + + TQString atomname("_QT_SETTINGS_TIMESTAMP_"); + atomname += XDisplayName(appDpyName); + qt_x11_intern_atom( atomname.latin1(), &qt_settings_timestamp ); + + qt_x11_intern_atom( "_NET_SUPPORTED", &qt_net_supported ); + qt_x11_intern_atom( "_NET_VIRTUAL_ROOTS", &qt_net_virtual_roots ); + qt_x11_intern_atom( "_NET_WORKAREA", &qt_net_workarea ); + qt_x11_intern_atom( "_NET_WM_STATE", &qt_net_wm_state ); + qt_x11_intern_atom( "_NET_WM_STATE_MODAL", &qt_net_wm_state_modal ); + qt_x11_intern_atom( "_NET_WM_STATE_MAXIMIZED_VERT", &qt_net_wm_state_max_v ); + qt_x11_intern_atom( "_NET_WM_STATE_MAXIMIZED_HORZ", &qt_net_wm_state_max_h ); + qt_x11_intern_atom( "_NET_WM_STATE_FULLSCREEN", &qt_net_wm_state_fullscreen ); + qt_x11_intern_atom( "_NET_WM_STATE_ABOVE", &qt_net_wm_state_above ); + qt_x11_intern_atom( "_NET_WM_ALLOWED_ACTIONS", &qt_net_wm_action ); + qt_x11_intern_atom( "_NET_WM_ACTION_MOVE", &qt_net_wm_action_move ); + qt_x11_intern_atom( "_NET_WM_ACTION_RESIZE", &qt_net_wm_action_resize ); + qt_x11_intern_atom( "_NET_WM_ACTION_MINIMIZE", &qt_net_wm_action_minimize ); + qt_x11_intern_atom( "_NET_WM_ACTION_SHADE", &qt_net_wm_action_shade ); + qt_x11_intern_atom( "_NET_WM_ACTION_STICK", &qt_net_wm_action_stick ); + qt_x11_intern_atom( "_NET_WM_ACTION_MAXIMIZE_HORZ", &qt_net_wm_action_max_h ); + qt_x11_intern_atom( "_NET_WM_ACTION_MAXIMIZE_VERT", &qt_net_wm_action_max_v ); + qt_x11_intern_atom( "_NET_WM_ACTION_FULLSCREEN", &qt_net_wm_action_fullscreen ); + qt_x11_intern_atom( "_NET_WM_ACTION_CHANGE_DESKTOP", &qt_net_wm_action_change_desktop ); + qt_x11_intern_atom( "_NET_WM_ACTION_CLOSE", &qt_net_wm_action_close ); + qt_x11_intern_atom( "_NET_WM_ACTION_ABOVE", &qt_net_wm_action_above ); + qt_x11_intern_atom( "_NET_WM_ACTION_BELOW", &qt_net_wm_action_below ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE", &qt_net_wm_window_type ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_NORMAL", &qt_net_wm_window_type_normal ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_DIALOG", &qt_net_wm_window_type_dialog ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_TOOLBAR", &qt_net_wm_window_type_toolbar ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_MENU", &qt_net_wm_window_type_menu ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_UTILITY", &qt_net_wm_window_type_utility ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_SPLASH", &qt_net_wm_window_type_splash ); + qt_x11_intern_atom( "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", &qt_net_wm_window_type_override ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", &qt_net_wm_window_type_dropdown_menu ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_POPUP_MENU", &qt_net_wm_window_type_popup_menu ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_TOOLTIP", &qt_net_wm_window_type_tooltip ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_COMBO", &qt_net_wm_window_type_combo ); + qt_x11_intern_atom( "_NET_WM_WINDOW_TYPE_DND", &qt_net_wm_window_type_dnd ); + qt_x11_intern_atom( "_KDE_NET_WM_FRAME_STRUT", &qt_net_wm_frame_strut ); + qt_x11_intern_atom( "_NET_WM_STATE_STAYS_ON_TOP", + &qt_net_wm_state_stays_on_top ); + qt_x11_intern_atom( "_NET_WM_PID", &qt_net_wm_pid ); + qt_x11_intern_atom( "_NET_WM_USER_TIME", &qt_net_wm_user_time ); + qt_x11_intern_atom( "_NET_WM_FULL_PLACEMENT", &qt_net_wm_full_placement ); + qt_x11_intern_atom( "ENLIGHTENMENT_DESKTOP", &qt_enlightenment_desktop ); + qt_x11_intern_atom( "_NET_WM_NAME", &qt_net_wm_name ); + qt_x11_intern_atom( "_NET_WM_ICON_NAME", &qt_net_wm_icon_name ); + qt_x11_intern_atom( "UTF8_STRING", &qt_utf8_string ); + qt_x11_intern_atom( "_SGI_DESKS_MANAGER", &qt_sgi_desks_manager ); + +#ifndef TQT_NO_XSYNC + qt_x11_intern_atom( "_NET_WM_SYNC_REQUEST_COUNTER", &qt_net_wm_sync_request_counter ); + qt_x11_intern_atom( "_NET_WM_SYNC_REQUEST", &qt_net_wm_sync_request ); +#endif + + qt_xdnd_setup(); + qt_x11_motifdnd_init(); + + // Finally create all atoms + tqt_x11_process_intern_atoms(); + + // look for broken window managers + qt_detect_broken_window_manager(); + + // initialize NET lists + qt_get_net_supported(); + qt_get_net_virtual_roots(); + +#ifndef TQT_NO_XRANDR + // See if XRandR is supported on the connected display + int xrandr_errorbase; + Q_UNUSED( xrandr_eventbase ); + if ( XRRQueryExtension( appDpy, &xrandr_eventbase, &xrandr_errorbase ) ) { + // XRandR is supported + qt_use_xrandr = TRUE; + } +#endif // TQT_NO_XRANDR + +#ifndef TQT_NO_XRENDER + // See if XRender is supported on the connected display + int xrender_eventbase, xrender_errorbase; + if (XRenderQueryExtension(appDpy, &xrender_eventbase, &xrender_errorbase)) { + // XRender is supported, let's see if we have a PictFormat for the + // default visual + XRenderPictFormat *format = + XRenderFindVisualFormat(appDpy, + (Visual *) TQPaintDevice::x_appvisual); + tqt_use_xrender = (format != 0) && (TQPaintDevice::x_appdepth != 8); + } +#endif // TQT_NO_XRENDER + +#ifndef TQT_NO_XSYNC + // Try to initialize SYNC extension on the connected display + int xsync_major, xsync_minor; + if ( XSyncQueryExtension( appDpy, &xsync_eventbase, &xsync_errorbase ) && + XSyncInitialize( appDpy, &xsync_major, &xsync_minor ) ) { + qt_use_xsync = TRUE; + } +#endif + +#ifndef TQT_NO_XKB + // If XKB is detected, set the GrabsUseXKBState option so input method + // compositions continue to work (ie. deadkeys) + unsigned int state = XkbPCF_GrabsUseXKBStateMask; + (void) XkbSetPerClientControls(appDpy, state, &state); +#endif + +#if !defined(TQT_NO_XFTFREETYPE) + // defined in tqfont_x11.cpp + extern bool tqt_has_xft; +#ifndef QT_XFT2 + if (!tqt_use_xrender) + tqt_has_xft = FALSE; + else +#endif + tqt_has_xft = XftInit(0) && XftInitFtLibrary(); + + if (tqt_has_xft) { + char *dpi_str = XGetDefault(appDpy, "Xft", "dpi"); + if (dpi_str) { + // use a custom DPI + char *end = 0; + int dpi = strtol(dpi_str, &end, 0); + if (dpi_str != end) { + for (int s = 0; s < ScreenCount(appDpy); ++s) { + TQPaintDevice::x11SetAppDpiX(dpi, s); + TQPaintDevice::x11SetAppDpiY(dpi, s); + } + } + } + } +#endif // TQT_NO_XFTFREETYPE + + // look at the modifier mapping, and get the correct masks for alt/meta + // find the alt/meta masks + XModifierKeymap *map = XGetModifierMapping(appDpy); + if (map) { + int i, maskIndex = 0, mapIndex = 0; + for (maskIndex = 0; maskIndex < 8; maskIndex++) { + for (i = 0; i < map->max_keypermod; i++) { + if (map->modifiermap[mapIndex]) { + KeySym sym = qt_x11_keycode_to_keysym(appDpy, map->modifiermap[ mapIndex ]); + if ( qt_alt_mask == 0 && + ( sym == XK_Alt_L || sym == XK_Alt_R ) ) { + qt_alt_mask = 1 << maskIndex; + } + if ( qt_meta_mask == 0 && + (sym == XK_Meta_L || sym == XK_Meta_R ) ) { + qt_meta_mask = 1 << maskIndex; + } + } + mapIndex++; + } + } + + // not look for mode_switch in qt_alt_mask and qt_meta_mask - if it is + // present in one or both, then we set qt_mode_switch_remove_mask. + // see TQETWidget::translateKeyEventInternal for an explanation + // of why this is needed + mapIndex = 0; + for ( maskIndex = 0; maskIndex < 8; maskIndex++ ) { + if ( qt_alt_mask != ( 1 << maskIndex ) && + qt_meta_mask != ( 1 << maskIndex ) ) { + for ( i = 0; i < map->max_keypermod; i++ ) + mapIndex++; + continue; + } + + for ( i = 0; i < map->max_keypermod; i++ ) { + if ( map->modifiermap[ mapIndex ] ) { + KeySym sym = qt_x11_keycode_to_keysym(appDpy, map->modifiermap[ mapIndex ]); + if ( sym == XK_Mode_switch ) { + qt_mode_switch_remove_mask |= 1 << maskIndex; + } + } + mapIndex++; + } + } + + XFreeModifiermap(map); + } else { + // assume defaults + qt_alt_mask = Mod1Mask; + qt_meta_mask = Mod4Mask; + qt_mode_switch_remove_mask = 0; + } + + // Misc. initialization + + TQColor::initialize(); + TQFont::initialize(); + TQCursor::initialize(); + TQPainter::initialize(); + } + +#if defined(TQT_THREAD_SUPPORT) + TQThread::initialize(); +#endif + + if( tqt_is_gui_used ) { + tqApp->setName( appName ); + + int screen; + for ( screen = 0; screen < appScreenCount; ++screen ) { + XSelectInput( appDpy, TQPaintDevice::x11AppRootWindow( screen ), + KeymapStateMask | EnterWindowMask | LeaveWindowMask | + PropertyChangeMask ); + +#ifndef TQT_NO_XRANDR + if (qt_use_xrandr) + XRRSelectInput( appDpy, TQPaintDevice::x11AppRootWindow( screen ), True ); +#endif // TQT_NO_XRANDR + } + } + + if ( tqt_is_gui_used ) { + qt_set_input_encoding(); + + qt_set_x11_resources( appFont, appFGCol, appBGCol, appBTNCol); + + // be smart about the size of the default font. most X servers have helvetica + // 12 point available at 2 resolutions: + // 75dpi (12 pixels) and 100dpi (17 pixels). + // At 95 DPI, a 12 point font should be 16 pixels tall - in which case a 17 + // pixel font is a closer match than a 12 pixel font + int ptsz = + (int) ( ( ( TQPaintDevice::x11AppDpiY() >= 95 ? 17. : 12. ) * + 72. / (float) TQPaintDevice::x11AppDpiY() ) + 0.5 ); + + if ( !tqt_app_has_font && !qt_x11_cmdline_font ) { + TQFont f( "Helvetica", ptsz ); + TQApplication::setFont( f ); + } + +#if !defined(TQT_NO_IM) +#if !defined(TQT_NO_IM_EXTENSIONS) + TQApplication::create_im(); +#else + TQApplication::create_xim(); +#endif +#endif + +#if defined (QT_TABLET_SUPPORT) + int ndev, + i, + j; + bool gotStylus, + gotEraser; + XDeviceInfo *devices, *devs; + XInputClassInfo *ip; + XAnyClassPtr any; + XValuatorInfoPtr v; + XAxisInfoPtr a; + XDevice *dev; + XEventClass *ev_class; + int curr_event_count; + +#if !defined(Q_OS_IRIX) + // XFree86 divides a stylus and eraser into 2 devices, so we must do for both... + const TQString XFREENAMESTYLUS = "stylus"; + const TQString XFREENAMEPEN = "pen"; + const TQString XFREENAMEERASER = "eraser"; +#endif + + devices = XListInputDevices( appDpy, &ndev); + if ( devices == NULL ) { + tqWarning( "Failed to get list of devices" ); + ndev = -1; + } + dev = NULL; + for ( devs = devices, i = 0; i < ndev; i++, devs++ ) { + gotEraser = FALSE; +#if defined(Q_OS_IRIX) + + gotStylus = ( !strncmp(devs->name, + WACOM_NAME, sizeof(WACOM_NAME) - 1) ); +#else + TQString devName = devs->name; + devName = devName.lower(); + gotStylus = ( devName.startsWith(XFREENAMEPEN) + || devName.startsWith(XFREENAMESTYLUS) ); + if ( !gotStylus ) + gotEraser = devName.startsWith( XFREENAMEERASER ); + +#endif + if ( gotStylus || gotEraser ) { + // I only wanted to do this once, so wrap pointers around these + curr_event_count = 0; + + if ( gotStylus ) { + devStylus = XOpenDevice( appDpy, devs->id ); + dev = devStylus; + ev_class = event_list_stylus; + } else if ( gotEraser ) { + devEraser = XOpenDevice( appDpy, devs->id ); + dev = devEraser; + ev_class = event_list_eraser; + } + if ( dev == NULL ) { + tqWarning( "Failed to open device" ); + } else { + if ( dev->num_classes > 0 ) { + for ( ip = dev->classes, j = 0; j < devs->num_classes; + ip++, j++ ) { + switch ( ip->input_class ) { + case KeyClass: + DeviceKeyPress( dev, xinput_key_press, + ev_class[curr_event_count] ); + curr_event_count++; + DeviceKeyRelease( dev, xinput_key_release, + ev_class[curr_event_count] ); + curr_event_count++; + break; + case ButtonClass: + DeviceButtonPress( dev, xinput_button_press, + ev_class[curr_event_count] ); + curr_event_count++; + DeviceButtonRelease( dev, xinput_button_release, + ev_class[curr_event_count] ); + curr_event_count++; + break; + case ValuatorClass: + // I'm only going to be interested in motion when the + // stylus is already down anyway! + DeviceMotionNotify( dev, xinput_motion, + ev_class[curr_event_count] ); + curr_event_count++; + break; + default: + break; + } + } + } + } + // get the min/max value for pressure! + any = (XAnyClassPtr) ( devs->inputclassinfo ); + if ( dev == devStylus ) { + qt_curr_events_stylus = curr_event_count; + for (j = 0; j < devs->num_classes; j++) { + if ( any->c_class == ValuatorClass ) { + v = (XValuatorInfoPtr) any; + a = (XAxisInfoPtr) ((char *) v + + sizeof (XValuatorInfo)); +#if defined (Q_OS_IRIX) + max_pressure = a[WAC_PRESSURE_I].max_value; +#else + max_pressure = a[2].max_value; +#endif + // got the max pressure no need to go further... + break; + } + any = (XAnyClassPtr) ((char *) any + any->length); + } + } else { + qt_curr_events_eraser = curr_event_count; + } + // at this point we are assuming there is only one + // wacom device... +#if defined (Q_OS_IRIX) + if ( devStylus != NULL ) { +#else + if ( devStylus != NULL && devEraser != NULL ) { +#endif + break; + } + } + } // end for loop + XFreeDeviceList( devices ); +#endif // QT_TABLET_SUPPORT + + } else { + // read some non-GUI settings when not using the X server... + + if ( TQApplication::desktopSettingsAware() ) { + TQSettings settings; + + // read library (ie. plugin) path list + TQString libpathkey = TQString("/qt/%1.%2/libraryPath") + .arg( TQT_VERSION >> 16 ) + .arg( (TQT_VERSION & 0xff00 ) >> 8 ); + TQStringList pathlist = + settings.readListEntry(libpathkey, ':'); + if (! pathlist.isEmpty()) { + TQStringList::ConstIterator it = pathlist.begin(); + while (it != pathlist.end()) + TQApplication::addLibraryPath(*it++); + } + + TQString defaultcodec = settings.readEntry("/qt/defaultCodec", "none"); + if (defaultcodec != "none") { + TQTextCodec *codec = TQTextCodec::codecForName(defaultcodec); + if (codec) + tqApp->setDefaultCodec(codec); + } + + tqt_resolve_symlinks = + settings.readBoolEntry("/qt/resolveSymlinks", TRUE); + } + } + } + + +#ifndef TQT_NO_STYLE + // run-time search for default style +void TQApplication::x11_initialize_style() +{ + Atom type; + int format; + unsigned long length, after; + uchar *data; + if ( !app_style && + XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), qt_twin_running, + 0, 1, False, AnyPropertyType, &type, &format, &length, + &after, &data ) == Success && length ) { + if ( data ) XFree( (char *)data ); + // twin is there. check if KDE's styles are available, + // otherwise use windows style + if ( (app_style = TQStyleFactory::create("highcolor") ) == 0 ) + app_style = TQStyleFactory::create("windows"); + } + if ( !app_style && + XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), qt_kwm_running, + 0, 1, False, AnyPropertyType, &type, &format, &length, + &after, &data ) == Success && length ) { + if ( data ) XFree( (char *)data ); + app_style = TQStyleFactory::create("windows"); + } + if ( !app_style && + XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), qt_cde_running, + 0, 1, False, AnyPropertyType, &type, &format, &length, + &after, &data ) == Success && length ) { + // DTWM is running, meaning most likely CDE is running... + if ( data ) XFree( (char *) data ); + app_style = TQStyleFactory::create( "cde" ); + } + // maybe another desktop? + if ( !app_style && + XGetWindowProperty( appDpy, TQPaintDevice::x11AppRootWindow(), + qt_gbackground_properties, 0, 1, False, AnyPropertyType, + &type, &format, &length, &after, &data ) == Success && + length ) { + if ( data ) XFree( (char *)data ); + // default to MotifPlus with hovering + app_style = TQStyleFactory::create("motifplus" ); + } +} +#endif + +void tqt_init( int *argcptr, char **argv, TQApplication::Type ) +{ + tqt_init_internal( argcptr, argv, 0, 0, 0 ); +} + +void tqt_init( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) +{ + tqt_init_internal( 0, 0, display, visual, colormap ); +} + +void tqt_init( int *argcptr, char **argv, Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) +{ + tqt_init_internal( argcptr, argv, display, visual, colormap ); +} + + +/***************************************************************************** + tqt_cleanup() - cleans up when the application is finished + *****************************************************************************/ + +void tqt_cleanup() +{ + appliedstamp = 0; + + if ( app_save_rootinfo ) // root window must keep state + qt_save_rootinfo(); + + if ( tqt_is_gui_used ) { + TQPixmapCache::clear(); + TQPainter::cleanup(); + TQCursor::cleanup(); + TQFont::cleanup(); + TQColor::cleanup(); + TQSharedDoubleBuffer::cleanup(); + } +#if defined(TQT_THREAD_SUPPORT) + TQThread::cleanup(); +#endif + +#if defined (QT_TABLET_SUPPORT) + if ( devStylus != NULL ) + XCloseDevice( appDpy, devStylus ); + if ( devEraser != NULL ) + XCloseDevice( appDpy, devEraser ); +#endif + +#if !defined(TQT_NO_IM) +#if !defined(TQT_NO_IM_EXTENSIONS) + TQApplication::close_im(); +#else + TQApplication::close_xim(); +#endif +#endif + + if ( tqt_is_gui_used ) { + int screen; + for ( screen = 0; screen < appScreenCount; screen++ ) { + if ( ! TQPaintDevice::x11AppDefaultColormap( screen ) ) + XFreeColormap( TQPaintDevice::x11AppDisplay(), + TQPaintDevice::x11AppColormap( screen ) ); + } + } + +#define QT_CLEANUP_GC(g) if (g) { for (int i=0;i= appScreenCount ) { + tqDebug("invalid screen %d %d", scrn, appScreenCount ); + TQWidget* bla = 0; + bla->setName("hello"); + } + GC gc; + if ( monochrome ) { + if ( !app_gc_ro_m ) // create GC for bitmap + memset( (app_gc_ro_m = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); + if ( !app_gc_ro_m[scrn] ) + app_gc_ro_m[scrn] = create_gc( scrn, TRUE ); + gc = app_gc_ro_m[scrn]; + } else { // create standard GC + if ( !app_gc_ro ) + memset( (app_gc_ro = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); + if ( !app_gc_ro[scrn] ) + app_gc_ro[scrn] = create_gc( scrn, FALSE ); + gc = app_gc_ro[scrn]; + } + return gc; +} + +GC tqt_xget_temp_gc( int scrn, bool monochrome ) // get temporary GC +{ + if ( scrn < 0 || scrn >= appScreenCount ) { + tqDebug("invalid screen (tmp) %d %d", scrn, appScreenCount ); + TQWidget* bla = 0; + bla->setName("hello"); + } + GC gc; + if ( monochrome ) { + if ( !app_gc_tmp_m ) // create GC for bitmap + memset( (app_gc_tmp_m = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); + if ( !app_gc_tmp_m[scrn] ) + app_gc_tmp_m[scrn] = create_gc( scrn, TRUE ); + gc = app_gc_tmp_m[scrn]; + } else { // create standard GC + if ( !app_gc_tmp ) + memset( (app_gc_tmp = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); + if ( !app_gc_tmp[scrn] ) + app_gc_tmp[scrn] = create_gc( scrn, FALSE ); + gc = app_gc_tmp[scrn]; + } + return gc; +} + + +/***************************************************************************** + Platform specific TQApplication members + *****************************************************************************/ + +/*! + \fn TQWidget *TQApplication::mainWidget() const + + Returns the main application widget, or 0 if there is no main + widget. + + \sa setMainWidget() +*/ + +/*! + Sets the application's main widget to \a mainWidget. + + In most respects the main widget is like any other widget, except + that if it is closed, the application exits. Note that + TQApplication does \e not take ownership of the \a mainWidget, so + if you create your main widget on the heap you must delete it + yourself. + + You need not have a main widget; connecting lastWindowClosed() to + quit() is an alternative. + + For X11, this function also resizes and moves the main widget + according to the \e -geometry command-line option, so you should + set the default geometry (using \l TQWidget::setGeometry()) before + calling setMainWidget(). + + \sa mainWidget(), exec(), quit() +*/ + +void TQApplication::setMainWidget( TQWidget *mainWidget ) +{ +#if defined(QT_CHECK_STATE) + if ( mainWidget && mainWidget->parentWidget() && + ! mainWidget->parentWidget()->isDesktop() ) + tqWarning( "TQApplication::setMainWidget(): New main widget (%s/%s) " + "has a parent!", + mainWidget->className(), mainWidget->name() ); +#endif + main_widget = mainWidget; + if ( main_widget ) { // give WM command line + XSetWMProperties( main_widget->x11Display(), main_widget->winId(), + 0, 0, app_argv, app_argc, 0, 0, 0 ); + if ( mwTitle ) + XStoreName( main_widget->x11Display(), main_widget->winId(), (char*)mwTitle ); + if ( mwGeometry ) { // parse geometry + int x, y; + int w, h; + int m = XParseGeometry( (char*)mwGeometry, &x, &y, (uint*)&w, (uint*)&h ); + TQSize minSize = main_widget->minimumSize(); + TQSize maxSize = main_widget->maximumSize(); + if ( (m & XValue) == 0 ) + x = main_widget->geometry().x(); + if ( (m & YValue) == 0 ) + y = main_widget->geometry().y(); + if ( (m & WidthValue) == 0 ) + w = main_widget->width(); + if ( (m & HeightValue) == 0 ) + h = main_widget->height(); + w = TQMIN(w,maxSize.width()); + h = TQMIN(h,maxSize.height()); + w = TQMAX(w,minSize.width()); + h = TQMAX(h,minSize.height()); + if ( (m & XNegative) ) { + x = desktop()->width() + x - w; + qt_widget_tlw_gravity = NorthEastGravity; + } + if ( (m & YNegative) ) { + y = desktop()->height() + y - h; + qt_widget_tlw_gravity = (m & XNegative) ? SouthEastGravity : SouthWestGravity; + } + main_widget->setGeometry( x, y, w, h ); + } + } +} + +#ifndef TQT_NO_CURSOR + +/***************************************************************************** + TQApplication cursor stack + *****************************************************************************/ + +extern void tqt_x11_enforce_cursor( TQWidget * w ); + +typedef TQPtrList TQCursorList; + +static TQCursorList *cursorStack = 0; + +/*! + \fn TQCursor *TQApplication::overrideCursor() + + Returns the active application override cursor. + + This function returns 0 if no application cursor has been defined + (i.e. the internal cursor stack is empty). + + \sa setOverrideCursor(), restoreOverrideCursor() +*/ + +/*! + Sets the application override cursor to \a cursor. + + Application override cursors are intended for showing the user + that the application is in a special state, for example during an + operation that might take some time. + + This cursor will be displayed in all the application's widgets + until restoreOverrideCursor() or another setOverrideCursor() is + called. + + Application cursors are stored on an internal stack. + setOverrideCursor() pushes the cursor onto the stack, and + restoreOverrideCursor() pops the active cursor off the stack. + Every setOverrideCursor() must eventually be followed by a + corresponding restoreOverrideCursor(), otherwise the stack will + never be emptied. + + If \a replace is TRUE, the new cursor will replace the last + override cursor (the stack keeps its depth). If \a replace is + FALSE, the new stack is pushed onto the top of the stack. + + Example: + \code + TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); + calculateHugeMandelbrot(); // lunch time... + TQApplication::restoreOverrideCursor(); + \endcode + + \sa overrideCursor(), restoreOverrideCursor(), TQWidget::setCursor() +*/ + +void TQApplication::setOverrideCursor( const TQCursor &cursor, bool replace ) +{ + if ( !cursorStack ) { + cursorStack = new TQCursorList; + TQ_CHECK_PTR( cursorStack ); + cursorStack->setAutoDelete( TRUE ); + } + app_cursor = new TQCursor( cursor ); + TQ_CHECK_PTR( app_cursor ); + if ( replace ) + cursorStack->removeLast(); + cursorStack->append( app_cursor ); + + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // for all widgets that have + if ( w->testWState( WState_OwnCursor ) ) + tqt_x11_enforce_cursor( w ); + ++it; + } + XFlush( appDpy ); // make X execute it NOW +} + +/*! + Undoes the last setOverrideCursor(). + + If setOverrideCursor() has been called twice, calling + restoreOverrideCursor() will activate the first cursor set. + Calling this function a second time restores the original widgets' + cursors. + + \sa setOverrideCursor(), overrideCursor(). +*/ + +void TQApplication::restoreOverrideCursor() +{ + if ( !cursorStack ) // no cursor stack + return; + cursorStack->removeLast(); + app_cursor = cursorStack->last(); + if ( TQWidget::mapper != 0 && !closingDown() ) { + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { // set back to original cursors + if ( w->testWState( WState_OwnCursor ) ) + tqt_x11_enforce_cursor( w ); + ++it; + } + XFlush( appDpy ); + } + if ( !app_cursor ) { + delete cursorStack; + cursorStack = 0; + } +} + +#endif + +/*! + \fn bool TQApplication::hasGlobalMouseTracking() + + Returns TRUE if global mouse tracking is enabled; otherwise + returns FALSE. + + \sa setGlobalMouseTracking() +*/ + +/*! + Enables global mouse tracking if \a enable is TRUE, or disables it + if \a enable is FALSE. + + Enabling global mouse tracking makes it possible for widget event + filters or application event filters to get all mouse move events, + even when no button is depressed. This is useful for special GUI + elements, e.g. tooltips. + + Global mouse tracking does not affect widgets and their + mouseMoveEvent(). For a widget to get mouse move events when no + button is depressed, it must do TQWidget::setMouseTracking(TRUE). + + This function uses an internal counter. Each + setGlobalMouseTracking(TRUE) must have a corresponding + setGlobalMouseTracking(FALSE): + \code + // at this point global mouse tracking is off + TQApplication::setGlobalMouseTracking( TRUE ); + TQApplication::setGlobalMouseTracking( TRUE ); + TQApplication::setGlobalMouseTracking( FALSE ); + // at this point it's still on + TQApplication::setGlobalMouseTracking( FALSE ); + // but now it's off + \endcode + + \sa hasGlobalMouseTracking(), TQWidget::hasMouseTracking() +*/ + +void TQApplication::setGlobalMouseTracking( bool enable ) +{ + bool tellAllWidgets; + if ( enable ) { + tellAllWidgets = (++app_tracking == 1); + } else { + tellAllWidgets = (--app_tracking == 0); + } + if ( tellAllWidgets ) { + TQWidgetIntDictIt it( *((TQWidgetIntDict*)TQWidget::mapper) ); + TQWidget *w; + while ( (w=it.current()) ) { + if ( app_tracking > 0 ) { // switch on + if ( !w->testWState(WState_MouseTracking) ) { + w->setMouseTracking( TRUE ); + w->clearWState( WState_MouseTracking ); + } + } else { // switch off + if ( !w->testWState(WState_MouseTracking) ) { + w->setWState( WState_MouseTracking ); + w->setMouseTracking( FALSE ); + } + } + ++it; + } + } +} + + +/***************************************************************************** + Routines to find a TQt widget from a screen position + *****************************************************************************/ + +Window qt_x11_findClientWindow( Window win, Atom property, bool leaf ) +{ + Atom type = None; + int format, i; + ulong nitems, after; + uchar *data; + Window root, parent, target=0, *children=0; + uint nchildren; + if ( XGetWindowProperty( appDpy, win, property, 0, 0, FALSE, AnyPropertyType, + &type, &format, &nitems, &after, &data ) == Success ) { + if ( data ) + XFree( (char *)data ); + if ( type ) + return win; + } + if ( !XQueryTree(appDpy,win,&root,&parent,&children,&nchildren) ) { + if ( children ) + XFree( (char *)children ); + return 0; + } + for ( i=nchildren-1; !target && i >= 0; i-- ) + target = qt_x11_findClientWindow( children[i], property, leaf ); + if ( children ) + XFree( (char *)children ); + return target; +} + + +/*! + Returns a pointer to the widget at global screen position \a + (x, y), or 0 if there is no TQt widget there. + + If \a child is FALSE and there is a child widget at position \a + (x, y), the top-level widget containing it is returned. If \a child + is TRUE the child widget at position \a (x, y) is returned. + + This function is normally rather slow. + + \sa TQCursor::pos(), TQWidget::grabMouse(), TQWidget::grabKeyboard() +*/ + +TQWidget *TQApplication::widgetAt( int x, int y, bool child ) +{ + int screen = TQCursor::x11Screen(); + int lx, ly; + + Window target; + if ( !XTranslateCoordinates(appDpy, + TQPaintDevice::x11AppRootWindow(screen), + TQPaintDevice::x11AppRootWindow(screen), + x, y, &lx, &ly, &target) ) { + return 0; + } + if ( !target || target == TQPaintDevice::x11AppRootWindow(screen) ) + return 0; + TQWidget *w, *c; + w = TQWidget::find( (WId)target ); + + if ( !w ) { + qt_ignore_badwindow(); + target = qt_x11_findClientWindow( target, tqt_wm_state, TRUE ); + if (qt_badwindow() ) + return 0; + w = TQWidget::find( (WId)target ); +#if 0 + if ( !w ) { + // Perhaps the widgets at (x,y) is inside a foreign application? + // Search all toplevel widgets to see if one is within target + TQWidgetList *list = topLevelWidgets(); + TQWidget *widget = list->first(); + while ( widget && !w ) { + Window ctarget = target; + if ( widget->isVisible() && !widget->isDesktop() ) { + Window wid = widget->winId(); + while ( ctarget && !w ) { + XTranslateCoordinates(appDpy, + TQPaintDevice::x11AppRootWindow(screen), + ctarget, x, y, &lx, &ly, &ctarget); + if ( ctarget == wid ) { + // Found + w = widget; + XTranslateCoordinates(appDpy, + TQPaintDevice::x11AppRootWindow(screen), + ctarget, x, y, &lx, &ly, &ctarget); + } + } + } + widget = list->next(); + } + delete list; + } +#endif + } + if ( child && w ) { + if ( (c = w->childAt( w->mapFromGlobal(TQPoint(x, y ) ) ) ) ) + return c; + } + return w; +} + +/*! + \overload TQWidget *TQApplication::widgetAt( const TQPoint &pos, bool child ) + + Returns a pointer to the widget at global screen position \a pos, + or 0 if there is no TQt widget there. + + If \a child is FALSE and there is a child widget at position \a + pos, the top-level widget containing it is returned. If \a child + is TRUE the child widget at position \a pos is returned. +*/ + + +/*! + Flushes the X event queue in the X11 implementation. This normally + returns almost immediately. Does nothing on other platforms. + + \sa syncX() +*/ + +void TQApplication::flushX() +{ + if ( appDpy ) + XFlush( appDpy ); +} + +/*! + Flushes the window system specific event queues. + + If you are doing graphical changes inside a loop that does not + return to the event loop on asynchronous window systems like X11 + or double buffered window systems like MacOS X, and you want to + visualize these changes immediately (e.g. Splash Screens), call + this function. + + \sa flushX() sendPostedEvents() TQPainter::flush() +*/ + +void TQApplication::flush() +{ + flushX(); +} + +/*! + Synchronizes with the X server in the X11 implementation. This + normally takes some time. Does nothing on other platforms. + + \sa flushX() +*/ + +void TQApplication::syncX() +{ + if ( appDpy ) + XSync( appDpy, False ); // don't discard events +} + + +/*! + Sounds the bell, using the default volume and sound. +*/ + +void TQApplication::beep() +{ + if ( appDpy ) + XBell( appDpy, 0 ); +} + + + +/***************************************************************************** + Special lookup functions for windows that have been reparented recently + *****************************************************************************/ + +static TQWidgetIntDict *wPRmapper = 0; // alternative widget mapper + +void qPRCreate( const TQWidget *widget, Window oldwin ) +{ // TQWidget::reparent mechanism + if ( !wPRmapper ) { + wPRmapper = new TQWidgetIntDict; + TQ_CHECK_PTR( wPRmapper ); + } + wPRmapper->insert( (long)oldwin, widget ); // add old window to mapper + TQETWidget *w = (TQETWidget *)widget; + w->setWState( TQt::WState_Reparented ); // set reparented flag +} + +void qPRCleanup( TQWidget *widget ) +{ + TQETWidget *etw = (TQETWidget *)widget; + if ( !(wPRmapper && etw->testWState(TQt::WState_Reparented)) ) + return; // not a reparented widget + TQWidgetIntDictIt it(*wPRmapper); + TQWidget *w; + while ( (w=it.current()) ) { + int key = it.currentKey(); + ++it; + if ( w == etw ) { // found widget + etw->clearWState( TQt::WState_Reparented ); // clear flag + wPRmapper->remove( key );// old window no longer needed + if ( wPRmapper->count() == 0 ) { // became empty + delete wPRmapper; // then reset alt mapper + wPRmapper = 0; + return; + } + } + } +} + +static TQETWidget *qPRFindWidget( Window oldwin ) +{ + return wPRmapper ? (TQETWidget*)wPRmapper->find((long)oldwin) : 0; +} + +/*! + \internal +*/ +int TQApplication::x11ClientMessage(TQWidget* w, XEvent* event, bool passive_only) +{ + TQETWidget *widget = (TQETWidget*)w; + if ( event->xclient.format == 32 && event->xclient.message_type ) { + if ( event->xclient.message_type == tqt_wm_protocols ) { + Atom a = event->xclient.data.l[0]; + if ( a == tqt_wm_delete_window ) { + if ( passive_only ) return 0; + widget->translateCloseEvent(event); + } + else if ( a == tqt_wm_take_focus ) { + TQWidget * amw = activeModalWidget(); + if ( (ulong) event->xclient.data.l[1] > tqt_x_time ) + tqt_x_time = event->xclient.data.l[1]; + if ( amw && amw != widget ) { + TQWidget* groupLeader = widget; + while ( groupLeader && !groupLeader->testWFlags( TQt::WGroupLeader ) + && groupLeader != amw ) + groupLeader = groupLeader->parentWidget(); + if ( !groupLeader ) { + TQWidget *p = amw->parentWidget(); + while (p && p != widget) + p = p->parentWidget(); + if (!p || !qt_net_supported_list) + amw->raise(); // help broken window managers + amw->setActiveWindow(); + } + } +#ifndef TQT_NO_WHATSTHIS + } else if ( a == qt_net_wm_context_help ) { + TQWhatsThis::enterWhatsThisMode(); +#endif // TQT_NO_WHATSTHIS + } else if ( a == qt_net_wm_ping ) { + // avoid send/reply loops + Window root = TQPaintDevice::x11AppRootWindow( w->x11Screen() ); + if (event->xclient.window != root) { + event->xclient.window = root; + XSendEvent( event->xclient.display, event->xclient.window, + False, SubstructureNotifyMask|SubstructureRedirectMask, event ); + } +#ifndef TQT_NO_XSYNC + } else if (a == qt_net_wm_sync_request ) { + widget->handleSyncRequest( event ); +#endif + } + } else if ( event->xclient.message_type == qt_qt_scrolldone ) { + widget->translateScrollDoneEvent(event); + } else if ( event->xclient.message_type == qt_xdnd_position ) { + qt_handle_xdnd_position( widget, event, passive_only ); + } else if ( event->xclient.message_type == qt_xdnd_enter ) { + qt_handle_xdnd_enter( widget, event, passive_only ); + } else if ( event->xclient.message_type == qt_xdnd_status ) { + qt_handle_xdnd_status( widget, event, passive_only ); + } else if ( event->xclient.message_type == qt_xdnd_leave ) { + qt_handle_xdnd_leave( widget, event, passive_only ); + } else if ( event->xclient.message_type == qt_xdnd_drop ) { + qt_handle_xdnd_drop( widget, event, passive_only ); + } else if ( event->xclient.message_type == qt_xdnd_finished ) { + qt_handle_xdnd_finished( widget, event, passive_only ); + } else { + if ( passive_only ) return 0; + // All other are interactions + } + } else { + qt_motifdnd_handle_msg( widget, event, passive_only ); + } + + return 0; +} + +/*! + This function does the core processing of individual X + \a{event}s, normally by dispatching TQt events to the right + destination. + + It returns 1 if the event was consumed by special handling, 0 if + the \a event was consumed by normal handling, and -1 if the \a + event was for an unrecognized widget. + + \sa x11EventFilter() +*/ +int TQApplication::x11ProcessEvent( XEvent* event ) +{ + switch ( event->type ) { + case ButtonPress: + ignoreNextMouseReleaseEvent = FALSE; + tqt_x_user_time = event->xbutton.time; + // fallthrough intended + case ButtonRelease: + tqt_x_time = event->xbutton.time; + break; + case MotionNotify: + tqt_x_time = event->xmotion.time; + break; + case XKeyPress: + tqt_x_user_time = event->xkey.time; + // fallthrough intended + case XKeyRelease: + tqt_x_time = event->xkey.time; + break; + case PropertyNotify: + tqt_x_time = event->xproperty.time; + break; + case EnterNotify: + case LeaveNotify: + tqt_x_time = event->xcrossing.time; + break; + case SelectionClear: + tqt_x_time = event->xselectionclear.time; + break; + default: + break; + } + + TQETWidget *widget = (TQETWidget*)TQWidget::find( (WId)event->xany.window ); + + if ( wPRmapper ) { // just did a widget reparent? + if ( widget == 0 ) { // not in std widget mapper + switch ( event->type ) { // only for mouse/key events + case ButtonPress: + case ButtonRelease: + case MotionNotify: + case XKeyPress: + case XKeyRelease: + widget = qPRFindWidget( event->xany.window ); + break; + } + } + else if ( widget->testWState(WState_Reparented) ) + qPRCleanup( widget ); // remove from alt mapper + } + + TQETWidget *keywidget=0; + bool grabbed=FALSE; + if ( event->type==XKeyPress || event->type==XKeyRelease ) { + keywidget = (TQETWidget*)TQWidget::keyboardGrabber(); + if ( keywidget ) { + grabbed = TRUE; + } else { + if ( focus_widget ) + keywidget = (TQETWidget*)focus_widget; + if ( !keywidget ) { + if ( inPopupMode() ) // no focus widget, see if we have a popup + keywidget = (TQETWidget*) activePopupWidget(); + else if ( widget ) + keywidget = (TQETWidget*)widget->topLevelWidget(); + } + } + } + +#ifndef TQT_NO_IM + // Filtering input events by the input context. It has to be taken + // place before any other key event consumers such as eventfilters + // and accelerators because some input methods require quite + // various key combination and sequences. It often conflicts with + // accelerators and so on, so we must give the input context the + // filtering opportunity first to ensure all input methods work + // properly regardless of application design. + +// #ifndef TQT_NO_IM_EXTENSIONS + if( keywidget && keywidget->isEnabled() && keywidget->isInputMethodEnabled() ) { +// #else +// if( keywidget && keywidget->isEnabled() ) { +// #endif + if( ( event->type==XKeyPress || event->type==XKeyRelease ) && + sm_blockUserInput ) // block user interaction during session management + return TRUE; + + // for XIM handling + TQInputContext *qic = keywidget->getInputContext(); + if( qic && qic->x11FilterEvent( keywidget, event ) ) + return TRUE; + + // filterEvent() accepts TQEvent *event rather than preexpanded key + // event attribute values. This is intended to pass other IM-related + // events in future. The IM-related events are supposed as + // TQWheelEvent, TQTabletEvent and so on. Other non IM-related events + // should not be forwarded to input contexts to prevent weird event + // handling. + if ( ( event->type == XKeyPress || event->type == XKeyRelease ) ) { + int code = -1; + int count = 0; + int state; + char ascii = 0; + TQEvent::Type type; + TQString text; + + keywidget->translateKeyEventInternal( event, count, text, + state, ascii, code, type, + FALSE, FALSE ); + + // both key press/release is required for some complex + // input methods. don't eliminate anything. + TQKeyEvent keyevent( type, code, ascii, state, text, FALSE, count ); + + if( qic && qic->filterEvent( &keyevent ) ) + return TRUE; + } + } else +#endif // TQT_NO_IM + { + if ( XFilterEvent( event, None ) ) + return TRUE; + } + + if ( qt_x11EventFilter(event) ) // send through app filter + return 1; + + if ( event->type == MappingNotify ) { // keyboard mapping changed + XRefreshKeyboardMapping( &event->xmapping ); + return 0; + } + + if ( event->type == PropertyNotify ) { // some properties changed + if ( event->xproperty.window == TQPaintDevice::x11AppRootWindow( 0 ) ) { + // root properties for the first screen + if ( event->xproperty.atom == tqt_clipboard_sentinel ) { + if (qt_check_clipboard_sentinel() ) + emit clipboard()->dataChanged(); + } else if ( event->xproperty.atom == qt_selection_sentinel ) { + if (qt_check_selection_sentinel() ) + emit clipboard()->selectionChanged(); + } else if ( obey_desktop_settings ) { + if ( event->xproperty.atom == qt_resource_manager ) + qt_set_x11_resources(); + else if ( event->xproperty.atom == qt_settings_timestamp ) + TQApplication::x11_apply_settings(); + } + } + if ( event->xproperty.window == TQPaintDevice::x11AppRootWindow() ) { + // root properties for the default screen + if ( event->xproperty.atom == qt_input_encoding ) { + qt_set_input_encoding(); + } else if ( event->xproperty.atom == qt_net_supported ) { + qt_get_net_supported(); + } else if ( event->xproperty.atom == qt_net_virtual_roots ) { + qt_get_net_virtual_roots(); + } else if ( event->xproperty.atom == qt_net_workarea ) { + qt_desktopwidget_update_workarea(); + } + } else if ( widget ) { + widget->translatePropertyEvent(event); + } else { + return -1; // don't know this window + } + return 0; + } + +#ifndef TQT_NO_XRANDR + // XRandR doesn't care if TQt doesn't know about the widget, so handle XRandR stuff before the !widget check below + if (event->type == xrandr_eventbase + RRScreenChangeNotify + || ( event->type == ConfigureNotify && event->xconfigure.window == TQPaintDevice::x11AppRootWindow())) { + // update Xlib internals with the latest screen configuration + XRRUpdateConfiguration(event); + + // update the size for desktop widget + int scr = XRRRootToScreen( appDpy, event->xany.window ); + TQWidget *w = desktop()->screen( scr ); + + if (w) { + int widgetScr = -1; + // make sure the specified widget is on the same screen that received the XRandR event + XWindowAttributes widgetAttr; + XGetWindowAttributes(appDpy, w->winId(), &widgetAttr); + if (widgetAttr.screen) { + widgetScr = XScreenNumberOfScreen(widgetAttr.screen); + } + + if ((widgetScr < 0) || (widgetScr == scr)) { + TQSize oldSize( w->size() ); + w->crect.setWidth( DisplayWidth( appDpy, scr ) ); + w->crect.setHeight( DisplayHeight( appDpy, scr ) ); + if ( w->size() != oldSize ) { + TQResizeEvent e( w->size(), oldSize ); + TQApplication::sendEvent( w, &e ); + emit desktop()->resized( scr ); + } + } + } + } +#endif // TQT_NO_XRANDR + + if ( !widget ) { // don't know this windows + TQWidget* popup = TQApplication::activePopupWidget(); + if ( popup ) { + + /* + That is more than suboptimal. The real solution should + do some keyevent and buttonevent translation, so that + the popup still continues to work as the user expects. + Unfortunately this translation is currently only + possible with a known widget. I'll change that soon + (Matthias). + */ + + // Danger - make sure we don't lock the server + switch ( event->type ) { + case ButtonPress: + case ButtonRelease: + case XKeyPress: + case XKeyRelease: + do { + popup->close(); + } while ( (popup = tqApp->activePopupWidget()) ); + return 1; + } + } + return -1; + } + + if ( event->type == XKeyPress || event->type == XKeyRelease ) + widget = keywidget; // send XKeyEvents through keywidget->x11Event() + + if ( app_do_modal ) // modal event handling + if ( !tqt_try_modal(widget, event) ) { + if ( event->type == ClientMessage ) + x11ClientMessage( widget, event, TRUE ); + return 1; + } + + + if ( widget->x11Event(event) ) // send through widget filter + return 1; +#if defined (QT_TABLET_SUPPORT) + if ( event->type == xinput_motion || + event->type == xinput_button_release || + event->type == xinput_button_press ) { + widget->translateXinputEvent( event ); + return 0; + } +#endif + + switch ( event->type ) { + + case ButtonRelease: // mouse event + if ( ignoreNextMouseReleaseEvent ) { + ignoreNextMouseReleaseEvent = FALSE; + break; + } + // fall through intended + case ButtonPress: + if (event->xbutton.root != RootWindow(widget->x11Display(), widget->x11Screen()) + && ! qt_xdnd_dragging) { + while ( activePopupWidget() ) + activePopupWidget()->close(); + return 1; + } + if (event->type == ButtonPress) + qt_net_update_user_time(widget->topLevelWidget()); + // fall through intended + case MotionNotify: +#if defined(QT_TABLET_SUPPORT) + if ( !chokeMouse ) { +#endif + widget->translateMouseEvent( event ); +#if defined(QT_TABLET_SUPPORT) + } else { + chokeMouse = FALSE; + } +#endif + break; + + case XKeyPress: // keyboard event + qt_net_update_user_time(widget->topLevelWidget()); + // fallthrough intended + case XKeyRelease: + { + if ( keywidget && keywidget->isEnabled() ) { // should always exist + // tqDebug( "sending key event" ); + keywidget->translateKeyEvent( event, grabbed ); + } + break; + } + + case GraphicsExpose: + case Expose: // paint event + widget->translatePaintEvent( event ); + break; + + case ConfigureNotify: // window move/resize event + if ( event->xconfigure.event == event->xconfigure.window ) + widget->translateConfigEvent( event ); + break; + + case XFocusIn: { // got focus + if ( widget->isDesktop() ) + break; + if ( inPopupMode() ) // some delayed focus event to ignore + break; + if ( !widget->isTopLevel() ) + break; + if ( event->xfocus.detail != NotifyAncestor && + event->xfocus.detail != NotifyInferior && + event->xfocus.detail != NotifyNonlinear ) + break; + widget->createInputContext(); + setActiveWindow( widget ); + if ( qt_focus_model == FocusModel_PointerRoot ) { + // We got real input focus from somewhere, but we were in PointerRoot + // mode, so we don't trust this event. Check the focus model to make + // sure we know what focus mode we are using... + qt_check_focus_model(); + } + } + break; + + case XFocusOut: // lost focus + if ( widget->isDesktop() ) + break; + if ( !widget->isTopLevel() ) + break; + if ( event->xfocus.mode == NotifyGrab ) + qt_xfocusout_grab_counter++; + if ( event->xfocus.mode != NotifyNormal ) + break; + if ( event->xfocus.detail != NotifyAncestor && + event->xfocus.detail != NotifyNonlinearVirtual && + event->xfocus.detail != NotifyNonlinear ) + break; + if ( !inPopupMode() && widget == active_window ) + setActiveWindow( 0 ); + break; + + case EnterNotify: { // enter window + if ( TQWidget::mouseGrabber() && widget != TQWidget::mouseGrabber() ) + break; + if ( inPopupMode() && widget->topLevelWidget() != activePopupWidget() ) + break; + if ( event->xcrossing.mode != NotifyNormal || + event->xcrossing.detail == NotifyVirtual || + event->xcrossing.detail == NotifyNonlinearVirtual ) + break; + if ( event->xcrossing.focus && + !widget->isDesktop() && !widget->isActiveWindow() ) { + if ( qt_focus_model == FocusModel_Unknown ) // check focus model + qt_check_focus_model(); + if ( qt_focus_model == FocusModel_PointerRoot ) // PointerRoot mode + setActiveWindow( widget ); + } + tqt_dispatchEnterLeave( widget, TQWidget::find( curWin ) ); + curWin = widget->winId(); + widget->translateMouseEvent( event ); //we don't get MotionNotify, emulate it + } + break; + + case LeaveNotify: { // leave window + if ( TQWidget::mouseGrabber() && widget != TQWidget::mouseGrabber() ) + break; + if ( curWin && widget->winId() != curWin ) + break; + if ( event->xcrossing.mode != NotifyNormal ) + break; + if ( !widget->isDesktop() ) + widget->translateMouseEvent( event ); //we don't get MotionNotify, emulate it + + TQWidget* enter = 0; + XEvent ev; + while ( XCheckMaskEvent( widget->x11Display(), EnterWindowMask | LeaveWindowMask , &ev ) + && !qt_x11EventFilter( &ev )) { + TQWidget* event_widget = TQWidget::find( ev.xcrossing.window ); + if( event_widget && event_widget->x11Event( &ev ) ) + break; + if ( ev.type == LeaveNotify && ev.xcrossing.mode == NotifyNormal ){ + enter = event_widget; + XPutBackEvent( widget->x11Display(), &ev ); + break; + } + if ( ev.xcrossing.mode != NotifyNormal || + ev.xcrossing.detail == NotifyVirtual || + ev.xcrossing.detail == NotifyNonlinearVirtual ) + continue; + enter = event_widget; + if ( ev.xcrossing.focus && + enter && !enter->isDesktop() && !enter->isActiveWindow() ) { + if ( qt_focus_model == FocusModel_Unknown ) // check focus model + qt_check_focus_model(); + if ( qt_focus_model == FocusModel_PointerRoot ) // PointerRoot mode + setActiveWindow( enter ); + } + break; + } + + if ( ( ! enter || enter->isDesktop() ) && + event->xcrossing.focus && widget == active_window && + qt_focus_model == FocusModel_PointerRoot // PointerRoot mode + ) { + setActiveWindow( 0 ); + } + + if ( !curWin ) + tqt_dispatchEnterLeave( widget, 0 ); + + tqt_dispatchEnterLeave( enter, widget ); + curWin = enter ? enter->winId() : 0; + } + break; + + case UnmapNotify: // window hidden + if ( widget->isTopLevel() && widget->isShown() ) { + widget->topData()->spont_unmapped = 1; + TQHideEvent e; + TQApplication::sendSpontaneousEvent( widget, &e ); + widget->hideChildren( TRUE ); + } + break; + + case MapNotify: // window shown + if ( widget->isTopLevel() && + widget->topData()->spont_unmapped ) { + widget->topData()->spont_unmapped = 0; + widget->showChildren( TRUE ); + TQShowEvent e; + TQApplication::sendSpontaneousEvent( widget, &e ); + } + break; + + case ClientMessage: // client message + return x11ClientMessage(widget,event,False); + + case ReparentNotify: // window manager reparents + while ( XCheckTypedWindowEvent( widget->x11Display(), + widget->winId(), + ReparentNotify, + event ) ) + ; // skip old reparent events + if ( event->xreparent.parent == TQPaintDevice::x11AppRootWindow() ) { + if ( widget->isTopLevel() ) { + widget->topData()->parentWinId = event->xreparent.parent; + if ( qt_deferred_map_contains( widget ) ) { + qt_deferred_map_take( widget ); + XMapWindow( appDpy, widget->winId() ); + } + } + } else + // store the parent. Useful for many things, embedding for instance. + widget->topData()->parentWinId = event->xreparent.parent; + if ( widget->isTopLevel() ) { + // the widget frame strut should also be invalidated + widget->topData()->fleft = widget->topData()->fright = + widget->topData()->ftop = widget->topData()->fbottom = 0; + + if ( qt_focus_model != FocusModel_Unknown ) { + // toplevel reparented... + TQWidget *newparent = TQWidget::find( event->xreparent.parent ); + if ( ! newparent || newparent->isDesktop() ) { + // we dont' know about the new parent (or we've been + // reparented to root), perhaps a window manager + // has been (re)started? reset the focus model to unknown + qt_focus_model = FocusModel_Unknown; + } + } + } + break; + + case SelectionRequest: { + XSelectionRequestEvent *req = &event->xselectionrequest; + if (! req) + break; + + if ( qt_xdnd_selection && req->selection == qt_xdnd_selection ) { + qt_xdnd_handle_selection_request( req ); + + } else if (tqt_clipboard) { + TQCustomEvent e( TQEvent::Clipboard, event ); + TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); + } + break; + } + case SelectionClear: { + XSelectionClearEvent *req = &event->xselectionclear; + // don't deliver dnd events to the clipboard, it gets confused + if (! req || ( qt_xdnd_selection && req->selection ) == qt_xdnd_selection) + break; + + if (tqt_clipboard) { + TQCustomEvent e( TQEvent::Clipboard, event ); + TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); + } + break; + } + + case SelectionNotify: { + XSelectionEvent *req = &event->xselection; + // don't deliver dnd events to the clipboard, it gets confused + if (! req || ( qt_xdnd_selection && req->selection ) == qt_xdnd_selection) + break; + + if (tqt_clipboard) { + TQCustomEvent e( TQEvent::Clipboard, event ); + TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); + } + break; + } + + default: + break; + } + + return 0; +} + +/*! + This virtual function is only implemented under X11. + + If you create an application that inherits TQApplication and + reimplement this function, you get direct access to all X events + that the are received from the X server. + + Return TRUE if you want to stop the event from being processed. + Return FALSE for normal event dispatching. + + \sa x11ProcessEvent() +*/ + +bool TQApplication::x11EventFilter( XEvent * ) +{ + return FALSE; +} + + + +/***************************************************************************** + Modal widgets; Since Xlib has little support for this we roll our own + modal widget mechanism. + A modal widget without a parent becomes application-modal. + A modal widget with a parent becomes modal to its parent and grandparents.. + + tqt_enter_modal() + Enters modal state + Arguments: + TQWidget *widget A modal widget + + tqt_leave_modal() + Leaves modal state for a widget + Arguments: + TQWidget *widget A modal widget + *****************************************************************************/ + +bool tqt_modal_state() +{ + return app_do_modal; +} + +void tqt_enter_modal( TQWidget *widget ) +{ + if ( !tqt_modal_stack ) { // create modal stack + tqt_modal_stack = new TQWidgetList; + TQ_CHECK_PTR( tqt_modal_stack ); + } + if (widget->parentWidget()) { + TQEvent e(TQEvent::WindowBlocked); + TQApplication::sendEvent(widget->parentWidget(), &e); + } + + tqt_dispatchEnterLeave( 0, TQWidget::find((WId)curWin) ); + tqt_modal_stack->insert( 0, widget ); + app_do_modal = TRUE; + curWin = 0; + ignoreNextMouseReleaseEvent = FALSE; +} + + +void tqt_leave_modal( TQWidget *widget ) +{ + if ( tqt_modal_stack && tqt_modal_stack->removeRef(widget) ) { + if ( tqt_modal_stack->isEmpty() ) { + delete tqt_modal_stack; + tqt_modal_stack = 0; + TQPoint p( TQCursor::pos() ); + TQWidget* w = TQApplication::widgetAt( p.x(), p.y(), TRUE ); + tqt_dispatchEnterLeave( w, TQWidget::find( curWin ) ); // send synthetic enter event + curWin = w? w->winId() : 0; + } + } + app_do_modal = tqt_modal_stack != 0; + ignoreNextMouseReleaseEvent = TRUE; + + if (widget->parentWidget()) { + TQEvent e(TQEvent::WindowUnblocked); + TQApplication::sendEvent(widget->parentWidget(), &e); + } +} + + +TQ_EXPORT bool tqt_try_modal( TQWidget *widget, XEvent *event ) +{ + if (qt_xdnd_dragging) { + // allow mouse events while DnD is active + switch (event->type) { + case ButtonPress: + case ButtonRelease: + case MotionNotify: + return TRUE; + default: + break; + } + } + + if ( tqt_tryModalHelper( widget ) ) + return TRUE; + + bool block_event = FALSE; + switch ( event->type ) { + case ButtonPress: // disallow mouse/key events + case ButtonRelease: + case MotionNotify: + case XKeyPress: + case XKeyRelease: + case EnterNotify: + case LeaveNotify: + case ClientMessage: + block_event = TRUE; + break; + default: + break; + } + + return !block_event; +} + + +/***************************************************************************** + Popup widget mechanism + + openPopup() + Adds a widget to the list of popup widgets + Arguments: + TQWidget *widget The popup widget to be added + + closePopup() + Removes a widget from the list of popup widgets + Arguments: + TQWidget *widget The popup widget to be removed + *****************************************************************************/ + + +static int openPopupCount = 0; +void TQApplication::openPopup( TQWidget *popup ) +{ + openPopupCount++; + if ( !popupWidgets ) { // create list + popupWidgets = new TQWidgetList; + TQ_CHECK_PTR( popupWidgets ); + } + popupWidgets->append( popup ); // add to end of list + + if ( popupWidgets->count() == 1 && !qt_nograb() ){ // grab mouse/keyboard + int r = XGrabKeyboard( popup->x11Display(), popup->winId(), FALSE, + GrabModeSync, GrabModeAsync, CurrentTime ); + if ( (popupGrabOk = (r == GrabSuccess)) ) { + r = XGrabPointer( popup->x11Display(), popup->winId(), TRUE, + (uint)(ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | EnterWindowMask | + LeaveWindowMask | PointerMotionMask), + GrabModeSync, GrabModeAsync, + None, None, CurrentTime ); + + if ( (popupGrabOk = (r == GrabSuccess)) ) + XAllowEvents( popup->x11Display(), SyncPointer, CurrentTime ); + else + XUngrabKeyboard( popup->x11Display(), CurrentTime ); + } + } else if ( popupGrabOk ) { + XAllowEvents( popup->x11Display(), SyncPointer, CurrentTime ); + } + + // popups are not focus-handled by the window system (the first + // popup grabbed the keyboard), so we have to do that manually: A + // new popup gets the focus + TQFocusEvent::setReason( TQFocusEvent::Popup ); + if ( popup->focusWidget()) + popup->focusWidget()->setFocus(); + else + popup->setFocus(); + TQFocusEvent::resetReason(); +} + +void TQApplication::closePopup( TQWidget *popup ) +{ + if ( !popupWidgets ) + return; + popupWidgets->removeRef( popup ); + if (popup == popupOfPopupButtonFocus) { + popupButtonFocus = 0; + popupOfPopupButtonFocus = 0; + } + if ( popupWidgets->count() == 0 ) { // this was the last popup + popupCloseDownMode = TRUE; // control mouse events + delete popupWidgets; + popupWidgets = 0; + if ( !qt_nograb() && popupGrabOk ) { // grabbing not disabled + if ( mouseButtonState != 0 + || popup->geometry(). contains(TQPoint(mouseGlobalXPos, mouseGlobalYPos) ) ) + { // mouse release event or inside + XAllowEvents( popup->x11Display(), AsyncPointer, + CurrentTime ); + } else { // mouse press event + mouseButtonPressTime -= 10000; // avoid double click + XAllowEvents( popup->x11Display(), ReplayPointer,CurrentTime ); + } + XUngrabPointer( popup->x11Display(), CurrentTime ); + XFlush( popup->x11Display() ); + } + if ( active_window ) { + TQFocusEvent::setReason( TQFocusEvent::Popup ); + if ( active_window->focusWidget() ) + active_window->focusWidget()->setFocus(); + else + active_window->setFocus(); + TQFocusEvent::resetReason(); + } + } else { + // popups are not focus-handled by the window system (the + // first popup grabbed the keyboard), so we have to do that + // manually: A popup was closed, so the previous popup gets + // the focus. + TQFocusEvent::setReason( TQFocusEvent::Popup ); + TQWidget* aw = popupWidgets->getLast(); + if (aw->focusWidget()) + aw->focusWidget()->setFocus(); + else + aw->setFocus(); + TQFocusEvent::resetReason(); + if ( popupWidgets->count() == 1 && !qt_nograb() ){ // grab mouse/keyboard + int r = XGrabKeyboard( aw->x11Display(), aw->winId(), FALSE, + GrabModeSync, GrabModeAsync, CurrentTime ); + if ( (popupGrabOk = (r == GrabSuccess)) ) { + r = XGrabPointer( aw->x11Display(), aw->winId(), TRUE, + (uint)(ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | EnterWindowMask | + LeaveWindowMask | PointerMotionMask), + GrabModeSync, GrabModeAsync, + None, None, CurrentTime ); + + if ( (popupGrabOk = (r == GrabSuccess)) ) + XAllowEvents( aw->x11Display(), SyncPointer, CurrentTime ); + } + } + } +} + +/***************************************************************************** + Event translation; translates X11 events to TQt events + *****************************************************************************/ + +// +// Mouse event translation +// +// Xlib doesn't give mouse double click events, so we generate them by +// comparing window, time and position between two mouse press events. +// + +// +// Keyboard event translation +// + +int qt_x11_translateButtonState( int s ) +{ + int bst = 0; + if ( s & Button1Mask ) + bst |= TQt::LeftButton; + if ( s & Button2Mask ) + bst |= TQt::MidButton; + if ( s & Button3Mask ) + bst |= TQt::RightButton; + if ( s & ShiftMask ) + bst |= TQt::ShiftButton; + if ( s & ControlMask ) + bst |= TQt::ControlButton; + if ( s & qt_alt_mask ) + bst |= TQt::AltButton; + if ( s & qt_meta_mask ) + bst |= TQt::MetaButton; + return bst; +} + +bool TQETWidget::translateMouseEvent( const XEvent *event ) +{ + static bool manualGrab = FALSE; + TQEvent::Type type; // event parameters + TQPoint pos; + TQPoint globalPos; + int button = 0; + int state; + XEvent nextEvent; + + if ( sm_blockUserInput ) // block user interaction during session management + return TRUE; + + static int x_root_save = -1, y_root_save = -1; + + if ( event->type == MotionNotify ) { // mouse move + if (event->xmotion.root != RootWindow(appDpy, x11Screen()) && + ! qt_xdnd_dragging ) + return FALSE; + + XMotionEvent lastMotion = event->xmotion; + while( XPending( appDpy ) ) { // compres mouse moves + XNextEvent( appDpy, &nextEvent ); + if ( nextEvent.type == ConfigureNotify + || nextEvent.type == PropertyNotify + || nextEvent.type == Expose + || nextEvent.type == NoExpose ) { + tqApp->x11ProcessEvent( &nextEvent ); + continue; + } else if ( nextEvent.type != MotionNotify || + nextEvent.xmotion.window != event->xmotion.window || + nextEvent.xmotion.state != event->xmotion.state ) { + XPutBackEvent( appDpy, &nextEvent ); + break; + } + if ( !qt_x11EventFilter(&nextEvent) + && !x11Event( &nextEvent ) ) // send event through filter + lastMotion = nextEvent.xmotion; + else + break; + } + type = TQEvent::MouseMove; + pos.rx() = lastMotion.x; + pos.ry() = lastMotion.y; + globalPos.rx() = lastMotion.x_root; + globalPos.ry() = lastMotion.y_root; + state = qt_x11_translateButtonState( lastMotion.state ); + if ( qt_button_down && (state & (LeftButton | + MidButton | + RightButton ) ) == 0 ) + qt_button_down = 0; + + // throw away mouse move events that are sent multiple times to the same + // position + bool throw_away = FALSE; + if ( x_root_save == globalPos.x() && + y_root_save == globalPos.y() ) + throw_away = TRUE; + x_root_save = globalPos.x(); + y_root_save = globalPos.y(); + if ( throw_away ) + return TRUE; + } else if ( event->type == EnterNotify || event->type == LeaveNotify) { + XEvent *xevent = (XEvent *)event; + //unsigned int xstate = event->xcrossing.state; + type = TQEvent::MouseMove; + pos.rx() = xevent->xcrossing.x; + pos.ry() = xevent->xcrossing.y; + globalPos.rx() = xevent->xcrossing.x_root; + globalPos.ry() = xevent->xcrossing.y_root; + state = qt_x11_translateButtonState( xevent->xcrossing.state ); + if ( qt_button_down && (state & (LeftButton | + MidButton | + RightButton ) ) == 0 ) + qt_button_down = 0; + if ( !qt_button_down ) + state = state & ~(LeftButton | MidButton | RightButton ); + } else { // button press or release + pos.rx() = event->xbutton.x; + pos.ry() = event->xbutton.y; + globalPos.rx() = event->xbutton.x_root; + globalPos.ry() = event->xbutton.y_root; + state = qt_x11_translateButtonState( event->xbutton.state ); + switch ( event->xbutton.button ) { + case Button1: button = LeftButton; break; + case Button2: button = MidButton; break; + case Button3: button = RightButton; break; + case Button4: + case Button5: + case 6: + case 7: + // the fancy mouse wheel. + + // take care about grabbing. We do this here since it + // is clear that we return anyway + if ( tqApp->inPopupMode() && popupGrabOk ) + XAllowEvents( x11Display(), SyncPointer, CurrentTime ); + + // We are only interested in ButtonPress. + if (event->type == ButtonPress ){ + + // compress wheel events (the X Server will simply + // send a button press for each single notch, + // regardless whether the application can catch up + // or not) + int delta = 1; + XEvent xevent; + while ( XCheckTypedWindowEvent(x11Display(),winId(), + ButtonPress,&xevent) ){ + if (xevent.xbutton.button != event->xbutton.button){ + XPutBackEvent(x11Display(), &xevent); + break; + } + delta++; + } + + // the delta is defined as multiples of + // WHEEL_DELTA, which is set to 120. Future wheels + // may offer a finer-resolution. A positive delta + // indicates forward rotation, a negative one + // backward rotation respectively. + int btn = event->xbutton.button; + delta *= 120 * ( (btn == Button4 || btn == 6) ? 1 : -1 ); + bool hor = ( ( (btn == Button4 || btn == Button5) && (state&AltButton) ) || + (btn == 6 || btn == 7) ); + translateWheelEvent( globalPos.x(), globalPos.y(), delta, state, (hor)?Horizontal:Vertical ); + } + return TRUE; + + // history navigation buttons + case 8: button = HistoryBackButton; break; + case 9: button = HistoryForwardButton; break; + } + if ( event->type == ButtonPress ) { // mouse button pressed +#if defined(Q_OS_IRIX) && defined(QT_TABLET_SUPPORT) + XEvent myEv; + if ( XCheckTypedEvent( appDpy, xinput_button_press, &myEv ) ) { + if ( translateXinputEvent( &myEv ) ) { + //Spontaneous event sent. Check if we need to continue. + if ( chokeMouse ) { + chokeMouse = FALSE; + return FALSE; + } + } + } +#endif + qt_button_down = childAt( pos ); //magic for masked widgets + if ( !qt_button_down || !qt_button_down->testWFlags(WMouseNoMask) ) + qt_button_down = this; + if ( mouseActWindow == event->xbutton.window && + mouseButtonPressed == button && + (long)event->xbutton.time -(long)mouseButtonPressTime + < TQApplication::doubleClickInterval() && + TQABS(event->xbutton.x - mouseXPos) < 5 && + TQABS(event->xbutton.y - mouseYPos) < 5 ) { + type = TQEvent::MouseButtonDblClick; + mouseButtonPressTime -= 2000; // no double-click next time + } else { + type = TQEvent::MouseButtonPress; + mouseButtonPressTime = event->xbutton.time; + } + mouseButtonPressed = button; // save event params for + mouseXPos = pos.x(); // future double click tests + mouseYPos = pos.y(); + mouseGlobalXPos = globalPos.x(); + mouseGlobalYPos = globalPos.y(); + } else { // mouse button released +#if defined(Q_OS_IRIX) && defined(QT_TABLET_SUPPORT) + XEvent myEv; + if ( XCheckTypedEvent( appDpy, xinput_button_release, &myEv ) ) { + if ( translateXinputEvent( &myEv ) ) { + //Spontaneous event sent. Check if we need to continue. + if ( chokeMouse ) { + chokeMouse = FALSE; + return FALSE; + } + } + } +#endif + if ( manualGrab ) { // release manual grab + manualGrab = FALSE; + XUngrabPointer( x11Display(), CurrentTime ); + XFlush( x11Display() ); + } + + type = TQEvent::MouseButtonRelease; + } + } + mouseActWindow = winId(); // save some event params + mouseButtonState = state; + if ( type == 0 ) // don't send event + return FALSE; + + if ( tqApp->inPopupMode() ) { // in popup mode + TQWidget *popup = tqApp->activePopupWidget(); + if ( popup != this ) { + if ( testWFlags(WType_Popup) && rect().contains(pos) ) + popup = this; + else // send to last popup + pos = popup->mapFromGlobal( globalPos ); + } + bool releaseAfter = FALSE; + TQWidget *popupChild = popup->childAt( pos ); + TQWidget *popupTarget = popupChild ? popupChild : popup; + + if (popup != popupOfPopupButtonFocus){ + popupButtonFocus = 0; + popupOfPopupButtonFocus = 0; + } + + if ( !popupTarget->isEnabled() ) { + if ( popupGrabOk ) + XAllowEvents( x11Display(), SyncPointer, CurrentTime ); + } + + switch ( type ) { + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonDblClick: + popupButtonFocus = popupChild; + popupOfPopupButtonFocus = popup; + break; + case TQEvent::MouseButtonRelease: + releaseAfter = TRUE; + break; + default: + break; // nothing for mouse move + } + + Display* dpy = x11Display(); // store display, send() may destroy us + + + int oldOpenPopupCount = openPopupCount; + + if ( popupButtonFocus ) { + TQMouseEvent e( type, popupButtonFocus->mapFromGlobal(globalPos), + globalPos, button, state ); + TQApplication::sendSpontaneousEvent( popupButtonFocus, &e ); + if ( releaseAfter ) { + popupButtonFocus = 0; + popupOfPopupButtonFocus = 0; + } + } else if ( popupChild ) { + TQMouseEvent e( type, popupChild->mapFromGlobal(globalPos), + globalPos, button, state ); + TQApplication::sendSpontaneousEvent( popupChild, &e ); + } else { + TQMouseEvent e( type, pos, globalPos, button, state ); + TQApplication::sendSpontaneousEvent( popup, &e ); + } + + if ( type == TQEvent::MouseButtonPress && button == RightButton && ( openPopupCount == oldOpenPopupCount ) ) { + TQWidget *popupEvent = popup; + if(popupButtonFocus) + popupEvent = popupButtonFocus; + else if(popupChild) + popupEvent = popupChild; + TQContextMenuEvent e( TQContextMenuEvent::Mouse, pos, globalPos, state ); + TQApplication::sendSpontaneousEvent( popupEvent, &e ); + } + + if ( releaseAfter ) + qt_button_down = 0; + + if ( tqApp->inPopupMode() ) { // still in popup mode + if ( popupGrabOk ) + XAllowEvents( dpy, SyncPointer, CurrentTime ); + } else { + if ( type != TQEvent::MouseButtonRelease && state != 0 && + TQWidget::find((WId)mouseActWindow) ) { + manualGrab = TRUE; // need to manually grab + XGrabPointer( dpy, mouseActWindow, False, + (uint)(ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | + EnterWindowMask | LeaveWindowMask), + GrabModeAsync, GrabModeAsync, + None, None, CurrentTime ); + } + } + + } else { + TQWidget *widget = this; + TQWidget *w = TQWidget::mouseGrabber(); + if ( !w ) + w = qt_button_down; + if ( w && w != this ) { + widget = w; + pos = w->mapFromGlobal( globalPos ); + } + + if ( popupCloseDownMode ) { + popupCloseDownMode = FALSE; + if ( testWFlags(WType_Popup) ) // ignore replayed event + return TRUE; + } + + if ( type == TQEvent::MouseButtonRelease && + (state & (~button) & ( LeftButton | + MidButton | + RightButton)) == 0 ) { + qt_button_down = 0; + } + + int oldOpenPopupCount = openPopupCount; + + TQMouseEvent e( type, pos, globalPos, button, state ); + TQApplication::sendSpontaneousEvent( widget, &e ); + + if ( type == TQEvent::MouseButtonPress && button == RightButton && ( openPopupCount == oldOpenPopupCount ) ) { + TQContextMenuEvent e( TQContextMenuEvent::Mouse, pos, globalPos, state ); + TQApplication::sendSpontaneousEvent( widget, &e ); + } + } + return TRUE; +} + + +// +// Wheel event translation +// +bool TQETWidget::translateWheelEvent( int global_x, int global_y, int delta, int state, Orientation orient ) +{ + // send the event to the widget or its ancestors + { + TQWidget* popup = tqApp->activePopupWidget(); + if ( popup && topLevelWidget() != popup ) + popup->close(); + TQWheelEvent e( mapFromGlobal(TQPoint( global_x, global_y)), + TQPoint(global_x, global_y), delta, state, orient ); + if ( TQApplication::sendSpontaneousEvent( this, &e ) ) + return TRUE; + } + + // send the event to the widget that has the focus or its ancestors, if different + TQWidget *w = this; + if ( w != tqApp->focusWidget() && ( w = tqApp->focusWidget() ) ) { + TQWidget* popup = tqApp->activePopupWidget(); + if ( popup && w != popup ) + popup->hide(); + TQWheelEvent e( mapFromGlobal(TQPoint( global_x, global_y)), + TQPoint(global_x, global_y), delta, state, orient ); + if ( TQApplication::sendSpontaneousEvent( w, &e ) ) + return TRUE; + } + return FALSE; +} + + +// +// XInput Translation Event +// +#if defined (QT_TABLET_SUPPORT) +bool TQETWidget::translateXinputEvent( const XEvent *ev ) +{ +#if defined (Q_OS_IRIX) + // Wacom has put defines in their wacom.h file so it would be quite wise + // to use them, need to think of a decent way of not using + // it when it doesn't exist... + XDeviceState *s; + XInputClass *iClass; + XValuatorState *vs; + int j; +#endif + TQWidget *w = this; + TQPoint global, + curr; + static int pressure = 0; + static int xTilt = 0, + yTilt = 0; + int deviceType = TQTabletEvent::NoDevice; + TQPair tId; + XEvent xinputMotionEvent; + XEvent mouseMotionEvent; +#if defined (Q_OS_IRIX) + XDevice *dev; +#endif + const XDeviceMotionEvent *motion = 0; + XDeviceButtonEvent *button = 0; + TQEvent::Type t; + + if ( ev->type == xinput_motion ) { + motion = (const XDeviceMotionEvent*)ev; + for (;;) { + if (!XCheckTypedWindowEvent(x11Display(), winId(), MotionNotify, &mouseMotionEvent)) + break; + if (!XCheckTypedWindowEvent(x11Display(), winId(), xinput_motion, &xinputMotionEvent)) { + XPutBackEvent(x11Display(), &mouseMotionEvent); + break; + } + if (mouseMotionEvent.xmotion.time != motion->time) { + XPutBackEvent(x11Display(), &mouseMotionEvent); + XPutBackEvent(x11Display(), &xinputMotionEvent); + break; + } + motion = ((const XDeviceMotionEvent*)&xinputMotionEvent); + } + t = TQEvent::TabletMove; + curr = TQPoint( motion->x, motion->y ); + } else { + if ( ev->type == xinput_button_press ) { + t = TQEvent::TabletPress; + } else { + t = TQEvent::TabletRelease; + } + button = (XDeviceButtonEvent*)ev; +/* + tqDebug( "\n\nXInput Button Event" ); + tqDebug( "serial:\t%d", button->serial ); + tqDebug( "send_event:\t%d", button->send_event ); + tqDebug( "display:\t%p", button->display ); + tqDebug( "window:\t%d", button->window ); + tqDebug( "deviceID:\t%d", button->deviceid ); + tqDebug( "root:\t%d", button->root ); + tqDebug( "subwindot:\t%d", button->subwindow ); + tqDebug( "x:\t%d", button->x ); + tqDebug( "y:\t%d", button->y ); + tqDebug( "x_root:\t%d", button->x_root ); + tqDebug( "y_root:\t%d", button->y_root ); + tqDebug( "state:\t%d", button->state ); + tqDebug( "button:\t%d", button->button ); + tqDebug( "same_screen:\t%d", button->same_screen ); + tqDebug( "time:\t%d", button->time ); +*/ + curr = TQPoint( button->x, button->y ); + } +#if defined(Q_OS_IRIX) + // default... + dev = devStylus; +#else + if ( ev->type == xinput_motion ) { + if ( motion->deviceid == devStylus->device_id ) { + deviceType = TQTabletEvent::Stylus; + } else if ( motion->deviceid == devEraser->device_id ) { + deviceType = TQTabletEvent::Eraser; + } + } else { + if ( button->deviceid == devStylus->device_id ) { + deviceType = TQTabletEvent::Stylus; + } else if ( button->deviceid == devEraser->device_id ) { + deviceType = TQTabletEvent::Eraser; + } + } +#endif + + const int PRESSURE_LEVELS = 255; + // we got the maximum pressure at start time, since various tablets have + // varying levels of distinguishing pressure changes, let's standardize and + // scale everything to 256 different levels... + static int scaleFactor = -1; + if ( scaleFactor == -1 ) { + if ( max_pressure > PRESSURE_LEVELS ) + scaleFactor = max_pressure / PRESSURE_LEVELS; + else + scaleFactor = PRESSURE_LEVELS / max_pressure; + } +#if defined (Q_OS_IRIX) + s = XQueryDeviceState( appDpy, dev ); + if ( s == NULL ) + return FALSE; + iClass = s->data; + for ( j = 0; j < s->num_classes; j++ ) { + if ( iClass->c_class == ValuatorClass ) { + vs = (XValuatorState *)iClass; + // figure out what device we have, based on bitmasking... + if ( vs->valuators[WAC_TRANSDUCER_I] + & WAC_TRANSDUCER_PROX_MSK ) { + switch ( vs->valuators[WAC_TRANSDUCER_I] + & WAC_TRANSDUCER_MSK ) { + case WAC_PUCK_ID: + deviceType = TQTabletEvent::Puck; + break; + case WAC_STYLUS_ID: + deviceType = TQTabletEvent::Stylus; + break; + case WAC_ERASER_ID: + deviceType = TQTabletEvent::Eraser; + break; + } + // Get a Unique Id for the device, Wacom gives us this ability + tId.first = vs->valuators[WAC_TRANSDUCER_I] & WAC_TRANSDUCER_ID_MSK; + tId.second = vs->valuators[WAC_SERIAL_NUM_I]; + } else + deviceType = TQTabletEvent::NoDevice; + // apparently Wacom needs a cast for the +/- values to make sense + xTilt = short(vs->valuators[WAC_XTILT_I]); + yTilt = short(vs->valuators[WAC_YTILT_I]); + if ( max_pressure > PRESSURE_LEVELS ) + pressure = vs->valuators[WAC_PRESSURE_I] / scaleFactor; + else + pressure = vs->valuators[WAC_PRESSURE_I] * scaleFactor; + global = TQPoint( vs->valuators[WAC_XCOORD_I], + vs->valuators[WAC_YCOORD_I] ); + break; + } + iClass = (XInputClass*)((char*)iClass + iClass->length); + } + XFreeDeviceState( s ); +#else + if ( motion ) { + xTilt = short(motion->axis_data[3]); + yTilt = short(motion->axis_data[4]); + if ( max_pressure > PRESSURE_LEVELS ) + pressure = motion->axis_data[2] / scaleFactor; + else + pressure = motion->axis_data[2] * scaleFactor; + global = TQPoint( motion->axis_data[0], motion->axis_data[1] ); + } else { + xTilt = short(button->axis_data[3]); + yTilt = short(button->axis_data[4]); + if ( max_pressure > PRESSURE_LEVELS ) + pressure = button->axis_data[2] / scaleFactor; + else + pressure = button->axis_data[2] * scaleFactor; + global = TQPoint( button->axis_data[0], button->axis_data[1] ); + } + // The only way to get these Ids is to scan the XFree86 log, which I'm not going to do. + tId.first = tId.second = -1; +#endif + + TQTabletEvent e( t, curr, global, deviceType, pressure, xTilt, yTilt, tId ); + TQApplication::sendSpontaneousEvent( w, &e ); + return TRUE; +} +#endif + +bool TQETWidget::translatePropertyEvent(const XEvent *event) +{ + if (!isTopLevel()) return TRUE; + + Atom ret; + int format, e; + unsigned char *data = 0; + unsigned long nitems, after; + + if (event->xproperty.atom == qt_net_wm_frame_strut) { + topData()->fleft = topData()->fright = topData()->ftop = topData()->fbottom = 0; + fstrut_dirty = 1; + + if (event->xproperty.state == PropertyNewValue) { + e = XGetWindowProperty(appDpy, event->xproperty.window, qt_net_wm_frame_strut, + 0, 4, // struts are 4 longs + False, XA_CARDINAL, &ret, &format, &nitems, &after, &data); + + if (e == Success && ret == XA_CARDINAL && + format == 32 && nitems == 4) { + long *strut = (long *) data; + topData()->fleft = strut[0]; + topData()->fright = strut[1]; + topData()->ftop = strut[2]; + topData()->fbottom = strut[3]; + fstrut_dirty = 0; + } + } + } else if (event->xproperty.atom == qt_net_wm_state) { + bool max = FALSE; + bool full = FALSE; + + if (event->xproperty.state == PropertyNewValue) { + // using length of 1024 should be safe for all current and + // possible NET states... + e = XGetWindowProperty(appDpy, event->xproperty.window, qt_net_wm_state, 0, 1024, + False, XA_ATOM, &ret, &format, &nitems, &after, &data); + + if (e == Success && ret == XA_ATOM && format == 32 && nitems > 0) { + Atom *states = (Atom *) data; + + unsigned long i; + for (i = 0; i < nitems; i++) { + if (states[i] == qt_net_wm_state_max_v || states[i] == qt_net_wm_state_max_h) + max = TRUE; + else if (states[i] == qt_net_wm_state_fullscreen) + full = TRUE; + } + } + } + + bool send_event = FALSE; + + if (qt_net_supports(qt_net_wm_state_max_v) + && qt_net_supports(qt_net_wm_state_max_h)) { + if (max && !isMaximized()) { + setWState(WState_Maximized); + send_event = TRUE; + } else if (!max && isMaximized()) { + clearWState(WState_Maximized); + send_event = TRUE; + } + } + + if (qt_net_supports(qt_net_wm_state_fullscreen)) { + if (full && !isFullScreen()) { + setWState(WState_FullScreen); + send_event = TRUE; + } else if (!full && isFullScreen()) { + clearWState(WState_FullScreen); + send_event = TRUE; + } + } + + if (send_event) { + TQEvent e(TQEvent::WindowStateChange); + TQApplication::sendSpontaneousEvent(this, &e); + } + } else if (event->xproperty.atom == tqt_wm_state) { + // the widget frame strut should also be invalidated + topData()->fleft = topData()->fright = topData()->ftop = topData()->fbottom = 0; + fstrut_dirty = 1; + + if (event->xproperty.state == PropertyDelete) { + // the window manager has removed the WM State property, + // so it is now in the withdrawn state (ICCCM 4.1.3.1) and + // we are free to reuse this window + topData()->parentWinId = 0; + // map the window if we were waiting for a transition to + // withdrawn + if ( qt_deferred_map_contains( this ) ) { + qt_deferred_map_take( this ); + XMapWindow( appDpy, winId() ); + } + } else if (topData()->parentWinId != TQPaintDevice::x11AppRootWindow(x11Screen())) { + // the window manager has changed the WM State property... + // we are wanting to see if we are withdrawn so that we + // can reuse this window... we only do this check *IF* we + // haven't been reparented to root - (the parentWinId != + // TQPaintDevice::x11AppRootWindow(x11Screen())) check + // above + + e = XGetWindowProperty(appDpy, winId(), tqt_wm_state, 0, 2, False, tqt_wm_state, + &ret, &format, &nitems, &after, &data ); + + if (e == Success && ret == tqt_wm_state && format == 32 && nitems > 0) { + long *state = (long *) data; + switch (state[0]) { + case WithdrawnState: + // if we are in the withdrawn state, we are free + // to reuse this window provided we remove the + // WM_STATE property (ICCCM 4.1.3.1) + XDeleteProperty(appDpy, winId(), tqt_wm_state); + + // set the parent id to zero, so that show() will + // work again + topData()->parentWinId = 0; + // map the window if we were waiting for a + // transition to withdrawn + if ( qt_deferred_map_contains( this ) ) { + qt_deferred_map_take( this ); + XMapWindow( appDpy, winId() ); + } + break; + + case IconicState: + if (!isMinimized()) { + // window was minimized + setWState(WState_Minimized); + TQEvent e(TQEvent::WindowStateChange); + TQApplication::sendSpontaneousEvent(this, &e); + } + break; + + default: + if (isMinimized()) { + // window was un-minimized + clearWState(WState_Minimized); + TQEvent e(TQEvent::WindowStateChange); + TQApplication::sendSpontaneousEvent(this, &e); + } + break; + } + } + } + } + + if (data) + XFree(data); + + return TRUE; +} + +#ifndef XK_ISO_Left_Tab +#define XK_ISO_Left_Tab 0xFE20 +#endif + +// the next lines are taken from XFree > 4.0 (X11/XF86keysyms.h), defining some special +// multimedia keys. They are included here as not every system has them. +#define XF86XK_Standby 0x1008FF10 +#define XF86XK_AudioLowerVolume 0x1008FF11 +#define XF86XK_AudioMute 0x1008FF12 +#define XF86XK_AudioRaiseVolume 0x1008FF13 +#define XF86XK_AudioPlay 0x1008FF14 +#define XF86XK_AudioStop 0x1008FF15 +#define XF86XK_AudioPrev 0x1008FF16 +#define XF86XK_AudioNext 0x1008FF17 +#define XF86XK_HomePage 0x1008FF18 +#define XF86XK_Calculator 0x1008FF1D +#define XF86XK_Mail 0x1008FF19 +#define XF86XK_Start 0x1008FF1A +#define XF86XK_Search 0x1008FF1B +#define XF86XK_AudioRecord 0x1008FF1C +#define XF86XK_Back 0x1008FF26 +#define XF86XK_Forward 0x1008FF27 +#define XF86XK_Stop 0x1008FF28 +#define XF86XK_Refresh 0x1008FF29 +#define XF86XK_Favorites 0x1008FF30 +#define XF86XK_AudioPause 0x1008FF31 +#define XF86XK_AudioMedia 0x1008FF32 +#define XF86XK_MyComputer 0x1008FF33 +#define XF86XK_OpenURL 0x1008FF38 +#define XF86XK_Launch0 0x1008FF40 +#define XF86XK_Launch1 0x1008FF41 +#define XF86XK_Launch2 0x1008FF42 +#define XF86XK_Launch3 0x1008FF43 +#define XF86XK_Launch4 0x1008FF44 +#define XF86XK_Launch5 0x1008FF45 +#define XF86XK_Launch6 0x1008FF46 +#define XF86XK_Launch7 0x1008FF47 +#define XF86XK_Launch8 0x1008FF48 +#define XF86XK_Launch9 0x1008FF49 +#define XF86XK_LaunchA 0x1008FF4A +#define XF86XK_LaunchB 0x1008FF4B +#define XF86XK_LaunchC 0x1008FF4C +#define XF86XK_LaunchD 0x1008FF4D +#define XF86XK_LaunchE 0x1008FF4E +#define XF86XK_LaunchF 0x1008FF4F +#define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */ +#define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */ +#define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */ +#define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */ +#define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */ +// end of XF86keysyms.h + + + +static const KeySym KeyTbl[] = { // keyboard mapping table + XK_Escape, TQt::Key_Escape, // misc keys + XK_Tab, TQt::Key_Tab, + XK_ISO_Left_Tab, TQt::Key_Backtab, + XK_BackSpace, TQt::Key_Backspace, + XK_Return, TQt::Key_Return, + XK_Insert, TQt::Key_Insert, + XK_KP_Insert, TQt::Key_Insert, + XK_Delete, TQt::Key_Delete, + XK_KP_Delete, TQt::Key_Delete, + XK_Clear, TQt::Key_Delete, + XK_Pause, TQt::Key_Pause, + XK_Print, TQt::Key_Print, + XK_KP_Begin, TQt::Key_Clear, + 0x1005FF60, TQt::Key_SysReq, // hardcoded Sun SysReq + 0x1007ff00, TQt::Key_SysReq, // hardcoded X386 SysReq + XK_Home, TQt::Key_Home, // cursor movement + XK_End, TQt::Key_End, + XK_Left, TQt::Key_Left, + XK_Up, TQt::Key_Up, + XK_Right, TQt::Key_Right, + XK_Down, TQt::Key_Down, + XK_Prior, TQt::Key_Prior, + XK_Next, TQt::Key_Next, + XK_KP_Home, TQt::Key_Home, + XK_KP_End, TQt::Key_End, + XK_KP_Left, TQt::Key_Left, + XK_KP_Up, TQt::Key_Up, + XK_KP_Right, TQt::Key_Right, + XK_KP_Down, TQt::Key_Down, + XK_KP_Prior, TQt::Key_Prior, + XK_KP_Next, TQt::Key_Next, + XK_Shift_L, TQt::Key_Shift, // modifiers + XK_Shift_R, TQt::Key_Shift, + XK_Shift_Lock, TQt::Key_Shift, + XK_Control_L, TQt::Key_Control, + XK_Control_R, TQt::Key_Control, + XK_Meta_L, TQt::Key_Meta, + XK_Meta_R, TQt::Key_Meta, + XK_Alt_L, TQt::Key_Alt, + XK_Alt_R, TQt::Key_Alt, + XK_Caps_Lock, TQt::Key_CapsLock, + XK_Num_Lock, TQt::Key_NumLock, + XK_Scroll_Lock, TQt::Key_ScrollLock, + XK_KP_Space, TQt::Key_Space, // numeric keypad + XK_KP_Tab, TQt::Key_Tab, + XK_KP_Enter, TQt::Key_Enter, + XK_KP_Equal, TQt::Key_Equal, + XK_KP_Multiply, TQt::Key_Asterisk, + XK_KP_Add, TQt::Key_Plus, + XK_KP_Separator, TQt::Key_Comma, + XK_KP_Subtract, TQt::Key_Minus, + XK_KP_Decimal, TQt::Key_Period, + XK_KP_Divide, TQt::Key_Slash, + XK_Super_L, TQt::Key_Super_L, + XK_Super_R, TQt::Key_Super_R, + XK_Menu, TQt::Key_Menu, + XK_Hyper_L, TQt::Key_Hyper_L, + XK_Hyper_R, TQt::Key_Hyper_R, + XK_Help, TQt::Key_Help, + 0x1000FF74, TQt::Key_BackTab, // hardcoded HP backtab + 0x1005FF10, TQt::Key_F11, // hardcoded Sun F36 (labeled F11) + 0x1005FF11, TQt::Key_F12, // hardcoded Sun F37 (labeled F12) + + // International input method support keys + + // International & multi-key character composition + XK_Multi_key, TQt::Key_Multi_key, + XK_Codeinput, TQt::Key_Codeinput, + XK_SingleCandidate, TQt::Key_SingleCandidate, + XK_MultipleCandidate, TQt::Key_MultipleCandidate, + XK_PreviousCandidate, TQt::Key_PreviousCandidate, + + // Misc Functions + XK_Mode_switch, TQt::Key_Mode_switch, + //XK_script_switch, TQt::Key_script_switch, + XK_script_switch, TQt::Key_Mode_switch, + + // Japanese keyboard support + XK_Kanji, TQt::Key_Kanji, + XK_Muhenkan, TQt::Key_Muhenkan, + //XK_Henkan_Mode, TQt::Key_Henkan_Mode, + XK_Henkan_Mode, TQt::Key_Henkan, + XK_Henkan, TQt::Key_Henkan, + XK_Romaji, TQt::Key_Romaji, + XK_Hiragana, TQt::Key_Hiragana, + XK_Katakana, TQt::Key_Katakana, + XK_Hiragana_Katakana, TQt::Key_Hiragana_Katakana, + XK_Zenkaku, TQt::Key_Zenkaku, + XK_Hankaku, TQt::Key_Hankaku, + XK_Zenkaku_Hankaku, TQt::Key_Zenkaku_Hankaku, + XK_Touroku, TQt::Key_Touroku, + XK_Massyo, TQt::Key_Massyo, + XK_Kana_Lock, TQt::Key_Kana_Lock, + XK_Kana_Shift, TQt::Key_Kana_Shift, + XK_Eisu_Shift, TQt::Key_Eisu_Shift, + XK_Eisu_toggle, TQt::Key_Eisu_toggle, + //XK_Kanji_Bangou, TQt::Key_Kanji_Bangou, + //XK_Zen_Koho, TQt::Key_Zen_Koho, + //XK_Mae_Koho, TQt::Key_Mae_Koho, + XK_Kanji_Bangou, TQt::Key_Codeinput, + XK_Zen_Koho, TQt::Key_MultipleCandidate, + XK_Mae_Koho, TQt::Key_PreviousCandidate, + +#ifdef XK_KOREAN + // Korean keyboard support + XK_Hangul, TQt::Key_Hangul, + XK_Hangul_Start, TQt::Key_Hangul_Start, + XK_Hangul_End, TQt::Key_Hangul_End, + XK_Hangul_Hanja, TQt::Key_Hangul_Hanja, + XK_Hangul_Jamo, TQt::Key_Hangul_Jamo, + XK_Hangul_Romaja, TQt::Key_Hangul_Romaja, + //XK_Hangul_Codeinput, TQt::Key_Hangul_Codeinput, + XK_Hangul_Codeinput, TQt::Key_Codeinput, + XK_Hangul_Jeonja, TQt::Key_Hangul_Jeonja, + XK_Hangul_Banja, TQt::Key_Hangul_Banja, + XK_Hangul_PreHanja, TQt::Key_Hangul_PreHanja, + XK_Hangul_PostHanja, TQt::Key_Hangul_PostHanja, + //XK_Hangul_SingleCandidate, TQt::Key_Hangul_SingleCandidate, + //XK_Hangul_MultipleCandidate, TQt::Key_Hangul_MultipleCandidate, + //XK_Hangul_PreviousCandidate, TQt::Key_Hangul_PreviousCandidate, + XK_Hangul_SingleCandidate, TQt::Key_SingleCandidate, + XK_Hangul_MultipleCandidate, TQt::Key_MultipleCandidate, + XK_Hangul_PreviousCandidate, TQt::Key_PreviousCandidate, + XK_Hangul_Special, TQt::Key_Hangul_Special, + //XK_Hangul_switch, TQt::Key_Hangul_switch, + XK_Hangul_switch, TQt::Key_Mode_switch, +#endif // XK_KOREAN + + // dead keys + XK_dead_grave, TQt::Key_Dead_Grave, + XK_dead_acute, TQt::Key_Dead_Acute, + XK_dead_circumflex, TQt::Key_Dead_Circumflex, + XK_dead_tilde, TQt::Key_Dead_Tilde, + XK_dead_macron, TQt::Key_Dead_Macron, + XK_dead_breve, TQt::Key_Dead_Breve, + XK_dead_abovedot, TQt::Key_Dead_Abovedot, + XK_dead_diaeresis, TQt::Key_Dead_Diaeresis, + XK_dead_abovering, TQt::Key_Dead_Abovering, + XK_dead_doubleacute, TQt::Key_Dead_Doubleacute, + XK_dead_caron, TQt::Key_Dead_Caron, + XK_dead_cedilla, TQt::Key_Dead_Cedilla, + XK_dead_ogonek, TQt::Key_Dead_Ogonek, + XK_dead_iota, TQt::Key_Dead_Iota, + XK_dead_voiced_sound, TQt::Key_Dead_Voiced_Sound, + XK_dead_semivoiced_sound, TQt::Key_Dead_Semivoiced_Sound, + XK_dead_belowdot, TQt::Key_Dead_Belowdot, + XK_dead_hook, TQt::Key_Dead_Hook, + XK_dead_horn, TQt::Key_Dead_Horn, + + // Special multimedia keys + // currently only tested with MS internet keyboard + + // browsing keys + XF86XK_Back, TQt::Key_Back, + XF86XK_Forward, TQt::Key_Forward, + XF86XK_Stop, TQt::Key_Stop, + XF86XK_Refresh, TQt::Key_Refresh, + XF86XK_Favorites, TQt::Key_Favorites, + XF86XK_AudioMedia, TQt::Key_LaunchMedia, + XF86XK_OpenURL, TQt::Key_OpenUrl, + XF86XK_HomePage, TQt::Key_HomePage, + XF86XK_Search, TQt::Key_Search, + + // media keys + XF86XK_AudioLowerVolume, TQt::Key_VolumeDown, + XF86XK_AudioMute, TQt::Key_VolumeMute, + XF86XK_AudioRaiseVolume, TQt::Key_VolumeUp, + XF86XK_AudioPlay, TQt::Key_MediaPlay, + XF86XK_AudioStop, TQt::Key_MediaStop, + XF86XK_AudioPrev, TQt::Key_MediaPrev, + XF86XK_AudioNext, TQt::Key_MediaNext, + XF86XK_AudioRecord, TQt::Key_MediaRecord, + + // launch keys + XF86XK_Mail, TQt::Key_LaunchMail, + XF86XK_MyComputer, TQt::Key_Launch0, + XF86XK_Calculator, TQt::Key_Launch1, + XF86XK_Standby, TQt::Key_Standby, + + XF86XK_Launch0, TQt::Key_Launch2, + XF86XK_Launch1, TQt::Key_Launch3, + XF86XK_Launch2, TQt::Key_Launch4, + XF86XK_Launch3, TQt::Key_Launch5, + XF86XK_Launch4, TQt::Key_Launch6, + XF86XK_Launch5, TQt::Key_Launch7, + XF86XK_Launch6, TQt::Key_Launch8, + XF86XK_Launch7, TQt::Key_Launch9, + XF86XK_Launch8, TQt::Key_LaunchA, + XF86XK_Launch9, TQt::Key_LaunchB, + XF86XK_LaunchA, TQt::Key_LaunchC, + XF86XK_LaunchB, TQt::Key_LaunchD, + XF86XK_LaunchC, TQt::Key_LaunchE, + XF86XK_LaunchD, TQt::Key_LaunchF, + XF86XK_MonBrightnessUp, TQt::Key_MonBrightnessUp, + XF86XK_MonBrightnessDown, TQt::Key_MonBrightnessDown, + XF86XK_KbdLightOnOff, TQt::Key_KeyboardLightOnOff, + XF86XK_KbdBrightnessUp, TQt::Key_KeyboardBrightnessUp, + XF86XK_KbdBrightnessDown, TQt::Key_KeyboardBrightnessDown, + + 0, 0 +}; + + +static TQIntDict *keyDict = 0; +static TQIntDict *textDict = 0; + +static void deleteKeyDicts() +{ + if ( keyDict ) + delete keyDict; + keyDict = 0; + if ( textDict ) + delete textDict; + textDict = 0; +} + +#if !defined(TQT_NO_XIM) +static const unsigned short katakanaKeysymsToUnicode[] = { + 0x0000, 0x3002, 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1, + 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3, + 0x30FC, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, + 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, + 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, + 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, + 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, + 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x309B, 0x309C +}; + +static const unsigned short cyrillicKeysymsToUnicode[] = { + 0x0000, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x0000, 0x045e, 0x045f, + 0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407, + 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x0000, 0x040e, 0x040f, + 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, + 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, + 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, + 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, + 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, + 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, + 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, + 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a +}; + +static const unsigned short greekKeysymsToUnicode[] = { + 0x0000, 0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c, + 0x038e, 0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015, + 0x0000, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc, + 0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, + 0x03a0, 0x03a1, 0x03a3, 0x0000, 0x03a4, 0x03a5, 0x03a6, 0x03a7, + 0x03a8, 0x03a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; + +static const unsigned short technicalKeysymsToUnicode[] = { + 0x0000, 0x23B7, 0x250C, 0x2500, 0x2320, 0x2321, 0x2502, 0x23A1, + 0x23A3, 0x23A4, 0x23A6, 0x239B, 0x239D, 0x239E, 0x23A0, 0x23A8, + 0x23AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222B, + 0x2234, 0x221D, 0x221E, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000, + 0x223C, 0x2243, 0x0000, 0x0000, 0x0000, 0x21D4, 0x21D2, 0x2261, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x0000, + 0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222A, 0x2227, 0x2228, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000, + 0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193, 0x0000 +}; + +static const unsigned short specialKeysymsToUnicode[] = { + 0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x0000, 0x0000, + 0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA, + 0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C, + 0x2502, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; + +static const unsigned short publishingKeysymsToUnicode[] = { + 0x0000, 0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009, + 0x200a, 0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025, + 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a, + 0x2105, 0x0000, 0x0000, 0x2012, 0x2329, 0x0000, 0x232a, 0x0000, + 0x0000, 0x0000, 0x0000, 0x215b, 0x215c, 0x215d, 0x215e, 0x0000, + 0x0000, 0x2122, 0x2613, 0x0000, 0x25c1, 0x25b7, 0x25cb, 0x25af, + 0x2018, 0x2019, 0x201c, 0x201d, 0x211e, 0x0000, 0x2032, 0x2033, + 0x0000, 0x271d, 0x0000, 0x25ac, 0x25c0, 0x25b6, 0x25cf, 0x25ae, + 0x25e6, 0x25ab, 0x25ad, 0x25b3, 0x25bd, 0x2606, 0x2022, 0x25aa, + 0x25b2, 0x25bc, 0x261c, 0x261e, 0x2663, 0x2666, 0x2665, 0x0000, + 0x2720, 0x2020, 0x2021, 0x2713, 0x2717, 0x266f, 0x266d, 0x2642, + 0x2640, 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e, 0x0000 +}; + +static const unsigned short aplKeysymsToUnicode[] = { + 0x0000, 0x0000, 0x0000, 0x003c, 0x0000, 0x0000, 0x003e, 0x0000, + 0x2228, 0x2227, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x00af, 0x0000, 0x22a5, 0x2229, 0x230a, 0x0000, 0x005f, 0x0000, + 0x0000, 0x0000, 0x2218, 0x0000, 0x2395, 0x0000, 0x22a4, 0x25cb, + 0x0000, 0x0000, 0x0000, 0x2308, 0x0000, 0x0000, 0x222a, 0x0000, + 0x2283, 0x0000, 0x2282, 0x0000, 0x22a2, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x22a3, 0x0000, 0x0000, 0x0000 +}; + +static const unsigned short koreanKeysymsToUnicode[] = { + 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, + 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, + 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, + 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f, + 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, + 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f, + 0x3160, 0x3161, 0x3162, 0x3163, 0x11a8, 0x11a9, 0x11aa, 0x11ab, + 0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3, + 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb, + 0x11bc, 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x316d, + 0x3171, 0x3178, 0x317f, 0x3181, 0x3184, 0x3186, 0x318d, 0x318e, + 0x11eb, 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9 +}; + + +static TQChar keysymToUnicode(unsigned char byte3, unsigned char byte4) +{ + if ( byte3 == 0x04 ) { + // katakana + if ( byte4 > 0xa0 && byte4 < 0xe0 ) + return TQChar( katakanaKeysymsToUnicode[byte4 - 0xa0] ); + else if ( byte4 == 0x7e ) + return TQChar( 0x203e ); // Overline + } else if ( byte3 == 0x06 ) { + // russian, use lookup table + if ( byte4 > 0xa0 ) + return TQChar( cyrillicKeysymsToUnicode[byte4 - 0xa0] ); + } else if ( byte3 == 0x07 ) { + // greek + if ( byte4 > 0xa0 ) + return TQChar( greekKeysymsToUnicode[byte4 - 0xa0] ); + } else if ( byte3 == 0x08 ) { + // technical + if ( byte4 > 0xa0 ) + return TQChar( technicalKeysymsToUnicode[byte4 - 0xa0] ); + } else if ( byte3 == 0x09 ) { + // special + if ( byte4 >= 0xe0 ) + return TQChar( specialKeysymsToUnicode[byte4 - 0xe0] ); + } else if ( byte3 == 0x0a ) { + // publishing + if ( byte4 > 0xa0 ) + return TQChar( publishingKeysymsToUnicode[byte4 - 0xa0] ); + } else if ( byte3 == 0x0b ) { + // APL + if ( byte4 > 0xa0 ) + return TQChar( aplKeysymsToUnicode[byte4 - 0xa0] ); + } else if ( byte3 == 0x0e ) { + // Korean + if ( byte4 > 0xa0 ) + return TQChar( koreanKeysymsToUnicode[byte4 - 0xa0] ); + } + return TQChar(0x0); +} +#endif + + +bool TQETWidget::translateKeyEventInternal( const XEvent *event, int& count, + TQString& text, + int& state, + char& ascii, int& code, TQEvent::Type &type, bool willRepeat, bool statefulTranslation ) +{ + TQTextCodec *mapper = qt_input_mapper; + // some XmbLookupString implementations don't return buffer overflow correctly, + // so we increase the input buffer to allow for long strings... + // 256 chars * 2 bytes + 1 null-term == 513 bytes + TQCString chars(513); + TQChar converted; + KeySym key = 0; + + if ( !keyDict ) { + keyDict = new TQIntDict( 13 ); + keyDict->setAutoDelete( FALSE ); + textDict = new TQIntDict( 13 ); + textDict->setAutoDelete( FALSE ); + tqAddPostRoutine( deleteKeyDicts ); + } + + XKeyEvent xkeyevent = event->xkey; + + // save the modifier state, we will use the keystate uint later by passing + // it to qt_x11_translateButtonState + uint keystate = event->xkey.state; + // remove the modifiers where mode_switch exists... HPUX machines seem + // to have alt *AND* mode_switch both in Mod1Mask, which causes + // XLookupString to return things like '�' (aring) for ALT-A. This + // completely breaks modifiers. If we remove the modifier for Mode_switch, + // then things work correctly... + xkeyevent.state &= ~qt_mode_switch_remove_mask; + + type = (event->type == XKeyPress) + ? TQEvent::KeyPress : TQEvent::KeyRelease; +#if defined(TQT_NO_XIM) + + count = XLookupString( &xkeyevent, chars.data(), chars.size(), &key, 0 ); + + if ( count == 1 ) + ascii = chars[0]; + +#else + // Implementation for X11R5 and newer, using XIM + + int keycode = event->xkey.keycode; + + if ( type == TQEvent::KeyPress ) { + bool mb=FALSE; + // commit string handling is done by + // TQXIMInputContext::x11FilterEvent() and are passed to + // widgets via TQIMEvent regardless of XIM style, so the + // following code is commented out. +#if 0 + if ( qt_xim ) { + TQTLWExtra* xd = tlw->topData(); + TQInputContext *qic = (TQInputContext *) xd->xic; + if ( qic ) { + mb=TRUE; + count = qic->lookupString(&xkeyevent, chars, &key, &status); + } + } +#endif + if ( !mb ) { + count = XLookupString( &xkeyevent, + chars.data(), chars.size(), &key, 0 ); + } + if ( count && !keycode ) { + keycode = qt_ximComposingKeycode; + qt_ximComposingKeycode = 0; + } + if ( key ) + keyDict->replace( keycode, (void*)key ); + // all keysyms smaller than that are actally keys that can be mapped + // to unicode chars + if ( count == 0 && key < 0xff00 ) { + unsigned char byte3 = (unsigned char )(key >> 8); + int mib = -1; + switch( byte3 ) { + case 0: // Latin 1 + case 1: // Latin 2 + case 2: //latin 3 + case 3: // latin4 + mib = byte3 + 4; break; + case 5: // arabic + mib = 82; break; + case 12: // Hebrew + mib = 85; break; + case 13: // Thai + mib = 2259; break; + case 4: // kana + case 6: // cyrillic + case 7: // greek + case 8: // technical, no mapping here at the moment + case 9: // Special + case 10: // Publishing + case 11: // APL + case 14: // Korean, no mapping + mib = -1; // manual conversion + mapper = 0; + converted = keysymToUnicode( byte3, key & 0xff ); + case 0x20: + // currency symbols + if ( key >= 0x20a0 && key <= 0x20ac ) { + mib = -1; // manual conversion + mapper = 0; + converted = (uint)key; + } + break; + default: + break; + } + if ( mib != -1 ) { + mapper = TQTextCodec::codecForMib( mib ); + chars[0] = (unsigned char) (key & 0xff); // get only the fourth bit for conversion later + count++; + } + } else if ( key >= 0x1000000 && key <= 0x100ffff ) { + converted = (ushort) (key - 0x1000000); + mapper = 0; + } + if ( count < (int)chars.size()-1 ) + chars[count] = '\0'; + if ( count == 1 ) { + ascii = chars[0]; + // +256 so we can store all eight-bit codes, including ascii 0, + // and independent of whether char is signed or not. + textDict->replace( keycode, (void*)(long)(256+ascii) ); + } + } else { + key = (int)(long)keyDict->find( keycode ); + if ( key ) + if( !willRepeat && statefulTranslation ) // Take out key of dictionary only if this call. + keyDict->take( keycode ); + long s = (long)textDict->find( keycode ); + if ( s ) { + if( statefulTranslation ) + textDict->take( keycode ); + ascii = (char)(s-256); + } + } +#endif // !TQT_NO_XIM + + state = qt_x11_translateButtonState( keystate ); + + static int directionKeyEvent = 0; + static unsigned int lastWinId = 0; + if ( qt_use_rtl_extensions && type == TQEvent::KeyRelease && statefulTranslation ) { + if (directionKeyEvent == Key_Direction_R || directionKeyEvent == Key_Direction_L ) { + type = TQEvent::KeyPress; + code = directionKeyEvent; + chars[0] = 0; + directionKeyEvent = 0; + lastWinId = 0; + return TRUE; + } else { + directionKeyEvent = 0; + lastWinId = 0; + } + } + + // Watch for keypresses and if its a key belonging to the Ctrl-Shift + // direction-changing accel, remember it. + // We keep track of those keys instead of using the event's state + // (to figure out whether the Ctrl modifier is held while Shift is pressed, + // or Shift is held while Ctrl is pressed) since the 'state' doesn't tell + // us whether the modifier held is Left or Right. + if ( qt_use_rtl_extensions && type == TQEvent::KeyPress && statefulTranslation ) { + if (key == XK_Control_L || key == XK_Control_R || key == XK_Shift_L || key == XK_Shift_R) { + if (!directionKeyEvent) { + directionKeyEvent = key; + // This code exists in order to check that + // the event is occurred in the same widget. + lastWinId = winId(); + } + } else { + // this can no longer be a direction-changing accel. + // if any other key was pressed. + directionKeyEvent = Key_Space; + } + } + + // Commentary in X11/keysymdef says that X codes match ASCII, so it + // is safe to use the locale functions to process X codes in ISO8859-1. + // + // This is mainly for compatibility - applications should not use the + // TQt keycodes between 128 and 255, but should rather use the + // TQKeyEvent::text(). + // + if ( key < 128 || (key < 256 && (!qt_input_mapper || qt_input_mapper->mibEnum()==4)) ) { + code = isprint((int)key) ? toupper((int)key) : 0; // upper-case key, if known + } else if ( key >= XK_F1 && key <= XK_F35 ) { + code = Key_F1 + ((int)key - XK_F1); // function keys + } else if ( key >= XK_KP_0 && key <= XK_KP_9) { + code = Key_0 + ((int)key - XK_KP_0); // numeric keypad keys + state |= Keypad; + } else { + int i = 0; // any other keys + while ( KeyTbl[i] ) { + if ( key == KeyTbl[i] ) { + code = (int)KeyTbl[i+1]; + break; + } + i += 2; + } + switch ( key ) { + case XK_KP_Insert: + case XK_KP_Delete: + case XK_KP_Home: + case XK_KP_End: + case XK_KP_Left: + case XK_KP_Up: + case XK_KP_Right: + case XK_KP_Down: + case XK_KP_Prior: + case XK_KP_Next: + case XK_KP_Space: + case XK_KP_Tab: + case XK_KP_Enter: + case XK_KP_Equal: + case XK_KP_Multiply: + case XK_KP_Add: + case XK_KP_Separator: + case XK_KP_Subtract: + case XK_KP_Decimal: + case XK_KP_Divide: + state |= Keypad; + break; + default: + break; + } + + if ( code == Key_Tab && + (state & ShiftButton) == ShiftButton ) { + // map shift+tab to shift+backtab, TQAccel knows about it + // and will handle it. + code = Key_Backtab; + chars[0] = 0; + } + + if ( qt_use_rtl_extensions && type == TQEvent::KeyPress && statefulTranslation ) { + if ( directionKeyEvent && lastWinId == winId() ) { + if ( ( key == XK_Shift_L && directionKeyEvent == XK_Control_L ) || + ( key == XK_Control_L && directionKeyEvent == XK_Shift_L ) ) { + directionKeyEvent = Key_Direction_L; + } else if ( ( key == XK_Shift_R && directionKeyEvent == XK_Control_R ) || + ( key == XK_Control_R && directionKeyEvent == XK_Shift_R ) ) { + directionKeyEvent = Key_Direction_R; + } + } + else if ( directionKeyEvent == Key_Direction_L || directionKeyEvent == Key_Direction_R ) { + directionKeyEvent = Key_Space; // invalid + } + } + } + +#if 0 +#ifndef Q_EE + static int c = 0; + extern void qt_dialog_default_key(); +#define Q_EE(x) c = (c == x || (!c && x == 0x1000) )? x+1 : 0 + if ( tlw && state == '0' ) { + switch ( code ) { + case 0x4f: Q_EE(Key_Backtab); break; + case 0x52: Q_EE(Key_Tab); break; + case 0x54: Q_EE(Key_Escape); break; + case 0x4c: + if (c == Key_Return ) + qt_dialog_default_key(); + else + Q_EE(Key_Backspace); + break; + } + } +#undef Q_EE +#endif +#endif + + // convert chars (8bit) to text (unicode). + if ( mapper ) + text = mapper->toUnicode(chars,count); + else if ( !mapper && converted.unicode() != 0x0 ) + text = converted; + else + text = chars; + return TRUE; +} + + +struct qt_auto_repeat_data +{ + // match the window and keycode with timestamp delta of 10ms + Window window; + KeyCode keycode; + Time timestamp; + + // queue scanner state + bool release; + bool error; +}; + +#if defined(Q_C_CALLBACKS) +extern "C" { +#endif + +static Bool qt_keypress_scanner(Display *, XEvent *event, XPointer arg) +{ + if (event->type != XKeyPress && event->type != XKeyRelease) + return FALSE; + + qt_auto_repeat_data *d = (qt_auto_repeat_data *) arg; + if (d->error || + event->xkey.window != d->window || + event->xkey.keycode != d->keycode) { + d->error = TRUE; + return FALSE; + } + + if (event->type == XKeyPress) { + d->error = (! d->release || event->xkey.time - d->timestamp > 10); + return (! d->error); + } + + // must be XKeyRelease event + if (d->release) { + // found a second release + d->error = TRUE; + return FALSE; + } + + // found a single release + d->release = TRUE; + d->timestamp = event->xkey.time; + + return FALSE; +} + +static Bool qt_keyrelease_scanner(Display *, XEvent *event, XPointer arg) +{ + const qt_auto_repeat_data *d = (const qt_auto_repeat_data *) arg; + return (event->type == XKeyRelease && + event->xkey.window == d->window && + event->xkey.keycode == d->keycode); +} + +#if defined(Q_C_CALLBACKS) +} +#endif + +bool TQETWidget::translateKeyEvent( const XEvent *event, bool grab ) +{ + int code = -1; + int count = 0; + int state; + char ascii = 0; + + if ( sm_blockUserInput ) // block user interaction during session management + return TRUE; + + Display *dpy = x11Display(); + + if ( !isEnabled() ) + return TRUE; + + TQEvent::Type type; + bool autor = FALSE; + TQString text; + + translateKeyEventInternal( event, count, text, state, ascii, code, type, + qt_mode_switch_remove_mask != 0 ); + + static uint curr_autorep = 0; + // was this the last auto-repeater? + qt_auto_repeat_data auto_repeat_data; + auto_repeat_data.window = event->xkey.window; + auto_repeat_data.keycode = event->xkey.keycode; + auto_repeat_data.timestamp = event->xkey.time; + + if ( event->type == XKeyPress ) { + if ( curr_autorep == event->xkey.keycode ) { + autor = TRUE; + curr_autorep = 0; + } + } else { + // look ahead for auto-repeat + XEvent nextpress; + + auto_repeat_data.release = TRUE; + auto_repeat_data.error = FALSE; + if (XCheckIfEvent(dpy, &nextpress, &qt_keypress_scanner, + (XPointer) &auto_repeat_data)) { + autor = TRUE; + + // Put it back... we COULD send the event now and not need + // the static curr_autorep variable. + XPutBackEvent(dpy,&nextpress); + } + curr_autorep = autor ? event->xkey.keycode : 0; + } + + // process accelerators before doing key compression + if ( type == TQEvent::KeyPress && !grab ) { + // send accel events if the keyboard is not grabbed + TQKeyEvent a( type, code, ascii, state, text, autor, + TQMAX( TQMAX(count,1), int(text.length())) ); + if ( tqt_tryAccelEvent( this, &a ) ) + return TRUE; + } + + long save = 0; + if ( qt_mode_switch_remove_mask != 0 ) { + save = qt_mode_switch_remove_mask; + qt_mode_switch_remove_mask = 0; + + // translate the key event again, but this time apply any Mode_switch + // modifiers + translateKeyEventInternal( event, count, text, state, ascii, code, type ); + } + +#ifndef TQT_NO_IM + TQInputContext *qic = getInputContext(); +#endif + + // compress keys + if ( !text.isEmpty() && testWState(WState_CompressKeys) && +#ifndef TQT_NO_IM + // Ordinary input methods require discrete key events to work + // properly, so key compression has to be disabled when input + // context exists. + // + // And further consideration, some complex input method + // require all key press/release events discretely even if + // the input method awares of key compression and compressed + // keys are ordinary alphabets. For example, the uim project + // is planning to implement "combinational shift" feature for + // a Japanese input method, uim-skk. It will work as follows. + // + // 1. press "r" + // 2. press "u" + // 3. release both "r" and "u" in arbitrary order + // 4. above key sequence generates "Ru" + // + // Of course further consideration about other participants + // such as key repeat mechanism is required to implement such + // feature. + ! qic && +#endif // TQT_NO_IM + // do not compress keys if the key event we just got above matches + // one of the key ranges used to compute stopCompression + ! ( ( code >= Key_Escape && code <= Key_SysReq ) || + ( code >= Key_Home && code <= Key_Next ) || + ( code >= Key_Super_L && code <= Key_Direction_R ) || + ( ( code == 0 ) && ( ascii == '\n' ) ) ) ) { + // the widget wants key compression so it gets it + int codeIntern = -1; + int countIntern = 0; + int stateIntern; + char asciiIntern = 0; + XEvent evRelease; + XEvent evPress; + + // sync the event queue, this makes key compress work better + XSync( dpy, FALSE ); + + for (;;) { + TQString textIntern; + if ( !XCheckTypedWindowEvent(dpy,event->xkey.window, + XKeyRelease,&evRelease) ) + break; + if ( !XCheckTypedWindowEvent(dpy,event->xkey.window, + XKeyPress,&evPress) ) { + XPutBackEvent(dpy, &evRelease); + break; + } + TQEvent::Type t; + translateKeyEventInternal( &evPress, countIntern, textIntern, + stateIntern, asciiIntern, codeIntern, t ); + // use stopCompression to stop key compression for the following + // key event ranges: + bool stopCompression = + // 1) misc keys + ( codeIntern >= Key_Escape && codeIntern <= Key_SysReq ) || + // 2) cursor movement + ( codeIntern >= Key_Home && codeIntern <= Key_Next ) || + // 3) extra keys + ( codeIntern >= Key_Super_L && codeIntern <= Key_Direction_R ) || + // 4) something that a) doesn't translate to text or b) translates + // to newline text + ((codeIntern == 0) && (asciiIntern == '\n')); + if (stateIntern == state && !textIntern.isEmpty() && !stopCompression) { + text += textIntern; + count += countIntern; + } else { + XPutBackEvent(dpy, &evPress); + XPutBackEvent(dpy, &evRelease); + break; + } + } + } + + if ( save != 0 ) + qt_mode_switch_remove_mask = save; + + // autorepeat compression makes sense for all widgets (Windows + // does it automatically .... ) + if ( event->type == XKeyPress && text.length() <= 1 +#ifndef TQT_NO_IM + // input methods need discrete key events + && ! qic +#endif// TQT_NO_IM + ) { + XEvent dummy; + + for (;;) { + auto_repeat_data.release = FALSE; + auto_repeat_data.error = FALSE; + if (! XCheckIfEvent(dpy, &dummy, &qt_keypress_scanner, + (XPointer) &auto_repeat_data)) + break; + if (! XCheckIfEvent(dpy, &dummy, &qt_keyrelease_scanner, + (XPointer) &auto_repeat_data)) + break; + + count++; + if (!text.isEmpty()) + text += text[0]; + } + } + + if (code == 0 && ascii == '\n') { + code = Key_Return; + ascii = '\r'; + text = "\r"; + } + + // try the menukey first + if ( type == TQEvent::KeyPress && code == TQt::Key_Menu ) { + TQContextMenuEvent e( TQContextMenuEvent::Keyboard, TQPoint( 5, 5 ), mapToGlobal( TQPoint( 5, 5 ) ), 0 ); + TQApplication::sendSpontaneousEvent( this, &e ); + if( e.isAccepted() ) + return TRUE; + } + + TQKeyEvent e( type, code, ascii, state, text, autor, + TQMAX(TQMAX(count,1), int(text.length())) ); + return TQApplication::sendSpontaneousEvent( this, &e ); +} + + +// +// Paint event translation +// +// When receiving many expose events, we compress them (union of all expose +// rectangles) into one event which is sent to the widget. + +struct PaintEventInfo { + Window window; +}; + +#if defined(Q_C_CALLBACKS) +extern "C" { +#endif + +static Bool isPaintOrScrollDoneEvent( Display *, XEvent *ev, XPointer a ) +{ + PaintEventInfo *info = (PaintEventInfo *)a; + if ( ev->type == Expose || ev->type == GraphicsExpose + || ( ev->type == ClientMessage + && ev->xclient.message_type == qt_qt_scrolldone ) ) + { + if ( ev->xexpose.window == info->window ) + return True; + } + return False; +} + +#if defined(Q_C_CALLBACKS) +} +#endif + + +// declared above: static TQPtrList *sip_list = 0; + +void qt_insert_sip( TQWidget* scrolled_widget, int dx, int dy ) +{ + if ( !sip_list ) { + sip_list = new TQPtrList; + sip_list->setAutoDelete( TRUE ); + } + + TQScrollInProgress* sip = new TQScrollInProgress( scrolled_widget, dx, dy ); + sip_list->append( sip ); + + XClientMessageEvent client_message = {}; + client_message.type = ClientMessage; + client_message.window = scrolled_widget->winId(); + client_message.format = 32; + client_message.message_type = qt_qt_scrolldone; + client_message.data.l[0] = sip->id; + + XSendEvent( appDpy, scrolled_widget->winId(), False, NoEventMask, + (XEvent*)&client_message ); +} + +int qt_sip_count( TQWidget* scrolled_widget ) +{ + if ( !sip_list ) + return 0; + + int sips=0; + + for (TQScrollInProgress* sip = sip_list->first(); + sip; sip=sip_list->next()) + { + if ( sip->scrolled_widget == scrolled_widget ) + sips++; + } + + return sips; +} + +static +bool translateBySips( TQWidget* that, TQRect& paintRect ) +{ + if ( sip_list ) { + int dx=0, dy=0; + int sips=0; + for (TQScrollInProgress* sip = sip_list->first(); + sip; sip=sip_list->next()) + { + if ( sip->scrolled_widget == that ) { + if ( sips ) { + dx += sip->dx; + dy += sip->dy; + } + sips++; + } + } + if ( sips > 1 ) { + paintRect.moveBy( dx, dy ); + return TRUE; + } + } + return FALSE; +} + +bool TQETWidget::translatePaintEvent( const XEvent *event ) +{ + setWState( WState_Exposed ); + TQRect paintRect( event->xexpose.x, event->xexpose.y, + event->xexpose.width, event->xexpose.height ); + bool merging_okay = !testWFlags(WPaintClever); + XEvent xevent; + PaintEventInfo info; + info.window = winId(); + bool should_clip = translateBySips( this, paintRect ); + + TQRegion paintRegion( paintRect ); + + if ( merging_okay ) { + // WARNING: this is O(number_of_events * number_of_matching_events) + while ( XCheckIfEvent(x11Display(),&xevent,isPaintOrScrollDoneEvent, + (XPointer)&info) && + !qt_x11EventFilter(&xevent) && + !x11Event( &xevent ) ) // send event through filter + { + if ( xevent.type == Expose || xevent.type == GraphicsExpose ) { + TQRect exposure(xevent.xexpose.x, + xevent.xexpose.y, + xevent.xexpose.width, + xevent.xexpose.height); + if ( translateBySips( this, exposure ) ) + should_clip = TRUE; + paintRegion = paintRegion.unite( exposure ); + } else { + translateScrollDoneEvent( &xevent ); + } + } + } + + if ( should_clip ) { + paintRegion = paintRegion.intersect( rect() ); + if ( paintRegion.isEmpty() ) + return TRUE; + } + + TQPaintEvent e( paintRegion ); + setWState( WState_InPaintEvent ); + if ( !isTopLevel() && backgroundOrigin() != WidgetOrigin ) + erase( paintRegion ); + qt_set_paintevent_clipping( this, paintRegion ); + TQApplication::sendSpontaneousEvent( this, &e ); + qt_clear_paintevent_clipping(); + clearWState( WState_InPaintEvent ); + return TRUE; +} + +// +// Scroll-done event translation. +// + +bool TQETWidget::translateScrollDoneEvent( const XEvent *event ) +{ + if ( !sip_list ) return FALSE; + + long id = event->xclient.data.l[0]; + + // Remove any scroll-in-progress record for the given id. + for (TQScrollInProgress* sip = sip_list->first(); sip; sip=sip_list->next()) { + if ( sip->id == id ) { + sip_list->remove( sip_list->current() ); + return TRUE; + } + } + + return FALSE; +} + +#if defined(Q_C_CALLBACKS) +extern "C" { +#endif +#ifndef TQT_NO_XSYNC +static Bool qt_net_wm_sync_request_scanner(Display*, XEvent* event, XPointer arg) +{ + return (event->type == ClientMessage && event->xclient.window == *(Window*)arg + && event->xclient.message_type == tqt_wm_protocols + && ((unsigned int)event->xclient.data.l[ 0 ]) == qt_net_wm_sync_request ); +} +#endif + +#if defined(Q_C_CALLBACKS) +} +#endif + +// +// ConfigureNotify (window move and resize) event translation + +bool TQETWidget::translateConfigEvent( const XEvent *event ) +{ + // config pending is only set on resize, see tqwidget_x11.cpp, internalSetGeometry() + bool was_resize = testWState( WState_ConfigPending ); + + clearWState(WState_ConfigPending); + + if ( isTopLevel() ) { + TQPoint newCPos( geometry().topLeft() ); + TQSize newSize( event->xconfigure.width, event->xconfigure.height ); + + bool trust = (topData()->parentWinId == None || + topData()->parentWinId == TQPaintDevice::x11AppRootWindow()); + + if (event->xconfigure.send_event || trust ) { + // if a ConfigureNotify comes from a real sendevent request, we can + // trust its values. + newCPos.rx() = event->xconfigure.x + event->xconfigure.border_width; + newCPos.ry() = event->xconfigure.y + event->xconfigure.border_width; + } + + if ( isVisible() ) + TQApplication::syncX(); + + if (! extra || extra->compress_events) { + // ConfigureNotify compression for faster opaque resizing + XEvent otherEvent; + int compressed_configs = 0; + while ( XCheckTypedWindowEvent( x11Display(), winId(), ConfigureNotify, + &otherEvent ) ) { + if ( qt_x11EventFilter( &otherEvent ) ) + continue; + + if (x11Event( &otherEvent ) ) + continue; + + if ( otherEvent.xconfigure.event != otherEvent.xconfigure.window ) + continue; + + newSize.setWidth( otherEvent.xconfigure.width ); + newSize.setHeight( otherEvent.xconfigure.height ); + + if ( otherEvent.xconfigure.send_event || trust ) { + newCPos.rx() = otherEvent.xconfigure.x + + otherEvent.xconfigure.border_width; + newCPos.ry() = otherEvent.xconfigure.y + + otherEvent.xconfigure.border_width; + } + ++compressed_configs; + } +#ifndef TQT_NO_XSYNC + // _NET_WM_SYNC_REQUEST compression + Window wid = winId(); + while ( compressed_configs && + XCheckIfEvent( x11Display(), &otherEvent, + qt_net_wm_sync_request_scanner, (XPointer)&wid ) ) { + handleSyncRequest( (void*)&otherEvent ); + --compressed_configs; + } +#endif + } + + TQRect cr ( geometry() ); + if ( newSize != cr.size() ) { // size changed + was_resize = TRUE; + TQSize oldSize = size(); + cr.setSize( newSize ); + crect = cr; + + if ( isVisible() ) { + TQResizeEvent e( newSize, oldSize ); + TQApplication::sendSpontaneousEvent( this, &e ); + } else { + TQResizeEvent * e = new TQResizeEvent( newSize, oldSize ); + TQApplication::postEvent( this, e ); + } + } + + if ( newCPos != cr.topLeft() ) { // compare with cpos (exluding frame) + TQPoint oldPos = geometry().topLeft(); + cr.moveTopLeft( newCPos ); + crect = cr; + if ( isVisible() ) { + TQMoveEvent e( newCPos, oldPos ); // pos (including frame), not cpos + TQApplication::sendSpontaneousEvent( this, &e ); + } else { + TQMoveEvent * e = new TQMoveEvent( newCPos, oldPos ); + TQApplication::postEvent( this, e ); + } + } + } else { + XEvent xevent; + while ( XCheckTypedWindowEvent(x11Display(),winId(), ConfigureNotify,&xevent) && + !qt_x11EventFilter(&xevent) && + !x11Event( &xevent ) ) // send event through filter + ; + } + + bool transbg = backgroundOrigin() != WidgetOrigin; + // we ignore NorthWestGravity at the moment for reversed layout + if ( transbg || + (!testWFlags( WStaticContents ) && + testWState( WState_Exposed ) && was_resize ) || + TQApplication::reverseLayout() ) { + // remove unnecessary paint events from the queue + XEvent xevent; + while ( XCheckTypedWindowEvent( x11Display(), winId(), Expose, &xevent ) && + ! qt_x11EventFilter( &xevent ) && + ! x11Event( &xevent ) ) // send event through filter + ; + repaint( !testWFlags(WResizeNoErase) || transbg ); + } + + incrementSyncCounter(); + + return TRUE; +} + + +// +// Close window event translation. +// +bool TQETWidget::translateCloseEvent( const XEvent * ) +{ + return close(FALSE); +} + + +/*! + Sets the text cursor's flash (blink) time to \a msecs + milliseconds. The flash time is the time required to display, + invert and restore the caret display. Usually the text cursor is + displayed for \a msecs/2 milliseconds, then hidden for \a msecs/2 + milliseconds, but this may vary. + + Note that on Microsoft Windows, calling this function sets the + cursor flash time for all windows. + + \sa cursorFlashTime() +*/ +void TQApplication::setCursorFlashTime( int msecs ) +{ + cursor_flash_time = msecs; +} + + +/*! + Returns the text cursor's flash (blink) time in milliseconds. The + flash time is the time required to display, invert and restore the + caret display. + + The default value on X11 is 1000 milliseconds. On Windows, the + control panel value is used. + + Widgets should not cache this value since it may be changed at any + time by the user changing the global desktop settings. + + \sa setCursorFlashTime() +*/ +int TQApplication::cursorFlashTime() +{ + return cursor_flash_time; +} + +/*! + Sets the time limit that distinguishes a double click from two + consecutive mouse clicks to \a ms milliseconds. + + Note that on Microsoft Windows, calling this function sets the + double click interval for all windows. + + \sa doubleClickInterval() +*/ + +void TQApplication::setDoubleClickInterval( int ms ) +{ + mouse_double_click_time = ms; +} + + +/*! + Returns the maximum duration for a double click. + + The default value on X11 is 400 milliseconds. On Windows, the + control panel value is used. + + \sa setDoubleClickInterval() +*/ + +int TQApplication::doubleClickInterval() +{ + return mouse_double_click_time; +} + + +/*! + Sets the number of lines to scroll when the mouse wheel is rotated + to \a n. + + If this number exceeds the number of visible lines in a certain + widget, the widget should interpret the scroll operation as a + single page up / page down operation instead. + + \sa wheelScrollLines() +*/ +void TQApplication::setWheelScrollLines( int n ) +{ + wheel_scroll_lines = n; +} + +/*! + Returns the number of lines to scroll when the mouse wheel is + rotated. + + \sa setWheelScrollLines() +*/ +int TQApplication::wheelScrollLines() +{ + return wheel_scroll_lines; +} + +/*! + Enables the UI effect \a effect if \a enable is TRUE, otherwise + the effect will not be used. + + Note: All effects are disabled on screens running at less than + 16-bit color depth. + + \sa isEffectEnabled(), TQt::UIEffect, setDesktopSettingsAware() +*/ +void TQApplication::setEffectEnabled( TQt::UIEffect effect, bool enable ) +{ + switch (effect) { + case UI_AnimateMenu: + if ( enable ) fade_menu = FALSE; + animate_menu = enable; + break; + case UI_FadeMenu: + if ( enable ) + animate_menu = TRUE; + fade_menu = enable; + break; + case UI_AnimateCombo: + animate_combo = enable; + break; + case UI_AnimateTooltip: + if ( enable ) fade_tooltip = FALSE; + animate_tooltip = enable; + break; + case UI_FadeTooltip: + if ( enable ) + animate_tooltip = TRUE; + fade_tooltip = enable; + break; + case UI_AnimateToolBox: + animate_toolbox = enable; + break; + default: + animate_ui = enable; + break; + } +} + +/*! + Returns TRUE if \a effect is enabled; otherwise returns FALSE. + + By default, TQt will try to use the desktop settings. Call + setDesktopSettingsAware(FALSE) to prevent this. + + Note: All effects are disabled on screens running at less than + 16-bit color depth. + + \sa setEffectEnabled(), TQt::UIEffect +*/ +bool TQApplication::isEffectEnabled( TQt::UIEffect effect ) +{ + if ( TQColor::numBitPlanes() < 16 || !animate_ui ) + return FALSE; + + switch( effect ) { + case UI_AnimateMenu: + return animate_menu; + case UI_FadeMenu: + return fade_menu; + case UI_AnimateCombo: + return animate_combo; + case UI_AnimateTooltip: + return animate_tooltip; + case UI_FadeTooltip: + return fade_tooltip; + case UI_AnimateToolBox: + return animate_toolbox; + default: + return animate_ui; + } +} + +/***************************************************************************** + Session management support + *****************************************************************************/ + +#ifndef TQT_NO_SM_SUPPORT + +#include + +class TQSessionManagerData +{ +public: + TQSessionManagerData( TQSessionManager* mgr, TQString& id, TQString& key ) + : sm( mgr ), sessionId( id ), sessionKey( key ) {} + TQSessionManager* sm; + TQStringList restartCommand; + TQStringList discardCommand; + TQString& sessionId; + TQString& sessionKey; + TQSessionManager::RestartHint restartHint; +}; + +class TQSmSocketReceiver : public TQObject +{ + TQ_OBJECT +public: + TQSmSocketReceiver( int socket ) + : TQObject(0,0) + { + TQSocketNotifier* sn = new TQSocketNotifier( socket, TQSocketNotifier::Read, this ); + connect( sn, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( socketActivated(int) ) ); + } + +public slots: + void socketActivated(int); +}; + + +static SmcConn smcConnection = 0; +static bool sm_interactionActive; +static bool sm_smActive; +static int sm_interactStyle; +static int sm_saveType; +static bool sm_cancel; +// static bool sm_waitingForPhase2; ### never used?!? +static bool sm_waitingForInteraction; +static bool sm_isshutdown; +// static bool sm_shouldbefast; ### never used?!? +static bool sm_phase2; +static bool sm_in_phase2; + +static TQSmSocketReceiver* sm_receiver = 0; + +static void resetSmState(); +static void sm_setProperty( const char* name, const char* type, + int num_vals, SmPropValue* vals); +static void sm_saveYourselfCallback( SmcConn smcConn, SmPointer clientData, + int saveType, Bool shutdown , int interactStyle, Bool fast); +static void sm_saveYourselfPhase2Callback( SmcConn smcConn, SmPointer clientData ) ; +static void sm_dieCallback( SmcConn smcConn, SmPointer clientData ) ; +static void sm_shutdownCancelledCallback( SmcConn smcConn, SmPointer clientData ); +static void sm_saveCompleteCallback( SmcConn smcConn, SmPointer clientData ); +static void sm_interactCallback( SmcConn smcConn, SmPointer clientData ); +static void sm_performSaveYourself( TQSessionManagerData* ); + +static void resetSmState() +{ +// sm_waitingForPhase2 = FALSE; ### never used?!? + sm_waitingForInteraction = FALSE; + sm_interactionActive = FALSE; + sm_interactStyle = SmInteractStyleNone; + sm_smActive = FALSE; + sm_blockUserInput = FALSE; + sm_isshutdown = FALSE; +// sm_shouldbefast = FALSE; ### never used?!? + sm_phase2 = FALSE; + sm_in_phase2 = FALSE; +} + + +// theoretically it's possible to set several properties at once. For +// simplicity, however, we do just one property at a time +static void sm_setProperty( const char* name, const char* type, + int num_vals, SmPropValue* vals) +{ + if (num_vals ) { + SmProp prop; + prop.name = (char*)name; + prop.type = (char*)type; + prop.num_vals = num_vals; + prop.vals = vals; + + SmProp* props[1]; + props[0] = ∝ + SmcSetProperties( smcConnection, 1, props ); + } + else { + char* names[1]; + names[0] = (char*) name; + SmcDeleteProperties( smcConnection, 1, names ); + } +} + +static void sm_setProperty( const TQString& name, const TQString& value) +{ + SmPropValue prop; + prop.length = value.length(); + prop.value = (SmPointer) value.latin1(); + sm_setProperty( name.latin1(), SmARRAY8, 1, &prop ); +} + +static void sm_setProperty( const TQString& name, const TQStringList& value) +{ + SmPropValue *prop = new SmPropValue[ value.count() ]; + int count = 0; + for ( TQStringList::ConstIterator it = value.begin(); it != value.end(); ++it ) { + prop[ count ].length = (*it).length(); + prop[ count ].value = (char*)(*it).latin1(); + ++count; + } + sm_setProperty( name.latin1(), SmLISTofARRAY8, count, prop ); + delete [] prop; +} + + +// workaround for broken libsm, see below +struct QT_smcConn { + unsigned int save_yourself_in_progress : 1; + unsigned int shutdown_in_progress : 1; +}; + +static void sm_saveYourselfCallback( SmcConn smcConn, SmPointer clientData, + int saveType, Bool shutdown , int interactStyle, Bool /*fast*/) +{ + if (smcConn != smcConnection ) + return; + sm_cancel = FALSE; + sm_smActive = TRUE; + sm_isshutdown = shutdown; + sm_saveType = saveType; + sm_interactStyle = interactStyle; +// sm_shouldbefast = fast; ### never used?!? + + // ugly workaround for broken libSM. libSM should do that _before_ + // actually invoking the callback in sm_process.c + ( (QT_smcConn*)smcConn )->save_yourself_in_progress = TRUE; + if ( sm_isshutdown ) + ( (QT_smcConn*)smcConn )->shutdown_in_progress = TRUE; + + sm_performSaveYourself( (TQSessionManagerData*) clientData ); + if ( !sm_isshutdown ) // we cannot expect a confirmation message in that case + resetSmState(); +} + +static void sm_performSaveYourself( TQSessionManagerData* smd ) +{ + if ( sm_isshutdown ) + sm_blockUserInput = TRUE; + + TQSessionManager* sm = smd->sm; + + // generate a new session key + timeval tv; + gettimeofday( &tv, 0 ); + smd->sessionKey = TQString::number( tv.tv_sec ) + "_" + TQString::number(tv.tv_usec); + + // tell the session manager about our program in best POSIX style + sm_setProperty( SmProgram, TQString( tqApp->argv()[0] ) ); + // tell the session manager about our user as well. + struct passwd* entry = getpwuid( geteuid() ); + if ( entry ) + sm_setProperty( SmUserID, TQString::fromLatin1( entry->pw_name ) ); + + // generate a restart and discard command that makes sense + TQStringList restart; + restart << tqApp->argv()[0] << "-session" << smd->sessionId + "_" + smd->sessionKey; + if (tqstricmp(tqAppName(), tqAppClass()) != 0) + restart << "-name" << tqAppName(); + sm->setRestartCommand( restart ); + TQStringList discard; + sm->setDiscardCommand( discard ); + + switch ( sm_saveType ) { + case SmSaveBoth: + tqApp->commitData( *sm ); + if ( sm_isshutdown && sm_cancel) + break; // we cancelled the shutdown, no need to save state + // fall through + case SmSaveLocal: + tqApp->saveState( *sm ); + break; + case SmSaveGlobal: + tqApp->commitData( *sm ); + break; + default: + break; + } + + if ( sm_phase2 && !sm_in_phase2 ) { + SmcRequestSaveYourselfPhase2( smcConnection, sm_saveYourselfPhase2Callback, (SmPointer*) smd ); + sm_blockUserInput = FALSE; + } + else { + // close eventual interaction monitors and cancel the + // shutdown, if required. Note that we can only cancel when + // performing a shutdown, it does not work for checkpoints + if ( sm_interactionActive ) { + SmcInteractDone( smcConnection, sm_isshutdown && sm_cancel); + sm_interactionActive = FALSE; + } + else if ( sm_cancel && sm_isshutdown ) { + if ( sm->allowsErrorInteraction() ) { + SmcInteractDone( smcConnection, True ); + sm_interactionActive = FALSE; + } + } + + // set restart and discard command in session manager + sm_setProperty( SmRestartCommand, sm->restartCommand() ); + sm_setProperty( SmDiscardCommand, sm->discardCommand() ); + + // set the restart hint + SmPropValue prop; + prop.length = sizeof( int ); + int value = sm->restartHint(); + prop.value = (SmPointer) &value; + sm_setProperty( SmRestartStyleHint, SmCARD8, 1, &prop ); + + // we are done + SmcSaveYourselfDone( smcConnection, !sm_cancel ); + } +} + +static void sm_dieCallback( SmcConn smcConn, SmPointer /* clientData */) +{ + if (smcConn != smcConnection ) + return; + resetSmState(); + TQEvent quitEvent(TQEvent::Quit); + TQApplication::sendEvent(tqApp, &quitEvent); +} + +static void sm_shutdownCancelledCallback( SmcConn smcConn, SmPointer /* clientData */) +{ + if (smcConn != smcConnection ) + return; + if ( sm_waitingForInteraction ) + tqApp->exit_loop(); + resetSmState(); +} + +static void sm_saveCompleteCallback( SmcConn smcConn, SmPointer /*clientData */) +{ + if (smcConn != smcConnection ) + return; + resetSmState(); +} + +static void sm_interactCallback( SmcConn smcConn, SmPointer /* clientData */ ) +{ + if (smcConn != smcConnection ) + return; + if ( sm_waitingForInteraction ) + tqApp->exit_loop(); +} + +static void sm_saveYourselfPhase2Callback( SmcConn smcConn, SmPointer clientData ) +{ + if (smcConn != smcConnection ) + return; + sm_in_phase2 = TRUE; + sm_performSaveYourself( (TQSessionManagerData*) clientData ); +} + + +void TQSmSocketReceiver::socketActivated(int) +{ + IceProcessMessages( SmcGetIceConnection( smcConnection ), 0, 0); +} + + +#undef Bool +#include "tqapplication_x11.moc" + +TQSessionManager::TQSessionManager( TQApplication * app, TQString &id, TQString& key ) + : TQObject( app, "session manager" ) +{ + d = new TQSessionManagerData( this, id, key ); + d->restartHint = RestartIfRunning; + + resetSmState(); + char cerror[256]; + char* myId = 0; + char* prevId = (char*)id.latin1(); // we know what we are doing + + SmcCallbacks cb; + cb.save_yourself.callback = sm_saveYourselfCallback; + cb.save_yourself.client_data = (SmPointer) d; + cb.die.callback = sm_dieCallback; + cb.die.client_data = (SmPointer) d; + cb.save_complete.callback = sm_saveCompleteCallback; + cb.save_complete.client_data = (SmPointer) d; + cb.shutdown_cancelled.callback = sm_shutdownCancelledCallback; + cb.shutdown_cancelled.client_data = (SmPointer) d; + + // avoid showing a warning message below + const char* session_manager = getenv("SESSION_MANAGER"); + if ( !session_manager || !session_manager[0] ) + return; + + smcConnection = SmcOpenConnection( 0, 0, 1, 0, + SmcSaveYourselfProcMask | + SmcDieProcMask | + SmcSaveCompleteProcMask | + SmcShutdownCancelledProcMask, + &cb, + prevId, + &myId, + 256, cerror ); + + id = TQString::fromLatin1( myId ); + ::free( myId ); // it was allocated by C + + TQString error = cerror; + if (!smcConnection ) { + tqWarning("Session management error: %s", error.latin1() ); + } + else { + sm_receiver = new TQSmSocketReceiver( IceConnectionNumber( SmcGetIceConnection( smcConnection ) ) ); + } +} + +TQSessionManager::~TQSessionManager() +{ + if ( smcConnection ) + SmcCloseConnection( smcConnection, 0, 0 ); + smcConnection = 0; + delete sm_receiver; + delete d; +} + +TQString TQSessionManager::sessionId() const +{ + return d->sessionId; +} + +TQString TQSessionManager::sessionKey() const +{ + return d->sessionKey; +} + + +void* TQSessionManager::handle() const +{ + return (void*) smcConnection; +} + + +bool TQSessionManager::allowsInteraction() +{ + if ( sm_interactionActive ) + return TRUE; + + if ( sm_waitingForInteraction ) + return FALSE; + + if ( sm_interactStyle == SmInteractStyleAny ) { + sm_waitingForInteraction = SmcInteractRequest( smcConnection, SmDialogNormal, + sm_interactCallback, (SmPointer*) this ); + } + if ( sm_waitingForInteraction ) { + tqApp->enter_loop(); + sm_waitingForInteraction = FALSE; + if ( sm_smActive ) { // not cancelled + sm_interactionActive = TRUE; + sm_blockUserInput = FALSE; + return TRUE; + } + } + return FALSE; +} + +bool TQSessionManager::allowsErrorInteraction() +{ + if ( sm_interactionActive ) + return TRUE; + + if ( sm_waitingForInteraction ) + return FALSE; + + if ( sm_interactStyle == SmInteractStyleAny || sm_interactStyle == SmInteractStyleErrors ) { + sm_waitingForInteraction = SmcInteractRequest( smcConnection, SmDialogError, + sm_interactCallback, (SmPointer*) this ); + } + if ( sm_waitingForInteraction ) { + tqApp->enter_loop(); + sm_waitingForInteraction = FALSE; + if ( sm_smActive ) { // not cancelled + sm_interactionActive = TRUE; + sm_blockUserInput = FALSE; + return TRUE; + } + } + return FALSE; +} + +void TQSessionManager::release() +{ + if ( sm_interactionActive ) { + SmcInteractDone( smcConnection, False ); + sm_interactionActive = FALSE; + if ( sm_smActive && sm_isshutdown ) + sm_blockUserInput = TRUE; + } +} + +void TQSessionManager::cancel() +{ + sm_cancel = TRUE; +} + +void TQSessionManager::setRestartHint( TQSessionManager::RestartHint hint) +{ + d->restartHint = hint; +} + +TQSessionManager::RestartHint TQSessionManager::restartHint() const +{ + return d->restartHint; +} + +void TQSessionManager::setRestartCommand( const TQStringList& command) +{ + d->restartCommand = command; +} + +TQStringList TQSessionManager::restartCommand() const +{ + return d->restartCommand; +} + +void TQSessionManager::setDiscardCommand( const TQStringList& command) +{ + d->discardCommand = command; +} + +TQStringList TQSessionManager::discardCommand() const +{ + return d->discardCommand; +} + +void TQSessionManager::setManagerProperty( const TQString& name, const TQString& value) +{ + SmPropValue prop; + prop.length = value.length(); + prop.value = (SmPointer) value.utf8().data(); + sm_setProperty( name.latin1(), SmARRAY8, 1, &prop ); +} + +void TQSessionManager::setManagerProperty( const TQString& name, const TQStringList& value) +{ + SmPropValue *prop = new SmPropValue[ value.count() ]; + int count = 0; + for ( TQStringList::ConstIterator it = value.begin(); it != value.end(); ++it ) { + prop[ count ].length = (*it).length(); + prop[ count ].value = (char*)(*it).utf8().data(); + ++count; + } + sm_setProperty( name.latin1(), SmLISTofARRAY8, count, prop ); + delete [] prop; +} + +bool TQSessionManager::isPhase2() const +{ + return sm_in_phase2; +} + +void TQSessionManager::requestPhase2() +{ + sm_phase2 = TRUE; +} + + +#endif // TQT_NO_SM_SUPPORT diff --git a/src/kernel/tqclipboard.cpp b/src/kernel/tqclipboard.cpp index f7c2836f5..ee476a1a5 100644 --- a/src/kernel/tqclipboard.cpp +++ b/src/kernel/tqclipboard.cpp @@ -42,8 +42,8 @@ #ifndef TQT_NO_CLIPBOARD -#include "ntqapplication.h" -#include "qapplication_p.h" +#include "tqapplication.h" +#include "tqapplication_p.h" #include "tqdragobject.h" #include "tqpixmap.h" diff --git a/src/kernel/tqclipboard_x11.cpp b/src/kernel/tqclipboard_x11.cpp index 16af49f8e..16772b491 100644 --- a/src/kernel/tqclipboard_x11.cpp +++ b/src/kernel/tqclipboard_x11.cpp @@ -64,7 +64,7 @@ #ifndef TQT_NO_CLIPBOARD -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqeventloop.h" #include "tqbitmap.h" #include "tqdatetime.h" @@ -74,7 +74,7 @@ #include "tqvaluelist.h" #include "tqmap.h" #include "tqt_x11_p.h" -#include "qapplication_p.h" +#include "tqapplication_p.h" // REVISED: arnt @@ -83,12 +83,12 @@ Internal TQClipboard functions for X11. *****************************************************************************/ -// from qapplication_x11.cpp +// from tqapplication_x11.cpp typedef int (*QX11EventFilter) (XEvent*); extern QX11EventFilter tqt_set_x11_event_filter (QX11EventFilter filter); -extern Time tqt_x_time; // def. in qapplication_x11.cpp -extern Time qt_x_incr; // def. in qapplication_x11.cpp +extern Time tqt_x_time; // def. in tqapplication_x11.cpp +extern Time qt_x_incr; // def. in tqapplication_x11.cpp extern Atom qt_xa_clipboard; extern Atom qt_selection_property; extern Atom tqt_clipboard_sentinel; @@ -1575,7 +1575,7 @@ void TQClipboard::setData( TQMimeSource* src, Mode mode ) /* - Called by the main event loop in qapplication_x11.cpp when the + Called by the main event loop in tqapplication_x11.cpp when the _QT_SELECTION_SENTINEL property has been changed (i.e. when some TQt process has performed TQClipboard::setData(). If it returns TRUE, the TQClipBoard dataChanged() signal should be emitted. diff --git a/src/kernel/tqcolor_x11.cpp b/src/kernel/tqcolor_x11.cpp index fe5f6685c..77f48037a 100644 --- a/src/kernel/tqcolor_x11.cpp +++ b/src/kernel/tqcolor_x11.cpp @@ -42,8 +42,8 @@ #include "tqcolor_p.h" #include "string.h" #include "tqpaintdevice.h" -#include "ntqapplication.h" -#include "qapplication_p.h" +#include "tqapplication.h" +#include "tqapplication_p.h" #include "tqt_x11_p.h" // NOT REVISED diff --git a/src/kernel/tqcursor_x11.cpp b/src/kernel/tqcursor_x11.cpp index 3724706c2..6a66e3cda 100644 --- a/src/kernel/tqcursor_x11.cpp +++ b/src/kernel/tqcursor_x11.cpp @@ -41,7 +41,7 @@ #include "tqcursor.h" #include "tqbitmap.h" #include "tqimage.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqdatastream.h" #include "tqnamespace.h" #include "tqt_x11_p.h" diff --git a/src/kernel/tqdesktopwidget_x11.cpp b/src/kernel/tqdesktopwidget_x11.cpp index 2a9e5bd9e..35d021c51 100644 --- a/src/kernel/tqdesktopwidget_x11.cpp +++ b/src/kernel/tqdesktopwidget_x11.cpp @@ -37,7 +37,7 @@ **********************************************************************/ #include "tqdesktopwidget.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqobjectlist.h" #include "tqt_x11_p.h" #include @@ -45,7 +45,7 @@ // defined in tqwidget_x11.cpp extern int qt_x11_create_desktop_on_screen; -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern Atom qt_net_workarea; extern bool qt_net_supports(Atom atom); diff --git a/src/kernel/tqdragobject.cpp b/src/kernel/tqdragobject.cpp index b6fac2bd0..04b9f43a1 100644 --- a/src/kernel/tqdragobject.cpp +++ b/src/kernel/tqdragobject.cpp @@ -47,7 +47,7 @@ #include "tqdragobject.h" #include "tqtextcodec.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpoint.h" #include "tqwidget.h" #include "tqbuffer.h" diff --git a/src/kernel/tqdrawutil.cpp b/src/kernel/tqdrawutil.cpp index 0c3283ddc..79aa69378 100644 --- a/src/kernel/tqdrawutil.cpp +++ b/src/kernel/tqdrawutil.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_DRAWUTIL #include "tqbitmap.h" #include "tqpixmapcache.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" /*! diff --git a/src/kernel/tqevent.cpp b/src/kernel/tqevent.cpp index e8d042b06..fc59d9164 100644 --- a/src/kernel/tqevent.cpp +++ b/src/kernel/tqevent.cpp @@ -40,7 +40,7 @@ #include "tqevent.h" #include "tqcursor.h" -#include "ntqapplication.h" +#include "tqapplication.h" /*! diff --git a/src/kernel/tqeventloop.cpp b/src/kernel/tqeventloop.cpp index 3a7d72833..0cc3036d6 100644 --- a/src/kernel/tqeventloop.cpp +++ b/src/kernel/tqeventloop.cpp @@ -38,7 +38,7 @@ #include "tqeventloop_p.h" // includes qplatformdefs.h #include "tqeventloop.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqdatetime.h" #ifdef TQT_THREAD_SUPPORT diff --git a/src/kernel/tqeventloop_unix.cpp b/src/kernel/tqeventloop_unix.cpp index 8ab816426..fc0a0b48b 100644 --- a/src/kernel/tqeventloop_unix.cpp +++ b/src/kernel/tqeventloop_unix.cpp @@ -38,7 +38,7 @@ #include "tqeventloop_p.h" // includes qplatformdefs.h #include "tqeventloop.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitarray.h" #include "tqmutex.h" #include diff --git a/src/kernel/tqeventloop_unix_glib.cpp b/src/kernel/tqeventloop_unix_glib.cpp index 200c9245d..eec66d0af 100644 --- a/src/kernel/tqeventloop_unix_glib.cpp +++ b/src/kernel/tqeventloop_unix_glib.cpp @@ -38,7 +38,7 @@ #include "tqeventloop_glib_p.h" // includes qplatformdefs.h #include "tqeventloop.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitarray.h" #include "tqmutex.h" diff --git a/src/kernel/tqeventloop_x11.cpp b/src/kernel/tqeventloop_x11.cpp index 743d48e70..13ba8c6af 100644 --- a/src/kernel/tqeventloop_x11.cpp +++ b/src/kernel/tqeventloop_x11.cpp @@ -38,7 +38,7 @@ #include "tqeventloop_p.h" // includes qplatformdefs.h #include "tqeventloop.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitarray.h" #include "tqcolor_p.h" #include "tqt_x11_p.h" @@ -59,7 +59,7 @@ static const int XKeyRelease = KeyRelease; #undef KeyPress #undef KeyRelease -// from qapplication.cpp +// from tqapplication.cpp extern bool tqt_is_gui_used; // from tqeventloop_unix.cpp @@ -170,7 +170,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags ) case ClientMessage: { - // from qapplication_x11.cpp + // from tqapplication_x11.cpp extern Atom tqt_wm_protocols; extern Atom tqt_wm_take_focus; extern Atom qt_qt_scrolldone; @@ -405,7 +405,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags ) bool TQEventLoop::hasPendingEvents() const { - extern uint qGlobalPostedEventsCount(); // from qapplication.cpp + extern uint qGlobalPostedEventsCount(); // from tqapplication.cpp return ( qGlobalPostedEventsCount() || XPending( TQPaintDevice::x11AppDisplay() ) ); } diff --git a/src/kernel/tqeventloop_x11_glib.cpp b/src/kernel/tqeventloop_x11_glib.cpp index 28069fe1b..cf2126591 100644 --- a/src/kernel/tqeventloop_x11_glib.cpp +++ b/src/kernel/tqeventloop_x11_glib.cpp @@ -41,7 +41,7 @@ #include "tqeventloop_glib_p.h" // includes qplatformdefs.h #include "tqeventloop.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitarray.h" #include "tqcolor_p.h" #include "tqt_x11_p.h" @@ -140,7 +140,7 @@ static const int XKeyRelease = KeyRelease; #undef KeyPress #undef KeyRelease -// from qapplication.cpp +// from tqapplication.cpp extern bool tqt_is_gui_used; // from tqeventloop_unix.cpp @@ -339,7 +339,7 @@ bool TQEventLoop::processX11Events() case ClientMessage: { - // from qapplication_x11.cpp + // from tqapplication_x11.cpp extern Atom tqt_wm_protocols; extern Atom tqt_wm_take_focus; extern Atom qt_qt_scrolldone; @@ -645,7 +645,7 @@ bool TQEventLoop::hasPendingEvents() const TQMutexLocker locker( TQApplication::tqt_mutex ); #endif // TQT_THREAD_SUPPORT - extern uint qGlobalPostedEventsCount(); // from qapplication.cpp + extern uint qGlobalPostedEventsCount(); // from tqapplication.cpp return ( qGlobalPostedEventsCount() || ( (tqt_is_gui_used && TQApplication::isGuiThread()) ? XPending( TQPaintDevice::x11AppDisplay() ) : 0)); } diff --git a/src/kernel/tqfont.cpp b/src/kernel/tqfont.cpp index e058e49d4..c8395d342 100644 --- a/src/kernel/tqfont.cpp +++ b/src/kernel/tqfont.cpp @@ -48,7 +48,7 @@ #include "tqdict.h" #include "tqcache.h" #include "tqdatastream.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcleanuphandler.h" #include "tqstringlist.h" #ifdef TQ_WS_MAC diff --git a/src/kernel/tqfont_x11.cpp b/src/kernel/tqfont_x11.cpp index 373a82a5f..77742a5f0 100644 --- a/src/kernel/tqfont_x11.cpp +++ b/src/kernel/tqfont_x11.cpp @@ -45,7 +45,7 @@ #include "qplatformdefs.h" #include "tqfont.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcleanuphandler.h" #include "tqfontinfo.h" #include "tqfontdatabase.h" diff --git a/src/kernel/tqfontdatabase.cpp b/src/kernel/tqfontdatabase.cpp index 0702bb67f..5413f2db4 100644 --- a/src/kernel/tqfontdatabase.cpp +++ b/src/kernel/tqfontdatabase.cpp @@ -43,7 +43,7 @@ #ifndef TQT_NO_FONTDATABASE #include -#include +#include #include #include "tqfontengine_p.h" @@ -1330,7 +1330,7 @@ TQString TQFontDatabase::styleString( const TQFont &f ) Example: \code -#include +#include #include #include diff --git a/src/kernel/tqiconset.cpp b/src/kernel/tqiconset.cpp index 2a251c2ff..22e8a8f1d 100644 --- a/src/kernel/tqiconset.cpp +++ b/src/kernel/tqiconset.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_ICONSET -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitmap.h" #include "tqcleanuphandler.h" #include "tqimage.h" diff --git a/src/kernel/tqimage.cpp b/src/kernel/tqimage.cpp index 50ed52222..177c0a6af 100644 --- a/src/kernel/tqimage.cpp +++ b/src/kernel/tqimage.cpp @@ -53,7 +53,7 @@ #include #include "tqimageformatinterface_p.h" #include "tqwmatrix.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqmime.h" #include "tqdragobject.h" #include diff --git a/src/kernel/tqinputcontext.cpp b/src/kernel/tqinputcontext.cpp index 7d15aa0c7..7f0d5501d 100644 --- a/src/kernel/tqinputcontext.cpp +++ b/src/kernel/tqinputcontext.cpp @@ -41,7 +41,7 @@ #include "qplatformdefs.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidget.h" #include "tqpopupmenu.h" diff --git a/src/kernel/tqinputcontext_x11.cpp b/src/kernel/tqinputcontext_x11.cpp index 7377b264c..70fa9f160 100644 --- a/src/kernel/tqinputcontext_x11.cpp +++ b/src/kernel/tqinputcontext_x11.cpp @@ -42,7 +42,7 @@ #include "qplatformdefs.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidget.h" #include "tqt_x11_p.h" diff --git a/src/kernel/tqlayout.cpp b/src/kernel/tqlayout.cpp index bfab60480..814f1565b 100644 --- a/src/kernel/tqlayout.cpp +++ b/src/kernel/tqlayout.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_LAYOUT -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidget.h" #include "tqptrlist.h" #include "tqsizepolicy.h" diff --git a/src/kernel/tqlocalfs.cpp b/src/kernel/tqlocalfs.cpp index 5adc77fb2..69e2eba72 100644 --- a/src/kernel/tqlocalfs.cpp +++ b/src/kernel/tqlocalfs.cpp @@ -45,7 +45,7 @@ #include "tqfileinfo.h" #include "tqfile.h" #include "tqurlinfo.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqurloperator.h" #include "tqguardedptr.h" diff --git a/src/kernel/tqmime.cpp b/src/kernel/tqmime.cpp index d230d88d8..ba12e4c8e 100644 --- a/src/kernel/tqmime.cpp +++ b/src/kernel/tqmime.cpp @@ -46,7 +46,7 @@ #include "tqdir.h" #include "tqdragobject.h" #include "tqcleanuphandler.h" -#include "ntqapplication.h" // ### for now +#include "tqapplication.h" // ### for now #include "tqclipboard.h" // ### for now /*! diff --git a/src/kernel/tqmotifdnd_x11.cpp b/src/kernel/tqmotifdnd_x11.cpp index cf5867aeb..e1481446f 100644 --- a/src/kernel/tqmotifdnd_x11.cpp +++ b/src/kernel/tqmotifdnd_x11.cpp @@ -68,7 +68,7 @@ in doc/dnd.doc, where the documentation system can see it. */ #include "qplatformdefs.h" -#include "ntqapplication.h" +#include "tqapplication.h" #ifndef TQT_NO_DRAGANDDROP diff --git a/src/kernel/tqnamespace.h b/src/kernel/tqnamespace.h index f5ec7dd1d..4ff686c1c 100644 --- a/src/kernel/tqnamespace.h +++ b/src/kernel/tqnamespace.h @@ -814,7 +814,7 @@ public: CustomPattern=24 }; - // documented in qapplication_mac.cpp + // documented in tqapplication_mac.cpp enum MacintoshVersion { //Unknown MV_Unknown = 0x0000, @@ -835,7 +835,7 @@ public: MV_TIGER = MV_10_DOT_4 }; - // documented in qapplication_win.cpp + // documented in tqapplication_win.cpp enum WindowsVersion { WV_32s = 0x0001, WV_95 = 0x0002, @@ -1005,7 +1005,7 @@ public: }; // "handle" type for system objects. Documented as \internal in - // qapplication.cpp + // tqapplication.cpp #if defined(TQ_WS_MAC) typedef void * HANDLE; #elif defined(TQ_WS_WIN) diff --git a/src/kernel/tqobject.cpp b/src/kernel/tqobject.cpp index 85c69f8ba..e37cf1481 100644 --- a/src/kernel/tqobject.cpp +++ b/src/kernel/tqobject.cpp @@ -39,7 +39,7 @@ **********************************************************************/ #include "tqvariant.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqobject.h" #include "tqobjectlist.h" #include "tqsignalslotimp.h" @@ -454,7 +454,7 @@ static TQCString qt_rmWS( const char *s ) } -// Event functions, implemented in qapplication_xxx.cpp +// Event functions, implemented in tqapplication_xxx.cpp int qStartTimer( int interval, TQObject *obj ); bool qKillTimer( int id ); diff --git a/src/kernel/tqpaintdevice_x11.cpp b/src/kernel/tqpaintdevice_x11.cpp index 37bdfa83e..efeaf78fa 100644 --- a/src/kernel/tqpaintdevice_x11.cpp +++ b/src/kernel/tqpaintdevice_x11.cpp @@ -43,7 +43,7 @@ #include "tqpainter.h" #include "tqwidget.h" #include "tqbitmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqt_x11_p.h" diff --git a/src/kernel/tqpainter.cpp b/src/kernel/tqpainter.cpp index b66f16d2b..452af0a57 100644 --- a/src/kernel/tqpainter.cpp +++ b/src/kernel/tqpainter.cpp @@ -47,7 +47,7 @@ #include "tqwidget.h" #include "tqimage.h" #include "tqpaintdevicemetrics.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqrichtext_p.h" #include "tqregexp.h" #include "tqcleanuphandler.h" diff --git a/src/kernel/tqpixmap.cpp b/src/kernel/tqpixmap.cpp index 4a40d821b..c3eceba6b 100644 --- a/src/kernel/tqpixmap.cpp +++ b/src/kernel/tqpixmap.cpp @@ -47,7 +47,7 @@ #include "tqdatastream.h" #include "tqbuffer.h" #include "tqobjectlist.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include #include "tqmime.h" #include "tqdragobject.h" diff --git a/src/kernel/tqpixmap_x11.cpp b/src/kernel/tqpixmap_x11.cpp index 9f8c6b7d1..36c050005 100644 --- a/src/kernel/tqpixmap_x11.cpp +++ b/src/kernel/tqpixmap_x11.cpp @@ -71,7 +71,7 @@ #include "tqpaintdevicemetrics.h" #include "tqimage.h" #include "tqwmatrix.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqt_x11_p.h" #include @@ -371,7 +371,7 @@ static void build_scale_table( uint **table, uint nBits ) static int defaultScreen = -1; -extern bool tqt_use_xrender; // defined in qapplication_x11.cpp +extern bool tqt_use_xrender; // defined in tqapplication_x11.cpp extern bool tqt_has_xft; // defined in tqfont_x11.cpp #ifndef TQT_NO_XFTFREETYPE @@ -2421,7 +2421,7 @@ TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, #ifndef TQT_NO_XFTFREETYPE // copy alpha data - extern bool tqt_use_xrender; // from qapplication_x11.cpp + extern bool tqt_use_xrender; // from tqapplication_x11.cpp if ( ! tqt_use_xrender || ! src->data->alphapm ) return; diff --git a/src/kernel/tqprinter_unix.cpp b/src/kernel/tqprinter_unix.cpp index 2899d86df..e53dc5ff6 100644 --- a/src/kernel/tqprinter_unix.cpp +++ b/src/kernel/tqprinter_unix.cpp @@ -54,7 +54,7 @@ static inline int qt_open(const char *pathname, int flags, mode_t mode) #include "tqpaintdevicemetrics.h" #include "tqpsprinter_p.h" #include "tqprintdialog.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqprinter_p.h" #include // For ::sleep() diff --git a/src/kernel/tqprocess.cpp b/src/kernel/tqprocess.cpp index bfca757a8..b43c12b4a 100644 --- a/src/kernel/tqprocess.cpp +++ b/src/kernel/tqprocess.cpp @@ -45,7 +45,7 @@ #ifndef TQT_NO_PROCESS -#include "ntqapplication.h" +#include "tqapplication.h" #include "private/tqinternal_p.h" diff --git a/src/kernel/tqprocess_unix.cpp b/src/kernel/tqprocess_unix.cpp index b9a79afda..606d1fd28 100644 --- a/src/kernel/tqprocess_unix.cpp +++ b/src/kernel/tqprocess_unix.cpp @@ -49,7 +49,7 @@ #ifndef TQT_NO_PROCESS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqptrqueue.h" #include "tqptrlist.h" #include "tqsocketnotifier.h" diff --git a/src/kernel/tqpsprinter.cpp b/src/kernel/tqpsprinter.cpp index 80e00ae23..bc283807c 100644 --- a/src/kernel/tqpsprinter.cpp +++ b/src/kernel/tqpsprinter.cpp @@ -57,7 +57,7 @@ #undef Q_PRINTER_USE_TYPE42 #include "tqpainter.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpaintdevicemetrics.h" #include "tqimage.h" #include "tqdatetime.h" diff --git a/src/kernel/tqrichtext.cpp b/src/kernel/tqrichtext.cpp index 9866a6c9c..57b091721 100644 --- a/src/kernel/tqrichtext.cpp +++ b/src/kernel/tqrichtext.cpp @@ -47,7 +47,7 @@ #include "tqfont.h" #include "tqtextstream.h" #include "tqfile.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqmap.h" #include "tqfileinfo.h" #include "tqstylesheet.h" diff --git a/src/kernel/tqrichtext_p.h b/src/kernel/tqrichtext_p.h index 1032c74eb..11dfcc6d1 100644 --- a/src/kernel/tqrichtext_p.h +++ b/src/kernel/tqrichtext_p.h @@ -74,7 +74,7 @@ #include "tqpainter.h" #include "tqlayout.h" #include "tqobject.h" -#include "ntqapplication.h" +#include "tqapplication.h" #endif // QT_H #ifndef TQT_NO_RICHTEXT diff --git a/src/kernel/tqsimplerichtext.cpp b/src/kernel/tqsimplerichtext.cpp index 4c98f1fd3..c2808b1cd 100644 --- a/src/kernel/tqsimplerichtext.cpp +++ b/src/kernel/tqsimplerichtext.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_RICHTEXT #include "tqrichtext_p.h" -#include "ntqapplication.h" +#include "tqapplication.h" class TQSimpleRichTextData { diff --git a/src/kernel/tqsizegrip.cpp b/src/kernel/tqsizegrip.cpp index 017c3e6a0..65b29a1c9 100644 --- a/src/kernel/tqsizegrip.cpp +++ b/src/kernel/tqsizegrip.cpp @@ -43,12 +43,12 @@ #ifndef TQT_NO_SIZEGRIP #include "tqpainter.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #if defined(TQ_WS_X11) #include "tqt_x11_p.h" -extern Atom qt_sizegrip; // defined in qapplication_x11.cpp +extern Atom qt_sizegrip; // defined in tqapplication_x11.cpp #elif defined (TQ_WS_WIN ) #include "tqobjectlist.h" #include "qt_windows.h" diff --git a/src/kernel/tqsocketnotifier.cpp b/src/kernel/tqsocketnotifier.cpp index b350403a5..3a3d32a07 100644 --- a/src/kernel/tqsocketnotifier.cpp +++ b/src/kernel/tqsocketnotifier.cpp @@ -39,7 +39,7 @@ **********************************************************************/ #include "tqsocketnotifier.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqevent.h" #include "tqeventloop.h" #include "qplatformdefs.h" diff --git a/src/kernel/tqsound_x11.cpp b/src/kernel/tqsound_x11.cpp index bbdbf5b44..dba19b144 100644 --- a/src/kernel/tqsound_x11.cpp +++ b/src/kernel/tqsound_x11.cpp @@ -44,7 +44,7 @@ #include "tqptrdict.h" #include "tqsocketnotifier.h" -#include "ntqapplication.h" +#include "tqapplication.h" #ifdef QT_NAS_SUPPORT diff --git a/src/kernel/tqstyle.cpp b/src/kernel/tqstyle.cpp index dfa1c2cbe..27a4ce33c 100644 --- a/src/kernel/tqstyle.cpp +++ b/src/kernel/tqstyle.cpp @@ -40,7 +40,7 @@ #include "tqstyle.h" #ifndef TQT_NO_STYLE -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqbitmap.h" #include "tqpixmapcache.h" diff --git a/src/kernel/tqt3.h b/src/kernel/tqt3.h index cff4b0895..9300c254e 100644 --- a/src/kernel/tqt3.h +++ b/src/kernel/tqt3.h @@ -258,7 +258,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/kernel/tqtextlayout.cpp b/src/kernel/tqtextlayout.cpp index 3e71ccd39..0d50e4106 100644 --- a/src/kernel/tqtextlayout.cpp +++ b/src/kernel/tqtextlayout.cpp @@ -40,7 +40,7 @@ #include "tqtextengine_p.h" #include -#include +#include #include diff --git a/src/kernel/tqthread.cpp b/src/kernel/tqthread.cpp index 560577589..9a1d1f602 100644 --- a/src/kernel/tqthread.cpp +++ b/src/kernel/tqthread.cpp @@ -45,7 +45,7 @@ #include #ifndef QT_H -# include "ntqapplication.h" +# include "tqapplication.h" #endif // QT_H diff --git a/src/kernel/tqthread_unix.cpp b/src/kernel/tqthread_unix.cpp index db780ee18..714b35c31 100644 --- a/src/kernel/tqthread_unix.cpp +++ b/src/kernel/tqthread_unix.cpp @@ -47,7 +47,7 @@ typedef pthread_mutex_t Q_MUTEX_T; #include #include #include -#include +#include #include #include diff --git a/src/kernel/tqtimer.cpp b/src/kernel/tqtimer.cpp index 3d19923e8..84803f1b5 100644 --- a/src/kernel/tqtimer.cpp +++ b/src/kernel/tqtimer.cpp @@ -302,7 +302,7 @@ bool TQSingleShotTimer::event( TQEvent * ) Example: \code - #include + #include #include int main( int argc, char **argv ) diff --git a/src/kernel/tqtranslator.cpp b/src/kernel/tqtranslator.cpp index fd86a73ca..b6a11feb3 100644 --- a/src/kernel/tqtranslator.cpp +++ b/src/kernel/tqtranslator.cpp @@ -60,7 +60,7 @@ static inline int qt_open(const char *pathname, int flags, mode_t mode) #include "tqwidgetlist.h" #include "tqintdict.h" #include "tqstring.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqfile.h" #include "tqbuffer.h" #include "tqdatastream.h" diff --git a/src/kernel/tqurl.cpp b/src/kernel/tqurl.cpp index 1155e9fa1..7d0066f0c 100644 --- a/src/kernel/tqurl.cpp +++ b/src/kernel/tqurl.cpp @@ -1010,7 +1010,7 @@ void TQUrl::setEncodedPathAndQuery( const TQString& pathAndQuery ) d->cleanPathDirty = TRUE; } -extern bool tqt_resolve_symlinks; // defined in qapplication.cpp +extern bool tqt_resolve_symlinks; // defined in tqapplication.cpp /*! Returns the path of the URL. If \a correct is TRUE, the path is diff --git a/src/kernel/tqwidget.cpp b/src/kernel/tqwidget.cpp index 33c4768a6..71fe8ea16 100644 --- a/src/kernel/tqwidget.cpp +++ b/src/kernel/tqwidget.cpp @@ -47,8 +47,8 @@ #include "tqfocusdata.h" #include "tqcursor.h" #include "tqpixmap.h" -#include "ntqapplication.h" -#include "qapplication_p.h" +#include "tqapplication.h" +#include "tqapplication_p.h" #include "tqbrush.h" #include "tqlayout.h" #include "tqstylefactory.h" diff --git a/src/kernel/tqwidget_p.h b/src/kernel/tqwidget_p.h index 0c0eb9460..6815665c2 100644 --- a/src/kernel/tqwidget_p.h +++ b/src/kernel/tqwidget_p.h @@ -47,7 +47,7 @@ // ------------- // // This file is not part of the TQt API. It exists for the convenience -// of qapplication_*.cpp, tqwidget*.cpp and tqfiledialog.cpp. This header +// of tqapplication_*.cpp, tqwidget*.cpp and tqfiledialog.cpp. This header // file may change from version to version without notice, or even be removed. // // We mean it. diff --git a/src/kernel/tqwidget_x11.cpp b/src/kernel/tqwidget_x11.cpp index 2f90c4905..c8492c6e6 100644 --- a/src/kernel/tqwidget_x11.cpp +++ b/src/kernel/tqwidget_x11.cpp @@ -38,8 +38,8 @@ ** **********************************************************************/ -#include "ntqapplication.h" -#include "qapplication_p.h" +#include "tqapplication.h" +#include "tqapplication_p.h" #include "tqnamespace.h" #include "tqpaintdevicemetrics.h" #include "tqpainter.h" @@ -55,11 +55,11 @@ // NOT REVISED -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern Window qt_x11_wm_client_leader; extern void qt_x11_create_wm_client_leader(); -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp void qt_insert_sip( TQWidget*, int, int ); int qt_sip_count( TQWidget* ); bool qt_wstate_iconified( WId ); @@ -77,7 +77,7 @@ extern void qt_clear_paintevent_clipping(); extern bool qt_dnd_enable( TQWidget* w, bool on ); extern bool qt_nograb(); -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern void qt_deferred_map_add( TQWidget* ); extern void qt_deferred_map_take( TQWidget* ); extern bool qt_deferred_map_contains(TQWidget *); @@ -85,7 +85,7 @@ extern bool qt_deferred_map_contains(TQWidget *); static TQWidget *mouseGrb = 0; static TQWidget *keyboardGrb = 0; -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern Time tqt_x_time; extern Time tqt_x_user_time; @@ -104,7 +104,7 @@ int qt_x11_create_desktop_on_screen = -1; TQWidget member functions *****************************************************************************/ -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern Atom tqt_wm_state; extern Atom qt_wm_change_state; extern Atom tqt_wm_delete_window; @@ -157,7 +157,7 @@ extern Atom qt_enlightenment_desktop; extern Atom qt_net_virtual_roots; extern bool qt_broken_wm; -// defined in qapplication_x11.cpp +// defined in tqapplication_x11.cpp extern bool qt_net_supports(Atom); extern unsigned long *qt_net_virtual_root_list; @@ -835,7 +835,7 @@ void TQWidget::destroy( bool destroyWindow, bool destroySubWindows ) #endif setWinId( 0 ); - extern void qPRCleanup( TQWidget *widget ); // from qapplication_x11.cpp + extern void qPRCleanup( TQWidget *widget ); // from tqapplication_x11.cpp if ( testWState(WState_Reparented) ) qPRCleanup(this); @@ -2228,7 +2228,7 @@ void TQWidget::internalSetGeometry( int x, int y, int w, int h, bool isMove ) } if ( isResize ) { - // set config pending only on resize, see qapplication_x11.cpp, translateConfigEvent() + // set config pending only on resize, see tqapplication_x11.cpp, translateConfigEvent() setWState( WState_ConfigPending ); TQResizeEvent e( size(), oldSize ); diff --git a/src/network/tqdns.cpp b/src/network/tqdns.cpp index 8bc081bb5..fa248533c 100644 --- a/src/network/tqdns.cpp +++ b/src/network/tqdns.cpp @@ -69,7 +69,7 @@ #include "tqptrlist.h" #include "tqstring.h" #include "tqtimer.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqptrvector.h" #include "tqstrlist.h" #include "tqptrdict.h" diff --git a/src/opengl/tqgl_x11.cpp b/src/opengl/tqgl_x11.cpp index cf82fe355..72870e83d 100644 --- a/src/opengl/tqgl_x11.cpp +++ b/src/opengl/tqgl_x11.cpp @@ -44,7 +44,7 @@ #include "tqmap.h" #include "tqpixmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqintdict.h" #include "private/tqfontengine_p.h" diff --git a/src/opengl/tqglcolormap.cpp b/src/opengl/tqglcolormap.cpp index a9f176b96..5f1c580f1 100644 --- a/src/opengl/tqglcolormap.cpp +++ b/src/opengl/tqglcolormap.cpp @@ -73,7 +73,7 @@ Example of use: \code - #include + #include #include int main() diff --git a/src/qt.pro b/src/qt.pro index 17de6ea1b..c74e4f2ef 100644 --- a/src/qt.pro +++ b/src/qt.pro @@ -149,9 +149,9 @@ include($$TOOLS_CPP/qt_tools.pri) include($$CODECS_CPP/tqt_codecs.pri) include($$STYLES_CPP/qt_styles.pri) -# qconfig.cpp -exists($$QT_BUILD_TREE/src/tools/qconfig.cpp) { - SOURCES += $$QT_BUILD_TREE/src/tools/qconfig.cpp +# tqconfig.cpp +exists($$QT_BUILD_TREE/src/tools/tqconfig.cpp) { + SOURCES += $$QT_BUILD_TREE/src/tools/tqconfig.cpp } #install directives diff --git a/src/qt_install.pri b/src/qt_install.pri index 6ef9ec193..a0051046b 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/ntqconfig.h \ - $$QT_BUILD_TREE/include/ntqmodules.h +headers.files += $$QT_BUILD_TREE/include/tqconfig.h \ + $$QT_BUILD_TREE/include/tqmodules.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/odbc/tqsql_odbc.cpp b/src/sql/drivers/odbc/tqsql_odbc.cpp index 82dd6247d..3da2dd50c 100644 --- a/src/sql/drivers/odbc/tqsql_odbc.cpp +++ b/src/sql/drivers/odbc/tqsql_odbc.cpp @@ -43,7 +43,7 @@ #if defined (Q_OS_WIN32) #include -#include +#include #endif #include #include diff --git a/src/sql/tqdatatable.cpp b/src/sql/tqdatatable.cpp index 1e8826d3c..ac4c11267 100644 --- a/src/sql/tqdatatable.cpp +++ b/src/sql/tqdatatable.cpp @@ -45,7 +45,7 @@ #include "tqsqldriver.h" #include "tqsqleditorfactory.h" #include "tqsqlpropertymap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqlayout.h" #include "tqpainter.h" #include "tqpopupmenu.h" diff --git a/src/sql/tqsqldatabase.cpp b/src/sql/tqsqldatabase.cpp index ccdaea94d..f818a8f62 100644 --- a/src/sql/tqsqldatabase.cpp +++ b/src/sql/tqsqldatabase.cpp @@ -75,7 +75,7 @@ #include "drivers/ibase/tqsql_ibase.h" #endif -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqsqlresult.h" #include "tqsqldriver.h" #include "tqsqldriverinterface_p.h" diff --git a/src/sql/tqsqlmanager_p.cpp b/src/sql/tqsqlmanager_p.cpp index 754d572a9..64345bde2 100644 --- a/src/sql/tqsqlmanager_p.cpp +++ b/src/sql/tqsqlmanager_p.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_SQL -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidget.h" #include "tqsqlcursor.h" #include "tqsqlform.h" diff --git a/src/styles/tqcommonstyle.cpp b/src/styles/tqcommonstyle.cpp index 02b878c38..a18604f48 100644 --- a/src/styles/tqcommonstyle.cpp +++ b/src/styles/tqcommonstyle.cpp @@ -44,7 +44,7 @@ #include "tqmutex.h" #include "tqmenubar.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqdrawutil.h" #include "tqpixmap.h" diff --git a/src/styles/tqinterlacestyle.cpp b/src/styles/tqinterlacestyle.cpp index 3c86f0638..a0cd70c58 100644 --- a/src/styles/tqinterlacestyle.cpp +++ b/src/styles/tqinterlacestyle.cpp @@ -44,7 +44,7 @@ #if !defined(TQT_NO_STYLE_INTERLACE) || defined(QT_PLUGIN) -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqdrawutil.h" // for now #include "tqpalette.h" // for now diff --git a/src/styles/tqmotifplusstyle.cpp b/src/styles/tqmotifplusstyle.cpp index 2d65a7c4f..6c9075495 100644 --- a/src/styles/tqmotifplusstyle.cpp +++ b/src/styles/tqmotifplusstyle.cpp @@ -43,7 +43,7 @@ #if !defined(TQT_NO_STYLE_MOTIFPLUS) || defined(QT_PLUGIN) #include "tqmenubar.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqpalette.h" #include "tqframe.h" diff --git a/src/styles/tqmotifstyle.cpp b/src/styles/tqmotifstyle.cpp index d2248e83f..5e71d6813 100644 --- a/src/styles/tqmotifstyle.cpp +++ b/src/styles/tqmotifstyle.cpp @@ -43,7 +43,7 @@ #if !defined(TQT_NO_STYLE_MOTIF) || defined(QT_PLUGIN) #include "tqpopupmenu.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqdrawutil.h" #include "tqpixmap.h" diff --git a/src/styles/tqplatinumstyle.cpp b/src/styles/tqplatinumstyle.cpp index 2a2ad20fb..4050f075e 100644 --- a/src/styles/tqplatinumstyle.cpp +++ b/src/styles/tqplatinumstyle.cpp @@ -42,7 +42,7 @@ #if !defined(TQT_NO_STYLE_PLATINUM) || defined(QT_PLUGIN) -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcombobox.h" #include "tqdrawutil.h" #include "tqpainter.h" diff --git a/src/styles/tqsgistyle.cpp b/src/styles/tqsgistyle.cpp index c02b64d20..3574dc0d0 100644 --- a/src/styles/tqsgistyle.cpp +++ b/src/styles/tqsgistyle.cpp @@ -43,7 +43,7 @@ #if !defined(TQT_NO_STYLE_SGI) || defined(QT_PLUGIN) #include "tqpopupmenu.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbutton.h" #include "tqpainter.h" #include "tqdrawutil.h" diff --git a/src/styles/tqstylefactory.cpp b/src/styles/tqstylefactory.cpp index d66fbe72d..05418b275 100644 --- a/src/styles/tqstylefactory.cpp +++ b/src/styles/tqstylefactory.cpp @@ -43,7 +43,7 @@ #ifndef TQT_NO_STYLE -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwindowsstyle.h" #include "tqmotifstyle.h" #include "tqcdestyle.h" diff --git a/src/styles/tqwindowsstyle.cpp b/src/styles/tqwindowsstyle.cpp index 03fc62dd5..02bd43720 100644 --- a/src/styles/tqwindowsstyle.cpp +++ b/src/styles/tqwindowsstyle.cpp @@ -43,7 +43,7 @@ #if !defined(TQT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) #include "tqpopupmenu.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqdrawutil.h" // for now #include "tqpixmap.h" // for now diff --git a/src/table/tqtable.cpp b/src/table/tqtable.cpp index d2270ab80..2bffd774c 100644 --- a/src/table/tqtable.cpp +++ b/src/table/tqtable.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/tools/qconfig-dist.h b/src/tools/qconfig-dist.h deleted file mode 100644 index d6075aa4d..000000000 --- a/src/tools/qconfig-dist.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef QT_H -#endif /* QT_H */ - -/* - Empty leaves all features enabled. See doc/html/features.html for choices. - - Note that disabling some features will produce a libtqt that is not - compatible with other libtqt 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. -*/ diff --git a/src/tools/qconfig-large.h b/src/tools/qconfig-large.h deleted file mode 100644 index d2f8321ce..000000000 --- a/src/tools/qconfig-large.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef QT_H -#endif /* QT_H */ -#ifndef TQT_NO_CODECS -#define TQT_NO_CODECS -#endif -#define TQT_NO_UNICODETABLES -#define TQT_NO_IMAGEIO_BMP -#define TQT_NO_IMAGEIO_PPM -#define TQT_NO_ASYNC_IO -#define TQT_NO_ASYNC_IMAGE_IO -//#define TQT_NO_FONTDATABASE -#define TQT_NO_TRANSLATION -#define TQT_NO_DRAGANDDROP -#define TQT_NO_CLIPBOARD -#define TQT_NO_SOUND -#define TQT_NO_PROPERTIES -#define TQT_NO_DNS -#define TQT_NO_NETWORKPROTOCOL -#define TQT_NO_URL -#define TQT_NO_COLORNAMES -#define TQT_NO_TRANSFORMATIONS -#define TQT_NO_PRINTER -#define TQT_NO_PICTURE -#define TQT_NO_ICONVIEW -#define TQT_NO_DIAL -#define TQT_NO_WORKSPACE -#define TQT_NO_TABLE -#define TQT_NO_ACTION -#define TQT_NO_STYLE_MOTIF -#define TQT_NO_STYLE_PLATINUM -/* #define TQT_NO_FILEDIALOG */ -#define TQT_NO_FONTDIALOG -#define TQT_NO_PRINTDIALOG -/* #define TQT_NO_COLORDIALOG */ -#define TQT_NO_INPUTDIALOG -/* #define TQT_NO_MESSAGEBOX */ -#define TQT_NO_PROGRESSDIALOG -/* #define TQT_NO_TABDIALOG */ -#define TQT_NO_WIZARD -#define TQT_NO_EFFECTS diff --git a/src/tools/qconfig-medium.h b/src/tools/qconfig-medium.h deleted file mode 100644 index 93bc436e6..000000000 --- a/src/tools/qconfig-medium.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef QT_H -#endif /* QT_H */ -#ifndef TQT_NO_TEXTCODEC /* moc? */ -#define TQT_NO_TEXTCODEC -#endif -#define TQT_NO_UNICODETABLES -#define TQT_NO_IMAGEIO_BMP -#define TQT_NO_IMAGEIO_PPM -/* #define TQT_NO_IMAGEIO_PNG */ -#define TQT_NO_ASYNC_IO -#define TQT_NO_ASYNC_IMAGE_IO -//#define TQT_NO_FONTDATABASE -#define TQT_NO_TRANSLATION -#define TQT_NO_DRAGANDDROP -#define TQT_NO_CLIPBOARD -#define TQT_NO_SOUND -#define TQT_NO_PROPERTIES -#define TQT_NO_DNS -#define TQT_NO_NETWORKPROTOCOL -#define TQT_NO_COLORNAMES -#define TQT_NO_TRANSFORMATIONS -#define TQT_NO_PRINTER -#define TQT_NO_PICTURE -#define TQT_NO_ICONVIEW -#define TQT_NO_DIAL -#define TQT_NO_WORKSPACE -#define TQT_NO_TABLE -#define TQT_NO_ACTION -#define TQT_NO_STYLE_MOTIF -#define TQT_NO_STYLE_PLATINUM -/* #define TQT_NO_FILEDIALOG */ -#define TQT_NO_FONTDIALOG -#define TQT_NO_PRINTDIALOG -/* #define TQT_NO_COLORDIALOG */ -#define TQT_NO_INPUTDIALOG -/* #define TQT_NO_MESSAGEBOX */ -#define TQT_NO_PROGRESSDIALOG -/* #define TQT_NO_TABDIALOG */ -#define TQT_NO_WIZARD -#define TQT_NO_EFFECTS - - -#define TQT_NO_MIME -/* #define TQT_NO_NETWORK //??? means single-process only */ - - -#define TQT_NO_IMAGE_TRUECOLOR -/* #define TQT_NO_IMAGE_SMOOTHSCALE //needed for iconset --> pushbutton */ -#define TQT_NO_IMAGE_TEXT -#define TQT_NO_DIR - -/* #define TQT_NO_TEXTSTREAM */ -#define TQT_NO_DATASTREAM - -#define TQT_NO_SESSIONMANAGER - - -/* #define TQT_NO_DIALOG */ - -#define TQT_NO_EFFECTS - -/* #define TQT_NO_RANGECONTROL */ -/* #define TQT_NO_SPLITTER */ -#define TQT_NO_STATUSBAR -#define TQT_NO_TABBAR -#define TQT_NO_TOOLBAR -#define TQT_NO_TOOLTIP -/* #define TQT_NO_VALIDATOR */ -#define TQT_NO_WHATSTHIS -#define TQT_NO_WIDGETSTACK -#define TQT_NO_ACCEL -#define TQT_NO_SIZEGRIP -#define TQT_NO_HEADER -#define TQT_NO_WORKSPACE -#define TQT_NO_LCDNUMBER -#define TQT_NO_STYLE_MOTIF -#define TQT_NO_STYLE_PLATINUM -#define TQT_NO_PROGRESSBAR - -#define TQT_NO_ICONVIEW -#define TQT_NO_DIAL - -#define TQT_NO_TABLE - -/* #define TQT_NO_FILEDIALOG */ -#define TQT_NO_FONTDIALOG -#define TQT_NO_PRINTDIALOG -#define TQT_NO_COLORDIALOG -#define TQT_NO_INPUTDIALOG -/* #define TQT_NO_MESSAGEBOX */ -#define TQT_NO_PROGRESSDIALOG -/* #define TQT_NO_TABDIALOG */ -#define TQT_NO_WIZARD -#define TQT_NO_EFFECTS - diff --git a/src/tools/qconfig-minimal.h b/src/tools/qconfig-minimal.h deleted file mode 100644 index 2d98d14ea..000000000 --- a/src/tools/qconfig-minimal.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef QT_H -#endif /* QT_H */ - -#ifndef TQT_NO_CHECK -# define TQT_NO_CHECK -#endif -#define TQT_NO_PROCESS -#define TQT_NO_PALETTE -#define TQT_NO_ACTION -#ifndef TQT_NO_TEXTCODEC /* moc? */ -#define TQT_NO_TEXTCODEC -#endif -#define TQT_NO_UNICODETABLES -#define TQT_NO_IMAGEIO_BMP -#define TQT_NO_IMAGEIO_PPM -#define TQT_NO_IMAGEIO_XBM -#define TQT_NO_IMAGEIO_XPM -/* #define TQT_NO_IMAGEIO_PNG //done by configure -no-png */ -#define TQT_NO_ASYNC_IO -#define TQT_NO_ASYNC_IMAGE_IO -//#define TQT_NO_FONTDATABASE -#define TQT_NO_TRANSLATION -#define TQT_NO_MIME -#define TQT_NO_SOUND -/* #define TQT_NO_PROPERTIES */ -#define TQT_NO_CURSOR -#define TQT_NO_NETWORK -#define TQT_NO_COLORNAMES -#define TQT_NO_TRANSFORMATIONS -#define TQT_NO_PRINTER -#define TQT_NO_PICTURE -#define TQT_NO_LAYOUT -#define TQT_NO_DRAWUTIL -#define TQT_NO_IMAGE_TRUECOLOR -#define TQT_NO_IMAGE_SMOOTHSCALE -#define TQT_NO_IMAGE_TEXT -#define TQT_NO_DIR -#define TQT_NO_TEXTSTREAM -#define TQT_NO_DATASTREAM -//#define TQT_NO_STRINGLIST -#define TQT_NO_TEMPLATE_VARIANT -#define TQT_NO_SESSIONMANAGER -#define TQT_NO_SYNTAXHIGHLIGHTER - -#define TQT_NO_ACCEL -#define TQT_NO_BUTTON -#define TQT_NO_DIALOG -#define TQT_NO_FRAME - -#define TQT_NO_STYLE -#define TQT_NO_EFFECTS - -#define TQT_NO_SQL - -#define TQT_NO_REGEXP_CAPTURE -#define TQT_NO_REGEXP_WILDCARD - -#define TQT_NO_VALIDATOR -#define TQT_NO_SPRINTF - -#define TQT_NO_REGEXP - -#define TQT_NO_IMAGEIO - -/* #define TQT_NO_VARIANT //needed for signals/slots */ - -#define TQT_NO_RANGECONTROL -#define TQT_NO_QUUID_STRING -#define TQT_NO_SIGNALMAPPER - -#define TQT_NO_WHEELEVENT -#define TQT_NO_BEZIER - -#define TQT_NO_IMAGE_DITHER_TO_1 -#define TQT_NO_IMAGE_HEURISTIC_MASK -#define TQT_NO_IMAGE_MIRROR - -#ifndef TQT_NO_STL -# define TQT_NO_STL -#endif - -#define TQT_NO_DATESTRING -#define TQT_NO_WMATRIX diff --git a/src/tools/qconfig-small.h b/src/tools/qconfig-small.h deleted file mode 100644 index d7d08b795..000000000 --- a/src/tools/qconfig-small.h +++ /dev/null @@ -1,76 +0,0 @@ -#define NO_CHECK -#ifndef QT_H -#endif /* QT_H */ - -#define TQT_NO_ACTION -#ifndef TQT_NO_TEXTCODEC /* moc? */ -#define TQT_NO_TEXTCODEC -#endif -#define TQT_NO_UNICODETABLES -#define TQT_NO_IMAGEIO_BMP -#define TQT_NO_IMAGEIO_PPM -#define TQT_NO_IMAGEIO_XBM -#define TQT_NO_IMAGEIO_XPM -/* #define TQT_NO_IMAGEIO_PNG //done by configure -no-png */ -#define TQT_NO_ASYNC_IO -#define TQT_NO_ASYNC_IMAGE_IO -//#define TQT_NO_FONTDATABASE -#define TQT_NO_TRANSLATION -#define TQT_NO_MIME -#define TQT_NO_SOUND -#define TQT_NO_PROPERTIES -#define TQT_NO_SYNTAXHIGHLIGHTER - -#define TQT_NO_NETWORK /* ?????????????? */ -#define TQT_NO_COLORNAMES -#define TQT_NO_TRANSFORMATIONS -#define TQT_NO_PRINTER -#define TQT_NO_PICTURE - -#define TQT_NO_IMAGE_TRUECOLOR -/* #define TQT_NO_IMAGE_SMOOTHSCALE //needed for iconset --> pushbutton */ -#define TQT_NO_IMAGE_TEXT -#define TQT_NO_DIR - -#define TQT_NO_TEXTSTREAM -#define TQT_NO_DATASTREAM -//#define TQT_NO_STRINGLIST -#define TQT_NO_SESSIONMANAGER - - -#define TQT_NO_DIALOG - -/* #define TQT_NO_STYLE //will require substantial work... */ - -#define TQT_NO_EFFECTS - -#define TQT_NO_RANGECONTROL -#define TQT_NO_SPLITTER -#define TQT_NO_STATUSBAR -#define TQT_NO_TABBAR -#define TQT_NO_TOOLBAR -#define TQT_NO_TOOLTIP -#define TQT_NO_VALIDATOR -#define TQT_NO_WHATSTHIS -#define TQT_NO_WIDGETSTACK -#define TQT_NO_ACCEL -#define TQT_NO_SIZEGRIP -#define TQT_NO_HEADER -#define TQT_NO_WORKSPACE -#define TQT_NO_LCDNUMBER -#define TQT_NO_STYLE_MOTIF -#define TQT_NO_STYLE_PLATINUM -#define TQT_NO_PROGRESSBAR - - -/* other widgets that could be removed: */ -/* -#define TQT_NO_MENUDATA -*/ - - -/* possible options: */ -/* -#define TQT_NO_CURSOR -#define TQT_NO_LAYOUT -*/ diff --git a/src/tools/tqcomlibrary.cpp b/src/tools/tqcomlibrary.cpp index 5c2510130..a387c9611 100644 --- a/src/tools/tqcomlibrary.cpp +++ b/src/tools/tqcomlibrary.cpp @@ -39,7 +39,7 @@ #include "tqcomlibrary_p.h" #ifndef TQT_NO_COMPONENT -#include +#include #include #include #include diff --git a/src/tools/tqcomponentfactory.cpp b/src/tools/tqcomponentfactory.cpp index 3b05e94de..4d799b024 100644 --- a/src/tools/tqcomponentfactory.cpp +++ b/src/tools/tqcomponentfactory.cpp @@ -44,7 +44,7 @@ #include "tqsettings.h" #include #include "tqdir.h" -#include "ntqapplication.h" +#include "tqapplication.h" /*! \class TQComponentFactory tqcomponentfactory.h diff --git a/src/tools/tqconfig-dist.h b/src/tools/tqconfig-dist.h new file mode 100644 index 000000000..d6075aa4d --- /dev/null +++ b/src/tools/tqconfig-dist.h @@ -0,0 +1,11 @@ +#ifndef QT_H +#endif /* QT_H */ + +/* + Empty leaves all features enabled. See doc/html/features.html for choices. + + Note that disabling some features will produce a libtqt that is not + compatible with other libtqt 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. +*/ diff --git a/src/tools/tqconfig-large.h b/src/tools/tqconfig-large.h new file mode 100644 index 000000000..d2f8321ce --- /dev/null +++ b/src/tools/tqconfig-large.h @@ -0,0 +1,40 @@ +#ifndef QT_H +#endif /* QT_H */ +#ifndef TQT_NO_CODECS +#define TQT_NO_CODECS +#endif +#define TQT_NO_UNICODETABLES +#define TQT_NO_IMAGEIO_BMP +#define TQT_NO_IMAGEIO_PPM +#define TQT_NO_ASYNC_IO +#define TQT_NO_ASYNC_IMAGE_IO +//#define TQT_NO_FONTDATABASE +#define TQT_NO_TRANSLATION +#define TQT_NO_DRAGANDDROP +#define TQT_NO_CLIPBOARD +#define TQT_NO_SOUND +#define TQT_NO_PROPERTIES +#define TQT_NO_DNS +#define TQT_NO_NETWORKPROTOCOL +#define TQT_NO_URL +#define TQT_NO_COLORNAMES +#define TQT_NO_TRANSFORMATIONS +#define TQT_NO_PRINTER +#define TQT_NO_PICTURE +#define TQT_NO_ICONVIEW +#define TQT_NO_DIAL +#define TQT_NO_WORKSPACE +#define TQT_NO_TABLE +#define TQT_NO_ACTION +#define TQT_NO_STYLE_MOTIF +#define TQT_NO_STYLE_PLATINUM +/* #define TQT_NO_FILEDIALOG */ +#define TQT_NO_FONTDIALOG +#define TQT_NO_PRINTDIALOG +/* #define TQT_NO_COLORDIALOG */ +#define TQT_NO_INPUTDIALOG +/* #define TQT_NO_MESSAGEBOX */ +#define TQT_NO_PROGRESSDIALOG +/* #define TQT_NO_TABDIALOG */ +#define TQT_NO_WIZARD +#define TQT_NO_EFFECTS diff --git a/src/tools/tqconfig-medium.h b/src/tools/tqconfig-medium.h new file mode 100644 index 000000000..93bc436e6 --- /dev/null +++ b/src/tools/tqconfig-medium.h @@ -0,0 +1,95 @@ +#ifndef QT_H +#endif /* QT_H */ +#ifndef TQT_NO_TEXTCODEC /* moc? */ +#define TQT_NO_TEXTCODEC +#endif +#define TQT_NO_UNICODETABLES +#define TQT_NO_IMAGEIO_BMP +#define TQT_NO_IMAGEIO_PPM +/* #define TQT_NO_IMAGEIO_PNG */ +#define TQT_NO_ASYNC_IO +#define TQT_NO_ASYNC_IMAGE_IO +//#define TQT_NO_FONTDATABASE +#define TQT_NO_TRANSLATION +#define TQT_NO_DRAGANDDROP +#define TQT_NO_CLIPBOARD +#define TQT_NO_SOUND +#define TQT_NO_PROPERTIES +#define TQT_NO_DNS +#define TQT_NO_NETWORKPROTOCOL +#define TQT_NO_COLORNAMES +#define TQT_NO_TRANSFORMATIONS +#define TQT_NO_PRINTER +#define TQT_NO_PICTURE +#define TQT_NO_ICONVIEW +#define TQT_NO_DIAL +#define TQT_NO_WORKSPACE +#define TQT_NO_TABLE +#define TQT_NO_ACTION +#define TQT_NO_STYLE_MOTIF +#define TQT_NO_STYLE_PLATINUM +/* #define TQT_NO_FILEDIALOG */ +#define TQT_NO_FONTDIALOG +#define TQT_NO_PRINTDIALOG +/* #define TQT_NO_COLORDIALOG */ +#define TQT_NO_INPUTDIALOG +/* #define TQT_NO_MESSAGEBOX */ +#define TQT_NO_PROGRESSDIALOG +/* #define TQT_NO_TABDIALOG */ +#define TQT_NO_WIZARD +#define TQT_NO_EFFECTS + + +#define TQT_NO_MIME +/* #define TQT_NO_NETWORK //??? means single-process only */ + + +#define TQT_NO_IMAGE_TRUECOLOR +/* #define TQT_NO_IMAGE_SMOOTHSCALE //needed for iconset --> pushbutton */ +#define TQT_NO_IMAGE_TEXT +#define TQT_NO_DIR + +/* #define TQT_NO_TEXTSTREAM */ +#define TQT_NO_DATASTREAM + +#define TQT_NO_SESSIONMANAGER + + +/* #define TQT_NO_DIALOG */ + +#define TQT_NO_EFFECTS + +/* #define TQT_NO_RANGECONTROL */ +/* #define TQT_NO_SPLITTER */ +#define TQT_NO_STATUSBAR +#define TQT_NO_TABBAR +#define TQT_NO_TOOLBAR +#define TQT_NO_TOOLTIP +/* #define TQT_NO_VALIDATOR */ +#define TQT_NO_WHATSTHIS +#define TQT_NO_WIDGETSTACK +#define TQT_NO_ACCEL +#define TQT_NO_SIZEGRIP +#define TQT_NO_HEADER +#define TQT_NO_WORKSPACE +#define TQT_NO_LCDNUMBER +#define TQT_NO_STYLE_MOTIF +#define TQT_NO_STYLE_PLATINUM +#define TQT_NO_PROGRESSBAR + +#define TQT_NO_ICONVIEW +#define TQT_NO_DIAL + +#define TQT_NO_TABLE + +/* #define TQT_NO_FILEDIALOG */ +#define TQT_NO_FONTDIALOG +#define TQT_NO_PRINTDIALOG +#define TQT_NO_COLORDIALOG +#define TQT_NO_INPUTDIALOG +/* #define TQT_NO_MESSAGEBOX */ +#define TQT_NO_PROGRESSDIALOG +/* #define TQT_NO_TABDIALOG */ +#define TQT_NO_WIZARD +#define TQT_NO_EFFECTS + diff --git a/src/tools/tqconfig-minimal.h b/src/tools/tqconfig-minimal.h new file mode 100644 index 000000000..2d98d14ea --- /dev/null +++ b/src/tools/tqconfig-minimal.h @@ -0,0 +1,83 @@ +#ifndef QT_H +#endif /* QT_H */ + +#ifndef TQT_NO_CHECK +# define TQT_NO_CHECK +#endif +#define TQT_NO_PROCESS +#define TQT_NO_PALETTE +#define TQT_NO_ACTION +#ifndef TQT_NO_TEXTCODEC /* moc? */ +#define TQT_NO_TEXTCODEC +#endif +#define TQT_NO_UNICODETABLES +#define TQT_NO_IMAGEIO_BMP +#define TQT_NO_IMAGEIO_PPM +#define TQT_NO_IMAGEIO_XBM +#define TQT_NO_IMAGEIO_XPM +/* #define TQT_NO_IMAGEIO_PNG //done by configure -no-png */ +#define TQT_NO_ASYNC_IO +#define TQT_NO_ASYNC_IMAGE_IO +//#define TQT_NO_FONTDATABASE +#define TQT_NO_TRANSLATION +#define TQT_NO_MIME +#define TQT_NO_SOUND +/* #define TQT_NO_PROPERTIES */ +#define TQT_NO_CURSOR +#define TQT_NO_NETWORK +#define TQT_NO_COLORNAMES +#define TQT_NO_TRANSFORMATIONS +#define TQT_NO_PRINTER +#define TQT_NO_PICTURE +#define TQT_NO_LAYOUT +#define TQT_NO_DRAWUTIL +#define TQT_NO_IMAGE_TRUECOLOR +#define TQT_NO_IMAGE_SMOOTHSCALE +#define TQT_NO_IMAGE_TEXT +#define TQT_NO_DIR +#define TQT_NO_TEXTSTREAM +#define TQT_NO_DATASTREAM +//#define TQT_NO_STRINGLIST +#define TQT_NO_TEMPLATE_VARIANT +#define TQT_NO_SESSIONMANAGER +#define TQT_NO_SYNTAXHIGHLIGHTER + +#define TQT_NO_ACCEL +#define TQT_NO_BUTTON +#define TQT_NO_DIALOG +#define TQT_NO_FRAME + +#define TQT_NO_STYLE +#define TQT_NO_EFFECTS + +#define TQT_NO_SQL + +#define TQT_NO_REGEXP_CAPTURE +#define TQT_NO_REGEXP_WILDCARD + +#define TQT_NO_VALIDATOR +#define TQT_NO_SPRINTF + +#define TQT_NO_REGEXP + +#define TQT_NO_IMAGEIO + +/* #define TQT_NO_VARIANT //needed for signals/slots */ + +#define TQT_NO_RANGECONTROL +#define TQT_NO_QUUID_STRING +#define TQT_NO_SIGNALMAPPER + +#define TQT_NO_WHEELEVENT +#define TQT_NO_BEZIER + +#define TQT_NO_IMAGE_DITHER_TO_1 +#define TQT_NO_IMAGE_HEURISTIC_MASK +#define TQT_NO_IMAGE_MIRROR + +#ifndef TQT_NO_STL +# define TQT_NO_STL +#endif + +#define TQT_NO_DATESTRING +#define TQT_NO_WMATRIX diff --git a/src/tools/tqconfig-small.h b/src/tools/tqconfig-small.h new file mode 100644 index 000000000..d7d08b795 --- /dev/null +++ b/src/tools/tqconfig-small.h @@ -0,0 +1,76 @@ +#define NO_CHECK +#ifndef QT_H +#endif /* QT_H */ + +#define TQT_NO_ACTION +#ifndef TQT_NO_TEXTCODEC /* moc? */ +#define TQT_NO_TEXTCODEC +#endif +#define TQT_NO_UNICODETABLES +#define TQT_NO_IMAGEIO_BMP +#define TQT_NO_IMAGEIO_PPM +#define TQT_NO_IMAGEIO_XBM +#define TQT_NO_IMAGEIO_XPM +/* #define TQT_NO_IMAGEIO_PNG //done by configure -no-png */ +#define TQT_NO_ASYNC_IO +#define TQT_NO_ASYNC_IMAGE_IO +//#define TQT_NO_FONTDATABASE +#define TQT_NO_TRANSLATION +#define TQT_NO_MIME +#define TQT_NO_SOUND +#define TQT_NO_PROPERTIES +#define TQT_NO_SYNTAXHIGHLIGHTER + +#define TQT_NO_NETWORK /* ?????????????? */ +#define TQT_NO_COLORNAMES +#define TQT_NO_TRANSFORMATIONS +#define TQT_NO_PRINTER +#define TQT_NO_PICTURE + +#define TQT_NO_IMAGE_TRUECOLOR +/* #define TQT_NO_IMAGE_SMOOTHSCALE //needed for iconset --> pushbutton */ +#define TQT_NO_IMAGE_TEXT +#define TQT_NO_DIR + +#define TQT_NO_TEXTSTREAM +#define TQT_NO_DATASTREAM +//#define TQT_NO_STRINGLIST +#define TQT_NO_SESSIONMANAGER + + +#define TQT_NO_DIALOG + +/* #define TQT_NO_STYLE //will require substantial work... */ + +#define TQT_NO_EFFECTS + +#define TQT_NO_RANGECONTROL +#define TQT_NO_SPLITTER +#define TQT_NO_STATUSBAR +#define TQT_NO_TABBAR +#define TQT_NO_TOOLBAR +#define TQT_NO_TOOLTIP +#define TQT_NO_VALIDATOR +#define TQT_NO_WHATSTHIS +#define TQT_NO_WIDGETSTACK +#define TQT_NO_ACCEL +#define TQT_NO_SIZEGRIP +#define TQT_NO_HEADER +#define TQT_NO_WORKSPACE +#define TQT_NO_LCDNUMBER +#define TQT_NO_STYLE_MOTIF +#define TQT_NO_STYLE_PLATINUM +#define TQT_NO_PROGRESSBAR + + +/* other widgets that could be removed: */ +/* +#define TQT_NO_MENUDATA +*/ + + +/* possible options: */ +/* +#define TQT_NO_CURSOR +#define TQT_NO_LAYOUT +*/ diff --git a/src/tools/tqglobal.cpp b/src/tools/tqglobal.cpp index d33bfdf95..d77e284ea 100644 --- a/src/tools/tqglobal.cpp +++ b/src/tools/tqglobal.cpp @@ -820,7 +820,7 @@ void tqObsolete( const char *message ) Example: \code - #include + #include #include #include diff --git a/src/tools/tqglobal.h b/src/tools/tqglobal.h index 15545d1c7..e00cf68a9 100644 --- a/src/tools/tqglobal.h +++ b/src/tools/tqglobal.h @@ -736,17 +736,17 @@ class TQString; #if !defined(QT_MOC) #if defined(TQCONFIG_LOCAL) -#include "qconfig-local.h" +#include "tqconfig-local.h" #elif defined(TQCONFIG_MINIMAL) -#include "qconfig-minimal.h" +#include "tqconfig-minimal.h" #elif defined(TQCONFIG_SMALL) -#include "qconfig-small.h" +#include "tqconfig-small.h" #elif defined(TQCONFIG_MEDIUM) -#include "qconfig-medium.h" +#include "tqconfig-medium.h" #elif defined(TQCONFIG_LARGE) -#include "qconfig-large.h" +#include "tqconfig-large.h" #else // everything... -#include "ntqconfig.h" +#include "tqconfig.h" #endif #endif @@ -756,7 +756,7 @@ class TQString; #endif // prune to local config -#include "ntqmodules.h" +#include "tqmodules.h" #ifndef TQT_MODULE_DIALOGS # define TQT_NO_DIALOG #endif diff --git a/src/tools/tqthreadstorage_unix.cpp b/src/tools/tqthreadstorage_unix.cpp index 9a7e179b2..977ccf6bb 100644 --- a/src/tools/tqthreadstorage_unix.cpp +++ b/src/tools/tqthreadstorage_unix.cpp @@ -38,7 +38,7 @@ #ifdef TQT_THREAD_SUPPORT -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqthread.h" #include "qplatformdefs.h" diff --git a/src/tqmoc/tqmoc.y b/src/tqmoc/tqmoc.y index 3309ee7b6..5854ce787 100644 --- a/src/tqmoc/tqmoc.y +++ b/src/tqmoc/tqmoc.y @@ -2905,7 +2905,7 @@ void generateClass() // generate C++ source code for a class } } fprintf( out, "#include <%stqmetaobject.h>\n", (const char*)g->qtPath ); - fprintf( out, "#include <%sntqapplication.h>\n\n", (const char*)g->qtPath ); + fprintf( out, "#include <%stqapplication.h>\n\n", (const char*)g->qtPath ); fprintf( out, "#include <%sprivate/tqucomextra_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 tqmoc from %s." diff --git a/src/tqmoc/tqmoc_yacc.cpp b/src/tqmoc/tqmoc_yacc.cpp index ea0f36a2d..0422ee4cd 100644 --- a/src/tqmoc/tqmoc_yacc.cpp +++ b/src/tqmoc/tqmoc_yacc.cpp @@ -5780,7 +5780,7 @@ void generateClass() // generate C++ source code for a class } } fprintf( out, "#include <%stqmetaobject.h>\n", (const char*)g->qtPath ); - fprintf( out, "#include <%sntqapplication.h>\n\n", (const char*)g->qtPath ); + fprintf( out, "#include <%stqapplication.h>\n\n", (const char*)g->qtPath ); fprintf( out, "#include <%sprivate/tqucomextra_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 tqmoc from %s." diff --git a/src/widgets/tqbutton.cpp b/src/widgets/tqbutton.cpp index 088f9cc6a..bcf9c2ada 100644 --- a/src/widgets/tqbutton.cpp +++ b/src/widgets/tqbutton.cpp @@ -46,7 +46,7 @@ #include "tqtimer.h" #include "tqaccel.h" #include "tqpixmapcache.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpushbutton.h" #include "tqradiobutton.h" #include "tqguardedptr.h" diff --git a/src/widgets/tqbuttongroup.cpp b/src/widgets/tqbuttongroup.cpp index c56af49d9..9b495279c 100644 --- a/src/widgets/tqbuttongroup.cpp +++ b/src/widgets/tqbuttongroup.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_BUTTONGROUP #include "tqbutton.h" #include "tqptrlist.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqradiobutton.h" diff --git a/src/widgets/tqcheckbox.cpp b/src/widgets/tqcheckbox.cpp index 85c3e1845..6b0cc48a6 100644 --- a/src/widgets/tqcheckbox.cpp +++ b/src/widgets/tqcheckbox.cpp @@ -46,7 +46,7 @@ #include "tqpixmapcache.h" #include "tqbitmap.h" #include "tqtextstream.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" /*! diff --git a/src/widgets/tqcombobox.cpp b/src/widgets/tqcombobox.cpp index 1f0ff2e9d..278b555e6 100644 --- a/src/widgets/tqcombobox.cpp +++ b/src/widgets/tqcombobox.cpp @@ -47,7 +47,7 @@ #include "tqstrlist.h" #include "tqpixmap.h" #include "tqtimer.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqlineedit.h" #include "tqbitmap.h" #include "tqeffects_p.h" diff --git a/src/widgets/tqdatetimeedit.cpp b/src/widgets/tqdatetimeedit.cpp index a01a14694..3820c5604 100644 --- a/src/widgets/tqdatetimeedit.cpp +++ b/src/widgets/tqdatetimeedit.cpp @@ -45,9 +45,8 @@ #include "../kernel/tqinternal_p.h" #include "../kernel/tqrichtext_p.h" #include "tqrangecontrol.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpixmap.h" -#include "ntqapplication.h" #include "tqvaluelist.h" #include "tqstring.h" #include "tqstyle.h" diff --git a/src/widgets/tqdial.cpp b/src/widgets/tqdial.cpp index 6c9b4d499..b1e523956 100644 --- a/src/widgets/tqdial.cpp +++ b/src/widgets/tqdial.cpp @@ -45,7 +45,7 @@ #include "tqpainter.h" #include "tqpointarray.h" #include "tqcolor.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqregion.h" #include "tqbitmap.h" #include "tqstyle.h" diff --git a/src/widgets/tqdialogbuttons.cpp b/src/widgets/tqdialogbuttons.cpp index 12015bceb..0704cc0e0 100644 --- a/src/widgets/tqdialogbuttons.cpp +++ b/src/widgets/tqdialogbuttons.cpp @@ -39,7 +39,7 @@ #include "tqdialogbuttons_p.h" #ifndef TQT_NO_DIALOGBUTTONS -#include +#include #include #include #include diff --git a/src/widgets/tqdockarea.cpp b/src/widgets/tqdockarea.cpp index 0f14a33a7..9bb4d4a12 100644 --- a/src/widgets/tqdockarea.cpp +++ b/src/widgets/tqdockarea.cpp @@ -44,7 +44,7 @@ #include "tqsplitter.h" #include "tqlayout.h" #include "tqptrvector.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqwidgetlist.h" #include "tqmap.h" diff --git a/src/widgets/tqdockwindow.cpp b/src/widgets/tqdockwindow.cpp index e07a550af..fa20b1745 100644 --- a/src/widgets/tqdockwindow.cpp +++ b/src/widgets/tqdockwindow.cpp @@ -46,7 +46,7 @@ #include "tqwidgetresizehandler_p.h" #include "tqtitlebar_p.h" #include "tqpainter.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqtoolbutton.h" #include "tqtoolbar.h" #include "tqlayout.h" diff --git a/src/widgets/tqeffects.cpp b/src/widgets/tqeffects.cpp index 792456119..0ff1b11d4 100644 --- a/src/widgets/tqeffects.cpp +++ b/src/widgets/tqeffects.cpp @@ -38,7 +38,7 @@ ** **********************************************************************/ -#include "ntqapplication.h" +#include "tqapplication.h" #ifndef TQT_NO_EFFECTS #include "tqwidget.h" #include "tqeffects_p.h" diff --git a/src/widgets/tqgrid.cpp b/src/widgets/tqgrid.cpp index bdc43f9e1..19e7e2964 100644 --- a/src/widgets/tqgrid.cpp +++ b/src/widgets/tqgrid.cpp @@ -38,7 +38,7 @@ #include "tqgrid.h" #ifndef TQT_NO_GRID #include "tqlayout.h" -#include "ntqapplication.h" +#include "tqapplication.h" /*! \class TQGrid tqgrid.h diff --git a/src/widgets/tqgroupbox.cpp b/src/widgets/tqgroupbox.cpp index c54ff3357..b969f18ac 100644 --- a/src/widgets/tqgroupbox.cpp +++ b/src/widgets/tqgroupbox.cpp @@ -48,7 +48,7 @@ #include "tqfocusdata.h" #include "tqobjectlist.h" #include "tqdrawutil.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqcheckbox.h" #include "tqbuttongroup.h" diff --git a/src/widgets/tqhbox.cpp b/src/widgets/tqhbox.cpp index 41b4fabbf..cb0e0281c 100644 --- a/src/widgets/tqhbox.cpp +++ b/src/widgets/tqhbox.cpp @@ -37,7 +37,7 @@ #include "tqhbox.h" #ifndef TQT_NO_HBOX #include "tqlayout.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqobjectlist.h" diff --git a/src/widgets/tqheader.cpp b/src/widgets/tqheader.cpp index 82df9e63e..540a90508 100644 --- a/src/widgets/tqheader.cpp +++ b/src/widgets/tqheader.cpp @@ -45,7 +45,7 @@ #include "tqpixmap.h" #include "tqbitarray.h" #include "tqptrvector.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" class TQHeaderData diff --git a/src/widgets/tqiconview.cpp b/src/widgets/tqiconview.cpp index 7af1babc8..1b3170a42 100644 --- a/src/widgets/tqiconview.cpp +++ b/src/widgets/tqiconview.cpp @@ -58,7 +58,7 @@ #include "tqbrush.h" #include "tqtimer.h" #include "tqcursor.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqtextedit.h" #include "tqmemarray.h" #include "tqptrlist.h" diff --git a/src/widgets/tqlabel.cpp b/src/widgets/tqlabel.cpp index b1c5807ec..4550cda3e 100644 --- a/src/widgets/tqlabel.cpp +++ b/src/widgets/tqlabel.cpp @@ -47,7 +47,7 @@ #include "tqimage.h" #include "tqbitmap.h" #include "tqpicture.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqsimplerichtext.h" #include "tqstylesheet.h" #include "tqstyle.h" diff --git a/src/widgets/tqlineedit.cpp b/src/widgets/tqlineedit.cpp index 46b1df641..2267706d4 100644 --- a/src/widgets/tqlineedit.cpp +++ b/src/widgets/tqlineedit.cpp @@ -51,7 +51,7 @@ #include "tqfontmetrics.h" #include "tqpixmap.h" #include "tqclipboard.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqvalidator.h" #include "tqdragobject.h" #include "tqtimer.h" diff --git a/src/widgets/tqlistbox.cpp b/src/widgets/tqlistbox.cpp index e7c90ddcb..bbbda6694 100644 --- a/src/widgets/tqlistbox.cpp +++ b/src/widgets/tqlistbox.cpp @@ -51,7 +51,7 @@ #include "tqpainter.h" #include "tqstrlist.h" #include "tqpixmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqptrdict.h" #include "tqtimer.h" #include "tqstringlist.h" diff --git a/src/widgets/tqlistview.cpp b/src/widgets/tqlistview.cpp index 477743c2a..6d8f3771f 100644 --- a/src/widgets/tqlistview.cpp +++ b/src/widgets/tqlistview.cpp @@ -47,7 +47,7 @@ #include "tqptrstack.h" #include "tqptrlist.h" #include "tqstrlist.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitmap.h" #include "tqdatetime.h" #include "tqptrdict.h" diff --git a/src/widgets/tqmainwindow.cpp b/src/widgets/tqmainwindow.cpp index 609b22289..bc5596645 100644 --- a/src/widgets/tqmainwindow.cpp +++ b/src/widgets/tqmainwindow.cpp @@ -45,7 +45,7 @@ #include "tqlayout.h" #include "tqobjectlist.h" #include "tqintdict.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqptrlist.h" #include "tqmap.h" #include "tqcursor.h" diff --git a/src/widgets/tqmenubar.cpp b/src/widgets/tqmenubar.cpp index 8577bda56..58507e4d4 100644 --- a/src/widgets/tqmenubar.cpp +++ b/src/widgets/tqmenubar.cpp @@ -48,7 +48,7 @@ #include "tqaccel.h" #include "tqpainter.h" #include "tqdrawutil.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqguardedptr.h" #include "tqlayout.h" #include "tqcleanuphandler.h" @@ -72,7 +72,7 @@ static bool inMenu = FALSE; #endif #if defined(TQ_WS_X11) -extern int qt_xfocusout_grab_counter; // defined in qapplication_x11.cpp +extern int qt_xfocusout_grab_counter; // defined in tqapplication_x11.cpp #endif /*! diff --git a/src/widgets/tqmenudata.cpp b/src/widgets/tqmenudata.cpp index 148d79790..e0b7deca9 100644 --- a/src/widgets/tqmenudata.cpp +++ b/src/widgets/tqmenudata.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_MENUDATA #include "tqpopupmenu.h" #include "tqmenubar.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqguardedptr.h" class TQMenuItemData { diff --git a/src/widgets/tqmultilineedit.cpp b/src/widgets/tqmultilineedit.cpp index 1ee4b712e..67896224a 100644 --- a/src/widgets/tqmultilineedit.cpp +++ b/src/widgets/tqmultilineedit.cpp @@ -46,7 +46,7 @@ #include "tqclipboard.h" #include "tqpixmap.h" #include "tqregexp.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqdragobject.h" #include "tqpopupmenu.h" #include "tqtimer.h" diff --git a/src/widgets/tqpopupmenu.cpp b/src/widgets/tqpopupmenu.cpp index e614a328c..c52c00005 100644 --- a/src/widgets/tqpopupmenu.cpp +++ b/src/widgets/tqpopupmenu.cpp @@ -44,7 +44,7 @@ #include "tqaccel.h" #include "tqpainter.h" #include "tqdrawutil.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpixmap.h" #include "tqpixmapcache.h" #include "tqtimer.h" diff --git a/src/widgets/tqpushbutton.cpp b/src/widgets/tqpushbutton.cpp index 7e6add688..e264d2c1e 100644 --- a/src/widgets/tqpushbutton.cpp +++ b/src/widgets/tqpushbutton.cpp @@ -48,7 +48,7 @@ #include "tqbitmap.h" #include "tqpopupmenu.h" #include "tqguardedptr.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqtoolbar.h" #include "tqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) diff --git a/src/widgets/tqradiobutton.cpp b/src/widgets/tqradiobutton.cpp index eac619f59..b296f5d79 100644 --- a/src/widgets/tqradiobutton.cpp +++ b/src/widgets/tqradiobutton.cpp @@ -47,7 +47,7 @@ #include "tqpixmapcache.h" #include "tqbitmap.h" #include "tqtextstream.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" /*! diff --git a/src/widgets/tqscrollbar.cpp b/src/widgets/tqscrollbar.cpp index 3f6c683c7..e49e1f9a9 100644 --- a/src/widgets/tqscrollbar.cpp +++ b/src/widgets/tqscrollbar.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_SCROLLBAR #include "tqpainter.h" #include "tqbitmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqtimer.h" #include "tqstyle.h" #ifndef TQT_NO_CURSOR diff --git a/src/widgets/tqscrollview.cpp b/src/widgets/tqscrollview.cpp index 2f5e92ea1..40a5bb509 100644 --- a/src/widgets/tqscrollview.cpp +++ b/src/widgets/tqscrollview.cpp @@ -48,7 +48,7 @@ #include "tqfocusdata.h" #include "tqscrollview.h" #include "tqptrdict.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqtimer.h" #include "tqstyle.h" #include "tqlistview.h" diff --git a/src/widgets/tqslider.cpp b/src/widgets/tqslider.cpp index 6b020c620..7c503e1b0 100644 --- a/src/widgets/tqslider.cpp +++ b/src/widgets/tqslider.cpp @@ -44,7 +44,7 @@ #include "tqdrawutil.h" #include "tqtimer.h" #include "tqbitmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) #include "tqaccessible.h" diff --git a/src/widgets/tqspinbox.cpp b/src/widgets/tqspinbox.cpp index 6c6b38be5..08af76cb0 100644 --- a/src/widgets/tqspinbox.cpp +++ b/src/widgets/tqspinbox.cpp @@ -48,7 +48,7 @@ #include "tqlineedit.h" #include "tqvalidator.h" #include "tqpixmapcache.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #if defined(QT_ACCESSIBILITY_SUPPORT) #include "tqaccessible.h" diff --git a/src/widgets/tqsplashscreen.cpp b/src/widgets/tqsplashscreen.cpp index 78aa19869..ba7b765a6 100644 --- a/src/widgets/tqsplashscreen.cpp +++ b/src/widgets/tqsplashscreen.cpp @@ -40,7 +40,7 @@ #ifndef TQT_NO_SPLASHSCREEN -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpainter.h" #include "tqpixmap.h" diff --git a/src/widgets/tqsplitter.cpp b/src/widgets/tqsplitter.cpp index e9de06731..41b565ef3 100644 --- a/src/widgets/tqsplitter.cpp +++ b/src/widgets/tqsplitter.cpp @@ -43,7 +43,7 @@ #include "tqlayout.h" #include "../kernel/tqlayoutengine_p.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqbitmap.h" #include "tqdrawutil.h" #include "tqmemarray.h" diff --git a/src/widgets/tqtabbar.cpp b/src/widgets/tqtabbar.cpp index cba1906c8..0d3ea9c70 100644 --- a/src/widgets/tqtabbar.cpp +++ b/src/widgets/tqtabbar.cpp @@ -42,7 +42,7 @@ #include "tqbitmap.h" #include "tqtoolbutton.h" #include "tqtooltip.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqpainter.h" #include "tqiconset.h" diff --git a/src/widgets/tqtabwidget.cpp b/src/widgets/tqtabwidget.cpp index 88ec8a06e..ea294e76a 100644 --- a/src/widgets/tqtabwidget.cpp +++ b/src/widgets/tqtabwidget.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_TABWIDGET #include "tqobjectlist.h" #include "tqtabbar.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqwidgetstack.h" #include "tqbitmap.h" #include "tqaccel.h" diff --git a/src/widgets/tqtextbrowser.cpp b/src/widgets/tqtextbrowser.cpp index 161757d19..584639c61 100644 --- a/src/widgets/tqtextbrowser.cpp +++ b/src/widgets/tqtextbrowser.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_TEXTBROWSER #include "../kernel/tqrichtext_p.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqlayout.h" #include "tqpainter.h" diff --git a/src/widgets/tqtextedit.cpp b/src/widgets/tqtextedit.cpp index baddd23c5..cc88b3dd9 100644 --- a/src/widgets/tqtextedit.cpp +++ b/src/widgets/tqtextedit.cpp @@ -58,10 +58,9 @@ #include "tqsize.h" #include "tqevent.h" #include "tqtimer.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqlistbox.h" #include "tqvbox.h" -#include "ntqapplication.h" #include "tqclipboard.h" #include "tqcolordialog.h" #include "tqfontdialog.h" diff --git a/src/widgets/tqtitlebar.cpp b/src/widgets/tqtitlebar.cpp index 83bb8c125..536bf4942 100644 --- a/src/widgets/tqtitlebar.cpp +++ b/src/widgets/tqtitlebar.cpp @@ -45,10 +45,10 @@ #ifndef TQT_NO_TITLEBAR #include -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqdatetime.h" -#include "private/qapplication_p.h" +#include "private/tqapplication_p.h" #include "tqtooltip.h" #include "tqimage.h" #include "tqtimer.h" diff --git a/src/widgets/tqtoolbox.cpp b/src/widgets/tqtoolbox.cpp index ac9df2f82..e5b139035 100644 --- a/src/widgets/tqtoolbox.cpp +++ b/src/widgets/tqtoolbox.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/widgets/tqtoolbutton.cpp b/src/widgets/tqtoolbutton.cpp index b44f93b9e..fab5ffb93 100644 --- a/src/widgets/tqtoolbutton.cpp +++ b/src/widgets/tqtoolbutton.cpp @@ -45,7 +45,7 @@ #include "tqpainter.h" #include "tqpixmap.h" #include "tqwmatrix.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqstyle.h" #include "tqmainwindow.h" #include "tqtooltip.h" diff --git a/src/widgets/tqtooltip.cpp b/src/widgets/tqtooltip.cpp index e044be6ea..32211ec9f 100644 --- a/src/widgets/tqtooltip.cpp +++ b/src/widgets/tqtooltip.cpp @@ -40,7 +40,7 @@ #ifndef TQT_NO_TOOLTIP #include "tqlabel.h" #include "tqptrdict.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqguardedptr.h" #include "tqtimer.h" #include "tqeffects_p.h" diff --git a/src/widgets/tqwhatsthis.cpp b/src/widgets/tqwhatsthis.cpp index 4b38a43d5..6f4a7ec10 100644 --- a/src/widgets/tqwhatsthis.cpp +++ b/src/widgets/tqwhatsthis.cpp @@ -38,7 +38,7 @@ #include "tqwhatsthis.h" #ifndef TQT_NO_WHATSTHIS -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqpaintdevicemetrics.h" #include "tqpixmap.h" #include "tqpainter.h" diff --git a/src/widgets/tqwidgetresizehandler.cpp b/src/widgets/tqwidgetresizehandler.cpp index 342626e53..e16814ba5 100644 --- a/src/widgets/tqwidgetresizehandler.cpp +++ b/src/widgets/tqwidgetresizehandler.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_RESIZEHANDLER #include "tqframe.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqcursor.h" #include "tqsizegrip.h" #if defined(TQ_WS_WIN) diff --git a/src/widgets/tqwidgetstack.cpp b/src/widgets/tqwidgetstack.cpp index d550fa6ef..d751fb243 100644 --- a/src/widgets/tqwidgetstack.cpp +++ b/src/widgets/tqwidgetstack.cpp @@ -48,7 +48,7 @@ #include "tqbutton.h" #include "tqbuttongroup.h" -#include "ntqapplication.h" +#include "tqapplication.h" class TQWidgetStackPrivate { public: diff --git a/src/workspace/tqworkspace.cpp b/src/workspace/tqworkspace.cpp index 1677b3a41..ab0f67896 100644 --- a/src/workspace/tqworkspace.cpp +++ b/src/workspace/tqworkspace.cpp @@ -40,7 +40,7 @@ #include "tqworkspace.h" #ifndef TQT_NO_WORKSPACE -#include "ntqapplication.h" +#include "tqapplication.h" #include "../widgets/tqtitlebar_p.h" #include "tqobjectlist.h" #include "tqlayout.h" diff --git a/tools/assistant/config.cpp b/tools/assistant/config.cpp index 9c4c328a8..43f17b6c1 100644 --- a/tools/assistant/config.cpp +++ b/tools/assistant/config.cpp @@ -35,7 +35,7 @@ #include "profile.h" #include "docuparser.h" -#include +#include #include #include #include diff --git a/tools/assistant/finddialog.ui.h b/tools/assistant/finddialog.ui.h index f356dd4cd..c95c41379 100644 --- a/tools/assistant/finddialog.ui.h +++ b/tools/assistant/finddialog.ui.h @@ -31,7 +31,7 @@ ** **********************************************************************/ -#include +#include void FindDialog::init() { diff --git a/tools/assistant/helpdialogimpl.cpp b/tools/assistant/helpdialogimpl.cpp index fce5ceeea..6a1d91b56 100644 --- a/tools/assistant/helpdialogimpl.cpp +++ b/tools/assistant/helpdialogimpl.cpp @@ -40,7 +40,7 @@ #include "tabbedbrowser.h" #include -#include +#include #include #include #include diff --git a/tools/assistant/helpwindow.cpp b/tools/assistant/helpwindow.cpp index 5f5777233..014729c23 100644 --- a/tools/assistant/helpwindow.cpp +++ b/tools/assistant/helpwindow.cpp @@ -37,7 +37,7 @@ #include "helpdialogimpl.h" #include "config.h" -#include +#include #include #include #include diff --git a/tools/assistant/index.cpp b/tools/assistant/index.cpp index 602dc9afe..37de8a85a 100644 --- a/tools/assistant/index.cpp +++ b/tools/assistant/index.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include diff --git a/tools/assistant/main.cpp b/tools/assistant/main.cpp index b1bbb5066..ba26d82c1 100644 --- a/tools/assistant/main.cpp +++ b/tools/assistant/main.cpp @@ -35,7 +35,7 @@ #include "helpdialogimpl.h" #include "config.h" -#include +#include #include #include #include diff --git a/tools/assistant/mainwindow.ui b/tools/assistant/mainwindow.ui index 9a65861ea..f140f7d16 100644 --- a/tools/assistant/mainwindow.ui +++ b/tools/assistant/mainwindow.ui @@ -585,7 +585,7 @@ tqmime.h helpwindow.h tqstylesheet.h - ntqapplication.h + tqapplication.h helpdialogimpl.h tqdir.h tqprinter.h diff --git a/tools/assistant/settingsdialogimpl.cpp b/tools/assistant/settingsdialogimpl.cpp index 42eeca0fe..287bb374c 100644 --- a/tools/assistant/settingsdialogimpl.cpp +++ b/tools/assistant/settingsdialogimpl.cpp @@ -35,7 +35,7 @@ #include "docuparser.h" #include "config.h" -#include +#include #include #include #include diff --git a/tools/designer/designer/actiondnd.cpp b/tools/designer/designer/actiondnd.cpp index f744e34ff..e48142677 100644 --- a/tools/designer/designer/actiondnd.cpp +++ b/tools/designer/designer/actiondnd.cpp @@ -41,7 +41,7 @@ #include "hierarchyview.h" #include -#include +#include #include #include #include diff --git a/tools/designer/designer/command.cpp b/tools/designer/designer/command.cpp index 21fdbc3f3..e04bfd71d 100644 --- a/tools/designer/designer/command.cpp +++ b/tools/designer/designer/command.cpp @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/customwidgeteditorimpl.cpp b/tools/designer/designer/customwidgeteditorimpl.cpp index 5eb81d29c..193477cf8 100644 --- a/tools/designer/designer/customwidgeteditorimpl.cpp +++ b/tools/designer/designer/customwidgeteditorimpl.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/dbconnectionsimpl.cpp b/tools/designer/designer/dbconnectionsimpl.cpp index 37c4b8a43..413214782 100644 --- a/tools/designer/designer/dbconnectionsimpl.cpp +++ b/tools/designer/designer/dbconnectionsimpl.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include "mainwindow.h" #include "asciivalidator.h" diff --git a/tools/designer/designer/designer_de.ts b/tools/designer/designer/designer_de.ts index f92fe096d..a3d66c67c 100644 --- a/tools/designer/designer/designer_de.ts +++ b/tools/designer/designer/designer_de.ts @@ -4444,7 +4444,7 @@ load these files? - QApplication + TQApplication Connection diff --git a/tools/designer/designer/designer_fr.ts b/tools/designer/designer/designer_fr.ts index a185365c4..710efadc6 100644 --- a/tools/designer/designer/designer_fr.ts +++ b/tools/designer/designer/designer_fr.ts @@ -4442,7 +4442,7 @@ load these files? - QApplication + TQApplication Connection diff --git a/tools/designer/designer/designer_pch.h b/tools/designer/designer/designer_pch.h index fd4fbe756..fa840181a 100644 --- a/tools/designer/designer/designer_pch.h +++ b/tools/designer/designer/designer_pch.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/designerapp.h b/tools/designer/designer/designerapp.h index 296572e5b..df5271a68 100644 --- a/tools/designer/designer/designerapp.h +++ b/tools/designer/designer/designerapp.h @@ -36,7 +36,7 @@ class TQSplashScreen; -#include +#include class DesignerApplication : public TQApplication { diff --git a/tools/designer/designer/formfile.cpp b/tools/designer/designer/formfile.cpp index 2870f57c5..42e555c79 100644 --- a/tools/designer/designer/formfile.cpp +++ b/tools/designer/designer/formfile.cpp @@ -48,7 +48,7 @@ #include #include #include "designerappiface.h" -#include +#include static TQString make_func_pretty( const TQString &s ) { diff --git a/tools/designer/designer/formwindow.cpp b/tools/designer/designer/formwindow.cpp index 8b7514f7f..d81852623 100644 --- a/tools/designer/designer/formwindow.cpp +++ b/tools/designer/designer/formwindow.cpp @@ -57,11 +57,10 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include diff --git a/tools/designer/designer/hierarchyview.cpp b/tools/designer/designer/hierarchyview.cpp index a80a44cf7..a83867f21 100644 --- a/tools/designer/designer/hierarchyview.cpp +++ b/tools/designer/designer/hierarchyview.cpp @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include "../interfaces/languageinterface.h" #include diff --git a/tools/designer/designer/listeditor.ui.h b/tools/designer/designer/listeditor.ui.h index e28e90551..217ca58eb 100644 --- a/tools/designer/designer/listeditor.ui.h +++ b/tools/designer/designer/listeditor.ui.h @@ -7,7 +7,7 @@ *****************************************************************************/ #include -#include +#include void ListEditor::init() { diff --git a/tools/designer/designer/mainwindowactions.cpp b/tools/designer/designer/mainwindowactions.cpp index cf392f9af..c24984c33 100644 --- a/tools/designer/designer/mainwindowactions.cpp +++ b/tools/designer/designer/mainwindowactions.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/menubareditor.cpp b/tools/designer/designer/menubareditor.cpp index cc3e22c25..613b9e5ee 100644 --- a/tools/designer/designer/menubareditor.cpp +++ b/tools/designer/designer/menubareditor.cpp @@ -32,7 +32,7 @@ **********************************************************************/ #include -#include +#include #include #include #include diff --git a/tools/designer/designer/metadatabase.cpp b/tools/designer/designer/metadatabase.cpp index b8385d056..094639a3d 100644 --- a/tools/designer/designer/metadatabase.cpp +++ b/tools/designer/designer/metadatabase.cpp @@ -41,7 +41,7 @@ #include "project.h" #include "mainwindow.h" -#include +#include #include #include #include diff --git a/tools/designer/designer/multilineeditorimpl.cpp b/tools/designer/designer/multilineeditorimpl.cpp index cea8ad720..9bbb09c6f 100644 --- a/tools/designer/designer/multilineeditorimpl.cpp +++ b/tools/designer/designer/multilineeditorimpl.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include diff --git a/tools/designer/designer/orderindicator.cpp b/tools/designer/designer/orderindicator.cpp index e0a9a7ec5..baf16369b 100644 --- a/tools/designer/designer/orderindicator.cpp +++ b/tools/designer/designer/orderindicator.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include OrderIndicator::OrderIndicator( int i, TQWidget* w, FormWindow *fw ) : TQWidget( fw, "order_indicator", WMouseNoMask ), formWindow( fw ) diff --git a/tools/designer/designer/outputwindow.cpp b/tools/designer/designer/outputwindow.cpp index 54d71b745..c0e319da4 100644 --- a/tools/designer/designer/outputwindow.cpp +++ b/tools/designer/designer/outputwindow.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/paletteeditoradvancedimpl.cpp b/tools/designer/designer/paletteeditoradvancedimpl.cpp index df27dc318..10c9edf04 100644 --- a/tools/designer/designer/paletteeditoradvancedimpl.cpp +++ b/tools/designer/designer/paletteeditoradvancedimpl.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/paletteeditorimpl.cpp b/tools/designer/designer/paletteeditorimpl.cpp index 0aae0754b..02910e442 100644 --- a/tools/designer/designer/paletteeditorimpl.cpp +++ b/tools/designer/designer/paletteeditorimpl.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include PaletteEditor::PaletteEditor( FormWindow *fw, TQWidget * parent, const char * name, bool modal, WFlags f ) diff --git a/tools/designer/designer/pixmapchooser.cpp b/tools/designer/designer/pixmapchooser.cpp index 0746fb015..980bb9921 100644 --- a/tools/designer/designer/pixmapchooser.cpp +++ b/tools/designer/designer/pixmapchooser.cpp @@ -44,7 +44,7 @@ #include "pixmapcollection.h" #include "project.h" -#include +#include #include #include #include diff --git a/tools/designer/designer/popupmenueditor.cpp b/tools/designer/designer/popupmenueditor.cpp index 2aa2c7062..d3891735a 100644 --- a/tools/designer/designer/popupmenueditor.cpp +++ b/tools/designer/designer/popupmenueditor.cpp @@ -31,7 +31,7 @@ ** **********************************************************************/ -#include +#include #include #include #include diff --git a/tools/designer/designer/project.cpp b/tools/designer/designer/project.cpp index 5f20067d9..777c54597 100644 --- a/tools/designer/designer/project.cpp +++ b/tools/designer/designer/project.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include "mainwindow.h" #include diff --git a/tools/designer/designer/propertyeditor.cpp b/tools/designer/designer/propertyeditor.cpp index 0883e63fc..03b9219c6 100644 --- a/tools/designer/designer/propertyeditor.cpp +++ b/tools/designer/designer/propertyeditor.cpp @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/propertyeditor.h b/tools/designer/designer/propertyeditor.h index ac9fcb326..0c8b3c22d 100644 --- a/tools/designer/designer/propertyeditor.h +++ b/tools/designer/designer/propertyeditor.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/resource.cpp b/tools/designer/designer/resource.cpp index e65493c5a..ee602c271 100644 --- a/tools/designer/designer/resource.cpp +++ b/tools/designer/designer/resource.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/sizehandle.cpp b/tools/designer/designer/sizehandle.cpp index a7e213669..aa442085f 100644 --- a/tools/designer/designer/sizehandle.cpp +++ b/tools/designer/designer/sizehandle.cpp @@ -38,7 +38,7 @@ #include "widgetfactory.h" #include -#include +#include #include SizeHandle::SizeHandle( FormWindow *parent, Direction d, WidgetSelection *s ) diff --git a/tools/designer/designer/startdialogimpl.cpp b/tools/designer/designer/startdialogimpl.cpp index 9fe20026a..59125b685 100644 --- a/tools/designer/designer/startdialogimpl.cpp +++ b/tools/designer/designer/startdialogimpl.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/tools/designer/designer/styledbutton.cpp b/tools/designer/designer/styledbutton.cpp index 6f57519d9..e4dfd5f93 100644 --- a/tools/designer/designer/styledbutton.cpp +++ b/tools/designer/designer/styledbutton.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff --git a/tools/designer/designer/syntaxhighlighter_html.cpp b/tools/designer/designer/syntaxhighlighter_html.cpp index 6a7946c05..164f30a66 100644 --- a/tools/designer/designer/syntaxhighlighter_html.cpp +++ b/tools/designer/designer/syntaxhighlighter_html.cpp @@ -35,7 +35,7 @@ #include "syntaxhighlighter_html.h" #include "tqstring.h" #include "tqmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" SyntaxHighlighter_HTML::SyntaxHighlighter_HTML() diff --git a/tools/designer/designer/tqcompletionedit.cpp b/tools/designer/designer/tqcompletionedit.cpp index 02c3af5c5..466cedcee 100644 --- a/tools/designer/designer/tqcompletionedit.cpp +++ b/tools/designer/designer/tqcompletionedit.cpp @@ -34,7 +34,7 @@ #include "tqcompletionedit.h" #include #include -#include +#include #include TQCompletionEdit::TQCompletionEdit( TQWidget *parent, const char *name ) diff --git a/tools/designer/designer/widgetfactory.cpp b/tools/designer/designer/widgetfactory.cpp index b2fb21d0b..4611047ce 100644 --- a/tools/designer/designer/widgetfactory.cpp +++ b/tools/designer/designer/widgetfactory.cpp @@ -91,7 +91,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/designer/designer/workspace.cpp b/tools/designer/designer/workspace.cpp index 485f02ea4..560b81464 100644 --- a/tools/designer/designer/workspace.cpp +++ b/tools/designer/designer/workspace.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/designer/editor/completion.cpp b/tools/designer/editor/completion.cpp index b8e71233b..22acdc951 100644 --- a/tools/designer/editor/completion.cpp +++ b/tools/designer/editor/completion.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include "arghintwidget.h" #include diff --git a/tools/designer/editor/conf.cpp b/tools/designer/editor/conf.cpp index 65541ea12..dba758a2f 100644 --- a/tools/designer/editor/conf.cpp +++ b/tools/designer/editor/conf.cpp @@ -32,7 +32,7 @@ **********************************************************************/ #include "conf.h" -#include +#include #include #include #include diff --git a/tools/designer/editor/editor.cpp b/tools/designer/editor/editor.cpp index 86af88362..127bcbeef 100644 --- a/tools/designer/editor/editor.cpp +++ b/tools/designer/editor/editor.cpp @@ -36,7 +36,7 @@ #include #include #include "conf.h" -#include +#include #include #include diff --git a/tools/designer/editor/parenmatcher.cpp b/tools/designer/editor/parenmatcher.cpp index 5976fc0ff..a753f34a2 100644 --- a/tools/designer/editor/parenmatcher.cpp +++ b/tools/designer/editor/parenmatcher.cpp @@ -36,7 +36,7 @@ #include "tqtextedit.h" #include -#include +#include ParenMatcher::ParenMatcher() { diff --git a/tools/designer/examples/addressbook/addressbook.ui.h b/tools/designer/examples/addressbook/addressbook.ui.h index 35cf1e737..7e97cc96a 100644 --- a/tools/designer/examples/addressbook/addressbook.ui.h +++ b/tools/designer/examples/addressbook/addressbook.ui.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include void AddressBook::fileNew() { diff --git a/tools/designer/examples/addressbook/main.cpp b/tools/designer/examples/addressbook/main.cpp index 0359e37c0..09a8fe001 100644 --- a/tools/designer/examples/addressbook/main.cpp +++ b/tools/designer/examples/addressbook/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "addressbook.h" int main( int argc, char ** argv ) diff --git a/tools/designer/examples/book/book1/main.cpp b/tools/designer/examples/book/book1/main.cpp index e101e2711..21c9fcacc 100644 --- a/tools/designer/examples/book/book1/main.cpp +++ b/tools/designer/examples/book/book1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book2/main.cpp b/tools/designer/examples/book/book2/main.cpp index e101e2711..21c9fcacc 100644 --- a/tools/designer/examples/book/book2/main.cpp +++ b/tools/designer/examples/book/book2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book3/main.cpp b/tools/designer/examples/book/book3/main.cpp index db0977fb1..e1f5ebfe5 100644 --- a/tools/designer/examples/book/book3/main.cpp +++ b/tools/designer/examples/book/book3/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book4/main.cpp b/tools/designer/examples/book/book4/main.cpp index 234e8e7f0..6072fbd1c 100644 --- a/tools/designer/examples/book/book4/main.cpp +++ b/tools/designer/examples/book/book4/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book5/main.cpp b/tools/designer/examples/book/book5/main.cpp index e101e2711..21c9fcacc 100644 --- a/tools/designer/examples/book/book5/main.cpp +++ b/tools/designer/examples/book/book5/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book6/main.cpp b/tools/designer/examples/book/book6/main.cpp index e101e2711..21c9fcacc 100644 --- a/tools/designer/examples/book/book6/main.cpp +++ b/tools/designer/examples/book/book6/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book7/main.cpp b/tools/designer/examples/book/book7/main.cpp index e101e2711..21c9fcacc 100644 --- a/tools/designer/examples/book/book7/main.cpp +++ b/tools/designer/examples/book/book7/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/book/book8/main.cpp b/tools/designer/examples/book/book8/main.cpp index e101e2711..21c9fcacc 100644 --- a/tools/designer/examples/book/book8/main.cpp +++ b/tools/designer/examples/book/book8/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include #include "book.h" #include "../connection.h" diff --git a/tools/designer/examples/colortool/main.cpp b/tools/designer/examples/colortool/main.cpp index 7b3be5a5c..8375c5918 100644 --- a/tools/designer/examples/colortool/main.cpp +++ b/tools/designer/examples/colortool/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "mainform.h" int main( int argc, char ** argv ) diff --git a/tools/designer/examples/colortool/mainform.ui b/tools/designer/examples/colortool/mainform.ui index 43c77db51..ce0b50729 100644 --- a/tools/designer/examples/colortool/mainform.ui +++ b/tools/designer/examples/colortool/mainform.ui @@ -520,7 +520,7 @@ tqregexp.h tqfile.h tqfiledialog.h - ntqapplication.h + tqapplication.h tqcolor.h tqstring.h tqpainter.h diff --git a/tools/designer/examples/credit/main.cpp b/tools/designer/examples/credit/main.cpp index a1e06b3ca..43a32ea75 100644 --- a/tools/designer/examples/credit/main.cpp +++ b/tools/designer/examples/credit/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "creditform.h" diff --git a/tools/designer/examples/filechooser/widget/main.cpp b/tools/designer/examples/filechooser/widget/main.cpp index b50ddf7f0..6daadddfc 100644 --- a/tools/designer/examples/filechooser/widget/main.cpp +++ b/tools/designer/examples/filechooser/widget/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "filechooser.h" int main( int argc, char ** argv ) diff --git a/tools/designer/examples/metric/main.cpp b/tools/designer/examples/metric/main.cpp index 00ec8c418..1d555d1f8 100644 --- a/tools/designer/examples/metric/main.cpp +++ b/tools/designer/examples/metric/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "metric.h" int main( int argc, char ** argv ) diff --git a/tools/designer/examples/multiclip/main.cpp b/tools/designer/examples/multiclip/main.cpp index 4b1e93aae..a48753743 100644 --- a/tools/designer/examples/multiclip/main.cpp +++ b/tools/designer/examples/multiclip/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "multiclip.h" diff --git a/tools/designer/examples/multiclip/multiclip.ui b/tools/designer/examples/multiclip/multiclip.ui index 35c2b4e20..d20b07534 100644 --- a/tools/designer/examples/multiclip/multiclip.ui +++ b/tools/designer/examples/multiclip/multiclip.ui @@ -1,7 +1,7 @@ MulticlipForm tqclipboard.h -ntqapplication.h +tqapplication.h multiclip.ui.h TQClipboard *cb; diff --git a/tools/designer/examples/receiver1/main.cpp b/tools/designer/examples/receiver1/main.cpp index 72efaafa0..e8aeb0aec 100644 --- a/tools/designer/examples/receiver1/main.cpp +++ b/tools/designer/examples/receiver1/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "mainform.h" int main( int argc, char *argv[] ) diff --git a/tools/designer/examples/receiver2/main.cpp b/tools/designer/examples/receiver2/main.cpp index 697f7a5f3..5fb03be8e 100644 --- a/tools/designer/examples/receiver2/main.cpp +++ b/tools/designer/examples/receiver2/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "mainform.h" diff --git a/tools/designer/examples/richedit/main.cpp b/tools/designer/examples/richedit/main.cpp index 1a5cb1f83..55f8ed553 100644 --- a/tools/designer/examples/richedit/main.cpp +++ b/tools/designer/examples/richedit/main.cpp @@ -7,7 +7,7 @@ ** *****************************************************************************/ -#include +#include #include "richedit.h" diff --git a/tools/designer/examples/richedit/richedit.ui b/tools/designer/examples/richedit/richedit.ui index 88e829a90..7601adb89 100644 --- a/tools/designer/examples/richedit/richedit.ui +++ b/tools/designer/examples/richedit/richedit.ui @@ -3,7 +3,7 @@ tqfile.h tqfontdatabase.h tqmessagebox.h -ntqapplication.h +tqapplication.h tqfiledialog.h tqtextstream.h richedit.ui.h diff --git a/tools/designer/examples/sizeaware/main.cpp b/tools/designer/examples/sizeaware/main.cpp index 2b0dcf446..11d4e1579 100644 --- a/tools/designer/examples/sizeaware/main.cpp +++ b/tools/designer/examples/sizeaware/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "sizeaware.h" int main( int argc, char ** argv ) diff --git a/tools/designer/examples/vcr/main.cpp b/tools/designer/examples/vcr/main.cpp index 4beb0d1cb..71f04f856 100644 --- a/tools/designer/examples/vcr/main.cpp +++ b/tools/designer/examples/vcr/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include "vcr.h" int main( int argc, char ** argv ) diff --git a/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp b/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp index a7b60eae1..84ec3dd8d 100644 --- a/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp +++ b/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp @@ -36,7 +36,7 @@ #include #include "cppeditor.h" #include -#include +#include #include "completion.h" #include #include diff --git a/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp b/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp index 879e39d1b..3d414d587 100644 --- a/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp +++ b/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp @@ -68,7 +68,7 @@ TQStringList SourceTemplateInterfaceImpl::featureList() const static TQString generateMainCppCode( const TQString &formname, const TQString &include ) { TQString code; - code += "#include \n"; + code += "#include \n"; code += "#include \"" + include + "\"\n"; code += "\n"; code += "int main( int argc, char ** argv )\n"; diff --git a/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp b/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp index 36a116768..2109cdb8b 100644 --- a/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp +++ b/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp @@ -37,7 +37,7 @@ #include "tqstring.h" #include "tqstringlist.h" #include "tqmap.h" -#include "ntqapplication.h" +#include "tqapplication.h" #include "tqregexp.h" const char * const SyntaxHighlighter_CPP::keywords[] = { diff --git a/tools/designer/plugins/dlg/main.cpp b/tools/designer/plugins/dlg/main.cpp index 2aa9cef5a..96bb6d914 100644 --- a/tools/designer/plugins/dlg/main.cpp +++ b/tools/designer/plugins/dlg/main.cpp @@ -33,7 +33,7 @@ **********************************************************************/ #include -#include +#include #include "dlg2ui.h" diff --git a/tools/designer/plugins/glade/glade2ui.cpp b/tools/designer/plugins/glade/glade2ui.cpp index 3ede1321d..67531031c 100644 --- a/tools/designer/plugins/glade/glade2ui.cpp +++ b/tools/designer/plugins/glade/glade2ui.cpp @@ -36,7 +36,7 @@ #include "glade2ui.h" -#include +#include #include #include #include diff --git a/tools/designer/plugins/glade/main.cpp b/tools/designer/plugins/glade/main.cpp index e0df6460f..879493c6c 100644 --- a/tools/designer/plugins/glade/main.cpp +++ b/tools/designer/plugins/glade/main.cpp @@ -33,7 +33,7 @@ **********************************************************************/ #include -#include +#include #include "glade2ui.h" diff --git a/tools/designer/plugins/kdevdlg/main.cpp b/tools/designer/plugins/kdevdlg/main.cpp index af5c08c93..767c90b9b 100644 --- a/tools/designer/plugins/kdevdlg/main.cpp +++ b/tools/designer/plugins/kdevdlg/main.cpp @@ -34,7 +34,7 @@ #include -#include +#include #include #include diff --git a/tools/designer/plugins/rc/main.cpp b/tools/designer/plugins/rc/main.cpp index c43a17264..502c6729e 100644 --- a/tools/designer/plugins/rc/main.cpp +++ b/tools/designer/plugins/rc/main.cpp @@ -34,7 +34,7 @@ #include -#include +#include #include "rc2ui.h" diff --git a/tools/designer/plugins/wizards/main.cpp b/tools/designer/plugins/wizards/main.cpp index b8cda6e1e..1a4bb7b53 100644 --- a/tools/designer/plugins/wizards/main.cpp +++ b/tools/designer/plugins/wizards/main.cpp @@ -39,7 +39,7 @@ #include "sqlformwizardimpl.h" #endif #include "mainwindowwizard.h" -#include +#include class StandardTemplateWizardInterface : public TemplateWizardInterface, public TQLibraryInterface { diff --git a/tools/designer/shared/globaldefs.h b/tools/designer/shared/globaldefs.h index a92e2a46a..d121256d1 100644 --- a/tools/designer/shared/globaldefs.h +++ b/tools/designer/shared/globaldefs.h @@ -35,7 +35,7 @@ #define GLOBALDEFS_H #include -#include +#include #define BOXLAYOUT_DEFAULT_MARGIN 11 #define BOXLAYOUT_DEFAULT_SPACING 6 diff --git a/tools/designer/shared/widgetdatabase.cpp b/tools/designer/shared/widgetdatabase.cpp index e74139ef5..b58e0b578 100644 --- a/tools/designer/shared/widgetdatabase.cpp +++ b/tools/designer/shared/widgetdatabase.cpp @@ -34,7 +34,7 @@ #include "widgetdatabase.h" #include "../interfaces/widgetinterface.h" -#include +#include #define NO_STATIC_COLORS #include #include diff --git a/tools/designer/tools/tqtconv2ui/main.cpp b/tools/designer/tools/tqtconv2ui/main.cpp index 4044e1e4a..82d5a18ab 100644 --- a/tools/designer/tools/tqtconv2ui/main.cpp +++ b/tools/designer/tools/tqtconv2ui/main.cpp @@ -31,7 +31,7 @@ ** **********************************************************************/ -#include +#include #include #include #include diff --git a/tools/designer/tools/tqtcreatecw/main.cpp b/tools/designer/tools/tqtcreatecw/main.cpp index 02633f37d..36dd3c9af 100644 --- a/tools/designer/tools/tqtcreatecw/main.cpp +++ b/tools/designer/tools/tqtcreatecw/main.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include // STEP1: Include header files of the widgets for which a description // should be created here. If you have a widget which is defined in diff --git a/tools/designer/tquic/form.cpp b/tools/designer/tquic/form.cpp index 09b3a6828..dd77d0113 100644 --- a/tools/designer/tquic/form.cpp +++ b/tools/designer/tquic/form.cpp @@ -804,7 +804,7 @@ void TQUic::createFormImpl( const TQDomElement &e ) TQString name = getClassName( nl.item(i).toElement() ); if ( name == "Spacer" ) { globalIncludes += "tqlayout.h"; - globalIncludes += "ntqapplication.h"; + globalIncludes += "tqapplication.h"; continue; } if (( name.mid( 1 ) == "ListView" ) || ( name.mid( 2 ) == "ListView" )) diff --git a/tools/designer/tquic/main.cpp b/tools/designer/tquic/main.cpp index 636ffd432..f9432d050 100644 --- a/tools/designer/tquic/main.cpp +++ b/tools/designer/tquic/main.cpp @@ -36,7 +36,7 @@ #if defined(UIB) #include "ui2uib.h" #endif -#include +#include #include #include #include diff --git a/tools/designer/uilib/test/main.cpp b/tools/designer/uilib/test/main.cpp index 4637cf604..1665f301c 100644 --- a/tools/designer/uilib/test/main.cpp +++ b/tools/designer/uilib/test/main.cpp @@ -31,7 +31,7 @@ ** **********************************************************************/ -#include +#include #include "../tqwidgetfactory.h" int main( int argc, char ** argv ) diff --git a/tools/designer/uilib/tqwidgetfactory.cpp b/tools/designer/uilib/tqwidgetfactory.cpp index a608eeaf8..02ede9a4f 100644 --- a/tools/designer/uilib/tqwidgetfactory.cpp +++ b/tools/designer/uilib/tqwidgetfactory.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/linguist/book/linguist-manager.leaf b/tools/linguist/book/linguist-manager.leaf index 15d2d7367..6c314d09d 100644 --- a/tools/linguist/book/linguist-manager.leaf +++ b/tools/linguist/book/linguist-manager.leaf @@ -50,8 +50,8 @@ An example of a complete \c .pro file with four translation source files: superapp_se.ts \endcode -\index QApplication!defaultCodec() -\index defaultCodec()!QApplication +\index TQApplication!defaultCodec() +\index defaultCodec()!TQApplication \index DEFAULTCODEC!in Project Files \index Chinese Language \index Japanese Language diff --git a/tools/linguist/book/linguist-programmer.leaf b/tools/linguist/book/linguist-programmer.leaf index 51bc028ee..1e5147cf5 100644 --- a/tools/linguist/book/linguist-programmer.leaf +++ b/tools/linguist/book/linguist-programmer.leaf @@ -79,7 +79,7 @@ See the \link lupdate "lupdate" \endlink and \link lrelease \quotefile tt1/main.cpp \skipto main( \printline main( -\printuntil QApplication +\printuntil TQApplication \index main() @@ -87,8 +87,8 @@ This is how a simple \c main() function of a TQt application begins. \index TQTranslator!load() \index load()!TQTranslator -\index QApplication!installTranslator() -\index installTranslator()!QApplication +\index TQApplication!installTranslator() +\index installTranslator()!TQApplication \quotefile tt1/main.cpp \skipto main( @@ -237,11 +237,11 @@ understood as meaning \c MyNamespace::MyClass::tr(). \section2 Translating Text that is Outside of a TQObject subclass -\section3 Using QApplication::translate() +\section3 Using TQApplication::translate() If the quoted text is not in a member function of a TQObject subclass, use either the tr() function of an appropriate class, or the -QApplication::translate() function directly: +TQApplication::translate() function directly: \code void some_global_function( LoginWidget *logwid ) @@ -353,8 +353,8 @@ Tries to load a file called \c tt1_la.qm (the \c .qm file extension is implicit) that contains Latin translations for the source texts used in the program. No error will occur if the file is not found. -\index QApplication!installTranslator() -\index installTranslator()!QApplication +\index TQApplication!installTranslator() +\index installTranslator()!TQApplication \printline installTranslator @@ -593,8 +593,8 @@ which the source text appears. Thus, in this example, "ArrowPad" is a context: it is the context of the texts in the \c ArrowPad class. The \c TQ_OBJECT macro defines \c tr(x) in \c ArrowPad like this -\index QApplication!translate() -\index translate()!QApplication +\index TQApplication!translate() +\index translate()!TQApplication \code tqApp->translate( "ArrowPad", x ) diff --git a/tools/linguist/linguist/main.cpp b/tools/linguist/linguist/main.cpp index 867c8c0fd..1eab3da08 100644 --- a/tools/linguist/linguist/main.cpp +++ b/tools/linguist/linguist/main.cpp @@ -33,7 +33,7 @@ #include "trwindow.h" -#include +#include #include #include #include diff --git a/tools/linguist/linguist/msgedit.cpp b/tools/linguist/linguist/msgedit.cpp index 06689d4ad..8e96586fe 100644 --- a/tools/linguist/linguist/msgedit.cpp +++ b/tools/linguist/linguist/msgedit.cpp @@ -42,7 +42,7 @@ #include "phraselv.h" #include "simtexth.h" -#include +#include #include #include #include diff --git a/tools/linguist/linguist/phrase.cpp b/tools/linguist/linguist/phrase.cpp index 44b380571..c38e9e00a 100644 --- a/tools/linguist/linguist/phrase.cpp +++ b/tools/linguist/linguist/phrase.cpp @@ -33,7 +33,7 @@ #include "phrase.h" -#include +#include #include #include #include diff --git a/tools/linguist/linguist/phrasebookbox.cpp b/tools/linguist/linguist/phrasebookbox.cpp index 093c68daf..7852f9958 100644 --- a/tools/linguist/linguist/phrasebookbox.cpp +++ b/tools/linguist/linguist/phrasebookbox.cpp @@ -40,7 +40,7 @@ #include "phrasebookbox.h" #include "phraselv.h" -#include +#include #include #include #include diff --git a/tools/linguist/linguist/trwindow.cpp b/tools/linguist/linguist/trwindow.cpp index 790695759..7320530d3 100644 --- a/tools/linguist/linguist/trwindow.cpp +++ b/tools/linguist/linguist/trwindow.cpp @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/linguist/shared/metatranslator.cpp b/tools/linguist/shared/metatranslator.cpp index 6c63a9871..27c921bd6 100644 --- a/tools/linguist/shared/metatranslator.cpp +++ b/tools/linguist/shared/metatranslator.cpp @@ -33,7 +33,7 @@ #include "metatranslator.h" -#include +#include #include #include #include diff --git a/tools/linguist/tutorial/tt1/main.cpp b/tools/linguist/tutorial/tt1/main.cpp index 977d18e88..27373bec2 100644 --- a/tools/linguist/tutorial/tt1/main.cpp +++ b/tools/linguist/tutorial/tt1/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include diff --git a/tools/linguist/tutorial/tt2/main.cpp b/tools/linguist/tutorial/tt2/main.cpp index 6aa66d472..f4cbea950 100644 --- a/tools/linguist/tutorial/tt2/main.cpp +++ b/tools/linguist/tutorial/tt2/main.cpp @@ -6,7 +6,7 @@ #include "mainwindow.h" -#include +#include #include #include #include diff --git a/tools/linguist/tutorial/tt2/mainwindow.cpp b/tools/linguist/tutorial/tt2/mainwindow.cpp index bc72c4a27..6edf2f9a3 100644 --- a/tools/linguist/tutorial/tt2/mainwindow.cpp +++ b/tools/linguist/tutorial/tt2/mainwindow.cpp @@ -8,7 +8,7 @@ #include "mainwindow.h" #include -#include +#include #include #include diff --git a/tools/linguist/tutorial/tt3/main.cpp b/tools/linguist/tutorial/tt3/main.cpp index 64cfd2523..141b8c8d1 100644 --- a/tools/linguist/tutorial/tt3/main.cpp +++ b/tools/linguist/tutorial/tt3/main.cpp @@ -6,7 +6,7 @@ #include "mainwindow.h" -#include +#include #include #include #include diff --git a/tools/linguist/tutorial/tt3/mainwindow.cpp b/tools/linguist/tutorial/tt3/mainwindow.cpp index ad3e41cf9..072767ed0 100644 --- a/tools/linguist/tutorial/tt3/mainwindow.cpp +++ b/tools/linguist/tutorial/tt3/mainwindow.cpp @@ -8,7 +8,7 @@ #include "printpanel.h" #include -#include +#include #include #include #include diff --git a/tools/qconfig/LICENSE.GPL b/tools/qconfig/LICENSE.GPL deleted file mode 100644 index 3221c0305..000000000 --- a/tools/qconfig/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tools/qconfig/main.cpp b/tools/qconfig/main.cpp deleted file mode 100644 index e36d639de..000000000 --- a/tools/qconfig/main.cpp +++ /dev/null @@ -1,733 +0,0 @@ -/********************************************************************** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt/Embedded. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for 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. -** -**********************************************************************/ - -#include "main.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(Q_OS_WIN32) -#include -#else -#include -#endif -#include - - -/* XPM */ -static const char * const logo_xpm[] = { -/* width height ncolors chars_per_pixel */ -"50 50 17 1", -/* colors */ -" c #000000", -". c #495808", -"X c #2A3304", -"o c #242B04", -"O c #030401", -"+ c #9EC011", -"@ c #93B310", -"# c #748E0C", -"$ c #A2C511", -"% c #8BA90E", -"& c #99BA10", -"* c #060701", -"= c #181D02", -"- c #212804", -"; c #61770A", -": c #0B0D01", -"/ c None", -/* pixels */ -"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$@;.o=::=o.;@$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$+#X* **X#+$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$#oO* O **o#+$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$&.* OO O*.&$$$$$$$$$$$$$", -"$$$$$$$$$$$$@XOO * OO X&$$$$$$$$$$$$", -"$$$$$$$$$$$@XO OO O **:::OOO OOO X@$$$$$$$$$$$", -"$$$$$$$$$$&XO O-;#@++@%.oOO X&$$$$$$$$$$", -"$$$$$$$$$$.O : *-#+$$$$$$$$+#- : O O*.$$$$$$$$$$", -"$$$$$$$$$#*OO O*.&$$$$$$$$$$$$+.OOOO **#$$$$$$$$$", -"$$$$$$$$+-OO O *;$$$$$$$$$$$&$$$$;* o+$$$$$$$$", -"$$$$$$$$#O* O .+$$$$$$$$$$@X;$$$+.O *#$$$$$$$$", -"$$$$$$$$X* -&$$$$$$$$$$@- :;$$$&- OX$$$$$$$$", -"$$$$$$$@*O *O#$$$$$$$$$$@oOO**;$$$# O*%$$$$$$$", -"$$$$$$$; -+$$$$$$$$$@o O OO ;+$$-O *;$$$$$$$", -"$$$$$$$. ;$$$$$$$$$@-OO OO X&$$;O .$$$$$$$", -"$$$$$$$o *#$$$$$$$$@o O O O-@$$$#O *o$$$$$$$", -"$$$$$$+= *@$$$$$$$@o* OO -@$$$$&: =$$$$$$$", -"$$$$$$+: :+$$$$$$@- *-@$$$$$$: :+$$$$$$", -"$$$$$$+: :+$$$$$@o* O *-@$$$$$$: :+$$$$$$", -"$$$$$$$= :@$$$$@o*OOO -@$$$$@: =+$$$$$$", -"$$$$$$$- O%$$$@o* O O O O-@$$$#* OX$$$$$$$", -"$$$$$$$. O *O;$$&o O*O* *O -@$$; O.$$$$$$$", -"$$$$$$$;* Oo+$$;O*O:OO-- Oo@+= *;$$$$$$$", -"$$$$$$$@* O O#$$$;*OOOo@@-O Oo;O* **@$$$$$$$", -"$$$$$$$$X* OOO-+$$$;O o@$$@- O O OX$$$$$$$$", -"$$$$$$$$#* * O.$$$$;X@$$$$@-O O O#$$$$$$$$", -"$$$$$$$$+oO O OO.+$$+&$$$$$$@-O o+$$$$$$$$", -"$$$$$$$$$#* **.&$$$$$$$$$$@o OO:#$$$$$$$$$", -"$$$$$$$$$+. O* O-#+$$$$$$$$+;O OOO:@$$$$$$$$$", -"$$$$$$$$$$&X *O -;#@++@#;=O O -@$$$$$$$$", -"$$$$$$$$$$$&X O O*O::::O OO Oo@$$$$$$$", -"$$$$$$$$$$$$@XOO OO O*X+$$$$$$", -"$$$$$$$$$$$$$&.* ** O :: *:#$$$$$$$", -"$$$$$$$$$$$$$$$#o*OO O Oo#@-OOO=#$$$$$$$$", -"$$$$$$$$$$$$$$$$+#X:* * O**X#+$$@-*:#$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$%;.o=::=o.#@$$$$$$@X#$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$+$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", -"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/", -}; - - -#define FIXED_LAYOUT - -static const char*back_xpm[]={ -"16 16 5 1", -"# c #000000", -"a c #ffffff", -"c c #808080", -"b c #c0c0c0", -". c None", -"................", -".......#........", -"......##........", -".....#a#........", -"....#aa########.", -"...#aabaaaaaaa#.", -"..#aabbbbbbbbb#.", -"...#abbbbbbbbb#.", -"...c#ab########.", -"....c#a#ccccccc.", -".....c##c.......", -"......c#c.......", -".......cc.......", -"........c.......", -"................", -"......................"}; - -static const char*forward_xpm[]={ -"16 16 5 1", -"# c #000000", -"a c #ffffff", -"c c #808080", -"b c #c0c0c0", -". c None", -"................", -"................", -".........#......", -".........##.....", -".........#a#....", -"..########aa#...", -"..#aaaaaaabaa#..", -"..#bbbbbbbbbaa#.", -"..#bbbbbbbbba#..", -"..########ba#c..", -"..ccccccc#a#c...", -"........c##c....", -"........c#c.....", -"........cc......", -"........c.......", -"................", -"................"}; - -class ChoiceItem : public TQCheckListItem { -public: - TQString id; - ChoiceItem(const TQString& i, TQListViewItem* parent) : - TQCheckListItem(parent, - i.mid(6), // strip "TQT_NO_" as we reverse the logic - CheckBox), - id(i) - { - setOpen(TRUE); - label = text(0); - avl = TRUE; - } - - // We reverse the logic - void setDefined(bool y) { setOn(!y); } - bool isDefined() const { return !isOn(); } - - void setAvailable(bool y) - { - if ( avl != y ) { - avl = y; - repaint(); - } - } - bool isAvailable() const { return avl; } - - virtual void setOn(bool y) - { - TQCheckListItem::setOn(y); - setOpen(y); -/* - for (TQListViewItem* i=firstChild(); i; i = i->nextSibling() ) { - ChoiceItem* ci = (ChoiceItem*)i; // all are ChoiceItem - if ( ci->isSelectable() != y ) { - ci->setSelectable(y); - listView()->repaintItem(ci); - } - } -*/ - } - - void paintBranches( TQPainter * p, const TQColorGroup & cg, - int w, int y, int h) - { - TQListViewItem::paintBranches(p,cg,w,y,h); - } - - void paintCell( TQPainter * p, const TQColorGroup & cg, - int column, int width, int align ) - { - if ( !isSelectable() || !isAvailable() ) { - TQColorGroup c = cg; - c.setColor(TQColorGroup::Text, lightGray); - TQCheckListItem::paintCell(p,c,column,width,align); - } else { - TQCheckListItem::paintCell(p,cg,column,width,align); - } - } - - void setInfo(const TQString& l, const TQString& d) - { - label = l; - doc = d; - setText(0,label); - } - - TQString label; - - TQString info() const - { - return "

      "+label+"

      "+doc; - } - -private: - TQString doc; - bool avl; -}; - -Main::Main() -{ - setIcon( (const char**)logo_xpm ); -#ifdef FIXED_LAYOUT - TQHBox* horizontal = new TQHBox(this); -#else - TQSplitter* horizontal = new TQSplitter(this); -#endif - - lv = new TQListView(horizontal); - lv->setSorting(-1); - lv->setRootIsDecorated(TRUE); - lv->addColumn("ID"); - - info = new Info(horizontal); - info->setBackgroundMode(PaletteBase); - info->setMargin(10); - info->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken); - info->setAlignment(AlignTop); - - connect(info, TQ_SIGNAL(idClicked(const TQString&)), - this, TQ_SLOT(selectId(const TQString&))); - -#ifdef FIXED_LAYOUT - horizontal->setStretchFactor(info,2); -#endif - - connect(lv, TQ_SIGNAL(pressed(TQListViewItem*)), - this, TQ_SLOT(updateAvailability(TQListViewItem*))); - connect(lv, TQ_SIGNAL(selectionChanged(TQListViewItem*)), - this, TQ_SLOT(showInfo(TQListViewItem*))); - - setCentralWidget(horizontal); - - TQToolBar* tb = new TQToolBar( this, "browser controls" ); - tb->setLabel( "Browser Controls" ); - (void)new TQToolButton( TQPixmap(back_xpm), "Back", TQString::null, - info, TQ_SLOT(back()), tb, "back" ); - (void)new TQToolButton( TQPixmap(forward_xpm), "Forward", TQString::null, - info, TQ_SLOT(forward()), tb, "forward" ); - - TQPopupMenu* file = new TQPopupMenu( menuBar() ); - file->insertItem( "&Open", this, TQ_SLOT(open()), CTRL+Key_O ); - file->insertItem( "&Save", this, TQ_SLOT(save()), CTRL+Key_S ); - file->insertSeparator(); - file->insertItem( "&Test all", this, TQ_SLOT(testAll()), CTRL+Key_T ); - file->insertSeparator(); - file->insertItem( "E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q ); - - menuBar()->insertItem( "&File",file ); - - menuBar()->insertSeparator(); - - TQPopupMenu *help = new TQPopupMenu( menuBar() ); - help->insertItem( "&About", this, TQ_SLOT(about()) ); - help->insertItem( "About &TQt", this, TQ_SLOT(aboutTQt()) ); - - menuBar()->insertItem( "&Help", help ); - - statusBar()->message( "Ready" ); -} - -void Main::open() -{ -} - -void Main::save() -{ -} - -void Main::testAll() -{ - TQString qtdir = getenv("TQTDIR"); - chdir((qtdir+"/src").ascii()); - TQString c; - for (TQStringList::ConstIterator it = choices.begin(); it != choices.end(); ++it) - { - c += "Feature: "; - c += *it; - c += "\n"; - - c += "Section: "; - c += section[*it]; - c += "\n"; - - c += "Requires: "; - c += dependencies[*it].join(" "); - c += "\n"; - - c += "Name: "; - c += label[*it]; - c += "\n"; - - c += "SeeAlso: ???\n"; - - c += "\n"; - } - TQFile f("features.txt"); - f.open(IO_WriteOnly); - f.writeBlock(c.ascii(),c.length()); - f.close(); - // system("./feature_size_calculator"); - -#if 0 - system("mv ../include/ntqconfig.h ../include/ntqconfig.h-orig"); - for (TQStringList::ConstIterator it = choices.begin(); it != choices.end(); ++it) - { - TQString choice = *it; - TQFile f("../include/ntqconfig.h"); - f.open(IO_WriteOnly); - TQCString s = "#define "; - s += choice.latin1(); - s += "\n"; - f.writeBlock(s,s.length()); - f.close(); - int err = system("make"); - if ( err != 0 ) - break; - } - system("mv ../include/ntqconfig.h-orig ../include/ntqconfig.h"); -#endif -} - - -// ##### should be in TQMap? -template -TQValueList keys(TQMap map) -{ - TQValueList result; - for (TQ_TYPENAME TQMap::ConstIterator it = map.begin(); it!=map.end(); ++it) - result.append(it.key()); - return result; -} - -void Main::loadFeatures(const TQString& filename) -{ - TQFile file(filename); - if ( !file.open(IO_ReadOnly) ) { - TQMessageBox::warning(this,"Warning", - "Cannot open file " + filename); - return; - } - TQTextStream s(&file); - TQRegExp qt_no_xxx("TQT_NO_[A-Z_0-9]*"); - TQStringList sections; - -#if 1 - TQString line = s.readLine(); - TQString feature, lab, sec; - TQStringList deps, seealso; - TQMap sectioncontents; - while (!s.atEnd()) { - if ( line.length() <= 1 ) { - if ( !feature.isEmpty() ) { - dependencies[feature] = deps; - for (TQStringList::ConstIterator it = deps.begin(); it!=deps.end(); ++it) - rdependencies[*it].append(feature); - label[feature] = lab; - links[feature] = seealso; - section[feature] = sec; - sectioncontents[sec].append(feature); - choices.append(feature); - } else { - tqDebug("Unparsed text"); - } - - feature = lab = sec = TQString::null; - deps.clear(); seealso.clear(); - line = s.readLine(); - continue; - } - - TQString nextline = s.readLine(); - while ( nextline[0] == ' ' ) { - line += nextline; - nextline = s.readLine(); - } - - int colon = line.find(':'); - if ( colon < 0 ) { - tqDebug("Cannot parse: %s",line.ascii()); - } else { - TQString tag = line.left(colon); - TQString value = line.mid(colon+1).stripWhiteSpace(); - if ( tag == "Feature" ) - feature = value; - else if ( tag == "Requires" ) - deps = TQStringList::split(TQChar(' '),value); - else if ( tag == "Name" ) - lab = value; - else if ( tag == "Section" ) - sec = value; - else if ( tag == "SeeAlso" ) - seealso = TQStringList::split(TQChar(' '),value); - } - - line = nextline; - } - sections = keys(sectioncontents); - -#else - TQString sec; - TQString lab; - TQString doc; - bool on = FALSE; - bool docmode = FALSE; - TQStringList deps; - - do { - TQString line = s.readLine(); - line.replace(TQRegExp("# *define"),"#define"); - - TQStringList token = TQStringList::split(TQChar(' '),line); - if ( on ) { - if ( docmode ) { - if ( token[0] == "*/" ) - docmode = FALSE; - else if ( lab.isEmpty() ) - lab = line.stripWhiteSpace(); - else - doc += line.simplifyWhiteSpace() + "\n"; - } else if ( token[0] == "//#define" || token[0] == "#define" ) { - dependencies[token[1]] = deps; - for (TQStringList::ConstIterator it = deps.begin(); it!=deps.end(); ++it) - rdependencies[*it].append(token[1]); - section[token[1]] = sec; - documentation[token[1]] = doc; - label[token[1]] = lab; - choices.append(token[1]); - doc = ""; - lab = ""; - } else if ( token[0] == "/*!" ) { - docmode = TRUE; - } else if ( token[0] == "//" ) { - token.remove(token.begin()); - sec = token.join(" "); - sections.append(sec); - } else if ( token[0] == "#if" ) { - Q_ASSERT(deps.isEmpty()); - for (int i=1; i<(int)token.count(); i++) { - if ( token[i][0] == 'd' ) { - int index; - int len; - index = qt_no_xxx.match(token[i],0,&len); - if ( index >= 0 ) { - TQString d = token[i].mid(index,len); - deps.append(d); - } - } - } - } else if ( token[0] == "#endif" ) { - deps.clear(); - } else if ( token[0].isEmpty() ) { - } else { - tqDebug("Cannot parse: %s",token.join(" ").ascii()); - } - } else if ( token[0] == "#include" ) { - on = TRUE; - } - } while (!s.atEnd()); -#endif - - lv->clear(); - sections.sort(); - // ##### TQListView default sort order is reverse of insertion order - for (TQStringList::Iterator se = sections.fromLast(); se != sections.end(); --se) { - sectionitem[*se] = new TQListViewItem(lv,*se); - } - for (TQStringList::Iterator ch = choices.begin(); ch != choices.end(); ++ch) { - createItem(*ch); - } - -#ifdef FIXED_LAYOUT - lv->setFixedWidth(lv->sizeHint().width()); -#endif -} - -void Main::createItem(const TQString& ch) -{ - if ( !item[ch] ) { - TQStringList deps = dependencies[ch]; - TQString sec = section[ch]; - TQListViewItem* parent = 0; - for (TQStringList::Iterator dp = deps.begin(); dp != deps.end(); ++dp) { - TQString dsec = section[*dp]; - if ( dsec.isEmpty() ) - tqDebug("No section for %s",(*dp).latin1()); - if ( !parent && dsec == sec ) { - createItem(*dp); - parent = item[*dp]; - } - } - if ( !parent ) - parent = sectionitem[section[ch]]; - ChoiceItem* ci = new ChoiceItem(ch,parent); - item[ch] = ci; - if ( !label[ch].isEmpty() ) - ci->setInfo(label[ch],documentation[ch]); - } -} - -void Main::loadConfig(const TQString& filename) -{ - TQFile file(filename); - if ( !file.open(IO_ReadOnly) ) { - TQMessageBox::warning(this,"Warning", - "Cannot open file " + filename); - return; - } - TQTextStream s(&file); - TQRegExp qt_no_xxx("TQT_NO_[A-Z_0-9]*"); - - for (TQStringList::Iterator ch = choices.begin(); ch != choices.end(); ++ch) { - item[*ch]->setDefined(FALSE); - } - do { - TQString line = s.readLine(); - TQStringList token = TQStringList::split(TQChar(' '),line); - if ( token[0] == "#define" ) { - ChoiceItem* i = item[token[1]]; - if ( i ) - i->setDefined(TRUE); - else - tqDebug("The item %s is not used by tqfeatures.h", token[1].latin1()); - } - } while (!s.atEnd()); -} - -void Main::updateAvailability(TQListViewItem* i) -{ - if ( !i || !i->parent() ) { - // section. do nothing for now - } else { - ChoiceItem* choice = (ChoiceItem*)i; - TQStringList deps = rdependencies[choice->id]; - for (TQStringList::ConstIterator it = deps.begin(); - it != deps.end(); ++it) - { - ChoiceItem* d = item[*it]; - TQStringList ddeps = dependencies[d->id]; - bool av = TRUE; - for (TQStringList::ConstIterator dit = ddeps.begin(); - av && dit != ddeps.end(); ++dit) - { - ChoiceItem* dd = item[*dit]; - if ( dd ) { - if ( dd->isDefined() || !dd->isAvailable() ) - av = FALSE; - } else - tqDebug("%s ???",(*dit).latin1()); - } - if ( d->isAvailable() != av ) { - d->setAvailable(av); - updateAvailability(d); - } - } -tqDebug("%s: %d",choice->id.latin1(),choice->isAvailable()); - } -} - -void Main::showInfo(TQListViewItem* i) -{ - if ( !i ) - return; - if ( !i->parent() ) { - // section. do nothing for now - } else { - ChoiceItem* choice = (ChoiceItem*)i; - TQString i = choice->info(); - TQStringList deps = dependencies[choice->id]; - if ( !deps.isEmpty() ) { - i += "

      Requires:

        "; - for (TQStringList::ConstIterator it = deps.begin(); - it != deps.end(); ++it) - { - ChoiceItem* d = item[*it]; - if ( d ) { - bool got = d->isAvailable() && !d->isDefined(); - i += "
      • "; - if ( !got ) i += ""; - i += "id+">"+d->label+""; - if ( !got ) i += ""; - } - } - i += "
      "; - } - TQStringList rdeps = rdependencies[choice->id]; - if ( !rdeps.isEmpty() ) { - i += "

      Required for:

        "; - for (TQStringList::ConstIterator it = rdeps.begin(); - it != rdeps.end(); ++it) - { - ChoiceItem* d = item[*it]; - if ( d ) - i += "
      • id+">"+d->label+""; - } - i += "
      "; - } - info->setText(i); - } -} - -void Main::selectId(const TQString& id) -{ - TQListViewItem* it = item[id]; - if ( it ) { - lv->setSelected(it,TRUE); - lv->ensureItemVisible(it); - } -} - -Info::Info( TQWidget* parent, const char* name ) : - TQTextBrowser(parent, name) -{ -} - -void Info::setSource(const TQString& name) -{ - if ( name.left(5) == "id://" ) { - emit idClicked(name.mid(5,name.length()-6)); // skip trailing "/" too - } else { - TQTextBrowser::setSource(name); - } -} - -void Main::about() -{ - TQMessageBox::about(this, "About qconfig", - "

      TQt/Embedded build configuration

      " - "

      " - "

      Version 1.0

      " - "

      Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.

      " - "

      " - "

      This program is licensed to you under the terms of the GNU General " - "Public License Version 2 as published by the Free Software Foundation. This " - "gives you legal permission to copy, distribute and/or modify this software " - "under certain conditions. For details, see the file 'LICENSE.GPL' that came with " - "this software distribution. If you did not get the file, send email to " - "info@trolltech.com.

      \n\n

      The program is provided AS IS with NO WARRANTY " - "OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS " - "FOR A PARTICULAR PURPOSE.

      " - ); -} - -void Main::aboutTQt() -{ - TQMessageBox::aboutTQt( this, tr("qconfig") ); -} - -int main(int argc, char** argv) -{ - TQApplication app(argc,argv); - Main m; - TQString qtdir = getenv("TQTDIR"); - TQString tqfeatures = qtdir + "/src/tools/tqfeatures.txt"; - //TQString tqfeatures = qtdir + "/include/tqfeatures.h"; - TQString qconfig = qtdir + "/include/ntqconfig.h"; - for (int i=1; i -#include -#include -#include - -class ChoiceItem; -class TQListViewItem; -class TQListView; -class TQLabel; - -class Info : public TQTextBrowser { - TQ_OBJECT -public: - Info( TQWidget* parent, const char* name=0 ); - -signals: - void idClicked(const TQString& name); - -public slots: - void setSource(const TQString& name); -}; - -class Main : public TQMainWindow { - TQ_OBJECT -public: - Main(); - void loadFeatures(const TQString& filename); - void loadConfig(const TQString& filename); - -private: - void createItem(const TQString& ch); - TQMap label; - TQMap documentation; - TQMap links; - TQMap dependencies; - TQMap rdependencies; - TQMap section; - TQMap item; - TQMap sectionitem; - TQStringList choices; - TQListView* lv; - TQTextBrowser* info; - -private slots: - void updateAvailability(TQListViewItem* i); - void showInfo(TQListViewItem* i); - void selectId(const TQString&); - void open(); - void save(); - void testAll(); - void about(); - void aboutTQt(); -}; diff --git a/tools/qconfig/qconfig.pro b/tools/qconfig/qconfig.pro deleted file mode 100644 index bc0527329..000000000 --- a/tools/qconfig/qconfig.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -CONFIG += qt warn_on release -HEADERS = main.h -SOURCES = main.cpp -INTERFACES = -TARGET = qconfig -REQUIRES=full-config nocrosscompiler diff --git a/tools/qtconfig/colorbutton.cpp b/tools/qtconfig/colorbutton.cpp index 474e650eb..1d47d9be8 100644 --- a/tools/qtconfig/colorbutton.cpp +++ b/tools/qtconfig/colorbutton.cpp @@ -33,7 +33,7 @@ #include "colorbutton.h" -#include +#include #include #include #include diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp index 0e82f9940..ef8bbb546 100644 --- a/tools/qtconfig/main.cpp +++ b/tools/qtconfig/main.cpp @@ -32,7 +32,7 @@ **********************************************************************/ #include "mainwindow.h" -#include +#include int main(int argc, char **argv) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index a3d0a14f8..2e5bff115 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -37,7 +37,7 @@ #include "paletteeditoradvanced.h" #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ #include -// from qapplication.cpp and qapplication_x11.cpp - These are NOT for +// from tqapplication.cpp and tqapplication_x11.cpp - These are NOT for // external use ignore them extern bool TQ_EXPORT tqt_resolve_symlinks; diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index 6bc3e49bc..f3c47faaf 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include diff --git a/tools/tools.pro b/tools/tools.pro index 0f9c05cc1..265d01eb0 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -8,7 +8,7 @@ no-png { linguist unix:SUBDIRS += qtconfig \ tqtmergetr \ - qconfig \ + tqconfig \ msg2tqm \ qembed } diff --git a/tools/tqconfig/LICENSE.GPL b/tools/tqconfig/LICENSE.GPL new file mode 100644 index 000000000..3221c0305 --- /dev/null +++ b/tools/tqconfig/LICENSE.GPL @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/tools/tqconfig/main.cpp b/tools/tqconfig/main.cpp new file mode 100644 index 000000000..f1407e4a1 --- /dev/null +++ b/tools/tqconfig/main.cpp @@ -0,0 +1,733 @@ +/********************************************************************** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of TQt/Embedded. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for 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. +** +**********************************************************************/ + +#include "main.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(Q_OS_WIN32) +#include +#else +#include +#endif +#include + + +/* XPM */ +static const char * const logo_xpm[] = { +/* width height ncolors chars_per_pixel */ +"50 50 17 1", +/* colors */ +" c #000000", +". c #495808", +"X c #2A3304", +"o c #242B04", +"O c #030401", +"+ c #9EC011", +"@ c #93B310", +"# c #748E0C", +"$ c #A2C511", +"% c #8BA90E", +"& c #99BA10", +"* c #060701", +"= c #181D02", +"- c #212804", +"; c #61770A", +": c #0B0D01", +"/ c None", +/* pixels */ +"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$@;.o=::=o.;@$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$+#X* **X#+$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$#oO* O **o#+$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$&.* OO O*.&$$$$$$$$$$$$$", +"$$$$$$$$$$$$@XOO * OO X&$$$$$$$$$$$$", +"$$$$$$$$$$$@XO OO O **:::OOO OOO X@$$$$$$$$$$$", +"$$$$$$$$$$&XO O-;#@++@%.oOO X&$$$$$$$$$$", +"$$$$$$$$$$.O : *-#+$$$$$$$$+#- : O O*.$$$$$$$$$$", +"$$$$$$$$$#*OO O*.&$$$$$$$$$$$$+.OOOO **#$$$$$$$$$", +"$$$$$$$$+-OO O *;$$$$$$$$$$$&$$$$;* o+$$$$$$$$", +"$$$$$$$$#O* O .+$$$$$$$$$$@X;$$$+.O *#$$$$$$$$", +"$$$$$$$$X* -&$$$$$$$$$$@- :;$$$&- OX$$$$$$$$", +"$$$$$$$@*O *O#$$$$$$$$$$@oOO**;$$$# O*%$$$$$$$", +"$$$$$$$; -+$$$$$$$$$@o O OO ;+$$-O *;$$$$$$$", +"$$$$$$$. ;$$$$$$$$$@-OO OO X&$$;O .$$$$$$$", +"$$$$$$$o *#$$$$$$$$@o O O O-@$$$#O *o$$$$$$$", +"$$$$$$+= *@$$$$$$$@o* OO -@$$$$&: =$$$$$$$", +"$$$$$$+: :+$$$$$$@- *-@$$$$$$: :+$$$$$$", +"$$$$$$+: :+$$$$$@o* O *-@$$$$$$: :+$$$$$$", +"$$$$$$$= :@$$$$@o*OOO -@$$$$@: =+$$$$$$", +"$$$$$$$- O%$$$@o* O O O O-@$$$#* OX$$$$$$$", +"$$$$$$$. O *O;$$&o O*O* *O -@$$; O.$$$$$$$", +"$$$$$$$;* Oo+$$;O*O:OO-- Oo@+= *;$$$$$$$", +"$$$$$$$@* O O#$$$;*OOOo@@-O Oo;O* **@$$$$$$$", +"$$$$$$$$X* OOO-+$$$;O o@$$@- O O OX$$$$$$$$", +"$$$$$$$$#* * O.$$$$;X@$$$$@-O O O#$$$$$$$$", +"$$$$$$$$+oO O OO.+$$+&$$$$$$@-O o+$$$$$$$$", +"$$$$$$$$$#* **.&$$$$$$$$$$@o OO:#$$$$$$$$$", +"$$$$$$$$$+. O* O-#+$$$$$$$$+;O OOO:@$$$$$$$$$", +"$$$$$$$$$$&X *O -;#@++@#;=O O -@$$$$$$$$", +"$$$$$$$$$$$&X O O*O::::O OO Oo@$$$$$$$", +"$$$$$$$$$$$$@XOO OO O*X+$$$$$$", +"$$$$$$$$$$$$$&.* ** O :: *:#$$$$$$$", +"$$$$$$$$$$$$$$$#o*OO O Oo#@-OOO=#$$$$$$$$", +"$$$$$$$$$$$$$$$$+#X:* * O**X#+$$@-*:#$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$%;.o=::=o.#@$$$$$$@X#$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$+$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", +"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/", +}; + + +#define FIXED_LAYOUT + +static const char*back_xpm[]={ +"16 16 5 1", +"# c #000000", +"a c #ffffff", +"c c #808080", +"b c #c0c0c0", +". c None", +"................", +".......#........", +"......##........", +".....#a#........", +"....#aa########.", +"...#aabaaaaaaa#.", +"..#aabbbbbbbbb#.", +"...#abbbbbbbbb#.", +"...c#ab########.", +"....c#a#ccccccc.", +".....c##c.......", +"......c#c.......", +".......cc.......", +"........c.......", +"................", +"......................"}; + +static const char*forward_xpm[]={ +"16 16 5 1", +"# c #000000", +"a c #ffffff", +"c c #808080", +"b c #c0c0c0", +". c None", +"................", +"................", +".........#......", +".........##.....", +".........#a#....", +"..########aa#...", +"..#aaaaaaabaa#..", +"..#bbbbbbbbbaa#.", +"..#bbbbbbbbba#..", +"..########ba#c..", +"..ccccccc#a#c...", +"........c##c....", +"........c#c.....", +"........cc......", +"........c.......", +"................", +"................"}; + +class ChoiceItem : public TQCheckListItem { +public: + TQString id; + ChoiceItem(const TQString& i, TQListViewItem* parent) : + TQCheckListItem(parent, + i.mid(6), // strip "TQT_NO_" as we reverse the logic + CheckBox), + id(i) + { + setOpen(TRUE); + label = text(0); + avl = TRUE; + } + + // We reverse the logic + void setDefined(bool y) { setOn(!y); } + bool isDefined() const { return !isOn(); } + + void setAvailable(bool y) + { + if ( avl != y ) { + avl = y; + repaint(); + } + } + bool isAvailable() const { return avl; } + + virtual void setOn(bool y) + { + TQCheckListItem::setOn(y); + setOpen(y); +/* + for (TQListViewItem* i=firstChild(); i; i = i->nextSibling() ) { + ChoiceItem* ci = (ChoiceItem*)i; // all are ChoiceItem + if ( ci->isSelectable() != y ) { + ci->setSelectable(y); + listView()->repaintItem(ci); + } + } +*/ + } + + void paintBranches( TQPainter * p, const TQColorGroup & cg, + int w, int y, int h) + { + TQListViewItem::paintBranches(p,cg,w,y,h); + } + + void paintCell( TQPainter * p, const TQColorGroup & cg, + int column, int width, int align ) + { + if ( !isSelectable() || !isAvailable() ) { + TQColorGroup c = cg; + c.setColor(TQColorGroup::Text, lightGray); + TQCheckListItem::paintCell(p,c,column,width,align); + } else { + TQCheckListItem::paintCell(p,cg,column,width,align); + } + } + + void setInfo(const TQString& l, const TQString& d) + { + label = l; + doc = d; + setText(0,label); + } + + TQString label; + + TQString info() const + { + return "

      "+label+"

      "+doc; + } + +private: + TQString doc; + bool avl; +}; + +Main::Main() +{ + setIcon( (const char**)logo_xpm ); +#ifdef FIXED_LAYOUT + TQHBox* horizontal = new TQHBox(this); +#else + TQSplitter* horizontal = new TQSplitter(this); +#endif + + lv = new TQListView(horizontal); + lv->setSorting(-1); + lv->setRootIsDecorated(TRUE); + lv->addColumn("ID"); + + info = new Info(horizontal); + info->setBackgroundMode(PaletteBase); + info->setMargin(10); + info->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken); + info->setAlignment(AlignTop); + + connect(info, TQ_SIGNAL(idClicked(const TQString&)), + this, TQ_SLOT(selectId(const TQString&))); + +#ifdef FIXED_LAYOUT + horizontal->setStretchFactor(info,2); +#endif + + connect(lv, TQ_SIGNAL(pressed(TQListViewItem*)), + this, TQ_SLOT(updateAvailability(TQListViewItem*))); + connect(lv, TQ_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQ_SLOT(showInfo(TQListViewItem*))); + + setCentralWidget(horizontal); + + TQToolBar* tb = new TQToolBar( this, "browser controls" ); + tb->setLabel( "Browser Controls" ); + (void)new TQToolButton( TQPixmap(back_xpm), "Back", TQString::null, + info, TQ_SLOT(back()), tb, "back" ); + (void)new TQToolButton( TQPixmap(forward_xpm), "Forward", TQString::null, + info, TQ_SLOT(forward()), tb, "forward" ); + + TQPopupMenu* file = new TQPopupMenu( menuBar() ); + file->insertItem( "&Open", this, TQ_SLOT(open()), CTRL+Key_O ); + file->insertItem( "&Save", this, TQ_SLOT(save()), CTRL+Key_S ); + file->insertSeparator(); + file->insertItem( "&Test all", this, TQ_SLOT(testAll()), CTRL+Key_T ); + file->insertSeparator(); + file->insertItem( "E&xit", tqApp, TQ_SLOT(quit()), CTRL+Key_Q ); + + menuBar()->insertItem( "&File",file ); + + menuBar()->insertSeparator(); + + TQPopupMenu *help = new TQPopupMenu( menuBar() ); + help->insertItem( "&About", this, TQ_SLOT(about()) ); + help->insertItem( "About &TQt", this, TQ_SLOT(aboutTQt()) ); + + menuBar()->insertItem( "&Help", help ); + + statusBar()->message( "Ready" ); +} + +void Main::open() +{ +} + +void Main::save() +{ +} + +void Main::testAll() +{ + TQString qtdir = getenv("TQTDIR"); + chdir((qtdir+"/src").ascii()); + TQString c; + for (TQStringList::ConstIterator it = choices.begin(); it != choices.end(); ++it) + { + c += "Feature: "; + c += *it; + c += "\n"; + + c += "Section: "; + c += section[*it]; + c += "\n"; + + c += "Requires: "; + c += dependencies[*it].join(" "); + c += "\n"; + + c += "Name: "; + c += label[*it]; + c += "\n"; + + c += "SeeAlso: ???\n"; + + c += "\n"; + } + TQFile f("features.txt"); + f.open(IO_WriteOnly); + f.writeBlock(c.ascii(),c.length()); + f.close(); + // system("./feature_size_calculator"); + +#if 0 + system("mv ../include/tqconfig.h ../include/tqconfig.h-orig"); + for (TQStringList::ConstIterator it = choices.begin(); it != choices.end(); ++it) + { + TQString choice = *it; + TQFile f("../include/tqconfig.h"); + f.open(IO_WriteOnly); + TQCString s = "#define "; + s += choice.latin1(); + s += "\n"; + f.writeBlock(s,s.length()); + f.close(); + int err = system("make"); + if ( err != 0 ) + break; + } + system("mv ../include/tqconfig.h-orig ../include/tqconfig.h"); +#endif +} + + +// ##### should be in TQMap? +template +TQValueList keys(TQMap map) +{ + TQValueList result; + for (TQ_TYPENAME TQMap::ConstIterator it = map.begin(); it!=map.end(); ++it) + result.append(it.key()); + return result; +} + +void Main::loadFeatures(const TQString& filename) +{ + TQFile file(filename); + if ( !file.open(IO_ReadOnly) ) { + TQMessageBox::warning(this,"Warning", + "Cannot open file " + filename); + return; + } + TQTextStream s(&file); + TQRegExp qt_no_xxx("TQT_NO_[A-Z_0-9]*"); + TQStringList sections; + +#if 1 + TQString line = s.readLine(); + TQString feature, lab, sec; + TQStringList deps, seealso; + TQMap sectioncontents; + while (!s.atEnd()) { + if ( line.length() <= 1 ) { + if ( !feature.isEmpty() ) { + dependencies[feature] = deps; + for (TQStringList::ConstIterator it = deps.begin(); it!=deps.end(); ++it) + rdependencies[*it].append(feature); + label[feature] = lab; + links[feature] = seealso; + section[feature] = sec; + sectioncontents[sec].append(feature); + choices.append(feature); + } else { + tqDebug("Unparsed text"); + } + + feature = lab = sec = TQString::null; + deps.clear(); seealso.clear(); + line = s.readLine(); + continue; + } + + TQString nextline = s.readLine(); + while ( nextline[0] == ' ' ) { + line += nextline; + nextline = s.readLine(); + } + + int colon = line.find(':'); + if ( colon < 0 ) { + tqDebug("Cannot parse: %s",line.ascii()); + } else { + TQString tag = line.left(colon); + TQString value = line.mid(colon+1).stripWhiteSpace(); + if ( tag == "Feature" ) + feature = value; + else if ( tag == "Requires" ) + deps = TQStringList::split(TQChar(' '),value); + else if ( tag == "Name" ) + lab = value; + else if ( tag == "Section" ) + sec = value; + else if ( tag == "SeeAlso" ) + seealso = TQStringList::split(TQChar(' '),value); + } + + line = nextline; + } + sections = keys(sectioncontents); + +#else + TQString sec; + TQString lab; + TQString doc; + bool on = FALSE; + bool docmode = FALSE; + TQStringList deps; + + do { + TQString line = s.readLine(); + line.replace(TQRegExp("# *define"),"#define"); + + TQStringList token = TQStringList::split(TQChar(' '),line); + if ( on ) { + if ( docmode ) { + if ( token[0] == "*/" ) + docmode = FALSE; + else if ( lab.isEmpty() ) + lab = line.stripWhiteSpace(); + else + doc += line.simplifyWhiteSpace() + "\n"; + } else if ( token[0] == "//#define" || token[0] == "#define" ) { + dependencies[token[1]] = deps; + for (TQStringList::ConstIterator it = deps.begin(); it!=deps.end(); ++it) + rdependencies[*it].append(token[1]); + section[token[1]] = sec; + documentation[token[1]] = doc; + label[token[1]] = lab; + choices.append(token[1]); + doc = ""; + lab = ""; + } else if ( token[0] == "/*!" ) { + docmode = TRUE; + } else if ( token[0] == "//" ) { + token.remove(token.begin()); + sec = token.join(" "); + sections.append(sec); + } else if ( token[0] == "#if" ) { + Q_ASSERT(deps.isEmpty()); + for (int i=1; i<(int)token.count(); i++) { + if ( token[i][0] == 'd' ) { + int index; + int len; + index = qt_no_xxx.match(token[i],0,&len); + if ( index >= 0 ) { + TQString d = token[i].mid(index,len); + deps.append(d); + } + } + } + } else if ( token[0] == "#endif" ) { + deps.clear(); + } else if ( token[0].isEmpty() ) { + } else { + tqDebug("Cannot parse: %s",token.join(" ").ascii()); + } + } else if ( token[0] == "#include" ) { + on = TRUE; + } + } while (!s.atEnd()); +#endif + + lv->clear(); + sections.sort(); + // ##### TQListView default sort order is reverse of insertion order + for (TQStringList::Iterator se = sections.fromLast(); se != sections.end(); --se) { + sectionitem[*se] = new TQListViewItem(lv,*se); + } + for (TQStringList::Iterator ch = choices.begin(); ch != choices.end(); ++ch) { + createItem(*ch); + } + +#ifdef FIXED_LAYOUT + lv->setFixedWidth(lv->sizeHint().width()); +#endif +} + +void Main::createItem(const TQString& ch) +{ + if ( !item[ch] ) { + TQStringList deps = dependencies[ch]; + TQString sec = section[ch]; + TQListViewItem* parent = 0; + for (TQStringList::Iterator dp = deps.begin(); dp != deps.end(); ++dp) { + TQString dsec = section[*dp]; + if ( dsec.isEmpty() ) + tqDebug("No section for %s",(*dp).latin1()); + if ( !parent && dsec == sec ) { + createItem(*dp); + parent = item[*dp]; + } + } + if ( !parent ) + parent = sectionitem[section[ch]]; + ChoiceItem* ci = new ChoiceItem(ch,parent); + item[ch] = ci; + if ( !label[ch].isEmpty() ) + ci->setInfo(label[ch],documentation[ch]); + } +} + +void Main::loadConfig(const TQString& filename) +{ + TQFile file(filename); + if ( !file.open(IO_ReadOnly) ) { + TQMessageBox::warning(this,"Warning", + "Cannot open file " + filename); + return; + } + TQTextStream s(&file); + TQRegExp qt_no_xxx("TQT_NO_[A-Z_0-9]*"); + + for (TQStringList::Iterator ch = choices.begin(); ch != choices.end(); ++ch) { + item[*ch]->setDefined(FALSE); + } + do { + TQString line = s.readLine(); + TQStringList token = TQStringList::split(TQChar(' '),line); + if ( token[0] == "#define" ) { + ChoiceItem* i = item[token[1]]; + if ( i ) + i->setDefined(TRUE); + else + tqDebug("The item %s is not used by tqfeatures.h", token[1].latin1()); + } + } while (!s.atEnd()); +} + +void Main::updateAvailability(TQListViewItem* i) +{ + if ( !i || !i->parent() ) { + // section. do nothing for now + } else { + ChoiceItem* choice = (ChoiceItem*)i; + TQStringList deps = rdependencies[choice->id]; + for (TQStringList::ConstIterator it = deps.begin(); + it != deps.end(); ++it) + { + ChoiceItem* d = item[*it]; + TQStringList ddeps = dependencies[d->id]; + bool av = TRUE; + for (TQStringList::ConstIterator dit = ddeps.begin(); + av && dit != ddeps.end(); ++dit) + { + ChoiceItem* dd = item[*dit]; + if ( dd ) { + if ( dd->isDefined() || !dd->isAvailable() ) + av = FALSE; + } else + tqDebug("%s ???",(*dit).latin1()); + } + if ( d->isAvailable() != av ) { + d->setAvailable(av); + updateAvailability(d); + } + } +tqDebug("%s: %d",choice->id.latin1(),choice->isAvailable()); + } +} + +void Main::showInfo(TQListViewItem* i) +{ + if ( !i ) + return; + if ( !i->parent() ) { + // section. do nothing for now + } else { + ChoiceItem* choice = (ChoiceItem*)i; + TQString i = choice->info(); + TQStringList deps = dependencies[choice->id]; + if ( !deps.isEmpty() ) { + i += "

      Requires:

        "; + for (TQStringList::ConstIterator it = deps.begin(); + it != deps.end(); ++it) + { + ChoiceItem* d = item[*it]; + if ( d ) { + bool got = d->isAvailable() && !d->isDefined(); + i += "
      • "; + if ( !got ) i += ""; + i += "id+">"+d->label+""; + if ( !got ) i += ""; + } + } + i += "
      "; + } + TQStringList rdeps = rdependencies[choice->id]; + if ( !rdeps.isEmpty() ) { + i += "

      Required for:

        "; + for (TQStringList::ConstIterator it = rdeps.begin(); + it != rdeps.end(); ++it) + { + ChoiceItem* d = item[*it]; + if ( d ) + i += "
      • id+">"+d->label+""; + } + i += "
      "; + } + info->setText(i); + } +} + +void Main::selectId(const TQString& id) +{ + TQListViewItem* it = item[id]; + if ( it ) { + lv->setSelected(it,TRUE); + lv->ensureItemVisible(it); + } +} + +Info::Info( TQWidget* parent, const char* name ) : + TQTextBrowser(parent, name) +{ +} + +void Info::setSource(const TQString& name) +{ + if ( name.left(5) == "id://" ) { + emit idClicked(name.mid(5,name.length()-6)); // skip trailing "/" too + } else { + TQTextBrowser::setSource(name); + } +} + +void Main::about() +{ + TQMessageBox::about(this, "About tqconfig", + "

      TQt/Embedded build configuration

      " + "

      " + "

      Version 1.0

      " + "

      Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.

      " + "

      " + "

      This program is licensed to you under the terms of the GNU General " + "Public License Version 2 as published by the Free Software Foundation. This " + "gives you legal permission to copy, distribute and/or modify this software " + "under certain conditions. For details, see the file 'LICENSE.GPL' that came with " + "this software distribution. If you did not get the file, send email to " + "info@trolltech.com.

      \n\n

      The program is provided AS IS with NO WARRANTY " + "OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS " + "FOR A PARTICULAR PURPOSE.

      " + ); +} + +void Main::aboutTQt() +{ + TQMessageBox::aboutTQt( this, tr("tqconfig") ); +} + +int main(int argc, char** argv) +{ + TQApplication app(argc,argv); + Main m; + TQString qtdir = getenv("TQTDIR"); + TQString tqfeatures = qtdir + "/src/tools/tqfeatures.txt"; + //TQString tqfeatures = qtdir + "/include/tqfeatures.h"; + TQString tqconfig = qtdir + "/include/tqconfig.h"; + for (int i=1; i +#include +#include +#include + +class ChoiceItem; +class TQListViewItem; +class TQListView; +class TQLabel; + +class Info : public TQTextBrowser { + TQ_OBJECT +public: + Info( TQWidget* parent, const char* name=0 ); + +signals: + void idClicked(const TQString& name); + +public slots: + void setSource(const TQString& name); +}; + +class Main : public TQMainWindow { + TQ_OBJECT +public: + Main(); + void loadFeatures(const TQString& filename); + void loadConfig(const TQString& filename); + +private: + void createItem(const TQString& ch); + TQMap label; + TQMap documentation; + TQMap links; + TQMap dependencies; + TQMap rdependencies; + TQMap section; + TQMap item; + TQMap sectionitem; + TQStringList choices; + TQListView* lv; + TQTextBrowser* info; + +private slots: + void updateAvailability(TQListViewItem* i); + void showInfo(TQListViewItem* i); + void selectId(const TQString&); + void open(); + void save(); + void testAll(); + void about(); + void aboutTQt(); +}; diff --git a/tools/tqconfig/qconfig.pro b/tools/tqconfig/qconfig.pro new file mode 100644 index 000000000..fd51e1528 --- /dev/null +++ b/tools/tqconfig/qconfig.pro @@ -0,0 +1,7 @@ +TEMPLATE = app +CONFIG += qt warn_on release +HEADERS = main.h +SOURCES = main.cpp +INTERFACES = +TARGET = tqconfig +REQUIRES=full-config nocrosscompiler diff --git a/translations/qt_ar.ts b/translations/qt_ar.ts index 4aaaca45e..de0e24f5b 100644 --- a/translations/qt_ar.ts +++ b/translations/qt_ar.ts @@ -283,7 +283,7 @@
      - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_ca.ts b/translations/qt_ca.ts index 456037552..156aa2dc6 100644 --- a/translations/qt_ca.ts +++ b/translations/qt_ca.ts @@ -284,7 +284,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_cs.ts b/translations/qt_cs.ts index 54c88118f..fa4665186 100644 --- a/translations/qt_cs.ts +++ b/translations/qt_cs.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_de.ts b/translations/qt_de.ts index a97c8f3da..08ff92cc6 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -296,7 +296,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_es.ts b/translations/qt_es.ts index e220ddb27..4a7e4bc66 100644 --- a/translations/qt_es.ts +++ b/translations/qt_es.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_fr.ts b/translations/qt_fr.ts index 45d2fa172..06ea07b07 100644 --- a/translations/qt_fr.ts +++ b/translations/qt_fr.ts @@ -295,7 +295,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_he.ts b/translations/qt_he.ts index f46b6d54a..236c0af1f 100644 --- a/translations/qt_he.ts +++ b/translations/qt_he.ts @@ -294,7 +294,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_it.ts b/translations/qt_it.ts index 03072ffd7..009c8164a 100644 --- a/translations/qt_it.ts +++ b/translations/qt_it.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_ja.ts b/translations/qt_ja.ts index ea7b2065d..f7845e085 100644 --- a/translations/qt_ja.ts +++ b/translations/qt_ja.ts @@ -283,7 +283,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_nb.ts b/translations/qt_nb.ts index 29d1e7db0..ebbf2a23a 100644 --- a/translations/qt_nb.ts +++ b/translations/qt_nb.ts @@ -284,7 +284,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_pt-br.ts b/translations/qt_pt-br.ts index 298d3e37b..8597c4a13 100644 --- a/translations/qt_pt-br.ts +++ b/translations/qt_pt-br.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_pt.ts b/translations/qt_pt.ts index bcb9e2157..bf4952beb 100644 --- a/translations/qt_pt.ts +++ b/translations/qt_pt.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts index 5cb9a411b..92bf86a90 100644 --- a/translations/qt_ru.ts +++ b/translations/qt_ru.ts @@ -337,7 +337,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_sk.ts b/translations/qt_sk.ts index 67386a60b..de0969f07 100644 --- a/translations/qt_sk.ts +++ b/translations/qt_sk.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_tr.ts b/translations/qt_tr.ts index 7b6c4e6db..60d2a937a 100644 --- a/translations/qt_tr.ts +++ b/translations/qt_tr.ts @@ -285,7 +285,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_zh-cn.ts b/translations/qt_zh-cn.ts index 4a7622157..16d255e5a 100644 --- a/translations/qt_zh-cn.ts +++ b/translations/qt_zh-cn.ts @@ -283,7 +283,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/qt_zh-tw.ts b/translations/qt_zh-tw.ts index 7848b4545..5389fd9f3 100644 --- a/translations/qt_zh-tw.ts +++ b/translations/qt_zh-tw.ts @@ -283,7 +283,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/translations/template.ts b/translations/template.ts index 61bc14dc1..b29c63217 100644 --- a/translations/template.ts +++ b/translations/template.ts @@ -283,7 +283,7 @@ - QApplication + TQApplication QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. diff --git a/tutorial/t1/main.cpp b/tutorial/t1/main.cpp index c3fa55675..4acd54d87 100644 --- a/tutorial/t1/main.cpp +++ b/tutorial/t1/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include diff --git a/tutorial/t10/main.cpp b/tutorial/t10/main.cpp index d2502e640..375dfcb00 100644 --- a/tutorial/t10/main.cpp +++ b/tutorial/t10/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t11/main.cpp b/tutorial/t11/main.cpp index d86453f7b..0a9d31bf1 100644 --- a/tutorial/t11/main.cpp +++ b/tutorial/t11/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t12/main.cpp b/tutorial/t12/main.cpp index 643e4d2ab..500076c09 100644 --- a/tutorial/t12/main.cpp +++ b/tutorial/t12/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t13/gamebrd.cpp b/tutorial/t13/gamebrd.cpp index 0cf59057a..1f0d6c6ec 100644 --- a/tutorial/t13/gamebrd.cpp +++ b/tutorial/t13/gamebrd.cpp @@ -7,7 +7,7 @@ #include "gamebrd.h" #include -#include +#include #include #include #include diff --git a/tutorial/t13/main.cpp b/tutorial/t13/main.cpp index 0e7089b5c..3ac7bfe9d 100644 --- a/tutorial/t13/main.cpp +++ b/tutorial/t13/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include "gamebrd.h" diff --git a/tutorial/t14/gamebrd.cpp b/tutorial/t14/gamebrd.cpp index a76a0a0f3..8fd2498ac 100644 --- a/tutorial/t14/gamebrd.cpp +++ b/tutorial/t14/gamebrd.cpp @@ -7,7 +7,7 @@ #include "gamebrd.h" #include -#include +#include #include #include #include diff --git a/tutorial/t14/main.cpp b/tutorial/t14/main.cpp index c2e6a58e1..aebf66d82 100644 --- a/tutorial/t14/main.cpp +++ b/tutorial/t14/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include "gamebrd.h" diff --git a/tutorial/t15/main.h b/tutorial/t15/main.h index 93d4fad93..0cbefda69 100644 --- a/tutorial/t15/main.h +++ b/tutorial/t15/main.h @@ -11,7 +11,7 @@ #ifndef _MAIN_H_ #define _MAIN_H_ -#include +#include #include #include #include diff --git a/tutorial/t2/main.cpp b/tutorial/t2/main.cpp index cc1d59432..6d4172318 100644 --- a/tutorial/t2/main.cpp +++ b/tutorial/t2/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include diff --git a/tutorial/t3/main.cpp b/tutorial/t3/main.cpp index c9a727d57..b6b765c9e 100644 --- a/tutorial/t3/main.cpp +++ b/tutorial/t3/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t4/main.cpp b/tutorial/t4/main.cpp index 79bceaab1..3900bfcbb 100644 --- a/tutorial/t4/main.cpp +++ b/tutorial/t4/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include diff --git a/tutorial/t5/main.cpp b/tutorial/t5/main.cpp index 1f04d2dbd..242104e96 100644 --- a/tutorial/t5/main.cpp +++ b/tutorial/t5/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t6/main.cpp b/tutorial/t6/main.cpp index b976e7f48..a280fafd6 100644 --- a/tutorial/t6/main.cpp +++ b/tutorial/t6/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t7/main.cpp b/tutorial/t7/main.cpp index 469293699..dc77904bd 100644 --- a/tutorial/t7/main.cpp +++ b/tutorial/t7/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t8/main.cpp b/tutorial/t8/main.cpp index 3ead07ebe..dd8dce929 100644 --- a/tutorial/t8/main.cpp +++ b/tutorial/t8/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include diff --git a/tutorial/t9/main.cpp b/tutorial/t9/main.cpp index 57216dd25..74049bdb4 100644 --- a/tutorial/t9/main.cpp +++ b/tutorial/t9/main.cpp @@ -4,7 +4,7 @@ ** ****************************************************************/ -#include +#include #include #include #include -- cgit v1.2.1