summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-03-12 21:03:49 +0100
committerLars Knoll <lars.knoll@nokia.com>2012-03-12 21:03:49 +0100
commitd5098f2802255da10b749b93705084ad1fdfc6a5 (patch)
tree6462008a4ab7d13435d93490fed96c62c516cbdf /src
parentd5a85940f785459d7b982d5fdf59a9fd18825092 (diff)
parentb5b41c18345719612e5411cc482466d2dbafdaf7 (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gpos.c3
-rw-r--r--src/3rdparty/pcre/sljit/sljitUtils.c4
-rw-r--r--src/concurrent/qtconcurrent_global.h13
-rw-r--r--src/concurrent/qtconcurrentrun.h72
-rw-r--r--src/corelib/codecs/codecs.pri2
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp2
-rw-r--r--src/corelib/codecs/qtextcodec.cpp28
-rw-r--r--src/corelib/codecs/qtextcodec.h4
-rw-r--r--src/corelib/global/global.pri4
-rw-r--r--src/corelib/global/qisenum.h64
-rw-r--r--src/corelib/global/qprocessordetection.h26
-rw-r--r--src/corelib/global/qsysinfo.h2
-rw-r--r--src/corelib/global/qtypetraits.h420
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp5
-rw-r--r--src/corelib/json/qjsonarray.cpp2
-rw-r--r--src/corelib/json/qjsonobject.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.h6
-rw-r--r--src/corelib/kernel/qmetatype.cpp5
-rw-r--r--src/corelib/kernel/qmetatype.h6
-rw-r--r--src/corelib/kernel/qvariant.cpp10
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp21
-rw-r--r--src/corelib/tools/qlocale.h1
-rw-r--r--src/corelib/tools/qregularexpression.cpp214
-rw-r--r--src/gui/accessible/qaccessible.cpp28
-rw-r--r--src/gui/accessible/qaccessible.h19
-rw-r--r--src/gui/accessible/qaccessible2.h29
-rw-r--r--src/gui/egl/egl.pri26
-rw-r--r--src/gui/egl/qegl.cpp751
-rw-r--r--src/gui/egl/qegl_p.h191
-rw-r--r--src/gui/egl/qegl_qpa.cpp110
-rw-r--r--src/gui/egl/qeglcontext_p.h117
-rw-r--r--src/gui/egl/qeglproperties.cpp563
-rw-r--r--src/gui/gui.pro60
-rw-r--r--src/gui/image/qimage.cpp6
-rw-r--r--src/gui/kernel/qguiapplication.cpp48
-rw-r--r--src/gui/kernel/qguiapplication.h1
-rw-r--r--src/gui/kernel/qplatformdrag_qpa.cpp1
-rw-r--r--src/gui/kernel/qplatformdrag_qpa.h2
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp14
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.h3
-rw-r--r--src/gui/kernel/qwindow.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa_p.h3
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp6
-rw-r--r--src/gui/opengl/qopenglpaintengine_p.h2
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp19
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h18
-rw-r--r--src/gui/painting/qpaintengineex.cpp7
-rw-r--r--src/gui/painting/qpaintengineex_p.h4
-rw-r--r--src/gui/painting/qpainter.cpp110
-rw-r--r--src/gui/painting/qpainter.h2
-rw-r--r--src/gui/painting/qpainter_p.h1
-rw-r--r--src/gui/text/qdistancefield.cpp67
-rw-r--r--src/gui/text/qdistancefield_p.h2
-rw-r--r--src/gui/text/qfont.cpp14
-rw-r--r--src/gui/text/qfont_p.h1
-rw-r--r--src/gui/text/qfontengine.cpp20
-rw-r--r--src/gui/text/qfontengine_p.h7
-rw-r--r--src/gui/text/qglyphrun.h2
-rw-r--r--src/gui/text/qtextengine.cpp99
-rw-r--r--src/gui/text/qtextengine_p.h32
-rw-r--r--src/gui/text/qtextlayout.cpp13
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp1
-rw-r--r--src/network/kernel/qnetworkproxy.cpp47
-rw-r--r--src/network/kernel/qnetworkproxy.h4
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp182
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp7
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp45
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h7
-rw-r--r--src/platformsupport/platformsupport.pro2
-rw-r--r--src/plugins/accessible/widgets/itemviews.cpp64
-rw-r--r--src/plugins/accessible/widgets/itemviews.h11
-rw-r--r--src/plugins/platforms/blackberry/blackberry.pro71
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm3
-rw-r--r--src/plugins/platforms/eglfs/eglfs.pro6
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.cpp21
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.h2
-rw-r--r--src/plugins/platforms/kms/qkmsdevice.cpp2
-rw-r--r--src/plugins/platforms/platforms.pro4
-rw-r--r--src/plugins/platforms/qnx/main.cpp (renamed from src/plugins/platforms/blackberry/main.cpp)16
-rw-r--r--src/plugins/platforms/qnx/qnx.pro71
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.cpp (renamed from src/plugins/platforms/blackberry/qbbbuffer.cpp)48
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.h (renamed from src/plugins/platforms/blackberry/qbbbuffer.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.cpp (renamed from src/plugins/platforms/blackberry/qbbclipboard.cpp)34
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.h (renamed from src/plugins/platforms/blackberry/qbbclipboard.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxeventthread.cpp (renamed from src/plugins/platforms/blackberry/qbbeventthread.cpp)163
-rw-r--r--src/plugins/platforms/qnx/qqnxeventthread.h (renamed from src/plugins/platforms/blackberry/qbbeventthread.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxglbackingstore.cpp (renamed from src/plugins/platforms/blackberry/qbbglbackingstore.cpp)62
-rw-r--r--src/plugins/platforms/qnx/qqnxglbackingstore.h (renamed from src/plugins/platforms/blackberry/qbbglbackingstore.h)28
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.cpp (renamed from src/plugins/platforms/blackberry/qbbglcontext.cpp)92
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.h (renamed from src/plugins/platforms/blackberry/qbbglcontext.h)14
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp (renamed from src/plugins/platforms/blackberry/qbbinputcontext_imf.cpp)238
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.h (renamed from src/plugins/platforms/blackberry/qbbinputcontext_imf.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp (renamed from src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp)64
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.h (renamed from src/plugins/platforms/blackberry/qbbinputcontext_noimf.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp (renamed from src/plugins/platforms/blackberry/qbbintegration.cpp)140
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h (renamed from src/plugins/platforms/blackberry/qbbintegration.h)36
-rw-r--r--src/plugins/platforms/qnx/qqnxkeytranslator.h (renamed from src/plugins/platforms/blackberry/qbbkeytranslator.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorthread.cpp (renamed from src/plugins/platforms/blackberry/qbbnavigatorthread.cpp)71
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorthread.h (renamed from src/plugins/platforms/blackberry/qbbnavigatorthread.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp (renamed from src/plugins/platforms/blackberry/qbbrasterbackingstore.cpp)52
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h (renamed from src/plugins/platforms/blackberry/qbbrasterbackingstore.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.cpp (renamed from src/plugins/platforms/blackberry/qbbrootwindow.cpp)68
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.h (renamed from src/plugins/platforms/blackberry/qbbrootwindow.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp (renamed from src/plugins/platforms/blackberry/qbbscreen.cpp)96
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h (renamed from src/plugins/platforms/blackberry/qbbscreen.h)28
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboard.cpp (renamed from src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp)118
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboard.h (renamed from src/plugins/platforms/blackberry/qbbvirtualkeyboard.h)8
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp (renamed from src/plugins/platforms/blackberry/qbbwindow.cpp)204
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h (renamed from src/plugins/platforms/blackberry/qbbwindow.h)42
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp28
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h2
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp16
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp36
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
-rw-r--r--src/plugins/platforms/xlib/main.cpp6
-rw-r--r--src/plugins/platforms/xlib/qxlibkeyboard.cpp36
-rw-r--r--src/plugins/platforms/xlib/xlib.json3
-rw-r--r--src/plugins/platforms/xlib/xlib.pro2
-rw-r--r--src/printsupport/dialogs/qprintdialog.h19
-rw-r--r--src/printsupport/kernel/qprinter.cpp2
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
-rw-r--r--src/src.pro28
-rw-r--r--src/testlib/qtest.h8
-rw-r--r--src/testlib/qtest_gui.h30
-rw-r--r--src/testlib/qtestaccessible.h50
-rw-r--r--src/testlib/qtestcase.cpp49
-rw-r--r--src/testlib/qtestcase.h16
-rw-r--r--src/testlib/qtestresult.cpp38
-rw-r--r--src/testlib/qtestresult_p.h6
-rw-r--r--src/tools/qdoc/TODO.txt87
-rw-r--r--src/tools/qdoc/atom.cpp387
-rw-r--r--src/tools/qdoc/atom.h237
-rw-r--r--src/tools/qdoc/codechunk.cpp150
-rw-r--r--src/tools/qdoc/codechunk.h123
-rw-r--r--src/tools/qdoc/codemarker.cpp682
-rw-r--r--src/tools/qdoc/codemarker.h192
-rw-r--r--src/tools/qdoc/codeparser.cpp409
-rw-r--r--src/tools/qdoc/codeparser.h107
-rw-r--r--src/tools/qdoc/config.cpp978
-rw-r--r--src/tools/qdoc/config.h199
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp1354
-rw-r--r--src/tools/qdoc/cppcodemarker.h96
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp2502
-rw-r--r--src/tools/qdoc/cppcodeparser.h196
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp6434
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.h543
-rw-r--r--src/tools/qdoc/doc.cpp3393
-rw-r--r--src/tools/qdoc/doc.h198
-rw-r--r--src/tools/qdoc/doc/config/compat.qdocconf12
-rw-r--r--src/tools/qdoc/doc/config/config.pro13
-rw-r--r--src/tools/qdoc/doc/config/images/arrow_down.pngbin0 -> 177 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bg_l.pngbin0 -> 100 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bg_l_blank.pngbin0 -> 84 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bg_ll_blank.pngbin0 -> 320 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bg_r.pngbin0 -> 96 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bg_ul_blank.pngbin0 -> 304 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/box_bg.pngbin0 -> 89 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/breadcrumb.pngbin0 -> 134 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bullet_dn.pngbin0 -> 230 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bullet_gt.pngbin0 -> 124 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bullet_sq.pngbin0 -> 74 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bullet_up.pngbin0 -> 210 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/feedbackground.pngbin0 -> 263 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/header_bg.pngbin0 -> 114 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/horBar.pngbin0 -> 2807 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/page.pngbin0 -> 3102 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/page_bg.pngbin0 -> 84 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/spinner.gifbin0 -> 2037 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/sprites-combined.pngbin0 -> 62534 bytes
-rw-r--r--src/tools/qdoc/doc/config/macros.qdocconf40
-rw-r--r--src/tools/qdoc/doc/config/qdoc-online.qdocconf2
-rw-r--r--src/tools/qdoc/doc/config/qdoc-project.qdocconf48
-rw-r--r--src/tools/qdoc/doc/config/qdoc.qdocconf2
-rw-r--r--src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf98
-rw-r--r--src/tools/qdoc/doc/config/qt-defines.qdocconf17
-rw-r--r--src/tools/qdoc/doc/config/qt-html-default-styles.qdocconf32
-rw-r--r--src/tools/qdoc/doc/config/qt-html-online-styles.qdocconf72
-rw-r--r--src/tools/qdoc/doc/config/qt-html-templates-online.qdocconf115
-rw-r--r--src/tools/qdoc/doc/config/qt-html-templates.qdocconf54
-rw-r--r--src/tools/qdoc/doc/config/style/offline.css673
-rw-r--r--src/tools/qdoc/doc/corefeatures.qdoc35
-rw-r--r--src/tools/qdoc/doc/examples/componentset/ProgressBar.qml135
-rw-r--r--src/tools/qdoc/doc/examples/componentset/Switch.qml142
-rw-r--r--src/tools/qdoc/doc/examples/componentset/TabWidget.qml183
-rw-r--r--src/tools/qdoc/doc/examples/componentset/componentset.pro5
-rw-r--r--src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc37
-rw-r--r--src/tools/qdoc/doc/examples/examples.qdoc84
-rw-r--r--src/tools/qdoc/doc/examples/layoutmanagement.qdocinc13
-rw-r--r--src/tools/qdoc/doc/examples/main.cpp54
-rw-r--r--src/tools/qdoc/doc/examples/mainwindow.cpp251
-rw-r--r--src/tools/qdoc/doc/examples/minimum.qdocconf38
-rw-r--r--src/tools/qdoc/doc/examples/objectmodel.qdocinc11
-rw-r--r--src/tools/qdoc/doc/examples/samples.qdocinc109
-rw-r--r--src/tools/qdoc/doc/examples/signalandslots.qdocinc9
-rw-r--r--src/tools/qdoc/doc/files/compat.qdocconf12
-rw-r--r--src/tools/qdoc/doc/files/qt.qdocconf115
-rw-r--r--src/tools/qdoc/doc/images/happy.gifbin0 -> 11526 bytes
-rw-r--r--src/tools/qdoc/doc/images/happyguy.jpgbin0 -> 53442 bytes
-rw-r--r--src/tools/qdoc/doc/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--src/tools/qdoc/doc/images/training.jpgbin0 -> 8368 bytes
-rw-r--r--src/tools/qdoc/doc/qdoc-guide.qdoc690
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc8764
-rw-r--r--src/tools/qdoc/editdistance.cpp114
-rw-r--r--src/tools/qdoc/editdistance.h59
-rw-r--r--src/tools/qdoc/generator.cpp1495
-rw-r--r--src/tools/qdoc/generator.h221
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp772
-rw-r--r--src/tools/qdoc/helpprojectwriter.h111
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp5115
-rw-r--r--src/tools/qdoc/htmlgenerator.h319
-rw-r--r--src/tools/qdoc/jscodemarker.cpp148
-rw-r--r--src/tools/qdoc/jscodemarker.h75
-rw-r--r--src/tools/qdoc/location.cpp398
-rw-r--r--src/tools/qdoc/location.h131
-rw-r--r--src/tools/qdoc/main.cpp481
-rw-r--r--src/tools/qdoc/node.cpp2780
-rw-r--r--src/tools/qdoc/node.h958
-rw-r--r--src/tools/qdoc/openedlist.cpp228
-rw-r--r--src/tools/qdoc/openedlist.h91
-rw-r--r--src/tools/qdoc/pagegenerator.cpp388
-rw-r--r--src/tools/qdoc/pagegenerator.h99
-rw-r--r--src/tools/qdoc/plaincodemarker.cpp137
-rw-r--r--src/tools/qdoc/plaincodemarker.h (renamed from src/gui/egl/qeglproperties_p.h)70
-rw-r--r--src/tools/qdoc/puredocparser.cpp63
-rw-r--r--src/tools/qdoc/puredocparser.h72
-rw-r--r--src/tools/qdoc/qdoc.pro114
-rw-r--r--src/tools/qdoc/qmlcodemarker.cpp302
-rw-r--r--src/tools/qdoc/qmlcodemarker.h86
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp291
-rw-r--r--src/tools/qdoc/qmlcodeparser.h92
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.cpp851
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.h178
-rw-r--r--src/tools/qdoc/qmlparser/qmlparser.pri19
-rw-r--r--src/tools/qdoc/qmlparser/qqmljs.g3016
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast.cpp931
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast_p.h2640
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastfwd_p.h186
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp58
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h329
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.cpp161
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.h126
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsglobal_p.h69
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar.cpp1013
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar_p.h211
-rw-r--r--src/tools/qdoc/qmlparser/qqmljskeywords_p.h860
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer.cpp1171
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer_p.h248
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h173
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser.cpp1817
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser_p.h248
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp594
-rw-r--r--src/tools/qdoc/qmlvisitor.h122
-rw-r--r--src/tools/qdoc/quoter.cpp377
-rw-r--r--src/tools/qdoc/quoter.h93
-rw-r--r--src/tools/qdoc/separator.cpp77
-rw-r--r--src/tools/qdoc/separator.h58
-rw-r--r--src/tools/qdoc/text.cpp287
-rw-r--r--src/tools/qdoc/text.h106
-rw-r--r--src/tools/qdoc/tokenizer.cpp771
-rw-r--r--src/tools/qdoc/tokenizer.h182
-rw-r--r--src/tools/qdoc/tr.h72
-rw-r--r--src/tools/qdoc/tree.cpp2358
-rw-r--r--src/tools/qdoc/tree.h174
-rw-r--r--src/tools/qdoc/yyindent.cpp1190
-rw-r--r--src/tools/rcc/rcc.cpp304
-rw-r--r--src/tools/tools.pro13
-rw-r--r--src/widgets/dialogs/qdialog.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp65
-rw-r--r--src/widgets/kernel/qapplication.h4
-rw-r--r--src/widgets/kernel/qapplication_p.h3
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp28
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp17
-rw-r--r--src/widgets/util/qsystemtrayicon_mac.mm8
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp227
-rw-r--r--src/widgets/util/util.pri9
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp12
-rw-r--r--src/widgets/widgets/qabstractslider.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp4
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp2
-rw-r--r--src/widgets/widgets/qprogressbar.cpp2
-rw-r--r--src/widgets/widgets/qpushbutton.cpp4
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp4
-rw-r--r--src/winmain/winmain.pro4
300 files changed, 69116 insertions, 3767 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 2a86cb21e9..8247875714 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -1595,6 +1595,9 @@ static HB_Error Lookup_PairPos1( GPOS_Instance* gpi,
if ( index >= ppf1->PairSetCount )
return ERR(HB_Err_Invalid_SubTable);
+ if (!ppf1->PairSet[index].PairValueCount)
+ return HB_Err_Not_Covered;
+
pvr = ppf1->PairSet[index].PairValueRecord;
if ( !pvr )
return ERR(HB_Err_Invalid_SubTable);
diff --git a/src/3rdparty/pcre/sljit/sljitUtils.c b/src/3rdparty/pcre/sljit/sljitUtils.c
index 98beaa0b5e..703f405e18 100644
--- a/src/3rdparty/pcre/sljit/sljitUtils.c
+++ b/src/3rdparty/pcre/sljit/sljitUtils.c
@@ -233,7 +233,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stac
aligned_new_limit = (new_limit + sljit_page_align) & ~sljit_page_align;
aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
if (aligned_new_limit < aligned_old_limit)
+#ifdef __QNXNTO__
+ posix_madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, POSIX_MADV_DONTNEED);
+#else
madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, MADV_DONTNEED);
+#endif
stack->limit = new_limit;
return 0;
#endif
diff --git a/src/concurrent/qtconcurrent_global.h b/src/concurrent/qtconcurrent_global.h
index 1e26c2321d..422bca0258 100644
--- a/src/concurrent/qtconcurrent_global.h
+++ b/src/concurrent/qtconcurrent_global.h
@@ -68,17 +68,4 @@
# endif
#endif
-// gcc 3 version has problems with some of the
-// map/filter overloads.
-#if defined(Q_CC_GNU) && (__GNUC__ < 4)
-# define QT_NO_CONCURRENT_MAP
-# define QT_NO_CONCURRENT_FILTER
-#endif
-
-#if defined (Q_CC_MSVC) && (_MSC_VER < 1300)
-# define QT_TYPENAME
-#else
-# define QT_TYPENAME typename
-#endif
-
#endif // include guard
diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h
index 0e46db868d..2ca5621f08 100644
--- a/src/concurrent/qtconcurrentrun.h
+++ b/src/concurrent/qtconcurrentrun.h
@@ -152,187 +152,187 @@ auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3,
template <typename FunctionObject>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject)
{
- return (new StoredFunctorCall0<QT_TYPENAME FunctionObject::result_type, FunctionObject>(functionObject))->start();
+ return (new StoredFunctorCall0<typename FunctionObject::result_type, FunctionObject>(functionObject))->start();
}
template <typename FunctionObject, typename Arg1>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1)
{
- return (new StoredFunctorCall1<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1>(functionObject, arg1))->start();
+ return (new StoredFunctorCall1<typename FunctionObject::result_type, FunctionObject, Arg1>(functionObject, arg1))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new StoredFunctorCall2<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2>(functionObject, arg1, arg2))->start();
+ return (new StoredFunctorCall2<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2>(functionObject, arg1, arg2))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new StoredFunctorCall3<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>(functionObject, arg1, arg2, arg3))->start();
+ return (new StoredFunctorCall3<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>(functionObject, arg1, arg2, arg3))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new StoredFunctorCall4<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>(functionObject, arg1, arg2, arg3, arg4))->start();
+ return (new StoredFunctorCall4<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>(functionObject, arg1, arg2, arg3, arg4))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new StoredFunctorCall5<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new StoredFunctorCall5<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename FunctionObject>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall0<QT_TYPENAME FunctionObject::result_type, FunctionObject>::type(functionObject))->start();
+ return (new typename SelectStoredFunctorPointerCall0<typename FunctionObject::result_type, FunctionObject>::type(functionObject))->start();
}
template <typename FunctionObject, typename Arg1>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall1<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1>::type(functionObject, arg1))->start();
+ return (new typename SelectStoredFunctorPointerCall1<typename FunctionObject::result_type, FunctionObject, Arg1>::type(functionObject, arg1))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall2<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2>::type(functionObject, arg1, arg2))->start();
+ return (new typename SelectStoredFunctorPointerCall2<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2>::type(functionObject, arg1, arg2))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall3<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>::type(functionObject, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredFunctorPointerCall3<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>::type(functionObject, arg1, arg2, arg3))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall4<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>::type(functionObject, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredFunctorPointerCall4<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>::type(functionObject, arg1, arg2, arg3, arg4))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall5<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>::type(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredFunctorPointerCall5<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>::type(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(const Class &object, T (Class::*fn)())
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredMemberFunctionCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1), const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(const Class &object, T (Class::*fn)() const)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredConstMemberFunctionCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1) const, const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredConstMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredConstMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredConstMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredConstMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredConstMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(Class *object, T (Class::*fn)())
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(Class *object, T (Class::*fn)(Param1), const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(const Class *object, T (Class::*fn)() const)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1) const, const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
} //namespace QtConcurrent
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index c3a15ab4f9..a6f8914516 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -38,7 +38,7 @@ unix {
contains(QT_CONFIG,iconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
- blackberry-*-qcc:LIBS_PRIVATE *= -liconv
+ qnx-*-qcc:LIBS_PRIVATE *= -liconv
} else:contains(QT_CONFIG,gnu-libiconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index aa0ddca753..be22ff9bca 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -465,7 +465,7 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from)
Q_ASSERT((to == 0 && from != 0) || (to != 0 && from == 0));
iconv_t cd = (iconv_t) -1;
-#if defined(__GLIBC__) || defined(GNU_LIBICONV)
+#if defined(__GLIBC__) || defined(GNU_LIBICONV) || defined(Q_OS_QNX)
#if defined(Q_OS_QNX)
// on QNX the default locale is UTF-8, and an empty string will cause iconv_open to fail
static const char empty_codeset[] = "UTF-8";
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 13f0ec8ce5..784a75bcad 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -48,6 +48,7 @@
#include "qlist.h"
#include "qfile.h"
#include "qstringlist.h"
+#include "qvarlengtharray.h"
#ifdef Q_OS_UNIX
# include "qiconvcodec_p.h"
@@ -220,10 +221,7 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
if (!mb || !mblen)
return QString();
- const int wclen_auto = 4096;
- wchar_t wc_auto[wclen_auto];
- int wclen = wclen_auto;
- wchar_t *wc = wc_auto;
+ QVarLengthArray<wchar_t, 4096> wc(4096);
int len;
QString sp;
bool prepend = false;
@@ -243,7 +241,7 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
prev[1] = mb[0];
remainingChars = 0;
len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
- prev, 2, wc, wclen);
+ prev, 2, wc.data(), wc.length());
if (len) {
prepend = true;
sp.append(QChar(wc[0]));
@@ -254,18 +252,12 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
}
while (!(len=MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
- mb, mblen, wc, wclen))) {
+ mb, mblen, wc.data(), wc.length()))) {
int r = GetLastError();
if (r == ERROR_INSUFFICIENT_BUFFER) {
- if (wc != wc_auto) {
- qWarning("MultiByteToWideChar: Size changed");
- break;
- } else {
- wclen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
+ const int wclen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
mb, mblen, 0, 0);
- wc = new wchar_t[wclen];
- // and try again...
- }
+ wc.resize(wclen);
} else if (r == ERROR_NO_UNICODE_TRANSLATION) {
//find the last non NULL character
while (mblen > 1 && !(mb[mblen-1]))
@@ -283,8 +275,10 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
break;
}
}
+
if (len <= 0)
return QString();
+
if (wc[len-1] == 0) // len - 1: we don't want terminator
--len;
@@ -293,9 +287,7 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
state->state_data[0] = (char)state_data;
state->remainingChars = remainingChars;
}
- QString s((QChar*)wc, len);
- if (wc != wc_auto)
- delete [] wc;
+ QString s((QChar*)wc.data(), len);
if (prepend) {
return sp+s;
}
@@ -359,7 +351,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le
s.append(QChar(ws[i]));
delete [] ws;
#endif
- delete mbcs;
+ delete [] mbcs;
return s;
}
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index b4b170f7d7..690214323d 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -72,6 +72,10 @@ public:
static QTextCodec* codecForLocale();
static void setCodecForLocale(QTextCodec *c);
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED static QTextCodec *codecForTr() { return codecForMib(4); /* Latin1 */ }
+#endif
+
static QTextCodec *codecForHtml(const QByteArray &ba);
static QTextCodec *codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec);
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 49128374e0..58cff6b81c 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -11,7 +11,9 @@ HEADERS += \
global/qnumeric.h \
global/qlogging.h \
global/qtypeinfo.h \
- global/qsysinfo.h
+ global/qsysinfo.h \
+ global/qisenum.h \
+ global/qtypetraits.h
SOURCES += \
global/qglobal.cpp \
diff --git a/src/corelib/global/qisenum.h b/src/corelib/global/qisenum.h
new file mode 100644
index 0000000000..c9b6ec6695
--- /dev/null
+++ b/src/corelib/global/qisenum.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qglobal.h>
+
+#ifndef QISENUM_H
+#define QISENUM_H
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+#ifndef Q_IS_ENUM
+# if defined(Q_CC_GNU) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+# define Q_IS_ENUM(x) __is_enum(x)
+# elif defined(Q_CC_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215)
+# define Q_IS_ENUM(x) __is_enum(x)
+# else
+# include <QtCore/qtypetraits.h>
+# define Q_IS_ENUM(x) QtPrivate::is_enum<x>::value
+# endif
+#endif
+
+QT_END_HEADER
+QT_END_NAMESPACE
+
+#endif // QISENUM_H
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 1f16f090a9..d62794e706 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -75,7 +75,7 @@
/*
Alpha family, no revisions or variants
- Alpha is bi-endian, use endianness auto-detection described above.
+ Alpha is bi-endian, use endianness auto-detection implemented below.
*/
// #elif defined(__alpha__) || defined(_M_ALPHA)
// # define Q_PROCESSOR_ALPHA
@@ -85,7 +85,7 @@
ARM family, known revisions: V5, V6, and V7
ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
- auto-detection described above.
+ auto-detection implemented below.
*/
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
# define Q_PROCESSOR_ARM
@@ -154,7 +154,7 @@
/*
Itanium (IA-64) family, no revisions or variants
- Itanium is bi-endian, use endianness auto-detection described above.
+ Itanium is bi-endian, use endianness auto-detection implemented below.
*/
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
# define Q_PROCESSOR_IA64
@@ -163,7 +163,7 @@
/*
MIPS family, known revisions: I, II, III, IV, 32, 64
- MIPS is bi-endian, use endianness auto-detection described above.
+ MIPS is bi-endian, use endianness auto-detection implemented below.
*/
#elif defined(__mips) || defined(__mips__) || defined(_M_MRX000)
# define Q_PROCESSOR_MIPS
@@ -188,7 +188,13 @@
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
# define Q_PROCESSOR_MIPS_64
# endif
+# if defined(__MIPSEL__)
+# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+# elif defined(__MIPSEB__)
+# define Q_BYTE_ORDER Q_BIG_ENDIAN
+# else
// Q_BYTE_ORDER not defined, use endianness auto-detection
+# endif
/*
Power family, known variants: 32- and 64-bit
@@ -197,7 +203,7 @@
See http://en.wikipedia.org/wiki/Power_Architecture
and http://en.wikipedia.org/wiki/File:PowerISA-evolution.svg
- Power is bi-endian, use endianness auto-detection described above.
+ Power is bi-endian, use endianness auto-detection implemented below.
*/
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \
@@ -225,7 +231,7 @@
/*
SuperH family, optional revision: SH-4A
- SuperH is bi-endian, use endianness auto-detection descrived above.
+ SuperH is bi-endian, use endianness auto-detection implemented below.
*/
// #elif defined(__sh__)
// # define Q_PROCESSOR_SH
@@ -249,6 +255,14 @@
#endif
+/*
+ NOTE:
+ GCC 4.6 added __BYTE_ORDER__, __ORDER_BIG_ENDIAN__, __ORDER_LITTLE_ENDIAN__
+ and __ORDER_PDP_ENDIAN__ in SVN r165881. If you are using GCC 4.6 or newer,
+ this code will properly detect your target byte order; if you are not, and
+ the __LITTLE_ENDIAN__ or __BIG_ENDIAN__ macros are not defined, then this
+ code will fail to detect the target byte order.
+*/
// Some processors support either endian format, try to detect which we are using.
#if !defined(Q_BYTE_ORDER)
# if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == Q_BIG_ENDIAN || __BYTE_ORDER__ == Q_LITTLE_ENDIAN)
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index e6e207ec3d..74c8d1de7f 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -80,8 +80,6 @@ public:
# error "Undefined byte order"
# endif
};
-#else
-# error "Qt not configured correctly, please run configure"
#endif
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
enum WinVersion {
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
new file mode 100644
index 0000000000..92bd949570
--- /dev/null
+++ b/src/corelib/global/qtypetraits.h
@@ -0,0 +1,420 @@
+// Copyright (c) 2006, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// ----
+//
+// This code is compiled directly on many platforms, including client
+// platforms like Windows, Mac, and embedded systems. Before making
+// any changes here, make sure that you're not breaking any platforms.
+//
+// Define a small subset of tr1 type traits. The traits we define are:
+// is_integral
+// is_floating_point
+// is_pointer
+// is_enum
+// is_reference
+// is_pod
+// has_trivial_constructor
+// has_trivial_copy
+// has_trivial_assign
+// has_trivial_destructor
+// remove_const
+// remove_volatile
+// remove_cv
+// remove_reference
+// add_reference
+// remove_pointer
+// is_same
+// is_convertible
+// We can add more type traits as required.
+
+// Changes from the original implementation:
+// - Move base types from template_util.h directly into this header.
+// - Use Qt macros for long long type differences on Windows.
+// - Enclose in QtPrivate namespace.
+
+#ifndef QTYPETRAITS_H
+#define QTYPETRAITS_H
+
+#include <utility> // For pair
+#include "QtCore/qglobal.h"
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+namespace QtPrivate {
+
+// Types small_ and big_ are guaranteed such that sizeof(small_) <
+// sizeof(big_)
+typedef char small_;
+
+struct big_ {
+ char dummy[2];
+};
+
+// Identity metafunction.
+template <class T>
+struct identity_ {
+ typedef T type;
+};
+
+// integral_constant, defined in tr1, is a wrapper for an integer
+// value. We don't really need this generality; we could get away
+// with hardcoding the integer type to bool. We use the fully
+// general integer_constant for compatibility with tr1.
+
+template<class T, T v>
+struct integral_constant {
+ static const T value = v;
+ typedef T value_type;
+ typedef integral_constant<T, v> type;
+};
+
+template <class T, T v> const T integral_constant<T, v>::value;
+
+
+// Abbreviations: true_type and false_type are structs that represent boolean
+// true and false values. Also define the boost::mpl versions of those names,
+// true_ and false_.
+typedef integral_constant<bool, true> true_type;
+typedef integral_constant<bool, false> false_type;
+typedef true_type true_;
+typedef false_type false_;
+
+// if_ is a templatized conditional statement.
+// if_<cond, A, B> is a compile time evaluation of cond.
+// if_<>::type contains A if cond is true, B otherwise.
+template<bool cond, typename A, typename B>
+struct if_{
+ typedef A type;
+};
+
+template<typename A, typename B>
+struct if_<false, A, B> {
+ typedef B type;
+};
+
+
+// type_equals_ is a template type comparator, similar to Loki IsSameType.
+// type_equals_<A, B>::value is true iff "A" is the same type as "B".
+//
+// New code should prefer base::is_same, defined in base/type_traits.h.
+// It is functionally identical, but is_same is the standard spelling.
+template<typename A, typename B>
+struct type_equals_ : public false_ {
+};
+
+template<typename A>
+struct type_equals_<A, A> : public true_ {
+};
+
+// and_ is a template && operator.
+// and_<A, B>::value evaluates "A::value && B::value".
+template<typename A, typename B>
+struct and_ : public integral_constant<bool, (A::value && B::value)> {
+};
+
+// or_ is a template || operator.
+// or_<A, B>::value evaluates "A::value || B::value".
+template<typename A, typename B>
+struct or_ : public integral_constant<bool, (A::value || B::value)> {
+};
+
+template <class T> struct is_integral;
+template <class T> struct is_floating_point;
+template <class T> struct is_pointer;
+// MSVC can't compile this correctly, and neither can gcc 3.3.5 (at least)
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+// is_enum uses is_convertible, which is not available on MSVC.
+template <class T> struct is_enum;
+#endif
+template <class T> struct is_reference;
+template <class T> struct is_pod;
+template <class T> struct has_trivial_constructor;
+template <class T> struct has_trivial_copy;
+template <class T> struct has_trivial_assign;
+template <class T> struct has_trivial_destructor;
+template <class T> struct remove_const;
+template <class T> struct remove_volatile;
+template <class T> struct remove_cv;
+template <class T> struct remove_reference;
+template <class T> struct add_reference;
+template <class T> struct remove_pointer;
+template <class T, class U> struct is_same;
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+template <class From, class To> struct is_convertible;
+#endif
+
+// is_integral is false except for the built-in integer types. A
+// cv-qualified type is integral if and only if the underlying type is.
+template <class T> struct is_integral : false_type { };
+template<> struct is_integral<bool> : true_type { };
+template<> struct is_integral<char> : true_type { };
+template<> struct is_integral<unsigned char> : true_type { };
+template<> struct is_integral<signed char> : true_type { };
+#if defined(_MSC_VER)
+// wchar_t is not by default a distinct type from unsigned short in
+// Microsoft C.
+// See http://msdn2.microsoft.com/en-us/library/dh8che7s(VS.80).aspx
+template<> struct is_integral<__wchar_t> : true_type { };
+#else
+template<> struct is_integral<wchar_t> : true_type { };
+#endif
+template<> struct is_integral<short> : true_type { };
+template<> struct is_integral<unsigned short> : true_type { };
+template<> struct is_integral<int> : true_type { };
+template<> struct is_integral<unsigned int> : true_type { };
+template<> struct is_integral<long> : true_type { };
+template<> struct is_integral<unsigned long> : true_type { };
+#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
+template<> struct is_integral<__int64> : true_type { };
+template<> struct is_integral<unsigned __int64> : true_type { };
+#else
+template<> struct is_integral<long long> : true_type { };
+template<> struct is_integral<unsigned long long> : true_type { };
+#endif
+template <class T> struct is_integral<const T> : is_integral<T> { };
+template <class T> struct is_integral<volatile T> : is_integral<T> { };
+template <class T> struct is_integral<const volatile T> : is_integral<T> { };
+
+// is_floating_point is false except for the built-in floating-point types.
+// A cv-qualified type is integral if and only if the underlying type is.
+template <class T> struct is_floating_point : false_type { };
+template<> struct is_floating_point<float> : true_type { };
+template<> struct is_floating_point<double> : true_type { };
+template<> struct is_floating_point<long double> : true_type { };
+template <class T> struct is_floating_point<const T>
+ : is_floating_point<T> { };
+template <class T> struct is_floating_point<volatile T>
+ : is_floating_point<T> { };
+template <class T> struct is_floating_point<const volatile T>
+ : is_floating_point<T> { };
+
+// is_pointer is false except for pointer types. A cv-qualified type (e.g.
+// "int* const", as opposed to "int const*") is cv-qualified if and only if
+// the underlying type is.
+template <class T> struct is_pointer : false_type { };
+template <class T> struct is_pointer<T*> : true_type { };
+template <class T> struct is_pointer<const T> : is_pointer<T> { };
+template <class T> struct is_pointer<volatile T> : is_pointer<T> { };
+template <class T> struct is_pointer<const volatile T> : is_pointer<T> { };
+
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+
+namespace internal {
+
+template <class T> struct is_class_or_union {
+ template <class U> static small_ tester(void (U::*)());
+ template <class U> static big_ tester(...);
+ static const bool value = sizeof(tester<T>(0)) == sizeof(small_);
+};
+
+// is_convertible chokes if the first argument is an array. That's why
+// we use add_reference here.
+template <bool NotUnum, class T> struct is_enum_impl
+ : is_convertible<typename add_reference<T>::type, int> { };
+
+template <class T> struct is_enum_impl<true, T> : false_type { };
+
+} // namespace internal
+
+// Specified by TR1 [4.5.1] primary type categories.
+
+// Implementation note:
+//
+// Each type is either void, integral, floating point, array, pointer,
+// reference, member object pointer, member function pointer, enum,
+// union or class. Out of these, only integral, floating point, reference,
+// class and enum types are potentially convertible to int. Therefore,
+// if a type is not a reference, integral, floating point or class and
+// is convertible to int, it's a enum. Adding cv-qualification to a type
+// does not change whether it's an enum.
+//
+// Is-convertible-to-int check is done only if all other checks pass,
+// because it can't be used with some types (e.g. void or classes with
+// inaccessible conversion operators).
+template <class T> struct is_enum
+ : internal::is_enum_impl<
+ is_same<T, void>::value ||
+ is_integral<T>::value ||
+ is_floating_point<T>::value ||
+ is_reference<T>::value ||
+ internal::is_class_or_union<T>::value,
+ T> { };
+
+template <class T> struct is_enum<const T> : is_enum<T> { };
+template <class T> struct is_enum<volatile T> : is_enum<T> { };
+template <class T> struct is_enum<const volatile T> : is_enum<T> { };
+
+#endif
+
+// is_reference is false except for reference types.
+template<typename T> struct is_reference : false_type {};
+template<typename T> struct is_reference<T&> : true_type {};
+
+
+// We can't get is_pod right without compiler help, so fail conservatively.
+// We will assume it's false except for arithmetic types, enumerations,
+// pointers and cv-qualified versions thereof. Note that std::pair<T,U>
+// is not a POD even if T and U are PODs.
+template <class T> struct is_pod
+ : integral_constant<bool, (is_integral<T>::value ||
+ is_floating_point<T>::value ||
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+ // is_enum is not available on MSVC.
+ is_enum<T>::value ||
+#endif
+ is_pointer<T>::value)> { };
+template <class T> struct is_pod<const T> : is_pod<T> { };
+template <class T> struct is_pod<volatile T> : is_pod<T> { };
+template <class T> struct is_pod<const volatile T> : is_pod<T> { };
+
+
+// We can't get has_trivial_constructor right without compiler help, so
+// fail conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial
+// constructors. (3) array of a type with a trivial constructor.
+// (4) const versions thereof.
+template <class T> struct has_trivial_constructor : is_pod<T> { };
+template <class T, class U> struct has_trivial_constructor<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_constructor<T>::value &&
+ has_trivial_constructor<U>::value)> { };
+template <class A, int N> struct has_trivial_constructor<A[N]>
+ : has_trivial_constructor<A> { };
+template <class T> struct has_trivial_constructor<const T>
+ : has_trivial_constructor<T> { };
+
+// We can't get has_trivial_copy right without compiler help, so fail
+// conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial copy
+// constructors. (3) array of a type with a trivial copy constructor.
+// (4) const versions thereof.
+template <class T> struct has_trivial_copy : is_pod<T> { };
+template <class T, class U> struct has_trivial_copy<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_copy<T>::value &&
+ has_trivial_copy<U>::value)> { };
+template <class A, int N> struct has_trivial_copy<A[N]>
+ : has_trivial_copy<A> { };
+template <class T> struct has_trivial_copy<const T> : has_trivial_copy<T> { };
+
+// We can't get has_trivial_assign right without compiler help, so fail
+// conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial copy
+// constructors. (3) array of a type with a trivial assign constructor.
+template <class T> struct has_trivial_assign : is_pod<T> { };
+template <class T, class U> struct has_trivial_assign<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_assign<T>::value &&
+ has_trivial_assign<U>::value)> { };
+template <class A, int N> struct has_trivial_assign<A[N]>
+ : has_trivial_assign<A> { };
+
+// We can't get has_trivial_destructor right without compiler help, so
+// fail conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial
+// destructors. (3) array of a type with a trivial destructor.
+// (4) const versions thereof.
+template <class T> struct has_trivial_destructor : is_pod<T> { };
+template <class T, class U> struct has_trivial_destructor<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_destructor<T>::value &&
+ has_trivial_destructor<U>::value)> { };
+template <class A, int N> struct has_trivial_destructor<A[N]>
+ : has_trivial_destructor<A> { };
+template <class T> struct has_trivial_destructor<const T>
+ : has_trivial_destructor<T> { };
+
+// Specified by TR1 [4.7.1]
+template<typename T> struct remove_const { typedef T type; };
+template<typename T> struct remove_const<T const> { typedef T type; };
+template<typename T> struct remove_volatile { typedef T type; };
+template<typename T> struct remove_volatile<T volatile> { typedef T type; };
+template<typename T> struct remove_cv {
+ typedef typename remove_const<typename remove_volatile<T>::type>::type type;
+};
+
+
+// Specified by TR1 [4.7.2] Reference modifications.
+template<typename T> struct remove_reference { typedef T type; };
+template<typename T> struct remove_reference<T&> { typedef T type; };
+
+template <typename T> struct add_reference { typedef T& type; };
+template <typename T> struct add_reference<T&> { typedef T& type; };
+
+// Specified by TR1 [4.7.4] Pointer modifications.
+template<typename T> struct remove_pointer { typedef T type; };
+template<typename T> struct remove_pointer<T*> { typedef T type; };
+template<typename T> struct remove_pointer<T* const> { typedef T type; };
+template<typename T> struct remove_pointer<T* volatile> { typedef T type; };
+template<typename T> struct remove_pointer<T* const volatile> {
+ typedef T type; };
+
+// Specified by TR1 [4.6] Relationships between types
+template<typename T, typename U> struct is_same : public false_type { };
+template<typename T> struct is_same<T, T> : public true_type { };
+
+// Specified by TR1 [4.6] Relationships between types
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+namespace internal {
+
+// This class is an implementation detail for is_convertible, and you
+// don't need to know how it works to use is_convertible. For those
+// who care: we declare two different functions, one whose argument is
+// of type To and one with a variadic argument list. We give them
+// return types of different size, so we can use sizeof to trick the
+// compiler into telling us which function it would have chosen if we
+// had called it with an argument of type From. See Alexandrescu's
+// _Modern C++ Design_ for more details on this sort of trick.
+
+template <typename From, typename To>
+struct ConvertHelper {
+ static small_ Test(To);
+ static big_ Test(...);
+ static From Create();
+};
+} // namespace internal
+
+// Inherits from true_type if From is convertible to To, false_type otherwise.
+template <typename From, typename To>
+struct is_convertible
+ : integral_constant<bool,
+ sizeof(internal::ConvertHelper<From, To>::Test(
+ internal::ConvertHelper<From, To>::Create()))
+ == sizeof(small_)> {
+};
+#endif
+
+}
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QTYPETRAITS_H
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 7a1357959e..c6f174bcf8 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -1223,12 +1223,11 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
/*!
\fn bool QAbstractItemModel::insertRow(int row, const QModelIndex &parent)
- \note The base class implementation of this function does nothing and
- returns false.
-
Inserts a single row before the given \a row in the child items of the
\a parent specified.
+ \note This function calls the virtual method insertRows.
+
Returns true if the row is inserted; otherwise returns false.
\sa insertRows() insertColumn() removeRow()
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index 433a68105d..6bae2001a1 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -122,10 +122,10 @@ QJsonArray &QJsonArray::operator =(const QJsonArray &other)
if (d && !d->ref.deref())
delete d;
d = other.d;
- a = other.a;
if (d)
d->ref.ref();
}
+ a = other.a;
return *this;
}
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index cfe71e8959..e14000fac3 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -125,10 +125,10 @@ QJsonObject &QJsonObject::operator =(const QJsonObject &other)
if (d && !d->ref.deref())
delete d;
d = other.d;
- o = other.o;
if (d)
d->ref.ref();
}
+ o = other.o;
return *this;
}
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 0a5181a508..cf76511f25 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -137,7 +137,11 @@ public:
static void installTranslator(QTranslator * messageFile);
static void removeTranslator(QTranslator * messageFile);
#endif
- enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1 };
+ enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1
+#if QT_DEPRECATED_SINCE(5, 0)
+ , CodecForTr = Latin1
+#endif
+ };
static QString translate(const char * context,
const char * key,
const char * disambiguation = 0,
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index a5dc179113..8474635fe7 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -375,8 +375,9 @@ void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp,
\sa type(), isRegistered(), Type
*/
-const char *QMetaType::typeName(int type)
+const char *QMetaType::typeName(int typeId)
{
+ const uint type = typeId;
// In theory it can be filled during compilation time, but for some reason template code
// that is able to do it causes GCC 4.6 to generate additional 3K of executable code. Probably
// it is not worth of it.
@@ -398,7 +399,7 @@ const char *QMetaType::typeName(int type)
} else {
const QVector<QCustomTypeInfo> * const ct = customTypes();
QReadLocker locker(customTypesLock());
- return ct && ct->count() > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty()
+ return ct && uint(ct->count()) > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty()
? ct->at(type - QMetaType::User).typeName.constData()
: 0;
}
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index fb2bce7d7b..4eadb34ea1 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -45,6 +45,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
#include <QtCore/qbytearray.h>
+#include <QtCore/qisenum.h>
#include <new>
@@ -210,7 +211,8 @@ public:
NeedsConstruction = 0x1,
NeedsDestruction = 0x2,
MovableType = 0x4,
- PointerToQObject = 0x8
+ PointerToQObject = 0x8,
+ IsEnumeration = 0x10
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
@@ -466,6 +468,8 @@ int qRegisterMetaType(const char *typeName
}
if (QtPrivate::IsPointerToTypeDerivedFromQObject<T>::Value)
flags |= QMetaType::PointerToQObject;
+ if (Q_IS_ENUM(T))
+ flags |= QMetaType::IsEnumeration;
return QMetaType::registerType(typeName, qMetaTypeDeleteHelper<T>,
qMetaTypeCreateHelper<T>,
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 39e8b4360f..8058a06117 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1676,12 +1676,12 @@ void QVariant::load(QDataStream &s)
// by moving all ids down by 97.
typeId -= 97;
} else if (typeId == 69 /* QIcon */) {
- // In Qt5 after modularization project this types where moved to a separate module (and ids were downgraded)
+ // In Qt5 after modularization project these types where moved to a separate module (and ids were downgraded)
typeId = QMetaType::QIcon;
} else if (typeId == 75 /* QSizePolicy */) {
typeId = QMetaType::QSizePolicy;
} else if (typeId >= 70) {
- // and as a result this types recieved lower ids too
+ // and as a result these types received lower ids too
if (typeId <= 74) { // QImage QPolygon QRegion QBitmap QCursor
typeId -=1;
} else if (typeId <= 86) { // QKeySequence QPen QTextLength QTextFormat QMatrix QTransform QMatrix4x4 QVector2D QVector3D QVector4D QQuaternion
@@ -1749,12 +1749,12 @@ void QVariant::save(QDataStream &s) const
// by moving all ids down by 97.
typeId += 97;
} else if (typeId == QMetaType::QIcon) {
- // In Qt5 after modularization project this types where moved to a separate module (and ids were downgraded)
+ // In Qt5 after modularization project these types where moved to a separate module (and ids were downgraded)
typeId = 69;
} else if (typeId == QMetaType::QSizePolicy) {
typeId = 75;
} else if (typeId >= QMetaType::QImage) {
- // and as a result this types recieved lower ids too
+ // and as a result these types received lower ids too
if (typeId <= QMetaType::QCursor) {
typeId +=1;
} else if (typeId <= QMetaType::QQuaternion) {
@@ -2445,6 +2445,8 @@ bool QVariant::canConvert(int targetTypeId) const
if (currentType == uint(targetTypeId))
return true;
+ if (targetTypeId < 0 || targetTypeId >= QMetaType::User)
+ return false;
// FIXME It should be LastCoreType intead of Uuid
if (currentType > int(QMetaType::QUuid) || targetTypeId > int(QMetaType::QUuid)) {
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 4099487f9b..ebf687bb4b 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QDebug>
#include <QtCore/QLocale>
+#include <memory>
+
QT_BEGIN_NAMESPACE
bool qt_isQMimeTypeDebuggingActivated (false);
@@ -62,27 +64,19 @@ bool qt_isQMimeTypeDebuggingActivated (false);
#endif
QMimeTypePrivate::QMimeTypePrivate()
- : name()
- //, comment()
- , localeComments()
- , genericIconName()
- , iconName()
- , globPatterns()
{}
QMimeTypePrivate::QMimeTypePrivate(const QMimeType &other)
- : name(other.d->name)
- //, comment(other.d->comment)
- , localeComments(other.d->localeComments)
- , genericIconName(other.d->genericIconName)
- , iconName(other.d->iconName)
- , globPatterns(other.d->globPatterns)
+ : name(other.d->name),
+ localeComments(other.d->localeComments),
+ genericIconName(other.d->genericIconName),
+ iconName(other.d->iconName),
+ globPatterns(other.d->globPatterns)
{}
void QMimeTypePrivate::clear()
{
name.clear();
- //comment.clear();
localeComments.clear();
genericIconName.clear();
iconName.clear();
@@ -97,7 +91,6 @@ bool QMimeTypePrivate::operator==(const QMimeTypePrivate &other) const
{
DBG();
if (name == other.name &&
- //comment == other.comment &&
localeComments == other.localeComments &&
genericIconName == other.genericIconName &&
iconName == other.iconName &&
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 2ecd934100..c029f627b2 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -42,6 +42,7 @@
#ifndef QLOCALE_H
#define QLOCALE_H
+#include <QtCore/qvariant.h>
#include <QtCore/qstring.h>
#include <QtCore/qobjectdefs.h>
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 0fa7d6459e..1db78519a3 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -47,6 +47,8 @@
#include <QtCore/qvector.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qthreadstorage.h>
+#include <QtCore/qglobal.h>
#include <pcre.h>
@@ -989,6 +991,47 @@ void QRegularExpressionPrivate::getPatternInfo()
(patternNewlineSetting == PCRE_NEWLINE_ANYCRLF);
}
+
+/*!
+ \class QPcreJitStackPointer
+ \internal
+
+ Simple "smartpointer" wrapper around a pcre_jit_stack, to be used with
+ QThreadStorage.
+*/
+class QPcreJitStackPointer
+{
+ Q_DISABLE_COPY(QPcreJitStackPointer);
+
+public:
+ QPcreJitStackPointer()
+ {
+ // The default JIT stack size in PCRE is 32K,
+ // we allocate from 32K up to 512K.
+ stack = pcre16_jit_stack_alloc(32*1024, 512*1024);
+ }
+ ~QPcreJitStackPointer()
+ {
+ if (stack)
+ pcre16_jit_stack_free(stack);
+ }
+
+ pcre16_jit_stack *stack;
+};
+
+Q_GLOBAL_STATIC(QThreadStorage<QPcreJitStackPointer *>, jitStacks)
+
+/*!
+ \internal
+*/
+static pcre16_jit_stack *qtPcreCallback(void *)
+{
+ if (jitStacks()->hasLocalData())
+ return jitStacks()->localData()->stack;
+
+ return 0;
+}
+
/*!
\internal
*/
@@ -1044,6 +1087,9 @@ pcre16_extra *QRegularExpressionPrivate::optimizePattern()
const char *err;
studyData = pcre16_study(compiledPattern, studyOptions, &err);
+ if (studyData && studyData->flags & PCRE_EXTRA_EXECUTABLE_JIT)
+ pcre16_assign_jit_stack(studyData, qtPcreCallback, 0);
+
if (!studyData && err)
qWarning("QRegularExpressionPrivate::optimizePattern(): pcre_study failed: %s", err);
@@ -1060,6 +1106,9 @@ int QRegularExpressionPrivate::captureIndexForName(const QString &name) const
{
Q_ASSERT(!name.isEmpty());
+ if (!compiledPattern)
+ return -1;
+
int index = pcre16_get_stringnumber(compiledPattern, name.utf16());
if (index >= 0)
return index;
@@ -1070,6 +1119,32 @@ int QRegularExpressionPrivate::captureIndexForName(const QString &name) const
/*!
\internal
+ This is a simple wrapper for pcre16_exec for handling the case in which the
+ JIT runs out of memory. In that case, we allocate a thread-local JIT stack
+ and re-run pcre16_exec.
+*/
+static int pcre16SafeExec(const pcre16 *code, const pcre16_extra *extra,
+ const unsigned short *subject, int length,
+ int startOffset, int options,
+ int *ovector, int ovecsize)
+{
+ int result = pcre16_exec(code, extra, subject, length,
+ startOffset, options, ovector, ovecsize);
+
+ if (result == PCRE_ERROR_JIT_STACKLIMIT && !jitStacks()->hasLocalData()) {
+ QPcreJitStackPointer *p = new QPcreJitStackPointer;
+ jitStacks()->setLocalData(p);
+
+ result = pcre16_exec(code, extra, subject, length,
+ startOffset, options, ovector, ovecsize);
+ }
+
+ return result;
+}
+
+/*!
+ \internal
+
Performs a match of type \a matchType on the given \a subject string with
options \a matchOptions and returns the QRegularExpressionMatchPrivate of
the result. It also advances a match if a previous result is given as \a
@@ -1134,15 +1209,15 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString
int result;
if (!previousMatchWasEmpty) {
- result = pcre16_exec(compiledPattern, currentStudyData,
- subjectUtf16, subjectLength,
- offset, pcreOptions,
- captureOffsets, captureOffsetsCount);
+ result = pcre16SafeExec(compiledPattern, currentStudyData,
+ subjectUtf16, subjectLength,
+ offset, pcreOptions,
+ captureOffsets, captureOffsetsCount);
} else {
- result = pcre16_exec(compiledPattern, currentStudyData,
- subjectUtf16, subjectLength,
- offset, pcreOptions | PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED,
- captureOffsets, captureOffsetsCount);
+ result = pcre16SafeExec(compiledPattern, currentStudyData,
+ subjectUtf16, subjectLength,
+ offset, pcreOptions | PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED,
+ captureOffsets, captureOffsetsCount);
if (result == PCRE_ERROR_NOMATCH) {
++offset;
@@ -1157,10 +1232,10 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString
++offset;
}
- result = pcre16_exec(compiledPattern, currentStudyData,
- subjectUtf16, subjectLength,
- offset, pcreOptions,
- captureOffsets, captureOffsetsCount);
+ result = pcre16SafeExec(compiledPattern, currentStudyData,
+ subjectUtf16, subjectLength,
+ offset, pcreOptions,
+ captureOffsets, captureOffsetsCount);
}
}
@@ -2131,4 +2206,119 @@ QDebug operator<<(QDebug debug, const QRegularExpressionMatch &match)
}
#endif
+// fool lupdate: make it extract those strings for translation, but don't put them
+// inside Qt -- they're already inside libpcre (cf. man 3 pcreapi, pcre_compile.c).
+#if 0
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2012 University of Cambridge
+
+-----------------------------------------------------------------------------
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the University of Cambridge nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+-----------------------------------------------------------------------------
+*/
+
+static const char *pcreCompileErrorCodes[] =
+{
+ QT_TRANSLATE_NOOP("QRegularExpression", "no error"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\ at end of pattern"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\c at end of pattern"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character follows \\"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "numbers out of order in {} quantifier"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "number too big in {} quantifier"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "missing terminating ] for character class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid escape sequence in character class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "range out of order in character class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "nothing to repeat"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: unexpected repeat"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character after (? or (?-"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "POSIX named classes are supported only within a class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "missing )"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "reference to non-existent subpattern"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "erroffset passed as NULL"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unknown option bit(s) set"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "missing ) after comment"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "regular expression is too large"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "failed to get memory"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unmatched parentheses"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: code overflow"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character after (?<"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "lookbehind assertion is not fixed length"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "malformed number or name after (?("),
+ QT_TRANSLATE_NOOP("QRegularExpression", "conditional group contains more than two branches"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "assertion expected after (?("),
+ QT_TRANSLATE_NOOP("QRegularExpression", "(?R or (?[+-]digits must be followed by )"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unknown POSIX class name"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "POSIX collating elements are not supported"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "this version of PCRE is not compiled with PCRE_UTF8 support"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "character value in \\x{...} sequence is too large"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid condition (?(0)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\C not allowed in lookbehind assertion"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "number after (?C is > 255"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "closing ) for (?C expected"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "recursive call could loop indefinitely"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character after (?P"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "syntax error in subpattern name (missing terminator)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "two named subpatterns have the same name"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid UTF-8 string"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "support for \\P, \\p, and \\X has not been compiled"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "malformed \\P or \\p sequence"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unknown property name after \\P or \\p"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "subpattern name is too long (maximum 32 characters)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "too many named subpatterns (maximum 10000)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "octal value is greater than \\377 (not in UTF-8 mode)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: overran compiling workspace"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: previously-checked referenced subpattern not found"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "DEFINE group contains more than one branch"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "repeating a DEFINE group is not allowed"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "inconsistent NEWLINE options"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "a numbered reference must not be zero"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "(*VERB) not recognized"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "number is too big"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "subpattern name expected"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "digit expected after (?+"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "] is an invalid data character in JavaScript compatibility mode"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "different names for subpatterns of the same number are not allowed"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "(*MARK) must have an argument"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "this version of PCRE is not compiled with PCRE_UCP support"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\c must be followed by an ASCII character"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\k is not followed by a braced, angle-bracketed, or quoted name"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: unknown opcode in find_fixedlength()"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\N is not supported in a class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "too many forward references"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid UTF-16 string")
+};
+#endif // #if 0
+
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index e5b290ae1f..cb89fccc2d 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -257,7 +257,8 @@ QT_BEGIN_NAMESPACE
\value SelectionWithin Several changes to a selection has occurred in an item
view.
\value SoundPlayed A sound has been played by an object
- \value StateChanged The QAccessible::State of an object has changed.
+ \omitvalue StateChanged The QAccessible::State of an object has changed.
+ This value is used internally for the QAccessibleStateChangeEvent.
\value TableCaptionChanged A table caption has been changed.
\value TableColumnDescriptionChanged The description of a table column, typically found in
the column's header, has been changed.
@@ -308,6 +309,7 @@ QT_BEGIN_NAMESPACE
\value ColumnHeader A header for a column of data.
\value ComboBox A list of choices that the user can select from.
\value Cursor An object that represents the mouse cursor.
+ \value Desktop The object represents the desktop or workspace.
\value Dial An object that represents a dial or knob.
\value Dialog A dialog box.
\value Document A document window, usually in an MDI environment.
@@ -345,6 +347,7 @@ QT_BEGIN_NAMESPACE
\value StaticText Static text, such as labels for other widgets.
\value StatusBar A status bar.
\value Table A table representing data in a grid of rows and columns.
+ \value Terminal A terminal or command line interface.
\value TitleBar The title bar caption of a window.
\value ToolBar A tool bar, which groups widgets that the user accesses frequently.
\value ToolTip A tool tip which provides information about other objects.
@@ -694,9 +697,32 @@ void QAccessible::updateAccessibility(const QAccessibleEvent &event)
This class should be created on the stack and used as parameter for
\l QAccessible::updateAccessibility().
+ \sa QAccessibleStateChangedEvent
*/
/*!
+ \class QAccessibleStateChangedEvent
+ \brief This subclass of QAccessibleEvent is used to inform about state changes.
+ \internal
+
+ \ingroup accessibility
+ \inmodule QtGui
+
+ This class should be created on the stack and used as parameter for
+ \l QAccessible::updateAccessibility().
+ In addition to the regular \l QAccessibleEvent it contains details about which states
+ changed.
+ \sa QAccessibleEvent
+*/
+
+/*!
+ \fn QAccessibleStateChangeEvent::changedStates() const
+ All states that have changed are set to true. This does not reflect the state of the object,
+ but indicates which states are changed.
+ Use the \l QAccessibleInterface::state() function to get the current state.
+ */
+
+/*!
Returns the QAccessibleInterface associated with the event.
The caller of this function takes ownership of the returned interface.
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 6ad1bb9da9..e8a5cf8bad 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -292,6 +292,7 @@ public:
// Additional Qt roles where enum value does not map directly to MSAA:
LayeredPane = 0x0000003F,
Terminal = 0x00000040,
+ Desktop = 0x00000041,
UserRole = 0x0000ffff
};
@@ -436,6 +437,9 @@ public:
Q_ASSERT(obj);
}
+ virtual ~QAccessibleEvent()
+ {}
+
QAccessible::Event type() const { return m_type; }
QObject *object() const { return m_object; }
int child() const { return m_child; }
@@ -448,6 +452,21 @@ private:
int m_child;
};
+class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent
+{
+public:
+ inline QAccessibleStateChangeEvent(QAccessible::State state, QObject *obj, int chld = -1)
+ : QAccessibleEvent(QAccessible::StateChanged, obj, chld), m_changedStates(state)
+ {}
+
+ QAccessible::State changedStates() const {
+ return m_changedStates;
+ }
+
+private:
+ QAccessible::State m_changedStates;
+};
+
#define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index b84c484f74..61e46ebf04 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -70,24 +70,6 @@ namespace QAccessible2
LineBoundary,
NoBoundary
};
-
- enum TableModelChangeType {
- TableModelChangeInsert,
- TableModelChangeDelete,
- TableModelChangeUpdate
- };
-
- struct TableModelChange {
- int firstColumn;
- int firstRow;
- int lastColumn;
- int lastRow;
- TableModelChangeType type;
-
- TableModelChange()
- : firstColumn(0), firstRow(0), lastColumn(0), lastRow(0), type(TableModelChangeUpdate)
- {}
- };
}
class Q_GUI_EXPORT QAccessibleTextInterface
@@ -230,19 +212,8 @@ public:
virtual bool unselectRow(int row) = 0;
// Unselects one column, leaving other selected columns selected (if any).
virtual bool unselectColumn(int column) = 0;
- // Returns the type and extents describing how a table changed.
- virtual QAccessible2::TableModelChange modelChange() const = 0;
protected:
- // These functions are called when the model changes.
- virtual void modelReset() = 0;
- virtual void rowsInserted(const QModelIndex &parent, int first, int last) = 0;
- virtual void rowsRemoved(const QModelIndex &parent, int first, int last) = 0;
- virtual void columnsInserted(const QModelIndex &parent, int first, int last) = 0;
- virtual void columnsRemoved(const QModelIndex &parent, int first, int last) = 0;
- virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) = 0;
- virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column) = 0;
-
friend class QAbstractItemView;
friend class QAbstractItemViewPrivate;
};
diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri
deleted file mode 100644
index e4a2bbef75..0000000000
--- a/src/gui/egl/egl.pri
+++ /dev/null
@@ -1,26 +0,0 @@
-contains(QT_CONFIG, egl): {
- CONFIG += egl
-
- HEADERS += \
- egl/qegl_p.h \
- egl/qeglcontext_p.h \
- egl/qeglproperties_p.h
-
- SOURCES += \
- egl/qegl.cpp \
- egl/qeglproperties.cpp
- unix {
- !isEmpty(QMAKE_INCDIR_EGL){
- INCLUDEPATH += $$QMAKE_INCDIR_EGL
- }
- !isEmpty(QMAKE_LIBDIR_EGL){
- for(p, QMAKE_LIBDIR_EGL) {
- exists($$p):LIBS += -L$$p
- }
- }
-
- !isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
- }
-
- SOURCES += egl/qegl_qpa.cpp
-}
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
deleted file mode 100644
index 067886cf5a..0000000000
--- a/src/gui/egl/qegl.cpp
+++ /dev/null
@@ -1,751 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/qpaintdevice.h>
-#include <QtGui/qpixmap.h>
-#include <QtGui/qwidget.h>
-#include <QtCore/qatomic.h>
-#include <QtCore/qdebug.h>
-
-#include "qegl_p.h"
-#include "qeglcontext_p.h"
-
-
-QT_BEGIN_NAMESPACE
-
-
-/*
- QEglContextTracker is used to track the EGL contexts that we
- create internally in Qt, so that we can call eglTerminate() to
- free additional EGL resources when the last context is destroyed.
-*/
-
-class QEglContextTracker
-{
-public:
- static void ref() { contexts.ref(); }
- static void deref() {
- if (!contexts.deref()) {
- eglTerminate(QEgl::display());
- displayOpen = 0;
- }
- }
- static void setDisplayOpened() { displayOpen = 1; }
- static bool displayOpened() { return displayOpen; }
-
-private:
- static QBasicAtomicInt contexts;
- static QBasicAtomicInt displayOpen;
-};
-
-QBasicAtomicInt QEglContextTracker::contexts = Q_BASIC_ATOMIC_INITIALIZER(0);
-QBasicAtomicInt QEglContextTracker::displayOpen = Q_BASIC_ATOMIC_INITIALIZER(0);
-
-// Current GL and VG contexts. These are used to determine if
-// we can avoid an eglMakeCurrent() after a call to lazyDoneCurrent().
-// If a background thread modifies the value, the worst that will
-// happen is a redundant eglMakeCurrent() in the foreground thread.
-static QEglContext * volatile currentGLContext = 0;
-static QEglContext * volatile currentVGContext = 0;
-
-QEglContext::QEglContext()
- : apiType(QEgl::OpenGL)
- , ctx(EGL_NO_CONTEXT)
- , cfg(QEGL_NO_CONFIG)
- , currentSurface(EGL_NO_SURFACE)
- , current(false)
- , ownsContext(true)
- , sharing(false)
-{
- QEglContextTracker::ref();
-}
-
-QEglContext::~QEglContext()
-{
- destroyContext();
-
- if (currentGLContext == this)
- currentGLContext = 0;
- if (currentVGContext == this)
- currentVGContext = 0;
- QEglContextTracker::deref();
-}
-
-bool QEglContext::isValid() const
-{
- return (ctx != EGL_NO_CONTEXT);
-}
-
-bool QEglContext::isCurrent() const
-{
- return current;
-}
-
-EGLConfig QEgl::defaultConfig(int devType, API api, ConfigOptions options)
-{
- if ( (devType != QInternal::Pixmap) && ((options & Renderable) == 0))
- qWarning("QEgl::defaultConfig() - Only configs for pixmaps make sense to be read-only!");
-
- EGLConfig* targetConfig = 0;
-
- static EGLConfig defaultVGConfigs[] = {
- QEGL_NO_CONFIG, // 0 Window Renderable Translucent
- QEGL_NO_CONFIG, // 1 Window Renderable Opaque
- QEGL_NO_CONFIG, // 2 Pixmap Renderable Translucent
- QEGL_NO_CONFIG, // 3 Pixmap Renderable Opaque
- QEGL_NO_CONFIG, // 4 Pixmap ReadOnly Translucent
- QEGL_NO_CONFIG // 5 Pixmap ReadOnly Opaque
- };
- if (api == OpenVG) {
- if (devType == QInternal::Widget) {
- if (options & Translucent)
- targetConfig = &(defaultVGConfigs[0]);
- else
- targetConfig = &(defaultVGConfigs[1]);
- } else if (devType == QInternal::Pixmap) {
- if (options & Renderable) {
- if (options & Translucent)
- targetConfig = &(defaultVGConfigs[2]);
- else // Opaque
- targetConfig = &(defaultVGConfigs[3]);
- } else { // Read-only
- if (options & Translucent)
- targetConfig = &(defaultVGConfigs[4]);
- else // Opaque
- targetConfig = &(defaultVGConfigs[5]);
- }
- }
- }
-
-
- static EGLConfig defaultGLConfigs[] = {
- QEGL_NO_CONFIG, // 0 Window Renderable Translucent
- QEGL_NO_CONFIG, // 1 Window Renderable Opaque
- QEGL_NO_CONFIG, // 2 PBuffer Renderable Translucent
- QEGL_NO_CONFIG, // 3 PBuffer Renderable Opaque
- QEGL_NO_CONFIG, // 4 Pixmap Renderable Translucent
- QEGL_NO_CONFIG, // 5 Pixmap Renderable Opaque
- QEGL_NO_CONFIG, // 6 Pixmap ReadOnly Translucent
- QEGL_NO_CONFIG // 7 Pixmap ReadOnly Opaque
- };
- if (api == OpenGL) {
- if (devType == QInternal::Widget) {
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[0]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[1]);
- } else if (devType == QInternal::Pbuffer) {
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[2]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[3]);
- } else if (devType == QInternal::Pixmap) {
- if (options & Renderable) {
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[4]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[5]);
- } else { // ReadOnly
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[6]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[7]);
- }
- }
- }
-
- if (!targetConfig) {
- qWarning("QEgl::defaultConfig() - No default config for device/api/options combo");
- return QEGL_NO_CONFIG;
- }
- if (*targetConfig != QEGL_NO_CONFIG)
- return *targetConfig;
-
-
- // We haven't found an EGL config for the target config yet, so do it now:
-
-
- // Allow overriding from an environment variable:
- QByteArray configId;
- if (api == OpenVG)
- configId = qgetenv("QT_VG_EGL_CONFIG");
- else
- configId = qgetenv("QT_GL_EGL_CONFIG");
- if (!configId.isEmpty()) {
- // Overridden, so get the EGLConfig for the specified config ID:
- EGLint properties[] = {
- EGL_CONFIG_ID, (EGLint)configId.toInt(),
- EGL_NONE
- };
- EGLint configCount = 0;
- eglChooseConfig(display(), properties, targetConfig, 1, &configCount);
- if (configCount > 0)
- return *targetConfig;
- qWarning() << "QEgl::defaultConfig() -" << configId << "appears to be invalid";
- }
-
- QEglProperties configAttribs;
- configAttribs.setRenderableType(api);
-
- EGLint surfaceType;
- switch (devType) {
- case QInternal::Widget:
- surfaceType = EGL_WINDOW_BIT;
- break;
- case QInternal::Pixmap:
- surfaceType = EGL_PIXMAP_BIT;
- break;
- case QInternal::Pbuffer:
- surfaceType = EGL_PBUFFER_BIT;
- break;
- default:
- qWarning("QEgl::defaultConfig() - Can't create EGL surface for %d device type", devType);
- return QEGL_NO_CONFIG;
- };
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- // For OpenVG, we try to create a surface using a pre-multiplied format if
- // the surface needs to have an alpha channel:
- if (api == OpenVG && (options & Translucent))
- surfaceType |= EGL_VG_ALPHA_FORMAT_PRE_BIT;
-#endif
- configAttribs.setValue(EGL_SURFACE_TYPE, surfaceType);
-
-#ifdef EGL_BIND_TO_TEXTURE_RGBA
- if (devType == QInternal::Pixmap || devType == QInternal::Pbuffer) {
- if (options & Translucent)
- configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE);
- else
- configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE);
- }
-#endif
-
- // Add paint engine requirements
- if (api == OpenVG) {
-#if !defined(QVG_SCISSOR_CLIP) && defined(EGL_ALPHA_MASK_SIZE)
- configAttribs.setValue(EGL_ALPHA_MASK_SIZE, 1);
-#endif
- } else {
- // Both OpenGL paint engines need to have stencil and sample buffers
- configAttribs.setValue(EGL_STENCIL_SIZE, 1);
- configAttribs.setValue(EGL_SAMPLE_BUFFERS, 1);
-#ifndef QT_OPENGL_ES_2
- // Additionally, the GL1 engine likes to have a depth buffer for clipping
- configAttribs.setValue(EGL_DEPTH_SIZE, 1);
-#endif
- }
-
- if (options & Translucent)
- configAttribs.setValue(EGL_ALPHA_SIZE, 1);
-
- *targetConfig = chooseConfig(&configAttribs, QEgl::BestPixelFormat);
- return *targetConfig;
-}
-
-
-// Choose a configuration that matches "properties".
-EGLConfig QEgl::chooseConfig(const QEglProperties* properties, QEgl::PixelFormatMatch match)
-{
- QEglProperties props(*properties);
- EGLConfig cfg = QEGL_NO_CONFIG;
- do {
- // Get the number of matching configurations for this set of properties.
- EGLint matching = 0;
- EGLDisplay dpy = QEgl::display();
- if (!eglChooseConfig(dpy, props.properties(), 0, 0, &matching) || !matching)
- continue;
-
- // If we want the best pixel format, then return the first
- // matching configuration.
- if (match == QEgl::BestPixelFormat) {
- eglChooseConfig(display(), props.properties(), &cfg, 1, &matching);
- if (matching < 1)
- continue;
- return cfg;
- }
-
- // Fetch all of the matching configurations and find the
- // first that matches the pixel format we wanted.
- EGLint size = matching;
- EGLConfig *configs = new EGLConfig [size];
- eglChooseConfig(display(), props.properties(), configs, size, &matching);
- for (EGLint index = 0; index < size; ++index) {
- EGLint red, green, blue, alpha;
- eglGetConfigAttrib(display(), configs[index], EGL_RED_SIZE, &red);
- eglGetConfigAttrib(display(), configs[index], EGL_GREEN_SIZE, &green);
- eglGetConfigAttrib(display(), configs[index], EGL_BLUE_SIZE, &blue);
- eglGetConfigAttrib(display(), configs[index], EGL_ALPHA_SIZE, &alpha);
- if (red == props.value(EGL_RED_SIZE) &&
- green == props.value(EGL_GREEN_SIZE) &&
- blue == props.value(EGL_BLUE_SIZE) &&
- (props.value(EGL_ALPHA_SIZE) == 0 ||
- alpha == props.value(EGL_ALPHA_SIZE))) {
- cfg = configs[index];
- delete [] configs;
- return cfg;
- }
- }
- delete [] configs;
- } while (props.reduceConfiguration());
-
-#ifdef EGL_BIND_TO_TEXTURE_RGBA
- // Don't report an error just yet if we failed to get a pbuffer
- // configuration with texture rendering. Only report failure if
- // we cannot get any pbuffer configurations at all.
- if (props.value(EGL_BIND_TO_TEXTURE_RGBA) == EGL_DONT_CARE &&
- props.value(EGL_BIND_TO_TEXTURE_RGB) == EGL_DONT_CARE)
-#endif
- {
- qWarning() << "QEglContext::chooseConfig(): Could not find a suitable EGL configuration";
- qWarning() << "Requested:" << props.toString();
- qWarning() << "Available:";
- QEgl::dumpAllConfigs();
- }
- return QEGL_NO_CONFIG;
-}
-
-bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match)
-{
- cfg = QEgl::chooseConfig(&properties, match);
- return cfg != QEGL_NO_CONFIG;
-}
-
-EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties *properties)
-{
- return QEgl::createSurface(device, cfg, properties);
-}
-
-
-// Create the EGLContext.
-bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties)
-{
- // We need to select the correct API before calling eglCreateContext().
-#ifdef QT_OPENGL_ES
-#ifdef EGL_OPENGL_ES_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
-#else
-#ifdef EGL_OPENGL_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_API);
-#endif
-#endif //defined(QT_OPENGL_ES)
-#ifdef EGL_OPENVG_API
- if (apiType == QEgl::OpenVG)
- eglBindAPI(EGL_OPENVG_API);
-#endif
-
- // Create a new context for the configuration.
- QEglProperties contextProps;
- if (properties)
- contextProps = *properties;
-#ifdef QT_OPENGL_ES_2
- if (apiType == QEgl::OpenGL)
- contextProps.setValue(EGL_CONTEXT_CLIENT_VERSION, 2);
-#endif
- sharing = false;
- if (shareContext && shareContext->ctx == EGL_NO_CONTEXT)
- shareContext = 0;
- if (shareContext) {
- ctx = eglCreateContext(QEgl::display(), cfg, shareContext->ctx, contextProps.properties());
- if (ctx == EGL_NO_CONTEXT) {
- qWarning() << "QEglContext::createContext(): Could not share context:" << QEgl::errorString();
- shareContext = 0;
- } else {
- sharing = true;
- }
- }
- if (ctx == EGL_NO_CONTEXT) {
- ctx = eglCreateContext(display(), cfg, EGL_NO_CONTEXT, contextProps.properties());
- if (ctx == EGL_NO_CONTEXT) {
- qWarning() << "QEglContext::createContext(): Unable to create EGL context:" << QEgl::errorString();
- return false;
- }
- }
- return true;
-}
-
-// Destroy an EGL surface object. If it was current on this context
-// then call doneCurrent() for it first.
-void QEglContext::destroySurface(EGLSurface surface)
-{
- if (surface != EGL_NO_SURFACE) {
- if (surface == currentSurface)
- doneCurrent();
- eglDestroySurface(display(), surface);
- }
-}
-
-// Destroy the context. Note: this does not destroy the surface.
-void QEglContext::destroyContext()
-{
- if (ctx != EGL_NO_CONTEXT && ownsContext)
- eglDestroyContext(display(), ctx);
- ctx = EGL_NO_CONTEXT;
- cfg = 0;
-}
-
-bool QEglContext::makeCurrent(EGLSurface surface)
-{
- if (ctx == EGL_NO_CONTEXT) {
- qWarning() << "QEglContext::makeCurrent(): Cannot make invalid context current";
- return false;
- }
-
- if (surface == EGL_NO_SURFACE) {
- qWarning() << "QEglContext::makeCurrent(): Cannot make invalid surface current";
- return false;
- }
-
- // If lazyDoneCurrent() was called on the surface, then we may be able
- // to assume that it is still current within the thread.
- if (surface == currentSurface && currentContext(apiType) == this) {
- current = true;
- return true;
- }
-
- current = true;
- currentSurface = surface;
- setCurrentContext(apiType, this);
-
- // Force the right API to be bound before making the context current.
- // The EGL implementation should be able to figure this out from ctx,
- // but some systems require the API to be explicitly set anyway.
-#ifdef EGL_OPENGL_ES_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
-#ifdef EGL_OPENVG_API
- if (apiType == QEgl::OpenVG)
- eglBindAPI(EGL_OPENVG_API);
-#endif
-
- bool ok = eglMakeCurrent(QEgl::display(), surface, surface, ctx);
- if (!ok)
- qWarning() << "QEglContext::makeCurrent(" << surface << "):" << QEgl::errorString();
- return ok;
-}
-
-bool QEglContext::doneCurrent()
-{
- // If the context is invalid, we assume that an error was reported
- // when makeCurrent() was called.
- if (ctx == EGL_NO_CONTEXT)
- return false;
-
- current = false;
- currentSurface = EGL_NO_SURFACE;
- setCurrentContext(apiType, 0);
-
- // We need to select the correct API before calling eglMakeCurrent()
- // with EGL_NO_CONTEXT because threads can have both OpenGL and OpenVG
- // contexts active at the same time.
-#ifdef EGL_OPENGL_ES_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
-#ifdef EGL_OPENVG_API
- if (apiType == QEgl::OpenVG)
- eglBindAPI(EGL_OPENVG_API);
-#endif
-
- bool ok = eglMakeCurrent(QEgl::display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (!ok)
- qWarning() << "QEglContext::doneCurrent():" << QEgl::errorString();
- return ok;
-}
-
-// Act as though doneCurrent() was called, but keep the context
-// and the surface active for the moment. This allows makeCurrent()
-// to skip a call to eglMakeCurrent() if we are using the same
-// surface as the last set of painting operations. We leave the
-// currentContext() pointer as-is for now.
-bool QEglContext::lazyDoneCurrent()
-{
- current = false;
- return true;
-}
-
-bool QEglContext::swapBuffers(EGLSurface surface)
-{
- if(ctx == EGL_NO_CONTEXT)
- return false;
-
- bool ok = eglSwapBuffers(QEgl::display(), surface);
- if (!ok)
- qWarning() << "QEglContext::swapBuffers():" << QEgl::errorString();
- return ok;
-}
-
-bool QEglContext::swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region) {
- QVector<QRect> qrects = region->rects();
- EGLint *gl_rects;
- uint count;
- uint i;
-
- count = qrects.size();
- QVarLengthArray <EGLint> arr(4 * count);
- gl_rects = arr.data();
- for (i = 0; i < count; i++) {
- QRect qrect = qrects[i];
-
- gl_rects[4 * i + 0] = qrect.x();
- gl_rects[4 * i + 1] = qrect.y();
- gl_rects[4 * i + 2] = qrect.width();
- gl_rects[4 * i + 3] = qrect.height();
- }
-
- bool ok = QEgl::eglSwapBuffersRegion2NOK(QEgl::display(), surface, count, gl_rects);
-
- if (!ok)
- qWarning() << "QEglContext::swapBuffersRegion2NOK():" << QEgl::errorString();
- return ok;
-}
-
-int QEglContext::configAttrib(int name) const
-{
- EGLint value;
- EGLBoolean success = eglGetConfigAttrib(QEgl::display(), cfg, name, &value);
- if (success)
- return value;
- else
- return EGL_DONT_CARE;
-}
-
-typedef EGLImageKHR (EGLAPIENTRY *_eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint*);
-typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR);
-
-// Defined in qegl.cpp:
-static _eglCreateImageKHR qt_eglCreateImageKHR = 0;
-static _eglDestroyImageKHR qt_eglDestroyImageKHR = 0;
-
-typedef EGLBoolean (EGLAPIENTRY *_eglSwapBuffersRegion2NOK)(EGLDisplay, EGLSurface, EGLint, const EGLint*);
-
-static _eglSwapBuffersRegion2NOK qt_eglSwapBuffersRegion2NOK = 0;
-
-EGLDisplay QEgl::display()
-{
- static EGLDisplay dpy = EGL_NO_DISPLAY;
- if (!QEglContextTracker::displayOpened()) {
- dpy = eglGetDisplay(nativeDisplay());
- QEglContextTracker::setDisplayOpened();
- if (dpy == EGL_NO_DISPLAY) {
- qWarning("QEgl::display(): Falling back to EGL_DEFAULT_DISPLAY");
- dpy = eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
- }
- if (dpy == EGL_NO_DISPLAY) {
- qWarning("QEgl::display(): Can't even open the default display");
- return EGL_NO_DISPLAY;
- }
-
- if (!eglInitialize(dpy, NULL, NULL)) {
- qWarning() << "QEgl::display(): Cannot initialize EGL display:" << QEgl::errorString();
- return EGL_NO_DISPLAY;
- }
-
- // Resolve the egl extension function pointers:
-#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
- if (QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_base")) {
- qt_eglCreateImageKHR = (_eglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
- qt_eglDestroyImageKHR = (_eglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
- }
-#endif
-
- if (QEgl::hasExtension("EGL_NOK_swap_region2")) {
- qt_eglSwapBuffersRegion2NOK = (_eglSwapBuffersRegion2NOK) eglGetProcAddress("eglSwapBuffersRegion2NOK");
- }
- }
-
- return dpy;
-}
-
-EGLImageKHR QEgl::eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- if (qt_eglCreateImageKHR)
- return qt_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
-
- QEgl::display(); // Initialises function pointers
- if (qt_eglCreateImageKHR)
- return qt_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
-
- qWarning("QEgl::eglCreateImageKHR() called but EGL_KHR_image(_base) extension not present");
- return 0;
-}
-
-EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
-{
- if (qt_eglDestroyImageKHR)
- return qt_eglDestroyImageKHR(dpy, img);
-
- QEgl::display(); // Initialises function pointers
- if (qt_eglDestroyImageKHR)
- return qt_eglDestroyImageKHR(dpy, img);
-
- qWarning("QEgl::eglDestroyImageKHR() called but EGL_KHR_image(_base) extension not present");
- return 0;
-}
-
-EGLBoolean QEgl::eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
-{
- if (qt_eglSwapBuffersRegion2NOK)
- return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
-
- QEgl::display(); // Initialises function pointers
- if (qt_eglSwapBuffersRegion2NOK)
- return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
-
- qWarning("QEgl::eglSwapBuffersRegion2NOK() called but EGL_NOK_swap_region2 extension not present");
- return 0;
-}
-
-EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties)
-{
- // Create the native drawable for the paint device.
- int devType = device->devType();
- EGLNativePixmapType pixmapDrawable = 0;
- EGLNativeWindowType windowDrawable = 0;
- bool ok;
- if (devType == QInternal::Pixmap) {
- pixmapDrawable = nativePixmap(static_cast<QPixmap *>(device));
- ok = (pixmapDrawable != 0);
- } else if (devType == QInternal::Widget) {
- windowDrawable = nativeWindow(static_cast<QWidget *>(device));
- ok = (windowDrawable != 0);
- } else {
- ok = false;
- }
- if (!ok) {
- qWarning("QEglContext::createSurface(): Cannot create the native EGL drawable");
- return EGL_NO_SURFACE;
- }
-
- // Create the EGL surface to draw into, based on the native drawable.
- const int *props;
- if (properties)
- props = properties->properties();
- else
- props = 0;
- EGLSurface surf;
- if (devType == QInternal::Widget)
- surf = eglCreateWindowSurface(QEgl::display(), cfg, windowDrawable, props);
- else
- surf = eglCreatePixmapSurface(QEgl::display(), cfg, pixmapDrawable, props);
- if (surf == EGL_NO_SURFACE) {
- qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
- }
- return surf;
-}
-
-
-// Return the error string associated with a specific code.
-QString QEgl::errorString(EGLint code)
-{
- static const char * const errors[] = {
- "Success (0x3000)", // No tr
- "Not initialized (0x3001)", // No tr
- "Bad access (0x3002)", // No tr
- "Bad alloc (0x3003)", // No tr
- "Bad attribute (0x3004)", // No tr
- "Bad config (0x3005)", // No tr
- "Bad context (0x3006)", // No tr
- "Bad current surface (0x3007)", // No tr
- "Bad display (0x3008)", // No tr
- "Bad match (0x3009)", // No tr
- "Bad native pixmap (0x300A)", // No tr
- "Bad native window (0x300B)", // No tr
- "Bad parameter (0x300C)", // No tr
- "Bad surface (0x300D)", // No tr
- "Context lost (0x300E)" // No tr
- };
- if (code >= 0x3000 && code <= 0x300E) {
- return QString::fromLatin1(errors[code - 0x3000]);
- } else {
- return QLatin1String("0x") + QString::number(int(code), 16);
- }
-}
-
-// Dump all of the EGL configurations supported by the system.
-void QEgl::dumpAllConfigs()
-{
- QEglProperties props;
- EGLint count = 0;
- if (!eglGetConfigs(display(), 0, 0, &count) || count < 1)
- return;
- EGLConfig *configs = new EGLConfig [count];
- eglGetConfigs(display(), configs, count, &count);
- for (EGLint index = 0; index < count; ++index) {
- props = QEglProperties(configs[index]);
- qWarning() << props.toString();
- }
- delete [] configs;
-}
-
-QString QEgl::extensions()
-{
- const char* exts = eglQueryString(QEgl::display(), EGL_EXTENSIONS);
- return QString(QLatin1String(exts));
-}
-
-bool QEgl::hasExtension(const char* extensionName)
-{
- QList<QByteArray> extensions =
- QByteArray(reinterpret_cast<const char *>
- (eglQueryString(QEgl::display(), EGL_EXTENSIONS))).split(' ');
- return extensions.contains(extensionName);
-}
-
-QEglContext *QEglContext::currentContext(QEgl::API api)
-{
- if (api == QEgl::OpenGL)
- return currentGLContext;
- else
- return currentVGContext;
-}
-
-void QEglContext::setCurrentContext(QEgl::API api, QEglContext *context)
-{
- if (api == QEgl::OpenGL)
- currentGLContext = context;
- else
- currentVGContext = context;
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
deleted file mode 100644
index 3e78b97fcb..0000000000
--- a/src/gui/egl/qegl_p.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QEGL_P_H
-#define QEGL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience of
-// the QtGui and QtOpenVG modules. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-QT_BEGIN_INCLUDE_NAMESPACE
-
-#ifndef QT_NO_EGL
-#if defined(QT_OPENGL_ES_2)
-# include <GLES2/gl2.h>
-#endif
-
-#if defined(QT_GLES_EGL)
-# include <GLES/egl.h>
-#else
-# include <EGL/egl.h>
-#endif
-#if !defined(EGL_VERSION_1_2)
-typedef unsigned int EGLenum;
-typedef void *EGLClientBuffer;
-#endif
-#else
-
-//types from egltypes.h for compiling stub without EGL headers
-typedef int EGLBoolean;
-typedef int EGLint;
-typedef int EGLenum;
-typedef int NativeDisplayType;
-typedef void* NativeWindowType;
-typedef void* NativePixmapType;
-typedef int EGLDisplay;
-typedef int EGLConfig;
-typedef int EGLSurface;
-typedef int EGLContext;
-typedef int EGLClientBuffer;
-#define EGL_NONE 0x3038 /* Attrib list terminator */
-
-#endif
-
-
-// Internally we use the EGL-prefixed native types which are used in EGL >= 1.3.
-// For older versions of EGL, we have to define these types ourselves here:
-#if !defined(EGL_VERSION_1_3) && !defined(QEGL_NATIVE_TYPES_DEFINED)
-#undef EGLNativeWindowType
-#undef EGLNativePixmapType
-#undef EGLNativeDisplayType
-typedef NativeWindowType EGLNativeWindowType;
-typedef NativePixmapType EGLNativePixmapType;
-typedef NativeDisplayType EGLNativeDisplayType;
-#define QEGL_NATIVE_TYPES_DEFINED 1
-#endif
-
-QT_END_INCLUDE_NAMESPACE
-
-#include <QtGui/qpaintdevice.h>
-#include <QFlags>
-
-QT_BEGIN_NAMESPACE
-
-#define QEGL_NO_CONFIG ((EGLConfig)-1)
-
-#ifndef EGLAPIENTRY
-#define EGLAPIENTRY
-#endif
-
-// Declare/define the bits of EGL_KHR_image_base we need:
-#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base)
-typedef void *EGLImageKHR;
-
-#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
-#define EGL_IMAGE_PRESERVED_KHR 0x30D2
-#define EGL_KHR_image_base
-#endif
-
-#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_pixmap)
-#define EGL_NATIVE_PIXMAP_KHR 0x30B0
-#define EGL_KHR_image_pixmap
-#endif
-
-
-class QEglProperties;
-
-namespace QEgl {
- enum API
- {
- OpenGL,
- OpenVG
- };
-
- enum PixelFormatMatch
- {
- ExactPixelFormat,
- BestPixelFormat
- };
-
- enum ConfigOption
- {
- NoOptions = 0,
- Translucent = 0x01,
- Renderable = 0x02 // Config will be compatable with the paint engines (VG or GL)
- };
- Q_DECLARE_FLAGS(ConfigOptions, ConfigOption)
-
- // Most of the time we use the same config for things like widgets & pixmaps, so rather than
- // go through the eglChooseConfig loop every time, we use defaultConfig, which will return
- // the config for a particular device/api/option combo. This function assumes that once a
- // config is chosen for a particular combo, it's safe to always use that combo.
- Q_GUI_EXPORT EGLConfig defaultConfig(int devType, API api, ConfigOptions options);
-
- Q_GUI_EXPORT EGLConfig chooseConfig(const QEglProperties* configAttribs, QEgl::PixelFormatMatch match = QEgl::ExactPixelFormat);
- Q_GUI_EXPORT EGLSurface createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *surfaceAttribs = 0);
-
- Q_GUI_EXPORT void dumpAllConfigs();
-
-#ifdef QT_NO_EGL
- Q_GUI_EXPORT QString errorString(EGLint code = 0);
-#else
- Q_GUI_EXPORT QString errorString(EGLint code = eglGetError());
-#endif
-
- Q_GUI_EXPORT QString extensions();
- Q_GUI_EXPORT bool hasExtension(const char* extensionName);
-
- Q_GUI_EXPORT EGLDisplay display();
-
- Q_GUI_EXPORT EGLNativeDisplayType nativeDisplay();
- Q_GUI_EXPORT EGLNativeWindowType nativeWindow(QWidget*);
- Q_GUI_EXPORT EGLNativePixmapType nativePixmap(QPixmap*);
-
- // Extension functions
- Q_GUI_EXPORT EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
- Q_GUI_EXPORT EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img);
- Q_GUI_EXPORT EGLBoolean eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects);
-
-}
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QEgl::ConfigOptions)
-
-QT_END_NAMESPACE
-
-#endif //QEGL_P_H
diff --git a/src/gui/egl/qegl_qpa.cpp b/src/gui/egl/qegl_qpa.cpp
deleted file mode 100644
index a0a16a5395..0000000000
--- a/src/gui/egl/qegl_qpa.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/qpaintdevice.h>
-#include <QtGui/qpixmap.h>
-#include <QtGui/qwidget.h>
-#include "qeglcontext_p.h"
-
-#if !defined(QT_NO_EGL)
-
-#include <QtGui/private/qapplication_p.h>
-#include <QtGui/qdesktopwidget.h>
-
-QT_BEGIN_NAMESPACE
-
-EGLNativeDisplayType QEgl::nativeDisplay()
-{
- return EGLNativeDisplayType(EGL_DEFAULT_DISPLAY);
-}
-
-EGLNativeWindowType QEgl::nativeWindow(QWidget* widget)
-{
- return (EGLNativeWindowType)(widget->winId());
-}
-
-EGLNativePixmapType QEgl::nativePixmap(QPixmap* pixmap)
-{
- Q_UNUSED(pixmap);
- return 0;
-}
-
-//EGLDisplay QEglContext::display()
-//{
-// return eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
-//}
-
-static QPlatformScreen *screenForDevice(QPaintDevice *device)
-{
- QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
-
- QList<QPlatformScreen *> screens = pi->screens();
-
- int screenNumber;
- if (device && device->devType() == QInternal::Widget)
- screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
- else
- screenNumber = 0;
- if (screenNumber < 0 || screenNumber >= screens.size())
- return 0;
- return screens[screenNumber];
-}
-
-// Set pixel format and other properties based on a paint device.
-void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
-{
- if (!dev)
- return;
-
- // Find the QOpenGLScreen for this paint device.
- QPlatformScreen *screen = screenForDevice(dev);
- if (!screen)
- return;
- int devType = dev->devType();
- if (devType == QInternal::Image)
- setPixelFormat(static_cast<QImage *>(dev)->format());
- else
- setPixelFormat(screen->format());
-}
-
-QT_END_NAMESPACE
-
-#endif // !QT_NO_EGL
diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h
deleted file mode 100644
index 94654eb2a8..0000000000
--- a/src/gui/egl/qeglcontext_p.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QEGLCONTEXT_P_H
-#define QEGLCONTEXT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience of
-// the QtGui and QtOpenVG modules. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qsize.h>
-#include <QtGui/qimage.h>
-
-#include <QtGui/private/qegl_p.h>
-#include <QtGui/private/qeglproperties_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GUI_EXPORT QEglContext
-{
-public:
- QEglContext();
- ~QEglContext();
-
- bool isValid() const;
- bool isCurrent() const;
- bool isSharing() const { return sharing; }
-
- QEgl::API api() const { return apiType; }
- void setApi(QEgl::API api) { apiType = api; }
-
- bool chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match = QEgl::ExactPixelFormat);
- bool createContext(QEglContext *shareContext = 0, const QEglProperties *properties = 0);
- void destroyContext();
- EGLSurface createSurface(QPaintDevice *device, const QEglProperties *properties = 0);
- void destroySurface(EGLSurface surface);
-
- bool makeCurrent(EGLSurface surface);
- bool doneCurrent();
- bool lazyDoneCurrent();
- bool swapBuffers(EGLSurface surface);
- bool swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region);
-
- int configAttrib(int name) const;
-
- EGLContext context() const { return ctx; }
- void setContext(EGLContext context) { ctx = context; ownsContext = false;}
-
- EGLDisplay display() {return QEgl::display();}
-
- EGLConfig config() const { return cfg; }
- void setConfig(EGLConfig config) { cfg = config; }
-
-private:
- QEgl::API apiType;
- EGLContext ctx;
- EGLConfig cfg;
- EGLSurface currentSurface;
- bool current;
- bool ownsContext;
- bool sharing;
-
- static QEglContext *currentContext(QEgl::API api);
- static void setCurrentContext(QEgl::API api, QEglContext *context);
-
- friend class QMeeGoGraphicsSystem;
- friend class QMeeGoPlatformPixmap;
-};
-
-QT_END_NAMESPACE
-
-#endif // QEGLCONTEXT_P_H
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
deleted file mode 100644
index 414ad8d06a..0000000000
--- a/src/gui/egl/qeglproperties.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qstringlist.h>
-
-#include "qeglproperties_p.h"
-#include "qeglcontext_p.h"
-
-QT_BEGIN_NAMESPACE
-
-// Initialize a property block.
-QEglProperties::QEglProperties()
-{
- props.append(EGL_NONE);
-}
-
-QEglProperties::QEglProperties(EGLConfig cfg)
-{
- props.append(EGL_NONE);
- for (int name = 0x3020; name <= 0x304F; ++name) {
- EGLint value;
- if (name != EGL_NONE && eglGetConfigAttrib(QEgl::display(), cfg, name, &value))
- setValue(name, value);
- }
- eglGetError(); // Clear the error state.
-}
-
-// Fetch the current value associated with a property.
-int QEglProperties::value(int name) const
-{
- for (int index = 0; index < (props.size() - 1); index += 2) {
- if (props[index] == name)
- return props[index + 1];
- }
-
- // If the attribute has not been explicitly set, return the EGL default
- // The following defaults were taken from the EGL 1.4 spec:
- switch(name) {
- case EGL_BUFFER_SIZE: return 0;
- case EGL_RED_SIZE: return 0;
- case EGL_GREEN_SIZE: return 0;
- case EGL_BLUE_SIZE: return 0;
- case EGL_ALPHA_SIZE: return 0;
-#ifdef EGL_LUMINANCE_SIZE
- case EGL_LUMINANCE_SIZE: return 0;
-#endif
-#ifdef EGL_ALPHA_MASK_SIZE
- case EGL_ALPHA_MASK_SIZE: return 0;
-#endif
-#ifdef EGL_BIND_TO_TEXTURE_RGB
- case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE;
-#endif
-#ifdef EGL_BIND_TO_TEXTURE_RGBA
- case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE;
-#endif
-#ifdef EGL_COLOR_BUFFER_TYPE
- case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER;
-#endif
- case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE;
- case EGL_CONFIG_ID: return EGL_DONT_CARE;
- case EGL_DEPTH_SIZE: return 0;
- case EGL_LEVEL: return 0;
- case EGL_NATIVE_RENDERABLE: return EGL_DONT_CARE;
- case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE;
- case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE;
- case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE;
-#ifdef EGL_RENDERABLE_TYPE
- case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT;
-#endif
- case EGL_SAMPLE_BUFFERS: return 0;
- case EGL_SAMPLES: return 0;
- case EGL_STENCIL_SIZE: return 0;
- case EGL_SURFACE_TYPE: return EGL_WINDOW_BIT;
- case EGL_TRANSPARENT_TYPE: return EGL_NONE;
- case EGL_TRANSPARENT_RED_VALUE: return EGL_DONT_CARE;
- case EGL_TRANSPARENT_GREEN_VALUE: return EGL_DONT_CARE;
- case EGL_TRANSPARENT_BLUE_VALUE: return EGL_DONT_CARE;
-
-#ifdef EGL_VERSION_1_3
- case EGL_CONFORMANT: return 0;
- case EGL_MATCH_NATIVE_PIXMAP: return EGL_NONE;
-#endif
-
- case EGL_MAX_PBUFFER_HEIGHT:
- case EGL_MAX_PBUFFER_WIDTH:
- case EGL_MAX_PBUFFER_PIXELS:
- case EGL_NATIVE_VISUAL_ID:
- case EGL_NONE:
- // Attribute does not affect config selection.
- return EGL_DONT_CARE;
- default:
- // Attribute is unknown in EGL <= 1.4.
- return EGL_DONT_CARE;
- }
-}
-
-// Set the value associated with a property, replacing an existing
-// value if there is one.
-void QEglProperties::setValue(int name, int value)
-{
- for (int index = 0; index < (props.size() - 1); index += 2) {
- if (props[index] == name) {
- props[index + 1] = value;
- return;
- }
- }
- props[props.size() - 1] = name;
- props.append(value);
- props.append(EGL_NONE);
-}
-
-// Remove a property value. Returns false if the property is not present.
-bool QEglProperties::removeValue(int name)
-{
- for (int index = 0; index < (props.size() - 1); index += 2) {
- if (props[index] == name) {
- while ((index + 2) < props.size()) {
- props[index] = props[index + 2];
- ++index;
- }
- props.resize(props.size() - 2);
- return true;
- }
- }
- return false;
-}
-
-void QEglProperties::setDeviceType(int devType)
-{
- if (devType == QInternal::Pixmap || devType == QInternal::Image)
- setValue(EGL_SURFACE_TYPE, EGL_PIXMAP_BIT);
- else if (devType == QInternal::Pbuffer)
- setValue(EGL_SURFACE_TYPE, EGL_PBUFFER_BIT);
- else
- setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT);
-}
-
-
-// Sets the red, green, blue, and alpha sizes based on a pixel format.
-// Normally used to match a configuration request to the screen format.
-void QEglProperties::setPixelFormat(QImage::Format pixelFormat)
-{
- int red, green, blue, alpha;
- switch (pixelFormat) {
- case QImage::Format_RGB32:
- case QImage::Format_RGB888:
- red = green = blue = 8; alpha = 0; break;
- case QImage::Format_ARGB32:
- case QImage::Format_ARGB32_Premultiplied:
- red = green = blue = alpha = 8; break;
- case QImage::Format_RGB16:
- red = 5; green = 6; blue = 5; alpha = 0; break;
- case QImage::Format_ARGB8565_Premultiplied:
- red = 5; green = 6; blue = 5; alpha = 8; break;
- case QImage::Format_RGB666:
- red = green = blue = 6; alpha = 0; break;
- case QImage::Format_ARGB6666_Premultiplied:
- red = green = blue = alpha = 6; break;
- case QImage::Format_RGB555:
- red = green = blue = 5; alpha = 0; break;
- case QImage::Format_ARGB8555_Premultiplied:
- red = green = blue = 5; alpha = 8; break;
- case QImage::Format_RGB444:
- red = green = blue = 4; alpha = 0; break;
- case QImage::Format_ARGB4444_Premultiplied:
- red = green = blue = alpha = 4; break;
- default:
- qWarning() << "QEglProperties::setPixelFormat(): Unsupported pixel format";
- red = green = blue = alpha = 1; break;
- }
- setValue(EGL_RED_SIZE, red);
- setValue(EGL_GREEN_SIZE, green);
- setValue(EGL_BLUE_SIZE, blue);
- setValue(EGL_ALPHA_SIZE, alpha);
-}
-
-void QEglProperties::setRenderableType(QEgl::API api)
-{
-#ifdef EGL_RENDERABLE_TYPE
-#if defined(QT_OPENGL_ES_2)
- if (api == QEgl::OpenGL)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT);
-#elif defined(QT_OPENGL_ES)
- if (api == QEgl::OpenGL)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
-#elif defined(EGL_OPENGL_BIT)
- if (api == QEgl::OpenGL)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
-#endif
-#ifdef EGL_OPENVG_BIT
- if (api == QEgl::OpenVG)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT);
-#endif
-#else
- Q_UNUSED(api);
-#endif
-}
-
-// Reduce the complexity of a configuration request to ask for less
-// because the previous request did not result in success. Returns
-// true if the complexity was reduced, or false if no further
-// reductions in complexity are possible.
-bool QEglProperties::reduceConfiguration()
-{
-#ifdef EGL_SWAP_BEHAVIOR
- if (value(EGL_SWAP_BEHAVIOR) != EGL_DONT_CARE)
- removeValue(EGL_SWAP_BEHAVIOR);
-#endif
-
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- // For OpenVG, we sometimes try to create a surface using a pre-multiplied format. If we can't
- // find a config which supports pre-multiplied formats, remove the flag on the surface type:
- EGLint surfaceType = value(EGL_SURFACE_TYPE);
- if (surfaceType & EGL_VG_ALPHA_FORMAT_PRE_BIT) {
- surfaceType ^= EGL_VG_ALPHA_FORMAT_PRE_BIT;
- setValue(EGL_SURFACE_TYPE, surfaceType);
- return true;
- }
-#endif
- // EGL chooses configs with the highest color depth over
- // those with smaller (but faster) lower color depths. One
- // way around this is to set EGL_BUFFER_SIZE to 16, which
- // trumps the others. Of course, there may not be a 16-bit
- // config available, so it's the first restraint we remove.
- if (value(EGL_BUFFER_SIZE) == 16) {
- removeValue(EGL_BUFFER_SIZE);
- return true;
- }
- if (removeValue(EGL_SAMPLE_BUFFERS)) {
- removeValue(EGL_SAMPLES);
- return true;
- }
- if (removeValue(EGL_ALPHA_SIZE)) {
-#if defined(EGL_BIND_TO_TEXTURE_RGBA) && defined(EGL_BIND_TO_TEXTURE_RGB)
- if (removeValue(EGL_BIND_TO_TEXTURE_RGBA))
- setValue(EGL_BIND_TO_TEXTURE_RGB, TRUE);
-#endif
- return true;
- }
- if (removeValue(EGL_STENCIL_SIZE))
- return true;
- if (removeValue(EGL_DEPTH_SIZE))
- return true;
-#ifdef EGL_BIND_TO_TEXTURE_RGB
- if (removeValue(EGL_BIND_TO_TEXTURE_RGB))
- return true;
-#endif
- return false;
-}
-
-static void addTag(QString& str, const QString& tag)
-{
- int lastnl = str.lastIndexOf(QLatin1String("\n"));
- if (lastnl == -1)
- lastnl = 0;
- if ((str.length() - lastnl) >= 50)
- str += QLatin1String("\n ");
- str += tag;
-}
-
-// Convert a property list to a string suitable for debug output.
-QString QEglProperties::toString() const
-{
- QString str;
- int val;
-
- val = value(EGL_CONFIG_ID);
- if (val != EGL_DONT_CARE) {
- str += QLatin1String("id=");
- str += QString::number(val);
- str += QLatin1Char(' ');
- }
-
-#ifdef EGL_RENDERABLE_TYPE
- val = value(EGL_RENDERABLE_TYPE);
- if (val != EGL_DONT_CARE) {
- str += QLatin1String("type=");
- QStringList types;
- if ((val & EGL_OPENGL_ES_BIT) != 0)
- types += QLatin1String("es1");
-#ifdef EGL_OPENGL_ES2_BIT
- if ((val & EGL_OPENGL_ES2_BIT) != 0)
- types += QLatin1String("es2");
-#endif
-#ifdef EGL_OPENGL_BIT
- if ((val & EGL_OPENGL_BIT) != 0)
- types += QLatin1String("gl");
-#endif
- if ((val & EGL_OPENVG_BIT) != 0)
- types += QLatin1String("vg");
- if ((val & ~7) != 0)
- types += QString::number(val);
- str += types.join(QLatin1String(","));
- } else {
- str += QLatin1String("type=any");
- }
-#else
- str += QLatin1String("type=es1");
-#endif
-
- int red = value(EGL_RED_SIZE);
- int green = value(EGL_GREEN_SIZE);
- int blue = value(EGL_BLUE_SIZE);
- int alpha = value(EGL_ALPHA_SIZE);
- int bufferSize = value(EGL_BUFFER_SIZE);
- if (bufferSize == (red + green + blue + alpha))
- bufferSize = 0;
- str += QLatin1String(" rgba=");
- str += QString::number(red);
- str += QLatin1Char(',');
- str += QString::number(green);
- str += QLatin1Char(',');
- str += QString::number(blue);
- str += QLatin1Char(',');
- str += QString::number(alpha);
- if (bufferSize != 0) {
- // Only report buffer size if different than r+g+b+a.
- str += QLatin1String(" buffer-size=");
- str += QString::number(bufferSize);
- }
-
-#ifdef EGL_COLOR_BUFFER_TYPE
- val = value(EGL_COLOR_BUFFER_TYPE);
- if (val == EGL_LUMINANCE_BUFFER) {
- addTag(str, QLatin1String(" color-buffer-type=luminance"));
- } else if (val != EGL_DONT_CARE && val != EGL_RGB_BUFFER) {
- addTag(str, QLatin1String(" color-buffer-type="));
- str += QString::number(val, 16);
- }
-#endif
-
- val = value(EGL_DEPTH_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" depth="));
- str += QString::number(val);
- }
-
- val = value(EGL_STENCIL_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" stencil="));
- str += QString::number(val);
- }
-
- val = value(EGL_SURFACE_TYPE);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" surface-type="));
- QStringList types;
- if ((val & EGL_WINDOW_BIT) != 0)
- types += QLatin1String("window");
- if ((val & EGL_PIXMAP_BIT) != 0)
- types += QLatin1String("pixmap");
- if ((val & EGL_PBUFFER_BIT) != 0)
- types += QLatin1String("pbuffer");
-#ifdef EGL_VG_COLORSPACE_LINEAR_BIT
- if ((val & EGL_VG_COLORSPACE_LINEAR_BIT) != 0)
- types += QLatin1String("vg-colorspace-linear");
-#endif
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- if ((val & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0)
- types += QLatin1String("vg-alpha-format-pre");
-#endif
- if ((val & ~(EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT
-#ifdef EGL_VG_COLORSPACE_LINEAR_BIT
- | EGL_VG_COLORSPACE_LINEAR_BIT
-#endif
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- | EGL_VG_ALPHA_FORMAT_PRE_BIT
-#endif
- )) != 0) {
- types += QString::number(val);
- }
- str += types.join(QLatin1String(","));
- }
-
- val = value(EGL_CONFIG_CAVEAT);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" caveat="));
- if (val == EGL_NONE)
- str += QLatin1String("none");
- else if (val == EGL_SLOW_CONFIG)
- str += QLatin1String("slow");
- else if (val == EGL_NON_CONFORMANT_CONFIG)
- str += QLatin1String("non-conformant");
- else
- str += QString::number(val, 16);
- }
-
- val = value(EGL_LEVEL);
- if (val != 0) {
- addTag(str, QLatin1String(" level="));
- str += QString::number(val);
- }
-
- int width, height, pixels;
- width = value(EGL_MAX_PBUFFER_WIDTH);
- height = value(EGL_MAX_PBUFFER_HEIGHT);
- pixels = value(EGL_MAX_PBUFFER_PIXELS);
- if (height != EGL_DONT_CARE || width != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" max-pbuffer-size="));
- str += QString::number(width);
- str += QLatin1Char('x');
- str += QString::number(height);
- if (pixels != (width * height)) {
- addTag(str, QLatin1String(" max-pbuffer-pixels="));
- str += QString::number(pixels);
- }
- }
-
- val = value(EGL_NATIVE_RENDERABLE);
- if (val != EGL_DONT_CARE) {
- if (val)
- addTag(str, QLatin1String(" native-renderable=true"));
- else
- addTag(str, QLatin1String(" native-renderable=false"));
- }
-
- val = value(EGL_NATIVE_VISUAL_ID);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" visual-id="));
- str += QString::number(val);
- }
-
- val = value(EGL_NATIVE_VISUAL_TYPE);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" visual-type="));
- str += QString::number(val);
- }
-
-#ifdef EGL_PRESERVED_RESOURCES
- val = value(EGL_PRESERVED_RESOURCES);
- if (val != EGL_DONT_CARE) {
- if (val)
- addTag(str, QLatin1String(" preserved-resources=true"));
- else
- addTag(str, QLatin1String(" preserved-resources=false"));
- }
-#endif
-
- val = value(EGL_SAMPLES);
- if (val != 0) {
- addTag(str, QLatin1String(" samples="));
- str += QString::number(val);
- }
-
- val = value(EGL_SAMPLE_BUFFERS);
- if (val != 0) {
- addTag(str, QLatin1String(" sample-buffers="));
- str += QString::number(val);
- }
-
- val = value(EGL_TRANSPARENT_TYPE);
- if (val == EGL_TRANSPARENT_RGB) {
- addTag(str, QLatin1String(" transparent-rgb="));
- str += QString::number(value(EGL_TRANSPARENT_RED_VALUE));
- str += QLatin1Char(',');
- str += QString::number(value(EGL_TRANSPARENT_GREEN_VALUE));
- str += QLatin1Char(',');
- str += QString::number(value(EGL_TRANSPARENT_BLUE_VALUE));
- }
-
-#if defined(EGL_BIND_TO_TEXTURE_RGB) && defined(EGL_BIND_TO_TEXTURE_RGBA)
- val = value(EGL_BIND_TO_TEXTURE_RGB);
- int val2 = value(EGL_BIND_TO_TEXTURE_RGBA);
- if (val != EGL_DONT_CARE || val2 != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" bind-texture="));
- if (val == EGL_TRUE)
- str += QLatin1String("rgb");
- else
- str += QLatin1String("no-rgb");
- if (val2 == EGL_TRUE)
- str += QLatin1String(",rgba");
- else
- str += QLatin1String(",no-rgba");
- }
-#endif
-
-#ifdef EGL_MIN_SWAP_INTERVAL
- val = value(EGL_MIN_SWAP_INTERVAL);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" min-swap-interval="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_MIN_SWAP_INTERVAL
- val = value(EGL_MAX_SWAP_INTERVAL);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" max-swap-interval="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_LUMINANCE_SIZE
- val = value(EGL_LUMINANCE_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" luminance="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_ALPHA_MASK_SIZE
- val = value(EGL_ALPHA_MASK_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" alpha-mask="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_CONFORMANT
- val = value(EGL_CONFORMANT);
- if (val != 0) {
- if (val)
- addTag(str, QLatin1String(" conformant=true"));
- else
- addTag(str, QLatin1String(" conformant=false"));
- }
-#endif
-
- return str;
-}
-
-QT_END_NAMESPACE
-
-
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index db045930a3..2cee31fce1 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -32,8 +32,6 @@ include(util/util.pri)
include(math3d/math3d.pri)
include(opengl/opengl.pri)
-include(egl/egl.pri)
-
QMAKE_LIBS += $$QMAKE_LIBS_GUI
DEFINES += Q_INTERNAL_QAPP_SRC
@@ -59,20 +57,10 @@ win32:!contains(QT_CONFIG, directwrite) {
DEFINES += QT_NO_DIRECTWRITE
}
-contains(QMAKE_MAC_XARCH, no) {
- DEFINES += QT_NO_MAC_XARCH
-} else {
win32-g++*|!win32:!win32-icc*:!macx-icc* {
mmx {
mmx_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: mmx_compiler.commands += -Xarch_i386 -mmmx
- x86_64: mmx_compiler.commands += -Xarch_x86_64 -mmmx
- } else {
- mmx_compiler.commands += -mmmx
- }
-
+ mmx_compiler.commands += -mmmx
mmx_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mmx_compiler.dependency_type = TYPE_C
mmx_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -84,14 +72,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
3dnow {
mmx3dnow_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: mmx3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -mmmx
- x86_64: mmx3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -mmmx
- } else {
- mmx3dnow_compiler.commands += -m3dnow -mmmx
- }
-
+ mmx3dnow_compiler.commands += -m3dnow -mmmx
mmx3dnow_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mmx3dnow_compiler.dependency_type = TYPE_C
mmx3dnow_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -102,14 +83,7 @@ contains(QMAKE_MAC_XARCH, no) {
QMAKE_EXTRA_COMPILERS += mmx3dnow_compiler
sse {
sse3dnow_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: sse3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -msse
- x86_64: sse3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -msse
- } else {
- sse3dnow_compiler.commands += -m3dnow -msse
- }
-
+ sse3dnow_compiler.commands += -m3dnow -msse
sse3dnow_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
sse3dnow_compiler.dependency_type = TYPE_C
sse3dnow_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -122,14 +96,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
sse {
sse_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: sse_compiler.commands += -Xarch_i386 -msse
- x86_64: sse_compiler.commands += -Xarch_x86_64 -msse
- } else {
- sse_compiler.commands += -msse
- }
-
+ sse_compiler.commands += -msse
sse_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
sse_compiler.dependency_type = TYPE_C
sse_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -141,14 +108,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
sse2 {
sse2_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: sse2_compiler.commands += -Xarch_i386 -msse2
- x86_64: sse2_compiler.commands += -Xarch_x86_64 -msse2
- } else {
- sse2_compiler.commands += -msse2
- }
-
+ sse2_compiler.commands += -msse2
sse2_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
sse2_compiler.dependency_type = TYPE_C
sse2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -160,14 +120,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
ssse3 {
ssse3_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: ssse3_compiler.commands += -Xarch_i386 -mssse3
- x86_64: ssse3_compiler.commands += -Xarch_x86_64 -mssse3
- } else {
- ssse3_compiler.commands += -mssse3
- }
-
+ ssse3_compiler.commands += -mssse3
ssse3_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
ssse3_compiler.dependency_type = TYPE_C
ssse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -198,4 +151,3 @@ contains(QMAKE_MAC_XARCH, no) {
ssse3: SOURCES += $$SSSE3_SOURCES
iwmmxt: SOURCES += $$IWMMXT_SOURCES
}
-}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 3e53b04728..61a3895a6b 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -50,6 +50,7 @@
#include "qstringlist.h"
#include "qvariant.h"
#include "qimagepixmapcleanuphooks_p.h"
+#include "qplatformintegration_qpa.h"
#include <ctype.h>
#include <stdlib.h>
#include <limits.h>
@@ -62,6 +63,7 @@
#include <qhash.h>
+#include <private/qguiapplication_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qimage_p.h>
@@ -4900,7 +4902,9 @@ QPaintEngine *QImage::paintEngine() const
return 0;
if (!d->paintEngine) {
- d->paintEngine = new QRasterPaintEngine(const_cast<QImage *>(this));
+ QPaintDevice *paintDevice = const_cast<QImage *>(this);
+ QPaintEngine *paintEngine = QGuiApplicationPrivate::platformIntegration()->createImagePaintEngine(paintDevice);
+ d->paintEngine = paintEngine ? paintEngine : new QRasterPaintEngine(paintDevice);
}
return d->paintEngine;
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 42ce3745de..26690c78cf 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -696,6 +696,8 @@ void QGuiApplicationPrivate::init()
// trigger registering of QVariant's GUI types
qRegisterGuiVariant();
+ QWindowSystemInterfacePrivate::eventTime.start();
+
is_app_running = true;
init_plugins(pluginList);
QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents);
@@ -753,7 +755,17 @@ static QClipboard *clipboard();
#endif
/*!
- Returns the currently held keyboard modifiers.
+ Returns the current state of the modifier keys on the keyboard. The current
+ state is updated sychronously as the event queue is emptied of events that
+ will spontaneously change the keyboard state (QEvent::KeyPress and
+ QEvent::KeyRelease events).
+
+ It should be noted this may not reflect the actual keys held on the input
+ device at the time of calling but rather the modifiers as last reported in
+ one of the above events. If no keys are being held Qt::NoModifier is
+ returned.
+
+ \sa mouseButtons(), queryKeyboardModifiers()
*/
Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()
{
@@ -761,7 +773,39 @@ Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()
}
/*!
- Returns the currently held mouse buttons.
+ \fn Qt::KeyboardModifiers QApplication::queryKeyboardModifiers()
+
+ Queries and returns the state of the modifier keys on the keyboard.
+ Unlike keyboardModifiers, this method returns the actual keys held
+ on the input device at the time of calling the method.
+
+ It does not rely on the keypress events having been received by this
+ process, which makes it possible to check the modifiers while moving
+ a window, for instance. Note that in most cases, you should use
+ keyboardModifiers(), which is faster and more accurate since it contains
+ the state of the modifiers as they were when the currently processed
+ event was received.
+
+ \sa keyboardModifiers()
+*/
+Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers()
+{
+ QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
+ return pi->queryKeyboardModifiers();
+}
+
+/*!
+ Returns the current state of the buttons on the mouse. The current state is
+ updated syncronously as the event queue is emptied of events that will
+ spontaneously change the mouse state (QEvent::MouseButtonPress and
+ QEvent::MouseButtonRelease events).
+
+ It should be noted this may not reflect the actual buttons held on the
+ input device at the time of calling but rather the mouse buttons as last
+ reported in one of the above events. If no mouse buttons are being held
+ Qt::NoButton is returned.
+
+ \sa keyboardModifiers()
*/
Qt::MouseButtons QGuiApplication::mouseButtons()
{
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index c374a05986..6fdbb000fe 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -113,6 +113,7 @@ public:
static void setPalette(const QPalette &pal);
static Qt::KeyboardModifiers keyboardModifiers();
+ static Qt::KeyboardModifiers queryKeyboardModifiers();
static Qt::MouseButtons mouseButtons();
static void setLayoutDirection(Qt::LayoutDirection direction);
diff --git a/src/gui/kernel/qplatformdrag_qpa.cpp b/src/gui/kernel/qplatformdrag_qpa.cpp
index 832b91db7e..0e7b0f41cc 100644
--- a/src/gui/kernel/qplatformdrag_qpa.cpp
+++ b/src/gui/kernel/qplatformdrag_qpa.cpp
@@ -88,6 +88,7 @@ QPlatformDrag::QPlatformDrag() : d_ptr(new QPlatformDragPrivate)
QPlatformDrag::~QPlatformDrag()
{
+ delete d_ptr;
}
QDrag *QPlatformDrag::currentDrag() const
diff --git a/src/gui/kernel/qplatformdrag_qpa.h b/src/gui/kernel/qplatformdrag_qpa.h
index 7d22c69947..22133706d1 100644
--- a/src/gui/kernel/qplatformdrag_qpa.h
+++ b/src/gui/kernel/qplatformdrag_qpa.h
@@ -100,6 +100,8 @@ public:
private:
QPlatformDragPrivate *d_ptr;
+
+ Q_DISABLE_COPY(QPlatformDrag)
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 7a3fe05f7a..e8721edce7 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -241,6 +241,15 @@ QPlatformSharedGraphicsCache *QPlatformIntegration::createPlatformSharedGraphics
}
/*!
+ Factory function for QPaintEngine. This function will return 0 if the platform
+ integration does not support creating any paint engine the given \a paintDevice.
+*/
+QPaintEngine *QPlatformIntegration::createImagePaintEngine(QPaintDevice *paintDevice) const
+{
+ return 0;
+}
+
+/*!
Returns the platforms input context.
The default implementation returns 0, implying no input method support.
@@ -282,6 +291,11 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return 0;
}
+Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const
+{
+ return QGuiApplication::keyboardModifiers();
+}
+
/*!
Should be called by the implementation whenever a new screen is added.
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h
index 483964b8f3..3f9de9df5e 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration_qpa.h
@@ -91,6 +91,7 @@ public:
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
#endif
virtual QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const;
+ virtual QPaintEngine *createImagePaintEngine(QPaintDevice *paintDevice) const;
// Event dispatcher:
virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0;
@@ -123,6 +124,8 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
+ virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
+
virtual QPlatformTheme *platformTheme() const;
protected:
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 04c2617838..367cee70e3 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1386,7 +1386,7 @@ void QWindow::hideEvent(QHideEvent *ev)
/*!
Override this to handle any event sent to the window.
- Remembet to call the base class version if you wish for mouse events,
+ Remember to call the base class version if you wish for mouse events,
key events, resize events, etc to be dispatched as usual.
*/
bool QWindow::event(QEvent *ev)
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index 5b77d97950..be9ac8e545 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -49,7 +49,7 @@
QT_BEGIN_NAMESPACE
-QTime QWindowSystemInterfacePrivate::eventTime;
+QElapsedTimer QWindowSystemInterfacePrivate::eventTime;
//------------------------------------------------------------
//
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
index f5c141b4c9..fe97b486ad 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
@@ -42,6 +42,7 @@
#define QWINDOWSYSTEMINTERFACE_QPA_P_H
#include "qwindowsysteminterface_qpa.h"
+#include <QElapsedTimer>
QT_BEGIN_HEADER
@@ -272,7 +273,7 @@ public:
static WindowSystemEvent * getWindowSystemEvent();
static void queueWindowSystemEvent(WindowSystemEvent *ev);
- static QTime eventTime;
+ static QElapsedTimer eventTime;
static QList<QTouchEvent::TouchPoint> convertTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points, QEvent::Type *type);
};
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index eb32ac162f..73be87bc1d 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1405,8 +1405,7 @@ void QOpenGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
// don't try to cache huge fonts or vastly transformed fonts
QFontEngine *fontEngine = textItem->fontEngine();
- const qreal pixelSize = fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f) {
+ if (shouldDrawCachedGlyphs(fontEngine, s->matrix) || det < 0.25f || det > 4.f) {
QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0
? QFontEngineGlyphCache::Type(textItem->fontEngine()->glyphFormat)
: d->glyphCacheType;
@@ -1460,8 +1459,7 @@ void QOpenGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &text
bool drawCached = txtype < QTransform::TxProject;
// don't try to cache huge fonts or vastly transformed fonts
- const qreal pixelSize = ti.fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f)
+ if (shouldDrawCachedGlyphs(ti.fontEngine, s->matrix) || det < 0.25f || det > 4.f)
drawCached = false;
QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
index 0a6ef2a4d2..1b3dfbae28 100644
--- a/src/gui/opengl/qopenglpaintengine_p.h
+++ b/src/gui/opengl/qopenglpaintengine_p.h
@@ -157,7 +157,7 @@ public:
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
- bool supportsTransformations(qreal, const QTransform &) const { return true; }
+ bool supportsTransformations(QFontEngine *, const QTransform &) const { return true; }
private:
Q_DISABLE_COPY(QOpenGL2PaintEngineEx)
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 1b4f4f7429..4b6101e7c9 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -72,7 +72,7 @@ public:
, m_width(0)
, m_height(0)
{
- if (ctx && !ctx->d_func()->workaround_brokenFBOReadBack)
+ if (!ctx->d_func()->workaround_brokenFBOReadBack)
QOpenGLFunctions(ctx).glGenFramebuffers(1, &m_fbo);
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index f2aac442dc..b5e8bca7e0 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2467,6 +2467,15 @@ static inline bool monoVal(const uchar* s, int x)
/*!
\internal
+ */
+QRasterBuffer *QRasterPaintEngine::rasterBuffer()
+{
+ Q_D(QRasterPaintEngine);
+ return d->rasterBuffer.data();
+}
+
+/*!
+ \internal
*/
void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h)
{
@@ -2923,7 +2932,7 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
ensureRasterState();
QFontEngine *fontEngine = textItem->fontEngine();
- if (shouldDrawCachedGlyphs(fontEngine->fontDef.pixelSize, state()->matrix)) {
+ if (shouldDrawCachedGlyphs(fontEngine, state()->matrix)) {
drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
fontEngine);
} else if (state()->matrix.type() < QTransform::TxProject) {
@@ -3207,18 +3216,18 @@ void QRasterPaintEngine::releaseDC(HDC) const
#endif
-bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const
+bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine) const
{
const QTransform &m = state()->matrix;
- return supportsTransformations(fontEngine->fontDef.pixelSize, m);
+ return supportsTransformations(fontEngine, m);
}
-bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const
+bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const
{
if (m.type() >= QTransform::TxProject)
return true;
- return !shouldDrawCachedGlyphs(pixelSize, m);
+ return !shouldDrawCachedGlyphs(fontEngine, m);
}
/*!
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 7b353188a3..79ed03e393 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -194,8 +194,11 @@ public:
void clip(const QVectorPath &path, Qt::ClipOperation op);
void clip(const QRect &rect, Qt::ClipOperation op);
void clip(const QRegion &region, Qt::ClipOperation op);
+ inline const QClipData *clip() const;
void drawStaticTextItem(QStaticTextItem *textItem);
+ virtual bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
+ QFontEngine *fontEngine);
enum ClipType {
RectClip,
@@ -227,14 +230,15 @@ public:
static bool clearTypeFontsEnabled();
#endif
+ QRasterBuffer *rasterBuffer();
void alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h);
Type type() const { return Raster; }
QPoint coordinateOffset() const;
- bool supportsTransformations(const QFontEngine *fontEngine) const;
- bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
+ bool supportsTransformations(QFontEngine *fontEngine) const;
+ bool supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const;
protected:
QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *);
@@ -247,10 +251,6 @@ private:
void fillRect(const QRectF &rect, QSpanData *data);
void drawBitmap(const QPointF &pos, const QImage &image, QSpanData *fill);
- bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
- QFontEngine *fontEngine);
-
-
bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op);
inline void ensureBrush(const QBrush &brush) {
@@ -492,6 +492,12 @@ inline const QClipData *QRasterPaintEnginePrivate::clip() const {
return baseClip.data();
}
+inline const QClipData *QRasterPaintEngine::clip() const {
+ Q_D(const QRasterPaintEngine);
+ if (state() && state()->clip && state()->clip->enabled)
+ return state()->clip;
+ return d->baseClip.data();
+}
QT_END_NAMESPACE
#endif // QPAINTENGINE_RASTER_P_H
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 93f36ba0ab..36414f4774 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -1081,9 +1081,9 @@ void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem)
}
}
-bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &m) const
+bool QPaintEngineEx::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const
{
- Q_UNUSED(pixelSize);
+ Q_UNUSED(fontEngine);
if (!m.isAffine())
return true;
@@ -1091,8 +1091,9 @@ bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &
return false;
}
-bool QPaintEngineEx::shouldDrawCachedGlyphs(qreal pixelSize, const QTransform &m) const
+bool QPaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
{
+ qreal pixelSize = fontEngine->fontDef.pixelSize;
return (pixelSize * pixelSize * qAbs(m.determinant())) <
QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE;
}
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 62c5d972de..bc944b2297 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -226,8 +226,8 @@ public:
IsEmulationEngine = 0x02 // If set, this object is a QEmulationEngine.
};
virtual uint flags() const {return 0;}
- virtual bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
- virtual bool shouldDrawCachedGlyphs(qreal pixelSize, const QTransform &m) const;
+ virtual bool supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const;
+ virtual bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const;
protected:
QPaintEngineEx(QPaintEngineExPrivate &data);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 0f5468df4e..eafbe87b31 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -90,7 +90,7 @@ void qt_format_text(const QFont &font,
const QRectF &_r, int tf, const QTextOption *option, const QString& str, QRectF *brect,
int tabstops, int* tabarray, int tabarraylen,
QPainter *painter);
-static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe,
+static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextEngine *textEngine,
QTextCharFormat::UnderlineStyle underlineStyle,
QTextItem::RenderFlags flags, qreal width,
const QTextCharFormat &charFormat);
@@ -5551,14 +5551,9 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count);
QRawFontPrivate *fontD = QRawFontPrivate::get(font);
- bool supportsTransformations;
- if (d->extended != 0) {
- supportsTransformations = d->extended->supportsTransformations(fontD->fontEngine->fontDef.pixelSize,
- d->state->matrix);
- } else {
- supportsTransformations = d->engine->type() == QPaintEngine::CoreGraphics
- || d->state->matrix.isAffine();
- }
+ bool supportsTransformations = d->extended
+ ? d->extended->supportsTransformations(fontD->fontEngine, d->state->matrix)
+ : d->engine->type() == QPaintEngine::CoreGraphics || d->state->matrix.isAffine();
for (int i=0; i<count; ++i) {
QPointF processedPosition = position + glyphPositions[i];
@@ -5646,6 +5641,7 @@ void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positio
drawTextItemDecoration(q, QPointF(leftMost.toReal(), baseLine.toReal()),
fontEngine,
+ 0, // textEngine
(underline
? QTextCharFormat::SingleUnderline
: QTextCharFormat::NoUnderline),
@@ -5739,7 +5735,7 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
return;
}
- bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.pixelSize(),
+ bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.d->engineForScript(QUnicodeTables::Common),
d->state->matrix);
if (supportsTransformations && !staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = true;
@@ -6182,7 +6178,7 @@ static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen)
return pixmap;
}
-static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe,
+static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextEngine *textEngine,
QTextCharFormat::UnderlineStyle underlineStyle,
QTextItem::RenderFlags flags, qreal width,
const QTextCharFormat &charFormat)
@@ -6227,15 +6223,17 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
painter->fillRect(pos.x(), 0, qCeil(width), qMin(wave.height(), descent), wave);
painter->restore();
} else if (underlineStyle != QTextCharFormat::NoUnderline) {
- QLineF underLine(line.x1(), underlinePos, line.x2(), underlinePos);
-
QColor uc = charFormat.underlineColor();
if (uc.isValid())
pen.setColor(uc);
pen.setStyle((Qt::PenStyle)(underlineStyle));
painter->setPen(pen);
- painter->drawLine(underLine);
+ QLineF underline(line.x1(), underlinePos, line.x2(), underlinePos);
+ if (textEngine)
+ textEngine->addUnderline(painter, underline);
+ else
+ painter->drawLine(underline);
}
pen.setStyle(Qt::SolidLine);
@@ -6245,14 +6243,20 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
QLineF strikeOutLine = line;
strikeOutLine.translate(0., - fe->ascent().toReal() / 3.);
painter->setPen(pen);
- painter->drawLine(strikeOutLine);
+ if (textEngine)
+ textEngine->addStrikeOut(painter, strikeOutLine);
+ else
+ painter->drawLine(strikeOutLine);
}
if (flags & QTextItem::Overline) {
- QLineF overLine = line;
- overLine.translate(0., - fe->ascent().toReal());
+ QLineF overline = line;
+ overline.translate(0., - fe->ascent().toReal());
painter->setPen(pen);
- painter->drawLine(overLine);
+ if (textEngine)
+ textEngine->addOverline(painter, overline);
+ else
+ painter->drawLine(overline);
}
painter->setPen(oldPen);
@@ -6277,7 +6281,7 @@ Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t
// We don't support glyphs that do not share a common baseline. If this turns out to
// be a relevant use case, then we need to find clusters of glyphs that share a baseline
- // and do a drawTextItemDecorations call per cluster.
+ // and do a drawTextItemDecoration call per cluster.
if (i == 0 || baseLine < positions[i].y)
baseLine = positions[i].y;
@@ -6298,12 +6302,20 @@ Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t
drawTextItemDecoration(painter, QPointF(leftMost.toReal(), baseLine.toReal()),
fontEngine,
+ 0, // textEngine
font.underline() ? QTextCharFormat::SingleUnderline
: QTextCharFormat::NoUnderline, flags,
width.toReal(), charFormat);
}
-void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
+void QPainter::drawTextItem(const QPointF &p, const QTextItem &ti)
+{
+ Q_D(QPainter);
+
+ d->drawTextItem(p, ti, static_cast<QTextEngine *>(0));
+}
+
+void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QTextEngine *textEngine)
{
#ifdef QT_DEBUG_DRAW
if (qt_show_painter_debug_output)
@@ -6311,35 +6323,35 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
p.x(), p.y(), qPrintable(_ti.text()));
#endif
- Q_D(QPainter);
+ Q_Q(QPainter);
- if (!d->engine)
+ if (!engine)
return;
#ifndef QT_NO_DEBUG
- qt_painter_thread_test(d->device->devType(),
+ qt_painter_thread_test(device->devType(),
"text and fonts",
QFontDatabase::supportsThreadedFontRendering());
#endif
QTextItemInt &ti = const_cast<QTextItemInt &>(static_cast<const QTextItemInt &>(_ti));
- if (!d->extended && d->state->bgMode == Qt::OpaqueMode) {
+ if (!extended && state->bgMode == Qt::OpaqueMode) {
QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal());
- fillRect(rect, d->state->bgBrush);
+ q->fillRect(rect, state->bgBrush);
}
- if (pen().style() == Qt::NoPen)
+ if (q->pen().style() == Qt::NoPen)
return;
- const RenderHints oldRenderHints = d->state->renderHints;
- if (!d->state->renderHints & QPainter::Antialiasing && d->state->matrix.type() >= QTransform::TxScale) {
+ const QPainter::RenderHints oldRenderHints = state->renderHints;
+ if (!state->renderHints & QPainter::Antialiasing && state->matrix.type() >= QTransform::TxScale) {
// draw antialias decoration (underline/overline/strikeout) with
// transformed text
bool aa = true;
- const QTransform &m = d->state->matrix;
- if (d->state->matrix.type() < QTransform::TxShear) {
+ const QTransform &m = state->matrix;
+ if (state->matrix.type() < QTransform::TxShear) {
bool isPlain90DegreeRotation =
(qFuzzyIsNull(m.m11())
&& qFuzzyIsNull(m.m12() - qreal(1))
@@ -6362,11 +6374,11 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
aa = !isPlain90DegreeRotation;
}
if (aa)
- setRenderHint(QPainter::Antialiasing, true);
+ q->setRenderHint(QPainter::Antialiasing, true);
}
- if (!d->extended)
- d->updateState(d->state);
+ if (!extended)
+ updateState(state);
if (!ti.glyphs.numGlyphs) {
// nothing to do
@@ -6402,7 +6414,7 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
if (rtl)
x -= ti2.width.toReal();
- d->engine->drawTextItem(QPointF(x, y), ti2);
+ engine->drawTextItem(QPointF(x, y), ti2);
if (!rtl)
x += ti2.width.toReal();
@@ -6429,10 +6441,10 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
if (rtl)
x -= ti2.width.toReal();
- if (d->extended)
- d->extended->drawTextItem(QPointF(x, y), ti2);
+ if (extended)
+ extended->drawTextItem(QPointF(x, y), ti2);
else
- d->engine->drawTextItem(QPointF(x,y), ti2);
+ engine->drawTextItem(QPointF(x,y), ti2);
// reset the high byte for all glyphs
const int hi = which << 24;
@@ -6440,20 +6452,20 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
glyphs.glyphs[i] = hi | glyphs.glyphs[i];
} else {
- if (d->extended)
- d->extended->drawTextItem(p, ti);
+ if (extended)
+ extended->drawTextItem(p, ti);
else
- d->engine->drawTextItem(p, ti);
+ engine->drawTextItem(p, ti);
}
- drawTextItemDecoration(this, p, ti.fontEngine, ti.underlineStyle, ti.flags, ti.width.toReal(),
- ti.charFormat);
+ drawTextItemDecoration(q, p, ti.fontEngine, textEngine, ti.underlineStyle,
+ ti.flags, ti.width.toReal(), ti.charFormat);
- if (d->state->renderHints != oldRenderHints) {
- d->state->renderHints = oldRenderHints;
- if (d->extended)
- d->extended->renderHintsChanged();
+ if (state->renderHints != oldRenderHints) {
+ state->renderHints = oldRenderHints;
+ if (extended)
+ extended->renderHintsChanged();
else
- d->state->dirtyFlags |= QPaintEngine::DirtyHints;
+ state->dirtyFlags |= QPaintEngine::DirtyHints;
}
}
@@ -7550,11 +7562,12 @@ start_lengthVariant:
for (int i = 0; i < textLayout.lineCount(); i++) {
QTextLine line = textLayout.lineAt(i);
+ QTextEngine *eng = textLayout.engine();
+ eng->enableDelayDecorations();
qreal advance = line.horizontalAdvance();
xoff = 0;
if (tf & Qt::AlignRight) {
- QTextEngine *eng = textLayout.engine();
xoff = r.width() - advance -
eng->leadingSpaceWidth(eng->lines[line.lineNumber()]).toReal();
}
@@ -7562,6 +7575,7 @@ start_lengthVariant:
xoff = (r.width() - advance) / 2;
line.draw(painter, QPointF(r.x() + xoff, r.y() + yoff));
+ eng->drawDecorations(painter);
}
if (restore) {
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 67b05eeca5..97c10a2764 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -74,6 +74,7 @@ class QPainterPrivate;
class QPen;
class QPolygon;
class QTextItem;
+class QTextEngine;
class QMatrix;
class QTransform;
class QStaticText;
@@ -487,6 +488,7 @@ private:
friend class QRasterPaintEngine;
friend class QAlphaPaintEngine;
friend class QPreviewPaintEngine;
+ friend class QTextEngine;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QPainter::RenderHints)
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index fecf8bd960..3327860ac9 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -230,6 +230,7 @@ public:
void draw_helper(const QPainterPath &path, DrawOperation operation = StrokeAndFillDraw);
void drawStretchedGradient(const QPainterPath &path, DrawOperation operation);
void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation);
+ void drawTextItem(const QPointF &p, const QTextItem &_ti, QTextEngine *textEngine);
#if !defined(QT_NO_RAWFONT)
void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount,
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp
index fb06a26c8f..a1deb47175 100644
--- a/src/gui/text/qdistancefield.cpp
+++ b/src/gui/text/qdistancefield.cpp
@@ -692,17 +692,8 @@ static QImage makeDistanceField(int imgSize, const QPainterPath &path, int dfSca
return image;
}
-bool qt_fontHasNarrowOutlines(const QRawFont &f)
+static bool imageHasNarrowOutlines(const QImage &im)
{
- QRawFont font = f;
- font.setPixelSize(QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE);
- Q_ASSERT(font.isValid());
-
- QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("O"));
- if (glyphIndices.size() < 1)
- return false;
-
- QImage im = font.alphaMapForGlyph(glyphIndices.at(0), QRawFont::PixelAntialiasing);
if (im.isNull())
return false;
@@ -742,6 +733,56 @@ bool qt_fontHasNarrowOutlines(const QRawFont &f)
return minHThick == 1 || minVThick == 1;
}
+bool qt_fontHasNarrowOutlines(QFontEngine *fontEngine)
+{
+ QFontEngine *fe = fontEngine->cloneWithSize(QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE);
+
+ QGlyphLayout glyphs;
+ glyph_t glyph;
+ glyphs.glyphs = &glyph;
+ int numGlyphs;
+ QChar *chars = QString(QLatin1String("O")).data();
+ fe->stringToCMap(chars, 1, &glyphs, &numGlyphs, QTextEngine::GlyphIndicesOnly);
+ QImage im = fe->alphaMapForGlyph(glyph, QFixed(), QTransform());
+ delete fe;
+
+ return imageHasNarrowOutlines(im);
+}
+
+bool qt_fontHasNarrowOutlines(const QRawFont &f)
+{
+ QRawFont font = f;
+ font.setPixelSize(QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE);
+ Q_ASSERT(font.isValid());
+
+ QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("O"));
+ if (glyphIndices.size() < 1)
+ return false;
+
+ return imageHasNarrowOutlines(font.alphaMapForGlyph(glyphIndices.at(0),
+ QRawFont::PixelAntialiasing));
+}
+
+static QImage renderDistanceFieldPath(const QPainterPath &path, bool doubleResolution)
+{
+ QImage im = makeDistanceField(QT_DISTANCEFIELD_TILESIZE(doubleResolution),
+ path,
+ QT_DISTANCEFIELD_SCALE(doubleResolution),
+ QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution));
+ return im;
+}
+
+QImage qt_renderDistanceFieldGlyph(QFontEngine *fe, glyph_t glyph, bool doubleResolution)
+{
+ QFixedPoint position;
+ QPainterPath path;
+ fe->addGlyphsToPath(&glyph, &position, 1, &path, 0);
+ path.translate(-path.boundingRect().topLeft());
+ path.setFillRule(Qt::WindingFill);
+
+ return renderDistanceFieldPath(path, doubleResolution);
+}
+
QImage qt_renderDistanceFieldGlyph(const QRawFont &font, glyph_t glyph, bool doubleResolution)
{
QRawFont renderFont = font;
@@ -751,11 +792,7 @@ QImage qt_renderDistanceFieldGlyph(const QRawFont &font, glyph_t glyph, bool dou
path.translate(-path.boundingRect().topLeft());
path.setFillRule(Qt::WindingFill);
- QImage im = makeDistanceField(QT_DISTANCEFIELD_TILESIZE(doubleResolution),
- path,
- QT_DISTANCEFIELD_SCALE(doubleResolution),
- QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution));
- return im;
+ return renderDistanceFieldPath(path, doubleResolution);
}
QT_END_NAMESPACE
diff --git a/src/gui/text/qdistancefield_p.h b/src/gui/text/qdistancefield_p.h
index 486d291b78..bf87e7d3cb 100644
--- a/src/gui/text/qdistancefield_p.h
+++ b/src/gui/text/qdistancefield_p.h
@@ -79,6 +79,8 @@ QT_BEGIN_NAMESPACE
bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(const QRawFont &f);
QImage Q_GUI_EXPORT qt_renderDistanceFieldGlyph(const QRawFont &font, glyph_t glyph, bool doubleResolution);
+bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(QFontEngine *fontEngine);
+QImage Q_GUI_EXPORT qt_renderDistanceFieldGlyph(QFontEngine *fontEngine, glyph_t glyph, bool doubleResolution);
QT_END_NAMESPACE
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index c68452d55a..56ff298d9b 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2733,20 +2733,6 @@ void QFontCache::updateHitCountAndTimeStamp(Engine &value)
value.data->name());
}
-void QFontCache::removeEngine(QFontEngine *engine)
-{
- EngineCache::iterator it = engineCache.begin();
- while (it != engineCache.end()) {
- if (it.value().data == engine) {
- it = engineCache.erase(it);
- if (--engine->cache_count == 0)
- decreaseCost(engine->cache_cost);
- } else {
- ++it;
- }
- }
-}
-
void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMulti)
{
FC_DEBUG("QFontCache: inserting new engine %p", engine);
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 06cf787880..13e5fcbedd 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -245,7 +245,6 @@ public:
void updateHitCountAndTimeStamp(Engine &value);
void insertEngine(const Key &key, QFontEngine *engine, bool insertMulti = false);
- void removeEngine(QFontEngine *engine);
private:
void increaseCost(uint cost);
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 142d627100..364a356b96 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -775,7 +775,7 @@ QByteArray QFontEngine::getSfntTable(uint tag) const
return table;
}
-void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data)
+void QFontEngine::setGlyphCache(const void *key, QFontEngineGlyphCache *data)
{
Q_ASSERT(data);
@@ -794,7 +794,7 @@ void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data)
}
-QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
+QFontEngineGlyphCache *QFontEngine::glyphCache(const void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
{
for (QLinkedList<GlyphCacheEntry>::const_iterator it = m_glyphCaches.constBegin(), end = m_glyphCaches.constEnd(); it != end; ++it) {
QFontEngineGlyphCache *c = it->cache.data();
@@ -1421,22 +1421,6 @@ bool QFontEngineMulti::shouldLoadFontEngineForCharacter(int at, uint ucs4) const
return true;
}
-void QFontEngineMulti::unloadEngine(int at)
-{
- QFontEngine *fontEngine = engines.at(at);
- if (fontEngine == 0)
- return;
-
- // If there are other references to the engine, keep it around and keep the reference
- if (fontEngine->ref.load() == 1) {
- QFontCache::instance()->removeEngine(fontEngine);
- if (fontEngine->cache_count == 0) {
- delete fontEngine;
- engines[at] = 0;
- }
- }
-}
-
glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs)
{
if (glyphs.numGlyphs <= 0)
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 660e3be459..1114cdf12c 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -239,8 +239,8 @@ public:
virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
- void setGlyphCache(void *key, QFontEngineGlyphCache *data);
- QFontEngineGlyphCache *glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const;
+ void setGlyphCache(const void *key, QFontEngineGlyphCache *data);
+ QFontEngineGlyphCache *glyphCache(const void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const;
static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode);
@@ -284,7 +284,7 @@ protected:
private:
struct GlyphCacheEntry {
- void *context;
+ const void *context;
QExplicitlySharedDataPointer<QFontEngineGlyphCache> cache;
bool operator==(const GlyphCacheEntry &other) const { return context == other.context && cache == other.cache; }
};
@@ -401,7 +401,6 @@ protected:
friend class QPSPrintEngineFontMulti;
friend class QRawFont;
virtual void loadEngine(int at) = 0;
- virtual void unloadEngine(int at);
QVector<QFontEngine *> engines;
};
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index 847b7e4852..b590775d8b 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -124,6 +124,8 @@ private:
QExplicitlySharedDataPointer<QGlyphRunPrivate> d;
};
+Q_DECLARE_TYPEINFO(QGlyphRun, Q_MOVABLE_TYPE);
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index dae02def07..3d58d91169 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1174,6 +1174,7 @@ static void init(QTextEngine *e)
e->cacheGlyphs = false;
e->forceJustification = false;
e->visualMovement = false;
+ e->delayDecorations = false;
e->layoutData = 0;
@@ -2913,6 +2914,104 @@ int QTextEngine::positionAfterVisualMovement(int pos, QTextCursor::MoveOperation
return pos;
}
+void QTextEngine::addItemDecoration(QPainter *painter, const QLineF &line, ItemDecorationList *decorationList)
+{
+ if (delayDecorations) {
+ decorationList->append(ItemDecoration(line.x1(), line.x2(), line.y1(), painter->pen()));
+ } else {
+ painter->drawLine(line);
+ }
+}
+
+void QTextEngine::addUnderline(QPainter *painter, const QLineF &line)
+{
+ // qDebug() << "Adding underline:" << line;
+ addItemDecoration(painter, line, &underlineList);
+}
+
+void QTextEngine::addStrikeOut(QPainter *painter, const QLineF &line)
+{
+ addItemDecoration(painter, line, &strikeOutList);
+}
+
+void QTextEngine::addOverline(QPainter *painter, const QLineF &line)
+{
+ addItemDecoration(painter, line, &overlineList);
+}
+
+void QTextEngine::drawItemDecorationList(QPainter *painter, const ItemDecorationList &decorationList)
+{
+ // qDebug() << "Drawing" << decorationList.size() << "decorations";
+ if (decorationList.isEmpty())
+ return;
+
+ foreach (const ItemDecoration decoration, decorationList) {
+ painter->setPen(decoration.pen);
+ QLineF line(decoration.x1, decoration.y, decoration.x2, decoration.y);
+ painter->drawLine(line);
+ }
+}
+
+void QTextEngine::drawDecorations(QPainter *painter)
+{
+ QPen oldPen = painter->pen();
+
+ adjustUnderlines();
+ drawItemDecorationList(painter, underlineList);
+ drawItemDecorationList(painter, strikeOutList);
+ drawItemDecorationList(painter, overlineList);
+
+ painter->setPen(oldPen);
+ clearDecorations();
+}
+
+void QTextEngine::clearDecorations()
+{
+ underlineList.clear();
+ strikeOutList.clear();
+ overlineList.clear();
+}
+
+void QTextEngine::adjustUnderlines()
+{
+ // qDebug() << __PRETTY_FUNCTION__ << underlineList.count() << "underlines";
+ if (underlineList.isEmpty())
+ return;
+
+ ItemDecorationList::iterator start = underlineList.begin();
+ ItemDecorationList::iterator end = underlineList.end();
+ ItemDecorationList::iterator it = start;
+ qreal underlinePos = start->y;
+ qreal penWidth = start->pen.widthF();
+ qreal lastLineEnd = start->x1;
+
+ while (it != end) {
+ if (qFuzzyCompare(lastLineEnd, it->x1)) { // no gap between underlines
+ underlinePos = qMax(underlinePos, it->y);
+ penWidth = qMax(penWidth, it->pen.widthF());
+ } else { // gap between this and the last underline
+ adjustUnderlines(start, it, underlinePos, penWidth);
+ start = it;
+ underlinePos = start->y;
+ penWidth = start->pen.widthF();
+ }
+ lastLineEnd = it->x2;
+ ++it;
+ }
+
+ adjustUnderlines(start, end, underlinePos, penWidth);
+}
+
+void QTextEngine::adjustUnderlines(ItemDecorationList::iterator start,
+ ItemDecorationList::iterator end,
+ qreal underlinePos, qreal penWidth)
+{
+ for (ItemDecorationList::iterator it = start; it != end; ++it) {
+ it->y = underlinePos;
+ it->pen.setWidth(penWidth);
+ }
+}
+
QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f)
: QTextEngine(string, f),
_layoutData(string, _memory, MemSize)
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 6f1fd713f1..03581eb6a2 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -446,6 +446,18 @@ public:
bool reallocate(int totalGlyphs);
};
+ struct ItemDecoration {
+ ItemDecoration(qreal x1, qreal x2, qreal y, const QPen &pen):
+ x1(x1), x2(x2), y(y), pen(pen) {}
+
+ qreal x1;
+ qreal x2;
+ qreal y;
+ QPen pen;
+ };
+
+ typedef QList<ItemDecoration> ItemDecorationList;
+
QTextEngine(LayoutData *data);
QTextEngine();
QTextEngine(const QString &str, const QFont &f);
@@ -597,6 +609,7 @@ public:
uint stackEngine : 1;
uint forceJustification : 1;
uint visualMovement : 1;
+ uint delayDecorations: 1;
#ifndef QT_NO_RAWFONT
uint useRawFont : 1;
#endif
@@ -605,6 +618,10 @@ public:
mutable LayoutData *layoutData;
+ ItemDecorationList underlineList;
+ ItemDecorationList strikeOutList;
+ ItemDecorationList overlineList;
+
inline bool hasFormats() const { return (block.docHandle() || specialData); }
inline bool visualCursorMovement() const
{
@@ -639,7 +656,22 @@ public:
void insertionPointsForLine(int lineNum, QVector<int> &insertionPoints);
void resetFontEngineCache();
+ void enableDelayDecorations(bool enable = true) { delayDecorations = enable; }
+
+ void addUnderline(QPainter *painter, const QLineF &line);
+ void addStrikeOut(QPainter *painter, const QLineF &line);
+ void addOverline(QPainter *painter, const QLineF &line);
+
+ void drawDecorations(QPainter *painter);
+ void clearDecorations();
+ void adjustUnderlines();
+
private:
+ void addItemDecoration(QPainter *painter, const QLineF &line, ItemDecorationList *decorationList);
+ void adjustUnderlines(ItemDecorationList::iterator start,
+ ItemDecorationList::iterator end,
+ qreal underlinePos, qreal penWidth);
+ void drawItemDecorationList(QPainter *painter, const ItemDecorationList &decorationList);
void setBoundary(int strPos) const;
void addRequiredBoundaries() const;
void shapeText(int item) const;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index d5b05a8957..56098b0bdb 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -60,6 +60,7 @@
#include <qdebug.h>
#include "qfontengine_p.h"
+#include <private/qpainter_p.h>
QT_BEGIN_NAMESPACE
@@ -2062,7 +2063,7 @@ static void drawMenuText(QPainter *p, QFixed x, QFixed y, const QScriptItem &si,
if (rtl)
x -= w;
if (gf.num_chars)
- p->drawTextItem(QPointF(x.toReal(), y.toReal()), gf);
+ QPainterPrivate::get(p)->drawTextItem(QPointF(x.toReal(), y.toReal()), gf, eng);
if (!rtl)
x += w;
if (ul && *ul != -1 && *ul < end) {
@@ -2083,7 +2084,7 @@ static void drawMenuText(QPainter *p, QFixed x, QFixed y, const QScriptItem &si,
gf.underlineStyle = QTextCharFormat::SingleUnderline;
if (rtl)
x -= w;
- p->drawTextItem(QPointF(x.toReal(), y.toReal()), gf);
+ QPainterPrivate::get(p)->drawTextItem(QPointF(x.toReal(), y.toReal()), gf, eng);
if (!rtl)
x += w;
gf.underlineStyle = QTextCharFormat::NoUnderline;
@@ -2379,6 +2380,8 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
QTextLineItemIterator iterator(eng, index, pos, selection);
QFixed lineBase = line.base();
+ eng->clearDecorations();
+ eng->enableDelayDecorations();
const QFixed y = QFixed::fromReal(pos.y()) + line.y + lineBase;
@@ -2451,7 +2454,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
gf.chars = 0;
gf.num_chars = 0;
gf.width = iterator.itemWidth;
- p->drawTextItem(QPointF(iterator.x.toReal(), y.toReal()), gf);
+ QPainterPrivate::get(p)->drawTextItem(QPointF(iterator.x.toReal(), y.toReal()), gf, eng);
if (eng->option.flags() & QTextOption::ShowTabsAndSpaces) {
QChar visualTab(0x2192);
int w = QFontMetrics(f).width(visualTab);
@@ -2529,7 +2532,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
} else {
if (noText)
gf.glyphs.numGlyphs = 0; // slightly less elegant than it should be
- p->drawTextItem(pos, gf);
+ QPainterPrivate::get(p)->drawTextItem(pos, gf, eng);
}
}
if (si.analysis.flags == QScriptAnalysis::Space
@@ -2542,7 +2545,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
p->setPen(pen);
}
}
-
+ eng->drawDecorations(p);
if (eng->hasFormats())
p->setPen(pen);
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index c65edb6673..397bb0535e 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1185,6 +1185,7 @@ void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager)
if (manager->d_func()->httpThread) {
// The thread will deleteLater() itself from its finished() signal
manager->d_func()->httpThread->quit();
+ manager->d_func()->httpThread->wait(5000);
manager->d_func()->httpThread = 0;
}
}
@@ -1194,6 +1195,7 @@ QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()
if (httpThread) {
// The thread will deleteLater() itself from its finished() signal
httpThread->quit();
+ httpThread->wait(5000);
httpThread = 0;
}
}
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 1f456746ae..a914ee3f04 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -904,6 +904,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
// End the thread. It will delete itself from the finished() signal
thread->quit();
+ thread->wait(5000);
finished();
} else {
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 0281eaf48b..feef74e737 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -224,8 +224,10 @@
#include "private/qsocks5socketengine_p.h"
#include "private/qhttpsocketengine_p.h"
#include "qauthenticator.h"
+#include "qdebug.h"
#include "qhash.h"
#include "qmutex.h"
+#include "qstringlist.h"
#include "qurl.h"
#ifndef QT_NO_BEARERMANAGEMENT
@@ -1508,6 +1510,51 @@ QList<QNetworkProxy> QNetworkProxyFactory::proxyForQuery(const QNetworkProxyQuer
return globalNetworkProxy()->proxyForQuery(query);
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QNetworkProxy &proxy)
+{
+ QNetworkProxy::ProxyType type = proxy.type();
+ switch (type) {
+ case QNetworkProxy::NoProxy:
+ debug << "NoProxy ";
+ break;
+ case QNetworkProxy::DefaultProxy:
+ debug << "DefaultProxy ";
+ break;
+ case QNetworkProxy::Socks5Proxy:
+ debug << "Socks5Proxy ";
+ break;
+ case QNetworkProxy::HttpProxy:
+ debug << "HttpProxy ";
+ break;
+ case QNetworkProxy::HttpCachingProxy:
+ debug << "HttpCachingProxy ";
+ break;
+ case QNetworkProxy::FtpCachingProxy:
+ debug << "FtpCachingProxy ";
+ break;
+ default:
+ debug << "Unknown proxy " << int(type);
+ break;
+ }
+ debug << "\"" << proxy.hostName() << ":" << proxy.port() << "\" ";
+ QNetworkProxy::Capabilities caps = proxy.capabilities();
+ QStringList scaps;
+ if (caps & QNetworkProxy::TunnelingCapability)
+ scaps << QStringLiteral("Tunnel");
+ if (caps & QNetworkProxy::ListeningCapability)
+ scaps << QStringLiteral("Listen");
+ if (caps & QNetworkProxy::UdpTunnelingCapability)
+ scaps << QStringLiteral("UDP");
+ if (caps & QNetworkProxy::CachingCapability)
+ scaps << QStringLiteral("Caching");
+ if (caps & QNetworkProxy::HostNameLookupCapability)
+ scaps << QStringLiteral("NameLookup");
+ debug << "[" << scaps.join(QStringLiteral(" ")) << "]";
+ return debug;
+}
+#endif
+
QT_END_NAMESPACE
#endif // QT_NO_NETWORKPROXY
diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h
index 8f961c43ac..805f5cdb5c 100644
--- a/src/network/kernel/qnetworkproxy.h
+++ b/src/network/kernel/qnetworkproxy.h
@@ -203,6 +203,10 @@ public:
static QList<QNetworkProxy> systemProxyForQuery(const QNetworkProxyQuery &query = QNetworkProxyQuery());
};
+#ifndef QT_NO_DEBUG_STREAM
+Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkProxy &proxy);
+#endif
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp
index 33ae4a6a14..4f1dece4a9 100644
--- a/src/network/kernel/qnetworkproxy_win.cpp
+++ b/src/network/kernel/qnetworkproxy_win.cpp
@@ -103,6 +103,7 @@ typedef struct {
#define WINHTTP_ERROR_BASE 12000
#define ERROR_WINHTTP_LOGIN_FAILURE (WINHTTP_ERROR_BASE + 15)
+#define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT (WINHTTP_ERROR_BASE + 167)
#define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180)
QT_BEGIN_NAMESPACE
@@ -146,7 +147,7 @@ static QStringList splitSpaceSemicolon(const QString &source)
static bool isBypassed(const QString &host, const QStringList &bypassList)
{
if (host.isEmpty())
- return true;
+ return false;
bool isSimple = !host.contains(QLatin1Char('.')) && !host.contains(QLatin1Char(':'));
@@ -171,6 +172,51 @@ static bool isBypassed(const QString &host, const QStringList &bypassList)
return false;
}
+static QList<QNetworkProxy> filterProxyListByCapabilities(const QList<QNetworkProxy> &proxyList, const QNetworkProxyQuery &query)
+{
+ QNetworkProxy::Capabilities requiredCaps;
+ switch (query.queryType()) {
+ case QNetworkProxyQuery::TcpSocket:
+ requiredCaps = QNetworkProxy::TunnelingCapability;
+ break;
+ case QNetworkProxyQuery::UdpSocket:
+ requiredCaps = QNetworkProxy::UdpTunnelingCapability;
+ break;
+ case QNetworkProxyQuery::TcpServer:
+ requiredCaps = QNetworkProxy::ListeningCapability;
+ break;
+ default:
+ return proxyList;
+ break;
+ }
+ QList<QNetworkProxy> result;
+ foreach (const QNetworkProxy& proxy, proxyList) {
+ if (proxy.capabilities() & requiredCaps)
+ result.append(proxy);
+ }
+ return result;
+}
+
+static QList<QNetworkProxy> removeDuplicateProxies(const QList<QNetworkProxy> &proxyList)
+{
+ QList<QNetworkProxy> result;
+ foreach (QNetworkProxy proxy, proxyList) {
+ bool append = true;
+ for (int i=0; i < result.count(); i++) {
+ if (proxy.hostName() == result.at(i).hostName()
+ && proxy.port() == result.at(i).port()) {
+ append = false;
+ // HttpProxy trumps FtpCachingProxy or HttpCachingProxy on the same host/port
+ if (proxy.type() == QNetworkProxy::HttpProxy)
+ result[i] = proxy;
+ }
+ }
+ if (append)
+ result.append(proxy);
+ }
+ return result;
+}
+
static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, const QStringList &proxyList)
{
// Reference documentation from Microsoft:
@@ -179,38 +225,46 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
// According to the website, the proxy server list is
// one or more of the space- or semicolon-separated strings in the format:
// ([<scheme>=][<scheme>"://"]<server>[":"<port>])
+ // The first scheme relates to the protocol tag
+ // The second scheme, if present, overrides the proxy type
QList<QNetworkProxy> result;
+ QHash<QString, QNetworkProxy> taggedProxies;
+ const QString requiredTag = query.protocolTag();
+ bool checkTags = !requiredTag.isEmpty() && query.queryType() != QNetworkProxyQuery::TcpServer; //windows tags are only for clients
foreach (const QString &entry, proxyList) {
int server = 0;
+ QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy;
+ quint16 port = 8080;
+
int pos = entry.indexOf(QLatin1Char('='));
+ QStringRef scheme;
+ QStringRef protocolTag;
if (pos != -1) {
- QStringRef scheme = entry.leftRef(pos);
- if (scheme != query.protocolTag())
- continue;
-
+ scheme = protocolTag = entry.leftRef(pos);
server = pos + 1;
}
-
- QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy;
- quint16 port = 8080;
-
pos = entry.indexOf(QLatin1String("://"), server);
if (pos != -1) {
- QStringRef scheme = entry.midRef(server, pos - server);
+ scheme = entry.midRef(server, pos - server);
+ server = pos + 3;
+ }
+
+ if (!scheme.isEmpty()) {
if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) {
// no-op
// defaults are above
} else if (scheme == QLatin1String("socks") || scheme == QLatin1String("socks5")) {
proxyType = QNetworkProxy::Socks5Proxy;
port = 1080;
+ } else if (scheme == QLatin1String("ftp")) {
+ proxyType = QNetworkProxy::FtpCachingProxy;
+ port = 2121;
} else {
// unknown proxy type
continue;
}
-
- server = pos + 3;
}
pos = entry.indexOf(QLatin1Char(':'), server);
@@ -226,9 +280,32 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
}
result << QNetworkProxy(proxyType, entry.mid(server, pos - server), port);
+ if (!protocolTag.isEmpty())
+ taggedProxies.insert(protocolTag.toString(), result.last());
}
- return result;
+ if (checkTags && taggedProxies.contains(requiredTag)) {
+ if (query.queryType() == QNetworkProxyQuery::UrlRequest) {
+ result.clear();
+ result.append(taggedProxies.value(requiredTag));
+ return result;
+ } else {
+ result.prepend(taggedProxies.value(requiredTag));
+ }
+ }
+ if (!checkTags || requiredTag != QLatin1String("http")) {
+ // if there are different http proxies for http and https, prefer the https one (more likely to be capable of CONNECT)
+ QNetworkProxy httpProxy = taggedProxies.value(QLatin1String("http"));
+ QNetworkProxy httpsProxy = taggedProxies.value(QLatin1String("http"));
+ if (httpProxy != httpsProxy && httpProxy.type() == QNetworkProxy::HttpProxy && httpsProxy.type() == QNetworkProxy::HttpProxy) {
+ for (int i = 0; i < result.count(); i++) {
+ if (httpProxy == result.at(i))
+ result[i].setType(QNetworkProxy::HttpCachingProxy);
+ }
+ }
+ }
+ result = filterProxyListByCapabilities(result, query);
+ return removeDuplicateProxies(result);
}
class QWindowsSystemProxy
@@ -306,14 +383,27 @@ void QWindowsSystemProxy::init()
proxyBypass = splitSpaceSemicolon(QString::fromWCharArray(ieProxyConfig.lpszProxyBypass));
GlobalFree(ieProxyConfig.lpszProxyBypass);
}
+ } else {
+ // no user configuration
+ // attempt to get the default configuration instead
+ WINHTTP_PROXY_INFO proxyInfo;
+ if (ptrWinHttpGetDefaultProxyConfiguration(&proxyInfo) &&
+ proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NAMED_PROXY) {
+ // we got information from the registry
+ // overwrite the IE configuration, if any
+
+ proxyBypass = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxyBypass));
+ proxyServerList = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxy));
+ }
+
+ if (proxyInfo.lpszProxy)
+ GlobalFree(proxyInfo.lpszProxy);
+ if (proxyInfo.lpszProxyBypass)
+ GlobalFree(proxyInfo.lpszProxyBypass);
}
hHttpSession = NULL;
if (ieProxyConfig.fAutoDetect || !autoConfigUrl.isEmpty()) {
- // using proxy autoconfiguration
- proxyServerList.clear();
- proxyBypass.clear();
-
// open the handle and obtain the options
hHttpSession = ptrWinHttpOpen(L"Qt System Proxy access/1.0",
WINHTTP_ACCESS_TYPE_NO_PROXY,
@@ -326,6 +416,9 @@ void QWindowsSystemProxy::init()
isAutoConfig = true;
memset(&autoProxyOptions, 0, sizeof autoProxyOptions);
autoProxyOptions.fAutoLogonIfChallenged = false;
+ //Although it is possible to specify dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT | WINHTTP_AUTOPROXY_CONFIG_URL
+ //this has poor performance (WPAD is attempted for every url, taking 2.5 seconds per interface,
+ //before the configured pac file is used)
if (ieProxyConfig.fAutoDetect) {
autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
autoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP |
@@ -334,23 +427,6 @@ void QWindowsSystemProxy::init()
autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)autoConfigUrl.utf16();
}
- } else {
- // not auto-detected
- // attempt to get the static configuration instead
- WINHTTP_PROXY_INFO proxyInfo;
- if (ptrWinHttpGetDefaultProxyConfiguration(&proxyInfo) &&
- proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NAMED_PROXY) {
- // we got information from the registry
- // overwrite the IE configuration, if any
-
- proxyBypass = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxyBypass));
- proxyServerList = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxy));
- }
-
- if (proxyInfo.lpszProxy)
- GlobalFree(proxyInfo.lpszProxy);
- if (proxyInfo.lpszProxyBypass)
- GlobalFree(proxyInfo.lpszProxyBypass);
}
functional = isAutoConfig || !proxyServerList.isEmpty();
@@ -390,6 +466,25 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
DWORD getProxyError = GetLastError();
if (!getProxySucceeded
+ && (ERROR_WINHTTP_AUTODETECTION_FAILED == getProxyError)) {
+ // WPAD failed
+ if (sp->autoConfigUrl.isEmpty()) {
+ //No config file could be retrieved on the network.
+ //Don't search for it next time again.
+ sp->isAutoConfig = false;
+ } else {
+ //pac file URL is specified as well, try using that
+ sp->autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
+ sp->autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)sp->autoConfigUrl.utf16();
+ getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
+ (LPCWSTR)url.toString().utf16(),
+ &sp->autoProxyOptions,
+ &proxyInfo);
+ getProxyError = GetLastError();
+ }
+ }
+
+ if (!getProxySucceeded
&& (ERROR_WINHTTP_LOGIN_FAILURE == getProxyError)) {
// We first tried without AutoLogon, because this might prevent caching the result.
// But now we've to enable it (http://msdn.microsoft.com/en-us/library/aa383153%28v=VS.85%29.aspx)
@@ -401,6 +496,13 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
getProxyError = GetLastError();
}
+ if (!getProxySucceeded
+ && (ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT == getProxyError)) {
+ // PAC file url is not connectable, or server returned error (e.g. http 404)
+ //Don't search for it next time again.
+ sp->isAutoConfig = false;
+ }
+
if (getProxySucceeded) {
// yes, we got a config for this URL
QString proxyBypass = QString::fromWCharArray(proxyInfo.lpszProxyBypass);
@@ -410,20 +512,14 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
if (proxyInfo.lpszProxyBypass)
GlobalFree(proxyInfo.lpszProxyBypass);
+ if (proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NO_PROXY)
+ return sp->defaultResult; //i.e. the PAC file result was "DIRECT"
if (isBypassed(query.peerHostName(), splitSpaceSemicolon(proxyBypass)))
return sp->defaultResult;
return parseServerList(query, proxyServerList);
}
- // GetProxyForUrl failed
-
- if (ERROR_WINHTTP_AUTODETECTION_FAILED == getProxyError) {
- //No config file could be retrieved on the network.
- //Don't search for it next time again.
- sp->isAutoConfig = false;
- }
-
- return sp->defaultResult;
+ // GetProxyForUrl failed, fall back to static configuration
}
// static configuration
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index a9573bf1d8..65634a3cb7 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -1161,6 +1161,8 @@ static const char *certificate_blacklist[] = {
"07:27:14:a9", "Digisign Server ID (Enrich)", // (Malaysian) Digicert Sdn. Bhd. cross-signed by Verizon CyberTrust
"4c:0e:63:6a", "Digisign Server ID - (Enrich)", // (Malaysian) Digicert Sdn. Bhd. cross-signed by Entrust
+ "72:03:21:05:c5:0c:08:57:3d:8e:a5:30:4e:fe:e8:b0", "UTN-USERFirst-Hardware", // comodogate test certificate
+ "41", "MD5 Collisions Inc. (http://www.phreedom.org/md5)", // http://www.phreedom.org/research/rogue-ca/
0
};
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 20ad82407c..df60a0fcce 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -338,6 +338,13 @@ init_context:
long options = setupOpenSslOptions(configuration.protocol, configuration.sslOptions);
q_SSL_CTX_set_options(ctx, options);
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ // Tell OpenSSL to release memory early
+ // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
+ if (q_SSLeay() >= 0x10000000L)
+ q_SSL_CTX_set_mode(ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
// Initialize ciphers
QByteArray cipherString;
int first = true;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 758763523f..b0d748692f 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -411,6 +411,7 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
bp,(char *)x,enc,kstr,klen,cb,u)
#endif
#define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
+#define q_SSL_CTX_set_mode(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
#define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 29dab0e1e0..ca32adcd6f 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1432,8 +1432,7 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
// don't try to cache huge fonts or vastly transformed fonts
QFontEngine *fontEngine = textItem->fontEngine();
- const qreal pixelSize = fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f) {
+ if (shouldDrawCachedGlyphs(fontEngine, s->matrix) || det < 0.25f || det > 4.f) {
QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0
? QFontEngineGlyphCache::Type(textItem->fontEngine()->glyphFormat)
: d->glyphCacheType;
@@ -1491,8 +1490,7 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
bool drawCached = txtype < QTransform::TxProject;
// don't try to cache huge fonts or vastly transformed fonts
- const qreal pixelSize = ti.fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f)
+ if (shouldDrawCachedGlyphs(ti.fontEngine, s->matrix) || det < 0.25f || det > 4.f)
drawCached = false;
QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index c5d3417555..8eeee334f5 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -155,7 +155,7 @@ public:
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
- bool supportsTransformations(qreal, const QTransform &) const { return true; }
+ bool supportsTransformations(QFontEngine *, const QTransform &) const { return true; }
private:
Q_DISABLE_COPY(QGL2PaintEngineEx)
};
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
index 7b28b20bcb..2016500767 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
@@ -42,7 +42,6 @@
#include "qfontenginemultifontconfig_p.h"
#include <QtGui/private/qfontengine_ft_p.h>
-#include <fontconfig/fontconfig.h>
#include <QtGui/private/qfontengine_ft_p.h>
QT_BEGIN_NAMESPACE
@@ -53,6 +52,14 @@ QFontEngineMultiFontConfig::QFontEngineMultiFontConfig(QFontEngine *fe, int scri
{
}
+QFontEngineMultiFontConfig::~QFontEngineMultiFontConfig()
+{
+ Q_FOREACH (FcPattern *pattern, cachedMatchPatterns) {
+ if (pattern)
+ FcPatternDestroy(pattern);
+ }
+}
+
bool QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter(int at, uint ucs4) const
{
QFontEngineFT *fontEngine = static_cast<QFontEngineFT *>(engines.at(at));
@@ -61,27 +68,37 @@ bool QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter(int at, uint u
FcCharSet *charSet = fontEngine->freetype->charset;
charSetHasChar = FcCharSetHasChar(charSet, ucs4);
} else {
- FcPattern *requestPattern = FcPatternCreate();
-
- FcValue value;
- value.type = FcTypeString;
- QByteArray cs = fallbackFamilyAt(at-1).toUtf8();
- value.u.s = reinterpret_cast<const FcChar8 *>(cs.data());
- FcPatternAdd(requestPattern, FC_FAMILY, value, true);
-
- FcResult result;
- FcPattern *matchPattern = FcFontMatch(0, requestPattern, &result);
+ FcPattern *matchPattern = getMatchPatternForFallback(at - 1);
if (matchPattern != 0) {
FcCharSet *charSet;
FcPatternGetCharSet(matchPattern, FC_CHARSET, 0, &charSet);
charSetHasChar = FcCharSetHasChar(charSet, ucs4);
- FcPatternDestroy(matchPattern);
}
-
- FcPatternDestroy(requestPattern);
}
return charSetHasChar;
}
+
+FcPattern * QFontEngineMultiFontConfig::getMatchPatternForFallback(int fallBackIndex) const
+{
+ Q_ASSERT(fallBackIndex < fallbackFamilyCount());
+ if (engines.size() - 1 > cachedMatchPatterns.size())
+ cachedMatchPatterns.resize(engines.size() - 1);
+ FcPattern *ret = cachedMatchPatterns.at(fallBackIndex);
+ if (ret)
+ return ret;
+ FcPattern *requestPattern = FcPatternCreate();
+ FcValue value;
+ value.type = FcTypeString;
+ QByteArray cs = fallbackFamilyAt(fallBackIndex).toUtf8();
+ value.u.s = reinterpret_cast<const FcChar8 *>(cs.data());
+ FcPatternAdd(requestPattern, FC_FAMILY, value, true);
+ FcResult result;
+ ret = FcFontMatch(0, requestPattern, &result);
+ cachedMatchPatterns.insert(fallBackIndex, ret);
+ FcPatternDestroy(requestPattern);
+ return ret;
+}
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
index 4323cb7d2e..260a9b5c70 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
@@ -43,6 +43,7 @@
#define QFONTENGINEMULTIFONTCONFIG_H
#include <QtGui/private/qfontengine_qpa_p.h>
+#include <fontconfig/fontconfig.h>
QT_BEGIN_NAMESPACE
@@ -52,7 +53,13 @@ class QFontEngineMultiFontConfig : public QFontEngineMultiQPA
public:
explicit QFontEngineMultiFontConfig(QFontEngine *fe, int script, const QStringList &fallbacks);
+ ~QFontEngineMultiFontConfig();
+
bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const;
+private:
+ FcPattern* getMatchPatternForFallback(int at) const;
+
+ mutable QVector<FcPattern*> cachedMatchPatterns;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 8322d4c70f..47618f02e3 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -3,7 +3,7 @@ TARGET = QtPlatformSupport
QPRO_PWD = $$PWD
QT += core-private gui-private
TEMPLATE = lib
-DESTDIR = $$QMAKE_LIBDIR_QT
+DESTDIR = $$QT.gui.libs
CONFIG += module
CONFIG += staticlib
diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp
index a9f3a858d2..a2fe2cb7fd 100644
--- a/src/plugins/accessible/widgets/itemviews.cpp
+++ b/src/plugins/accessible/widgets/itemviews.cpp
@@ -156,63 +156,6 @@ QHeaderView *QAccessibleTable::verticalHeader() const
return header;
}
-void QAccessibleTable::modelReset()
-{}
-
-void QAccessibleTable::rowsInserted(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = first;
- lastChange.lastRow = last;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeInsert;
-}
-
-void QAccessibleTable::rowsRemoved(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = first;
- lastChange.lastRow = last;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeDelete;
-}
-
-void QAccessibleTable::columnsInserted(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = first;
- lastChange.lastColumn = last;
- lastChange.type = QAccessible2::TableModelChangeInsert;
-}
-
-void QAccessibleTable::columnsRemoved(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = first;
- lastChange.lastColumn = last;
- lastChange.type = QAccessible2::TableModelChangeDelete;
-}
-
-void QAccessibleTable::rowsMoved( const QModelIndex &, int, int, const QModelIndex &, int)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeUpdate;
-}
-
-void QAccessibleTable::columnsMoved( const QModelIndex &, int, int, const QModelIndex &, int)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeUpdate;
-}
-
QAccessibleTableCell *QAccessibleTable::cell(const QModelIndex &index) const
{
if (index.isValid())
@@ -349,13 +292,6 @@ bool QAccessibleTable::unselectColumn(int column)
return true;
}
-QAccessible2::TableModelChange QAccessibleTable::modelChange() const
-{
- QAccessible2::TableModelChange change;
- // FIXME
- return change;
-}
-
QAccessible::Role QAccessibleTable::role() const
{
return m_role;
diff --git a/src/plugins/accessible/widgets/itemviews.h b/src/plugins/accessible/widgets/itemviews.h
index 3d852a2377..2672cd4a16 100644
--- a/src/plugins/accessible/widgets/itemviews.h
+++ b/src/plugins/accessible/widgets/itemviews.h
@@ -88,7 +88,6 @@ public:
virtual QString rowDescription(int row) const;
virtual int columnCount() const;
virtual int rowCount() const;
- virtual QAccessible2::TableModelChange modelChange() const;
// selection
virtual int selectedCellCount() const;
@@ -105,17 +104,7 @@ public:
virtual bool unselectColumn(int column);
protected:
- virtual void modelReset();
- virtual void rowsInserted(const QModelIndex &parent, int first, int last);
- virtual void rowsRemoved(const QModelIndex &parent, int first, int last);
- virtual void columnsInserted(const QModelIndex &parent, int first, int last);
- virtual void columnsRemoved(const QModelIndex &parent, int first, int last);
- virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row);
- virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column);
-
-protected:
QAbstractItemView* view;
- QAccessible2::TableModelChange lastChange;
inline QAccessibleTableCell *cell(const QModelIndex &index) const;
inline QAccessible::Role cellRole() const {
switch (m_role) {
diff --git a/src/plugins/platforms/blackberry/blackberry.pro b/src/plugins/platforms/blackberry/blackberry.pro
deleted file mode 100644
index 94b9c5dbc8..0000000000
--- a/src/plugins/platforms/blackberry/blackberry.pro
+++ /dev/null
@@ -1,71 +0,0 @@
-TARGET = blackberry
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms
-QT += opengl opengl-private platformsupport platformsupport-private widgets-private
-
-# Uncomment this to build with support for IMF once it becomes available in the BBNDK
-#CONFIG += qbb_imf
-
-# Uncomment these to enable debugging output for various aspects of the plugin
-#DEFINES += QBBBUFFER_DEBUG
-#DEFINES += QBBCLIPBOARD_DEBUG
-#DEFINES += QBBEVENTTHREAD_DEBUG
-#DEFINES += QBBGLBACKINGSTORE_DEBUG
-#DEFINES += QBBGLCONTEXT_DEBUG
-#DEFINES += QBBINPUTCONTEXT_DEBUG
-#DEFINES += QBBINPUTCONTEXT_IMF_EVENT_DEBUG
-#DEFINES += QBBINTEGRATION_DEBUG
-#DEFINES += QBBNAVIGATORTHREAD_DEBUG
-#DEFINES += QBBRASTERBACKINGSTORE_DEBUG
-#DEFINES += QBBROOTWINDOW_DEBUG
-#DEFINES += QBBSCREEN_DEBUG
-#DEFINES += QBBVIRTUALKEYBOARD_DEBUG
-#DEFINES += QBBWINDOW_DEBUG
-
-SOURCES = main.cpp \
- qbbbuffer.cpp \
- qbbeventthread.cpp \
- qbbglcontext.cpp \
- qbbglbackingstore.cpp \
- qbbintegration.cpp \
- qbbnavigatorthread.cpp \
- qbbscreen.cpp \
- qbbwindow.cpp \
- qbbrasterbackingstore.cpp \
- qbbvirtualkeyboard.cpp \
- qbbclipboard.cpp \
- qbbrootwindow.cpp
-
-HEADERS = qbbbuffer.h \
- qbbeventthread.h \
- qbbkeytranslator.h \
- qbbintegration.h \
- qbbnavigatorthread.h \
- qbbglcontext.h \
- qbbglbackingstore.h \
- qbbscreen.h \
- qbbwindow.h \
- qbbrasterbackingstore.h \
- qbbvirtualkeyboard.h \
- qbbclipboard.h \
- qbbrootwindow.h
-
-CONFIG(qbb_imf) {
- DEFINES += QBB_IMF
- HEADERS += qbbinputcontext_imf.h
- SOURCES += qbbinputcontext_imf.cpp
-} else {
- HEADERS += qbbinputcontext_noimf.h
- SOURCES += qbbinputcontext_noimf.cpp
-}
-
-QMAKE_CXXFLAGS += -I./private
-
-LIBS += -lpps -lscreen -lEGL -lclipboard
-
-include (../../../platformsupport/eglconvenience/eglconvenience.pri)
-include (../../../platformsupport/fontdatabases/fontdatabases.pri)
-
-target.path += $$[QT_INSTALL_PLUGINS]/platforms
-INSTALLS += target
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 06d75036bf..58284bcddb 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -204,8 +204,7 @@ static QAccessibleInterface *acast(void *ptr)
- (void)accessibilityPerformAction:(NSString *)action {
QAccessibleActionInterface *actionInterface = acast(accessibleInterface)->actionInterface();
if (actionInterface) {
- QString qtAction = QCocoaAccessible::translateAction(action);
- actionInterface->doAction(QAccessibleActionInterface::pressAction());
+ actionInterface->doAction(QCocoaAccessible::translateAction(action));
}
}
diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro
index 8675dc164e..291e09d6ed 100644
--- a/src/plugins/platforms/eglfs/eglfs.pro
+++ b/src/plugins/platforms/eglfs/eglfs.pro
@@ -2,7 +2,11 @@ TARGET = qeglfs
TEMPLATE = lib
CONFIG += plugin
-QT += opengl core-private gui-private opengl-private platformsupport-private widgets-private
+QT += core-private gui-private platformsupport-private
+
+!contains(QT_CONFIG, no-widgets) {
+ QT += opengl opengl-private widgets-private
+}
DESTDIR = $$QT.gui.plugins/platforms
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
index 331b768a93..d2e4a47e56 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
@@ -39,17 +39,19 @@
**
****************************************************************************/
-#include <QtOpenGL/private/qgl_p.h>
-
#include "qeglfsbackingstore.h"
+#ifndef QT_NO_WIDGETS
+#include <QtOpenGL/private/qgl_p.h>
+#include <QtOpenGL/private/qglpaintdevice_p.h>
+#endif //QT_NO_WIDGETS
+
#include <QtGui/QPlatformOpenGLContext>
#include <QtGui/QScreen>
-#include <QtOpenGL/private/qglpaintdevice_p.h>
-
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_WIDGETS
class QEglFSPaintDevice : public QGLPaintDevice
{
public:
@@ -73,15 +75,20 @@ private:
QEglFSScreen *m_screen;
QGLContext *m_context;
};
-
+#endif //QT_NO_WIDGETS
QEglFSBackingStore::QEglFSBackingStore(QWindow *window)
- : QPlatformBackingStore(window)
+ : QPlatformBackingStore(window),
+ m_paintDevice(0)
{
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglBackingStore %p, %p", window, window->screen());
#endif
+#ifdef QT_NO_WIDGETS
+ m_paintDevice = new QImage(0,0);
+#else
m_paintDevice = new QEglFSPaintDevice(static_cast<QEglFSScreen *>(window->screen()->handle()));
+#endif //QT_NO_WIDGETS
}
void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
@@ -92,7 +99,9 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglBackingStore::flush %p", window);
#endif
+#ifndef QT_NO_WIDGETS
static_cast<QEglFSPaintDevice *>(m_paintDevice)->context()->swapBuffers();
+#endif //QT_NO_WIDGETS
}
void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents)
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.h b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
index 5623a96004..1ae3ecdc61 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.h
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
@@ -53,7 +53,7 @@ class QEglFSBackingStore : public QPlatformBackingStore
{
public:
QEglFSBackingStore(QWindow *window);
- ~QEglFSBackingStore() {}
+ ~QEglFSBackingStore() { delete m_paintDevice; }
QPaintDevice *paintDevice() { return m_paintDevice; }
void flush(QWindow *window, const QRegion &region, const QPoint &offset);
diff --git a/src/plugins/platforms/kms/qkmsdevice.cpp b/src/plugins/platforms/kms/qkmsdevice.cpp
index 01bf1d12be..8d42871401 100644
--- a/src/plugins/platforms/kms/qkmsdevice.cpp
+++ b/src/plugins/platforms/kms/qkmsdevice.cpp
@@ -127,7 +127,7 @@ void QKmsDevice::createScreens()
void QKmsDevice::handlePageFlipCompleted()
{
- //qDebug() << "Display signal recieved";
+ //qDebug() << "Display signal received";
drmEventContext eventContext;
memset(&eventContext, 0, sizeof eventContext);
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index 8f728a5fb0..c97c1def0c 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -12,6 +12,6 @@ mac {
win32: SUBDIRS += windows
-blackberry-armv7le-qcc {
- SUBDIRS += blackberry
+qnx-*-qcc {
+ SUBDIRS += qnx
}
diff --git a/src/plugins/platforms/blackberry/main.cpp b/src/plugins/platforms/qnx/main.cpp
index b9e09c0384..b1e1687150 100644
--- a/src/plugins/platforms/blackberry/main.cpp
+++ b/src/plugins/platforms/qnx/main.cpp
@@ -40,33 +40,33 @@
****************************************************************************/
#include <QtGui/QPlatformIntegrationPlugin>
-#include "qbbintegration.h"
+#include "qqnxintegration.h"
QT_BEGIN_NAMESPACE
-class QBBIntegrationPlugin : public QPlatformIntegrationPlugin
+class QQnxIntegrationPlugin : public QPlatformIntegrationPlugin
{
public:
QStringList keys() const;
QPlatformIntegration *create(const QString&, const QStringList&);
};
-QStringList QBBIntegrationPlugin::keys() const
+QStringList QQnxIntegrationPlugin::keys() const
{
QStringList list;
- list << QLatin1String("blackberry");
+ list << QLatin1String("qnx");
return list;
}
-QPlatformIntegration *QBBIntegrationPlugin::create(const QString& system, const QStringList& paramList)
+QPlatformIntegration *QQnxIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
- if (system.toLower() == QLatin1String("blackberry"))
- return new QBBIntegration;
+ if (system.toLower() == QLatin1String("qnx"))
+ return new QQnxIntegration;
return 0;
}
-Q_EXPORT_PLUGIN2(blackberry, QBBIntegrationPlugin)
+Q_EXPORT_PLUGIN2(qnx, QQnxIntegrationPlugin)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
new file mode 100644
index 0000000000..1bd3548b7d
--- /dev/null
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -0,0 +1,71 @@
+TARGET = qnx
+include(../../qpluginbase.pri)
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms
+QT += opengl opengl-private platformsupport platformsupport-private widgets-private
+
+# Uncomment this to build with support for IMF once it becomes available in the BBNDK
+#CONFIG += qqnx_imf
+
+# Uncomment these to enable debugging output for various aspects of the plugin
+#DEFINES += QQNXBUFFER_DEBUG
+#DEFINES += QQNXCLIPBOARD_DEBUG
+#DEFINES += QQNXEVENTTHREAD_DEBUG
+#DEFINES += QQNXGLBACKINGSTORE_DEBUG
+#DEFINES += QQNXGLCONTEXT_DEBUG
+#DEFINES += QQNXINPUTCONTEXT_DEBUG
+#DEFINES += QQNXINPUTCONTEXT_IMF_EVENT_DEBUG
+#DEFINES += QQNXINTEGRATION_DEBUG
+#DEFINES += QQNXNAVIGATORTHREAD_DEBUG
+#DEFINES += QQNXRASTERBACKINGSTORE_DEBUG
+#DEFINES += QQNXROOTWINDOW_DEBUG
+#DEFINES += QQNXSCREEN_DEBUG
+#DEFINES += QQNXVIRTUALKEYBOARD_DEBUG
+#DEFINES += QQNXWINDOW_DEBUG
+
+SOURCES = main.cpp \
+ qqnxbuffer.cpp \
+ qqnxeventthread.cpp \
+ qqnxglcontext.cpp \
+ qqnxglbackingstore.cpp \
+ qqnxintegration.cpp \
+ qqnxnavigatorthread.cpp \
+ qqnxscreen.cpp \
+ qqnxwindow.cpp \
+ qqnxrasterbackingstore.cpp \
+ qqnxvirtualkeyboard.cpp \
+ qqnxclipboard.cpp \
+ qqnxrootwindow.cpp
+
+HEADERS = qqnxbuffer.h \
+ qqnxeventthread.h \
+ qqnxkeytranslator.h \
+ qqnxintegration.h \
+ qqnxnavigatorthread.h \
+ qqnxglcontext.h \
+ qqnxglbackingstore.h \
+ qqnxscreen.h \
+ qqnxwindow.h \
+ qqnxrasterbackingstore.h \
+ qqnxvirtualkeyboard.h \
+ qqnxclipboard.h \
+ qqnxrootwindow.h
+
+CONFIG(qqnx_imf) {
+ DEFINES += QQNX_IMF
+ HEADERS += qqnxinputcontext_imf.h
+ SOURCES += qqnxinputcontext_imf.cpp
+} else {
+ HEADERS += qqnxinputcontext_noimf.h
+ SOURCES += qqnxinputcontext_noimf.cpp
+}
+
+QMAKE_CXXFLAGS += -I./private
+
+LIBS += -lpps -lscreen -lEGL -lclipboard
+
+include (../../../platformsupport/eglconvenience/eglconvenience.pri)
+include (../../../platformsupport/fontdatabases/fontdatabases.pri)
+
+target.path += $$[QT_INSTALL_PLUGINS]/platforms
+INSTALLS += target
diff --git a/src/plugins/platforms/blackberry/qbbbuffer.cpp b/src/plugins/platforms/qnx/qqnxbuffer.cpp
index c4ac04898d..048aec8ff6 100644
--- a/src/plugins/platforms/blackberry/qbbbuffer.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuffer.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qbbbuffer.h"
+#include "qqnxbuffer.h"
#include <QtCore/QDebug>
@@ -48,19 +48,19 @@
QT_BEGIN_NAMESPACE
-QBBBuffer::QBBBuffer()
+QQnxBuffer::QQnxBuffer()
: m_buffer(0)
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::QBBBuffer - empty";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::QQnxBuffer - empty";
#endif
}
-QBBBuffer::QBBBuffer(screen_buffer_t buffer)
+QQnxBuffer::QQnxBuffer(screen_buffer_t buffer)
: m_buffer(buffer)
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::QBBBuffer - normal";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::QQnxBuffer - normal";
#endif
// Get size of buffer
@@ -68,7 +68,7 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
int size[2];
int result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_BUFFER_SIZE, size);
if (result != 0) {
- qFatal("QBB: failed to query buffer size, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer size, errno=%d", errno);
}
// Get stride of buffer
@@ -76,7 +76,7 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
int stride;
result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_STRIDE, &stride);
if (result != 0) {
- qFatal("QBB: failed to query buffer stride, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer stride, errno=%d", errno);
}
// Get access to buffer's data
@@ -84,10 +84,10 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
uchar *dataPtr = 0;
result = screen_get_buffer_property_pv(buffer, SCREEN_PROPERTY_POINTER, (void **)&dataPtr);
if (result != 0) {
- qFatal("QBB: failed to query buffer pointer, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer pointer, errno=%d", errno);
}
if (dataPtr == NULL) {
- qFatal("QBB: buffer pointer is NULL, errno=%d", errno);
+ qFatal("QQNX: buffer pointer is NULL, errno=%d", errno);
}
// Get format of buffer
@@ -95,7 +95,7 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
int screenFormat;
result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_FORMAT, &screenFormat);
if (result != 0) {
- qFatal("QBB: failed to query buffer format, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer format, errno=%d", errno);
}
// Convert screen format to QImage format
@@ -120,45 +120,45 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
imageFormat = QImage::Format_ARGB32_Premultiplied;
break;
default:
- qFatal("QBB: unsupported buffer format, format=%d", screenFormat);
+ qFatal("QQNX: unsupported buffer format, format=%d", screenFormat);
}
// wrap buffer in an image
m_image = QImage(dataPtr, size[0], size[1], stride, imageFormat);
}
-QBBBuffer::QBBBuffer(const QBBBuffer &other)
+QQnxBuffer::QQnxBuffer(const QQnxBuffer &other)
: m_buffer(other.m_buffer),
m_image(other.m_image)
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::QBBBuffer - copy";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::QQnxBuffer - copy";
#endif
}
-QBBBuffer::~QBBBuffer()
+QQnxBuffer::~QQnxBuffer()
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::~QBBBuffer";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::~QQnxBuffer";
#endif
}
-void QBBBuffer::invalidateInCache()
+void QQnxBuffer::invalidateInCache()
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::invalidateInCache";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::invalidateInCache";
#endif
// Verify native buffer exists
if (m_buffer == 0) {
- qFatal("QBB: can't invalidate cache for null buffer");
+ qFatal("QQNX: can't invalidate cache for null buffer");
}
// Evict buffer's data from cache
errno = 0;
int result = msync(m_image.bits(), m_image.height() * m_image.bytesPerLine(), MS_INVALIDATE | MS_CACHE_ONLY);
if (result != 0) {
- qFatal("QBB: failed to invalidate cache, errno=%d", errno);
+ qFatal("QQNX: failed to invalidate cache, errno=%d", errno);
}
}
diff --git a/src/plugins/platforms/blackberry/qbbbuffer.h b/src/plugins/platforms/qnx/qqnxbuffer.h
index 45cedb21a8..be8dfcafad 100644
--- a/src/plugins/platforms/blackberry/qbbbuffer.h
+++ b/src/plugins/platforms/qnx/qqnxbuffer.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBBUFFER_H
-#define QBBBUFFER_H
+#ifndef QQNXBUFFER_H
+#define QQNXBUFFER_H
#include <QtGui/QImage>
@@ -48,13 +48,13 @@
QT_BEGIN_NAMESPACE
-class QBBBuffer
+class QQnxBuffer
{
public:
- QBBBuffer();
- QBBBuffer(screen_buffer_t buffer);
- QBBBuffer(const QBBBuffer &other);
- virtual ~QBBBuffer();
+ QQnxBuffer();
+ QQnxBuffer(screen_buffer_t buffer);
+ QQnxBuffer(const QQnxBuffer &other);
+ virtual ~QQnxBuffer();
screen_buffer_t nativeBuffer() const { return m_buffer; }
const QImage *image() const { return (m_buffer != NULL) ? &m_image : NULL; }
@@ -71,4 +71,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBBUFFER_H
+#endif // QQNXBUFFER_H
diff --git a/src/plugins/platforms/blackberry/qbbclipboard.cpp b/src/plugins/platforms/qnx/qqnxclipboard.cpp
index 293a0c771b..8931a15139 100644
--- a/src/plugins/platforms/blackberry/qbbclipboard.cpp
+++ b/src/plugins/platforms/qnx/qqnxclipboard.cpp
@@ -41,7 +41,7 @@
#ifndef QT_NO_CLIPBOARD
-#include "qbbclipboard.h"
+#include "qqnxclipboard.h"
#include <QtGui/QColor>
@@ -73,11 +73,11 @@ static QByteArray readClipboardBuff(const char *type)
return QByteArray();
}
-class QBBClipboard::MimeData : public QMimeData
+class QQnxClipboard::MimeData : public QMimeData
{
Q_OBJECT
public:
- MimeData(QBBClipboard *clipboard)
+ MimeData(QQnxClipboard *clipboard)
: QMimeData(),
m_clipboard(clipboard),
m_userMimeData(0)
@@ -97,7 +97,7 @@ public:
void addFormatToCheck(const QString &format) {
m_formatsToCheck << format;
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "formats=" << m_formatsToCheck;
#endif
}
@@ -105,7 +105,7 @@ public:
bool hasFormat(const QString &mimetype) const
{
const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0;
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "result=" << result;
#endif
return result;
@@ -120,7 +120,7 @@ public:
result << format;
}
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "result=" << result;
#endif
return result;
@@ -146,7 +146,7 @@ public:
protected:
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const
{
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "preferredType=" << preferredType;
#endif
if (is_clipboard_format_present(mimetype.toUtf8().constData()) != 0)
@@ -160,7 +160,7 @@ private Q_SLOTS:
void releaseOwnership()
{
if (m_userMimeData) {
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "user data formats=" << m_userMimeData->formats() << "system formats=" << formats();
#endif
delete m_userMimeData;
@@ -170,23 +170,23 @@ private Q_SLOTS:
}
private:
- QBBClipboard * const m_clipboard;
+ QQnxClipboard * const m_clipboard;
QSet<QString> m_formatsToCheck;
QMimeData *m_userMimeData;
};
-QBBClipboard::QBBClipboard()
+QQnxClipboard::QQnxClipboard()
: m_mimeData(new MimeData(this))
{
}
-QBBClipboard::~QBBClipboard()
+QQnxClipboard::~QQnxClipboard()
{
delete m_mimeData;
}
-void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
+void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
{
if (mode != QClipboard::Clipboard)
return;
@@ -203,7 +203,7 @@ void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
return;
const QStringList formats = data->formats();
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "formats=" << formats;
#endif
@@ -214,8 +214,8 @@ void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
continue;
int ret = set_clipboard_data(format.toUtf8().data(), buf.size(), buf.data());
-#if defined(QBBCLIPBOARD_DEBUG)
- qDebug() << "QBB: set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
+#if defined(QQNXCLIPBOARD_DEBUG)
+ qDebug() << "QQNX: set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
#endif
if (ret)
m_mimeData->addFormatToCheck(format);
@@ -224,7 +224,7 @@ void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
emitChanged(QClipboard::Clipboard);
}
-QMimeData *QBBClipboard::mimeData(QClipboard::Mode mode)
+QMimeData *QQnxClipboard::mimeData(QClipboard::Mode mode)
{
if (mode != QClipboard::Clipboard)
return 0;
@@ -239,6 +239,6 @@ QMimeData *QBBClipboard::mimeData(QClipboard::Mode mode)
QT_END_NAMESPACE
-#include "qbbclipboard.moc"
+#include "qqnxclipboard.moc"
#endif //QT_NO_CLIPBOARD
diff --git a/src/plugins/platforms/blackberry/qbbclipboard.h b/src/plugins/platforms/qnx/qqnxclipboard.h
index 11a36ba8e5..1104885d8c 100644
--- a/src/plugins/platforms/blackberry/qbbclipboard.h
+++ b/src/plugins/platforms/qnx/qqnxclipboard.h
@@ -39,19 +39,19 @@
**
****************************************************************************/
-#ifndef QBBCLIPBOARD_H
-#define QBBCLIPBOARD_H
+#ifndef QQNXCLIPBOARD_H
+#define QQNXCLIPBOARD_H
#ifndef QT_NO_CLIPBOARD
#include <QtGui/QPlatformClipboard>
QT_BEGIN_NAMESPACE
-class QBBClipboard : public QPlatformClipboard
+class QQnxClipboard : public QPlatformClipboard
{
public:
- QBBClipboard();
- virtual ~QBBClipboard();
+ QQnxClipboard();
+ virtual ~QQnxClipboard();
virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
@@ -63,4 +63,4 @@ private:
QT_END_NAMESPACE
#endif //QT_NO_CLIPBOARD
-#endif //QBBCLIPBOARD_H
+#endif //QQNXCLIPBOARD_H
diff --git a/src/plugins/platforms/blackberry/qbbeventthread.cpp b/src/plugins/platforms/qnx/qqnxeventthread.cpp
index 547428d1c4..cd30da1971 100644
--- a/src/plugins/platforms/blackberry/qbbeventthread.cpp
+++ b/src/plugins/platforms/qnx/qqnxeventthread.cpp
@@ -39,14 +39,14 @@
**
****************************************************************************/
-#include "qbbeventthread.h"
-#include "qbbintegration.h"
-#include "qbbkeytranslator.h"
+#include "qqnxeventthread.h"
+#include "qqnxintegration.h"
+#include "qqnxkeytranslator.h"
-#if defined(QBB_IMF)
-#include "qbbinputcontext_imf.h"
+#if defined(QQNX_IMF)
+#include "qqnxinputcontext_imf.h"
#else
-#include "qbbinputcontext_noimf.h"
+#include "qqnxinputcontext_noimf.h"
#endif
#include <QtGui/QWindow>
@@ -61,7 +61,7 @@
#include <cctype>
-QBBEventThread::QBBEventThread(screen_context_t context, QPlatformScreen& screen)
+QQnxEventThread::QQnxEventThread(screen_context_t context, QPlatformScreen& screen)
: QThread(),
m_screenContext(context),
m_platformScreen(screen),
@@ -89,13 +89,13 @@ QBBEventThread::QBBEventThread(screen_context_t context, QPlatformScreen& screen
}
}
-QBBEventThread::~QBBEventThread()
+QQnxEventThread::~QQnxEventThread()
{
// block until thread terminates
shutdown();
}
-void QBBEventThread::run()
+void QQnxEventThread::run()
{
screen_event_t event;
@@ -103,11 +103,11 @@ void QBBEventThread::run()
errno = 0;
int result = screen_create_event(&event);
if (result) {
- qFatal("QBB: failed to create event, errno=%d", errno);
+ qFatal("QQNX: failed to create event, errno=%d", errno);
}
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop started";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop started";
#endif
// loop indefinitely
@@ -117,22 +117,22 @@ void QBBEventThread::run()
errno = 0;
result = screen_get_event(m_screenContext, event, -1);
if (result) {
- qFatal("QBB: failed to get event, errno=%d", errno);
+ qFatal("QQNX: failed to get event, errno=%d", errno);
}
// process received event
dispatchEvent(event);
}
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop stopped";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop stopped";
#endif
// cleanup
screen_destroy_event(event);
}
-void QBBEventThread::shutdown()
+void QQnxEventThread::shutdown()
{
screen_event_t event;
@@ -140,7 +140,7 @@ void QBBEventThread::shutdown()
errno = 0;
int result = screen_create_event(&event);
if (result) {
- qFatal("QBB: failed to create event, errno=%d", errno);
+ qFatal("QQNX: failed to create event, errno=%d", errno);
}
// set the event type as user
@@ -148,7 +148,7 @@ void QBBEventThread::shutdown()
int type = SCREEN_EVENT_USER;
result = screen_set_event_property_iv(event, SCREEN_PROPERTY_TYPE, &type);
if (result) {
- qFatal("QBB: failed to set event type, errno=%d", errno);
+ qFatal("QQNX: failed to set event type, errno=%d", errno);
}
// NOTE: ignore SCREEN_PROPERTY_USER_DATA; treat all user events as shutdown events
@@ -157,32 +157,32 @@ void QBBEventThread::shutdown()
errno = 0;
result = screen_send_event(m_screenContext, event, getpid());
if (result) {
- qFatal("QBB: failed to set event type, errno=%d", errno);
+ qFatal("QQNX: failed to set event type, errno=%d", errno);
}
// cleanup
screen_destroy_event(event);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop shutdown begin";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop shutdown begin";
#endif
// block until thread terminates
wait();
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop shutdown end";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop shutdown end";
#endif
}
-void QBBEventThread::dispatchEvent(screen_event_t event)
+void QQnxEventThread::dispatchEvent(screen_event_t event)
{
// get the event type
errno = 0;
int qnxType;
int result = screen_get_event_property_iv(event, SCREEN_PROPERTY_TYPE, &qnxType);
if (result) {
- qFatal("QBB: failed to query event type, errno=%d", errno);
+ qFatal("QQNX: failed to query event type, errno=%d", errno);
}
switch (qnxType) {
@@ -206,29 +206,29 @@ void QBBEventThread::dispatchEvent(screen_event_t event)
case SCREEN_EVENT_USER:
// treat all user events as shutdown requests
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: QNX user event";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: QNX user event";
#endif
m_quit = true;
break;
default:
// event ignored
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: QNX unknown event";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: QNX unknown event";
#endif
break;
}
}
-void QBBEventThread::handleKeyboardEvent(screen_event_t event)
+void QQnxEventThread::handleKeyboardEvent(screen_event_t event)
{
// get flags of key event
errno = 0;
int flags;
int result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_FLAGS, &flags);
if (result) {
- qFatal("QBB: failed to query event flags, errno=%d", errno);
+ qFatal("QQNX: failed to query event flags, errno=%d", errno);
}
// get key code
@@ -236,31 +236,31 @@ void QBBEventThread::handleKeyboardEvent(screen_event_t event)
int sym;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_SYM, &sym);
if (result) {
- qFatal("QBB: failed to query event sym, errno=%d", errno);
+ qFatal("QQNX: failed to query event sym, errno=%d", errno);
}
int modifiers;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_MODIFIERS, &modifiers);
if (result) {
- qFatal("QBB: failed to query event modifiers, errno=%d", errno);
+ qFatal("QQNX: failed to query event modifiers, errno=%d", errno);
}
int scan;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_SCAN, &scan);
if (result) {
- qFatal("QBB: failed to query event modifiers, errno=%d", errno);
+ qFatal("QQNX: failed to query event modifiers, errno=%d", errno);
}
int cap;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_CAP, &cap);
if (result) {
- qFatal("QBB: failed to query event cap, errno=%d", errno);
+ qFatal("QQNX: failed to query event cap, errno=%d", errno);
}
injectKeyboardEvent(flags, sym, modifiers, scan, cap);
}
-void QBBEventThread::injectKeyboardEvent(int flags, int sym, int modifiers, int scan, int cap)
+void QQnxEventThread::injectKeyboardEvent(int flags, int sym, int modifiers, int scan, int cap)
{
Q_UNUSED(scan);
@@ -300,13 +300,13 @@ void QBBEventThread::injectKeyboardEvent(int flags, int sym, int modifiers, int
}
QWindowSystemInterface::handleKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod, keyStr);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
#endif
}
}
-void QBBEventThread::handlePointerEvent(screen_event_t event)
+void QQnxEventThread::handlePointerEvent(screen_event_t event)
{
errno = 0;
@@ -315,7 +315,7 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
void *handle;
int result = screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, &handle);
if (result) {
- qFatal("QBB: failed to query event window, errno=%d", errno);
+ qFatal("QQNX: failed to query event window, errno=%d", errno);
}
qnxWindow = static_cast<screen_window_t>(handle);
@@ -323,48 +323,48 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
int buttonState = 0;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_BUTTONS, &buttonState);
if (result) {
- qFatal("QBB: failed to query event button state, errno=%d", errno);
+ qFatal("QQNX: failed to query event button state, errno=%d", errno);
}
// Query the window position
int windowPos[2];
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_SOURCE_POSITION, windowPos);
if (result) {
- qFatal("QBB: failed to query event window position, errno=%d", errno);
+ qFatal("QQNX: failed to query event window position, errno=%d", errno);
}
// Query the screen position
int pos[2];
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_POSITION, pos);
if (result) {
- qFatal("QBB: failed to query event position, errno=%d", errno);
+ qFatal("QQNX: failed to query event position, errno=%d", errno);
}
// Query the wheel delta
int wheelDelta = 0;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_MOUSE_WHEEL, &wheelDelta);
if (result) {
- qFatal("QBB: failed to query event wheel delta, errno=%d", errno);
+ qFatal("QQNX: failed to query event wheel delta, errno=%d", errno);
}
// Map window handle to top-level QWindow
- QWindow *w = QBBIntegration::window(qnxWindow);
+ QWindow *w = QQnxIntegration::window(qnxWindow);
// Generate enter and leave events as needed.
if (qnxWindow != m_lastMouseWindow) {
- QWindow *wOld = QBBIntegration::window(m_lastMouseWindow);
+ QWindow *wOld = QQnxIntegration::window(m_lastMouseWindow);
if (wOld) {
QWindowSystemInterface::handleLeaveEvent(wOld);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt leave, w=" << wOld;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt leave, w=" << wOld;
#endif
}
if (w) {
QWindowSystemInterface::handleEnterEvent(w);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt enter, w=" << w;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt enter, w=" << w;
#endif
}
}
@@ -380,13 +380,26 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
QPoint localPoint(windowPos[0], windowPos[1]);
// Convert buttons.
+ // Some QNX header files invert 'Right Button versus "Left Button' ('Right' == 0x01). But they also offer a 'Button Swap' bit,
+ // so we may receive events as shown. (If this is wrong, the fix is easy.)
+ // QNX Button mask is 8 buttons wide, with a maximum value of x080.
Qt::MouseButtons buttons = Qt::NoButton;
- if (buttonState & 1)
+ if (buttonState & 0x01)
buttons |= Qt::LeftButton;
- if (buttonState & 2)
+ if (buttonState & 0x02)
buttons |= Qt::MidButton;
- if (buttonState & 4)
+ if (buttonState & 0x04)
buttons |= Qt::RightButton;
+ if (buttonState & 0x08)
+ buttons |= Qt::ExtraButton1; // AKA 'Qt::BackButton'
+ if (buttonState & 0x10)
+ buttons |= Qt::ExtraButton2; // AKA 'Qt::ForwardButton'
+ if (buttonState & 0x20)
+ buttons |= Qt::ExtraButton3;
+ if (buttonState & 0x40)
+ buttons |= Qt::ExtraButton4;
+ if (buttonState & 0x80)
+ buttons |= Qt::ExtraButton5;
if (w) {
// Inject mouse event into Qt only if something has changed.
@@ -394,8 +407,8 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
m_lastLocalMousePoint != localPoint ||
m_lastButtonState != buttons) {
QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << static_cast<int>(buttons);
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << static_cast<int>(buttons);
#endif
}
@@ -403,8 +416,8 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
// Screen only supports a single wheel, so we will assume Vertical orientation for
// now since that is pretty much standard.
QWindowSystemInterface::handleWheelEvent(w, localPoint, globalPoint, wheelDelta, Qt::Vertical);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt wheel, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), d=" << static_cast<int>(wheelDelta);
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt wheel, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), d=" << static_cast<int>(wheelDelta);
#endif
}
}
@@ -414,14 +427,14 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
m_lastButtonState = buttons;
}
-void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
+void QQnxEventThread::handleTouchEvent(screen_event_t event, int qnxType)
{
// get display coordinates of touch
errno = 0;
int pos[2];
int result = screen_get_event_property_iv(event, SCREEN_PROPERTY_POSITION, pos);
if (result) {
- qFatal("QBB: failed to query event position, errno=%d", errno);
+ qFatal("QQNX: failed to query event position, errno=%d", errno);
}
// get window coordinates of touch
@@ -429,7 +442,7 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
int windowPos[2];
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_SOURCE_POSITION, windowPos);
if (result) {
- qFatal("QBB: failed to query event window position, errno=%d", errno);
+ qFatal("QQNX: failed to query event window position, errno=%d", errno);
}
// determine which finger touched
@@ -437,7 +450,7 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
int touchId;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_TOUCH_ID, &touchId);
if (result) {
- qFatal("QBB: failed to query event touch id, errno=%d", errno);
+ qFatal("QQNX: failed to query event touch id, errno=%d", errno);
}
// determine which window was touched
@@ -445,7 +458,7 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
void *handle;
result = screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, &handle);
if (result) {
- qFatal("QBB: failed to query event window, errno=%d", errno);
+ qFatal("QQNX: failed to query event window, errno=%d", errno);
}
screen_window_t qnxWindow = static_cast<screen_window_t>(handle);
@@ -453,23 +466,23 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
if (touchId < MaximumTouchPoints) {
// Map window handle to top-level QWindow
- QWindow *w = QBBIntegration::window(qnxWindow);
+ QWindow *w = QQnxIntegration::window(qnxWindow);
// Generate enter and leave events as needed.
if (qnxWindow != m_lastMouseWindow) {
- QWindow *wOld = QBBIntegration::window(m_lastMouseWindow);
+ QWindow *wOld = QQnxIntegration::window(m_lastMouseWindow);
if (wOld) {
QWindowSystemInterface::handleLeaveEvent(wOld);
- #if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt leave, w=" << wOld;
+ #if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt leave, w=" << wOld;
#endif
}
if (w) {
QWindowSystemInterface::handleEnterEvent(w);
- #if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt enter, w=" << w;
+ #if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt enter, w=" << w;
#endif
}
}
@@ -488,8 +501,8 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
// inject event into Qt
QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << buttons;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << buttons;
#endif
}
@@ -533,25 +546,25 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
// inject event into Qt
QWindowSystemInterface::handleTouchEvent(w, m_touchDevice, pointList);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt touch, w=" << w << ", p=(" << pos[0] << "," << pos[1] << "), t=" << type;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt touch, w=" << w << ", p=(" << pos[0] << "," << pos[1] << "), t=" << type;
#endif
}
}
}
-void QBBEventThread::handleCloseEvent(screen_event_t event)
+void QQnxEventThread::handleCloseEvent(screen_event_t event)
{
// Query the window that was closed
void *handle;
int result = screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, &handle);
if (result != 0) {
- qFatal("QBB: failed to query event window, errno=%d", errno);
+ qFatal("QQNX: failed to query event window, errno=%d", errno);
}
screen_window_t qnxWindow = static_cast<screen_window_t>(handle);
// Map window handle to top-level QWindow
- QWindow *w = QBBIntegration::window(qnxWindow);
+ QWindow *w = QQnxIntegration::window(qnxWindow);
if (w != 0) {
QWindowSystemInterface::handleCloseEvent(w);
}
diff --git a/src/plugins/platforms/blackberry/qbbeventthread.h b/src/plugins/platforms/qnx/qqnxeventthread.h
index afa738830c..61831233e9 100644
--- a/src/plugins/platforms/blackberry/qbbeventthread.h
+++ b/src/plugins/platforms/qnx/qqnxeventthread.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBEVENTTHREAD_H
-#define QBBEVENTTHREAD_H
+#ifndef QQNXEVENTTHREAD_H
+#define QQNXEVENTTHREAD_H
#include <QtCore/QThread>
@@ -51,11 +51,11 @@
QT_BEGIN_NAMESPACE
-class QBBEventThread : public QThread
+class QQnxEventThread : public QThread
{
public:
- QBBEventThread(screen_context_t context, QPlatformScreen& screen);
- virtual ~QBBEventThread();
+ QQnxEventThread(screen_context_t context, QPlatformScreen& screen);
+ virtual ~QQnxEventThread();
static void injectKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
@@ -87,4 +87,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBEVENTTHREAD_H
+#endif // QQNXEVENTTHREAD_H
diff --git a/src/plugins/platforms/blackberry/qbbglbackingstore.cpp b/src/plugins/platforms/qnx/qqnxglbackingstore.cpp
index 91b07770e1..97a03e0042 100644
--- a/src/plugins/platforms/blackberry/qbbglbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxglbackingstore.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qbbglbackingstore.h"
-#include "qbbglcontext.h"
-#include "qbbwindow.h"
-#include "qbbscreen.h"
+#include "qqnxglbackingstore.h"
+#include "qqnxglcontext.h"
+#include "qqnxwindow.h"
+#include "qqnxscreen.h"
#include <QtGui/qwindow.h>
@@ -55,12 +55,12 @@
QT_BEGIN_NAMESPACE
-QBBGLPaintDevice::QBBGLPaintDevice(QWindow *window)
+QQnxGLPaintDevice::QQnxGLPaintDevice(QWindow *window)
: QGLPaintDevice(),
m_window(0),
m_glContext(0)
{
- m_window = static_cast<QBBWindow*>(window->handle());
+ m_window = static_cast<QQnxWindow*>(window->handle());
// Extract the QPlatformOpenGLContext from the window
QPlatformOpenGLContext *platformOpenGLContext = m_window->platformOpenGLContext();
@@ -69,81 +69,81 @@ QBBGLPaintDevice::QBBGLPaintDevice(QWindow *window)
m_glContext = QGLContext::fromOpenGLContext(platformOpenGLContext->context());
}
-QBBGLPaintDevice::~QBBGLPaintDevice()
+QQnxGLPaintDevice::~QQnxGLPaintDevice()
{
// Cleanup GL context
delete m_glContext;
}
-QPaintEngine *QBBGLPaintDevice::paintEngine() const
+QPaintEngine *QQnxGLPaintDevice::paintEngine() const
{
// Select a paint engine based on configued OpenGL version
return qt_qgl_paint_engine();
}
-QSize QBBGLPaintDevice::size() const
+QSize QQnxGLPaintDevice::size() const
{
// Get size of EGL surface
return m_window->geometry().size();
}
-QBBGLBackingStore::QBBGLBackingStore(QWindow *window)
+QQnxGLBackingStore::QQnxGLBackingStore(QWindow *window)
: QPlatformBackingStore(window),
m_openGLContext(0),
m_paintDevice(0),
m_requestedSize(),
m_size()
{
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::QBBGLBackingStore - w=" << window;
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::QQnxGLBackingStore - w=" << window;
#endif
// Create an OpenGL paint device which in turn creates a QGLContext for us
- m_paintDevice = new QBBGLPaintDevice(window);
+ m_paintDevice = new QQnxGLPaintDevice(window);
m_openGLContext = m_paintDevice->context()->contextHandle();
}
-QBBGLBackingStore::~QBBGLBackingStore()
+QQnxGLBackingStore::~QQnxGLBackingStore()
{
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::~QBBGLBackingStore - w=" << window();
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::~QQnxGLBackingStore - w=" << window();
#endif
// cleanup OpenGL paint device
delete m_paintDevice;
}
-void QBBGLBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QQnxGLBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
Q_UNUSED(region);
Q_UNUSED(offset);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::flush - w=" << window;
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::flush - w=" << window;
#endif
// update the display with newly rendered content
m_openGLContext->swapBuffers(window);
}
-void QBBGLBackingStore::resize(const QSize &size, const QRegion &staticContents)
+void QQnxGLBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(staticContents);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::resize - w=" << window() << ", s=" << size;
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::resize - w=" << window() << ", s=" << size;
#endif
// NOTE: defer resizing window buffers until next paint as
// resize() can be called multiple times before a paint occurs
m_requestedSize = size;
}
-void QBBGLBackingStore::beginPaint(const QRegion &region)
+void QQnxGLBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::beginPaint - w=" << window();
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::beginPaint - w=" << window();
#endif
// resize EGL surface if window surface resized
@@ -152,19 +152,19 @@ void QBBGLBackingStore::beginPaint(const QRegion &region)
}
}
-void QBBGLBackingStore::endPaint(const QRegion &region)
+void QQnxGLBackingStore::endPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::endPaint - w=" << window();
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::endPaint - w=" << window();
#endif
}
-void QBBGLBackingStore::resizeSurface(const QSize &size)
+void QQnxGLBackingStore::resizeSurface(const QSize &size)
{
// need to destroy surface so make sure its not current
bool restoreCurrent = false;
- QBBGLContext *platformContext = static_cast<QBBGLContext *>(m_openGLContext->handle());
+ QQnxGLContext *platformContext = static_cast<QQnxGLContext *>(m_openGLContext->handle());
if (platformContext->isCurrent()) {
m_openGLContext->doneCurrent();
restoreCurrent = true;
@@ -174,7 +174,7 @@ void QBBGLBackingStore::resizeSurface(const QSize &size)
platformContext->destroySurface();
// resize window's buffers
- static_cast<QBBWindow*>(window()->handle())->setBufferSize(size);
+ static_cast<QQnxWindow*>(window()->handle())->setBufferSize(size);
// re-create EGL surface with new size
m_size = size;
diff --git a/src/plugins/platforms/blackberry/qbbglbackingstore.h b/src/plugins/platforms/qnx/qqnxglbackingstore.h
index 5455c5767c..d04fe22f5d 100644
--- a/src/plugins/platforms/blackberry/qbbglbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxglbackingstore.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBGLBACKINGSTORE_H
-#define QBBGLBACKINGSTORE_H
+#ifndef QQNXGLBACKINGSTORE_H
+#define QQNXGLBACKINGSTORE_H
#include <QtGui/qplatformbackingstore_qpa.h>
#include <QtOpenGL/private/qglpaintdevice_p.h>
@@ -50,30 +50,30 @@
QT_BEGIN_NAMESPACE
class QGLContext;
-class QBBGLContext;
-class QBBScreen;
-class QBBWindow;
+class QQnxGLContext;
+class QQnxScreen;
+class QQnxWindow;
-class QBBGLPaintDevice : public QGLPaintDevice
+class QQnxGLPaintDevice : public QGLPaintDevice
{
public:
- QBBGLPaintDevice(QWindow *window);
- virtual ~QBBGLPaintDevice();
+ QQnxGLPaintDevice(QWindow *window);
+ virtual ~QQnxGLPaintDevice();
virtual QPaintEngine *paintEngine() const;
virtual QSize size() const;
virtual QGLContext *context() const { return m_glContext; }
private:
- QBBWindow *m_window;
+ QQnxWindow *m_window;
QGLContext *m_glContext;
};
-class QBBGLBackingStore : public QPlatformBackingStore
+class QQnxGLBackingStore : public QPlatformBackingStore
{
public:
- QBBGLBackingStore(QWindow *window);
- virtual ~QBBGLBackingStore();
+ QQnxGLBackingStore(QWindow *window);
+ virtual ~QQnxGLBackingStore();
virtual QPaintDevice *paintDevice() { return m_paintDevice; }
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
@@ -85,11 +85,11 @@ public:
private:
QOpenGLContext *m_openGLContext;
- QBBGLPaintDevice *m_paintDevice;
+ QQnxGLPaintDevice *m_paintDevice;
QSize m_requestedSize;
QSize m_size;
};
QT_END_NAMESPACE
-#endif // QBBGLBACKINGSTORE_H
+#endif // QQNXGLBACKINGSTORE_H
diff --git a/src/plugins/platforms/blackberry/qbbglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp
index fb74fdb5d2..d620feb710 100644
--- a/src/plugins/platforms/blackberry/qbbglcontext.cpp
+++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qbbglcontext.h"
-#include "qbbrootwindow.h"
-#include "qbbscreen.h"
-#include "qbbwindow.h"
+#include "qqnxglcontext.h"
+#include "qqnxrootwindow.h"
+#include "qqnxscreen.h"
+#include "qqnxwindow.h"
#include "private/qeglconvenience_p.h"
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-EGLDisplay QBBGLContext::ms_eglDisplay = EGL_NO_DISPLAY;
+EGLDisplay QQnxGLContext::ms_eglDisplay = EGL_NO_DISPLAY;
static EGLenum checkEGLError(const char *msg)
{
@@ -78,12 +78,12 @@ static EGLenum checkEGLError(const char *msg)
return error;
}
-QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
+QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
: QPlatformOpenGLContext(),
m_glContext(glContext),
m_eglSurface(EGL_NO_SURFACE)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QSurfaceFormat format = m_glContext->format();
@@ -91,7 +91,7 @@ QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// Get colour channel sizes from window format
@@ -103,7 +103,7 @@ QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
// Check if all channels are don't care
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
// Set colour channels based on depth of window's screen
- QBBScreen *screen = static_cast<QBBScreen*>(QBBScreen::screens().first());
+ QQnxScreen *screen = static_cast<QQnxScreen*>(QQnxScreen::screens().first());
int depth = screen->depth();
if (depth == 32) {
// SCREEN_FORMAT_RGBA8888
@@ -145,22 +145,22 @@ QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
// Select EGL config based on requested window format
m_eglConfig = q_configFromGLFormat(ms_eglDisplay, format);
if (m_eglConfig == 0) {
- qFatal("QBB: failed to find EGL config");
+ qFatal("QQNXQBBWindow: failed to find EGL config");
}
m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, contextAttrs());
if (m_eglContext == EGL_NO_CONTEXT) {
checkEGLError("eglCreateContext");
- qFatal("QBB: failed to create EGL context, err=%d", eglGetError());
+ qFatal("QQNXQBBWindow: failed to create EGL context, err=%d", eglGetError());
}
// Query/cache window format of selected EGL config
m_windowFormat = q_glFormatFromConfig(ms_eglDisplay, m_eglConfig);
}
-QBBGLContext::~QBBGLContext()
+QQnxGLContext::~QQnxGLContext()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -173,43 +173,43 @@ QBBGLContext::~QBBGLContext()
destroySurface();
}
-void QBBGLContext::initialize()
+void QQnxGLContext::initialize()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Initialize connection to EGL
ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (ms_eglDisplay == EGL_NO_DISPLAY) {
checkEGLError("eglGetDisplay");
- qFatal("QBB: failed to obtain EGL display");
+ qFatal("QQNXQBBWindow: failed to obtain EGL display");
}
EGLBoolean eglResult = eglInitialize(ms_eglDisplay, 0, 0);
if (eglResult != EGL_TRUE) {
checkEGLError("eglInitialize");
- qFatal("QBB: failed to initialize EGL display, err=%d", eglGetError());
+ qFatal("QQNXQBBWindow: failed to initialize EGL display, err=%d", eglGetError());
}
}
-void QBBGLContext::shutdown()
+void QQnxGLContext::shutdown()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Close connection to EGL
eglTerminate(ms_eglDisplay);
}
-bool QBBGLContext::makeCurrent(QPlatformSurface *surface)
+bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNXQBBWindow: failed to set EGL API, err=%d", eglGetError());
}
if (m_eglSurface == EGL_NO_SURFACE)
@@ -218,68 +218,68 @@ bool QBBGLContext::makeCurrent(QPlatformSurface *surface)
eglResult = eglMakeCurrent(ms_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
if (eglResult != EGL_TRUE) {
checkEGLError("eglMakeCurrent");
- qFatal("QBB: failed to set current EGL context, err=%d", eglGetError());
+ qFatal("QQNX: failed to set current EGL context, err=%d", eglGetError());
}
return (eglResult == EGL_TRUE);
}
-void QBBGLContext::doneCurrent()
+void QQnxGLContext::doneCurrent()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// clear curent EGL context and unbind EGL surface
eglResult = eglMakeCurrent(ms_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to clear current EGL context, err=%d", eglGetError());
+ qFatal("QQNX: failed to clear current EGL context, err=%d", eglGetError());
}
}
-void QBBGLContext::swapBuffers(QPlatformSurface *surface)
+void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
{
Q_UNUSED(surface);
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// Post EGL surface to window
eglResult = eglSwapBuffers(ms_eglDisplay, m_eglSurface);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to swap EGL buffers, err=%d", eglGetError());
+ qFatal("QQNX: failed to swap EGL buffers, err=%d", eglGetError());
}
}
-QFunctionPointer QBBGLContext::getProcAddress(const QByteArray &procName)
+QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// Lookup EGL extension function pointer
return static_cast<QFunctionPointer>(eglGetProcAddress(procName.constData()));
}
-EGLint *QBBGLContext::contextAttrs()
+EGLint *QQnxGLContext::contextAttrs()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -292,23 +292,23 @@ EGLint *QBBGLContext::contextAttrs()
#endif
}
-bool QBBGLContext::isCurrent() const
+bool QQnxGLContext::isCurrent() const
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
return (eglGetCurrentContext() == m_eglContext);
}
-void QBBGLContext::createSurface(QPlatformSurface *surface)
+void QQnxGLContext::createSurface(QPlatformSurface *surface)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Get a pointer to the corresponding platform window
- QBBWindow *platformWindow = dynamic_cast<QBBWindow*>(surface);
+ QQnxWindow *platformWindow = dynamic_cast<QQnxWindow*>(surface);
if (!platformWindow) {
- qFatal("QBB: unable to create EGLSurface without a QBBWindow");
+ qFatal("QQNX: unable to create EGLSurface without a QQnxWindow");
}
// If the platform window does not yet have any buffers, we create
@@ -334,13 +334,13 @@ void QBBGLContext::createSurface(QPlatformSurface *surface)
m_eglSurface = eglCreateWindowSurface(ms_eglDisplay, m_eglConfig, (EGLNativeWindowType) handle, eglSurfaceAttrs);
if (m_eglSurface == EGL_NO_SURFACE) {
checkEGLError("eglCreateWindowSurface");
- qFatal("QBB: failed to create EGL surface, err=%d", eglGetError());
+ qFatal("QQNX: failed to create EGL surface, err=%d", eglGetError());
}
}
-void QBBGLContext::destroySurface()
+void QQnxGLContext::destroySurface()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -348,7 +348,7 @@ void QBBGLContext::destroySurface()
if (m_eglSurface != EGL_NO_SURFACE) {
EGLBoolean eglResult = eglDestroySurface(ms_eglDisplay, m_eglSurface);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to destroy EGL surface, err=%d", eglGetError());
+ qFatal("QQNX: failed to destroy EGL surface, err=%d", eglGetError());
}
}
}
diff --git a/src/plugins/platforms/blackberry/qbbglcontext.h b/src/plugins/platforms/qnx/qqnxglcontext.h
index 8ea1df5f40..36c439802a 100644
--- a/src/plugins/platforms/blackberry/qbbglcontext.h
+++ b/src/plugins/platforms/qnx/qqnxglcontext.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBGLCONTEXT_H
-#define QBBGLCONTEXT_H
+#ifndef QQNXGLCONTEXT_H
+#define QQNXGLCONTEXT_H
#include <QtGui/QPlatformOpenGLContext>
#include <QtGui/QSurfaceFormat>
@@ -50,13 +50,13 @@
QT_BEGIN_NAMESPACE
-class QBBWindow;
+class QQnxWindow;
-class QBBGLContext : public QPlatformOpenGLContext
+class QQnxGLContext : public QPlatformOpenGLContext
{
public:
- QBBGLContext(QOpenGLContext *glContext);
- virtual ~QBBGLContext();
+ QQnxGLContext(QOpenGLContext *glContext);
+ virtual ~QQnxGLContext();
static void initialize();
static void shutdown();
@@ -90,4 +90,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBGLCONTEXT_H
+#endif // QQNXGLCONTEXT_H
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_imf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
index fab3d3f151..3f9d768ccc 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_imf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qbbinputcontext_imf.h"
-#include "qbbeventthread.h"
-#include "qbbvirtualkeyboard.h"
+#include "qqnxinputcontext_imf.h"
+#include "qqnxeventthread.h"
+#include "qqnxvirtualkeyboard.h"
#include <QtWidgets/QAbstractSpinBox>
#include <QtWidgets/QAction>
@@ -175,7 +175,7 @@ int ImfEvent::sUserEventType = QEvent::registerEventType();
static int32_t imfBeginBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -194,7 +194,7 @@ static int32_t imfBeginBatchEdit(input_session_t *ic)
static int32_t imfClearMetaKeyStates(input_session_t *ic, int32_t states)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -215,7 +215,7 @@ static int32_t imfClearMetaKeyStates(input_session_t *ic, int32_t states)
static int32_t imfCommitText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -237,7 +237,7 @@ static int32_t imfCommitText(input_session_t *ic, spannable_string_t *text, int3
static int32_t imfDeleteSurroundingText(input_session_t *ic, int32_t left_length, int32_t right_length)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -259,7 +259,7 @@ static int32_t imfDeleteSurroundingText(input_session_t *ic, int32_t left_length
static int32_t imfEndBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -279,7 +279,7 @@ static int32_t imfEndBatchEdit(input_session_t *ic)
static int32_t imfFinishComposingText(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -299,7 +299,7 @@ static int32_t imfFinishComposingText(input_session_t *ic)
static int32_t imfGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -318,7 +318,7 @@ static int32_t imfGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
static int32_t imfGetCursorPosition(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -338,7 +338,7 @@ static int32_t imfGetCursorPosition(input_session_t *ic)
static extracted_text_t *imfGetExtractedText(input_session_t *ic, extracted_text_request_t *request, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -361,7 +361,7 @@ static extracted_text_t *imfGetExtractedText(input_session_t *ic, extracted_text
static spannable_string_t *imfGetSelectedText(input_session_t *ic, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -380,7 +380,7 @@ static spannable_string_t *imfGetSelectedText(input_session_t *ic, int32_t flags
static spannable_string_t *imfGetTextAfterCursor(input_session_t *ic, int32_t n, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -400,7 +400,7 @@ static spannable_string_t *imfGetTextAfterCursor(input_session_t *ic, int32_t n,
static spannable_string_t *imfGetTextBeforeCursor(input_session_t *ic, int32_t n, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -420,7 +420,7 @@ static spannable_string_t *imfGetTextBeforeCursor(input_session_t *ic, int32_t n
static int32_t imfPerformEditorAction(input_session_t *ic, int32_t editor_action)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -440,7 +440,7 @@ static int32_t imfPerformEditorAction(input_session_t *ic, int32_t editor_action
static int32_t imfReportFullscreenMode(input_session_t *ic, int32_t enabled)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -460,7 +460,7 @@ static int32_t imfReportFullscreenMode(input_session_t *ic, int32_t enabled)
static int32_t imfSendEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -477,7 +477,7 @@ static int32_t imfSendEvent(input_session_t *ic, event_t *event)
static int32_t imfSendAsyncEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -494,7 +494,7 @@ static int32_t imfSendAsyncEvent(input_session_t *ic, event_t *event)
static int32_t imfSetComposingRegion(input_session_t *ic, int32_t start, int32_t end)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -515,7 +515,7 @@ static int32_t imfSetComposingRegion(input_session_t *ic, int32_t start, int32_t
static int32_t imfSetComposingText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -536,7 +536,7 @@ static int32_t imfSetComposingText(input_session_t *ic, spannable_string_t *text
static int32_t imfSetSelection(input_session_t *ic, int32_t start, int32_t end)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -595,7 +595,7 @@ initEvent(event_t *pEvent, const input_session_t *pSession, EventType eventType,
spannable_string_t *toSpannableString(const QString &text)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << text;
#endif
@@ -674,14 +674,14 @@ static bool imfAvailable()
return s_imfReady;
}
-QBBInputContext::QBBInputContext():
+QQnxInputContext::QQnxInputContext():
QPlatformInputContext(),
m_lastCaretPos(0),
m_isComposing(false),
m_inputPanelVisible(false),
m_inputPanelLocale(QLocale::c())
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -697,7 +697,7 @@ QBBInputContext::QBBInputContext():
// p_vkb_init_selection_service();
- QBBVirtualKeyboard &keyboard = QBBVirtualKeyboard::instance();
+ QQnxVirtualKeyboard &keyboard = QQnxVirtualKeyboard::instance();
connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool)));
connect(&keyboard, SIGNAL(localeChanged(QLocale)), this, SLOT(keyboardLocaleChanged(QLocale)));
keyboardVisibilityChanged(keyboard.isVisible());
@@ -708,9 +708,9 @@ QBBInputContext::QBBInputContext():
}
-QBBInputContext::~QBBInputContext()
+QQnxInputContext::~QQnxInputContext()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -724,12 +724,12 @@ QBBInputContext::~QBBInputContext()
#define getarg(type, name) type name = imfEvent->mArgs[qs(#name)].value<type>()
#define getparg(type, name) type name = (type)(imfEvent->mArgs[qs(#name)].value<void*>())
-bool QBBInputContext::isValid() const
+bool QQnxInputContext::isValid() const
{
return imfAvailable();
}
-bool QBBInputContext::eventFilter(QObject *obj, QEvent *event)
+bool QQnxInputContext::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == ImfEvent::sUserEventType) {
// Forward the event to our real handler.
@@ -878,9 +878,9 @@ bool QBBInputContext::eventFilter(QObject *obj, QEvent *event)
}
}
-bool QBBInputContext::filterEvent( const QEvent *event )
+bool QQnxInputContext::filterEvent( const QEvent *event )
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << event;
#endif
switch (event->type()) {
@@ -895,17 +895,17 @@ bool QBBInputContext::filterEvent( const QEvent *event )
}
}
-void QBBInputContext::reset()
+void QQnxInputContext::reset()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
endComposition();
}
-void QBBInputContext::update(Qt::InputMethodQueries queries)
+void QQnxInputContext::update(Qt::InputMethodQueries queries)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
reset();
@@ -913,9 +913,9 @@ void QBBInputContext::update(Qt::InputMethodQueries queries)
QPlatformInputContext::update(queries);
}
-void QBBInputContext::closeSession()
+void QQnxInputContext::closeSession()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO
#endif
if (!imfAvailable())
@@ -927,9 +927,9 @@ void QBBInputContext::closeSession()
}
}
-void QBBInputContext::openSession()
+void QQnxInputContext::openSession()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO
#endif
if (!imfAvailable())
@@ -939,12 +939,12 @@ void QBBInputContext::openSession()
sInputSession = p_ictrl_open_session(&ic_funcs);
}
-bool QBBInputContext::hasSession()
+bool QQnxInputContext::hasSession()
{
return sInputSession != 0;
}
-bool QBBInputContext::hasSelectedText()
+bool QQnxInputContext::hasSelectedText()
{
QInputPanel *panel = qApp->inputPanel();
QObject *input = panel->inputItem();
@@ -957,11 +957,11 @@ bool QBBInputContext::hasSelectedText()
return !query.value(Qt::ImCurrentSelection).toString().isEmpty();
}
-bool QBBInputContext::dispatchRequestSoftwareInputPanel()
+bool QQnxInputContext::dispatchRequestSoftwareInputPanel()
{
- QBBVirtualKeyboard::instance().showKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: requesting virtual keyboard";
+ QQnxVirtualKeyboard::instance().showKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: requesting virtual keyboard";
#endif
QInputPanel *panel = qApp->inputPanel();
QObject *input = panel->inputItem();
@@ -984,11 +984,11 @@ bool QBBInputContext::dispatchRequestSoftwareInputPanel()
return true;
}
-bool QBBInputContext::dispatchCloseSoftwareInputPanel()
+bool QQnxInputContext::dispatchCloseSoftwareInputPanel()
{
- QBBVirtualKeyboard::instance().hideKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: hiding virtual keyboard";
+ QQnxVirtualKeyboard::instance().hideKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: hiding virtual keyboard";
#endif
// This also means we are stopping composition, but we should already have done that.
@@ -998,9 +998,9 @@ bool QBBInputContext::dispatchCloseSoftwareInputPanel()
/**
* IMF Event Dispatchers.
*/
-bool QBBInputContext::dispatchFocusEvent(FocusEventId id, int hints)
+bool QQnxInputContext::dispatchFocusEvent(FocusEventId id, int hints)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1031,7 +1031,7 @@ bool QBBInputContext::dispatchFocusEvent(FocusEventId id, int hints)
return true;
}
-bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
+bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
{
if (!imfAvailable())
return false;
@@ -1110,7 +1110,7 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
navigation_event_t navEvent;
initEvent(&navEvent.event, sInputSession, EVENT_NAVIGATION, key);
navEvent.magnitude = 1;
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "dispatch navigation event " << key;
#endif
p_ictrl_dispatch_event(&navEvent.event);
@@ -1124,7 +1124,7 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
keyEvent.meta_key_state = 0;
p_ictrl_dispatch_event(&keyEvent.event);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "dispatch key event " << key;
#endif
}
@@ -1133,7 +1133,7 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
return true;
}
-void QBBInputContext::endComposition()
+void QQnxInputContext::endComposition()
{
if (!m_isComposing)
return;
@@ -1156,7 +1156,7 @@ void QBBInputContext::endComposition()
p_ictrl_dispatch_event(&actionEvent.event);
}
-void QBBInputContext::setComposingText(QString const& composingText)
+void QQnxInputContext::setComposingText(QString const& composingText)
{
m_composingText = composingText;
m_isComposing = true;
@@ -1176,12 +1176,12 @@ void QBBInputContext::setComposingText(QString const& composingText)
QCoreApplication::sendEvent(input, &event);
}
-int32_t QBBInputContext::processEvent(event_t *event)
+int32_t QQnxInputContext::processEvent(event_t *event)
{
int32_t result = -1;
switch (event->event_type) {
case EVENT_SPELL_CHECK: {
- #if defined(QBBINPUTCONTEXT_DEBUG)
+ #if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "EVENT_SPELL_CHECK";
#endif
result = 0;
@@ -1189,7 +1189,7 @@ int32_t QBBInputContext::processEvent(event_t *event)
}
case EVENT_NAVIGATION: {
- #if defined(QBBINPUTCONTEXT_DEBUG)
+ #if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "EVENT_NAVIGATION";
#endif
@@ -1198,20 +1198,20 @@ int32_t QBBInputContext::processEvent(event_t *event)
event->event_id == NAVIGATE_LEFT ? KEYCODE_LEFT :
event->event_id == NAVIGATE_RIGHT ? KEYCODE_RIGHT : 0;
- QBBEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, key, 0, 0, 0);
- QBBEventThread::injectKeyboardEvent(KEY_CAP_VALID, key, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, key, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_CAP_VALID, key, 0, 0, 0);
result = 0;
break;
}
case EVENT_KEY: {
- #if defined(QBBINPUTCONTEXT_DEBUG)
+ #if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "EVENT_KEY";
#endif
key_event_t *kevent = static_cast<key_event_t *>(event);
- QBBEventThread::injectKeyboardEvent(KEY_DOWN | KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
- QBBEventThread::injectKeyboardEvent(KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
+ QQnxEventThread::injectKeyboardEvent(KEY_DOWN | KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
+ QQnxEventThread::injectKeyboardEvent(KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
result = 0;
break;
@@ -1239,9 +1239,9 @@ int32_t QBBInputContext::processEvent(event_t *event)
* IMF Event Handlers
*/
-int32_t QBBInputContext::onBeginBatchEdit(input_session_t *ic)
+int32_t QQnxInputContext::onBeginBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1252,10 +1252,10 @@ int32_t QBBInputContext::onBeginBatchEdit(input_session_t *ic)
return 0;
}
-int32_t QBBInputContext::onClearMetaKeyStates(input_session_t *ic, int32_t states)
+int32_t QQnxInputContext::onClearMetaKeyStates(input_session_t *ic, int32_t states)
{
Q_UNUSED(states);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1267,7 +1267,7 @@ int32_t QBBInputContext::onClearMetaKeyStates(input_session_t *ic, int32_t state
return 0;
}
-int32_t QBBInputContext::onCommitText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
+int32_t QQnxInputContext::onCommitText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
Q_UNUSED(new_cursor_position); // TODO: How can we set the cursor position it's not part of the API.
if (!isSessionOkay(ic))
@@ -1280,7 +1280,7 @@ int32_t QBBInputContext::onCommitText(input_session_t *ic, spannable_string_t *t
QString commitString = QString::fromWCharArray(text->str, text->length);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "Committing [" << commitString << "]";
#endif
@@ -1294,9 +1294,9 @@ int32_t QBBInputContext::onCommitText(input_session_t *ic, spannable_string_t *t
return 0;
}
-int32_t QBBInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t left_length, int32_t right_length)
+int32_t QQnxInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t left_length, int32_t right_length)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "L:" << left_length << " R:" << right_length;
#endif
@@ -1309,8 +1309,8 @@ int32_t QBBInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t le
return 0;
if (hasSelectedText()) {
- QBBEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
- QBBEventThread::injectKeyboardEvent(KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
reset();
return 0;
}
@@ -1326,9 +1326,9 @@ int32_t QBBInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t le
return 0;
}
-int32_t QBBInputContext::onEndBatchEdit(input_session_t *ic)
+int32_t QQnxInputContext::onEndBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1338,9 +1338,9 @@ int32_t QBBInputContext::onEndBatchEdit(input_session_t *ic)
return 0;
}
-int32_t QBBInputContext::onFinishComposingText(input_session_t *ic)
+int32_t QQnxInputContext::onFinishComposingText(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1364,10 +1364,10 @@ int32_t QBBInputContext::onFinishComposingText(input_session_t *ic)
return 0;
}
-int32_t QBBInputContext::onGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
+int32_t QQnxInputContext::onGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
{
Q_UNUSED(req_modes);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1380,9 +1380,9 @@ int32_t QBBInputContext::onGetCursorCapsMode(input_session_t *ic, int32_t req_mo
return 0;
}
-int32_t QBBInputContext::onGetCursorPosition(input_session_t *ic)
+int32_t QQnxInputContext::onGetCursorPosition(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1401,11 +1401,11 @@ int32_t QBBInputContext::onGetCursorPosition(input_session_t *ic)
return m_lastCaretPos;
}
-extracted_text_t *QBBInputContext::onGetExtractedText(input_session_t *ic, extracted_text_request_t *request, int32_t flags)
+extracted_text_t *QQnxInputContext::onGetExtractedText(input_session_t *ic, extracted_text_request_t *request, int32_t flags)
{
Q_UNUSED(flags);
Q_UNUSED(request);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1422,10 +1422,10 @@ extracted_text_t *QBBInputContext::onGetExtractedText(input_session_t *ic, extra
return et;
}
-spannable_string_t *QBBInputContext::onGetSelectedText(input_session_t *ic, int32_t flags)
+spannable_string_t *QQnxInputContext::onGetSelectedText(input_session_t *ic, int32_t flags)
{
Q_UNUSED(flags);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1444,10 +1444,10 @@ spannable_string_t *QBBInputContext::onGetSelectedText(input_session_t *ic, int3
return toSpannableString(text);
}
-spannable_string_t *QBBInputContext::onGetTextAfterCursor(input_session_t *ic, int32_t n, int32_t flags)
+spannable_string_t *QQnxInputContext::onGetTextAfterCursor(input_session_t *ic, int32_t n, int32_t flags)
{
Q_UNUSED(flags);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1467,10 +1467,10 @@ spannable_string_t *QBBInputContext::onGetTextAfterCursor(input_session_t *ic, i
return toSpannableString(text.mid(m_lastCaretPos+1, n));
}
-spannable_string_t *QBBInputContext::onGetTextBeforeCursor(input_session_t *ic, int32_t n, int32_t flags)
+spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(input_session_t *ic, int32_t n, int32_t flags)
{
Q_UNUSED(flags);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1494,10 +1494,10 @@ spannable_string_t *QBBInputContext::onGetTextBeforeCursor(input_session_t *ic,
}
}
-int32_t QBBInputContext::onPerformEditorAction(input_session_t *ic, int32_t editor_action)
+int32_t QQnxInputContext::onPerformEditorAction(input_session_t *ic, int32_t editor_action)
{
Q_UNUSED(editor_action);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1510,10 +1510,10 @@ int32_t QBBInputContext::onPerformEditorAction(input_session_t *ic, int32_t edit
return 0;
}
-int32_t QBBInputContext::onReportFullscreenMode(input_session_t *ic, int32_t enabled)
+int32_t QQnxInputContext::onReportFullscreenMode(input_session_t *ic, int32_t enabled)
{
Q_UNUSED(enabled);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1526,9 +1526,9 @@ int32_t QBBInputContext::onReportFullscreenMode(input_session_t *ic, int32_t ena
return 0;
}
-int32_t QBBInputContext::onSendEvent(input_session_t *ic, event_t *event)
+int32_t QQnxInputContext::onSendEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1538,9 +1538,9 @@ int32_t QBBInputContext::onSendEvent(input_session_t *ic, event_t *event)
return processEvent(event);
}
-int32_t QBBInputContext::onSendAsyncEvent(input_session_t *ic, event_t *event)
+int32_t QQnxInputContext::onSendAsyncEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1550,9 +1550,9 @@ int32_t QBBInputContext::onSendAsyncEvent(input_session_t *ic, event_t *event)
return processEvent(event);
}
-int32_t QBBInputContext::onSetComposingRegion(input_session_t *ic, int32_t start, int32_t end)
+int32_t QQnxInputContext::onSetComposingRegion(input_session_t *ic, int32_t start, int32_t end)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1584,10 +1584,10 @@ int32_t QBBInputContext::onSetComposingRegion(input_session_t *ic, int32_t start
return 0;
}
-int32_t QBBInputContext::onSetComposingText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
+int32_t QQnxInputContext::onSetComposingText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
Q_UNUSED(new_cursor_position);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1607,11 +1607,11 @@ int32_t QBBInputContext::onSetComposingText(input_session_t *ic, spannable_strin
return 0;
}
-int32_t QBBInputContext::onSetSelection(input_session_t *ic, int32_t start, int32_t end)
+int32_t QQnxInputContext::onSetSelection(input_session_t *ic, int32_t start, int32_t end)
{
Q_UNUSED(start);
Q_UNUSED(end);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1624,35 +1624,35 @@ int32_t QBBInputContext::onSetSelection(input_session_t *ic, int32_t start, int3
return 0;
}
-void QBBInputContext::showInputPanel()
+void QQnxInputContext::showInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
dispatchRequestSoftwareInputPanel();
}
-void QBBInputContext::hideInputPanel()
+void QQnxInputContext::hideInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
dispatchCloseSoftwareInputPanel();
}
-bool QBBInputContext::isInputPanelVisible() const
+bool QQnxInputContext::isInputPanelVisible() const
{
return m_inputPanelVisible;
}
-QLocale QBBInputContext::locale() const
+QLocale QQnxInputContext::locale() const
{
return m_inputPanelLocale;
}
-void QBBInputContext::keyboardVisibilityChanged(bool visible)
+void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "visible=" << visible;
#endif
if (m_inputPanelVisible != visible) {
@@ -1661,9 +1661,9 @@ void QBBInputContext::keyboardVisibilityChanged(bool visible)
}
}
-void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
+void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "locale=" << locale;
#endif
if (m_inputPanelLocale != locale) {
@@ -1672,12 +1672,12 @@ void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
}
}
-void QBBInputContext::inputItemChanged()
+void QQnxInputContext::inputItemChanged()
{
QInputMethod *inputMethod = qApp->inputMethod();
QObject *inputItem = inputMethod->inputItem();
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "input item=" << inputItem;
#endif
@@ -1686,9 +1686,9 @@ void QBBInputContext::inputItemChanged()
hideInputPanel();
} else {
if (qobject_cast<QAbstractSpinBox*>(inputItem)) {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::NumPunc);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::NumPunc);
} else {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::Default);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::Default);
}
if (!m_inputPanelVisible)
showInputPanel();
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_imf.h b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
index 135ec02971..1fb55296a6 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_imf.h
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBINPUTCONTEXT_H
-#define QBBINPUTCONTEXT_H
+#ifndef QQNXINPUTCONTEXT_H
+#define QQNXINPUTCONTEXT_H
#include <QtGui/QPlatformInputContext>
@@ -53,12 +53,12 @@
QT_BEGIN_NAMESPACE
-class QBBInputContext : public QPlatformInputContext
+class QQnxInputContext : public QPlatformInputContext
{
Q_OBJECT
public:
- QBBInputContext();
- ~QBBInputContext();
+ QQnxInputContext();
+ ~QQnxInputContext();
virtual bool isValid() const;
@@ -129,4 +129,4 @@ Q_DECLARE_METATYPE(extracted_text_t*)
QT_END_NAMESPACE
-#endif // QBBINPUTCONTEXT_H
+#endif // QQNXINPUTCONTEXT_H
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
index abe84e2e53..33b6c0e6f3 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
@@ -39,19 +39,19 @@
**
****************************************************************************/
-#include "qbbinputcontext_noimf.h"
-#include "qbbvirtualkeyboard.h"
+#include "qqnxinputcontext_noimf.h"
+#include "qqnxvirtualkeyboard.h"
#include <QtCore/QDebug>
#include <QtGui/QGuiApplication>
#include <QtWidgets/QAbstractSpinBox>
-QBBInputContext::QBBInputContext() :
+QQnxInputContext::QQnxInputContext() :
QPlatformInputContext(),
m_inputPanelVisible(false),
m_inputPanelLocale(QLocale::c())
{
- QBBVirtualKeyboard &keyboard = QBBVirtualKeyboard::instance();
+ QQnxVirtualKeyboard &keyboard = QQnxVirtualKeyboard::instance();
connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool)));
connect(&keyboard, SIGNAL(localeChanged(QLocale)), this, SLOT(keyboardLocaleChanged(QLocale)));
keyboardVisibilityChanged(keyboard.isVisible());
@@ -61,42 +61,42 @@ QBBInputContext::QBBInputContext() :
connect(inputMethod, SIGNAL(inputItemChanged()), this, SLOT(inputItemChanged()));
}
-QBBInputContext::~QBBInputContext()
+QQnxInputContext::~QQnxInputContext()
{
}
-bool QBBInputContext::isValid() const
+bool QQnxInputContext::isValid() const
{
return true;
}
-bool QBBInputContext::hasPhysicalKeyboard()
+bool QQnxInputContext::hasPhysicalKeyboard()
{
// TODO: This should query the system to check if a USB keyboard is connected.
return false;
}
-void QBBInputContext::reset()
+void QQnxInputContext::reset()
{
}
-bool QBBInputContext::filterEvent( const QEvent *event )
+bool QQnxInputContext::filterEvent( const QEvent *event )
{
if (hasPhysicalKeyboard())
return false;
if (event->type() == QEvent::CloseSoftwareInputPanel) {
- QBBVirtualKeyboard::instance().hideKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: hiding virtual keyboard";
+ QQnxVirtualKeyboard::instance().hideKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: hiding virtual keyboard";
#endif
return false;
}
if (event->type() == QEvent::RequestSoftwareInputPanel) {
- QBBVirtualKeyboard::instance().showKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: requesting virtual keyboard";
+ QQnxVirtualKeyboard::instance().showKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: requesting virtual keyboard";
#endif
return false;
}
@@ -105,7 +105,7 @@ bool QBBInputContext::filterEvent( const QEvent *event )
}
-bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
+bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
{
Q_UNUSED(flags);
Q_UNUSED(sym);
@@ -115,35 +115,35 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
return false;
}
-void QBBInputContext::showInputPanel()
+void QQnxInputContext::showInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- QBBVirtualKeyboard::instance().showKeyboard();
+ QQnxVirtualKeyboard::instance().showKeyboard();
}
-void QBBInputContext::hideInputPanel()
+void QQnxInputContext::hideInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- QBBVirtualKeyboard::instance().hideKeyboard();
+ QQnxVirtualKeyboard::instance().hideKeyboard();
}
-bool QBBInputContext::isInputPanelVisible() const
+bool QQnxInputContext::isInputPanelVisible() const
{
return m_inputPanelVisible;
}
-QLocale QBBInputContext::locale() const
+QLocale QQnxInputContext::locale() const
{
return m_inputPanelLocale;
}
-void QBBInputContext::keyboardVisibilityChanged(bool visible)
+void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "visible=" << visible;
#endif
if (m_inputPanelVisible != visible) {
@@ -152,9 +152,9 @@ void QBBInputContext::keyboardVisibilityChanged(bool visible)
}
}
-void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
+void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "locale=" << locale;
#endif
if (m_inputPanelLocale != locale) {
@@ -163,12 +163,12 @@ void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
}
}
-void QBBInputContext::inputItemChanged()
+void QQnxInputContext::inputItemChanged()
{
QInputMethod *inputMethod = qApp->inputMethod();
QObject *inputItem = inputMethod->inputItem();
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "input item=" << inputItem;
#endif
@@ -177,9 +177,9 @@ void QBBInputContext::inputItemChanged()
hideInputPanel();
} else {
if (qobject_cast<QAbstractSpinBox*>(inputItem)) {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::NumPunc);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::NumPunc);
} else {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::Default);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::Default);
}
if (!m_inputPanelVisible)
showInputPanel();
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
index 3d4d6da830..33a4631d16 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBINPUTCONTEXT_H
-#define QBBINPUTCONTEXT_H
+#ifndef QQNXINPUTCONTEXT_H
+#define QQNXINPUTCONTEXT_H
#include <QtCore/QLocale>
#include <QtGui/QPlatformInputContext>
@@ -48,12 +48,12 @@
QT_BEGIN_NAMESPACE
-class QBBInputContext : public QPlatformInputContext
+class QQnxInputContext : public QPlatformInputContext
{
Q_OBJECT
public:
- explicit QBBInputContext();
- ~QBBInputContext();
+ explicit QQnxInputContext();
+ ~QQnxInputContext();
virtual bool isValid() const;
@@ -81,4 +81,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBINPUTCONTEXT_H
+#endif // QQNXINPUTCONTEXT_H
diff --git a/src/plugins/platforms/blackberry/qbbintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 9f922a419e..2811661269 100644
--- a/src/plugins/platforms/blackberry/qbbintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -39,22 +39,22 @@
**
****************************************************************************/
-#include "qbbintegration.h"
-#include "qbbeventthread.h"
-#include "qbbglbackingstore.h"
-#include "qbbglcontext.h"
-#include "qbbnavigatorthread.h"
-#include "qbbrasterbackingstore.h"
-#include "qbbscreen.h"
-#include "qbbwindow.h"
-#include "qbbvirtualkeyboard.h"
-#include "qbbclipboard.h"
-#include "qbbglcontext.h"
-
-#if defined(QBB_IMF)
-#include "qbbinputcontext_imf.h"
+#include "qqnxintegration.h"
+#include "qqnxeventthread.h"
+#include "qqnxglbackingstore.h"
+#include "qqnxglcontext.h"
+#include "qqnxnavigatorthread.h"
+#include "qqnxrasterbackingstore.h"
+#include "qqnxscreen.h"
+#include "qqnxwindow.h"
+#include "qqnxvirtualkeyboard.h"
+#include "qqnxclipboard.h"
+#include "qqnxglcontext.h"
+
+#if defined(QQnx_IMF)
+#include "qqnxinputcontext_imf.h"
#else
-#include "qbbinputcontext_noimf.h"
+#include "qqnxinputcontext_noimf.h"
#endif
#include "private/qgenericunixfontdatabase_p.h"
@@ -71,10 +71,10 @@
QT_BEGIN_NAMESPACE
-QBBWindowMapper QBBIntegration::ms_windowMapper;
-QMutex QBBIntegration::ms_windowMapperMutex;
+QQnxWindowMapper QQnxIntegration::ms_windowMapper;
+QMutex QQnxIntegration::ms_windowMapperMutex;
-QBBIntegration::QBBIntegration()
+QQnxIntegration::QQnxIntegration()
: QPlatformIntegration()
, m_eventThread(0)
, m_navigatorThread(0)
@@ -86,47 +86,47 @@ QBBIntegration::QBBIntegration()
, m_clipboard(0)
#endif
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Open connection to QNX composition manager
errno = 0;
int result = screen_create_context(&m_screenContext, SCREEN_APPLICATION_CONTEXT);
if (result != 0) {
- qFatal("QBB: failed to connect to composition manager, errno=%d", errno);
+ qFatal("QQnx: failed to connect to composition manager, errno=%d", errno);
}
// Create displays for all possible screens (which may not be attached)
- QBBScreen::createDisplays(m_screenContext);
- Q_FOREACH (QPlatformScreen *screen, QBBScreen::screens()) {
+ QQnxScreen::createDisplays(m_screenContext);
+ Q_FOREACH (QPlatformScreen *screen, QQnxScreen::screens()) {
screenAdded(screen);
}
// Initialize global OpenGL resources
- QBBGLContext::initialize();
+ QQnxGLContext::initialize();
// Create/start event thread
- m_eventThread = new QBBEventThread(m_screenContext, *QBBScreen::primaryDisplay());
+ m_eventThread = new QQnxEventThread(m_screenContext, *QQnxScreen::primaryDisplay());
m_eventThread->start();
// Create/start navigator thread
- m_navigatorThread = new QBBNavigatorThread(*QBBScreen::primaryDisplay());
+ m_navigatorThread = new QQnxNavigatorThread(*QQnxScreen::primaryDisplay());
m_navigatorThread->start();
// Create/start the keyboard class.
- QBBVirtualKeyboard::instance();
+ QQnxVirtualKeyboard::instance();
// Set up the input context
- m_inputContext = new QBBInputContext;
+ m_inputContext = new QQnxInputContext;
}
-QBBIntegration::~QBBIntegration()
+QQnxIntegration::~QQnxIntegration()
{
-#if defined(QBBINTEGRATION_DEBUG)
- qDebug() << "QBB: platform plugin shutdown begin";
+#if defined(QQNXINTEGRATION_DEBUG)
+ qDebug() << "QQnx: platform plugin shutdown begin";
#endif
// Destroy the keyboard class.
- QBBVirtualKeyboard::destroy();
+ QQnxVirtualKeyboard::destroy();
#ifndef QT_NO_CLIPBOARD
// Delete the clipboard
@@ -140,22 +140,22 @@ QBBIntegration::~QBBIntegration()
delete m_navigatorThread;
// Destroy all displays
- QBBScreen::destroyDisplays();
+ QQnxScreen::destroyDisplays();
// Close connection to QNX composition manager
screen_destroy_context(m_screenContext);
// Cleanup global OpenGL resources
- QBBGLContext::shutdown();
+ QQnxGLContext::shutdown();
-#if defined(QBBINTEGRATION_DEBUG)
- qDebug() << "QBB: platform plugin shutdown end";
+#if defined(QQNXINTEGRATION_DEBUG)
+ qDebug() << "QQnx: platform plugin shutdown end";
#endif
}
-bool QBBIntegration::hasCapability(QPlatformIntegration::Capability cap) const
+bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
switch (cap) {
@@ -168,90 +168,90 @@ bool QBBIntegration::hasCapability(QPlatformIntegration::Capability cap) const
}
}
-QPlatformWindow *QBBIntegration::createPlatformWindow(QWindow *window) const
+QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// New windows are created on the primary display.
- return new QBBWindow(window, m_screenContext);
+ return new QQnxWindow(window, m_screenContext);
}
-QPlatformBackingStore *QBBIntegration::createPlatformBackingStore(QWindow *window) const
+QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
if (paintUsingOpenGL())
- return new QBBGLBackingStore(window);
+ return new QQnxGLBackingStore(window);
else
- return new QBBRasterBackingStore(window);
+ return new QQnxRasterBackingStore(window);
}
-QPlatformOpenGLContext *QBBIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
+QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- return new QBBGLContext(context);
+ return new QQnxGLContext(context);
}
-QPlatformInputContext *QBBIntegration::inputContext() const
+QPlatformInputContext *QQnxIntegration::inputContext() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
return m_inputContext;
}
-void QBBIntegration::moveToScreen(QWindow *window, int screen)
+void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{
-#if defined(QBBINTEGRATION_DEBUG)
- qDebug() << "QBBIntegration::moveToScreen - w=" << window << ", s=" << screen;
+#if defined(QQNXINTEGRATION_DEBUG)
+ qDebug() << "QQnxIntegration::moveToScreen - w=" << window << ", s=" << screen;
#endif
// get platform window used by widget
- QBBWindow *platformWindow = static_cast<QBBWindow *>(window->handle());
+ QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());
// lookup platform screen by index
- QBBScreen *platformScreen = static_cast<QBBScreen*>(QBBScreen::screens().at(screen));
+ QQnxScreen *platformScreen = static_cast<QQnxScreen*>(QQnxScreen::screens().at(screen));
// move the platform window to the platform screen
platformWindow->setScreen(platformScreen);
}
-QList<QPlatformScreen *> QBBIntegration::screens() const
+QList<QPlatformScreen *> QQnxIntegration::screens() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- return QBBScreen::screens();
+ return QQnxScreen::screens();
}
-QAbstractEventDispatcher *QBBIntegration::guiThreadEventDispatcher() const
+QAbstractEventDispatcher *QQnxIntegration::guiThreadEventDispatcher() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
return m_eventDispatcher;
}
#ifndef QT_NO_CLIPBOARD
-QPlatformClipboard *QBBIntegration::clipboard() const
+QPlatformClipboard *QQnxIntegration::clipboard() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
if (!m_clipboard) {
- m_clipboard = new QBBClipboard;
+ m_clipboard = new QQnxClipboard;
}
return m_clipboard;
}
#endif
-QVariant QBBIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
+QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
if (hint == ShowIsFullScreen)
@@ -260,9 +260,9 @@ QVariant QBBIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
return QPlatformIntegration::styleHint(hint);
}
-QWindow *QBBIntegration::window(screen_window_t qnxWindow)
+QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QMutexLocker locker(&ms_windowMapperMutex);
@@ -270,9 +270,9 @@ QWindow *QBBIntegration::window(screen_window_t qnxWindow)
return ms_windowMapper.value(qnxWindow, 0);
}
-void QBBIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
+void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QMutexLocker locker(&ms_windowMapperMutex);
@@ -280,9 +280,9 @@ void QBBIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
ms_windowMapper.insert(qnxWindow, window);
}
-void QBBIntegration::removeWindow(screen_window_t qnxWindow)
+void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QMutexLocker locker(&ms_windowMapperMutex);
diff --git a/src/plugins/platforms/blackberry/qbbintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 6b54329dac..51d06bd0e6 100644
--- a/src/plugins/platforms/blackberry/qbbintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBINTEGRATION_H
-#define QBBINTEGRATION_H
+#ifndef QQNXINTEGRATION_H
+#define QQNXINTEGRATION_H
#include <QtGui/qplatformintegration_qpa.h>
@@ -50,23 +50,23 @@
QT_BEGIN_NAMESPACE
-class QBBEventThread;
-class QBBInputContext;
-class QBBNavigatorThread;
-class QBBWindow;
+class QQnxEventThread;
+class QQnxInputContext;
+class QQnxNavigatorThread;
+class QQnxWindow;
#ifndef QT_NO_CLIPBOARD
-class QBBClipboard;
+class QQnxClipboard;
#endif
template<class K, class V> class QHash;
-typedef QHash<screen_window_t, QWindow *> QBBWindowMapper;
+typedef QHash<screen_window_t, QWindow *> QQnxWindowMapper;
-class QBBIntegration : public QPlatformIntegration
+class QQnxIntegration : public QPlatformIntegration
{
public:
- QBBIntegration();
- virtual ~QBBIntegration();
+ QQnxIntegration();
+ virtual ~QQnxIntegration();
virtual bool hasCapability(QPlatformIntegration::Capability cap) const;
@@ -98,22 +98,22 @@ private:
static void removeWindow(screen_window_t qnxWindow);
screen_context_t m_screenContext;
- QBBEventThread *m_eventThread;
- QBBNavigatorThread *m_navigatorThread;
- QBBInputContext *m_inputContext;
+ QQnxEventThread *m_eventThread;
+ QQnxNavigatorThread *m_navigatorThread;
+ QQnxInputContext *m_inputContext;
QPlatformFontDatabase *m_fontDatabase;
bool m_paintUsingOpenGL;
QAbstractEventDispatcher *m_eventDispatcher;
#ifndef QT_NO_CLIPBOARD
- mutable QBBClipboard* m_clipboard;
+ mutable QQnxClipboard* m_clipboard;
#endif
- static QBBWindowMapper ms_windowMapper;
+ static QQnxWindowMapper ms_windowMapper;
static QMutex ms_windowMapperMutex;
- friend class QBBWindow;
+ friend class QQnxWindow;
};
QT_END_NAMESPACE
-#endif // QBBINTEGRATION_H
+#endif // QQNXINTEGRATION_H
diff --git a/src/plugins/platforms/blackberry/qbbkeytranslator.h b/src/plugins/platforms/qnx/qqnxkeytranslator.h
index fdc1220aba..46bdfacd97 100644
--- a/src/plugins/platforms/blackberry/qbbkeytranslator.h
+++ b/src/plugins/platforms/qnx/qqnxkeytranslator.h
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#ifndef QBBKEYTRANSLATOR_H
-#define QBBKEYTRANSLATOR_H
+#ifndef QQNXKEYTRANSLATOR_H
+#define QQNXKEYTRANSLATOR_H
#include <sys/keycodes.h>
-#if defined(QBBEVENTTHREAD_DEBUG)
+#if defined(QQNXEVENTTHREAD_DEBUG)
#include <QtCore/QDebug>
#endif
@@ -227,8 +227,8 @@ Qt::Key keyTranslator( int key )
// See keycodes.h for more, but these are all the basics. And printables are already included.
default:
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: unknown key for translation:" << key;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: unknown key for translation:" << key;
#endif
break;
}
@@ -266,4 +266,4 @@ bool isKeypadKey( int key )
QT_END_NAMESPACE
-#endif // QBBKEYTRANSLATOR_H
+#endif // QQNXKEYTRANSLATOR_H
diff --git a/src/plugins/platforms/blackberry/qbbnavigatorthread.cpp b/src/plugins/platforms/qnx/qqnxnavigatorthread.cpp
index 65cbb77d31..def4cb7eb1 100644
--- a/src/plugins/platforms/blackberry/qbbnavigatorthread.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatorthread.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qbbnavigatorthread.h"
-#include "qbbscreen.h"
+#include "qqnxnavigatorthread.h"
+#include "qqnxscreen.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
@@ -50,6 +50,7 @@
#include <QtCore/QDebug>
#include <QtCore/QList>
#include <QtCore/QSocketNotifier>
+#include <QtCore/private/qcore_unix_p.h>
#include <errno.h>
#include <fcntl.h>
@@ -60,14 +61,14 @@
static const char *navigatorControlPath = "/pps/services/navigator/control";
static const int ppsBufferSize = 4096;
-QBBNavigatorThread::QBBNavigatorThread(QBBScreen& primaryScreen)
+QQnxNavigatorThread::QQnxNavigatorThread(QQnxScreen& primaryScreen)
: m_primaryScreen(primaryScreen),
m_fd(-1),
m_readNotifier(0)
{
}
-QBBNavigatorThread::~QBBNavigatorThread()
+QQnxNavigatorThread::~QQnxNavigatorThread()
{
// block until thread terminates
shutdown();
@@ -75,17 +76,17 @@ QBBNavigatorThread::~QBBNavigatorThread()
delete m_readNotifier;
}
-void QBBNavigatorThread::run()
+void QQnxNavigatorThread::run()
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread started";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread started";
#endif
// open connection to navigator
errno = 0;
m_fd = open(navigatorControlPath, O_RDWR);
if (m_fd == -1) {
- qWarning("QBB: failed to open navigator pps, errno=%d", errno);
+ qWarning("QQNX: failed to open navigator pps, errno=%d", errno);
return;
}
@@ -98,15 +99,15 @@ void QBBNavigatorThread::run()
// close connection to navigator
close(m_fd);
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread stopped";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread stopped";
#endif
}
-void QBBNavigatorThread::shutdown()
+void QQnxNavigatorThread::shutdown()
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread shutdown begin";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread shutdown begin";
#endif
// signal thread to terminate
@@ -115,14 +116,14 @@ void QBBNavigatorThread::shutdown()
// block until thread terminates
wait();
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread shutdown end";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread shutdown end";
#endif
}
-void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
+void QQnxNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: data=" << ppsData;
#endif
@@ -131,7 +132,7 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
// validate pps object
if (lines.size() == 0 || lines.at(0) != "@control") {
- qFatal("QBB: unrecognized pps object, data=%s", ppsData.constData());
+ qFatal("QQNX: unrecognized pps object, data=%s", ppsData.constData());
}
// parse pps object attributes and extract values
@@ -140,7 +141,7 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
// tokenize current attribute
const QByteArray &attr = lines.at(i);
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: attr=" << attr;
#endif
@@ -159,7 +160,7 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
QByteArray key = attr.left(firstColon);
QByteArray value = attr.mid(secondColon + 1);
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: key=" << key;
qDebug() << "PPS: val=" << value;
#endif
@@ -172,12 +173,12 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
} else if (key == "id") {
id = value;
} else {
- qFatal("QBB: unrecognized pps attribute, attr=%s", key.constData());
+ qFatal("QQNX: unrecognized pps attribute, attr=%s", key.constData());
}
}
}
-void QBBNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat)
+void QQnxNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat)
{
// construct pps message
QByteArray ppsData = "res::";
@@ -190,7 +191,7 @@ void QBBNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, c
}
ppsData += "\n";
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS reply=" << ppsData;
#endif
@@ -198,13 +199,13 @@ void QBBNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, c
errno = 0;
int bytes = write(m_fd, ppsData.constData(), ppsData.size());
if (bytes == -1) {
- qFatal("QBB: failed to write navigator pps, errno=%d", errno);
+ qFatal("QQNX: failed to write navigator pps, errno=%d", errno);
}
}
-void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id)
+void QQnxNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id)
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: msg=" << msg << ", dat=" << dat << ", id=" << id;
#endif
@@ -212,7 +213,7 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
if (msg == "orientationCheck") {
// reply to navigator that (any) orientation is acceptable
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: orientation check, o=" << dat;
#endif
replyPPS(msg, id, "true");
@@ -220,7 +221,7 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
} else if (msg == "orientation") {
// update screen geometry and reply to navigator that we're ready
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: orientation, o=" << dat;
#endif
m_primaryScreen.setRotation( dat.toInt() );
@@ -230,7 +231,7 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
} else if (msg == "SWIPE_DOWN") {
// simulate menu key press
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: menu";
#endif
QWindow *w = QGuiApplication::focusWindow();
@@ -240,26 +241,26 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
} else if (msg == "exit") {
// shutdown everything
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: exit";
#endif
QCoreApplication::quit();
}
}
-void QBBNavigatorThread::readData()
+void QQnxNavigatorThread::readData()
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: reading navigator data";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: reading navigator data";
#endif
// allocate buffer for pps data
char buffer[ppsBufferSize];
// attempt to read pps data
errno = 0;
- int bytes = read(m_fd, buffer, ppsBufferSize - 1);
+ int bytes = qt_safe_read(m_fd, buffer, ppsBufferSize - 1);
if (bytes == -1) {
- qFatal("QBB: failed to read navigator pps, errno=%d", errno);
+ qFatal("QQNX: failed to read navigator pps, errno=%d", errno);
}
// check if pps data was received
diff --git a/src/plugins/platforms/blackberry/qbbnavigatorthread.h b/src/plugins/platforms/qnx/qqnxnavigatorthread.h
index fda24b0c67..40b217db73 100644
--- a/src/plugins/platforms/blackberry/qbbnavigatorthread.h
+++ b/src/plugins/platforms/qnx/qqnxnavigatorthread.h
@@ -39,22 +39,22 @@
**
****************************************************************************/
-#ifndef QBBNAVIGATORTHREAD_H
-#define QBBNAVIGATORTHREAD_H
+#ifndef QQNXNAVIGATORTHREAD_H
+#define QQNXNAVIGATORTHREAD_H
#include <QThread>
QT_BEGIN_NAMESPACE
-class QBBScreen;
+class QQnxScreen;
class QSocketNotifier;
-class QBBNavigatorThread : public QThread
+class QQnxNavigatorThread : public QThread
{
Q_OBJECT
public:
- QBBNavigatorThread(QBBScreen &primaryScreen);
- virtual ~QBBNavigatorThread();
+ QQnxNavigatorThread(QQnxScreen &primaryScreen);
+ virtual ~QQnxNavigatorThread();
protected:
virtual void run();
@@ -68,11 +68,11 @@ private:
void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat);
void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id);
- QBBScreen &m_primaryScreen;
+ QQnxScreen &m_primaryScreen;
int m_fd;
QSocketNotifier *m_readNotifier;
};
QT_END_NAMESPACE
-#endif // QBBNAVIGATORTHREAD_H
+#endif // QQNXNAVIGATORTHREAD_H
diff --git a/src/plugins/platforms/blackberry/qbbrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 405e09260f..1d0da240b3 100644
--- a/src/plugins/platforms/blackberry/qbbrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qbbrasterbackingstore.h"
-#include "qbbwindow.h"
+#include "qqnxrasterbackingstore.h"
+#include "qqnxwindow.h"
#include <QtCore/QDebug>
@@ -48,36 +48,36 @@
QT_BEGIN_NAMESPACE
-QBBRasterBackingStore::QBBRasterBackingStore(QWindow *window)
+QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
: QPlatformBackingStore(window)
{
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::QBBRasterBackingStore - w=" << window;
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::QQnxRasterBackingStore - w=" << window;
#endif
// save platform window associated with widget
- m_platformWindow = static_cast<QBBWindow*>(window->handle());
+ m_platformWindow = static_cast<QQnxWindow*>(window->handle());
}
-QBBRasterBackingStore::~QBBRasterBackingStore()
+QQnxRasterBackingStore::~QQnxRasterBackingStore()
{
-#if defined(QBBRasterBackingStore_DEBUG)
- qDebug() << "QBBRasterBackingStore::~QBBRasterBackingStore - w=" << window();
+#if defined(QQnxRasterBackingStore_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::~QQnxRasterBackingStore - w=" << window();
#endif
}
-QPaintDevice *QBBRasterBackingStore::paintDevice()
+QPaintDevice *QQnxRasterBackingStore::paintDevice()
{
return m_platformWindow->renderBuffer().image();
}
-void QBBRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
Q_UNUSED(window);
Q_UNUSED(offset);
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::flush - w=" << this->window();
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::flush - w=" << this->window();
#endif
// visit all pending scroll operations
@@ -96,22 +96,22 @@ void QBBRasterBackingStore::flush(QWindow *window, const QRegion &region, const
m_platformWindow->post(region);
}
-void QBBRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
+void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(size);
Q_UNUSED(staticContents);
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::resize - w=" << window() << ", s=" << size;
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::resize - w=" << window() << ", s=" << size;
#endif
// NOTE: defer resizing window buffers until next paint as
// resize() can be called multiple times before a paint occurs
}
-bool QBBRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
+bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::scroll - w=" << window();
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::scroll - w=" << window();
#endif
// calculate entire region affected by scroll operation (src + dst)
@@ -130,7 +130,7 @@ bool QBBRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
} else if (op.totalArea.intersects(totalArea)) {
// current scroll overlaps previous scroll but is
// not equal in area - just paint everything
- qWarning("QBB: pending scroll operations overlap but not equal");
+ qWarning("QQNX: pending scroll operations overlap but not equal");
return false;
}
}
@@ -140,12 +140,12 @@ bool QBBRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
return true;
}
-void QBBRasterBackingStore::beginPaint(const QRegion &region)
+void QQnxRasterBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::beginPaint - w=" << window();
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::beginPaint - w=" << window();
#endif
// resize window buffers if surface resized
@@ -155,11 +155,11 @@ void QBBRasterBackingStore::beginPaint(const QRegion &region)
}
}
-void QBBRasterBackingStore::endPaint(const QRegion &region)
+void QQnxRasterBackingStore::endPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBRasterBackingStore_DEBUG)
- qDebug() << "QBBRasterBackingStore::endPaint - w=" << window();
+#if defined(QQnxRasterBackingStore_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::endPaint - w=" << window();
#endif
}
diff --git a/src/plugins/platforms/blackberry/qbbrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
index ca1e27bcc8..fec51a19b9 100644
--- a/src/plugins/platforms/blackberry/qbbrasterbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBRASTERWINDOWSURFACE_H
-#define QBBRASTERWINDOWSURFACE_H
+#ifndef QQNXRASTERWINDOWSURFACE_H
+#define QQNXRASTERWINDOWSURFACE_H
#include <QtGui/qplatformbackingstore_qpa.h>
@@ -48,13 +48,13 @@
QT_BEGIN_NAMESPACE
-class QBBWindow;
+class QQnxWindow;
-class QBBRasterBackingStore : public QPlatformBackingStore
+class QQnxRasterBackingStore : public QPlatformBackingStore
{
public:
- QBBRasterBackingStore(QWindow *window);
- virtual ~QBBRasterBackingStore();
+ QQnxRasterBackingStore(QWindow *window);
+ virtual ~QQnxRasterBackingStore();
virtual QPaintDevice *paintDevice();
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
@@ -72,10 +72,10 @@ private:
int dy;
};
- QBBWindow *m_platformWindow;
+ QQnxWindow *m_platformWindow;
QList<ScrollOp> m_scrollOpList;
};
QT_END_NAMESPACE
-#endif // QBBRASTERWINDOWSURFACE_H
+#endif // QQNXRASTERWINDOWSURFACE_H
diff --git a/src/plugins/platforms/blackberry/qbbrootwindow.cpp b/src/plugins/platforms/qnx/qqnxrootwindow.cpp
index 831b0774f9..6f6b89a6d6 100644
--- a/src/plugins/platforms/blackberry/qbbrootwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrootwindow.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qbbrootwindow.h"
+#include "qqnxrootwindow.h"
-#include "qbbscreen.h"
+#include "qqnxscreen.h"
#include <QtCore/QUuid>
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
#include <QtCore/QDebug>
#endif
@@ -54,12 +54,12 @@
static const int MAGIC_ZORDER_FOR_NO_NAV = 10;
-QBBRootWindow::QBBRootWindow(QBBScreen *screen)
+QQnxRootWindow::QQnxRootWindow(QQnxScreen *screen)
: m_screen(screen),
m_window(0),
m_windowGroupName()
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Create one top-level QNX window to act as a container for child windows
@@ -68,7 +68,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
int result = screen_create_window(&m_window, m_screen->nativeContext());
int val[2];
if (result != 0) {
- qFatal("QBBRootWindow: failed to create window, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to create window, errno=%d", errno);
}
// Move window to proper display
@@ -76,7 +76,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
screen_display_t display = m_screen->nativeDisplay();
result = screen_set_window_property_pv(m_window, SCREEN_PROPERTY_DISPLAY, (void **)&display);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window display, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window display, errno=%d", errno);
}
// Make sure window is above navigator but below keyboard if running as root
@@ -86,7 +86,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = MAGIC_ZORDER_FOR_NO_NAV;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ZORDER, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window z-order, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window z-order, errno=%d", errno);
}
}
@@ -95,14 +95,14 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = SCREEN_USAGE_NATIVE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_USAGE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window buffer usage, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window buffer usage, errno=%d", errno);
}
errno = 0;
val[0] = m_screen->nativeFormat();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_FORMAT, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window pixel format, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window pixel format, errno=%d", errno);
}
errno = 0;
@@ -110,13 +110,13 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = 1;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BUFFER_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window buffer size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window buffer size, errno=%d", errno);
}
errno = 0;
result = screen_create_window_buffers(m_window, 1);
if (result != 0) {
- qFatal("QBB: failed to create window buffer, errno=%d", errno);
+ qFatal("QQNX: failed to create window buffer, errno=%d", errno);
}
// Window is always the size of the display
@@ -126,7 +126,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = geometry.height();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window size, errno=%d", errno);
}
// Fill the window with solid black
@@ -134,7 +134,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_COLOR, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window colour, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window colour, errno=%d", errno);
}
// Make the window opaque
@@ -142,7 +142,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = SCREEN_TRANSPARENCY_NONE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_TRANSPARENCY, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window transparency, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window transparency, errno=%d", errno);
}
// Set the swap interval to 1
@@ -150,7 +150,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = 1;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SWAP_INTERVAL, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window swap interval, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window swap interval, errno=%d", errno);
}
// Set viewport size equal to window size but move outside buffer so the fill colour is used exclusively
@@ -159,7 +159,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = geometry.height();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window source size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window source size, errno=%d", errno);
}
errno = 0;
@@ -167,83 +167,83 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_POSITION, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window source position, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window source position, errno=%d", errno);
}
createWindowGroup();
post();
}
-QBBRootWindow::~QBBRootWindow()
+QQnxRootWindow::~QQnxRootWindow()
{
// Cleanup top-level QNX window
screen_destroy_window(m_window);
}
-void QBBRootWindow::post() const
+void QQnxRootWindow::post() const
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
errno = 0;
screen_buffer_t buffer;
int result = screen_get_window_property_pv(m_window, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)&buffer);
if (result != 0) {
- qFatal("QBBRootWindow: failed to query window buffer, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to query window buffer, errno=%d", errno);
}
errno = 0;
int dirtyRect[] = {0, 0, 1, 1};
result = screen_post_window(m_window, buffer, 1, dirtyRect, 0);
if (result != 0) {
- qFatal("QBB: failed to post window buffer, errno=%d", errno);
+ qFatal("QQNX: failed to post window buffer, errno=%d", errno);
}
}
-void QBBRootWindow::flush() const
+void QQnxRootWindow::flush() const
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Force immediate display update
errno = 0;
int result = screen_flush_context(m_screen->nativeContext(), 0);
if (result != 0) {
- qFatal("QBBRootWindow: failed to flush context, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to flush context, errno=%d", errno);
}
}
-void QBBRootWindow::setRotation(int rotation)
+void QQnxRootWindow::setRotation(int rotation)
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "angle =" << rotation;
#endif
errno = 0;
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ROTATION, &rotation);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window rotation, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window rotation, errno=%d", errno);
}
}
-void QBBRootWindow::resize(const QSize &size)
+void QQnxRootWindow::resize(const QSize &size)
{
errno = 0;
int val[] = {size.width(), size.height()};
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window size, errno=%d", errno);
}
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window source size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window source size, errno=%d", errno);
}
// NOTE: display will update when child windows relayout and repaint
}
-void QBBRootWindow::createWindowGroup()
+void QQnxRootWindow::createWindowGroup()
{
// Generate a random window group name
m_windowGroupName = QUuid::createUuid().toString().toAscii();
@@ -252,6 +252,6 @@ void QBBRootWindow::createWindowGroup()
errno = 0;
int result = screen_create_window_group(m_window, m_windowGroupName.constData());
if (result != 0) {
- qFatal("QBBRootWindow: failed to create app window group, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to create app window group, errno=%d", errno);
}
}
diff --git a/src/plugins/platforms/blackberry/qbbrootwindow.h b/src/plugins/platforms/qnx/qqnxrootwindow.h
index 0b89f52a5e..80b10c65f0 100644
--- a/src/plugins/platforms/blackberry/qbbrootwindow.h
+++ b/src/plugins/platforms/qnx/qqnxrootwindow.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBROOTWINDOW_H
-#define QBBROOTWINDOW_H
+#ifndef QQNXROOTWINDOW_H
+#define QQNXROOTWINDOW_H
#include <QtCore/QByteArray>
#include <QtCore/QRect>
@@ -49,13 +49,13 @@
QT_BEGIN_NAMESPACE
-class QBBScreen;
+class QQnxScreen;
-class QBBRootWindow
+class QQnxRootWindow
{
public:
- QBBRootWindow(QBBScreen *screen);
- ~QBBRootWindow();
+ QQnxRootWindow(QQnxScreen *screen);
+ ~QQnxRootWindow();
screen_window_t nativeHandle() const { return m_window; }
@@ -71,11 +71,11 @@ public:
private:
void createWindowGroup();
- QBBScreen *m_screen;
+ QQnxScreen *m_screen;
screen_window_t m_window;
QByteArray m_windowGroupName;
};
QT_END_NAMESPACE
-#endif // QBBROOTWINDOW_H
+#endif // QQNXROOTWINDOW_H
diff --git a/src/plugins/platforms/blackberry/qbbscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 11e40f6150..e0e3d6d57d 100644
--- a/src/plugins/platforms/blackberry/qbbscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qbbscreen.h"
-#include "qbbvirtualkeyboard.h"
-#include "qbbwindow.h"
+#include "qqnxscreen.h"
+#include "qqnxvirtualkeyboard.h"
+#include "qqnxwindow.h"
#include <QtCore/QDebug>
#include <QtCore/QUuid>
@@ -50,10 +50,10 @@
QT_BEGIN_NAMESPACE
-QList<QPlatformScreen *> QBBScreen::ms_screens;
-QList<QBBWindow*> QBBScreen::ms_childWindows;
+QList<QPlatformScreen *> QQnxScreen::ms_screens;
+QList<QQnxWindow*> QQnxScreen::ms_childWindows;
-QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen)
+QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen)
: m_screenContext(screenContext),
m_display(display),
m_rootWindow(),
@@ -61,7 +61,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
m_posted(false),
m_platformContext(0)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Cache initial orientation of this display
@@ -69,7 +69,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
errno = 0;
int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION, &m_initialRotation);
if (result != 0) {
- qFatal("QBBScreen: failed to query display rotation, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display rotation, errno=%d", errno);
}
m_currentRotation = m_initialRotation;
@@ -79,7 +79,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
int val[2];
result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBScreen: failed to query display size, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display size, errno=%d", errno);
}
m_currentGeometry = m_initialGeometry = QRect(0, 0, val[0], val[1]);
@@ -88,7 +88,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
errno = 0;
result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_PHYSICAL_SIZE, val);
if (result != 0) {
- qFatal("QBBScreen: failed to query display physical size, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display physical size, errno=%d", errno);
}
// Peg the DPI to 96 (for now) so fonts are a reasonable size. We'll want to match
@@ -104,20 +104,20 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
// We only create the root window if we are the primary display.
if (primaryScreen)
- m_rootWindow = QSharedPointer<QBBRootWindow>(new QBBRootWindow(this));
+ m_rootWindow = QSharedPointer<QQnxRootWindow>(new QQnxRootWindow(this));
}
-QBBScreen::~QBBScreen()
+QQnxScreen::~QQnxScreen()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
}
/* static */
-void QBBScreen::createDisplays(screen_context_t context)
+void QQnxScreen::createDisplays(screen_context_t context)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Query number of displays
@@ -125,7 +125,7 @@ void QBBScreen::createDisplays(screen_context_t context)
int displayCount;
int result = screen_get_context_property_iv(context, SCREEN_PROPERTY_DISPLAY_COUNT, &displayCount);
if (result != 0) {
- qFatal("QBBScreen: failed to query display count, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display count, errno=%d", errno);
}
// Get all displays
@@ -133,22 +133,22 @@ void QBBScreen::createDisplays(screen_context_t context)
screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount);
result = screen_get_context_property_pv(context, SCREEN_PROPERTY_DISPLAYS, (void **)displays);
if (result != 0) {
- qFatal("QBBScreen: failed to query displays, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query displays, errno=%d", errno);
}
for (int i=0; i<displayCount; i++) {
-#if defined(QBBSCREEN_DEBUG)
- qDebug() << "QBBScreen::Creating screen for display " << i;
+#if defined(QQNXSCREEN_DEBUG)
+ qDebug() << "QQnxScreen::Creating screen for display " << i;
#endif
- QBBScreen *screen = new QBBScreen(context, displays[i], i==0);
+ QQnxScreen *screen = new QQnxScreen(context, displays[i], i==0);
ms_screens.append(screen);
}
}
/* static */
-void QBBScreen::destroyDisplays()
+void QQnxScreen::destroyDisplays()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
qDeleteAll(ms_screens);
@@ -159,16 +159,16 @@ void QBBScreen::destroyDisplays()
}
/* static */
-int QBBScreen::defaultDepth()
+int QQnxScreen::defaultDepth()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
static int defaultDepth = 0;
if (defaultDepth == 0) {
// check if display depth was specified in environment variable;
// use default value if no valid value found
- defaultDepth = qgetenv("QBB_DISPLAY_DEPTH").toInt();
+ defaultDepth = qgetenv("QQNX_DISPLAY_DEPTH").toInt();
if (defaultDepth != 16 && defaultDepth != 32) {
defaultDepth = 32;
}
@@ -176,13 +176,13 @@ int QBBScreen::defaultDepth()
return defaultDepth;
}
-QRect QBBScreen::availableGeometry() const
+QRect QQnxScreen::availableGeometry() const
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// available geometry = total geometry - keyboard
- int keyboardHeight = QBBVirtualKeyboard::instance().height();
+ int keyboardHeight = QQnxVirtualKeyboard::instance().height();
return QRect(m_currentGeometry.x(), m_currentGeometry.y(),
m_currentGeometry.width(), m_currentGeometry.height() - keyboardHeight);
}
@@ -195,9 +195,9 @@ static bool isOrthogonal(int angle1, int angle2)
return ((angle1 - angle2) % 180) != 0;
}
-void QBBScreen::setRotation(int rotation)
+void QQnxScreen::setRotation(int rotation)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "orientation =" << rotation;
#endif
// Check if rotation changed
@@ -217,7 +217,7 @@ void QBBScreen::setRotation(int rotation)
// Resize root window if we've rotated 90 or 270 from previous orientation
if (isOrthogonal(m_currentRotation, rotation)) {
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "resize, size =" << m_currentGeometry.size();
#endif
if (m_rootWindow)
@@ -234,9 +234,9 @@ void QBBScreen::setRotation(int rotation)
}
}
-void QBBScreen::addWindow(QBBWindow *window)
+void QQnxScreen::addWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
@@ -244,48 +244,48 @@ void QBBScreen::addWindow(QBBWindow *window)
return;
ms_childWindows.push_back(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::removeWindow(QBBWindow *window)
+void QQnxScreen::removeWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
ms_childWindows.removeAll(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::raiseWindow(QBBWindow *window)
+void QQnxScreen::raiseWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
removeWindow(window);
ms_childWindows.push_back(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::lowerWindow(QBBWindow *window)
+void QQnxScreen::lowerWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
removeWindow(window);
ms_childWindows.push_front(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::updateHierarchy()
+void QQnxScreen::updateHierarchy()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
int topZorder = 1; // root window is z-order 0, all "top" level windows are "above" it
for (it = ms_childWindows.begin(); it != ms_childWindows.end(); it++)
@@ -296,9 +296,9 @@ void QBBScreen::updateHierarchy()
screen_flush_context( primaryDisplay()->m_screenContext, 0 );
}
-void QBBScreen::onWindowPost(QBBWindow *window)
+void QQnxScreen::onWindowPost(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
Q_UNUSED(window)
diff --git a/src/plugins/platforms/blackberry/qbbscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h
index 16606944d8..5749a66f5d 100644
--- a/src/plugins/platforms/blackberry/qbbscreen.h
+++ b/src/plugins/platforms/qnx/qqnxscreen.h
@@ -44,7 +44,7 @@
#include <QtGui/QPlatformScreen>
-#include "qbbrootwindow.h"
+#include "qqnxrootwindow.h"
#include <QtCore/QByteArray>
#include <QtCore/QScopedPointer>
@@ -53,15 +53,15 @@
QT_BEGIN_NAMESPACE
-class QBBWindow;
+class QQnxWindow;
-class QBBScreen : public QPlatformScreen
+class QQnxScreen : public QPlatformScreen
{
public:
static QList<QPlatformScreen *> screens() { return ms_screens; }
static void createDisplays(screen_context_t context);
static void destroyDisplays();
- static QBBScreen *primaryDisplay() { return static_cast<QBBScreen*>(ms_screens.at(0)); }
+ static QQnxScreen *primaryDisplay() { return static_cast<QQnxScreen*>(ms_screens.at(0)); }
static int defaultDepth();
virtual QRect geometry() const { return m_currentGeometry; }
@@ -81,25 +81,25 @@ public:
const char *windowGroupName() const { return m_rootWindow->groupName().constData(); }
/* Window hierarchy management */
- static void addWindow(QBBWindow *child);
- static void removeWindow(QBBWindow *child);
- static void raiseWindow(QBBWindow *window);
- static void lowerWindow(QBBWindow *window);
+ static void addWindow(QQnxWindow *child);
+ static void removeWindow(QQnxWindow *child);
+ static void raiseWindow(QQnxWindow *window);
+ static void lowerWindow(QQnxWindow *window);
static void updateHierarchy();
- void onWindowPost(QBBWindow *window);
+ void onWindowPost(QQnxWindow *window);
- QSharedPointer<QBBRootWindow> rootWindow() const { return m_rootWindow; }
+ QSharedPointer<QQnxRootWindow> rootWindow() const { return m_rootWindow; }
private:
- QBBScreen(screen_context_t context, screen_display_t display, bool primaryScreen);
- virtual ~QBBScreen();
+ QQnxScreen(screen_context_t context, screen_display_t display, bool primaryScreen);
+ virtual ~QQnxScreen();
static bool orthogonal(int rotation1, int rotation2);
screen_context_t m_screenContext;
screen_display_t m_display;
- QSharedPointer<QBBRootWindow> m_rootWindow;
+ QSharedPointer<QQnxRootWindow> m_rootWindow;
bool m_primaryScreen;
bool m_posted;
bool m_usingOpenGL;
@@ -113,7 +113,7 @@ private:
QPlatformOpenGLContext *m_platformContext;
static QList<QPlatformScreen *> ms_screens;
- static QList<QBBWindow *> ms_childWindows;
+ static QList<QQnxWindow *> ms_childWindows;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.cpp
index 082ef9b19d..9d7fe92660 100644
--- a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qbbvirtualkeyboard.h"
-#include "qbbscreen.h"
+#include "qqnxvirtualkeyboard.h"
+#include "qqnxscreen.h"
#include <QtGui/QPlatformScreen>
#include <QtGui/QPlatformWindow>
@@ -57,15 +57,15 @@
#include <sys/types.h>
#include <unistd.h>
-const char *QBBVirtualKeyboard::ms_PPSPath = "/pps/services/input/control?wait";
-const size_t QBBVirtualKeyboard::ms_bufferSize = 2048;
+const char *QQnxVirtualKeyboard::ms_PPSPath = "/pps/services/input/control?wait";
+const size_t QQnxVirtualKeyboard::ms_bufferSize = 2048;
-static QBBVirtualKeyboard *s_instance = 0;
+static QQnxVirtualKeyboard *s_instance = 0;
// Huge hack for keyboard shadow (see QNX PR 88400). Should be removed ASAP.
#define KEYBOARD_SHADOW_HEIGHT 8
-QBBVirtualKeyboard::QBBVirtualKeyboard() :
+QQnxVirtualKeyboard::QQnxVirtualKeyboard() :
m_encoder(NULL),
m_decoder(NULL),
m_buffer(NULL),
@@ -78,16 +78,16 @@ QBBVirtualKeyboard::QBBVirtualKeyboard() :
connect();
}
-QBBVirtualKeyboard::~QBBVirtualKeyboard()
+QQnxVirtualKeyboard::~QQnxVirtualKeyboard()
{
close();
}
/* static */
-QBBVirtualKeyboard& QBBVirtualKeyboard::instance()
+QQnxVirtualKeyboard& QQnxVirtualKeyboard::instance()
{
if (!s_instance) {
- s_instance = new QBBVirtualKeyboard();
+ s_instance = new QQnxVirtualKeyboard();
s_instance->start();
}
@@ -95,7 +95,7 @@ QBBVirtualKeyboard& QBBVirtualKeyboard::instance()
}
/* static */
-void QBBVirtualKeyboard::destroy()
+void QQnxVirtualKeyboard::destroy()
{
if (s_instance) {
delete s_instance;
@@ -103,7 +103,7 @@ void QBBVirtualKeyboard::destroy()
}
}
-void QBBVirtualKeyboard::close()
+void QQnxVirtualKeyboard::close()
{
if (m_fd) {
// any reads will fail after we close the fd, which is basically what we want.
@@ -136,7 +136,7 @@ void QBBVirtualKeyboard::close()
m_buffer = NULL;
}
-bool QBBVirtualKeyboard::connect()
+bool QQnxVirtualKeyboard::connect()
{
close();
@@ -150,7 +150,7 @@ bool QBBVirtualKeyboard::connect()
m_fd = ::open(ms_PPSPath, O_RDWR);
if (m_fd == -1)
{
- qCritical("QBBVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
+ qCritical("QQnxVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
ms_PPSPath, strerror(errno), errno);
close();
return false;
@@ -158,7 +158,7 @@ bool QBBVirtualKeyboard::connect()
m_buffer = new char[ms_bufferSize];
if (!m_buffer) {
- qCritical("QBBVirtualKeyboard: Unable to allocate buffer of %d bytes. Size is unavailable.", ms_bufferSize);
+ qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. Size is unavailable.", ms_bufferSize);
return false;
}
@@ -170,7 +170,7 @@ bool QBBVirtualKeyboard::connect()
return true;
}
-bool QBBVirtualKeyboard::queryPPSInfo()
+bool QQnxVirtualKeyboard::queryPPSInfo()
{
// Request info, requires id to regenerate res message.
pps_encoder_add_string(m_encoder, "msg", "info");
@@ -186,44 +186,44 @@ bool QBBVirtualKeyboard::queryPPSInfo()
return true;
}
-void QBBVirtualKeyboard::notifyClientActiveStateChange(bool active)
+void QQnxVirtualKeyboard::notifyClientActiveStateChange(bool active)
{
if (!active)
hideKeyboard();
}
-void QBBVirtualKeyboard::run()
+void QQnxVirtualKeyboard::run()
{
ppsDataReady();
}
-void QBBVirtualKeyboard::ppsDataReady()
+void QQnxVirtualKeyboard::ppsDataReady()
{
while (1) {
ssize_t nread = read(m_fd, m_buffer, ms_bufferSize - 1);
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: keyboardMessage size: " << nread;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: keyboardMessage size: " << nread;
#endif
if (nread < 0)
break;
// nread is the real space necessary, not the amount read.
if (static_cast<size_t>(nread) > ms_bufferSize - 1) {
- qCritical("QBBVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);
+ qCritical("QQnxVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);
break;
}
m_buffer[nread] = 0;
pps_decoder_parse_pps_str(m_decoder, m_buffer);
pps_decoder_push(m_decoder, NULL);
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
pps_decoder_dump_tree(m_decoder, stderr);
#endif
const char *value;
if (pps_decoder_get_string(m_decoder, "error", &value) == PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS decoder error: %s", value ? value : "[null]");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS decoder error: %s", value ? value : "[null]");
continue;
}
@@ -244,48 +244,48 @@ void QBBVirtualKeyboard::ppsDataReady()
handleKeyboardInfoMessage();
else if (strcmp(value, "connect") == 0) { }
else
- qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]");
+ qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]");
} else if (pps_decoder_get_string(m_decoder, "res", &value) == PPS_DECODER_OK) {
if (strcmp(value, "info") == 0)
handleKeyboardInfoMessage();
else
- qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS res value: %s", value ? value : "[null]");
+ qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS res value: %s", value ? value : "[null]");
} else
- qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS message type");
+ qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS message type");
}
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: exiting keyboard thread";
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: exiting keyboard thread";
#endif
if (m_decoder)
pps_decoder_cleanup(m_decoder);
}
-void QBBVirtualKeyboard::handleKeyboardInfoMessage()
+void QQnxVirtualKeyboard::handleKeyboardInfoMessage()
{
int newHeight = 0;
const char *value;
if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS dat object not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found");
return;
}
if (pps_decoder_get_int(m_decoder, "size", &newHeight) != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS size field not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found");
return;
}
if (pps_decoder_push(m_decoder, "locale") != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS locale object not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS locale object not found");
return;
}
if (pps_decoder_get_string(m_decoder, "languageId", &value) != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS languageId field not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS languageId field not found");
return;
}
const QString languageId = QString::fromLatin1(value);
if (pps_decoder_get_string(m_decoder, "countryId", &value) != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS size countryId not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS size countryId not found");
return;
}
const QString countryId = QString::fromLatin1(value);
@@ -304,16 +304,16 @@ void QBBVirtualKeyboard::handleKeyboardInfoMessage()
emit localeChanged(locale);
}
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: handleKeyboardInfoMessage size=" << m_height << "locale=" << m_locale;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: handleKeyboardInfoMessage size=" << m_height << "locale=" << m_locale;
#endif
}
-void QBBVirtualKeyboard::handleKeyboardStateChangeMessage(bool visible)
+void QQnxVirtualKeyboard::handleKeyboardStateChangeMessage(bool visible)
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: handleKeyboardStateChangeMessage " << visible;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: handleKeyboardStateChangeMessage " << visible;
#endif
updateAvailableScreenGeometry();
@@ -323,23 +323,23 @@ void QBBVirtualKeyboard::handleKeyboardStateChangeMessage(bool visible)
hideKeyboard();
}
-void QBBVirtualKeyboard::updateAvailableScreenGeometry()
+void QQnxVirtualKeyboard::updateAvailableScreenGeometry()
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: updateAvailableScreenGeometry: keyboard visible=" << m_visible << ", keyboard height=" << m_height;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: updateAvailableScreenGeometry: keyboard visible=" << m_visible << ", keyboard height=" << m_height;
#endif
// TODO: What screen index should be used? I assume primaryScreen here because it works, and
// we do it for handleScreenGeometryChange elsewhere but since we have support
// for more than one screen, that's not going to always work.
- QBBScreen *platformScreen = QBBScreen::primaryDisplay();
+ QQnxScreen *platformScreen = QQnxScreen::primaryDisplay();
QWindowSystemInterface::handleScreenAvailableGeometryChange(platformScreen->screen(), platformScreen->availableGeometry());
}
-bool QBBVirtualKeyboard::showKeyboard()
+bool QQnxVirtualKeyboard::showKeyboard()
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: showKeyboard()";
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: showKeyboard()";
#endif
// Try to connect.
@@ -367,10 +367,10 @@ bool QBBVirtualKeyboard::showKeyboard()
return true;
}
-bool QBBVirtualKeyboard::hideKeyboard()
+bool QQnxVirtualKeyboard::hideKeyboard()
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: hideKeyboard()";
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: hideKeyboard()";
#endif
if (m_fd == -1 && !connect())
@@ -399,12 +399,12 @@ bool QBBVirtualKeyboard::hideKeyboard()
return true;
}
-void QBBVirtualKeyboard::setKeyboardMode(KeyboardMode mode)
+void QQnxVirtualKeyboard::setKeyboardMode(KeyboardMode mode)
{
m_keyboardMode = mode;
}
-void QBBVirtualKeyboard::applyKeyboardModeOptions()
+void QQnxVirtualKeyboard::applyKeyboardModeOptions()
{
// Try to connect.
if (m_fd == -1 && !connect())
@@ -451,49 +451,49 @@ void QBBVirtualKeyboard::applyKeyboardModeOptions()
pps_encoder_reset(m_encoder);
}
-void QBBVirtualKeyboard::addDefaultModeOptions()
+void QQnxVirtualKeyboard::addDefaultModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "default");
}
-void QBBVirtualKeyboard::addUrlModeOptions()
+void QQnxVirtualKeyboard::addUrlModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "url");
}
-void QBBVirtualKeyboard::addEmailModeOptions()
+void QQnxVirtualKeyboard::addEmailModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "email");
}
-void QBBVirtualKeyboard::addWebModeOptions()
+void QQnxVirtualKeyboard::addWebModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "web");
}
-void QBBVirtualKeyboard::addNumPuncModeOptions()
+void QQnxVirtualKeyboard::addNumPuncModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "numPunc");
}
-void QBBVirtualKeyboard::addPhoneModeOptions()
+void QQnxVirtualKeyboard::addPhoneModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "phone");
}
-void QBBVirtualKeyboard::addPinModeOptions()
+void QQnxVirtualKeyboard::addPinModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "pin");
}
-void QBBVirtualKeyboard::addSymbolModeOptions()
+void QQnxVirtualKeyboard::addSymbolModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "symbol");
diff --git a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.h b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.h
index 14003ee897..21b2e8736c 100644
--- a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.h
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.h
@@ -55,7 +55,7 @@
QT_BEGIN_NAMESPACE
/* Shamelessly copied from the browser - this should be rewritten once we have a proper PPS wrapper class */
-class QBBVirtualKeyboard : public QThread
+class QQnxVirtualKeyboard : public QThread
{
Q_OBJECT
public:
@@ -72,7 +72,7 @@ public:
//
enum KeyboardMode { Default, Url, Email, Web, NumPunc, Symbol, Phone, Pin };
- static QBBVirtualKeyboard& instance();
+ static QQnxVirtualKeyboard& instance();
static void destroy();
bool showKeyboard();
@@ -88,8 +88,8 @@ Q_SIGNALS:
void visibilityChanged(bool visible);
private:
- QBBVirtualKeyboard();
- virtual ~QBBVirtualKeyboard();
+ QQnxVirtualKeyboard();
+ virtual ~QQnxVirtualKeyboard();
// Will be called internally if needed.
bool connect();
diff --git a/src/plugins/platforms/blackberry/qbbwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index bc9f112b01..cf45d062bd 100644
--- a/src/plugins/platforms/blackberry/qbbwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qbbwindow.h"
-#include "qbbglcontext.h"
-#include "qbbintegration.h"
-#include "qbbscreen.h"
+#include "qqnxwindow.h"
+#include "qqnxglcontext.h"
+#include "qqnxintegration.h"
+#include "qqnxscreen.h"
#include <QtGui/QWindow>
#include <QtGui/QWindowSystemInterface>
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
-QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
+QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
: QPlatformWindow(window),
m_screenContext(context),
m_window(0),
@@ -64,7 +64,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
m_parentWindow(0),
m_visible(true)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window << ", size =" << window->size();
#endif
int result;
@@ -73,7 +73,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
errno = 0;
result = screen_create_window_type(&m_window, m_screenContext, SCREEN_CHILD_WINDOW);
if (result != 0) {
- qFatal("QBBWindow: failed to create window, errno=%d", errno);
+ qFatal("QQnxWindow: failed to create window, errno=%d", errno);
}
// Set window buffer usage based on rendering API
@@ -87,14 +87,14 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = SCREEN_USAGE_OPENGL_ES2;
break;
default:
- qFatal("QBBWindow: unsupported window API");
+ qFatal("QQnxWindow: unsupported window API");
break;
}
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_USAGE, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window buffer usage, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window buffer usage, errno=%d", errno);
}
// Alpha channel is always pre-multiplied if present
@@ -102,7 +102,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = SCREEN_PRE_MULTIPLIED_ALPHA;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ALPHA_MODE, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window alpha mode, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window alpha mode, errno=%d", errno);
}
// Make the window opaque
@@ -110,7 +110,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = SCREEN_TRANSPARENCY_NONE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_TRANSPARENCY, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window transparency, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window transparency, errno=%d", errno);
}
// Set the window swap interval
@@ -118,43 +118,43 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = 1;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SWAP_INTERVAL, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window swap interval, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window swap interval, errno=%d", errno);
}
// Assign the window to the primary display (this is the default specified by screen).
- setScreen(QBBScreen::primaryDisplay());
+ setScreen(QQnxScreen::primaryDisplay());
// Add the window to the root of the hierarchy
- QBBScreen::addWindow(this);
+ QQnxScreen::addWindow(this);
// Add window to plugin's window mapper
- QBBIntegration::addWindow(m_window, window);
+ QQnxIntegration::addWindow(m_window, window);
}
-QBBWindow::~QBBWindow()
+QQnxWindow::~QQnxWindow()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Remove from plugin's window mapper
- QBBIntegration::removeWindow(m_window);
+ QQnxIntegration::removeWindow(m_window);
// Remove from parent's Hierarchy.
removeFromParent();
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
// We shouldn't allow this case unless QT allows it. Does it? Or should we send the
// handleCloseEvent on all children when this window is deleted?
if (m_childWindows.size() > 0)
- qFatal("QBBWindow: window destroyed before children!");
+ qFatal("QQnxWindow: window destroyed before children!");
// Cleanup QNX window and its buffers
screen_destroy_window(m_window);
}
-void QBBWindow::setGeometry(const QRect &rect)
+void QQnxWindow::setGeometry(const QRect &rect)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << ", (" << rect.x() << "," << rect.y() << "," << rect.width() << "," << rect.height() << ")";
#endif
@@ -170,7 +170,7 @@ void QBBWindow::setGeometry(const QRect &rect)
val[1] = rect.y();
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_POSITION, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window position, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window position, errno=%d", errno);
}
errno = 0;
@@ -178,14 +178,14 @@ void QBBWindow::setGeometry(const QRect &rect)
val[1] = rect.height();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window size, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window size, errno=%d", errno);
}
// Set viewport size equal to window size
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window source size, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window source size, errno=%d", errno);
}
// Now move all children.
@@ -194,16 +194,16 @@ void QBBWindow::setGeometry(const QRect &rect)
offset = rect.topLeft();
offset -= oldGeometry.topLeft();
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
(*it)->offset(offset);
}
}
}
-void QBBWindow::offset(const QPoint &offset)
+void QQnxWindow::offset(const QPoint &offset)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Move self and then children.
@@ -220,24 +220,24 @@ void QBBWindow::offset(const QPoint &offset)
val[1] = newGeometry.y();
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_POSITION, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window position, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window position, errno=%d", errno);
}
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
(*it)->offset(offset);
}
}
-void QBBWindow::setVisible(bool visible)
+void QQnxWindow::setVisible(bool visible)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible;
#endif
m_visible = visible;
- QBBWindow *root = this;
+ QQnxWindow *root = this;
while (root->m_parentWindow)
root = root->m_parentWindow;
@@ -246,9 +246,9 @@ void QBBWindow::setVisible(bool visible)
window()->requestActivateWindow();
}
-void QBBWindow::updateVisibility(bool parentVisible)
+void QQnxWindow::updateVisibility(bool parentVisible)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "parentVisible =" << parentVisible << "window =" << window();
#endif
// Set window visibility
@@ -256,18 +256,18 @@ void QBBWindow::updateVisibility(bool parentVisible)
int val = (m_visible && parentVisible) ? 1 : 0;
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window visibility, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window visibility, errno=%d", errno);
}
- QList<QBBWindow *>::iterator it;
+ QList<QQnxWindow *>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
(*it)->updateVisibility(m_visible && parentVisible);
}
}
-void QBBWindow::setOpacity(qreal level)
+void QQnxWindow::setOpacity(qreal level)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "opacity =" << level;
#endif
// Set window global alpha
@@ -275,16 +275,16 @@ void QBBWindow::setOpacity(qreal level)
int val = (int)(level * 255);
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_GLOBAL_ALPHA, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window global alpha, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window global alpha, errno=%d", errno);
}
// TODO: How to handle children of this window? If we change all the visibilities, then
// the transparency will look wrong...
}
-void QBBWindow::setBufferSize(const QSize &size)
+void QQnxWindow::setBufferSize(const QSize &size)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "size =" << size;
#endif
// Set window buffer size
@@ -292,7 +292,7 @@ void QBBWindow::setBufferSize(const QSize &size)
int val[2] = { size.width(), size.height() };
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BUFFER_SIZE, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window buffer size, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window buffer size, errno=%d", errno);
}
// Create window buffers if they do not exist
@@ -308,13 +308,13 @@ void QBBWindow::setBufferSize(const QSize &size)
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_FORMAT, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window pixel format, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window pixel format, errno=%d", errno);
}
errno = 0;
result = screen_create_window_buffers(m_window, MAX_BUFFER_COUNT);
if (result != 0) {
- qFatal("QBBWindow: failed to create window buffers, errno=%d", errno);
+ qFatal("QQnxWindow: failed to create window buffers, errno=%d", errno);
}
}
@@ -327,9 +327,9 @@ void QBBWindow::setBufferSize(const QSize &size)
m_scrolled = QRegion();
}
-QBBBuffer &QBBWindow::renderBuffer()
+QQnxBuffer &QQnxWindow::renderBuffer()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Check if render buffer is invalid
@@ -339,12 +339,12 @@ QBBBuffer &QBBWindow::renderBuffer()
screen_buffer_t buffers[MAX_BUFFER_COUNT];
int result = screen_get_window_property_pv(m_window, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)buffers);
if (result != 0) {
- qFatal("QBBWindow: failed to query window buffers, errno=%d", errno);
+ qFatal("QQnxWindow: failed to query window buffers, errno=%d", errno);
}
// Wrap each buffer
for (int i = 0; i < MAX_BUFFER_COUNT; ++i) {
- m_buffers[i] = QBBBuffer(buffers[i]);
+ m_buffers[i] = QQnxBuffer(buffers[i]);
}
// Use the first available render buffer
@@ -355,23 +355,23 @@ QBBBuffer &QBBWindow::renderBuffer()
return m_buffers[m_currentBufferIndex];
}
-void QBBWindow::scroll(const QRegion &region, int dx, int dy, bool flush)
+void QQnxWindow::scroll(const QRegion &region, int dx, int dy, bool flush)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
copyBack(region, dx, dy, flush);
m_scrolled += region;
}
-void QBBWindow::post(const QRegion &dirty)
+void QQnxWindow::post(const QRegion &dirty)
{
// Check if render buffer exists and something was rendered
if (m_currentBufferIndex != -1 && !dirty.isEmpty()) {
-#if defined(QBBWINDOW_DEBUG)
- qDebug() << "QBBWindow::post - window =" << window();
+#if defined(QQNXWINDOW_DEBUG)
+ qDebug() << "QQnxWindow::post - window =" << window();
#endif
- QBBBuffer &currentBuffer = m_buffers[m_currentBufferIndex];
+ QQnxBuffer &currentBuffer = m_buffers[m_currentBufferIndex];
// Copy unmodified region from old render buffer to new render buffer;
// required to allow partial updates
@@ -387,7 +387,7 @@ void QBBWindow::post(const QRegion &dirty)
errno = 0;
int result = screen_post_window(m_window, currentBuffer.nativeBuffer(), 1, dirtyRect, 0);
if (result != 0) {
- qFatal("QBBWindow: failed to post window buffer, errno=%d", errno);
+ qFatal("QQnxWindow: failed to post window buffer, errno=%d", errno);
}
// Advance to next nender buffer
@@ -407,9 +407,9 @@ void QBBWindow::post(const QRegion &dirty)
}
}
-void QBBWindow::setScreen(QBBScreen *platformScreen)
+void QQnxWindow::setScreen(QQnxScreen *platformScreen)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "platformScreen =" << platformScreen;
#endif
@@ -423,17 +423,17 @@ void QBBWindow::setScreen(QBBScreen *platformScreen)
screen_display_t display = platformScreen->nativeDisplay();
int result = screen_set_window_property_pv(m_window, SCREEN_PROPERTY_DISPLAY, (void **)&display);
if (result != 0) {
- qFatal("QBBWindow: failed to set window display, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window display, errno=%d", errno);
}
// Add window to display's window group
errno = 0;
result = screen_join_window_group(m_window, platformScreen->windowGroupName());
if (result != 0) {
- qFatal("QBBWindow: failed to join window group, errno=%d", errno);
+ qFatal("QQnxWindow: failed to join window group, errno=%d", errno);
}
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
// Only subwindows and tooltips need necessarily be moved to another display with the window.
if ((window()->windowType() & Qt::WindowType_Mask) == Qt::SubWindow ||
@@ -441,12 +441,12 @@ void QBBWindow::setScreen(QBBScreen *platformScreen)
(*it)->setScreen(platformScreen);
}
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBWindow::removeFromParent()
+void QQnxWindow::removeFromParent()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Remove from old Hierarchy position
@@ -454,22 +454,22 @@ void QBBWindow::removeFromParent()
if (m_parentWindow->m_childWindows.removeAll(this))
m_parentWindow = 0;
else
- qFatal("QBBWindow: Window Hierarchy broken; window has parent, but parent hasn't got child.");
+ qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child.");
} else {
- QBBScreen::removeWindow(this);
+ QQnxScreen::removeWindow(this);
}
}
-void QBBWindow::setParent(const QPlatformWindow *window)
+void QQnxWindow::setParent(const QPlatformWindow *window)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << this->window() << "platformWindow =" << window;
#endif
// Cast away the const, we need to modify the hierarchy.
- QBBWindow *newParent = 0;
+ QQnxWindow *newParent = 0;
if (window)
- newParent = static_cast<QBBWindow*>((QPlatformWindow *)window);
+ newParent = static_cast<QQnxWindow*>((QPlatformWindow *)window);
if (newParent == m_parentWindow)
return;
@@ -484,49 +484,49 @@ void QBBWindow::setParent(const QPlatformWindow *window)
m_parentWindow->m_childWindows.push_back(this);
} else {
- QBBScreen::addWindow(this);
+ QQnxScreen::addWindow(this);
}
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBWindow::raise()
+void QQnxWindow::raise()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
- QBBWindow *oldParent = m_parentWindow;
+ QQnxWindow *oldParent = m_parentWindow;
if (oldParent) {
removeFromParent();
oldParent->m_childWindows.push_back(this);
} else {
- QBBScreen::raiseWindow(this);
+ QQnxScreen::raiseWindow(this);
}
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBWindow::lower()
+void QQnxWindow::lower()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
- QBBWindow *oldParent = m_parentWindow;
+ QQnxWindow *oldParent = m_parentWindow;
if (oldParent) {
removeFromParent();
oldParent->m_childWindows.push_front(this);
} else {
- QBBScreen::lowerWindow(this);
+ QQnxScreen::lowerWindow(this);
}
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBWindow::requestActivateWindow()
+void QQnxWindow::requestActivateWindow()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
@@ -536,9 +536,9 @@ void QBBWindow::requestActivateWindow()
gainedFocus();
}
-void QBBWindow::gainedFocus()
+void QQnxWindow::gainedFocus()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
@@ -546,31 +546,31 @@ void QBBWindow::gainedFocus()
QWindowSystemInterface::handleWindowActivated(window());
}
-void QBBWindow::setPlatformOpenGLContext(QBBGLContext *platformOpenGLContext)
+void QQnxWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext)
{
// This function does not take ownership of the platform gl context.
// It is owned by the frontend QOpenGLContext
m_platformOpenGLContext = platformOpenGLContext;
}
-void QBBWindow::updateZorder(int &topZorder)
+void QQnxWindow::updateZorder(int &topZorder)
{
errno = 0;
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ZORDER, &topZorder);
topZorder++;
if (result != 0)
- qFatal("QBBWindow: failed to set window z-order=%d, errno=%d, mWindow=%p", topZorder, errno, m_window);
+ qFatal("QQnxWindow: failed to set window z-order=%d, errno=%d, mWindow=%p", topZorder, errno, m_window);
- QList<QBBWindow*>::const_iterator it;
+ QList<QQnxWindow*>::const_iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++)
(*it)->updateZorder(topZorder);
}
-void QBBWindow::copyBack(const QRegion &region, int dx, int dy, bool flush)
+void QQnxWindow::copyBack(const QRegion &region, int dx, int dy, bool flush)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
int result;
@@ -585,8 +585,8 @@ void QBBWindow::copyBack(const QRegion &region, int dx, int dy, bool flush)
return;
}
- QBBBuffer &currentBuffer = m_buffers[m_currentBufferIndex];
- QBBBuffer &previousBuffer = m_buffers[m_previousBufferIndex];
+ QQnxBuffer &currentBuffer = m_buffers[m_currentBufferIndex];
+ QQnxBuffer &previousBuffer = m_buffers[m_previousBufferIndex];
// Break down region into non-overlapping rectangles
QVector<QRect> rects = region.rects();
@@ -612,7 +612,7 @@ void QBBWindow::copyBack(const QRegion &region, int dx, int dy, bool flush)
errno = 0;
result = screen_blit(m_screenContext, currentBuffer.nativeBuffer(), previousBuffer.nativeBuffer(), attribs);
if (result != 0) {
- qFatal("QBBWindow: failed to blit buffers, errno=%d", errno);
+ qFatal("QQnxWindow: failed to blit buffers, errno=%d", errno);
}
}
@@ -622,7 +622,7 @@ void QBBWindow::copyBack(const QRegion &region, int dx, int dy, bool flush)
errno = 0;
result = screen_flush_blits(m_screenContext, SCREEN_WAIT_IDLE);
if (result != 0) {
- qFatal("QBBWindow: failed to flush blits, errno=%d", errno);
+ qFatal("QQnxWindow: failed to flush blits, errno=%d", errno);
}
// Buffer was modified outside the CPU
@@ -630,25 +630,25 @@ void QBBWindow::copyBack(const QRegion &region, int dx, int dy, bool flush)
}
}
-int QBBWindow::platformWindowFormatToNativeFormat(const QSurfaceFormat &format)
+int QQnxWindow::platformWindowFormatToNativeFormat(const QSurfaceFormat &format)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Extract size of colour channels from window format
int redSize = format.redBufferSize();
if (redSize == -1) {
- qFatal("QBBWindow: red size not defined");
+ qFatal("QQnxWindow: red size not defined");
}
int greenSize = format.greenBufferSize();
if (greenSize == -1) {
- qFatal("QBBWindow: green size not defined");
+ qFatal("QQnxWindow: green size not defined");
}
int blueSize = format.blueBufferSize();
if (blueSize == -1) {
- qFatal("QBBWindow: blue size not defined");
+ qFatal("QQnxWindow: blue size not defined");
}
// select matching native format
@@ -657,7 +657,7 @@ int QBBWindow::platformWindowFormatToNativeFormat(const QSurfaceFormat &format)
} else if (redSize == 8 && greenSize == 8 && blueSize == 8) {
return SCREEN_FORMAT_RGBA8888;
} else {
- qFatal("QBBWindow: unsupported pixel format");
+ qFatal("QQnxWindow: unsupported pixel format");
return 0;
}
}
diff --git a/src/plugins/platforms/blackberry/qbbwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index ffdeba423a..9507b08ade 100644
--- a/src/plugins/platforms/blackberry/qbbwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#ifndef QBBWINDOW_H
-#define QBBWINDOW_H
+#ifndef QQNXWINDOW_H
+#define QQNXWINDOW_H
#include <QtGui/QPlatformWindow>
-#include "qbbbuffer.h"
+#include "qqnxbuffer.h"
#include <QtGui/QImage>
@@ -57,18 +57,18 @@ QT_BEGIN_NAMESPACE
// all surfaces double buffered
#define MAX_BUFFER_COUNT 2
-class QBBGLContext;
-class QBBScreen;
+class QQnxGLContext;
+class QQnxScreen;
class QPlatformGLContext;
class QSurfaceFormat;
-class QBBWindow : public QPlatformWindow
+class QQnxWindow : public QPlatformWindow
{
-friend class QBBScreen;
+friend class QQnxScreen;
public:
- QBBWindow(QWindow *window, screen_context_t context);
- virtual ~QBBWindow();
+ QQnxWindow(QWindow *window, screen_context_t context);
+ virtual ~QQnxWindow();
virtual void setGeometry(const QRect &rect);
virtual void setVisible(bool visible);
@@ -81,11 +81,11 @@ public:
QSize bufferSize() const { return m_bufferSize; }
bool hasBuffers() const { return !m_bufferSize.isEmpty(); }
- QBBBuffer &renderBuffer();
+ QQnxBuffer &renderBuffer();
void scroll(const QRegion &region, int dx, int dy, bool flush=false);
void post(const QRegion &dirty);
- void setScreen(QBBScreen *platformScreen);
+ void setScreen(QQnxScreen *platformScreen);
virtual void setParent(const QPlatformWindow *window);
virtual void raise();
@@ -94,11 +94,11 @@ public:
void gainedFocus();
- QBBScreen *screen() const { return m_screen; }
- const QList<QBBWindow*>& children() const { return m_childWindows; }
+ QQnxScreen *screen() const { return m_screen; }
+ const QList<QQnxWindow*>& children() const { return m_childWindows; }
- void setPlatformOpenGLContext(QBBGLContext *platformOpenGLContext);
- QBBGLContext *platformOpenGLContext() const { return m_platformOpenGLContext; }
+ void setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext);
+ QQnxGLContext *platformOpenGLContext() const { return m_platformOpenGLContext; }
private:
void removeFromParent();
@@ -115,19 +115,19 @@ private:
screen_context_t m_screenContext;
screen_window_t m_window;
QSize m_bufferSize;
- QBBBuffer m_buffers[MAX_BUFFER_COUNT];
+ QQnxBuffer m_buffers[MAX_BUFFER_COUNT];
int m_currentBufferIndex;
int m_previousBufferIndex;
QRegion m_previousDirty;
QRegion m_scrolled;
- QBBGLContext *m_platformOpenGLContext;
- QBBScreen *m_screen;
- QList<QBBWindow*> m_childWindows;
- QBBWindow *m_parentWindow;
+ QQnxGLContext *m_platformOpenGLContext;
+ QQnxScreen *m_screen;
+ QList<QQnxWindow*> m_childWindows;
+ QQnxWindow *m_parentWindow;
bool m_visible;
};
QT_END_NAMESPACE
-#endif // QBBWINDOW_H
+#endif // QQNXWINDOW_H
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index b43362c045..3c2ece58d0 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -56,6 +56,7 @@
#include "qwindowsdrag.h"
#include "qwindowsinputcontext.h"
#include "qwindowsaccessibility.h"
+#include "qwindowskeymapper.h"
#include <QtGui/QPlatformNativeInterface>
#include <QtGui/QWindowSystemInterface>
@@ -84,12 +85,17 @@ QT_BEGIN_NAMESPACE
class QWindowsNativeInterface : public QPlatformNativeInterface
{
+ Q_OBJECT
public:
virtual void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window);
virtual void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *bs);
virtual EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter)
{ return QWindowsContext::instance()->setEventFilter(eventType, filter); }
+
+ Q_INVOKABLE void *createMessageWindow(const QString &classNameTemplate,
+ const QString &windowName,
+ void *eventProc) const;
};
void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
@@ -141,6 +147,21 @@ void *QWindowsNativeInterface::nativeResourceForContext(const QByteArray &resour
}
/*!
+ \brief Creates a non-visible window handle for filtering messages.
+*/
+
+void *QWindowsNativeInterface::createMessageWindow(const QString &classNameTemplate,
+ const QString &windowName,
+ void *eventProc) const
+{
+ QWindowsContext *ctx = QWindowsContext::instance();
+ const HWND hwnd = ctx->createDummyWindow(classNameTemplate,
+ (wchar_t*)windowName.utf16(),
+ (WNDPROC)eventProc);
+ return hwnd;
+}
+
+/*!
\class QWindowsIntegration
\brief QPlatformIntegration implementation for Windows.
\ingroup qt-lighthouse-win
@@ -301,6 +322,11 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
return QPlatformIntegration::styleHint(hint);
}
+Qt::KeyboardModifiers QWindowsIntegration::queryKeyboardModifiers() const
+{
+ return QWindowsKeyMapper::queryKeyboardModifiers();
+}
+
QPlatformNativeInterface *QWindowsIntegration::nativeInterface() const
{
return &d->m_nativeInterface;
@@ -347,3 +373,5 @@ QPlatformServices *QWindowsIntegration::services() const
}
QT_END_NAMESPACE
+
+#include "qwindowsintegration.moc"
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index ba5fafbbb5..6dd65a02e4 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -73,6 +73,8 @@ public:
QPlatformServices *services() const;
virtual QVariant styleHint(StyleHint hint) const;
+ virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
+
static QWindowsIntegration *instance();
inline void emitScreenAdded(QPlatformScreen *s) { screenAdded(s); }
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 7b96603c44..4b5e95824a 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -1072,4 +1072,16 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
return result;
}
+Qt::KeyboardModifiers QWindowsKeyMapper::queryKeyboardModifiers()
+{
+ Qt::KeyboardModifiers modifiers = Qt::NoModifier;
+ if (GetKeyState(VK_SHIFT) < 0)
+ modifiers |= Qt::ShiftModifier;
+ if (GetKeyState(VK_CONTROL) < 0)
+ modifiers |= Qt::ControlModifier;
+ if (GetKeyState(VK_MENU) < 0)
+ modifiers |= Qt::AltModifier;
+ return modifiers;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.h b/src/plugins/platforms/windows/qwindowskeymapper.h
index 483ff57942..b549422966 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.h
+++ b/src/plugins/platforms/windows/qwindowskeymapper.h
@@ -69,6 +69,8 @@ public:
QWindow *keyGrabber() const { return m_keyGrabber; }
void setKeyGrabber(QWindow *w) { m_keyGrabber = w; }
+ static Qt::KeyboardModifiers queryKeyboardModifiers();
+
private:
bool translateKeyEventInternal(QWindow *receiver, const MSG &msg, bool grab);
void updateKeyMap(const MSG &msg);
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 1edb243f4e..fa3661db22 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -441,17 +441,17 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange) const
{
if (desktop || !hwnd)
return;
- UINT flags = SWP_NOMOVE | SWP_NOSIZE;
+ UINT swpFlags = SWP_NOMOVE | SWP_NOSIZE;
if (frameChange)
- flags |= SWP_FRAMECHANGED;
+ swpFlags |= SWP_FRAMECHANGED;
if (topLevel) {
- flags |= SWP_NOACTIVATE;
+ swpFlags |= SWP_NOACTIVATE;
if ((flags & Qt::WindowStaysOnTopHint) || (type == Qt::ToolTip)) {
- SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, flags);
+ SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, swpFlags);
if (flags & Qt::WindowStaysOnBottomHint)
qWarning() << "QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time";
} else if (flags & Qt::WindowStaysOnBottomHint) {
- SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, flags);
+ SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, swpFlags);
}
if (flags & (Qt::CustomizeWindowHint|Qt::WindowTitleHint)) {
HMENU systemMenu = GetSystemMenu(hwnd, FALSE);
@@ -461,7 +461,7 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange) const
EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED);
}
} else { // child.
- SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, flags);
+ SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, swpFlags);
}
}
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 367b24da9d..76979bf05f 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -235,16 +235,24 @@ QXcbWindow *QXcbConnection::platformWindowFromId(xcb_window_t id)
#define HANDLE_PLATFORM_WINDOW_EVENT(event_t, windowMember, handler) \
{ \
event_t *e = (event_t *)event; \
- if (QXcbWindow *platformWindow = platformWindowFromId(e->windowMember)) \
- platformWindow->handler(e); \
+ if (QXcbWindow *platformWindow = platformWindowFromId(e->windowMember)) { \
+ long result = 0; \
+ handled = QWindowSystemInterface::handleNativeEvent(platformWindow->window(), m_nativeInterface->genericEventFilterType(), event, &result); \
+ if (!handled) \
+ platformWindow->handler(e); \
+ } \
} \
break;
#define HANDLE_KEYBOARD_EVENT(event_t, handler) \
{ \
event_t *e = (event_t *)event; \
- if (QXcbWindow *platformWindow = platformWindowFromId(e->event)) \
- m_keyboard->handler(platformWindow, e); \
+ if (QXcbWindow *platformWindow = platformWindowFromId(e->event)) { \
+ long result = 0; \
+ handled = QWindowSystemInterface::handleNativeEvent(platformWindow->window(), m_nativeInterface->genericEventFilterType(), event, &result); \
+ if (!handled) \
+ m_keyboard->handler(platformWindow, e); \
+ } \
} \
break;
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 03156dc544..c5e124ab45 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -247,24 +247,6 @@
// end of XF86keysyms.h
-// Special keys used by Qtopia, mapped into the X11 private keypad range.
-#define QTOPIAXK_Select 0x11000601
-#define QTOPIAXK_Yes 0x11000602
-#define QTOPIAXK_No 0x11000603
-#define QTOPIAXK_Cancel 0x11000604
-#define QTOPIAXK_Printer 0x11000605
-#define QTOPIAXK_Execute 0x11000606
-#define QTOPIAXK_Sleep 0x11000607
-#define QTOPIAXK_Play 0x11000608
-#define QTOPIAXK_Zoom 0x11000609
-#define QTOPIAXK_Context1 0x1100060A
-#define QTOPIAXK_Context2 0x1100060B
-#define QTOPIAXK_Context3 0x1100060C
-#define QTOPIAXK_Context4 0x1100060D
-#define QTOPIAXK_Call 0x1100060E
-#define QTOPIAXK_Hangup 0x1100060F
-#define QTOPIAXK_Flip 0x11000610
-
QT_BEGIN_NAMESPACE
// keyboard mapping table
@@ -573,24 +555,6 @@ static const unsigned int KeyTbl[] = {
XF86XK_LaunchE, Qt::Key_LaunchG,
XF86XK_LaunchF, Qt::Key_LaunchH,
- // Qtopia keys
- QTOPIAXK_Select, Qt::Key_Select,
- QTOPIAXK_Yes, Qt::Key_Yes,
- QTOPIAXK_No, Qt::Key_No,
- QTOPIAXK_Cancel, Qt::Key_Cancel,
- QTOPIAXK_Printer, Qt::Key_Printer,
- QTOPIAXK_Execute, Qt::Key_Execute,
- QTOPIAXK_Sleep, Qt::Key_Sleep,
- QTOPIAXK_Play, Qt::Key_Play,
- QTOPIAXK_Zoom, Qt::Key_Zoom,
- QTOPIAXK_Context1, Qt::Key_Context1,
- QTOPIAXK_Context2, Qt::Key_Context2,
- QTOPIAXK_Context3, Qt::Key_Context3,
- QTOPIAXK_Context4, Qt::Key_Context4,
- QTOPIAXK_Call, Qt::Key_Call,
- QTOPIAXK_Hangup, Qt::Key_Hangup,
- QTOPIAXK_Flip, Qt::Key_Flip,
-
0, 0
};
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index f56072f9d7..fc320ee69c 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -76,7 +76,9 @@ public:
Q_GLOBAL_STATIC(QXcbResourceMap, qXcbResourceMap)
-QXcbNativeInterface::QXcbNativeInterface()
+QXcbNativeInterface::QXcbNativeInterface() :
+ m_genericEventFilterType(QByteArrayLiteral("xcb_generic_event_t"))
+
{
qFill(m_eventFilters, m_eventFilters + EventFilterCount, EventFilter(0));
}
@@ -134,7 +136,7 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr
QPlatformNativeInterface::EventFilter QXcbNativeInterface::setEventFilter(const QByteArray &eventType, QPlatformNativeInterface::EventFilter filter)
{
int type = -1;
- if (eventType == QByteArrayLiteral("xcb_generic_event_t"))
+ if (eventType == m_genericEventFilterType)
type = GenericEventFilter;
if (type == -1) {
qWarning("QXcbNativeInterface: %s: Attempt to set invalid event filter type '%s'.",
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 6f6130d3e9..c6835ff9e0 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -71,6 +71,7 @@ public:
void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context);
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window);
+ inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; }
EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter);
EventFilter eventFilter(EventFilterType type) const { return m_eventFilters[type]; }
@@ -83,6 +84,7 @@ public:
void *eglContextForContext(QOpenGLContext *context);
private:
+ const QByteArray m_genericEventFilterType;
EventFilter m_eventFilters[EventFilterCount];
static QXcbScreen *qPlatformScreenForWindow(QWindow *window);
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 542d7ab69f..055defde08 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -143,6 +143,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
, m_syncCounter(0)
, m_mapped(false)
, m_transparent(false)
+ , m_deferredActivation(false)
, m_netWmUserTimeWindow(XCB_NONE)
#if defined(XCB_USE_EGL)
, m_eglSurface(0)
@@ -1178,8 +1179,11 @@ void QXcbWindow::propagateSizeHints()
void QXcbWindow::requestActivateWindow()
{
- if (!m_mapped)
+ if (!m_mapped) {
+ m_deferredActivation = true;
return;
+ }
+ m_deferredActivation = false;
updateNetWmUserTime(connection()->time());
@@ -1334,6 +1338,8 @@ void QXcbWindow::handleMapNotifyEvent(const xcb_map_notify_event_t *event)
{
if (event->window == m_window) {
m_mapped = true;
+ if (m_deferredActivation)
+ requestActivateWindow();
QWindowSystemInterface::handleMapEvent(window());
}
}
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 6ae55e77e6..c212095e98 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -154,6 +154,7 @@ private:
bool m_mapped;
bool m_transparent;
+ bool m_deferredActivation;
xcb_window_t m_netWmUserTimeWindow;
QSurfaceFormat m_format;
diff --git a/src/plugins/platforms/xlib/main.cpp b/src/plugins/platforms/xlib/main.cpp
index 6030a72236..95c4d9e4d8 100644
--- a/src/plugins/platforms/xlib/main.cpp
+++ b/src/plugins/platforms/xlib/main.cpp
@@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE
class QXlibIntegrationPlugin : public QPlatformIntegrationPlugin
{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "xlib.json")
public:
QStringList keys() const;
QPlatformIntegration *create(const QString&, const QStringList&);
@@ -67,6 +69,6 @@ QPlatformIntegration* QXlibIntegrationPlugin::create(const QString& system, cons
return 0;
}
-Q_EXPORT_PLUGIN2(xlib, QXlibIntegrationPlugin)
-
QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/platforms/xlib/qxlibkeyboard.cpp b/src/plugins/platforms/xlib/qxlibkeyboard.cpp
index e2742c4c8d..590d582661 100644
--- a/src/plugins/platforms/xlib/qxlibkeyboard.cpp
+++ b/src/plugins/platforms/xlib/qxlibkeyboard.cpp
@@ -243,24 +243,6 @@
// end of XF86keysyms.h
-// Special keys used by Qtopia, mapped into the X11 private keypad range.
-#define QTOPIAXK_Select 0x11000601
-#define QTOPIAXK_Yes 0x11000602
-#define QTOPIAXK_No 0x11000603
-#define QTOPIAXK_Cancel 0x11000604
-#define QTOPIAXK_Printer 0x11000605
-#define QTOPIAXK_Execute 0x11000606
-#define QTOPIAXK_Sleep 0x11000607
-#define QTOPIAXK_Play 0x11000608
-#define QTOPIAXK_Zoom 0x11000609
-#define QTOPIAXK_Context1 0x1100060A
-#define QTOPIAXK_Context2 0x1100060B
-#define QTOPIAXK_Context3 0x1100060C
-#define QTOPIAXK_Context4 0x1100060D
-#define QTOPIAXK_Call 0x1100060E
-#define QTOPIAXK_Hangup 0x1100060F
-#define QTOPIAXK_Flip 0x11000610
-
// keyboard mapping table
static const unsigned int KeyTbl[] = {
@@ -567,24 +549,6 @@ static const unsigned int KeyTbl[] = {
XF86XK_LaunchE, Qt::Key_LaunchG,
XF86XK_LaunchF, Qt::Key_LaunchH,
- // Qtopia keys
- QTOPIAXK_Select, Qt::Key_Select,
- QTOPIAXK_Yes, Qt::Key_Yes,
- QTOPIAXK_No, Qt::Key_No,
- QTOPIAXK_Cancel, Qt::Key_Cancel,
- QTOPIAXK_Printer, Qt::Key_Printer,
- QTOPIAXK_Execute, Qt::Key_Execute,
- QTOPIAXK_Sleep, Qt::Key_Sleep,
- QTOPIAXK_Play, Qt::Key_Play,
- QTOPIAXK_Zoom, Qt::Key_Zoom,
- QTOPIAXK_Context1, Qt::Key_Context1,
- QTOPIAXK_Context2, Qt::Key_Context2,
- QTOPIAXK_Context3, Qt::Key_Context3,
- QTOPIAXK_Context4, Qt::Key_Context4,
- QTOPIAXK_Call, Qt::Key_Call,
- QTOPIAXK_Hangup, Qt::Key_Hangup,
- QTOPIAXK_Flip, Qt::Key_Flip,
-
0, 0
};
diff --git a/src/plugins/platforms/xlib/xlib.json b/src/plugins/platforms/xlib/xlib.json
new file mode 100644
index 0000000000..524be2fc6d
--- /dev/null
+++ b/src/plugins/platforms/xlib/xlib.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "xlib" ]
+}
diff --git a/src/plugins/platforms/xlib/xlib.pro b/src/plugins/platforms/xlib/xlib.pro
index ea95ae83a1..463130a64b 100644
--- a/src/plugins/platforms/xlib/xlib.pro
+++ b/src/plugins/platforms/xlib/xlib.pro
@@ -32,6 +32,8 @@ HEADERS = \
qxlibdisplay.h \
qxlibnativeinterface.h
+OTHER_FILES += xlib.json
+
LIBS += -lX11 -lXext
mac {
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index 975640e6ee..8b8402f4fb 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -117,11 +117,6 @@ public:
QPrinter *printer();
#endif
-#ifdef QTOPIA_PRINTDIALOG
-public:
- bool eventFilter(QObject *, QEvent *);
-#endif
-
#ifdef Q_NO_USING_KEYWORD
#ifndef Q_QDOC
void accepted() { QDialog::accepted(); }
@@ -134,7 +129,6 @@ Q_SIGNALS:
void accepted(QPrinter *printer);
private:
-#ifndef QTOPIA_PRINTDIALOG
Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool))
#if defined (Q_OS_UNIX)
Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog())
@@ -142,19 +136,6 @@ private:
# if defined(Q_OS_UNIX) && !defined(QT_NO_MESSAGEBOX)
Q_PRIVATE_SLOT(d_func(), void _q_checkFields())
# endif
-#else // QTOPIA_PRINTDIALOG
- Q_PRIVATE_SLOT(d_func(), void _q_okClicked())
- Q_PRIVATE_SLOT(d_func(),void _q_printerOrFileSelected(QAbstractButton *b))
- Q_PRIVATE_SLOT(d_func(),void _q_paperSizeSelected(int))
- Q_PRIVATE_SLOT(d_func(), void _q_orientSelected(int))
- Q_PRIVATE_SLOT(d_func(), void _q_pageOrderSelected(int))
- Q_PRIVATE_SLOT(d_func(), void _q_colorModeSelected(QAbstractButton *))
- Q_PRIVATE_SLOT(d_func(), void _q_setNumCopies(int))
- Q_PRIVATE_SLOT(d_func(), void _q_printRangeSelected(int))
- Q_PRIVATE_SLOT(d_func(), void _q_setFirstPage(int))
- Q_PRIVATE_SLOT(d_func(), void _q_setLastPage(int))
- Q_PRIVATE_SLOT(d_func(), void _q_fileNameEditChanged(const QString &text))
-#endif // QTOPIA_PRINTDIALOG
friend class QUnixPrintWidget;
};
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index f56d34975d..85dc59ff34 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -58,8 +58,6 @@
#if defined (Q_WS_WIN)
#include <private/qprintengine_win_p.h>
-#elif defined (QTOPIA_PRINTENGINE)
-#include <private/qprintengine_qws_p.h>
#endif
#if defined(Q_WS_X11)
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index d39df1d710..5fed167070 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -1163,7 +1163,7 @@ int QSqlTableModel::rowCount(const QModelIndex &parent) const
QModelIndex QSqlTableModel::indexInQuery(const QModelIndex &item) const
{
Q_D(const QSqlTableModel);
- if (d->cache.value(item.row()).op() == QSqlTableModelPrivate::Insert)
+ if (d->cache.value(item.row()).insert())
return QModelIndex();
const int rowOffset = d->insertCount(item.row());
diff --git a/src/src.pro b/src/src.pro
index 941064eb59..21916b31f4 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -16,35 +16,35 @@ contains(QT_CONFIG, no-gui): SRC_SUBDIRS -= src_gui
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): SRC_SUBDIRS += src_opengl
SRC_SUBDIRS += src_plugins
-src_winmain.subdir = $$QT_SOURCE_TREE/src/winmain
+src_winmain.subdir = $$PWD/winmain
src_winmain.target = sub-winmain
-src_corelib.subdir = $$QT_SOURCE_TREE/src/corelib
+src_corelib.subdir = $$PWD/corelib
src_corelib.target = sub-corelib
-src_xml.subdir = $$QT_SOURCE_TREE/src/xml
+src_xml.subdir = $$PWD/xml
src_xml.target = sub-xml
-src_dbus.subdir = $$QT_SOURCE_TREE/src/dbus
+src_dbus.subdir = $$PWD/dbus
src_dbus.target = sub-dbus
-src_gui.subdir = $$QT_SOURCE_TREE/src/gui
+src_gui.subdir = $$PWD/gui
src_gui.target = sub-gui
-src_sql.subdir = $$QT_SOURCE_TREE/src/sql
+src_sql.subdir = $$PWD/sql
src_sql.target = sub-sql
-src_network.subdir = $$QT_SOURCE_TREE/src/network
+src_network.subdir = $$PWD/network
src_network.target = sub-network
-src_opengl.subdir = $$QT_SOURCE_TREE/src/opengl
+src_opengl.subdir = $$PWD/opengl
src_opengl.target = sub-opengl
-src_plugins.subdir = $$QT_SOURCE_TREE/src/plugins
+src_plugins.subdir = $$PWD/plugins
src_plugins.target = sub-plugins
-src_widgets.subdir = $$QT_SOURCE_TREE/src/widgets
+src_widgets.subdir = $$PWD/widgets
src_widgets.target = sub-widgets
!wince*: {
- src_printsupport.subdir = $$QT_SOURCE_TREE/src/printsupport
+ src_printsupport.subdir = $$PWD/printsupport
src_printsupport.target = sub-printsupport
}
-src_testlib.subdir = $$QT_SOURCE_TREE/src/testlib
+src_testlib.subdir = $$PWD/testlib
src_testlib.target = sub-testlib
-src_platformsupport.subdir = $$QT_SOURCE_TREE/src/platformsupport
+src_platformsupport.subdir = $$PWD/platformsupport
src_platformsupport.target = sub-platformsupport
-src_concurrent.subdir = $$QT_SOURCE_TREE/src/concurrent
+src_concurrent.subdir = $$PWD/concurrent
src_concurrent.target = sub-concurrent
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 32b2f0ca9c..d167324aef 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -197,20 +197,20 @@ inline bool qCompare(QStringList const &t1, QStringList const &t2,
const int expectedSize = t2.count();
if (actualSize != expectedSize) {
qsnprintf(msg, sizeof(msg), "Compared QStringLists have different sizes.\n"
- " Actual (%s) size : '%d'\n"
+ " Actual (%s) size: '%d'\n"
" Expected (%s) size: '%d'", actual, actualSize, expected, expectedSize);
isOk = false;
}
for (int i = 0; isOk && i < actualSize; ++i) {
if (t1.at(i) != t2.at(i)) {
qsnprintf(msg, sizeof(msg), "Compared QStringLists differ at index %d.\n"
- " Actual (%s) : '%s'\n"
- " Expected (%s) : '%s'", i, actual, t1.at(i).toLatin1().constData(),
+ " Actual (%s): '%s'\n"
+ " Expected (%s): '%s'", i, actual, t1.at(i).toLatin1().constData(),
expected, t2.at(i).toLatin1().constData());
isOk = false;
}
}
- return compare_helper(isOk, msg, file, line);
+ return compare_helper(isOk, msg, 0, 0, actual, expected, file, line);
}
template <typename T>
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index d39e943926..f10ddd8473 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -100,31 +100,29 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
const bool t2Null = t2.isNull();
if (t1Null != t2Null) {
qsnprintf(msg, 1024, "Compared QImages differ.\n"
- " Actual (%s).isNull() : %d\n"
+ " Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, file, line);
+ return compare_helper(false, msg, 0, 0, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, "COMPARE()", file, line);
+ return compare_helper(true, 0, 0, 0, actual, expected, file, line);
if (t1.width() != t2.width() || t2.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QImages differ in size.\n"
- " Actual (%s) : %dx%d\n"
+ " Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, file, line);
+ return compare_helper(false, msg, 0, 0, actual, expected, file, line);
}
if (t1.format() != t2.format()) {
qsnprintf(msg, 1024, "Compared QImages differ in format.\n"
- " Actual (%s) : %d\n"
+ " Actual (%s): %d\n"
" Expected (%s): %d",
actual, t1.format(), expected, t2.format());
- return compare_helper(false, msg, file, line);
+ return compare_helper(false, msg, 0, 0, actual, expected, file, line);
}
- return (t1 == t2)
- ? compare_helper(true, "COMPARE()", file, line)
- : compare_helper(false, "Compared values are not the same",
- toString(t1), toString(t2), actual, expected, file, line);
+ return compare_helper(t1 == t2, "Compared values are not the same",
+ toString(t1), toString(t2), actual, expected, file, line);
}
#ifndef QTEST_NO_SPECIALIZATIONS
@@ -139,19 +137,19 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c
const bool t2Null = t2.isNull();
if (t1Null != t2Null) {
qsnprintf(msg, 1024, "Compared QPixmaps differ.\n"
- " Actual (%s).isNull() : %d\n"
+ " Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, file, line);
+ return compare_helper(false, msg, 0, 0, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, "COMPARE()", file, line);
+ return compare_helper(true, 0, 0, 0, actual, expected, file, line);
if (t1.width() != t2.width() || t2.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n"
- " Actual (%s) : %dx%d\n"
+ " Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, file, line);
+ return compare_helper(false, msg, 0, 0, actual, expected, file, line);
}
return qCompare(t1.toImage(), t2.toImage(), actual, expected, file, line);
}
diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h
index d402cc8cf8..f9b1b97ac6 100644
--- a/src/testlib/qtestaccessible.h
+++ b/src/testlib/qtestaccessible.h
@@ -49,8 +49,8 @@
#ifndef QT_NO_ACCESSIBILITY
-#define QVERIFY_EVENT(object, child, event) \
- QVERIFY(QTestAccessibility::verifyEvent(object, child, (int)event))
+#define QVERIFY_EVENT(event) \
+ QVERIFY(QTestAccessibility::verifyEvent(event))
#include <QtCore/qlist.h>
#include <QtGui/qaccessible.h>
@@ -63,22 +63,21 @@ QT_BEGIN_NAMESPACE
class QObject;
-struct QTestAccessibilityEvent
-{
- QTestAccessibilityEvent(QObject* o = 0, int c = 0, int e = 0)
- : object(o), child(c), event(e) {}
+typedef QList<QAccessibleEvent> EventList;
- bool operator==(const QTestAccessibilityEvent &o) const
- {
- return o.object == object && o.child == child && o.event == event;
+bool operator==(const QAccessibleEvent &l, const QAccessibleEvent &r)
+{
+ if (l.type() != r.type() ||
+ l.object() != r.object() ||
+ l.child() != r.child())
+ return false;
+
+ if (l.type() == QAccessible::StateChanged) {
+ return static_cast<const QAccessibleStateChangeEvent*>(&l)->changedStates()
+ == static_cast<const QAccessibleStateChangeEvent*>(&r)->changedStates();
}
-
- QObject* object;
- int child;
- int event;
-};
-
-typedef QList<QTestAccessibilityEvent> EventList;
+ return true;
+}
class QTestAccessibility
{
@@ -90,6 +89,7 @@ public:
qAddPostRoutine(cleanup);
}
}
+
static void cleanup()
{
delete instance();
@@ -97,18 +97,13 @@ public:
}
static void clearEvents() { eventList().clear(); }
static EventList events() { return eventList(); }
- static bool verifyEvent(const QTestAccessibilityEvent& ev)
+ static bool verifyEvent(const QAccessibleEvent& ev)
{
if (eventList().isEmpty())
return FALSE;
return eventList().takeFirst() == ev;
}
- static bool verifyEvent(QObject *o, int c, int e)
- {
- return verifyEvent(QTestAccessibilityEvent(o, c, e));
- }
-
private:
QTestAccessibility()
{
@@ -136,8 +131,15 @@ private:
static void updateHandler(const QAccessibleEvent &event)
{
- // qDebug("updateHandler called: %p %d %d", o, c, (int)e);
- eventList().append(QTestAccessibilityEvent(event.object(), event.child(), (int)event.type()));
+ eventList().append(copyEvent(event));
+ }
+
+ static QAccessibleEvent copyEvent(const QAccessibleEvent &event)
+ {
+ if (event.type() == QAccessible::StateChanged)
+ return QAccessibleStateChangeEvent(static_cast<const QAccessibleStateChangeEvent*>(&event)->changedStates(),
+ event.object(), event.child());
+ return QAccessibleEvent(event.type(), event.object(), event.child());
}
static EventList &eventList()
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index c1d19b8098..fb9a8e630c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -410,6 +410,12 @@ QT_BEGIN_NAMESPACE
point to the working directory from which the compiler is invoked, or only
absolute paths to the source files are passed to the compiler. Otherwise, the
absolute path of the source directory cannot be determined.
+
+ \bold {Note:} For tests that use the \l QTEST_APPLESS_MAIN() macro to generate a
+ \c{main()} function, \c{QFINDTESTDATA} will not attempt to find test data
+ relative to QCoreApplication::applicationDirPath(). In practice, this means that
+ tests using \c{QTEST_APPLESS_MAIN()} will fail to find their test data
+ if run from a shadow build tree.
*/
/*! \macro QTEST_MAIN(TestClass)
@@ -2407,15 +2413,34 @@ QObject *QTest::testObject()
*/
bool QTest::compare_helper(bool success, const char *msg, const char *file, int line)
{
+ static bool warned = false;
+ if (!warned) {
+ warned = true;
+ QTest::qWarn("QTest::compare_helper(bool, const char *, const char *, int) is obsolete "
+ "and will soon be removed. Please update your code to use the other "
+ "version of this function.");
+ }
+
return QTestResult::compare(success, msg, file, line);
}
/*! \internal
+ This function is called by various specializations of QTest::qCompare
+ to decide whether to report a failure and to produce verbose test output.
+
+ The failureMsg parameter can be null, in which case a default message
+ will be output if the compare fails. If the compare succeeds, failureMsg
+ will not be output.
+
+ If the caller has already passed a failure message showing the compared
+ values, or if those values cannot be stringified, val1 and val2 can be null.
*/
-bool QTest::compare_helper(bool success, const char *msg, char *val1, char *val2,
- const char *actual, const char *expected, const char *file, int line)
+bool QTest::compare_helper(bool success, const char *failureMsg,
+ char *val1, char *val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
{
- return QTestResult::compare(success, msg, val1, val2, actual, expected, file, line);
+ return QTestResult::compare(success, failureMsg, val1, val2, actual, expected, file, line);
}
/*! \fn bool QTest::qCompare<float>(float const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line)
@@ -2425,10 +2450,8 @@ template <>
Q_TESTLIB_EXPORT bool QTest::qCompare<float>(float const &t1, float const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- return qFuzzyCompare(t1, t2)
- ? compare_helper(true, "COMPARE()", file, line)
- : compare_helper(false, "Compared floats are not the same (fuzzy compare)",
- toString(t1), toString(t2), actual, expected, file, line);
+ return compare_helper(qFuzzyCompare(t1, t2), "Compared floats are not the same (fuzzy compare)",
+ toString(t1), toString(t2), actual, expected, file, line);
}
/*! \fn bool QTest::qCompare<double>(double const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line)
@@ -2438,10 +2461,8 @@ template <>
Q_TESTLIB_EXPORT bool QTest::qCompare<double>(double const &t1, double const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- return qFuzzyCompare(t1, t2)
- ? compare_helper(true, "COMPARE()", file, line)
- : compare_helper(false, "Compared doubles are not the same (fuzzy compare)",
- toString(t1), toString(t2), actual, expected, file, line);
+ return compare_helper(qFuzzyCompare(t1, t2), "Compared doubles are not the same (fuzzy compare)",
+ toString(t1), toString(t2), actual, expected, file, line);
}
#define TO_STRING_IMPL(TYPE, FORMAT) \
@@ -2494,10 +2515,8 @@ char *QTest::toString(const void *p)
bool QTest::compare_string_helper(const char *t1, const char *t2, const char *actual,
const char *expected, const char *file, int line)
{
- return (qstrcmp(t1, t2) == 0)
- ? compare_helper(true, "COMPARE()", file, line)
- : compare_helper(false, "Compared strings are not the same",
- toString(t1), toString(t2), actual, expected, file, line);
+ return compare_helper(qstrcmp(t1, t2) == 0, "Compared strings are not the same",
+ toString(t1), toString(t2), actual, expected, file, line);
}
/*! \fn bool QTest::compare_ptr_helper(const void *t1, const void *t2, const char *actual, const char *expected, const char *file, int line);
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index c64420b000..a344736f7b 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -200,7 +200,8 @@ namespace QTest
Q_TESTLIB_EXPORT bool compare_helper(bool success, const char *msg, const char *file,
int line);
- Q_TESTLIB_EXPORT bool compare_helper(bool success, const char *msg, char *val1, char *val2,
+ Q_TESTLIB_EXPORT bool compare_helper(bool success, const char *failureMsg,
+ char *val1, char *val2,
const char *actual, const char *expected,
const char *file, int line);
Q_TESTLIB_EXPORT void qSleep(int ms);
@@ -217,13 +218,10 @@ namespace QTest
inline bool qCompare(T const &t1, T const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- return (t1 == t2)
- ? compare_helper(true, "COMPARE()", file, line)
- : compare_helper(false, "Compared values are not the same",
- toString<T>(t1), toString<T>(t2), actual, expected, file, line);
+ return compare_helper(t1 == t2, "Compared values are not the same",
+ toString<T>(t1), toString<T>(t2), actual, expected, file, line);
}
-
template <>
Q_TESTLIB_EXPORT bool qCompare<float>(float const &t1, float const &t2,
const char *actual, const char *expected, const char *file, int line);
@@ -235,10 +233,8 @@ namespace QTest
inline bool compare_ptr_helper(const void *t1, const void *t2, const char *actual,
const char *expected, const char *file, int line)
{
- return (t1 == t2)
- ? compare_helper(true, "COMPARE()", file, line)
- : compare_helper(false, "Compared pointers are not the same",
- toString(t1), toString(t2), actual, expected, file, line);
+ return compare_helper(t1 == t2, "Compared pointers are not the same",
+ toString(t1), toString(t2), actual, expected, file, line);
}
Q_TESTLIB_EXPORT bool compare_string_helper(const char *t1, const char *t2, const char *actual,
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index 14ab29af2b..9d62a9eb57 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -230,6 +230,8 @@ static bool checkStatement(bool statement, const char *msg, const char *file, in
bool QTestResult::verify(bool statement, const char *statementStr,
const char *description, const char *file, int line)
{
+ QTEST_ASSERT(statementStr);
+
char msg[1024];
if (QTestLog::verboseLevel() >= 2) {
@@ -240,7 +242,7 @@ bool QTestResult::verify(bool statement, const char *statementStr,
const char * format = QTest::expectFailMode
? "'%s' returned TRUE unexpectedly. (%s)"
: "'%s' returned FALSE. (%s)";
- qsnprintf(msg, 1024, format, statementStr, description);
+ qsnprintf(msg, 1024, format, statementStr, description ? description : "");
return checkStatement(statement, msg, file, line);
}
@@ -254,22 +256,38 @@ bool QTestResult::compare(bool success, const char *msg, const char *file, int l
return checkStatement(success, msg, file, line);
}
-bool QTestResult::compare(bool success, const char *msg, char *val1, char *val2,
- const char *actual, const char *expected, const char *file, int line)
+bool QTestResult::compare(bool success, const char *failureMsg,
+ char *val1, char *val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
{
QTEST_ASSERT(expected);
QTEST_ASSERT(actual);
- if (!val1 && !val2)
- return compare(success, msg, file, line);
+ char msg[1024];
+
+ if (QTestLog::verboseLevel() >= 2) {
+ qsnprintf(msg, 1024, "QCOMPARE(%s, %s)", actual, expected);
+ QTestLog::info(msg, file, line);
+ }
+
+ if (!failureMsg)
+ failureMsg = "Compared values are not the same";
+
+ if (success && QTest::expectFailMode) {
+ qsnprintf(msg, 1024, "QCOMPARE(%s, %s) returned TRUE unexpectedly.", actual, expected);
+ } else if (val1 || val2) {
+ qsnprintf(msg, 1024, "%s\n Actual (%s): %s\n Expected (%s): %s",
+ failureMsg,
+ actual, val1 ? val1 : "<null>",
+ expected, val2 ? val2 : "<null>");
+ } else
+ qsnprintf(msg, 1024, "%s", failureMsg);
- char buf[1024];
- qsnprintf(buf, 1024, "%s\n Actual (%s): %s\n Expected (%s): %s", msg,
- actual, val1 ? val1 : "<null>",
- expected, val2 ? val2 : "<null>");
delete [] val1;
delete [] val2;
- return compare(success, buf, file, line);
+
+ return checkStatement(success, msg, file, line);
}
void QTestResult::addFailure(const char *message, const char *file, int line)
diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h
index b060926f2a..1bf070f6cf 100644
--- a/src/testlib/qtestresult_p.h
+++ b/src/testlib/qtestresult_p.h
@@ -77,8 +77,10 @@ public:
static void addFailure(const char *message, const char *file, int line);
static bool compare(bool success, const char *msg, const char *file, int line);
- static bool compare(bool success, const char *msg, char *val1, char *val2,
- const char *actual, const char *expected, const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ char *val1, char *val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
static void setCurrentGlobalTestData(QTestData *data);
static void setCurrentTestData(QTestData *data);
diff --git a/src/tools/qdoc/TODO.txt b/src/tools/qdoc/TODO.txt
new file mode 100644
index 0000000000..9bf4a2864f
--- /dev/null
+++ b/src/tools/qdoc/TODO.txt
@@ -0,0 +1,87 @@
+ * fix QWSPointerCalibrationData::devPoints and qwsServer
+ * Fix QMenu::addAction(QAction *) overload, "using" etc.
+ * fix space between two tables using <p></p>
+ * qpixmap-qt3.html; remove 8 public functions inherited from QPaintDevice
+ * \variable array
+ * Added support for parameterless macros (e.g. \macro Q_OBJECT).
+ * Made qdoc stricter regarding the data types (e.g. can't use \enum to document a typedef).
+ * Parse QT_MODULE() macro and generate proper warnings for the various editions.
+ * Fix parsing of \image following \value (e.g. qt.html).
+ * Don't turn X11 and similar names into links.
+ * Added automatic links from getters to setters and vice versa.
+ * Support \module and show which module each class is from.
+ * Fix occasional crash caused by misuse of const_cast().
+ * Provide clearer error messages when resolves fail.
+
+
+
+
+CHECK:
+
+ * Identify editions
+ * Automatic \sa getter setter
+ * \macro Q_OBJECT
+
+MUST HAVES:
+
+ * resolve [gs]etters for \sa using base class
+
+ * fix \overload when one is a signal and the other a normal function
+ * use "project" for .dcf files
+ * functions.html: include the types from QtGlobal as well as the functions (whatever that means)
+
+ * nice template function/class syntax
+ * spellchecker: built-in vs. builtin
+
+ * verbose mode for functions that don't exist
+ * No links to Porting Guide sections (e.g. QStringList)
+ * link toggled(bool)
+ * autolink foo(1)
+ * handle using correctly
+ * QObject "reentrant" list: duplicates
+ * operator<< \overload
+ * \compat \overload
+ * qWarning() link
+ * operator<<() autolink
+
+ * get rid of spurious 'global' functions
+ * Make automatic links in code work
+
+ * Fix encoding bug (see Important email from Simon Hausmann)
+ * Make links to QFoo::bar().baz() work
+ * Fix automatic links in \sectionX (e.g. qt4-getting-started.html)
+ * Provide a "List of all properties" page.
+
+ * expand QObjectList -> QList<QObject *>
+ * warning for unnamed parameters in property access functions
+ * \center...\endcenter
+
+LINKS:
+
+ * explanation following nonstandard wording warning
+
+ * omit \overload in operator<< and operator>>
+ * make operator-() unary and binary independent functions (no \overload)
+ * fix \overload
+ * fix \legalese
+ * remove warning for undocumented enum item like QLocale::LastLanguage
+ * improve the \a warnings for overloads; if one overload documents a para, fine
+
+ * implement \sidebar
+
+ * implement \legalesefile
+
+ * show in which module each class is
+ * list namespaces, list header files
+
+
+NICE FEATURES:
+ * implement inheritance tree for each class (as a PNG)
+ * avoid <p>...</p> in table/item cells without relying on horrible kludge
+ * prevent macros from having same name as commands
+ * be smart about enum types Foo::Bar vs. Bar when comparing functions
+ * be smart about const & non-const when comparing functions
+
+OTHER:
+ * make qdoc run faster
+ * make sure \headerfile works even if specified after \relates
diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp
new file mode 100644
index 0000000000..777240c831
--- /dev/null
+++ b/src/tools/qdoc/atom.cpp
@@ -0,0 +1,387 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qregexp.h>
+#include "atom.h"
+#include "location.h"
+#include <stdio.h>
+
+QT_BEGIN_NAMESPACE
+
+QLatin1String Atom::BOLD_ ("bold");
+QLatin1String Atom::INDEX_ ("index");
+QLatin1String Atom::ITALIC_ ("italic");
+QLatin1String Atom::LINK_ ("link");
+QLatin1String Atom::PARAMETER_ ("parameter");
+QLatin1String Atom::SPAN_ ("span");
+QLatin1String Atom::SUBSCRIPT_ ("subscript");
+QLatin1String Atom::SUPERSCRIPT_ ("superscript");
+QLatin1String Atom::TELETYPE_ ("teletype");
+QLatin1String Atom::UNDERLINE_ ("underline");
+
+QLatin1String Atom::BULLET_ ("bullet");
+QLatin1String Atom::TAG_ ("tag");
+QLatin1String Atom::VALUE_ ("value");
+QLatin1String Atom::LOWERALPHA_ ("loweralpha");
+QLatin1String Atom::LOWERROMAN_ ("lowerroman");
+QLatin1String Atom::NUMERIC_ ("numeric");
+QLatin1String Atom::UPPERALPHA_ ("upperalpha");
+QLatin1String Atom::UPPERROMAN_ ("upperroman");
+
+/*! \class Atom
+ \brief The Atom class is the fundamental unit for representing
+ documents internally.
+
+ Atoms have a \i type and are completed by a \i string whose
+ meaning depends on the \i type. For example, the string
+ \quotation
+ \i italic text looks nicer than \bold bold text
+ \endquotation
+ is represented by the following atoms:
+ \quotation
+ (FormattingLeft, ATOM_FORMATTING_ITALIC)
+ (String, "italic")
+ (FormattingRight, ATOM_FORMATTING_ITALIC)
+ (String, " text is more attractive than ")
+ (FormattingLeft, ATOM_FORMATTING_BOLD)
+ (String, "bold")
+ (FormattingRight, ATOM_FORMATTING_BOLD)
+ (String, " text")
+ \endquotation
+
+ \also Text
+*/
+
+/*! \enum Atom::Type
+
+ \value AbstractLeft
+ \value AbstractRight
+ \value AnnotatedList
+ \value AutoLink
+ \value BaseName
+ \value BriefLeft
+ \value BriefRight
+ \value C
+ \value CaptionLeft
+ \value CaptionRight
+ \value Code
+ \value CodeBad
+ \value CodeNew
+ \value CodeOld
+ \value CodeQuoteArgument
+ \value CodeQuoteCommand
+ \value DivLeft
+ \value DivRight
+ \value EndQmlText
+ \value FormatElse
+ \value FormatEndif
+ \value FormatIf
+ \value FootnoteLeft
+ \value FootnoteRight
+ \value FormattingLeft
+ \value FormattingRight
+ \value GeneratedList
+ \value Image
+ \value ImageText
+ \value ImportantNote
+ \value InlineImage
+ \value LineBreak
+ \value Link
+ \value LinkNode
+ \value ListLeft
+ \value ListItemNumber
+ \value ListTagLeft
+ \value ListTagRight
+ \value ListItemLeft
+ \value ListItemRight
+ \value ListRight
+ \value Nop
+ \value Note
+ \value ParaLeft
+ \value ParaRight
+ \value Qml
+ \value QmlText
+ \value QuotationLeft
+ \value QuotationRight
+ \value RawString
+ \value SectionLeft
+ \value SectionRight
+ \value SectionHeadingLeft
+ \value SectionHeadingRight
+ \value SidebarLeft
+ \value SidebarRight
+ \value SinceList
+ \value String
+ \value TableLeft
+ \value TableRight
+ \value TableHeaderLeft
+ \value TableHeaderRight
+ \value TableRowLeft
+ \value TableRowRight
+ \value TableItemLeft
+ \value TableItemRight
+ \value TableOfContents
+ \value Target
+ \value UnhandledFormat
+ \value UnknownCommand
+*/
+
+static const struct {
+ const char *english;
+ int no;
+} atms[] = {
+ { "AbstractLeft", Atom::AbstractLeft },
+ { "AbstractRight", Atom::AbstractRight },
+ { "AnnotatedList", Atom::AnnotatedList },
+ { "AutoLink", Atom::AutoLink },
+ { "BaseName", Atom::BaseName },
+ { "BriefLeft", Atom::BriefLeft },
+ { "BriefRight", Atom::BriefRight },
+ { "C", Atom::C },
+ { "CaptionLeft", Atom::CaptionLeft },
+ { "CaptionRight", Atom::CaptionRight },
+ { "Code", Atom::Code },
+ { "CodeBad", Atom::CodeBad },
+ { "CodeNew", Atom::CodeNew },
+ { "CodeOld", Atom::CodeOld },
+ { "CodeQuoteArgument", Atom::CodeQuoteArgument },
+ { "CodeQuoteCommand", Atom::CodeQuoteCommand },
+ { "DivLeft", Atom::DivLeft },
+ { "DivRight", Atom::DivRight },
+ { "EndQmlText", Atom::EndQmlText },
+ { "FootnoteLeft", Atom::FootnoteLeft },
+ { "FootnoteRight", Atom::FootnoteRight },
+ { "FormatElse", Atom::FormatElse },
+ { "FormatEndif", Atom::FormatEndif },
+ { "FormatIf", Atom::FormatIf },
+ { "FormattingLeft", Atom::FormattingLeft },
+ { "FormattingRight", Atom::FormattingRight },
+ { "GeneratedList", Atom::GeneratedList },
+ { "GuidLink", Atom::GuidLink},
+ { "Image", Atom::Image },
+ { "ImageText", Atom::ImageText },
+ { "ImportantLeft", Atom::ImportantLeft },
+ { "ImportantRight", Atom::ImportantRight },
+ { "InlineImage", Atom::InlineImage },
+ { "JavaScript", Atom::JavaScript },
+ { "EndJavaScript", Atom::EndJavaScript },
+ { "LegaleseLeft", Atom::LegaleseLeft },
+ { "LegaleseRight", Atom::LegaleseRight },
+ { "LineBreak", Atom::LineBreak },
+ { "Link", Atom::Link },
+ { "LinkNode", Atom::LinkNode },
+ { "ListLeft", Atom::ListLeft },
+ { "ListItemNumber", Atom::ListItemNumber },
+ { "ListTagLeft", Atom::ListTagLeft },
+ { "ListTagRight", Atom::ListTagRight },
+ { "ListItemLeft", Atom::ListItemLeft },
+ { "ListItemRight", Atom::ListItemRight },
+ { "ListRight", Atom::ListRight },
+ { "Nop", Atom::Nop },
+ { "NoteLeft", Atom::NoteLeft },
+ { "NoteRight", Atom::NoteRight },
+ { "ParaLeft", Atom::ParaLeft },
+ { "ParaRight", Atom::ParaRight },
+ { "Qml", Atom::Qml},
+ { "QmlText", Atom::QmlText },
+ { "QuotationLeft", Atom::QuotationLeft },
+ { "QuotationRight", Atom::QuotationRight },
+ { "RawString", Atom::RawString },
+ { "SectionLeft", Atom::SectionLeft },
+ { "SectionRight", Atom::SectionRight },
+ { "SectionHeadingLeft", Atom::SectionHeadingLeft },
+ { "SectionHeadingRight", Atom::SectionHeadingRight },
+ { "SidebarLeft", Atom::SidebarLeft },
+ { "SidebarRight", Atom::SidebarRight },
+ { "SinceList", Atom::SinceList },
+ { "SnippetCommand", Atom::SnippetCommand },
+ { "SnippetIdentifier", Atom::SnippetIdentifier },
+ { "SnippetLocation", Atom::SnippetLocation },
+ { "String", Atom::String },
+ { "TableLeft", Atom::TableLeft },
+ { "TableRight", Atom::TableRight },
+ { "TableHeaderLeft", Atom::TableHeaderLeft },
+ { "TableHeaderRight", Atom::TableHeaderRight },
+ { "TableRowLeft", Atom::TableRowLeft },
+ { "TableRowRight", Atom::TableRowRight },
+ { "TableItemLeft", Atom::TableItemLeft },
+ { "TableItemRight", Atom::TableItemRight },
+ { "TableOfContents", Atom::TableOfContents },
+ { "Target", Atom::Target },
+ { "UnhandledFormat", Atom::UnhandledFormat },
+ { "UnknownCommand", Atom::UnknownCommand },
+ { 0, 0 }
+};
+
+/*! \fn Atom::Atom(Type type, const QString& string)
+
+ Constructs an atom of the specified \a type with the single
+ parameter \a string and does not put the new atom in a list.
+*/
+
+/*! \fn Atom::Atom(Type type, const QString& p1, const QString& p2)
+
+ Constructs an atom of the specified \a type with the two
+ parameters \a p1 and \a p2 and does not put the new atom
+ in a list.
+*/
+
+/*! \fn Atom(Atom *previous, Type type, const QString& string)
+
+ Constructs an atom of the specified \a type with the single
+ parameter \a string and inserts the new atom into the list
+ after the \a previous atom.
+*/
+
+/*! \fn Atom::Atom(Atom* previous, Type type, const QString& p1, const QString& p2)
+
+ Constructs an atom of the specified \a type with the two
+ parameters \a p1 and \a p2 and inserts the new atom into
+ the list after the \a previous atom.
+*/
+
+/*! \fn void Atom::appendChar(QChar ch)
+
+ Appends \a ch to the string parameter of this atom.
+
+ \also string()
+*/
+
+/*! \fn void Atom::appendString(const QString& string)
+
+ Appends \a string to the string parameter of this atom.
+
+ \also string()
+*/
+
+/*! \fn void Atom::chopString()
+
+ \also string()
+*/
+
+/*! \fn Atom *Atom::next()
+ Return the next atom in the atom list.
+ \also type(), string()
+*/
+
+/*!
+ Return the next Atom in the list if it is of Type \a t.
+ Otherwise return 0.
+ */
+const Atom* Atom::next(Type t) const
+{
+ return (next_ && (next_->type() == t)) ? next_ : 0;
+}
+
+/*!
+ Return the next Atom in the list if it is of Type \a t
+ and its string part is \a s. Otherwise return 0.
+ */
+const Atom* Atom::next(Type t, const QString& s) const
+{
+ return (next_ && (next_->type() == t) && (next_->string() == s)) ? next_ : 0;
+}
+
+/*! \fn const Atom *Atom::next() const
+ Return the next atom in the atom list.
+ \also type(), string()
+*/
+
+/*! \fn Type Atom::type() const
+ Return the type of this atom.
+ \also string(), next()
+*/
+
+/*!
+ Return the type of this atom as a string. Return "Invalid" if
+ type() returns an impossible value.
+
+ This is only useful for debugging.
+
+ \also type()
+*/
+QString Atom::typeString() const
+{
+ static bool deja = false;
+
+ if (!deja) {
+ int i = 0;
+ while (atms[i].english != 0) {
+ if (atms[i].no != i)
+ Location::internalError(tr("atom %1 missing").arg(i));
+ i++;
+ }
+ deja = true;
+ }
+
+ int i = (int) type();
+ if (i < 0 || i > (int) Last)
+ return QLatin1String("Invalid");
+ return QLatin1String(atms[i].english);
+}
+
+/*! \fn const QString& Atom::string() const
+
+ Returns the string parameter that together with the type
+ characterizes this atom.
+
+ \also type(), next()
+*/
+
+/*!
+ Dumps this Atom to stderr in printer friendly form.
+ */
+void Atom::dump() const
+{
+ QString str = string();
+ str.replace(QLatin1String("\\"), QLatin1String("\\\\"));
+ str.replace(QLatin1String("\""), QLatin1String("\\\""));
+ str.replace(QLatin1String("\n"), QLatin1String("\\n"));
+ str.replace(QRegExp(QLatin1String("[^\x20-\x7e]")), QLatin1String("?"));
+ if (!str.isEmpty())
+ str = QLatin1String(" \"") + str + QLatin1String("\"");
+ fprintf(stderr,
+ " %-15s%s\n",
+ typeString().toLatin1().data(),
+ str.toLatin1().data());
+}
+
+QT_END_NAMESPACE
diff --git a/src/tools/qdoc/atom.h b/src/tools/qdoc/atom.h
new file mode 100644
index 0000000000..584e8fcd08
--- /dev/null
+++ b/src/tools/qdoc/atom.h
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ atom.h
+*/
+
+#ifndef ATOM_H
+#define ATOM_H
+
+#include <qstringlist.h>
+
+#define QDOC_QML
+
+QT_BEGIN_NAMESPACE
+
+class Atom
+{
+public:
+ enum Type {
+ AbstractLeft,
+ AbstractRight,
+ AnnotatedList,
+ AutoLink,
+ BaseName,
+ BriefLeft,
+ BriefRight,
+ C,
+ CaptionLeft,
+ CaptionRight,
+ Code,
+ CodeBad,
+ CodeNew,
+ CodeOld,
+ CodeQuoteArgument,
+ CodeQuoteCommand,
+ DivLeft,
+ DivRight,
+ EndQmlText,
+ FootnoteLeft,
+ FootnoteRight,
+ FormatElse,
+ FormatEndif,
+ FormatIf,
+ FormattingLeft,
+ FormattingRight,
+ GeneratedList,
+ GuidLink,
+ Image,
+ ImageText,
+ ImportantLeft,
+ ImportantRight,
+ InlineImage,
+ JavaScript,
+ EndJavaScript,
+ LegaleseLeft,
+ LegaleseRight,
+ LineBreak,
+ Link,
+ LinkNode,
+ ListLeft,
+ ListItemNumber,
+ ListTagLeft,
+ ListTagRight,
+ ListItemLeft,
+ ListItemRight,
+ ListRight,
+ Nop,
+ NoteLeft,
+ NoteRight,
+ ParaLeft,
+ ParaRight,
+ Qml,
+ QmlText,
+ QuotationLeft,
+ QuotationRight,
+ RawString,
+ SectionLeft,
+ SectionRight,
+ SectionHeadingLeft,
+ SectionHeadingRight,
+ SidebarLeft,
+ SidebarRight,
+ SinceList,
+ SnippetCommand,
+ SnippetIdentifier,
+ SnippetLocation,
+ String,
+ TableLeft,
+ TableRight,
+ TableHeaderLeft,
+ TableHeaderRight,
+ TableRowLeft,
+ TableRowRight,
+ TableItemLeft,
+ TableItemRight,
+ TableOfContents,
+ Target,
+ UnhandledFormat,
+ UnknownCommand,
+ Last = UnknownCommand
+ };
+
+ Atom(Type type, const QString& string = "")
+ : next_(0), type_(type)
+ {
+ strs << string;
+ }
+
+ Atom(Type type, const QString& p1, const QString& p2)
+ : next_(0), type_(type)
+ {
+ strs << p1;
+ if (!p2.isEmpty())
+ strs << p2;
+ }
+
+ Atom(Atom* previous, Type type, const QString& string = "")
+ : next_(previous->next_), type_(type)
+ {
+ strs << string;
+ previous->next_ = this;
+ }
+
+ Atom(Atom* previous, Type type, const QString& p1, const QString& p2)
+ : next_(previous->next_), type_(type)
+ {
+ strs << p1;
+ if (!p2.isEmpty())
+ strs << p2;
+ previous->next_ = this;
+ }
+
+ void appendChar(QChar ch) { strs[0] += ch; }
+ void appendString(const QString& string) { strs[0] += string; }
+ void chopString() { strs[0].chop(1); }
+ void setString(const QString& string) { strs[0] = string; }
+ Atom* next() { return next_; }
+ void setNext(Atom* newNext) { next_ = newNext; }
+
+ const Atom* next() const { return next_; }
+ const Atom* next(Type t) const;
+ const Atom* next(Type t, const QString& s) const;
+ Type type() const { return type_; }
+ QString typeString() const;
+ const QString& string() const { return strs[0]; }
+ const QString& string(int i) const { return strs[i]; }
+ int count() const { return strs.size(); }
+ void dump() const;
+
+ static QLatin1String BOLD_;
+ static QLatin1String INDEX_;
+ static QLatin1String ITALIC_;
+ static QLatin1String LINK_;
+ static QLatin1String PARAMETER_;
+ static QLatin1String SPAN_;
+ static QLatin1String SUBSCRIPT_;
+ static QLatin1String SUPERSCRIPT_;
+ static QLatin1String TELETYPE_;
+ static QLatin1String UNDERLINE_;
+
+ static QLatin1String BULLET_;
+ static QLatin1String TAG_;
+ static QLatin1String VALUE_;
+ static QLatin1String LOWERALPHA_;
+ static QLatin1String LOWERROMAN_;
+ static QLatin1String NUMERIC_;
+ static QLatin1String UPPERALPHA_;
+ static QLatin1String UPPERROMAN_;
+
+private:
+ Atom* next_;
+ Type type_;
+ QStringList strs;
+};
+
+#define ATOM_FORMATTING_BOLD "bold"
+#define ATOM_FORMATTING_INDEX "index"
+#define ATOM_FORMATTING_ITALIC "italic"
+#define ATOM_FORMATTING_LINK "link"
+#define ATOM_FORMATTING_PARAMETER "parameter"
+#define ATOM_FORMATTING_SPAN "span "
+#define ATOM_FORMATTING_SUBSCRIPT "subscript"
+#define ATOM_FORMATTING_SUPERSCRIPT "superscript"
+#define ATOM_FORMATTING_TELETYPE "teletype"
+#define ATOM_FORMATTING_UNDERLINE "underline"
+
+#define ATOM_LIST_BULLET "bullet"
+#define ATOM_LIST_TAG "tag"
+#define ATOM_LIST_VALUE "value"
+#define ATOM_LIST_LOWERALPHA "loweralpha"
+#define ATOM_LIST_LOWERROMAN "lowerroman"
+#define ATOM_LIST_NUMERIC "numeric"
+#define ATOM_LIST_UPPERALPHA "upperalpha"
+#define ATOM_LIST_UPPERROMAN "upperroman"
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/tools/qdoc/codechunk.cpp b/src/tools/qdoc/codechunk.cpp
new file mode 100644
index 0000000000..a722bb109e
--- /dev/null
+++ b/src/tools/qdoc/codechunk.cpp
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ codechunk.cpp
+*/
+
+#include <qregexp.h>
+#include <qstringlist.h>
+
+#include "codechunk.h"
+
+QT_BEGIN_NAMESPACE
+
+enum { Other, Alnum, Gizmo, Comma, LParen, RParen, RAngle, Colon };
+
+// entries 128 and above are Other
+static const int charCategory[256] = {
+ Other, Other, Other, Other, Other, Other, Other, Other,
+ Other, Other, Other, Other, Other, Other, Other, Other,
+ Other, Other, Other, Other, Other, Other, Other, Other,
+ Other, Other, Other, Other, Other, Other, Other, Other,
+ // ! " # $ % & '
+ Other, Other, Other, Other, Other, Gizmo, Gizmo, Other,
+ // ( ) * + , - . /
+ LParen, RParen, Gizmo, Gizmo, Comma, Other, Other, Gizmo,
+ // 0 1 2 3 4 5 6 7
+ Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // 8 9 : ; < = > ?
+ Alnum, Alnum, Colon, Other, Other, Gizmo, RAngle, Gizmo,
+ // @ A B C D E F G
+ Other, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // H I J K L M N O
+ Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // P Q R S T U V W
+ Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // X Y Z [ \ ] ^ _
+ Alnum, Alnum, Alnum, Other, Other, Other, Gizmo, Alnum,
+ // ` a b c d e f g
+ Other, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // h i j k l m n o
+ Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // p q r s t u v w
+ Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
+ // x y z { | } ~
+ Alnum, Alnum, Alnum, LParen, Gizmo, RParen, Other, Other
+};
+
+static const bool needSpace[8][8] = {
+ /* [ a + , ( ) > : */
+ /* [ */ { false, false, false, false, false, true, false, false },
+ /* a */ { false, true, true, false, false, true, false, false },
+ /* + */ { false, true, false, false, false, true, false, true },
+ /* , */ { true, true, true, true, true, true, true, true },
+ /* ( */ { true, true, true, false, true, false, true, true },
+ /* ) */ { true, true, true, false, true, true, true, true },
+ /* > */ { true, true, true, false, true, true, true, false },
+ /* : */ { false, false, true, true, true, true, true, false }
+};
+
+static int category( QChar ch )
+{
+ return charCategory[(int)ch.toLatin1()];
+}
+
+CodeChunk::CodeChunk()
+ : hotspot( -1 )
+{
+}
+
+CodeChunk::CodeChunk( const QString& str )
+ : s( str ), hotspot( -1 )
+{
+}
+
+void CodeChunk::append( const QString& lexeme )
+{
+ if ( !s.isEmpty() && !lexeme.isEmpty() ) {
+ /*
+ Should there be a space or not between the code chunk so far and the
+ new lexeme?
+ */
+ int cat1 = category(s.at(s.size() - 1));
+ int cat2 = category(lexeme[0]);
+ if ( needSpace[cat1][cat2] )
+ s += QLatin1Char( ' ' );
+ }
+ s += lexeme;
+}
+
+void CodeChunk::appendHotspot()
+{
+ /*
+ The first hotspot is the right one.
+ */
+ if ( hotspot == -1 )
+ hotspot = s.length();
+}
+
+QString CodeChunk::toString() const
+{
+ return s;
+}
+
+QStringList CodeChunk::toPath() const
+{
+ QString t = s;
+ t.remove(QRegExp(QLatin1String("<([^<>]|<([^<>]|<[^<>]*>)*>)*>")));
+ return t.split(QLatin1String("::"));
+}
+
+QT_END_NAMESPACE
diff --git a/src/tools/qdoc/codechunk.h b/src/tools/qdoc/codechunk.h
new file mode 100644
index 0000000000..ee30f85a05
--- /dev/null
+++ b/src/tools/qdoc/codechunk.h
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ codechunk.h
+*/
+
+#ifndef CODECHUNK_H
+#define CODECHUNK_H
+
+#include <qstring.h>
+
+QT_BEGIN_NAMESPACE
+
+// ### get rid of that class
+
+/*
+ The CodeChunk class represents a tiny piece of C++ code.
+
+ The class provides conversion between a list of lexemes and a string. It adds
+ spaces at the right place for consistent style. The tiny pieces of code it
+ represents are data types, enum values, and default parameter values.
+
+ Apart from the piece of code itself, there are two bits of metainformation
+ stored in CodeChunk: the base and the hotspot. The base is the part of the
+ piece that may be a hypertext link. The base of
+
+ QMap<QString, QString>
+
+ is QMap.
+
+ The hotspot is the place the variable name should be inserted in the case of a
+ variable (or parameter) declaration. The base of
+
+ char * []
+
+ is between '*' and '[]'.
+*/
+class CodeChunk
+{
+public:
+ CodeChunk();
+ CodeChunk( const QString& str );
+
+ void append( const QString& lexeme );
+ void appendHotspot();
+
+ bool isEmpty() const { return s.isEmpty(); }
+ QString toString() const;
+ QStringList toPath() const;
+ QString left() const { return s.left(hotspot == -1 ? s.length() : hotspot); }
+ QString right() const { return s.mid(hotspot == -1 ? s.length() : hotspot); }
+
+private:
+ QString s;
+ int hotspot;
+};
+
+inline bool operator==( const CodeChunk& c, const CodeChunk& d ) {
+ return c.toString() == d.toString();
+}
+
+inline bool operator!=( const CodeChunk& c, const CodeChunk& d ) {
+ return !( c == d );
+}
+
+inline bool operator<( const CodeChunk& c, const CodeChunk& d ) {
+ return c.toString() < d.toString();
+}
+
+inline bool operator>( const CodeChunk& c, const CodeChunk& d ) {
+ return d < c;
+}
+
+inline bool operator<=( const CodeChunk& c, const CodeChunk& d ) {
+ return !( c > d );
+}
+
+inline bool operator>=( const CodeChunk& c, const CodeChunk& d ) {
+ return !( c < d );
+}
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
new file mode 100644
index 0000000000..791e08062b
--- /dev/null
+++ b/src/tools/qdoc/codemarker.cpp
@@ -0,0 +1,682 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QMetaObject>
+#include "codemarker.h"
+#include "config.h"
+#include "node.h"
+#include <qdebug.h>
+#include <stdio.h>
+
+QT_BEGIN_NAMESPACE
+
+QString CodeMarker::defaultLang;
+QList<CodeMarker *> CodeMarker::markers;
+
+/*!
+ When a code marker constructs itself, it puts itself into
+ the static list of code markers. All the code markers in
+ the static list get initialized in initialize(), which is
+ not called until after the qdoc configuration file has
+ been read.
+ */
+CodeMarker::CodeMarker()
+{
+ markers.prepend(this);
+}
+
+/*!
+ When a code marker destroys itself, it removes itself from
+ the static list of code markers.
+ */
+CodeMarker::~CodeMarker()
+{
+ markers.removeAll(this);
+}
+
+/*!
+ A code market performs no initialization by default. Marker-specific
+ initialization is performed in subclasses.
+ */
+void CodeMarker::initializeMarker(const Config& ) // config
+{
+}
+
+/*!
+ Terminating a code marker is trivial.
+ */
+void CodeMarker::terminateMarker()
+{
+ // nothing.
+}
+
+/*!
+ All the code markers in the static list are initialized
+ here, after the qdoc configuration file has been loaded.
+ */
+void CodeMarker::initialize(const Config& config)
+{
+ defaultLang = config.getString(QLatin1String(CONFIG_LANGUAGE));
+ QList<CodeMarker *>::ConstIterator m = markers.begin();
+ while (m != markers.end()) {
+ (*m)->initializeMarker(config);
+ ++m;
+ }
+}
+
+/*!
+ All the code markers in the static list are terminated here.
+ */
+void CodeMarker::terminate()
+{
+ QList<CodeMarker *>::ConstIterator m = markers.begin();
+ while (m != markers.end()) {
+ (*m)->terminateMarker();
+ ++m;
+ }
+}
+
+CodeMarker *CodeMarker::markerForCode(const QString& code)
+{
+ CodeMarker *defaultMarker = markerForLanguage(defaultLang);
+ if (defaultMarker != 0 && defaultMarker->recognizeCode(code))
+ return defaultMarker;
+
+ QList<CodeMarker *>::ConstIterator m = markers.begin();
+ while (m != markers.end()) {
+ if ((*m)->recognizeCode(code))
+ return *m;
+ ++m;
+ }
+ return defaultMarker;
+}
+
+CodeMarker *CodeMarker::markerForFileName(const QString& fileName)
+{
+ CodeMarker *defaultMarker = markerForLanguage(defaultLang);
+ int dot = -1;
+ while ((dot = fileName.lastIndexOf(QLatin1Char('.'), dot)) != -1) {
+ QString ext = fileName.mid(dot + 1);
+ if (defaultMarker != 0 && defaultMarker->recognizeExtension(ext))
+ return defaultMarker;
+ QList<CodeMarker *>::ConstIterator m = markers.begin();
+ while (m != markers.end()) {
+ if ((*m)->recognizeExtension(ext))
+ return *m;
+ ++m;
+ }
+ --dot;
+ }
+ return defaultMarker;
+}
+
+CodeMarker *CodeMarker::markerForLanguage(const QString& lang)
+{
+ QList<CodeMarker *>::ConstIterator m = markers.begin();
+ while (m != markers.end()) {
+ if ((*m)->recognizeLanguage(lang))
+ return *m;
+ ++m;
+ }
+ return 0;
+}
+
+const Node *CodeMarker::nodeForString(const QString& string)
+{
+ if (sizeof(const Node *) == sizeof(uint)) {
+ return reinterpret_cast<const Node *>(string.toUInt());
+ }
+ else {
+ return reinterpret_cast<const Node *>(string.toULongLong());
+ }
+}
+
+QString CodeMarker::stringForNode(const Node *node)
+{
+ if (sizeof(const Node *) == sizeof(ulong)) {
+ return QString::number(reinterpret_cast<quintptr>(node));
+ }
+ else {
+ return QString::number(reinterpret_cast<qulonglong>(node));
+ }
+}
+
+static const QString samp = QLatin1String("&amp;");
+static const QString slt = QLatin1String("&lt;");
+static const QString sgt = QLatin1String("&gt;");
+static const QString squot = QLatin1String("&quot;");
+
+QString CodeMarker::protect(const QString& str)
+{
+ int n = str.length();
+ QString marked;
+ marked.reserve(n * 2 + 30);
+ const QChar *data = str.constData();
+ for (int i = 0; i != n; ++i) {
+ switch (data[i].unicode()) {
+ case '&': marked += samp; break;
+ case '<': marked += slt; break;
+ case '>': marked += sgt; break;
+ case '"': marked += squot; break;
+ default : marked += data[i];
+ }
+ }
+ return marked;
+}
+
+QString CodeMarker::typified(const QString &string)
+{
+ QString result;
+ QString pendingWord;
+
+ for (int i = 0; i <= string.size(); ++i) {
+ QChar ch;
+ if (i != string.size())
+ ch = string.at(i);
+
+ QChar lower = ch.toLower();
+ if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z'))
+ || ch.digitValue() >= 0 || ch == QLatin1Char('_')
+ || ch == QLatin1Char(':')) {
+ pendingWord += ch;
+ }
+ else {
+ if (!pendingWord.isEmpty()) {
+ bool isProbablyType = (pendingWord != QLatin1String("const"));
+ if (isProbablyType)
+ result += QLatin1String("<@type>");
+ result += pendingWord;
+ if (isProbablyType)
+ result += QLatin1String("</@type>");
+ }
+ pendingWord.clear();
+
+ switch (ch.unicode()) {
+ case '\0':
+ break;
+ case '&':
+ result += QLatin1String("&amp;");
+ break;
+ case '<':
+ result += QLatin1String("&lt;");
+ break;
+ case '>':
+ result += QLatin1String("&gt;");
+ break;
+ default:
+ result += ch;
+ }
+ }
+ }
+ return result;
+}
+
+QString CodeMarker::taggedNode(const Node* node)
+{
+ QString tag;
+ QString name = node->name();
+
+ switch (node->type()) {
+ case Node::Namespace:
+ tag = QLatin1String("@namespace");
+ break;
+ case Node::Class:
+ tag = QLatin1String("@class");
+ break;
+ case Node::Enum:
+ tag = QLatin1String("@enum");
+ break;
+ case Node::Typedef:
+ tag = QLatin1String("@typedef");
+ break;
+ case Node::Function:
+ tag = QLatin1String("@function");
+ break;
+ case Node::Property:
+ tag = QLatin1String("@property");
+ break;
+ case Node::Fake:
+ /*
+ Remove the "QML:" prefix, if present.
+ There shouldn't be any of these "QML:"
+ prefixes in the documentation sources
+ after the switch to using QML module
+ qualifiers, but this code is kept to
+ be backward compatible.
+ */
+ if (node->subType() == Node::QmlClass) {
+ if (node->name().startsWith(QLatin1String("QML:")))
+ name = name.mid(4);
+ }
+ tag = QLatin1String("@property");
+ break;
+ default:
+ tag = QLatin1String("@unknown");
+ break;
+ }
+ return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name)
+ + QLatin1String("</") + tag + QLatin1Char('>');
+}
+
+QString CodeMarker::taggedQmlNode(const Node* node)
+{
+ QString tag;
+ switch (node->type()) {
+ case Node::QmlProperty:
+ tag = QLatin1String("@property");
+ break;
+ case Node::QmlSignal:
+ tag = QLatin1String("@signal");
+ break;
+ case Node::QmlSignalHandler:
+ tag = QLatin1String("@signalhandler");
+ break;
+ case Node::QmlMethod:
+ tag = QLatin1String("@method");
+ break;
+ default:
+ tag = QLatin1String("@unknown");
+ break;
+ }
+ return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
+ + QLatin1String("</") + tag + QLatin1Char('>');
+}
+
+QString CodeMarker::linkTag(const Node *node, const QString& body)
+{
+ return QLatin1String("<@link node=\"") + stringForNode(node)
+ + QLatin1String("\">") + body + QLatin1String("</@link>");
+}
+
+QString CodeMarker::sortName(const Node *node, const QString* name)
+{
+ QString nodeName;
+ if (name != 0)
+ nodeName = *name;
+ else
+ nodeName = node->name();
+ int numDigits = 0;
+ for (int i = nodeName.size() - 1; i > 0; --i) {
+ if (nodeName.at(i).digitValue() == -1)
+ break;
+ ++numDigits;
+ }
+
+ // we want 'qint8' to appear before 'qint16'
+ if (numDigits > 0) {
+ for (int i = 0; i < 4 - numDigits; ++i)
+ nodeName.insert(nodeName.size()-numDigits-1, QLatin1Char('0'));
+ }
+
+ if (node->type() == Node::Function) {
+ const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ QString sortNo;
+ if (func->metaness() == FunctionNode::Ctor) {
+ sortNo = QLatin1String("C");
+ }
+ else if (func->metaness() == FunctionNode::Dtor) {
+ sortNo = QLatin1String("D");
+ }
+ else {
+ if (nodeName.startsWith(QLatin1String("operator"))
+ && nodeName.length() > 8
+ && !nodeName[8].isLetterOrNumber())
+ sortNo = QLatin1String("F");
+ else
+ sortNo = QLatin1String("E");
+ }
+ return sortNo + nodeName + QLatin1Char(' ')
+ + QString::number(func->overloadNumber(), 36);
+ }
+
+ if (node->type() == Node::Class)
+ return QLatin1Char('A') + nodeName;
+
+ if (node->type() == Node::Property || node->type() == Node::Variable)
+ return QLatin1Char('E') + nodeName;
+
+ return QLatin1Char('B') + nodeName;
+}
+
+void CodeMarker::insert(FastSection &fastSection,
+ Node *node,
+ SynopsisStyle style,
+ Status status)
+{
+ bool irrelevant = false;
+ bool inheritedMember = false;
+ if (!node->relates()) {
+ if (node->parent() != (const InnerNode*)fastSection.innerNode && !node->parent()->isAbstract()) {
+ if (node->type() != Node::QmlProperty)
+ inheritedMember = true;
+ }
+ }
+
+ if (node->access() == Node::Private) {
+ irrelevant = true;
+ }
+ else if (node->type() == Node::Function) {
+ FunctionNode *func = (FunctionNode *) node;
+ irrelevant = (inheritedMember
+ && (func->metaness() == FunctionNode::Ctor ||
+ func->metaness() == FunctionNode::Dtor));
+ }
+ else if (node->type() == Node::Class || node->type() == Node::Enum
+ || node->type() == Node::Typedef) {
+ irrelevant = (inheritedMember && style != Subpage);
+ if (!irrelevant && style == Detailed && node->type() == Node::Typedef) {
+ const TypedefNode* typedeffe = static_cast<const TypedefNode*>(node);
+ if (typedeffe->associatedEnum())
+ irrelevant = true;
+ }
+ }
+
+ if (!irrelevant) {
+ if (status == Compat) {
+ irrelevant = (node->status() != Node::Compat);
+ }
+ else if (status == Obsolete) {
+ irrelevant = (node->status() != Node::Obsolete);
+ }
+ else {
+ irrelevant = (node->status() == Node::Compat ||
+ node->status() == Node::Obsolete);
+ }
+ }
+
+ if (!irrelevant) {
+ if (!inheritedMember || style == Subpage) {
+ QString key = sortName(node);
+ if (!fastSection.memberMap.contains(key))
+ fastSection.memberMap.insert(key, node);
+ }
+ else {
+ if (node->parent()->type() == Node::Class) {
+ if (fastSection.inherited.isEmpty()
+ || fastSection.inherited.last().first != node->parent()) {
+ QPair<InnerNode *, int> p(node->parent(), 0);
+ fastSection.inherited.append(p);
+ }
+ fastSection.inherited.last().second++;
+ }
+ }
+ }
+}
+
+void CodeMarker::insert(FastSection& fastSection,
+ Node* node,
+ SynopsisStyle style,
+ bool /* includeClassName */)
+{
+ if (node->status() == Node::Compat || node->status() == Node::Obsolete)
+ return;
+
+ bool inheritedMember = false;
+ InnerNode* parent = node->parent();
+ if (parent && (parent->type() == Node::Fake) &&
+ (parent->subType() == Node::QmlPropertyGroup)) {
+ parent = parent->parent();
+ }
+ inheritedMember = (parent != (const InnerNode*)fastSection.innerNode);
+
+ if (!inheritedMember || style == Subpage) {
+ QString key = sortName(node);
+ if (!fastSection.memberMap.contains(key))
+ fastSection.memberMap.insert(key, node);
+ }
+ else {
+ if ((parent->type() == Node::Fake) && (parent->subType() == Node::QmlClass)) {
+ if (fastSection.inherited.isEmpty()
+ || fastSection.inherited.last().first != parent) {
+ QPair<InnerNode*, int> p(parent, 0);
+ fastSection.inherited.append(p);
+ }
+ fastSection.inherited.last().second++;
+ }
+ }
+}
+
+/*!
+ Returns true if \a node represents a reimplemented member function.
+ If it is, then it is inserted in the reimplemented member map in the
+ section \a fs. And, the test is only performed if \a status is \e OK.
+ Otherwise, false is returned.
+ */
+bool CodeMarker::insertReimpFunc(FastSection& fs, Node* node, Status status)
+{
+ if (node->access() == Node::Private)
+ return false;
+
+ const FunctionNode* fn = static_cast<const FunctionNode*>(node);
+ if ((fn->reimplementedFrom() != 0) && (status == Okay)) {
+ bool inherited = (!fn->relates() && (fn->parent() != (const InnerNode*)fs.innerNode));
+ if (!inherited) {
+ QString key = sortName(fn);
+ if (!fs.reimpMemberMap.contains(key)) {
+ fs.reimpMemberMap.insert(key,node);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+/*!
+ If \a fs is not empty, convert it to a Section and append
+ the new Section to \a sectionList.
+ */
+void CodeMarker::append(QList<Section>& sectionList, const FastSection& fs, bool includeKeys)
+{
+ if (!fs.isEmpty()) {
+ Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember);
+ if (includeKeys) {
+ section.keys = fs.memberMap.keys();
+ }
+ section.members = fs.memberMap.values();
+ section.reimpMembers = fs.reimpMemberMap.values();
+ section.inherited = fs.inherited;
+ sectionList.append(section);
+ }
+}
+
+static QString encode(const QString &string)
+{
+#if 0
+ QString result = string;
+
+ for (int i = string.size() - 1; i >= 0; --i) {
+ uint ch = string.at(i).unicode();
+ if (ch > 0xFF)
+ ch = '?';
+ if ((ch - '0') >= 10 && (ch - 'a') >= 26 && (ch - 'A') >= 26
+ && ch != '/' && ch != '(' && ch != ')' && ch != ',' && ch != '*'
+ && ch != '&' && ch != '_' && ch != '<' && ch != '>' && ch != ':'
+ && ch != '~')
+ result.replace(i, 1, QString("%") + QString("%1").arg(ch, 2, 16));
+ }
+ return result;
+#else
+ return string;
+#endif
+}
+
+QStringList CodeMarker::macRefsForNode(Node *node)
+{
+ QString result = QLatin1String("cpp/");
+ switch (node->type()) {
+ case Node::Class:
+ {
+ const ClassNode *classe = static_cast<const ClassNode *>(node);
+#if 0
+ if (!classe->templateStuff().isEmpty()) {
+ result += QLatin1String("tmplt/");
+ }
+ else
+#endif
+ {
+ result += QLatin1String("cl/");
+ }
+ result += macName(classe); // ### Maybe plainName?
+ }
+ break;
+ case Node::Enum:
+ {
+ QStringList stringList;
+ stringList << encode(result + QLatin1String("tag/") +
+ macName(node));
+ foreach (const QString &enumName, node->doc().enumItemNames()) {
+ // ### Write a plainEnumValue() and use it here
+ stringList << encode(result + QLatin1String("econst/") +
+ macName(node->parent(), enumName));
+ }
+ return stringList;
+ }
+ case Node::Typedef:
+ result += QLatin1String("tdef/") + macName(node);
+ break;
+ case Node::Function:
+ {
+ bool isMacro = false;
+ Q_UNUSED(isMacro)
+ const FunctionNode *func = static_cast<const FunctionNode *>(node);
+
+ // overloads are too clever for the Xcode documentation browser
+ if (func->isOverload())
+ return QStringList();
+
+ if (func->metaness() == FunctionNode::MacroWithParams
+ || func->metaness() == FunctionNode::MacroWithoutParams) {
+ result += QLatin1String("macro/");
+#if 0
+ }
+ else if (!func->templateStuff().isEmpty()) {
+ result += QLatin1String("ftmplt/");
+#endif
+ }
+ else if (func->isStatic()) {
+ result += QLatin1String("clm/");
+ }
+ else if (!func->parent()->name().isEmpty()) {
+ result += QLatin1String("instm/");
+ }
+ else {
+ result += QLatin1String("func/");
+ }
+
+ result += macName(func);
+ if (result.endsWith(QLatin1String("()")))
+ result.chop(2);
+#if 0
+ // this code is too clever for the Xcode documentation
+ // browser and/or pbhelpindexer
+ if (!isMacro) {
+ result += QLatin1Char('/') + QLatin1String(QMetaObject::normalizedSignature(func->returnType().toLatin1().constData())) + "/(";
+ const QList<Parameter> &params = func->parameters();
+ for (int i = 0; i < params.count(); ++i) {
+ QString type = params.at(i).leftType() +
+ params.at(i).rightType();
+ type = QLatin1String(QMetaObject::normalizedSignature(type.toLatin1().constData()));
+ if (i != 0)
+ result += QLatin1Char(',');
+ result += type;
+ }
+ result += QLatin1Char(')');
+ }
+#endif
+ }
+ break;
+ case Node::Variable:
+ result += QLatin1String("data/") + macName(node);
+ break;
+ case Node::Property:
+ {
+ NodeList list = static_cast<const PropertyNode*>(node)->functions();
+ QStringList stringList;
+ foreach (Node* node, list) {
+ stringList += macRefsForNode(node);
+ }
+ return stringList;
+ }
+ case Node::Namespace:
+ case Node::Fake:
+ case Node::Target:
+ default:
+ return QStringList();
+ }
+
+ return QStringList(encode(result));
+}
+
+QString CodeMarker::macName(const Node *node, const QString &name)
+{
+ QString myName = name;
+ if (myName.isEmpty()) {
+ myName = node->name();
+ node = node->parent();
+ }
+
+ if (node->name().isEmpty()) {
+ return QLatin1Char('/') + protect(myName);
+ }
+ else {
+ return plainFullName(node) + QLatin1Char('/') + protect(myName);
+ }
+}
+
+/*!
+ Get the list of documentation sections for the children of
+ the specified QmlClassNode.
+ */
+QList<Section> CodeMarker::qmlSections(const QmlClassNode* ,
+ SynopsisStyle )
+{
+ return QList<Section>();
+}
+
+const Node* CodeMarker::resolveTarget(const QString& ,
+ const Tree* ,
+ const Node* ,
+ const Node* )
+{
+ return 0;
+}
+
+QT_END_NAMESPACE
diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h
new file mode 100644
index 0000000000..894d838a3b
--- /dev/null
+++ b/src/tools/qdoc/codemarker.h
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ codemarker.h
+*/
+
+#ifndef CODEMARKER_H
+#define CODEMARKER_H
+
+#include <qpair.h>
+
+#include "atom.h"
+#include "node.h"
+
+QT_BEGIN_NAMESPACE
+
+class Config;
+class Tree;
+
+struct Section
+{
+ QString name;
+ QString divClass;
+ QString singularMember;
+ QString pluralMember;
+ QStringList keys;
+ NodeList members;
+ NodeList reimpMembers;
+ QList<QPair<InnerNode *, int> > inherited;
+
+ Section() { }
+ Section(const QString& name0,
+ const QString& divClass0,
+ const QString& singularMember0,
+ const QString& pluralMember0)
+ : name(name0),
+ divClass(divClass0),
+ singularMember(singularMember0),
+ pluralMember(pluralMember0) { }
+ void appendMember(Node* node) { members.append(node); }
+ void appendReimpMember(Node* node) { reimpMembers.append(node); }
+};
+
+struct FastSection
+{
+ const InnerNode *innerNode;
+ QString name;
+ QString divClass;
+ QString singularMember;
+ QString pluralMember;
+ QMap<QString, Node *> memberMap;
+ QMap<QString, Node *> reimpMemberMap;
+ QList<QPair<InnerNode *, int> > inherited;
+
+ FastSection(const InnerNode *innerNode0,
+ const QString& name0,
+ const QString& divClass0,
+ const QString& singularMember0,
+ const QString& pluralMember0)
+ : innerNode(innerNode0),
+ name(name0),
+ divClass(divClass0),
+ singularMember(singularMember0),
+ pluralMember(pluralMember0) { }
+ bool isEmpty() const {
+ return (memberMap.isEmpty() &&
+ inherited.isEmpty() &&
+ reimpMemberMap.isEmpty());
+ }
+
+};
+
+class CodeMarker
+{
+public:
+ enum SynopsisStyle { Summary, Detailed, Subpage, Accessors };
+ enum Status { Compat, Obsolete, Okay };
+
+ CodeMarker();
+ virtual ~CodeMarker();
+
+ virtual void initializeMarker(const Config& config);
+ virtual void terminateMarker();
+ virtual bool recognizeCode(const QString& code) = 0;
+ virtual bool recognizeExtension(const QString& ext) = 0;
+ virtual bool recognizeLanguage(const QString& lang) = 0;
+ virtual Atom::Type atomType() const = 0;
+ virtual QString plainName(const Node *node) = 0;
+ virtual QString plainFullName(const Node *node,
+ const Node *relative = 0) = 0;
+ virtual QString markedUpCode(const QString& code,
+ const Node *relative,
+ const Location &location) = 0;
+ virtual QString markedUpSynopsis(const Node *node,
+ const Node *relative,
+ SynopsisStyle style) = 0;
+ virtual QString markedUpQmlItem(const Node* , bool) { return QString(); }
+ virtual QString markedUpName(const Node *node) = 0;
+ virtual QString markedUpFullName(const Node *node,
+ const Node *relative = 0) = 0;
+ virtual QString markedUpEnumValue(const QString &enumValue,
+ const Node *relative) = 0;
+ virtual QString markedUpIncludes(const QStringList& includes) = 0;
+ virtual QString functionBeginRegExp(const QString& funcName) = 0;
+ virtual QString functionEndRegExp(const QString& funcName) = 0;
+ virtual QList<Section> sections(const InnerNode *inner,
+ SynopsisStyle style,
+ Status status) = 0;
+ virtual QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
+ SynopsisStyle style);
+ virtual const Node* resolveTarget(const QString& target,
+ const Tree* tree,
+ const Node* relative,
+ const Node* self = 0);
+ virtual QStringList macRefsForNode(Node* node);
+
+ static void initialize(const Config& config);
+ static void terminate();
+ static CodeMarker *markerForCode(const QString& code);
+ static CodeMarker *markerForFileName(const QString& fileName);
+ static CodeMarker *markerForLanguage(const QString& lang);
+ static const Node *nodeForString(const QString& string);
+ static QString stringForNode(const Node *node);
+
+ QString typified(const QString &string);
+
+protected:
+ virtual QString sortName(const Node *node, const QString* name = 0);
+ QString protect(const QString &string);
+ QString taggedNode(const Node* node);
+ QString taggedQmlNode(const Node* node);
+ QString linkTag(const Node *node, const QString& body);
+ void insert(FastSection &fastSection,
+ Node *node,
+ SynopsisStyle style,
+ Status status);
+ void insert(FastSection& fastSection,
+ Node* node,
+ SynopsisStyle style,
+ bool includeClassName = false);
+ bool insertReimpFunc(FastSection& fs, Node* node, Status status);
+ void append(QList<Section>& sectionList, const FastSection& fastSection, bool includeKeys = false);
+
+private:
+ QString macName(const Node *parent, const QString &name = QString());
+
+ static QString defaultLang;
+ static QList<CodeMarker *> markers;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
new file mode 100644
index 0000000000..5173a404f2
--- /dev/null
+++ b/src/tools/qdoc/codeparser.cpp
@@ -0,0 +1,409 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ codeparser.cpp
+*/
+
+#include "codeparser.h"
+#include "node.h"
+#include "tree.h"
+#include "config.h"
+#include "generator.h"
+#include <qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+#define COMMAND_COMPAT Doc::alias(QLatin1String("compat"))
+#define COMMAND_DEPRECATED Doc::alias(QLatin1String("deprecated")) // ### don't document
+#define COMMAND_INGROUP Doc::alias(QLatin1String("ingroup"))
+#define COMMAND_INMODULE Doc::alias(QLatin1String("inmodule")) // ### don't document
+#define COMMAND_INQMLMODULE Doc::alias(QLatin1String("inqmlmodule"))
+#define COMMAND_INTERNAL Doc::alias(QLatin1String("internal"))
+#define COMMAND_MAINCLASS Doc::alias(QLatin1String("mainclass"))
+#define COMMAND_NONREENTRANT Doc::alias(QLatin1String("nonreentrant"))
+#define COMMAND_OBSOLETE Doc::alias(QLatin1String("obsolete"))
+#define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords"))
+#define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary"))
+#define COMMAND_INPUBLICGROUP Doc::alias(QLatin1String("inpublicgroup"))
+#define COMMAND_REENTRANT Doc::alias(QLatin1String("reentrant"))
+#define COMMAND_SINCE Doc::alias(QLatin1String("since"))
+#define COMMAND_SUBTITLE Doc::alias(QLatin1String("subtitle"))
+#define COMMAND_THREADSAFE Doc::alias(QLatin1String("threadsafe"))
+#define COMMAND_TITLE Doc::alias(QLatin1String("title"))
+
+QString CodeParser::currentSubDir_;
+QList<CodeParser *> CodeParser::parsers;
+bool CodeParser::showInternal = false;
+QMap<QString,QString> CodeParser::nameToTitle;
+
+/*!
+ The constructor adds this code parser to the static
+ list of code parsers.
+ */
+CodeParser::CodeParser()
+{
+ parsers.prepend(this);
+}
+
+/*!
+ The destructor removes this code parser from the static
+ list of code parsers.
+ */
+CodeParser::~CodeParser()
+{
+ parsers.removeAll(this);
+}
+
+/*!
+ Initialize the code parser base class.
+ */
+void CodeParser::initializeParser(const Config& config)
+{
+ showInternal = config.getBool(QLatin1String(CONFIG_SHOWINTERNAL));
+}
+
+/*!
+ Terminating a code parser is trivial.
+ */
+void CodeParser::terminateParser()
+{
+ // nothing.
+}
+
+QStringList CodeParser::headerFileNameFilter()
+{
+ return sourceFileNameFilter();
+}
+
+void CodeParser::parseHeaderFile(const Location& location,
+ const QString& filePath,
+ Tree *tree)
+{
+ parseSourceFile(location, filePath, tree);
+}
+
+void CodeParser::doneParsingHeaderFiles(Tree *tree)
+{
+ doneParsingSourceFiles(tree);
+}
+
+/*!
+ All the code parsers in the static list are initialized here,
+ after the qdoc configuration variables have been set.
+ */
+void CodeParser::initialize(const Config& config)
+{
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+ (*p)->initializeParser(config);
+ ++p;
+ }
+}
+
+/*!
+ All the code parsers in the static list are terminated here.
+ */
+void CodeParser::terminate()
+{
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+ (*p)->terminateParser();
+ ++p;
+ }
+}
+
+CodeParser *CodeParser::parserForLanguage(const QString& language)
+{
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+ if ((*p)->language() == language)
+ return *p;
+ ++p;
+ }
+ return 0;
+}
+
+CodeParser *CodeParser::parserForHeaderFile(const QString &filePath)
+{
+ QString fileName = QFileInfo(filePath).fileName();
+
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+
+ QStringList headerPatterns = (*p)->headerFileNameFilter();
+ foreach (QString pattern, headerPatterns) {
+ QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
+ if (re.exactMatch(fileName))
+ return *p;
+ }
+ ++p;
+ }
+ return 0;
+}
+
+CodeParser *CodeParser::parserForSourceFile(const QString &filePath)
+{
+ QString fileName = QFileInfo(filePath).fileName();
+
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+
+ QStringList sourcePatterns = (*p)->sourceFileNameFilter();
+ foreach (QString pattern, sourcePatterns) {
+ QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
+ if (re.exactMatch(fileName))
+ return *p;
+ }
+ ++p;
+ }
+ return 0;
+}
+
+/*!
+ Returns the set of strings representing the common metacommands.
+ */
+QSet<QString> CodeParser::commonMetaCommands()
+{
+ return QSet<QString>() << COMMAND_COMPAT
+ << COMMAND_DEPRECATED
+ << COMMAND_INGROUP
+ << COMMAND_INMODULE
+ << COMMAND_INQMLMODULE
+ << COMMAND_INTERNAL
+ << COMMAND_MAINCLASS
+ << COMMAND_NONREENTRANT
+ << COMMAND_OBSOLETE
+ << COMMAND_PAGEKEYWORDS
+ << COMMAND_PRELIMINARY
+ << COMMAND_INPUBLICGROUP
+ << COMMAND_REENTRANT
+ << COMMAND_SINCE
+ << COMMAND_SUBTITLE
+ << COMMAND_THREADSAFE
+ << COMMAND_TITLE;
+}
+
+/*!
+ The topic command has been processed. Now process the other
+ metacommands that were found. These are not the text markup
+ commands.
+ */
+void CodeParser::processCommonMetaCommand(const Location& location,
+ const QString& command,
+ const QString& arg,
+ Node* node,
+ Tree* tree)
+{
+ if (command == COMMAND_COMPAT) {
+ location.warning(tr("\\compat command used, but Qt3 compatibility is no longer supported"));
+ node->setStatus(Node::Compat);
+ }
+ else if (command == COMMAND_DEPRECATED) {
+ node->setStatus(Node::Deprecated);
+ }
+ else if (command == COMMAND_INGROUP) {
+ tree->addToGroup(node, arg);
+ }
+ else if (command == COMMAND_INPUBLICGROUP) {
+ tree->addToPublicGroup(node, arg);
+ }
+ else if (command == COMMAND_INMODULE) {
+ node->setModuleName(arg);
+ }
+ else if (command == COMMAND_INQMLMODULE) {
+ node->setQmlModuleName(arg);
+ tree->addToQmlModule(node,arg);
+ QString qmid = node->qmlModuleIdentifier();
+ QmlClassNode* qcn = static_cast<QmlClassNode*>(node);
+ QmlClassNode::moduleMap.insert(qmid + QLatin1String("::") + node->name(), qcn);
+ }
+ else if (command == COMMAND_MAINCLASS) {
+ node->setStatus(Node::Main);
+ }
+ else if (command == COMMAND_OBSOLETE) {
+ if (node->status() != Node::Compat)
+ node->setStatus(Node::Obsolete);
+ }
+ else if (command == COMMAND_NONREENTRANT) {
+ node->setThreadSafeness(Node::NonReentrant);
+ }
+ else if (command == COMMAND_PRELIMINARY) {
+ node->setStatus(Node::Preliminary);
+ }
+ else if (command == COMMAND_INTERNAL) {
+ if (!showInternal) {
+ node->setAccess(Node::Private);
+ node->setStatus(Node::Internal);
+ }
+ }
+ else if (command == COMMAND_REENTRANT) {
+ node->setThreadSafeness(Node::Reentrant);
+ }
+ else if (command == COMMAND_SINCE) {
+ node->setSince(arg);
+ }
+ else if (command == COMMAND_PAGEKEYWORDS) {
+ node->addPageKeywords(arg);
+ }
+ else if (command == COMMAND_SUBTITLE) {
+ if (node->type() == Node::Fake) {
+ FakeNode *fake = static_cast<FakeNode *>(node);
+ fake->setSubTitle(arg);
+ }
+ else
+ location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
+ }
+ else if (command == COMMAND_THREADSAFE) {
+ node->setThreadSafeness(Node::ThreadSafe);
+ }
+ else if (command == COMMAND_TITLE) {
+ if (node->type() == Node::Fake) {
+ FakeNode *fake = static_cast<FakeNode *>(node);
+ fake->setTitle(arg);
+ if (fake->subType() == Node::Example) {
+ ExampleNode::exampleNodeMap.insert(fake->title(),static_cast<ExampleNode*>(fake));
+ }
+ nameToTitle.insert(fake->name(),arg);
+ }
+ else
+ location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE));
+ }
+}
+
+/*!
+ Find the page title given the page \a name and return it.
+ */
+const QString CodeParser::titleFromName(const QString& name)
+{
+ const QString t = nameToTitle.value(name);
+ return t;
+}
+
+/*!
+ \internal
+ */
+void CodeParser::extractPageLinkAndDesc(const QString& arg,
+ QString* link,
+ QString* desc)
+{
+ QRegExp bracedRegExp(QLatin1String("\\{([^{}]*)\\}(?:\\{([^{}]*)\\})?"));
+
+ if (bracedRegExp.exactMatch(arg)) {
+ *link = bracedRegExp.cap(1);
+ *desc = bracedRegExp.cap(2);
+ if (desc->isEmpty())
+ *desc = *link;
+ }
+ else {
+ int spaceAt = arg.indexOf(QLatin1Char(' '));
+ if (arg.contains(QLatin1String(".html")) && spaceAt != -1) {
+ *link = arg.left(spaceAt).trimmed();
+ *desc = arg.mid(spaceAt).trimmed();
+ }
+ else {
+ *link = arg;
+ *desc = arg;
+ }
+ }
+}
+
+/*!
+ \internal
+ */
+void CodeParser::setLink(Node* node, Node::LinkType linkType, const QString& arg)
+{
+ QString link;
+ QString desc;
+ extractPageLinkAndDesc(arg, &link, &desc);
+ node->setLink(linkType, link, desc);
+}
+
+/*!
+ If the \e {basedir} variable is not set in the qdocconf
+ file, do nothing.
+
+ Otherwise, search for the basedir string string in the
+ \a filePath. It must be found, or else a warning message
+ is output. Extract the subdirectory name that follows the
+ basedir name and create a subdirectory using that name
+ in the output director.
+ */
+void CodeParser::createOutputSubdirectory(const Location& location,
+ const QString& filePath)
+{
+ QString bd = Generator::baseDir();
+ if (!bd.isEmpty()) {
+ int baseIdx = filePath.indexOf(bd);
+ if (baseIdx == -1)
+ location.warning(tr("File path: '%1' does not contain bundle base dir: '%2'")
+ .arg(filePath).arg(bd));
+ else {
+ int subDirIdx = filePath.indexOf(QLatin1Char('/'),baseIdx);
+ if (subDirIdx == -1)
+ location.warning(tr("File path: '%1' has no sub dir after bundle base dir: '%2'")
+ .arg(filePath).arg(bd));
+ else {
+ ++subDirIdx;
+ int fileNameIdx = filePath.indexOf(QLatin1Char('/'),subDirIdx);
+ if (fileNameIdx == -1)
+ location.warning(tr("File path: '%1' has no file name after sub dir: '%2/'")
+ .arg(filePath).arg(filePath.mid(subDirIdx)));
+ else {
+ currentSubDir_ = filePath.mid(subDirIdx,fileNameIdx-subDirIdx);
+ if (currentSubDir_.isEmpty())
+ location.warning(tr("File path: '%1' has no sub dir after bundle base dir: '%2'")
+ .arg(filePath).arg(bd));
+ else {
+ QString subDirPath = Generator::outputDir() + QLatin1Char('/') + currentSubDir_;
+ QDir dirInfo;
+ if (!dirInfo.exists(subDirPath)) {
+ if (!dirInfo.mkpath(subDirPath))
+ location.fatal(tr("Cannot create output sub-directory '%1'").arg(currentSubDir_));
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/tools/qdoc/codeparser.h b/src/tools/qdoc/codeparser.h
new file mode 100644
index 0000000000..f522567ddb
--- /dev/null
+++ b/src/tools/qdoc/codeparser.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ codeparser.h
+*/
+
+#ifndef CODEPARSER_H
+#define CODEPARSER_H
+
+#include <QSet>
+
+#include "node.h"
+
+QT_BEGIN_NAMESPACE
+
+class Config;
+class Node;
+class QString;
+class Tree;
+
+class CodeParser
+{
+public:
+ CodeParser();
+ virtual ~CodeParser();
+
+ virtual void initializeParser(const Config& config);
+ virtual void terminateParser();
+ virtual QString language() = 0;
+ virtual QStringList headerFileNameFilter();
+ virtual QStringList sourceFileNameFilter() = 0;
+ virtual void parseHeaderFile(const Location& location,
+ const QString& filePath, Tree *tree);
+ virtual void parseSourceFile(const Location& location,
+ const QString& filePath, Tree *tree) = 0;
+ virtual void doneParsingHeaderFiles(Tree *tree);
+ virtual void doneParsingSourceFiles(Tree *tree) = 0;
+
+ void createOutputSubdirectory(const Location& location, const QString& filePath);
+
+ static void initialize(const Config& config);
+ static void terminate();
+ static CodeParser *parserForLanguage(const QString& language);
+ static CodeParser *parserForHeaderFile(const QString &filePath);
+ static CodeParser *parserForSourceFile(const QString &filePath);
+ static const QString titleFromName(const QString& name);
+ static void setLink(Node* node, Node::LinkType linkType, const QString& arg);
+ static const QString& currentOutputSubdirectory() { return currentSubDir_; }
+
+protected:
+ QSet<QString> commonMetaCommands();
+ void processCommonMetaCommand(const Location& location,
+ const QString& command, const QString& arg,
+ Node *node, Tree *tree);
+ static void extractPageLinkAndDesc(const QString& arg,
+ QString* link,
+ QString* desc);
+
+private:
+ static QString currentSubDir_;
+ static QList<CodeParser *> parsers;
+ static bool showInternal;
+ static QMap<QString,QString> nameToTitle;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp
new file mode 100644
index 0000000000..f97b6ca93f
--- /dev/null
+++ b/src/tools/qdoc/config.cpp
@@ -0,0 +1,978 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ config.cpp
+*/
+
+#include <QDir>
+#include <QVariant>
+#include <QFile>
+#include <QTemporaryFile>
+#include <QTextStream>
+#include <qdebug.h>
+#include "config.h"
+#include <stdlib.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ An entry on the MetaStack.
+ */
+class MetaStackEntry
+{
+public:
+ void open();
+ void close();
+
+ QStringList accum;
+ QStringList next;
+};
+
+/*
+ */
+void MetaStackEntry::open()
+{
+ next.append(QString());
+}
+
+/*
+ */
+void MetaStackEntry::close()
+{
+ accum += next;
+ next.clear();
+}
+
+/*
+ ###
+*/
+class MetaStack : private QStack<MetaStackEntry>
+{
+public:
+ MetaStack();
+
+ void process(QChar ch, const Location& location);
+ QStringList getExpanded(const Location& location);
+};
+
+MetaStack::MetaStack()
+{
+ push(MetaStackEntry());
+ top().open();
+}
+
+void MetaStack::process(QChar ch, const Location& location)
+{
+ if (ch == QLatin1Char('{')) {
+ push(MetaStackEntry());
+ top().open();
+ }
+ else if (ch == QLatin1Char('}')) {
+ if (count() == 1)
+ location.fatal(tr("Unexpected '}'"));
+
+ top().close();
+ QStringList suffixes = pop().accum;
+ QStringList prefixes = top().next;
+
+ top().next.clear();
+ QStringList::ConstIterator pre = prefixes.begin();
+ while (pre != prefixes.end()) {
+ QStringList::ConstIterator suf = suffixes.begin();
+ while (suf != suffixes.end()) {
+ top().next << (*pre + *suf);
+ ++suf;
+ }
+ ++pre;
+ }
+ }
+ else if (ch == QLatin1Char(',') && count() > 1) {
+ top().close();
+ top().open();
+ }
+ else {
+ QStringList::Iterator pre = top().next.begin();
+ while (pre != top().next.end()) {
+ *pre += ch;
+ ++pre;
+ }
+ }
+}
+
+QStringList MetaStack::getExpanded(const Location& location)
+{
+ if (count() > 1)
+ location.fatal(tr("Missing '}'"));
+
+ top().close();
+ return top().accum;
+}
+
+QT_STATIC_CONST_IMPL QString Config::dot = QLatin1String(".");
+QString Config::overrideOutputDir;
+QSet<QString> Config::overrideOutputFormats;
+QMap<QString, QString> Config::extractedDirs;
+int Config::numInstances;
+
+/*!
+ \class Config
+ \brief The Config class contains the configuration variables
+ for controlling how qdoc produces documentation.
+
+ Its load() function, reads, parses, and processes a qdocconf file.
+ */
+
+/*!
+ The constructor sets the \a programName and initializes all
+ internal state variables to empty values.
+ */
+Config::Config(const QString& programName)
+ : prog(programName)
+{
+ loc = Location::null;
+ lastLoc = Location::null;
+ locMap.clear();
+ stringValueMap.clear();
+ stringListValueMap.clear();
+ numInstances++;
+}
+
+/*!
+ The destructor has nothing special to do.
+ */
+Config::~Config()
+{
+}
+
+/*!
+ Loads and parses the qdoc configuration file \a fileName.
+ This function calls the other load() function, which does
+ the loading, parsing, and processing of the configuration
+ file.
+
+ Intializes the location variables returned by location()
+ and lastLocation().
+ */
+void Config::load(const QString& fileName)
+{
+ load(Location::null, fileName);
+ if (loc.isEmpty()) {
+ loc = Location(fileName);
+ }
+ else {
+ loc.setEtc(true);
+ }
+ lastLoc = Location::null;
+}
+
+/*!
+ Writes the qdoc configuration data to the named file.
+ The previous contents of the file are overwritten.
+ */
+void Config::unload(const QString& fileName)
+{
+ QStringMultiMap::ConstIterator v = stringValueMap.begin();
+ while (v != stringValueMap.end()) {
+ qDebug() << v.key() << " = " << v.value();
+#if 0
+ if (v.key().startsWith(varDot)) {
+ QString subVar = v.key().mid(varDot.length());
+ int dot = subVar.indexOf(QLatin1Char('.'));
+ if (dot != -1)
+ subVar.truncate(dot);
+ t.insert(subVar,v.value());
+ }
+#endif
+ ++v;
+ }
+ qDebug() << "fileName:" << fileName;
+}
+
+/*!
+ Joins all the strings in \a values into a single string with the
+ individual \a values separated by ' '. Then it inserts the result
+ into the string list map with \a var as the key.
+
+ It also inserts the \a values string list into a separate map,
+ also with \a var as the key.
+ */
+void Config::setStringList(const QString& var, const QStringList& values)
+{
+ stringValueMap[var] = values.join(QLatin1String(" "));
+ stringListValueMap[var] = values;
+}
+
+/*!
+ Looks up the configuarion variable \a var in the string
+ map and returns the boolean value.
+ */
+bool Config::getBool(const QString& var) const
+{
+ return QVariant(getString(var)).toBool();
+}
+
+/*!
+ Looks up the configuration variable \a var in the string list
+ map. Iterates through the string list found, interpreting each
+ string in the list as an integer and adding it to a total sum.
+ Returns the sum.
+ */
+int Config::getInt(const QString& var) const
+{
+ QStringList strs = getStringList(var);
+ QStringList::ConstIterator s = strs.begin();
+ int sum = 0;
+
+ while (s != strs.end()) {
+ sum += (*s).toInt();
+ ++s;
+ }
+ return sum;
+}
+
+/*!
+ Function to return the correct outputdir.
+ outputdir can be set using the qdocconf or the command-line
+ variable -outputdir.
+ */
+QString Config::getOutputDir() const
+{
+ if (overrideOutputDir.isNull())
+ return getString(QLatin1String(CONFIG_OUTPUTDIR));
+ else
+ return overrideOutputDir;
+}
+
+/*!
+ Function to return the correct outputformats.
+ outputformats can be set using the qdocconf or the command-line
+ variable -outputformat.
+ */
+QSet<QString> Config::getOutputFormats() const
+{
+ if (overrideOutputFormats.isEmpty())
+ return getStringSet(QLatin1String(CONFIG_OUTPUTFORMATS));
+ else
+ return overrideOutputFormats;
+}
+
+/*!
+ First, this function looks up the configuration variable \a var
+ in the location map and, if found, sets the internal variable
+ \c{lastLoc} to the Location that \a var maps to.
+
+ Then it looks up the configuration variable \a var in the string
+ map, and returns the string that \a var maps to.
+ */
+QString Config::getString(const QString& var) const
+{
+ if (!locMap[var].isEmpty())
+ (Location&) lastLoc = locMap[var];
+ return stringValueMap[var];
+}
+
+/*!
+ Looks up the configuration variable \a var in the string
+ list map, converts the string list it maps to into a set
+ of strings, and returns the set.
+ */
+QSet<QString> Config::getStringSet(const QString& var) const
+{
+ return QSet<QString>::fromList(getStringList(var));
+}
+
+/*!
+ First, this function looks up the configuration variable \a var
+ in the location map and, if found, sets the internal variable
+ \c{lastLoc} the Location that \a var maps to.
+
+ Then it looks up the configuration variable \a var in the string
+ list map, and returns the string list that \a var maps to.
+ */
+QStringList Config::getStringList(const QString& var) const
+{
+ if (!locMap[var].isEmpty())
+ (Location&) lastLoc = locMap[var];
+ return stringListValueMap[var];
+}
+
+/*!
+ This function should only be called when the configuration
+ variable \a var maps to a string list that contains file paths.
+ It cleans the paths with QDir::cleanPath() before returning
+ them.
+
+ First, this function looks up the configuratio