summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/setcepaths.bat10
-rwxr-xr-xconfigure1
-rw-r--r--demos/browser/browser.pro2
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.cpp4
-rw-r--r--demos/qmediaplayer/mediaplayer.cpp3
-rw-r--r--demos/qtdemo/xml/examples.xml2
-rw-r--r--demos/sub-attaq/boat.cpp2
-rw-r--r--doc/doc.pri6
-rw-r--r--doc/src/deployment/deployment.qdoc25
-rw-r--r--doc/src/diagrams/gestures/pangesture.svg273
-rw-r--r--doc/src/diagrams/gestures/pinchgesture.svg341
-rw-r--r--doc/src/diagrams/gestures/swipegesture-details.svg168
-rw-r--r--doc/src/diagrams/gestures/swipegesture.svg158
-rw-r--r--doc/src/examples/audiodevices.qdoc2
-rw-r--r--doc/src/examples/audioinput.qdoc2
-rw-r--r--doc/src/examples/audiooutput.qdoc2
-rw-r--r--doc/src/examples/videographicsitem.qdoc2
-rw-r--r--doc/src/examples/videowidget.qdoc30
-rw-r--r--doc/src/frameworks-technologies/gestures.qdoc249
-rw-r--r--doc/src/getting-started/examples.qdoc17
-rw-r--r--doc/src/howtos/openvg.qdoc4
-rw-r--r--doc/src/images/pangesture.pngbin0 -> 7153 bytes
-rw-r--r--doc/src/images/pinchgesture.pngbin0 -> 10094 bytes
-rw-r--r--doc/src/images/swipegesture.pngbin0 -> 6864 bytes
-rw-r--r--doc/src/snippets/gestures/imageviewer/imagewidget.cpp364
-rw-r--r--doc/src/snippets/gestures/imageviewer/imagewidget.h137
-rw-r--r--doc/src/snippets/gestures/imageviewer/tapandholdgesture.cpp159
-rw-r--r--doc/src/snippets/gestures/imageviewer/tapandholdgesture.h74
-rw-r--r--doc/src/snippets/gestures/qgesture.cpp283
-rw-r--r--doc/src/snippets/gestures/qgesture.h101
-rw-r--r--doc/src/snippets/gestures/qstandardgestures.cpp483
-rw-r--r--doc/src/snippets/gestures/qstandardgestures.h126
-rw-r--r--examples/effects/effects.pro6
-rw-r--r--examples/examples.pro3
-rw-r--r--examples/gestures/gestures.pro2
-rw-r--r--examples/gestures/imagegestures/imagegestures.pro (renamed from examples/gestures/imageviewer/imageviewer.pro)8
-rw-r--r--examples/gestures/imagegestures/imagewidget.cpp (renamed from examples/gestures/imageviewer/imagewidget.cpp)17
-rw-r--r--examples/gestures/imagegestures/imagewidget.h (renamed from examples/gestures/imageviewer/imagewidget.h)18
-rw-r--r--examples/gestures/imagegestures/main.cpp59
-rw-r--r--examples/gestures/imagegestures/mainwidget.cpp56
-rw-r--r--examples/gestures/imagegestures/mainwidget.h65
-rw-r--r--examples/gestures/imageviewer/main.cpp90
-rw-r--r--examples/multimedia/audio/audio.pro10
-rw-r--r--examples/multimedia/audiodevices/audiodevices.cpp (renamed from examples/multimedia/audio/audiodevices/audiodevices.cpp)0
-rw-r--r--examples/multimedia/audiodevices/audiodevices.h (renamed from examples/multimedia/audio/audiodevices/audiodevices.h)0
-rw-r--r--examples/multimedia/audiodevices/audiodevices.pro (renamed from examples/multimedia/audio/audiodevices/audiodevices.pro)4
-rw-r--r--examples/multimedia/audiodevices/audiodevicesbase.ui (renamed from examples/multimedia/audio/audiodevices/audiodevicesbase.ui)0
-rw-r--r--examples/multimedia/audiodevices/main.cpp (renamed from examples/multimedia/audio/audiodevices/main.cpp)0
-rw-r--r--examples/multimedia/audioinput/audioinput.cpp (renamed from examples/multimedia/audio/audioinput/audioinput.cpp)0
-rw-r--r--examples/multimedia/audioinput/audioinput.h (renamed from examples/multimedia/audio/audioinput/audioinput.h)0
-rw-r--r--examples/multimedia/audioinput/audioinput.pro (renamed from examples/multimedia/audio/audioinput/audioinput.pro)4
-rw-r--r--examples/multimedia/audioinput/main.cpp (renamed from examples/multimedia/audio/audioinput/main.cpp)0
-rw-r--r--examples/multimedia/audiooutput/audiooutput.cpp (renamed from examples/multimedia/audio/audiooutput/audiooutput.cpp)0
-rw-r--r--examples/multimedia/audiooutput/audiooutput.h (renamed from examples/multimedia/audio/audiooutput/audiooutput.h)0
-rw-r--r--examples/multimedia/audiooutput/audiooutput.pro (renamed from examples/multimedia/audio/audiooutput/audiooutput.pro)4
-rw-r--r--examples/multimedia/audiooutput/main.cpp (renamed from examples/multimedia/audio/audiooutput/main.cpp)0
-rw-r--r--examples/multimedia/multimedia.pro14
-rw-r--r--examples/multimedia/videographicsitem/main.cpp (renamed from examples/video/videographicsitem/main.cpp)0
-rw-r--r--examples/multimedia/videographicsitem/videographicsitem.pro (renamed from examples/video/videographicsitem/videographicsitem.pro)4
-rw-r--r--examples/multimedia/videographicsitem/videoitem.cpp (renamed from examples/video/videographicsitem/videoitem.cpp)0
-rw-r--r--examples/multimedia/videographicsitem/videoitem.h (renamed from examples/video/videographicsitem/videoitem.h)0
-rw-r--r--examples/multimedia/videographicsitem/videoplayer.cpp (renamed from examples/video/videographicsitem/videoplayer.cpp)0
-rw-r--r--examples/multimedia/videographicsitem/videoplayer.h (renamed from examples/video/videographicsitem/videoplayer.h)0
-rw-r--r--examples/multimedia/videowidget/main.cpp (renamed from examples/video/videowidget/main.cpp)0
-rw-r--r--examples/multimedia/videowidget/videoplayer.cpp (renamed from examples/video/videowidget/videoplayer.cpp)0
-rw-r--r--examples/multimedia/videowidget/videoplayer.h (renamed from examples/video/videowidget/videoplayer.h)0
-rw-r--r--examples/multimedia/videowidget/videowidget.cpp (renamed from examples/video/videowidget/videowidget.cpp)0
-rw-r--r--examples/multimedia/videowidget/videowidget.h (renamed from examples/video/videowidget/videowidget.h)0
-rw-r--r--examples/multimedia/videowidget/videowidget.pro (renamed from examples/video/videowidget/videowidget.pro)6
-rw-r--r--examples/multimedia/videowidget/videowidgetsurface.cpp (renamed from examples/video/videowidget/videowidgetsurface.cpp)0
-rw-r--r--examples/multimedia/videowidget/videowidgetsurface.h (renamed from examples/video/videowidget/videowidgetsurface.h)0
-rw-r--r--examples/opengl/pbuffers/cube.h2
-rw-r--r--examples/opengl/pbuffers/glwidget.h2
-rw-r--r--examples/video/video.pro6
-rw-r--r--mkspecs/features/symbian/stl.prf2
-rw-r--r--mkspecs/features/uitools.prf4
-rw-r--r--projects.pro10
-rw-r--r--qmake/generators/metamakefile.cpp268
-rw-r--r--qmake/generators/symbian/symmake.cpp100
-rw-r--r--qmake/project.cpp47
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp30
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h6
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.cpp6
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp4
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/mmf_medianode.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp273
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.h19
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp144
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h30
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp114
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h10
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp20
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h40
-rw-r--r--src/3rdparty/phonon/mmf/utils.cpp8
-rw-r--r--src/3rdparty/phonon/mmf/utils.h18
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.cpp58
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp2
-rw-r--r--src/corelib/animation/qabstractanimation.cpp21
-rw-r--r--src/corelib/animation/qpauseanimation.cpp3
-rw-r--r--src/corelib/global/qnamespace.h4
-rw-r--r--src/corelib/global/qnamespace.qdoc4
-rw-r--r--src/corelib/io/qsettings.cpp24
-rw-r--r--src/corelib/kernel/qcoreevent.cpp1
-rw-r--r--src/corelib/kernel/qcoreevent.h1
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp6
-rw-r--r--src/corelib/tools/qdatetime.cpp62
-rw-r--r--src/gui/dialogs/qerrormessage.cpp13
-rw-r--r--src/gui/dialogs/qprintdialog_mac.mm4
-rw-r--r--src/gui/dialogs/qprogressdialog.cpp2
-rw-r--r--src/gui/dialogs/qwizard.cpp2
-rw-r--r--src/gui/effects/qgraphicseffect.cpp52
-rw-r--r--src/gui/egl/qegl_qws.cpp3
-rw-r--r--src/gui/embedded/directfb.pri2
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.cpp15
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/gui/image/qiconloader.cpp6
-rw-r--r--src/gui/image/qimage.cpp3
-rw-r--r--src/gui/image/qpixmap.cpp28
-rw-r--r--src/gui/image/qpixmap_mac.cpp5
-rw-r--r--src/gui/image/qpixmap_mac_p.h2
-rw-r--r--src/gui/image/qpixmap_raster.cpp28
-rw-r--r--src/gui/image/qpixmap_raster_p.h2
-rw-r--r--src/gui/image/qpixmap_x11.cpp5
-rw-r--r--src/gui/image/qpixmap_x11_p.h2
-rw-r--r--src/gui/image/qpixmapcache.cpp1
-rw-r--r--src/gui/image/qpixmapdata.cpp13
-rw-r--r--src/gui/image/qpixmapdata_p.h4
-rw-r--r--src/gui/image/qpixmapfilter.cpp51
-rw-r--r--src/gui/inputmethod/qmacinputcontext_mac.cpp6
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/gui/itemviews/qlistview.cpp28
-rw-r--r--src/gui/itemviews/qlistview_p.h1
-rw-r--r--src/gui/itemviews/qtreeview.cpp12
-rw-r--r--src/gui/kernel/kernel.pri1
-rw-r--r--src/gui/kernel/qaction.cpp2
-rw-r--r--src/gui/kernel/qapplication.cpp23
-rw-r--r--src/gui/kernel/qapplication_s60.cpp149
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm27
-rw-r--r--src/gui/kernel/qdesktopwidget.cpp67
-rw-r--r--src/gui/kernel/qdesktopwidget.h6
-rw-r--r--src/gui/kernel/qevent.cpp42
-rw-r--r--src/gui/kernel/qgesture.cpp268
-rw-r--r--src/gui/kernel/qgesture.h8
-rw-r--r--src/gui/kernel/qgesturerecognizer.cpp24
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp6
-rw-r--r--src/gui/kernel/qwidget.cpp52
-rw-r--r--src/gui/kernel/qwidget.h6
-rw-r--r--src/gui/kernel/qwidget_mac.mm15
-rw-r--r--src/gui/kernel/qwidget_p.h56
-rw-r--r--src/gui/kernel/qwidget_s60.cpp85
-rw-r--r--src/gui/kernel/qwidget_wince.cpp20
-rw-r--r--src/gui/kernel/qwidget_x11.cpp71
-rw-r--r--src/gui/painting/qblendfunctions.cpp4
-rw-r--r--src/gui/painting/qpaintdevice.cpp5
-rw-r--r--src/gui/painting/qpaintdevice.h1
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp11
-rw-r--r--src/gui/painting/qpainter.cpp64
-rw-r--r--src/gui/painting/qrasterizer.cpp6
-rw-r--r--src/gui/painting/qstroker.cpp39
-rw-r--r--src/gui/painting/qstroker_p.h15
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp7
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp2
-rw-r--r--src/gui/s60framework/qs60maindocument.cpp2
-rw-r--r--src/gui/styles/qwindowsmobilestyle.cpp2
-rw-r--r--src/gui/text/qfontengine_mac.mm76
-rw-r--r--src/gui/text/qfontengine_p.h3
-rw-r--r--src/gui/text/qtextengine_mac.cpp9
-rw-r--r--src/gui/widgets/qcombobox.cpp5
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp3
-rw-r--r--src/gui/widgets/qlinecontrol.cpp2
-rw-r--r--src/gui/widgets/qmenu.cpp31
-rw-r--r--src/gui/widgets/qmenu_mac.mm4
-rw-r--r--src/gui/widgets/qmenu_p.h3
-rw-r--r--src/gui/widgets/qpushbutton.cpp4
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp51
-rw-r--r--src/multimedia/video/qvideosurfaceformat.h8
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp12
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h1
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp3
-rw-r--r--src/network/access/qnetworkreply.cpp3
-rw-r--r--src/network/access/qnetworkrequest.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp7
-rw-r--r--src/network/socket/qabstractsocket.cpp13
-rw-r--r--src/network/ssl/qsslsocket.cpp23
-rw-r--r--src/network/ssl/qsslsocket.h4
-rw-r--r--src/opengl/gl2paintengineex/qglcustomshaderstage.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp10
-rw-r--r--src/opengl/opengl.pro4
-rw-r--r--src/opengl/qgl.cpp71
-rw-r--r--src/opengl/qgl_p.h4
-rw-r--r--src/opengl/qgl_qws.cpp3
-rw-r--r--src/opengl/qglframebufferobject.cpp20
-rw-r--r--src/opengl/qglframebufferobject_p.h2
-rw-r--r--src/opengl/qglpaintdevice_p.h2
-rw-r--r--src/opengl/qglpaintdevice_qws.cpp96
-rw-r--r--src/opengl/qglpaintdevice_qws_p.h86
-rw-r--r--src/opengl/qglwindowsurface_qws.cpp1
-rw-r--r--src/opengl/qpaintengine_opengl.cpp30
-rw-r--r--src/opengl/qpixmapdata_gl.cpp31
-rw-r--r--src/opengl/qpixmapdata_gl_p.h2
-rw-r--r--src/opengl/qwindowsurface_gl.cpp20
-rw-r--r--src/opengl/util/composition_mode_colorburn.glsl4
-rw-r--r--src/opengl/util/composition_mode_colordodge.glsl4
-rw-r--r--src/opengl/util/composition_mode_darken.glsl2
-rw-r--r--src/opengl/util/composition_mode_difference.glsl2
-rw-r--r--src/opengl/util/composition_mode_exclusion.glsl2
-rw-r--r--src/opengl/util/composition_mode_hardlight.glsl6
-rw-r--r--src/opengl/util/composition_mode_lighten.glsl2
-rw-r--r--src/opengl/util/composition_mode_multiply.glsl2
-rw-r--r--src/opengl/util/composition_mode_overlay.glsl6
-rw-r--r--src/opengl/util/composition_mode_softlight.glsl10
-rw-r--r--src/opengl/util/conical_brush.glsl2
-rw-r--r--src/opengl/util/ellipse.glsl6
-rw-r--r--src/opengl/util/ellipse_aa.glsl56
-rw-r--r--src/opengl/util/ellipse_aa_copy.glsl11
-rw-r--r--src/opengl/util/ellipse_aa_radial.glsl24
-rw-r--r--src/opengl/util/ellipse_functions.glsl63
-rw-r--r--src/opengl/util/fragmentprograms_p.h2069
-rw-r--r--src/opengl/util/generator.cpp53
-rw-r--r--src/opengl/util/masks.conf1
-rw-r--r--src/opengl/util/pattern_brush.glsl4
-rw-r--r--src/opengl/util/simple_porter_duff.glsl6
-rw-r--r--src/opengl/util/trap_exact_aa.glsl12
-rw-r--r--src/openvg/qpaintengine_vg.cpp21
-rw-r--r--src/openvg/qpixmapdata_vg.cpp5
-rw-r--r--src/openvg/qpixmapdata_vg_p.h2
-rw-r--r--src/openvg/qpixmapfilter_vg.cpp140
-rw-r--r--src/openvg/qpixmapfilter_vg_p.h10
-rw-r--r--src/openvg/qwindowsurface_vg.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp77
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h11
-rw-r--r--src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c70
-rw-r--r--src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h18
-rw-r--r--src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h1
-rw-r--r--src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c14
-rw-r--r--src/plugins/gfxdrivers/powervr/README12
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp67
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h9
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp54
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h8
-rw-r--r--src/plugins/graphicssystems/shivavg/shivavgwindowsurface.cpp14
-rw-r--r--src/qt3support/widgets/q3combobox.cpp3
-rw-r--r--src/qt3support/widgets/q3toolbar.cpp2
-rw-r--r--src/script/api/qscriptengine.cpp12
-rw-r--r--src/script/api/qscriptengine_p.h5
-rw-r--r--src/script/api/qscriptengineagent.cpp2
-rw-r--r--src/script/api/qscriptvalue.h3
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp2
-rw-r--r--src/testlib/qtestlog.cpp5
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp18
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp45
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp2
-rw-r--r--tests/auto/qlabel/qlabel.pro21
-rw-r--r--tests/auto/qlabel/tst_qlabel.cpp58
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp49
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp14
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp40
-rw-r--r--tests/auto/qpauseanimation/tst_qpauseanimation.cpp3
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp14
-rw-r--r--tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp38
-rw-r--r--tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp56
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp9
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp3
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp14
-rw-r--r--tests/auto/qtreewidget/tst_qtreewidget.cpp39
-rw-r--r--tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp39
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp146
-rw-r--r--tools/qdoc3/cppcodemarker.cpp19
-rw-r--r--tools/qdoc3/cppcodeparser.cpp23
-rw-r--r--tools/qdoc3/htmlgenerator.cpp6
-rw-r--r--tools/qdoc3/node.cpp14
-rw-r--r--tools/qdoc3/node.h11
-rw-r--r--tools/qdoc3/test/qt-api-only-with-xcode.qdocconf29
-rw-r--r--tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf3
-rw-r--r--tools/qdoc3/test/qt-with-xcode.qdocconf3
-rw-r--r--tools/qtestlib/wince/cetest/main.cpp2
-rw-r--r--translations/designer_pl.ts2
-rw-r--r--translations/linguist_pl.ts16
-rw-r--r--translations/qt_pl.ts10
283 files changed, 5381 insertions, 5072 deletions
diff --git a/bin/setcepaths.bat b/bin/setcepaths.bat
index 15d8ff8..914e594 100755
--- a/bin/setcepaths.bat
+++ b/bin/setcepaths.bat
@@ -79,6 +79,11 @@ checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_creat
tmp_created_script_setup.bat
del tmp_created_script_setup.bat
echo Windows Mobile 6 Professional selected, environment is set up
+) ELSE IF "%1" EQU "wincewm65professional-msvc2005" (
+checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL
+tmp_created_script_setup.bat
+del tmp_created_script_setup.bat
+echo Windows Mobile 6 Professional selected, environment is set up
) ELSE IF "%1" EQU "wincewm60standard-msvc2005" (
checksdk.exe -sdk "Windows Mobile 6 Standard SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL
tmp_created_script_setup.bat
@@ -124,6 +129,11 @@ checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_creat
tmp_created_script_setup.bat
del tmp_created_script_setup.bat
echo Windows Mobile 6 Professional selected, environment is set up
+) ELSE IF "%1" EQU "wincewm65professional-msvc2008" (
+checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL
+tmp_created_script_setup.bat
+del tmp_created_script_setup.bat
+echo Windows Mobile 6 Professional selected, environment is set up
) ELSE IF "%1" EQU "wincewm60standard-msvc2008" (
checksdk.exe -sdk "Windows Mobile 6 Standard SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL
tmp_created_script_setup.bat
diff --git a/configure b/configure
index 323224c..485c71c 100755
--- a/configure
+++ b/configure
@@ -2873,7 +2873,6 @@ fi
# pass on $CFG_SDK to the configure tests.
if [ '!' -z "$CFG_SDK" ]; then
MAC_CONFIG_TEST_COMMANDLINE="-sdk $CFG_SDK"
- echo "tests command line: $MAC_CONFIG_TEST_COMMANDLINE"
fi
# find the default framework value
diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro
index 6c5f005..a42aa60 100644
--- a/demos/browser/browser.pro
+++ b/demos/browser/browser.pro
@@ -3,7 +3,7 @@ TARGET = browser
QT += webkit network
CONFIG += qt warn_on
-contains(QT_BUILD_PARTS, tools):!symbian:!embedded: CONFIG += uitools
+contains(QT_BUILD_PARTS, tools):!embedded: CONFIG += uitools
else: DEFINES += QT_NO_UITOOLS
release:DEFINES+=QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.cpp b/demos/embedded/fluidlauncher/fluidlauncher.cpp
index c065bc9..5e8cc03 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.cpp
+++ b/demos/embedded/fluidlauncher/fluidlauncher.cpp
@@ -265,6 +265,10 @@ void FluidLauncher::demoFinished()
{
setCurrentWidget(pictureFlowWidget);
inputTimer->start();
+
+ // Bring the Fluidlauncher to the foreground to allow selecting another demo
+ raise();
+ activateWindow();
}
void FluidLauncher::changeEvent(QEvent* event)
diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp
index baac236..e1ceb0e 100644
--- a/demos/qmediaplayer/mediaplayer.cpp
+++ b/demos/qmediaplayer/mediaplayer.cpp
@@ -367,6 +367,9 @@ void MediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
case Phonon::PausedState:
case Phonon::StoppedState:
playButton->setIcon(playIcon);
+
+ m_videoWidget->setFullScreen(false);
+
if (m_MediaObject.currentSource().type() != Phonon::MediaSource::Invalid){
playButton->setEnabled(true);
rewindButton->setEnabled(true);
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 2c31484..83bd200 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -154,7 +154,7 @@
<category dirname="phonon" name="Phonon">
<example filename="qmusicplayer" name="Music Player" />
</category>
- <category dirname="multimedia/audio" name="Multimedia">
+ <category dirname="multimedia" name="Multimedia">
<example filename="audiodevices" name="Audio Devices" />
<example filename="audiooutput" name="Audio Output" />
<example filename="audioinput" name="Audio Input" />
diff --git a/demos/sub-attaq/boat.cpp b/demos/sub-attaq/boat.cpp
index 3b1bac7..cb40329 100644
--- a/demos/sub-attaq/boat.cpp
+++ b/demos/sub-attaq/boat.cpp
@@ -87,7 +87,7 @@ Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big),
speed(0), bombsAlreadyLaunched(0), direction(Boat::None), movementAnimation(0)
{
setZValue(4);
- setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsFocusable);
+ setFlags(QGraphicsItem::ItemIsFocusable);
//The movement animation used to animate the boat
movementAnimation = new QPropertyAnimation(this, "pos");
diff --git a/doc/doc.pri b/doc/doc.pri
index 9105fbb..d4fdcd8 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -19,11 +19,7 @@ $$unixstyle {
QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES
QDOC = $$replace(QDOC, "/", "\\")
}
-macx {
- ADP_DOCS_QDOCCONF_FILE = qt-build-docs-with-xcode.qdocconf
-} else {
- ADP_DOCS_QDOCCONF_FILE = qt-build-docs.qdocconf
-}
+ADP_DOCS_QDOCCONF_FILE = qt-build-docs.qdocconf
QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \
linguist.qdocconf qmake.qdocconf) && \
(cd $$QT_BUILD_TREE && \
diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc
index f2bae23..b5b1b9c 100644
--- a/doc/src/deployment/deployment.qdoc
+++ b/doc/src/deployment/deployment.qdoc
@@ -345,6 +345,7 @@
are many ways to solve this:
\list
+
\o You can install the Qt libraries in one of the system
library paths (e.g. \c /usr/lib on most systems).
@@ -804,6 +805,30 @@
compiler version against the same C runtime version. This prevents
deploying errors caused by different versions of the C runtime libraries.
+ \section2 Visual Studio 2008 And Manual Installs
+
+ As well as the above details for VS 2005 and onwards, Visual Studio 2008
+ applications may have problems when deploying manually, say to a USB
+ stick.
+
+ The recommended procedure is to configure Qt with the \c -plugin-manifests
+ option using the 'configure' tool. Then follow the \l {http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx}{guidelines}
+ for manually deploying private assemblies.
+
+ In brief the steps are
+
+ \list 1
+
+ \o create a folder structure on the development computer that will match the target USB stick directory structure, for example '\\app' and for your dlls, '\\app\\lib'.
+
+ \o on the development computer, from the appropriate 'redist' folder copy over Microsoft.VC80.CRT and Microsoft.VC80.MFC to the directories '\\app' and '\\app\\lib' on the development PC.
+
+ \o xcopy the \\app folder to the target USB stick.
+ \endlist
+
+ Your application should now run. Also be aware that even with a service
+ pack installed the Windows DLLs that are linked to will be the defaults. See
+ the information on \l {http://msdn.microsoft.com/en-us/library/cc664727.aspx}{how to select the appropriate target DLLs}.
\section1 Application Dependencies
diff --git a/doc/src/diagrams/gestures/pangesture.svg b/doc/src/diagrams/gestures/pangesture.svg
new file mode 100644
index 0000000..c5b95ca
--- /dev/null
+++ b/doc/src/diagrams/gestures/pangesture.svg
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="pangesture.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient3198">
+ <stop
+ style="stop-color:#c8c8e1;stop-opacity:1;"
+ offset="0"
+ id="stop3200" />
+ <stop
+ style="stop-color:#e0e0e0;stop-opacity:0;"
+ offset="1"
+ id="stop3202" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2473"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3198"
+ id="linearGradient3204"
+ x1="487.5"
+ y1="158.61218"
+ x2="487.5"
+ y2="171.11218"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-143.75,1.0517187e-5)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2"
+ inkscape:cx="297.42699"
+ inkscape:cy="855.02875"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1184"
+ inkscape:window-height="668"
+ inkscape:window-x="152"
+ inkscape:window-y="228">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ units="pt"
+ spacingx="1pt"
+ spacingy="1pt" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3235"
+ width="275"
+ height="162.5"
+ x="137.5"
+ y="114.86218"
+ ry="25.253815"
+ rx="25.253815"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:5, 5;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3167"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(62.5,18.75)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#c90000;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3169"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(206.25,18.75)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:5.625, 5.625;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 200,183.61218 C 243.75,171.11218 300,171.11218 343.75,183.61218"
+ sodipodi:nodetypes="cc"
+ id="path12"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <g
+ id="g3214"
+ transform="translate(2.07835,-3.2783474)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72">
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 316.67165,230.64053 C 318.73754,225.81328 330.55722,234.70496 337.5,236.73718 L 337.5,189.86218 C 337.5,180.48718 346.875,180.48718 346.875,189.86218 L 346.875,222.67468 L 346.875,208.61218 C 346.875,203.92468 356.25,203.92468 356.25,208.61218 L 356.25,222.67468 L 356.25,213.29968 C 356.25,208.61218 365.625,208.61218 365.625,213.29968 L 365.625,227.36218 L 365.625,217.98718 C 365.625,213.29968 375,213.29968 375,217.98718 L 375,264.86218 C 365.625,269.54968 346.875,269.54968 337.5,264.86218 L 337.5,250.79968 C 331.50558,243.39877 314.0625,236.73718 316.67165,230.64053 z"
+ id="path2480"
+ sodipodi:nodetypes="ccccccccccccccccc" />
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.9375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 345.62962,192.2547 C 345.62962,188.66774 345.62962,185.08078 342.1875,185.08078 C 338.7454,185.08078 338.7454,188.66774 338.7454,192.2547 C 338.7454,195.84166 345.62962,195.84166 345.62962,192.2547 z"
+ id="path2478"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ id="path3218"
+ d="M 165.625,142.98718 L 175,133.61218 L 184.375,142.98718 L 165.625,142.98718 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ sodipodi:nodetypes="cccc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 193.75,139.86218 L 206.25,127.36218 L 218.75,139.86218 L 193.75,139.86218 z"
+ id="path3220" />
+ <path
+ style="fill:none;fill-opacity:0.75000000000000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 143.75,164.86218 L 175,133.61218 L 187.5,146.11218 L 206.25,127.36218 L 243.75,164.86218"
+ id="path3157"
+ sodipodi:nodetypes="ccccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ id="path3222"
+ d="M 237.5,146.11218 L 243.75,139.86218 L 250,146.11218 L 237.5,146.11218 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:none;fill-opacity:0.75000000000000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 231.25,152.36218 L 243.75,139.86218 L 256.25,152.36218"
+ id="path3159"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path3186"
+ d="M 175,158.61218 L 187.5,146.11218"
+ style="fill:none;fill-opacity:0.75000000000000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:url(#linearGradient3204);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 281.25,171.11218 L 318.75,133.61218 L 331.25,146.11218 L 350,127.36218 L 375,152.36218 L 387.5,139.86218 L 400,152.36218 L 400,171.11218"
+ id="path3196"
+ sodipodi:nodetypes="cccccccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 309.375,142.98718 L 318.75,133.61218 L 328.125,142.98718 L 309.375,142.98718 z"
+ id="path3182"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ id="path3184"
+ d="M 337.5,139.86218 L 350,127.36218 L 362.5,139.86218 L 337.5,139.86218 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ sodipodi:nodetypes="cccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="cccc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 381.25,146.11218 L 387.5,139.86218 L 393.75,146.11218 L 381.25,146.11218 z"
+ id="path3188"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3208"
+ d="M 287.5,164.86218 L 318.75,133.61218 L 331.25,146.11218 L 350,127.36218 L 387.5,164.86218"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path3210"
+ d="M 375,152.36218 L 387.5,139.86218 L 400,152.36218"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 318.75,158.61218 L 331.25,146.11218"
+ id="path3212"
+ sodipodi:nodetypes="cc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ </g>
+</svg>
diff --git a/doc/src/diagrams/gestures/pinchgesture.svg b/doc/src/diagrams/gestures/pinchgesture.svg
new file mode 100644
index 0000000..1c520b9
--- /dev/null
+++ b/doc/src/diagrams/gestures/pinchgesture.svg
@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="pinchgesture.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2473"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3362"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3429"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3639"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.979899"
+ inkscape:cx="299.95763"
+ inkscape:cy="879.65793"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1184"
+ inkscape:window-height="668"
+ inkscape:window-x="223"
+ inkscape:window-y="324">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ units="pt"
+ spacingx="1pt"
+ spacingy="1pt" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3235"
+ width="275"
+ height="162.5"
+ x="137.5"
+ y="114.86218"
+ ry="25.253815"
+ rx="25.253815"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <rect
+ ry="0"
+ rx="0"
+ y="127.36218"
+ x="168.75"
+ height="81.25"
+ width="212.5"
+ id="rect3839"
+ style="opacity:1;fill:#4040a0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#008000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 168.75,158.61218 C 200,164.86218 243.75,164.86218 275,171.11218 C 293.75,164.86218 356.25,158.61218 381.25,158.61218 L 381.25,208.61218 L 256.25,208.61218 L 168.75,208.61218 L 168.75,158.61218 z"
+ id="path3845"
+ sodipodi:nodetypes="ccccccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <rect
+ style="opacity:1;fill:#404060;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93750000000000000;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3328"
+ width="75"
+ height="56.25"
+ x="237.5"
+ y="139.86218"
+ rx="0"
+ ry="0"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#2f4f2f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 312.5,164.86218 C 306.25,158.61218 281.25,171.11218 262.5,164.86218 C 247.30507,158.35772 243.75,164.86218 237.5,171.11218 L 237.5,196.11218 L 312.5,196.11218 L 312.5,164.86218 z"
+ id="path3841"
+ sodipodi:nodetypes="cccccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:0.12437811;fill-rule:evenodd;stroke:#000000;stroke-width:2.50000000000000000;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:5, 5;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3167"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(118.75,0)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:0;fill-rule:evenodd;stroke:#c90000;stroke-width:2.50000000000000000;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3169"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(225.5176,19.302421)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ transform="translate(50,-6.25)"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ sodipodi:ry="12.5"
+ sodipodi:rx="12.5"
+ sodipodi:cy="164.86218"
+ sodipodi:cx="137.5"
+ id="path3649"
+ style="opacity:1;fill:#ffffff;fill-opacity:0;fill-rule:evenodd;stroke:#c90000;stroke-width:2.50000000000000000;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <g
+ id="g3641"
+ inkscape:label="Layer 1"
+ transform="matrix(-0.75,0,0,0.75,585.42164,37.937193)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72">
+ <g
+ id="g3643">
+ <path
+ sodipodi:nodetypes="ccccccccccccccccc"
+ id="path3645"
+ d="M 497.22886,219.23332 C 499.98338,212.79698 515.74295,224.65256 525,227.36218 L 525,164.86218 C 525,152.36218 537.5,152.36218 537.5,164.86218 L 537.5,208.61218 L 537.5,189.86218 C 537.5,183.61218 550,183.61218 550,189.86218 L 550,208.61218 L 550,196.11218 C 550,189.86218 562.5,189.86218 562.5,196.11218 L 562.5,214.86218 L 562.5,202.36218 C 562.5,196.11218 575,196.11218 575,202.36218 L 575,264.86218 C 562.5,271.11218 537.5,271.11218 525,264.86218 L 525,246.11218 C 517.00744,236.2443 493.75,227.36218 497.22886,219.23332 z"
+ style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3647"
+ d="M 535.83948,168.05221 C 535.83948,163.26959 535.83948,158.48698 531.25,158.48698 C 526.66052,158.48698 526.66052,163.26959 526.66052,168.05221 C 526.66052,172.83482 535.83948,172.83482 535.83948,168.05221 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:5.625, 5.625;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 187.5,158.61218 L 256.25,164.86218"
+ sodipodi:nodetypes="cc"
+ id="path12"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ transform="translate(156.25,6.25)"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ sodipodi:ry="12.5"
+ sodipodi:rx="12.5"
+ sodipodi:cy="164.86218"
+ sodipodi:cx="137.5"
+ id="path3659"
+ style="opacity:1;fill:#ffffff;fill-opacity:0.12437811;fill-rule:evenodd;stroke:#000000;stroke-width:2.50000000000000000;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:5, 5;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ inkscape:export-ydpi="72"
+ inkscape:export-xdpi="72"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ id="path3661"
+ sodipodi:nodetypes="cc"
+ d="M 293.75,171.11218 L 362.5,183.61218"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:5.625, 5.625;stroke-dashoffset:0;stroke-opacity:1" />
+ <g
+ id="g3431"
+ inkscape:label="Layer 1"
+ transform="matrix(0.7386058,0.1302361,-0.1302361,0.7386058,-8.1572814,-2.6927947)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72">
+ <g
+ id="g3210">
+ <path
+ sodipodi:nodetypes="ccccccccccccccccc"
+ id="path3191"
+ d="M 497.22886,219.23332 C 499.98338,212.79698 515.74295,224.65256 525,227.36218 L 525,164.86218 C 525,152.36218 537.5,152.36218 537.5,164.86218 L 537.5,208.61218 L 537.5,189.86218 C 537.5,183.61218 550,183.61218 550,189.86218 L 550,208.61218 L 550,196.11218 C 550,189.86218 562.5,189.86218 562.5,196.11218 L 562.5,214.86218 L 562.5,202.36218 C 562.5,196.11218 575,196.11218 575,202.36218 L 575,264.86218 C 562.5,271.11218 537.5,271.11218 525,264.86218 L 525,246.11218 C 517.00744,236.2443 493.75,227.36218 497.22886,219.23332 z"
+ style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3197"
+ d="M 535.83948,168.05221 C 535.83948,163.26959 535.83948,158.48698 531.25,158.48698 C 526.66052,158.48698 526.66052,163.26959 526.66052,168.05221 C 526.66052,172.83482 535.83948,172.83482 535.83948,168.05221 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 312.5,171.11218 L 356.25,171.11218"
+ id="path3847"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#c44060;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 362.5,171.11218 L 362.5,139.86218 L 312.5,139.86218 L 312.5,171.11218 L 362.5,171.11218 z"
+ id="path3849"
+ sodipodi:nodetypes="cccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 368.75,139.86218 L 356.25,127.36218 L 318.75,127.36218 L 306.25,139.86218 L 368.75,139.86218 z"
+ id="path3853"
+ sodipodi:nodetypes="ccccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3855"
+ d="M 331.25,158.61218 L 331.25,146.11218 L 318.75,146.11218 L 318.75,158.61218 L 331.25,158.61218 z"
+ style="fill:#5b77ff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#c0cb54;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 356.25,171.11218 L 356.25,146.11218 L 343.75,146.11218 L 343.75,171.11218 L 356.25,171.11218 z"
+ id="path3857"
+ sodipodi:nodetypes="ccccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ id="path3868"
+ d="M 282.8125,167.98719 L 293.75,167.98719"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.25px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3870"
+ d="M 295.3125,167.98719 L 295.3125,160.17469 L 282.8125,160.17469 L 282.8125,167.98719 L 295.3125,167.98719 z"
+ style="fill:#681e2f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.25000000000000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3872"
+ d="M 296.875,160.17469 L 293.75,157.04969 L 284.375,157.04969 L 281.25,160.17469 L 296.875,160.17469 z"
+ style="fill:#6e6c6c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.25000000000000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:#2f3e85;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.31250000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 287.5,164.86219 L 287.5,161.73719 L 284.375,161.73719 L 284.375,164.86219 L 287.5,164.86219 z"
+ id="path3874"
+ sodipodi:nodetypes="cccc"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3876"
+ d="M 293.75,167.98719 L 293.75,161.73719 L 290.625,161.73719 L 290.625,167.98719 L 293.75,167.98719 z"
+ style="fill:#65692a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.31250000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pinchgesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ </g>
+</svg>
diff --git a/doc/src/diagrams/gestures/swipegesture-details.svg b/doc/src/diagrams/gestures/swipegesture-details.svg
new file mode 100644
index 0000000..0f7de5b
--- /dev/null
+++ b/doc/src/diagrams/gestures/swipegesture-details.svg
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="swipegesture-details.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2473"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3362"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3429"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="321.9787"
+ inkscape:cy="855.02875"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1184"
+ inkscape:window-height="668"
+ inkscape:window-x="152"
+ inkscape:window-y="228">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ units="pt"
+ spacingx="1pt"
+ spacingy="1pt" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3235"
+ width="275"
+ height="162.5"
+ x="137.5"
+ y="114.86218"
+ ry="25.253815"
+ rx="25.253815"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:5, 5;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3167"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(43.75,-25)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#c90000;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3169"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(218.75,18.75)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:5.625, 5.625;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 181.25,139.86218 L 356.25,183.61218"
+ sodipodi:nodetypes="cc"
+ id="path12"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <g
+ id="g3431"
+ inkscape:label="Layer 1"
+ transform="matrix(0.7386058,0.1302361,-0.1302361,0.7386058,-15.203718,-5.6523172)">
+ <g
+ id="g3210">
+ <path
+ sodipodi:nodetypes="ccccccccccccccccc"
+ id="path3191"
+ d="M 497.22886,219.23332 C 499.98338,212.79698 515.74295,224.65256 525,227.36218 L 525,164.86218 C 525,152.36218 537.5,152.36218 537.5,164.86218 L 537.5,208.61218 L 537.5,189.86218 C 537.5,183.61218 550,183.61218 550,189.86218 L 550,208.61218 L 550,196.11218 C 550,189.86218 562.5,189.86218 562.5,196.11218 L 562.5,214.86218 L 562.5,202.36218 C 562.5,196.11218 575,196.11218 575,202.36218 L 575,264.86218 C 562.5,271.11218 537.5,271.11218 525,264.86218 L 525,246.11218 C 517.00744,236.2443 493.75,227.36218 497.22886,219.23332 z"
+ style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3197"
+ d="M 535.83948,168.05221 C 535.83948,163.26959 535.83948,158.48698 531.25,158.48698 C 526.66052,158.48698 526.66052,163.26959 526.66052,168.05221 C 526.66052,172.83482 535.83948,172.83482 535.83948,168.05221 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 181.25,139.86218 L 356.25,139.86218"
+ id="path3436"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 287.5,139.86218 C 287.5,146.11218 287.5,158.61218 281.25,164.86218"
+ id="path3438"
+ sodipodi:nodetypes="cc" />
+ </g>
+</svg>
diff --git a/doc/src/diagrams/gestures/swipegesture.svg b/doc/src/diagrams/gestures/swipegesture.svg
new file mode 100644
index 0000000..fc60a4d
--- /dev/null
+++ b/doc/src/diagrams/gestures/swipegesture.svg
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="swipegesture.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2473"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3362"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3429"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="321.9787"
+ inkscape:cy="855.02875"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1184"
+ inkscape:window-height="668"
+ inkscape:window-x="152"
+ inkscape:window-y="228">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ units="pt"
+ spacingx="1pt"
+ spacingy="1pt" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3235"
+ width="275"
+ height="162.5"
+ x="137.5"
+ y="114.86218"
+ ry="25.253815"
+ rx="25.253815"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:5, 5;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3167"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(43.75,-25)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#c90000;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3169"
+ sodipodi:cx="137.5"
+ sodipodi:cy="164.86218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12.5"
+ d="M 150,164.86218 A 12.5,12.5 0 1 1 125,164.86218 A 12.5,12.5 0 1 1 150,164.86218 z"
+ transform="translate(218.75,18.75)"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:5.625, 5.625;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 181.25,139.86218 L 356.25,183.61218"
+ sodipodi:nodetypes="cc"
+ id="path12"
+ inkscape:export-filename="/home/dboddie/git/qt/doc/src/images/pangesture.png"
+ inkscape:export-xdpi="72"
+ inkscape:export-ydpi="72" />
+ <g
+ id="g3431"
+ inkscape:label="Layer 1"
+ transform="matrix(0.7386058,0.1302361,-0.1302361,0.7386058,-15.203718,-5.6523172)">
+ <g
+ id="g3210">
+ <path
+ sodipodi:nodetypes="ccccccccccccccccc"
+ id="path3191"
+ d="M 497.22886,219.23332 C 499.98338,212.79698 515.74295,224.65256 525,227.36218 L 525,164.86218 C 525,152.36218 537.5,152.36218 537.5,164.86218 L 537.5,208.61218 L 537.5,189.86218 C 537.5,183.61218 550,183.61218 550,189.86218 L 550,208.61218 L 550,196.11218 C 550,189.86218 562.5,189.86218 562.5,196.11218 L 562.5,214.86218 L 562.5,202.36218 C 562.5,196.11218 575,196.11218 575,202.36218 L 575,264.86218 C 562.5,271.11218 537.5,271.11218 525,264.86218 L 525,246.11218 C 517.00744,236.2443 493.75,227.36218 497.22886,219.23332 z"
+ style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3197"
+ d="M 535.83948,168.05221 C 535.83948,163.26959 535.83948,158.48698 531.25,158.48698 C 526.66052,158.48698 526.66052,163.26959 526.66052,168.05221 C 526.66052,172.83482 535.83948,172.83482 535.83948,168.05221 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/doc/src/examples/audiodevices.qdoc b/doc/src/examples/audiodevices.qdoc
index 0d0932e..1505846 100644
--- a/doc/src/examples/audiodevices.qdoc
+++ b/doc/src/examples/audiodevices.qdoc
@@ -40,7 +40,7 @@
****************************************************************************/
/*!
- \example multimedia/audio/audiodevices
+ \example multimedia/audiodevices
\title Audio Devices Example
The Audio Devices example demonstrates the basic use of QAudioDeviceInfo class
diff --git a/doc/src/examples/audioinput.qdoc b/doc/src/examples/audioinput.qdoc
index ac44d75..8553e92 100644
--- a/doc/src/examples/audioinput.qdoc
+++ b/doc/src/examples/audioinput.qdoc
@@ -40,7 +40,7 @@
****************************************************************************/
/*!
- \example multimedia/audio/audioinput
+ \example multimedia/audioinput
\title AudioInput Example
The Audio Input example demonstrates the basic use of QAudioInput class
diff --git a/doc/src/examples/audiooutput.qdoc b/doc/src/examples/audiooutput.qdoc
index 2ed6ce4..58b8ea9 100644
--- a/doc/src/examples/audiooutput.qdoc
+++ b/doc/src/examples/audiooutput.qdoc
@@ -40,7 +40,7 @@
****************************************************************************/
/*!
- \example multimedia/audio/audiooutput
+ \example multimedia/audiooutput
\title Audio Output Example
The Audio Output example demonstrates the basic use of the QAudioOutput class
diff --git a/doc/src/examples/videographicsitem.qdoc b/doc/src/examples/videographicsitem.qdoc
index ce24f09..e1cb6ed 100644
--- a/doc/src/examples/videographicsitem.qdoc
+++ b/doc/src/examples/videographicsitem.qdoc
@@ -40,7 +40,7 @@
****************************************************************************/
/*!
- \example video/videographicsitem
+ \example multimedia/videographicsitem
\title Video Graphics Item Example
The Video Graphics Item example shows how to implement a QGraphicsItem that displays video on a
diff --git a/doc/src/examples/videowidget.qdoc b/doc/src/examples/videowidget.qdoc
index 1b214d2..4223c1f 100644
--- a/doc/src/examples/videowidget.qdoc
+++ b/doc/src/examples/videowidget.qdoc
@@ -40,7 +40,7 @@
****************************************************************************/
/*!
- \example video/videowidget
+ \example multimedia/videowidget
\title Video Widget Example
The Video Widget example shows how to implement a video widget using
@@ -50,7 +50,7 @@
\section1 VideoWidgetSurface Class Definition
- \snippet examples/video/videowidget/videowidgetsurface.h 0
+ \snippet examples/multimedia/videowidget/videowidgetsurface.h 0
The VideoWidgetSurface class inherits QAbstractVideoSurface and paints
video frames on a QWidget. This is a separate class to VideoWidget as both
@@ -62,7 +62,7 @@
\section1 VideoWidgetSurface Class Implementation
- \snippet examples/video/videowidget/videowidgetsurface.cpp 0
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 0
From the supportedPixelFormats() function we return a list of pixel formats
the surface can paint. The order of the list hints at which formats are
@@ -74,7 +74,7 @@
return any pixel formats if handleType is not
QAbstractVideoBuffer::NoHandle.
- \snippet examples/video/videowidget/videowidgetsurface.cpp 1
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 1
In isFormatSupported() we test if the frame type of a surface format maps
to a valid QImage format, that the frame size is not empty, and the handle
@@ -85,7 +85,7 @@
that the size is not empty so a reimplementation wasn't strictly necessary
in this case.
- \snippet examples/video/videowidget/videowidgetsurface.cpp 2
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 2
To start our surface we'll extract the image format and size from the
selected video format and save it for use in the paint() function. If the
@@ -94,7 +94,7 @@
by calling QAbstractVideoSurface::start(). Finally since the video size may
have changed we'll trigger an update of the widget, and video geometry.
- \snippet examples/video/videowidget/videowidgetsurface.cpp 5
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 5
The updateVideoRect() function calculates the region within the widget the
video occupies. The \l {QVideoSurfaceFormat::sizeHint()}{size hint} of the
@@ -105,7 +105,7 @@
size in the center of the widget. Otherwise we shrink the size maintaining
the aspect ratio so that it does fit.
- \snippet examples/video/videowidget/videowidgetsurface.cpp 4
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 4
We can't paint from outside a paint event, so when a new frame is received
in present() we save a reference to it and force an immediate repaint of
@@ -118,7 +118,7 @@
\l {QAbstractVideoSurface::UnsupportedFormatError}{UnsupportedFormatError}
on our surface and stop it immediately.
- \snippet examples/video/videowidget/videowidgetsurface.cpp 6
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 6
The paint() function is called by the video widget to paint the current
video frame. Before we draw the frame first we'll check the format for
@@ -128,7 +128,7 @@
construct a new QImage from the current video frame, and draw it to the
the widget.
- \snippet examples/video/videowidget/videowidgetsurface.cpp 3
+ \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 3
When the surface is stopped we need to release the current frame and
invalidate the video region. Then we confirm the surface has been
@@ -141,7 +141,7 @@
The VideoWidget class uses the VideoWidgetSurface class to implement a
video widget.
- \snippet examples/video/videowidget/videowidget.h 0
+ \snippet examples/multimedia/videowidget/videowidget.h 0
The VideoWidget QWidget implementation is minimal with just the sizeHint(),
paintEvent(), and resizeEvent() functions in addition to the constructor,
@@ -149,7 +149,7 @@
\section1 VideoWidget Class Implementation
- \snippet examples/video/videowidget/videowidget.cpp 0
+ \snippet examples/multimedia/videowidget/videowidget.cpp 0
In the VideoWidget constructor we set some flags to speed up re-paints a
little. Setting the Qt::WA_NoSystemBackground flag and disabling automatic
@@ -162,17 +162,17 @@
Finally we construct an instance of the VideoWidgetSurface class.
- \snippet examples/video/videowidget/videowidget.cpp 1
+ \snippet examples/multimedia/videowidget/videowidget.cpp 1
In the destructor we simply delete the VideoWidgetSurface instance.
- \snippet examples/video/videowidget/videowidget.cpp 2
+ \snippet examples/multimedia/videowidget/videowidget.cpp 2
We get the size hint for the widget from the video format of the surface
which is calculated from viewport and pixel aspect ratio of the video
format.
- \snippet examples/video/videowidget/videowidget.cpp 3
+ \snippet examples/multimedia/videowidget/videowidget.cpp 3
When the video widget receives a paint event we first check if the surface
is started, if not then we simply fill the widget with the background
@@ -180,7 +180,7 @@
by the paint region, before calling paint on the video surface to draw the
current frame.
- \snippet examples/video/videowidget/videowidget.cpp 4
+ \snippet examples/multimedia/videowidget/videowidget.cpp 4
The resizeEvent() function is reimplemented to trigger an update of the
video region when the widget is resized.
diff --git a/doc/src/frameworks-technologies/gestures.qdoc b/doc/src/frameworks-technologies/gestures.qdoc
index 158a273..a619fe8 100644
--- a/doc/src/frameworks-technologies/gestures.qdoc
+++ b/doc/src/frameworks-technologies/gestures.qdoc
@@ -41,10 +41,9 @@
/*!
\page gestures-overview.html
- \startpage index.html Qt Reference Documentation
-
\title Gestures Programming
\ingroup frameworks-technologies
+ \startpage index.html Qt Reference Documentation
\brief An overview of the Qt support for Gesture programming.
@@ -59,176 +58,116 @@
\section1 Overview
- QGesture is the central class in Qt's gesture framework, providing
- the API used by classes that represent specific gestures, such as
- QPanGesture, QPinchGesture, and QSwipeGesture. These standard
- classes are ready to use, and each exposes functions and
- properties that give gesture-specific information about the user's
- input. This is described in the \l{Using Standard Gestures With Widgets}
- section.
-
- QGesture is also designed to be subclassed and extended so that
- support for new gestures can be implemented by developers. Adding
- support for a new gesture involves implementing code to recognize
- the gesture from incoming events. This is described in the
+ QGesture is the central class in Qt's gesture framework, providing a container
+ for information about gestures performed by the user. QGesture exposes
+ properties that give general information that is common to all gestures, and
+ these can be extended to provide additional gesture-specific information.
+ Common panning, pinching and swiping gestures are represented by specialized
+ classes: QPanGesture, QPinchGesture and QSwipeGesture.
+
+ Developers can also implement new gestures by subclassing and extending the
+ QGestureRecognizer class. Adding support for a new gesture involves implementing
+ code to recognize the gesture from input events. This is described in the
\l{Creating Your Own Gesture Recognizer} section.
\section1 Using Standard Gestures with Widgets
- Gesture objects are applied directly to widgets and other controls that accept
- user input \mdash these are the \e{target objects}. When a gesture object is
- constructed, the target object is typically passed to the constructor, though
- it can also be passed as the argument to the \l{QGesture::}{setGestureTarget()}
- function.
+ Gestures can be enabled for instances of QWidget and QGraphicsObject subclasses.
+ An object that accepts gesture input is referred to as a \e{target object}.
+
+ To enable a gesture for a target object, call its QWidget::grabGesture() or
+ QGraphicsObject::grabGesture() function with an argument describing the
+ required gesture type. The standard types are defined by the Qt::GestureType
+ enum and include many commonly used gestures.
- \snippet examples/gestures/imageviewer/imagewidget.cpp construct swipe gesture
+ \snippet examples/gestures/imagegestures/imagewidget.cpp enable gestures
In the above code, the gesture is set up in the constructor of the target object
- itself, so the argument to the QSwipeGesture constructor is \e this.
+ itself.
+
+ When the user performs a gesture, QGestureEvent events will be delivered to the
+ target object, and these can be handled by reimplementing the QWidget::event()
+ handler function for widgets or QGraphicsItem::sceneEvent() for graphics objects.
- When the user performs a gesture, various signals may be emitted by the
- gesture object. To monitor the user's actions, you need to connect signals
- from the gesture object to slots in your code.
+ For convenience, the \l{Image Gestures Example} reimplements the general
+ \l{QWidget::}{event()} handler function and delegates gesture events to a
+ specialized gestureEvent() function:
- \snippet examples/gestures/imageviewer/imagewidget.cpp connect swipe gesture
+ \snippet examples/gestures/imagegestures/imagewidget.cpp event handler
- Here, the \l{QGesture::}{triggered()} signal is used to inform the application
- that a gesture was used. More precise monitoring of a gesture can be implemented
- by connecting its \l{QGesture::}{started()}, \l{QGesture::}{canceled()} and
- \l{QGesture::}{finished()} signals to slots.
+ The gesture events delivered to the target object can be examined individually
+ and dealt with appropriately:
- Responding to a signal is simply a matter of obtaining the gesture that sent
- it and examining the information it contains.
+ \snippet examples/gestures/imagegestures/imagewidget.cpp gesture event handler
- \snippet examples/gestures/imageviewer/imagewidget.cpp swipe slot start
+ Responding to a gesture is simply a matter of obtaining the QGesture object
+ delivered in the QGestureEvent sent to the target object and examining the
+ information it contains.
+
+ \snippet examples/gestures/imagegestures/imagewidget.cpp swipe function
Here, we examine the direction in which the user swiped the widget and modify
its contents accordingly.
- \section1 Using Standard Gestures with Graphics Items
-
- The approach used for applying gestures to widgets can also be used with
- graphics items. However, instead of passing a target object to the
- gesture object's constructor, you set a target graphics item with the
- \l{QGesture::}{setGraphicsItem()} function.
\section1 Creating Your Own Gesture Recognizer
- QGesture is a base class for a user defined gesture recognizer class. In
- order to implement the recognizer you will need to subclass the
- QGesture class and implement the pure virtual function
- \l{QGesture::}{filterEvent()} to filter out events that are not relevant
- to your gesture.
-
- Once you have implemented the \l{QGesture::}{filterEvent()} function to
- make your own recognizer you can process events. A sequence of events may,
- according to your own rules, represent a gesture. The events can be singly
- passed to the recognizer via the \l{QGesture::}{filterEvent()} function
- or as a stream of events by specifying a parent source of events. The events
- can be from any source and could result in any action as defined by the user.
- The source and action need not be graphical, though that would be the most
- likely scenario. To find how to connect a source of events to automatically
- feed into the recognizer see the QGesture documentation.
-
- Recognizers based on QGesture can emit any of the following signals to
- indicate their progress in recognizing user input:
-
- \list
- \o \l{QGesture::}{triggered()} is emitted when a gesture is recognized.
- \o \l{QGesture::}{started()} indicates that the gesture object has started
- to recognize user input.
- \o \l{QGesture::}{finished()} is emitted when the gesture object has
- recognized the user input as a gesture, and finished handling it.
- \o \l{QGesture::}{canceled()} indicates that the gesture was canceled,
- either by the user or by the application.
- \endlist
-
- These signals are emitted when the state changes with the call to
- \l{QGesture::}{updateState()}, more than one signal may
- be emitted when a change of state occurs. There are four GestureStates
-
- \table
- \header \o New State \o Description \o QGesture Actions on Entering this State
- \row \o Qt::NoGesture \o Initial value \o emit \l {QGesture::}{canceled()}
- \row \o Qt::GestureStarted \o A continuous gesture has started \o emit \l{QGesture::}{started()} and emit \l{QGesture::}{triggered()}
- \row \o Qt::GestureUpdated \o A gesture continues \o emit \l{QGesture::}{triggered()}
- \row \o Qt::GestureFinished \o A gesture has finished. \o emit \l{QGesture::}{finished()}
- \endtable
-
- \note \l{QGesture::started()}{started()} can be emitted if entering any
- state greater than NoGesture if NoGesture was the previous state. This
- means that your state machine does not need to explicitly use the
- Qt::GestureStarted state, you can simply proceed from NoGesture to
- Qt::GestureUpdated to emit a \l{QGesture::started()}{started()} signal
- and a \l{QGesture::triggered()}{triggered()} signal.
-
- You may use some or all of these states when implementing the pure
- virtual function \l{QGesture::filterEvent()}{filterEvent()}.
- \l{QGesture::filterEvent()}{filterEvent()} will usually implement a
- state machine using the GestureState enums, but the details of which
- states are used is up to the developer.
-
- You may also need to reimplement the virtual function \l{QGesture::reset()}{reset()}
- if internal data or objects need to be re-initialized. The function must
- conclude with a call to \l{QGesture::updateState()}{updateState()} to
- change the current state to Qt::NoGesture.
-
- \section1 The ImageViewer Example
-
- To illustrate how to use QGesture we will look at the ImageViewer
- example. This example uses QPanGesture, a standard gesture, and an
- implementation of TapAndHoldGesture. Note that TapAndHoldGesture is
- platform-dependent.
-
- \snippet doc/src/snippets/gestures/imageviewer/tapandholdgesture.cpp tapandhold-reset
-
- In ImageViewer we see that the ImageWidget class uses two gestures:
- \l QPanGesture and TapAndHoldGesture. The
- QPanGesture is a standard gesture which is part of Qt.
- TapAndHoldGesture is defined and implemented as part of the example.
- The ImageWidget listens for signals from the gestures, but is not
- interested in the \l{QGesture::started()}{started()} signal.
-
- \snippet doc/src/snippets/gestures/imageviewer/imagewidget.h imagewidget-slots
-
- TapAndHoldGesture uses QTouchEvent events and mouse events to detect
- start, update and end events that can be mapped onto the GestureState
- changes. The implementation in this case uses a timer as well. If the
- timeout event occurs a given number of times after the start of the gesture
- then the gesture is considered to have finished whether or not the
- appropriate touch or mouse event has occurred. Also if a large jump in
- the position of the event occurs, as calculated by the \l {QPoint::manhattanLength()}{manhattanLength()}
- call, then the gesture is canceled by calling \l{QGesture::reset()}{reset()}
- which tidies up and uses \l{QGesture::updateState()}{updateState()} to
- change state to NoGesture which will result in the \l{QGesture::canceled()}{canceled()}
- signal being emitted by the recognizer.
-
- ImageWidget handles the signals by connecting the slots to the signals,
- although \c canceled() is not connected here.
-
- \snippet doc/src/snippets/gestures/imageviewer/imagewidget.cpp imagewidget-connect
-
- These functions in turn will have to be aware of which gesture
- object was the source of the signal since we have more than one source
- per slot. This is easily done by using the QObject::sender() function
- as shown here
-
- \snippet doc/src/snippets/gestures/imageviewer/imagewidget.cpp imagewidget-triggered-1
-
- As \l{QGesture::triggered()}{triggered()} signals are handled by
- gestureTriggered() there may be position updates invoking calls to,
- for example, goNextImage(), this will cause a change in the image
- handling logic of ImageWidget and a call to updateImage() to display
- the changed state.
-
- Following the logic of how the QEvent is processed we can summmarize
- it as follows:
- \list
- \o filterEvent() becomes the event filter of the parent ImageWidget object
- for a QPanGesture object and a TapAndHoldGesture object.
- \o filterEvent() then calls updateState() to change states
- \o updateState() emits the appropriate signal(s) for the state change.
- \o The signals are caught by the defined slots in ImageWidget
- \o The widget logic changes and an update() results in a paint event.
- \endlist
+ Adding support for a new gesture involves creating and registering a new gesture
+ recognizer. Depending on the recognition process for the gesture, it may also
+ involve creating a new gesture object.
+
+ To create a new recognizer, you need to subclass QGestureRecognizer to create a
+ custom recognizer class. There is one virtual function that you must reimplement
+ and two others that can be reimplemented as required.
+
+ \section2 Filtering Input Events
+
+ The \l{QGestureRecognizer::}{filterEvent()} function must be reimplemented.
+ This function handles and filters the incoming input events for the target objects
+ and determines whether or not they correspond to the gesture the recognizer is
+ looking for.
+
+ Although the logic for gesture recognition is implemented in this function,
+ possibly using a state machine based on the Qt::GestureState enums, you can store
+ persistent information about the state of the recognition process in the QGesture
+ object supplied.
+
+ Your \l{QGestureRecognizer::}{filterEvent()} function must return a value of
+ Qt::GestureState that indicates the state of recognition for a given gesture and
+ target object. This determines whether or not a gesture event will be delivered
+ to a target object.
+
+ \section2 Custom Gestures
+
+ If you choose to represent a gesture by a custom QGesture subclass, you will need to
+ reimplement the \l{QGestureRecognizer::}{createGesture()} function to construct
+ instances of your gesture class instead of standard QGesture instances. Alternatively,
+ you may want to use standard QGesture instances, but add additional dynamic properties
+ to them to express specific details of the gesture you want to handle.
+
+ \section2 Resetting Gestures
+
+ If you use custom gesture objects that need to be reset or otherwise specially
+ handled when a gesture is canceled, you need to reimplement the
+ \l{QGestureRecognizer::}{reset()} function to perform these special tasks.
+
+ Note that QGesture objects are only created once for each combination of target object
+ and gesture type, and they are reused every time the user attempts to perform the
+ same gesture type on the target object. As a result, it can be useful to reimplement
+ the \l{QGestureRecognizer::}{reset()} function to clean up after each previous attempt
+ at recognizing a gesture.
+
+
+ \section1 Using a New Gesture Recognizer
+
+ To use a gesture recognizer, construct an instance of your QGestureRecognizer
+ subclass, and register it with the application with
+ QApplication::registerGestureRecognizer(). A recognizer for a given type of
+ gesture can be removed with QApplication::unregisterGestureRecognizer().
+
+
+ \section1 Further Reading
+
+ The \l{Image Gestures Example} shows how to enable gestures for a widget in
+ a simple image viewer application.
*/
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index d72f816..05940e4 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -806,16 +806,16 @@
Audio API in Qt applications.
\list
- \o \l{multimedia/audio/audiodevices}{Audio Devices}
- \o \l{multimedia/audio/audiooutput}{Audio Output}
- \o \l{multimedia/audio/audioinput}{Audio Input}
+ \o \l{multimedia/audiodevices}{Audio Devices}
+ \o \l{multimedia/audiooutput}{Audio Output}
+ \o \l{multimedia/audioinput}{Audio Input}
\endlist
\section1 Video Output
\list
- \o \l{video/videowidget}{Video Widget}\raisedaster
- \o \l{video/videographicsitem}{Video Graphics Item}
+ \o \l{multimedia/videowidget}{Video Widget}\raisedaster
+ \o \l{multimedia/videographicsitem}{Video Graphics Item}
\endlist
\section1 Phonon
@@ -1072,18 +1072,17 @@
/*!
\page examples-gestures.html
\title Gestures Examples
-
+
\previouspage Animation Framework Examples
\contentspage Qt Examples
\nextpage D-Bus Examples
The API of the gesture framework is not yet finalized and
still subject to change.
-\omit
+
\list
- \o \l{widgets/imageviewer}{Image Viewer}
+ \o \l{gestures/imagegestures}{Image Gestures}
\endlist
-\endomit
*/
/*!
diff --git a/doc/src/howtos/openvg.qdoc b/doc/src/howtos/openvg.qdoc
index 42d2357..5de2e22 100644
--- a/doc/src/howtos/openvg.qdoc
+++ b/doc/src/howtos/openvg.qdoc
@@ -292,8 +292,8 @@
\section2 Pixmap filters
- Convolution, colorize, and drop shadow filters are accelerated using
- OpenVG operations.
+ Convolution, colorize, drop shadow, and blur filters are accelerated
+ using OpenVG operations.
\section1 Known issues
diff --git a/doc/src/images/pangesture.png b/doc/src/images/pangesture.png
new file mode 100644
index 0000000..24caf91
--- /dev/null
+++ b/doc/src/images/pangesture.png
Binary files differ
diff --git a/doc/src/images/pinchgesture.png b/doc/src/images/pinchgesture.png
new file mode 100644
index 0000000..95614c4
--- /dev/null
+++ b/doc/src/images/pinchgesture.png
Binary files differ
diff --git a/doc/src/images/swipegesture.png b/doc/src/images/swipegesture.png
new file mode 100644
index 0000000..0b7d35a
--- /dev/null
+++ b/doc/src/images/swipegesture.png
Binary files differ
diff --git a/doc/src/snippets/gestures/imageviewer/imagewidget.cpp b/doc/src/snippets/gestures/imageviewer/imagewidget.cpp
deleted file mode 100644
index 409db2e..0000000
--- a/doc/src/snippets/gestures/imageviewer/imagewidget.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "imagewidget.h"
-
-#include <QtGui>
-
-ImageWidget::ImageWidget(QWidget *parent)
- : QWidget(parent)
-{
- setAttribute(Qt::WA_AcceptTouchEvents);
- setAttribute(Qt::WA_PaintOnScreen);
- setAttribute(Qt::WA_OpaquePaintEvent);
- setAttribute(Qt::WA_NoSystemBackground);
-
- setObjectName("ImageWidget");
-
- setMinimumSize(QSize(100,100));
-
- position = 0;
- zoomed = rotated = false;
-
- zoomedIn = false;
- horizontalOffset = 0;
- verticalOffset = 0;
-
-//! [imagewidget-connect]
- panGesture = new QPanGesture(this);
- connect(panGesture, SIGNAL(triggered()), this, SLOT(gestureTriggered()));
-
- tapAndHoldGesture = new TapAndHoldGesture(this);
- connect(tapAndHoldGesture, SIGNAL(triggered()), this, SLOT(gestureTriggered()));
- connect(tapAndHoldGesture, SIGNAL(finished()), this, SLOT(gestureFinished()));
-//! [imagewidget-connect]
-}
-
-void ImageWidget::paintEvent(QPaintEvent*)
-{
- QPainter p(this);
- if (currentImage.isNull()) {
- p.fillRect(geometry(), Qt::white);
- return;
- }
- int hoffset = 0;
- int voffset = 0;
- const int w = pixmap.width();
- const int h = pixmap.height();
- p.save();
- if (zoomedIn) {
- hoffset = horizontalOffset;
- voffset = verticalOffset;
- if (horizontalOffset > 0)
- p.fillRect(0, 0, horizontalOffset, height(), Qt::white);
- if (verticalOffset > 0)
- p.fillRect(0, 0, width(), verticalOffset, Qt::white);
- }
- p.drawPixmap(hoffset, voffset, pixmap);
- if (hoffset + w < width())
- p.fillRect(hoffset + w, 0, width() - w - hoffset, height(), Qt::white);
- if (voffset + h < height())
- p.fillRect(0, voffset + h, width(), height() - h - voffset, Qt::white);
-
- // paint touch feedback
- if (touchFeedback.tapped || touchFeedback.doubleTapped) {
- p.setPen(QPen(Qt::gray, 2));
- p.drawEllipse(touchFeedback.position, 5, 5);
- if (touchFeedback.doubleTapped) {
- p.setPen(QPen(Qt::darkGray, 2, Qt::DotLine));
- p.drawEllipse(touchFeedback.position, 15, 15);
- } else if (touchFeedback.tapAndHoldState != 0) {
- QPoint pts[8] = {
- touchFeedback.position + QPoint( 0, -15),
- touchFeedback.position + QPoint( 10, -10),
- touchFeedback.position + QPoint( 15, 0),
- touchFeedback.position + QPoint( 10, 10),
- touchFeedback.position + QPoint( 0, 15),
- touchFeedback.position + QPoint(-10, 10),
- touchFeedback.position + QPoint(-15, 0)
- };
- for (int i = 0; i < touchFeedback.tapAndHoldState/5; ++i)
- p.drawEllipse(pts[i], 3, 3);
- }
- } else if (touchFeedback.sliding) {
- p.setPen(QPen(Qt::red, 3));
- QPoint endPos = QPoint(touchFeedback.position.x(), touchFeedback.slidingStartPosition.y());
- p.drawLine(touchFeedback.slidingStartPosition, endPos);
- int dx = 10;
- if (touchFeedback.slidingStartPosition.x() < endPos.x())
- dx = -1*dx;
- p.drawLine(endPos, endPos + QPoint(dx, 5));
- p.drawLine(endPos, endPos + QPoint(dx, -5));
- }
-
- for (int i = 0; i < TouchFeedback::MaximumNumberOfTouches; ++i) {
- if (touchFeedback.touches[i].isNull())
- break;
- p.drawEllipse(touchFeedback.touches[i], 10, 10);
- }
- p.restore();
-}
-
-void ImageWidget::mousePressEvent(QMouseEvent *event)
-{
- touchFeedback.tapped = true;
- touchFeedback.position = event->pos();
-}
-
-void ImageWidget::mouseDoubleClickEvent(QMouseEvent *event)
-{
- touchFeedback.doubleTapped = true;
- const QPoint p = event->pos();
- touchFeedback.position = p;
- horizontalOffset = p.x() - currentImage.width()*1.0*p.x()/width();
- verticalOffset = p.y() - currentImage.height()*1.0*p.y()/height();
- setZoomedIn(!zoomedIn);
- zoomed = rotated = false;
- updateImage();
-
- feedbackFadeOutTimer.start(500, this);
-}
-
-//! [imagewidget-triggered-1]
-void ImageWidget::gestureTriggered()
-{
- if (sender() == panGesture) {
-//! [imagewidget-triggered-1]
- touchFeedback.tapped = false;
- touchFeedback.doubleTapped = false;
- QPanGesture *pg = qobject_cast<QPanGesture*>(sender());
- if (zoomedIn) {
-#ifndef QT_NO_CURSOR
- switch (pg->state()) {
- case Qt::GestureStarted:
- case Qt::GestureUpdated:
- setCursor(Qt::SizeAllCursor);
- break;
- default:
- setCursor(Qt::ArrowCursor);
- }
-#endif
- horizontalOffset += pg->lastOffset().width();
- verticalOffset += pg->lastOffset().height();
- } else {
- // only slide gesture should be accepted
- if (pg->state() == Qt::GestureFinished) {
- touchFeedback.sliding = false;
- zoomed = rotated = false;
- if (pg->totalOffset().width() > 0)
- goNextImage();
- else
- goPrevImage();
- updateImage();
- }
- }
- update();
- feedbackFadeOutTimer.start(500, this);
- } else if (sender() == tapAndHoldGesture) {
- if (tapAndHoldGesture->state() == Qt::GestureFinished) {
- qDebug() << "tap and hold detected";
- touchFeedback.reset();
- update();
-
- QMenu menu;
- menu.addAction("Action 1");
- menu.addAction("Action 2");
- menu.addAction("Action 3");
- menu.exec(mapToGlobal(tapAndHoldGesture->pos()));
- } else {
- ++touchFeedback.tapAndHoldState;
- update();
- }
- feedbackFadeOutTimer.start(500, this);
- }
-}
-
-void ImageWidget::gestureFinished()
-{
- qDebug() << "gesture finished" << sender();
-}
-
-void ImageWidget::gestureCancelled()
-{
- qDebug() << "gesture cancelled" << sender();
-}
-
-void ImageWidget::resizeEvent(QResizeEvent*)
-{
- updateImage();
-}
-
-void ImageWidget::updateImage()
-{
- // should use qtconcurrent here?
- transformation = QTransform();
- if (zoomedIn) {
- } else {
- if (currentImage.isNull())
- return;
- if (zoomed) {
- transformation = transformation.scale(zoom, zoom);
- } else {
- double xscale = (double)width()/currentImage.width();
- double yscale = (double)height()/currentImage.height();
- if (xscale < yscale)
- yscale = xscale;
- else
- xscale = yscale;
- transformation = transformation.scale(xscale, yscale);
- }
- if (rotated)
- transformation = transformation.rotate(angle);
- }
- pixmap = QPixmap::fromImage(currentImage).transformed(transformation);
- update();
-}
-
-void ImageWidget::openDirectory(const QString &path)
-{
- this->path = path;
- QDir dir(path);
- QStringList nameFilters;
- nameFilters << "*.jpg" << "*.png";
- files = dir.entryList(nameFilters, QDir::Files|QDir::Readable, QDir::Name);
-
- position = 0;
- goToImage(0);
- updateImage();
-}
-
-QImage ImageWidget::loadImage(const QString &fileName)
-{
- QImageReader reader(fileName);
- if (!reader.canRead()) {
- qDebug() << fileName << ": can't load image";
- return QImage();
- }
- QImage image;
- if (!reader.read(&image)) {
- qDebug() << fileName << ": corrupted image";
- return QImage();
- }
- return image;
-}
-
-void ImageWidget::setZoomedIn(bool zoomed)
-{
- zoomedIn = zoomed;
-}
-
-void ImageWidget::goNextImage()
-{
- if (files.isEmpty())
- return;
- if (position < files.size()-1) {
- ++position;
- prevImage = currentImage;
- currentImage = nextImage;
- if (position+1 < files.size())
- nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
- else
- nextImage = QImage();
- }
- setZoomedIn(false);
- updateImage();
-}
-
-void ImageWidget::goPrevImage()
-{
- if (files.isEmpty())
- return;
- if (position > 0) {
- --position;
- nextImage = currentImage;
- currentImage = prevImage;
- if (position > 0)
- prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
- else
- prevImage = QImage();
- }
- setZoomedIn(false);
- updateImage();
-}
-
-void ImageWidget::goToImage(int index)
-{
- if (files.isEmpty())
- return;
- if (index < 0 || index >= files.size()) {
- qDebug() << "goToImage: invalid index: " << index;
- return;
- }
- if (index == position+1) {
- goNextImage();
- return;
- }
- if (position > 0 && index == position-1) {
- goPrevImage();
- return;
- }
- position = index;
- pixmap = QPixmap();
- if (index > 0)
- prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
- else
- prevImage = QImage();
- currentImage = loadImage(path+QLatin1String("/")+files.at(position));
- if (position+1 < files.size())
- nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
- else
- nextImage = QImage();
- setZoomedIn(false);
- updateImage();
-}
-
-void ImageWidget::timerEvent(QTimerEvent *event)
-{
- if (event->timerId() == touchFeedback.tapTimer.timerId()) {
- touchFeedback.tapTimer.stop();
- } else if (event->timerId() == feedbackFadeOutTimer.timerId()) {
- feedbackFadeOutTimer.stop();
- touchFeedback.reset();
- }
- update();
-}
-
-#include "moc_imagewidget.cpp"
diff --git a/doc/src/snippets/gestures/imageviewer/imagewidget.h b/doc/src/snippets/gestures/imageviewer/imagewidget.h
deleted file mode 100644
index 5553093..0000000
--- a/doc/src/snippets/gestures/imageviewer/imagewidget.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef IMAGEWIDGET_H
-#define IMAGEWIDGET_H
-
-#include <QWidget>
-#include <QImage>
-#include <QPixmap>
-
-#include <QtGui>
-
-#include "tapandholdgesture.h"
-
-class ImageWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- ImageWidget(QWidget *parent = 0);
-
- void openDirectory(const QString &path);
-
-protected:
- void paintEvent(QPaintEvent*);
- void resizeEvent(QResizeEvent*);
- void timerEvent(QTimerEvent*);
- void mousePressEvent(QMouseEvent*);
- void mouseDoubleClickEvent(QMouseEvent*);
-
-//! [imagewidget-slots]
-private slots:
- void gestureTriggered();
- void gestureFinished();
- void gestureCancelled();
-//! [imagewidget-slots]
-
-private:
- void updateImage();
- QImage loadImage(const QString &fileName);
- void loadImage();
- void setZoomedIn(bool zoomed);
- void goNextImage();
- void goPrevImage();
- void goToImage(int index);
-
- QPanGesture *panGesture;
- TapAndHoldGesture *tapAndHoldGesture;
-
- QString path;
- QStringList files;
- int position;
-
- QImage prevImage, nextImage;
- QImage currentImage;
- QPixmap pixmap;
- QTransform transformation;
-
- bool zoomedIn;
- int horizontalOffset;
- int verticalOffset;
-
- bool zoomed;
- qreal zoom;
- bool rotated;
- qreal angle;
-
- struct TouchFeedback
- {
- bool tapped;
- QPoint position;
- bool sliding;
- QPoint slidingStartPosition;
- QBasicTimer tapTimer;
- int tapState;
- bool doubleTapped;
- int tapAndHoldState;
-
- enum { MaximumNumberOfTouches = 5 };
- QPoint touches[MaximumNumberOfTouches];
-
- inline TouchFeedback() { reset(); }
- inline void reset()
- {
- tapped = false;
- sliding = false;
- tapTimer.stop();
- tapState = 0;
- doubleTapped = false;
- tapAndHoldState = 0;
- for (int i = 0; i < MaximumNumberOfTouches; ++i) {
- touches[i] = QPoint();
- }
- }
- } touchFeedback;
- QBasicTimer feedbackFadeOutTimer;
-};
-
-#endif
diff --git a/doc/src/snippets/gestures/imageviewer/tapandholdgesture.cpp b/doc/src/snippets/gestures/imageviewer/tapandholdgesture.cpp
deleted file mode 100644
index 7dd2359..0000000
--- a/doc/src/snippets/gestures/imageviewer/tapandholdgesture.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "tapandholdgesture.h"
-
-#include <QtGui/qevent.h>
-
-// #define TAPANDHOLD_USING_MOUSE
-
-/*!
- \class TapAndHoldGesture
- \since 4.6
-
- \brief The TapAndHoldGesture class represents a Tap-and-Hold gesture,
- providing additional information.
-*/
-
-const int TapAndHoldGesture::iterationCount = 40;
-const int TapAndHoldGesture::iterationTimeout = 50;
-
-/*!
- Creates a new Tap and Hold gesture handler object and marks it as a child
- of \a parent.
-
- On some platforms like Windows there is a system-wide tap and hold gesture
- that cannot be overriden, hence the gesture might never trigger and default
- context menu will be shown instead.
-*/
-TapAndHoldGesture::TapAndHoldGesture(QWidget *parent)
- : QGesture(parent), iteration(0)
-{
-}
-
-/*! \internal */
-bool TapAndHoldGesture::filterEvent(QEvent *event)
-{
- if (!event->spontaneous())
- return false;
- const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
- switch (event->type()) {
- case QEvent::TouchBegin: {
- if (timer.isActive())
- timer.stop();
- timer.start(TapAndHoldGesture::iterationTimeout, this);
- const QPoint p = ev->touchPoints().at(0).pos().toPoint();
- position = p;
- break;
- }
- case QEvent::TouchUpdate:
- if (ev->touchPoints().size() == 1) {
- const QPoint startPos = ev->touchPoints().at(0).startPos().toPoint();
- const QPoint pos = ev->touchPoints().at(0).pos().toPoint();
- if ((startPos - pos).manhattanLength() > 15)
- reset();
- } else {
- reset();
- }
- break;
- case QEvent::TouchEnd:
- reset();
- break;
-#ifdef TAPANDHOLD_USING_MOUSE
- case QEvent::MouseButtonPress: {
- if (timer.isActive())
- timer.stop();
- timer.start(TapAndHoldGesture::iterationTimeout, this);
- const QPoint p = static_cast<QMouseEvent*>(event)->pos();
- position = startPosition = p;
- break;
- }
- case QEvent::MouseMove: {
- const QPoint startPos = startPosition;
- const QPoint pos = static_cast<QMouseEvent*>(event)->pos();
- if ((startPos - pos).manhattanLength() > 15)
- reset();
- break;
- }
- case QEvent::MouseButtonRelease:
- reset();
- break;
-#endif // TAPANDHOLD_USING_MOUSE
- default:
- break;
- }
- return false;
-}
-
-/*! \internal */
-void TapAndHoldGesture::timerEvent(QTimerEvent *event)
-{
- if (event->timerId() != timer.timerId())
- return;
- if (iteration == TapAndHoldGesture::iterationCount) {
- timer.stop();
- updateState(Qt::GestureFinished);
- } else {
- updateState(Qt::GestureUpdated);
- }
- ++iteration;
-}
-
-/*! \internal */
-//! [tapandhold-reset]
-void TapAndHoldGesture::reset()
-{
- timer.stop();
- iteration = 0;
- position = startPosition = QPoint();
- updateState(Qt::NoGesture);
-}
-//! [tapandhold-reset]
-
-/*!
- \property TapAndHoldGesture::pos
-
- \brief The position of the gesture.
-*/
-QPoint TapAndHoldGesture::pos() const
-{
- return position;
-}
diff --git a/doc/src/snippets/gestures/imageviewer/tapandholdgesture.h b/doc/src/snippets/gestures/imageviewer/tapandholdgesture.h
deleted file mode 100644
index 682342e..0000000
--- a/doc/src/snippets/gestures/imageviewer/tapandholdgesture.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TAPANDHOLDGESTURE_H
-#define TAPANDHOLDGESTURE_H
-
-#include <QtCore/QBasicTimer>
-#include <QtGui/QGesture>
-#include <QtGui/QWidget>
-
-class TapAndHoldGesture : public QGesture
-{
- Q_OBJECT
- Q_PROPERTY(QPoint pos READ pos)
-
-public:
- TapAndHoldGesture(QWidget *parent);
-
- bool filterEvent(QEvent *event);
- void reset();
-
- QPoint pos() const;
-
-protected:
- void timerEvent(QTimerEvent *event);
-
-private:
- QBasicTimer timer;
- int iteration;
- QPoint position;
- QPoint startPosition;
- static const int iterationCount;
- static const int iterationTimeout;
-};
-
-#endif // TAPANDHOLDGESTURE_H
diff --git a/doc/src/snippets/gestures/qgesture.cpp b/doc/src/snippets/gestures/qgesture.cpp
deleted file mode 100644
index 77f5cc2..0000000
--- a/doc/src/snippets/gestures/qgesture.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgesture.h"
-#include <private/qgesture_p.h>
-#include "qgraphicsitem.h"
-
-QT_BEGIN_NAMESPACE
-
-
-class QEventFilterProxyGraphicsItem : public QGraphicsItem
-{
-public:
- QEventFilterProxyGraphicsItem(QGesture *g)
- : gesture(g)
- {
- }
- bool sceneEventFilter(QGraphicsItem *, QEvent *event)
- {
- return gesture ? gesture->filterEvent(event) : false;
- }
- QRectF boundingRect() const { return QRectF(); }
- void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) { }
-
-private:
- QGesture *gesture;
-};
-
-/*
- \class QGesture
- \since 4.6
-
- \brief The QGesture class is the base class for implementing custom
- gestures.
-
- This class represents both an object that recognizes a gesture out of a set
- of input events (a gesture recognizer), and a gesture object itself that
- can be used to get extended information about the triggered gesture.
-
- The class has a list of properties that can be queried by the user to get
- some gesture-specific parameters (for example, an offset of a Pan gesture).
-
- Usually gesture recognizer implements a state machine, storing its state
- internally in the recognizer object. The recognizer receives input events
- through the \l{QGesture::}{filterEvent()} virtual function and decides
- whether the event should change the state of the recognizer by emitting an
- appropriate signal.
-
- Input events should be either fed to the recognizer one by one with a
- filterEvent() function, or the gesture recognizer should be attached to an
- object it filters events for by specifying it as a parent object. The
- QGesture object installs itself as an event filter to the parent object
- automatically, the unsetObject() function should be used to remove an event
- filter from the parent object. To make a
- gesture that operates on a QGraphicsItem, both the appropriate QGraphicsView
- should be passed as a parent object and setGraphicsItem() functions should
- be used to attach a gesture to a graphics item.
-
- This is a base class, to create a custom gesture type, you should subclass
- it and implement its pure virtual functions.
-
- \sa QPanGesture
-*/
-
-/* \fn bool QGesture::filterEvent(QEvent *event)
-
- Parses input \a event and emits a signal when detects a gesture.
-
- In your reimplementation of this function, if you want to filter the \a
- event out, i.e. stop it being handled further, return true; otherwise
- return false;
-
- This is a pure virtual function that needs to be implemented in subclasses.
-*/
-
-/* \fn void QGesture::started()
-
- The signal is emitted when the gesture is started. Extended information
- about the gesture is contained in the signal sender object.
-
- In addition to started(), a triggered() signal should also be emitted.
-*/
-
-/* \fn void QGesture::triggered()
-
- The signal is emitted when the gesture is detected. Extended information
- about the gesture is contained in the signal sender object.
-*/
-
-/* \fn void QGesture::finished()
-
- The signal is emitted when the gesture is finished. Extended information
- about the gesture is contained in the signal sender object.
-*/
-
-/* \fn void QGesture::cancelled()
-
- The signal is emitted when the gesture is cancelled, for example the reset()
- function is called while the gesture was in the process of emitting a
- triggered() signal. Extended information about the gesture is contained in
- the sender object.
-*/
-
-
-/*
- Creates a new gesture handler object and marks it as a child of \a parent.
-
- The \a parent object is also the default event source for the gesture,
- meaning that the gesture installs itself as an event filter for the \a
- parent.
-
- \sa setGraphicsItem()
-*/
-QGesture::QGesture(QObject *parent)
- : QObject(*new QGesturePrivate, parent)
-{
- if (parent)
- parent->installEventFilter(this);
-}
-
-/* \internal
- */
-QGesture::QGesture(QGesturePrivate &dd, QObject *parent)
- : QObject(dd, parent)
-{
- if (parent)
- parent->installEventFilter(this);
-}
-
-/*
- Destroys the gesture object.
-*/
-QGesture::~QGesture()
-{
-}
-
-/* \internal
- */
-bool QGesture::eventFilter(QObject *receiver, QEvent *event)
-{
- Q_D(QGesture);
- if (d->graphicsItem && receiver == parent())
- return false;
- return filterEvent(event);
-}
-
-/*
- \property QGesture::state
-
- \brief The current state of the gesture.
-*/
-
-/*
- Returns the gesture recognition state.
- */
-Qt::GestureState QGesture::state() const
-{
- return d_func()->state;
-}
-
-/*
- Sets this gesture's recognition state to \a state and emits appropriate
- signals.
-
- This functions emits the signals according to the old state and the new
- \a state, and it should be called after all the internal properties have been
- initialized.
-
- \sa started(), triggered(), finished(), cancelled()
- */
-void QGesture::updateState(Qt::GestureState state)
-{
- Q_D(QGesture);
- if (d->state == state) {
- if (state == Qt::GestureUpdated)
- emit triggered();
- return;
- }
- const Qt::GestureState oldState = d->state;
- d->state = state;
- if (state != Qt::NoGesture && oldState > state) {
- // comparing the state as ints: state should only be changed from
- // started to (optionally) updated and to finished.
- qWarning("QGesture::updateState: incorrect new state");
- return;
- }
- if (oldState == Qt::NoGesture)
- emit started();
- if (state == Qt::GestureUpdated)
- emit triggered();
- else if (state == Qt::GestureFinished)
- emit finished();
- else if (state == Qt::NoGesture)
- emit cancelled();
-
- if (state == Qt::GestureFinished) {
- // gesture is finished, so we reset the internal state.
- d->state = Qt::NoGesture;
- }
-}
-
-/*
- Sets the \a graphicsItem the gesture is filtering events for.
-
- The gesture will install an event filter to the \a graphicsItem and
- redirect them to the filterEvent() function.
-
- \sa graphicsItem()
-*/
-void QGesture::setGraphicsItem(QGraphicsItem *graphicsItem)
-{
- Q_D(QGesture);
- if (d->graphicsItem && d->eventFilterProxyGraphicsItem)
- d->graphicsItem->removeSceneEventFilter(d->eventFilterProxyGraphicsItem);
- d->graphicsItem = graphicsItem;
- if (!d->eventFilterProxyGraphicsItem)
- d->eventFilterProxyGraphicsItem = new QEventFilterProxyGraphicsItem(this);
- if (graphicsItem)
- graphicsItem->installSceneEventFilter(d->eventFilterProxyGraphicsItem);
-}
-
-/*
- Returns the graphics item the gesture is filtering events for.
-
- \sa setGraphicsItem()
-*/
-QGraphicsItem* QGesture::graphicsItem() const
-{
- return d_func()->graphicsItem;
-}
-
-/* \fn void QGesture::reset()
-
- Resets the internal state of the gesture. This function might be called by
- the filterEvent() implementation in a derived class, or by the user to
- cancel a gesture. The base class implementation calls
- updateState(Qt::NoGesture) which emits the cancelled()
- signal if the state() of the gesture indicated it was active.
-*/
-void QGesture::reset()
-{
- updateState(Qt::NoGesture);
-}
-
-QT_END_NAMESPACE
diff --git a/doc/src/snippets/gestures/qgesture.h b/doc/src/snippets/gestures/qgesture.h
deleted file mode 100644
index 3fc89a1..0000000
--- a/doc/src/snippets/gestures/qgesture.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGESTURE_H
-#define QGESTURE_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qlist.h>
-#include <QtCore/qdatetime.h>
-#include <QtCore/qpoint.h>
-#include <QtCore/qrect.h>
-#include <QtCore/qmetatype.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
-class QGraphicsItem;
-class QGesturePrivate;
-class Q_GUI_EXPORT QGesture : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGesture)
-
- Q_PROPERTY(Qt::GestureState state READ state)
-
-public:
- explicit QGesture(QObject *parent = 0);
- ~QGesture();
-
- virtual bool filterEvent(QEvent *event) = 0;
-
- void setGraphicsItem(QGraphicsItem *);
- QGraphicsItem *graphicsItem() const;
-
- Qt::GestureState state() const;
-
-protected:
- QGesture(QGesturePrivate &dd, QObject *parent);
- bool eventFilter(QObject*, QEvent*);
-
- virtual void reset();
- void updateState(Qt::GestureState state);
-
-//! [qgesture-signals]
-Q_SIGNALS:
- void started();
- void triggered();
- void finished();
- void cancelled();
-//! [qgesture-signals]
-
-private:
- friend class QWidget;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGESTURE_H
diff --git a/doc/src/snippets/gestures/qstandardgestures.cpp b/doc/src/snippets/gestures/qstandardgestures.cpp
deleted file mode 100644
index b22f6ae..0000000
--- a/doc/src/snippets/gestures/qstandardgestures.cpp
+++ /dev/null
@@ -1,483 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qstandardgestures.h"
-#include "qstandardgestures_p.h"
-
-#include <qabstractscrollarea.h>
-#include <qscrollbar.h>
-#include <private/qapplication_p.h>
-#include <private/qevent_p.h>
-#include <private/qwidget_p.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifdef Q_WS_WIN
-QWidgetPrivate *qt_widget_private(QWidget *widget);
-#endif
-
-/*!
- \class QPanGesture
- \since 4.6
-
- \brief The QPanGesture class represents a Pan gesture,
- providing additional information related to panning.
-*/
-
-/*!
- Creates a new Pan gesture handler object and marks it as a child of \a
- parent.
-
- On some platform like Windows it's necessary to provide a non-null widget
- as \a parent to get native gesture support.
-*/
-QPanGesture::QPanGesture(QWidget *parent)
- : QGesture(*new QPanGesturePrivate, parent)
-{
- if (parent) {
- QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
- qAppPriv->widgetGestures[parent].pan = this;
-#ifdef Q_WS_WIN
- qt_widget_private(parent)->winSetupGestures();
-#endif
- }
-}
-
-/*! \internal */
-bool QPanGesture::event(QEvent *event)
-{
- switch (event->type()) {
- case QEvent::ParentAboutToChange:
- if (QWidget *w = qobject_cast<QWidget*>(parent())) {
- QApplicationPrivate::instance()->widgetGestures[w].pan = 0;
-#ifdef Q_WS_WIN
- qt_widget_private(w)->winSetupGestures();
-#endif
- }
- break;
- case QEvent::ParentChange:
- if (QWidget *w = qobject_cast<QWidget*>(parent())) {
- QApplicationPrivate::instance()->widgetGestures[w].pan = this;
-#ifdef Q_WS_WIN
- qt_widget_private(w)->winSetupGestures();
-#endif
- }
- break;
- default:
- break;
- }
-
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
- Q_D(QPanGesture);
- if (event->type() == QEvent::Timer) {
- const QTimerEvent *te = static_cast<QTimerEvent *>(event);
- if (te->timerId() == d->panFinishedTimer) {
- killTimer(d->panFinishedTimer);
- d->panFinishedTimer = 0;
- d->lastOffset = QSize(0, 0);
- updateState(Qt::GestureFinished);
- }
- }
-#endif
-
- return QObject::event(event);
-}
-
-bool QPanGesture::eventFilter(QObject *receiver, QEvent *event)
-{
-#ifdef Q_WS_WIN
- Q_D(QPanGesture);
- if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) {
- QNativeGestureEvent *ev = static_cast<QNativeGestureEvent*>(event);
- QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
- QApplicationPrivate::WidgetStandardGesturesMap::iterator it;
- it = qAppPriv->widgetGestures.find(static_cast<QWidget*>(receiver));
- if (it == qAppPriv->widgetGestures.end())
- return false;
- if (this != it.value().pan)
- return false;
- Qt::GestureState nextState = Qt::NoGesture;
- switch(ev->gestureType) {
- case QNativeGestureEvent::GestureBegin:
- // next we might receive the first gesture update event, so we
- // prepare for it.
- d->state = Qt::NoGesture;
- return false;
- case QNativeGestureEvent::Pan:
- nextState = Qt::GestureUpdated;
- event->accept();
- break;
- case QNativeGestureEvent::GestureEnd:
- if (state() == Qt::NoGesture)
- return false; // some other gesture has ended
- nextState = Qt::GestureFinished;
- break;
- default:
- return false;
- }
- if (state() == Qt::NoGesture) {
- d->lastOffset = d->totalOffset = QSize();
- } else {
- d->lastOffset = QSize(ev->position.x() - d->lastPosition.x(),
- ev->position.y() - d->lastPosition.y());
- d->totalOffset += d->lastOffset;
- }
- d->lastPosition = ev->position;
- updateState(nextState);
- return true;
- }
-#endif
- return QGesture::eventFilter(receiver, event);
-}
-
-/*! \internal */
-bool QPanGesture::filterEvent(QEvent *event)
-{
- Q_D(QPanGesture);
- if (!event->spontaneous())
- return false;
- const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
- if (event->type() == QEvent::TouchBegin) {
- QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
- d->lastPosition = p.pos().toPoint();
- d->lastOffset = d->totalOffset = QSize();
- } else if (event->type() == QEvent::TouchEnd) {
- if (state() != Qt::NoGesture) {
- if (!ev->touchPoints().isEmpty()) {
- QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
- const QPoint pos = p.pos().toPoint();
- const QPoint lastPos = p.lastPos().toPoint();
- const QPoint startPos = p.startPos().toPoint();
- d->lastOffset = QSize(pos.x() - lastPos.x(), pos.y() - lastPos.y());
- d->totalOffset = QSize(pos.x() - startPos.x(), pos.y() - startPos.y());
- }
- updateState(Qt::GestureFinished);
- }
- reset();
- } else if (event->type() == QEvent::TouchUpdate) {
- QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
- const QPoint pos = p.pos().toPoint();
- const QPoint lastPos = p.lastPos().toPoint();
- const QPoint startPos = p.startPos().toPoint();
- d->lastOffset = QSize(pos.x() - lastPos.x(), pos.y() - lastPos.y());
- d->totalOffset = QSize(pos.x() - startPos.x(), pos.y() - startPos.y());
- if (d->totalOffset.width() > 10 || d->totalOffset.height() > 10 ||
- d->totalOffset.width() < -10 || d->totalOffset.height() < -10) {
- updateState(Qt::GestureUpdated);
- }
- }
-#ifdef Q_OS_MAC
- else if (event->type() == QEvent::Wheel) {
- // On Mac, there is really no native panning gesture. Instead, a two
- // finger pan is delivered as mouse wheel events. Otoh, on Windows, you
- // either get mouse wheel events or pan events. We have decided to make this
- // the Qt behaviour as well, meaning that on Mac, wheel
- // events will be masked away when listening for pan events.
-#ifndef QT_MAC_USE_COCOA
- // In Carbon we receive neither touch-, nor pan gesture events.
- // So we create pan gestures by converting wheel events. After all, this
- // is how things are supposed to work on mac in the first place.
- const QWheelEvent *wev = static_cast<const QWheelEvent*>(event);
- int offset = wev->delta() / -120;
- d->lastOffset = wev->orientation() == Qt::Horizontal ? QSize(offset, 0) : QSize(0, offset);
-
- if (state() == Qt::NoGesture) {
- d->totalOffset = d->lastOffset;
- } else {
- d->totalOffset += d->lastOffset;
- }
-
- killTimer(d->panFinishedTimer);
- d->panFinishedTimer = startTimer(200);
- updateState(Qt::GestureUpdated);
-#endif
- return true;
- }
-#endif
- return false;
-}
-
-/*! \internal */
-void QPanGesture::reset()
-{
- Q_D(QPanGesture);
- d->lastOffset = d->totalOffset = QSize();
- d->lastPosition = QPoint();
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
- if (d->panFinishedTimer) {
- killTimer(d->panFinishedTimer);
- d->panFinishedTimer = 0;
- }
-#endif
- QGesture::reset();
-}
-
-/*!
- \property QPanGesture::totalOffset
-
- Specifies a total pan offset since the start of the gesture.
-*/
-QSize QPanGesture::totalOffset() const
-{
- Q_D(const QPanGesture);
- return d->totalOffset;
-}
-
-/*!
- \property QPanGesture::lastOffset
-
- Specifies a pan offset since the last time the gesture was
- triggered.
-*/
-QSize QPanGesture::lastOffset() const
-{
- Q_D(const QPanGesture);
- return d->lastOffset;
-}
-
-
-/*!
- \class QPinchGesture
- \since 4.6
-
- \brief The QPinchGesture class represents a Pinch gesture,
- providing additional information related to zooming and/or rotation.
-*/
-
-/*!
- Creates a new Pinch gesture handler object and marks it as a child of \a
- parent.
-
- On some platform like Windows it's necessary to provide a non-null widget
- as \a parent to get native gesture support.
-*/
-QPinchGesture::QPinchGesture(QWidget *parent)
- : QGesture(*new QPinchGesturePrivate, parent)
-{
- if (parent) {
- QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
- qAppPriv->widgetGestures[parent].pinch = this;
-#ifdef Q_WS_WIN
- qt_widget_private(parent)->winSetupGestures();
-#endif
- }
-}
-
-/*! \internal */
-bool QPinchGesture::event(QEvent *event)
-{
- switch (event->type()) {
- case QEvent::ParentAboutToChange:
- if (QWidget *w = qobject_cast<QWidget*>(parent())) {
- QApplicationPrivate::instance()->widgetGestures[w].pinch = 0;
-#ifdef Q_WS_WIN
- qt_widget_private(w)->winSetupGestures();
-#endif
- }
- break;
- case QEvent::ParentChange:
- if (QWidget *w = qobject_cast<QWidget*>(parent())) {
- QApplicationPrivate::instance()->widgetGestures[w].pinch = this;
-#ifdef Q_WS_WIN
- qt_widget_private(w)->winSetupGestures();
-#endif
- }
- break;
- default:
- break;
- }
- return QObject::event(event);
-}
-
-bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event)
-{
-#ifdef Q_WS_WIN
- Q_D(QPinchGesture);
- if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) {
- QNativeGestureEvent *ev = static_cast<QNativeGestureEvent*>(event);
- QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
- QApplicationPrivate::WidgetStandardGesturesMap::iterator it;
- it = qAppPriv->widgetGestures.find(static_cast<QWidget*>(receiver));
- if (it == qAppPriv->widgetGestures.end())
- return false;
- if (this != it.value().pinch)
- return false;
- Qt::GestureState nextState = Qt::NoGesture;
- switch(ev->gestureType) {
- case QNativeGestureEvent::GestureBegin:
- // next we might receive the first gesture update event, so we
- // prepare for it.
- d->state = Qt::NoGesture;
- d->scaleFactor = d->lastScaleFactor = 1;
- d->rotationAngle = d->lastRotationAngle = 0;
- d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
- d->initialDistance = 0;
- return false;
- case QNativeGestureEvent::Rotate:
- d->lastRotationAngle = d->rotationAngle;
- d->rotationAngle = -1 * GID_ROTATE_ANGLE_FROM_ARGUMENT(ev->argument);
- nextState = Qt::GestureUpdated;
- event->accept();
- break;
- case QNativeGestureEvent::Zoom:
- if (d->initialDistance != 0) {
- d->lastScaleFactor = d->scaleFactor;
- int distance = int(qint64(ev->argument));
- d->scaleFactor = (qreal) distance / d->initialDistance;
- } else {
- d->initialDistance = int(qint64(ev->argument));
- }
- nextState = Qt::GestureUpdated;
- event->accept();
- break;
- case QNativeGestureEvent::GestureEnd:
- if (state() == Qt::NoGesture)
- return false; // some other gesture has ended
- nextState = Qt::GestureFinished;
- break;
- default:
- return false;
- }
- if (d->startCenterPoint.isNull())
- d->startCenterPoint = d->centerPoint;
- d->lastCenterPoint = d->centerPoint;
- d->centerPoint = static_cast<QWidget*>(receiver)->mapFromGlobal(ev->position);
- updateState(nextState);
- return true;
- }
-#endif
- return QGesture::eventFilter(receiver, event);
-}
-
-/*! \internal */
-bool QPinchGesture::filterEvent(QEvent *event)
-{
- Q_UNUSED(event);
- return false;
-}
-
-/*! \internal */
-void QPinchGesture::reset()
-{
- Q_D(QPinchGesture);
- d->scaleFactor = d->lastScaleFactor = 0;
- d->rotationAngle = d->lastRotationAngle = 0;
- d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
- QGesture::reset();
-}
-
-/*!
- \property QPinchGesture::scaleFactor
-
- Specifies a scale factor of the pinch gesture.
-*/
-qreal QPinchGesture::scaleFactor() const
-{
- return d_func()->scaleFactor;
-}
-
-/*!
- \property QPinchGesture::lastScaleFactor
-
- Specifies a previous scale factor of the pinch gesture.
-*/
-qreal QPinchGesture::lastScaleFactor() const
-{
- return d_func()->lastScaleFactor;
-}
-
-/*!
- \property QPinchGesture::rotationAngle
-
- Specifies a rotation angle of the gesture.
-*/
-qreal QPinchGesture::rotationAngle() const
-{
- return d_func()->rotationAngle;
-}
-
-/*!
- \property QPinchGesture::lastRotationAngle
-
- Specifies a previous rotation angle of the gesture.
-*/
-qreal QPinchGesture::lastRotationAngle() const
-{
- return d_func()->lastRotationAngle;
-}
-
-/*!
- \property QPinchGesture::centerPoint
-
- Specifies a center point of the gesture. The point can be used as a center
- point that the object is rotated around.
-*/
-QPoint QPinchGesture::centerPoint() const
-{
- return d_func()->centerPoint;
-}
-
-/*!
- \property QPinchGesture::lastCenterPoint
-
- Specifies a previous center point of the gesture.
-*/
-QPoint QPinchGesture::lastCenterPoint() const
-{
- return d_func()->lastCenterPoint;
-}
-
-/*!
- \property QPinchGesture::startCenterPoint
-
- Specifies an initial center point of the gesture. Difference between the
- startCenterPoint and the centerPoint is the distance at which pinching
- fingers has shifted.
-*/
-QPoint QPinchGesture::startCenterPoint() const
-{
- return d_func()->startCenterPoint;
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qstandardgestures.cpp"
-
diff --git a/doc/src/snippets/gestures/qstandardgestures.h b/doc/src/snippets/gestures/qstandardgestures.h
deleted file mode 100644
index efd6c6e..0000000
--- a/doc/src/snippets/gestures/qstandardgestures.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSTANDARDGESTURES_H
-#define QSTANDARDGESTURES_H
-
-#include <QtGui/qevent.h>
-#include <QtCore/qbasictimer.h>
-
-#include <QtGui/qgesture.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
-class QPanGesturePrivate;
-class Q_GUI_EXPORT QPanGesture : public QGesture
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QPanGesture)
-
- Q_PROPERTY(QSize totalOffset READ totalOffset)
- Q_PROPERTY(QSize lastOffset READ lastOffset)
-
-public:
- QPanGesture(QWidget *parent);
-
- bool filterEvent(QEvent *event);
-
- QSize totalOffset() const;
- QSize lastOffset() const;
-
-protected:
- void reset();
-
-private:
- bool event(QEvent *event);
- bool eventFilter(QObject *receiver, QEvent *event);
-
- friend class QWidget;
-};
-
-class QPinchGesturePrivate;
-class Q_GUI_EXPORT QPinchGesture : public QGesture
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QPinchGesture)
-
- Q_PROPERTY(qreal scaleFactor READ scaleFactor)
- Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor)
-
- Q_PROPERTY(qreal rotationAngle READ rotationAngle)
- Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle)
-
- Q_PROPERTY(QPoint startCenterPoint READ startCenterPoint)
- Q_PROPERTY(QPoint lastCenterPoint READ lastCenterPoint)
- Q_PROPERTY(QPoint centerPoint READ centerPoint)
-
-public:
- QPinchGesture(QWidget *parent);
-
- bool filterEvent(QEvent *event);
- void reset();
-
- QPoint startCenterPoint() const;
- QPoint lastCenterPoint() const;
- QPoint centerPoint() const;
-
- qreal scaleFactor() const;
- qreal lastScaleFactor() const;
-
- qreal rotationAngle() const;
- qreal lastRotationAngle() const;
-
-private:
- bool event(QEvent *event);
- bool eventFilter(QObject *receiver, QEvent *event);
-
- friend class QWidget;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QSTANDARDGESTURES_H
diff --git a/examples/effects/effects.pro b/examples/effects/effects.pro
index 01fa293..2dec8d5 100644
--- a/examples/effects/effects.pro
+++ b/examples/effects/effects.pro
@@ -5,7 +5,11 @@ SUBDIRS = \
lighting \
fademessage
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2):SUBDIRS += customshader
+!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) {
+ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
+ SUBDIRS += customshader
+ }
+}
# install
target.path = $$[QT_INSTALL_EXAMPLES]/effects
diff --git a/examples/examples.pro b/examples/examples.pro
index 7acd67b..d11e36b 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -39,8 +39,7 @@ symbian: SUBDIRS = \
xml
contains(QT_CONFIG, multimedia) {
- SUBDIRS += video
- !static: SUBDIRS += multimedia
+ SUBDIRS += multimedia
}
contains(QT_CONFIG, script): SUBDIRS += script
diff --git a/examples/gestures/gestures.pro b/examples/gestures/gestures.pro
index 09cd56a..e3978b6 100644
--- a/examples/gestures/gestures.pro
+++ b/examples/gestures/gestures.pro
@@ -1,7 +1,7 @@
TEMPLATE = \
subdirs
SUBDIRS = \
- imageviewer
+ imagegestures
# install
target.path = $$[QT_INSTALL_EXAMPLES]/gestures
diff --git a/examples/gestures/imageviewer/imageviewer.pro b/examples/gestures/imagegestures/imagegestures.pro
index 68c1f1c..7780ad9 100644
--- a/examples/gestures/imageviewer/imageviewer.pro
+++ b/examples/gestures/imagegestures/imagegestures.pro
@@ -1,6 +1,8 @@
-HEADERS += imagewidget.h
-SOURCES += imagewidget.cpp \
- main.cpp
+HEADERS = imagewidget.h \
+ mainwidget.h
+SOURCES = imagewidget.cpp \
+ main.cpp \
+ mainwidget.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imagegestures/imagewidget.cpp
index f3fd8e4..95525c5 100644
--- a/examples/gestures/imageviewer/imagewidget.cpp
+++ b/examples/gestures/imagegestures/imagewidget.cpp
@@ -43,6 +43,7 @@
#include <QtGui>
+//! [constructor]
ImageWidget::ImageWidget(QWidget *parent)
: QWidget(parent),
position(0),
@@ -52,24 +53,24 @@ ImageWidget::ImageWidget(QWidget *parent)
scaleFactor(1)
{
- setObjectName("ImageWidget");
setMinimumSize(QSize(100,100));
- setAttribute(Qt::WA_PaintOnScreen);
- setAttribute(Qt::WA_OpaquePaintEvent);
- setAttribute(Qt::WA_NoSystemBackground);
-
+//! [enable gestures]
grabGesture(Qt::PanGesture);
grabGesture(Qt::PinchGesture);
grabGesture(Qt::SwipeGesture);
+//! [enable gestures]
}
+//! [constructor]
+//! [event handler]
bool ImageWidget::event(QEvent *event)
{
if (event->type() == QEvent::Gesture)
return gestureEvent(static_cast<QGestureEvent*>(event));
return QWidget::event(event);
}
+//! [event handler]
void ImageWidget::paintEvent(QPaintEvent*)
{
@@ -98,6 +99,7 @@ void ImageWidget::mouseDoubleClickEvent(QMouseEvent *)
update();
}
+//! [gesture event handler]
bool ImageWidget::gestureEvent(QGestureEvent *event)
{
if (QGesture *pan = event->gesture(Qt::PanGesture)) {
@@ -112,6 +114,7 @@ bool ImageWidget::gestureEvent(QGestureEvent *event)
}
return false;
}
+//! [gesture event handler]
void ImageWidget::panTriggered(QPanGesture *gesture)
{
@@ -147,7 +150,7 @@ void ImageWidget::pinchTriggered(QPinchGesture *gesture)
update();
}
-//! [swipe slot]
+//! [swipe function]
void ImageWidget::swipeTriggered(QSwipeGesture *gesture)
{
if (gesture->horizontalDirection() == QSwipeGesture::Left
@@ -157,7 +160,7 @@ void ImageWidget::swipeTriggered(QSwipeGesture *gesture)
goNextImage();
update();
}
-//! [swipe slot]
+//! [swipe function]
void ImageWidget::resizeEvent(QResizeEvent*)
{
diff --git a/examples/gestures/imageviewer/imagewidget.h b/examples/gestures/imagegestures/imagewidget.h
index e05a67a..56e2316 100644
--- a/examples/gestures/imageviewer/imagewidget.h
+++ b/examples/gestures/imagegestures/imagewidget.h
@@ -46,33 +46,35 @@
#include <QImage>
#include <QtGui>
+QT_BEGIN_NAMESPACE
class QGestureEvent;
class QPanGesture;
class QPinchGesture;
class QSwipeGesture;
+QT_END_NAMESPACE
+//! [class definition begin]
class ImageWidget : public QWidget
{
Q_OBJECT
public:
ImageWidget(QWidget *parent = 0);
-
void openDirectory(const QString &path);
protected:
- bool event(QEvent*);
- bool gestureEvent(QGestureEvent*);
- void paintEvent(QPaintEvent*);
- void resizeEvent(QResizeEvent*);
- void mouseDoubleClickEvent(QMouseEvent*);
+ bool event(QEvent *event);
+ void paintEvent(QPaintEvent *event);
+ void resizeEvent(QResizeEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
private:
+ bool gestureEvent(QGestureEvent *event);
void panTriggered(QPanGesture*);
void pinchTriggered(QPinchGesture*);
void swipeTriggered(QSwipeGesture*);
+//! [class definition begin]
-private:
void updateImage();
QImage loadImage(const QString &fileName);
void loadImage();
@@ -91,6 +93,8 @@ private:
float verticalOffset;
float rotationAngle;
float scaleFactor;
+//! [class definition end]
};
+//! [class definition end]
#endif
diff --git a/examples/gestures/imagegestures/main.cpp b/examples/gestures/imagegestures/main.cpp
new file mode 100644
index 0000000..9c99f31
--- /dev/null
+++ b/examples/gestures/imagegestures/main.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwidget.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ MainWidget w;
+ w.show();
+
+ if (QApplication::arguments().size() > 1)
+ w.openDirectory(QApplication::arguments().at(1));
+ else
+ w.openDirectory(QFileDialog::getExistingDirectory(0, "Select image folder"));
+
+ return app.exec();
+}
diff --git a/examples/gestures/imagegestures/mainwidget.cpp b/examples/gestures/imagegestures/mainwidget.cpp
new file mode 100644
index 0000000..51e9f1e
--- /dev/null
+++ b/examples/gestures/imagegestures/mainwidget.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "imagewidget.h"
+#include "mainwidget.h"
+
+MainWidget::MainWidget(QWidget *parent)
+ : QMainWindow(parent)
+{
+ resize(400, 300);
+ imageWidget = new ImageWidget(this);
+ setCentralWidget(imageWidget);
+}
+
+void MainWidget::openDirectory(const QString &path)
+{
+ imageWidget->openDirectory(path);
+}
diff --git a/examples/gestures/imagegestures/mainwidget.h b/examples/gestures/imagegestures/mainwidget.h
new file mode 100644
index 0000000..71b09b0
--- /dev/null
+++ b/examples/gestures/imagegestures/mainwidget.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWIDGET_H
+#define MAINWIDGET_H
+
+#include <QMainWindow>
+
+class ImageWidget;
+
+class MainWidget : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWidget(QWidget *parent = 0);
+
+public slots:
+ void openDirectory(const QString &path);
+
+private:
+ bool loadImage(const QString &fileName);
+
+ ImageWidget *imageWidget;
+};
+
+#endif
diff --git a/examples/gestures/imageviewer/main.cpp b/examples/gestures/imageviewer/main.cpp
deleted file mode 100644
index c3d03f3..0000000
--- a/examples/gestures/imageviewer/main.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "imagewidget.h"
-
-class MainWidget : public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainWidget(QWidget *parent = 0);
-
-public slots:
- void openDirectory(const QString &path);
-
-private:
- bool loadImage(const QString &fileName);
-
- ImageWidget *imageWidget;
-};
-
-MainWidget::MainWidget(QWidget *parent)
- : QMainWindow(parent)
-{
- resize(400, 300);
- imageWidget = new ImageWidget(this);
- setCentralWidget(imageWidget);
-}
-
-void MainWidget::openDirectory(const QString &path)
-{
- imageWidget->openDirectory(path);
-}
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- MainWidget w;
- w.show();
-
- if (QApplication::arguments().size() > 1)
- w.openDirectory(QApplication::arguments().at(1));
- else
- w.openDirectory(QFileDialog::getExistingDirectory(0, "Select image folder"));
-
- return app.exec();
-}
-
-#include "main.moc"
diff --git a/examples/multimedia/audio/audio.pro b/examples/multimedia/audio/audio.pro
deleted file mode 100644
index c64bb34..0000000
--- a/examples/multimedia/audio/audio.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = audioinput \
- audiooutput \
- audiodevices
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS audio.pro README
-sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio
-INSTALLS += target sources
diff --git a/examples/multimedia/audio/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp
index 4198605..4198605 100644
--- a/examples/multimedia/audio/audiodevices/audiodevices.cpp
+++ b/examples/multimedia/audiodevices/audiodevices.cpp
diff --git a/examples/multimedia/audio/audiodevices/audiodevices.h b/examples/multimedia/audiodevices/audiodevices.h
index 5fe5547..5fe5547 100644
--- a/examples/multimedia/audio/audiodevices/audiodevices.h
+++ b/examples/multimedia/audiodevices/audiodevices.h
diff --git a/examples/multimedia/audio/audiodevices/audiodevices.pro b/examples/multimedia/audiodevices/audiodevices.pro
index 173aa8f..232da09 100644
--- a/examples/multimedia/audio/audiodevices/audiodevices.pro
+++ b/examples/multimedia/audiodevices/audiodevices.pro
@@ -6,9 +6,9 @@ FORMS += audiodevicesbase.ui
QT += multimedia
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiodevices
+target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiodevices
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audiodevices.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiodevices
+sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiodevices
INSTALLS += target sources
symbian {
diff --git a/examples/multimedia/audio/audiodevices/audiodevicesbase.ui b/examples/multimedia/audiodevices/audiodevicesbase.ui
index 5207338..5207338 100644
--- a/examples/multimedia/audio/audiodevices/audiodevicesbase.ui
+++ b/examples/multimedia/audiodevices/audiodevicesbase.ui
diff --git a/examples/multimedia/audio/audiodevices/main.cpp b/examples/multimedia/audiodevices/main.cpp
index d5ddd4f..d5ddd4f 100644
--- a/examples/multimedia/audio/audiodevices/main.cpp
+++ b/examples/multimedia/audiodevices/main.cpp
diff --git a/examples/multimedia/audio/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp
index 05723ae..05723ae 100644
--- a/examples/multimedia/audio/audioinput/audioinput.cpp
+++ b/examples/multimedia/audioinput/audioinput.cpp
diff --git a/examples/multimedia/audio/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h
index 14e1bac..14e1bac 100644
--- a/examples/multimedia/audio/audioinput/audioinput.h
+++ b/examples/multimedia/audioinput/audioinput.h
diff --git a/examples/multimedia/audio/audioinput/audioinput.pro b/examples/multimedia/audioinput/audioinput.pro
index 0d6198d..a54d452 100644
--- a/examples/multimedia/audio/audioinput/audioinput.pro
+++ b/examples/multimedia/audioinput/audioinput.pro
@@ -5,9 +5,9 @@ SOURCES = audioinput.cpp \
QT += multimedia
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audioinput
+target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audioinput
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audioinput.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audioinput
+sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audioinput
INSTALLS += target sources
symbian {
diff --git a/examples/multimedia/audio/audioinput/main.cpp b/examples/multimedia/audioinput/main.cpp
index d7e9c6c..d7e9c6c 100644
--- a/examples/multimedia/audio/audioinput/main.cpp
+++ b/examples/multimedia/audioinput/main.cpp
diff --git a/examples/multimedia/audio/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp
index 9e532cd..9e532cd 100644
--- a/examples/multimedia/audio/audiooutput/audiooutput.cpp
+++ b/examples/multimedia/audiooutput/audiooutput.cpp
diff --git a/examples/multimedia/audio/audiooutput/audiooutput.h b/examples/multimedia/audiooutput/audiooutput.h
index 6c07a3a..6c07a3a 100644
--- a/examples/multimedia/audio/audiooutput/audiooutput.h
+++ b/examples/multimedia/audiooutput/audiooutput.h
diff --git a/examples/multimedia/audio/audiooutput/audiooutput.pro b/examples/multimedia/audiooutput/audiooutput.pro
index b43763c..26f68fe 100644
--- a/examples/multimedia/audio/audiooutput/audiooutput.pro
+++ b/examples/multimedia/audiooutput/audiooutput.pro
@@ -5,9 +5,9 @@ SOURCES = audiooutput.cpp \
QT += multimedia
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiooutput
+target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiooutput
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audiooutput.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiooutput
+sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiooutput
INSTALLS += target sources
symbian {
diff --git a/examples/multimedia/audio/audiooutput/main.cpp b/examples/multimedia/audiooutput/main.cpp
index 79ec99e..79ec99e 100644
--- a/examples/multimedia/audio/audiooutput/main.cpp
+++ b/examples/multimedia/audiooutput/main.cpp
diff --git a/examples/multimedia/multimedia.pro b/examples/multimedia/multimedia.pro
index ac78b15..4a764f2 100644
--- a/examples/multimedia/multimedia.pro
+++ b/examples/multimedia/multimedia.pro
@@ -1,5 +1,15 @@
-TEMPLATE = subdirs
-SUBDIRS = audio
+TEMPLATE = subdirs
+
+!static {
+ SUBDIRS += \
+ audiodevices \
+ audioinput \
+ audiooutput
+}
+
+SUBDIRS += \
+ videographicsitem \
+ videowidget
# install
target.path = $$[QT_INSTALL_EXAMPLES]/multimedia
diff --git a/examples/video/videographicsitem/main.cpp b/examples/multimedia/videographicsitem/main.cpp
index 3bf4c6d..3bf4c6d 100644
--- a/examples/video/videographicsitem/main.cpp
+++ b/examples/multimedia/videographicsitem/main.cpp
diff --git a/examples/video/videographicsitem/videographicsitem.pro b/examples/multimedia/videographicsitem/videographicsitem.pro
index d79c3fb..7c118cc 100644
--- a/examples/video/videographicsitem/videographicsitem.pro
+++ b/examples/multimedia/videographicsitem/videographicsitem.pro
@@ -10,9 +10,9 @@ SOURCES += main.cpp \
videoitem.cpp
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/video/videographicsitem
+target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videographicsitem
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png images
-sources.path = $$[QT_INSTALL_EXAMPLES]/video/videographicsitem
+sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videographicsitem
INSTALLS += target sources
symbian {
diff --git a/examples/video/videographicsitem/videoitem.cpp b/examples/multimedia/videographicsitem/videoitem.cpp
index c95e335..c95e335 100644
--- a/examples/video/videographicsitem/videoitem.cpp
+++ b/examples/multimedia/videographicsitem/videoitem.cpp
diff --git a/examples/video/videographicsitem/videoitem.h b/examples/multimedia/videographicsitem/videoitem.h
index 96f578a..96f578a 100644
--- a/examples/video/videographicsitem/videoitem.h
+++ b/examples/multimedia/videographicsitem/videoitem.h
diff --git a/examples/video/videographicsitem/videoplayer.cpp b/examples/multimedia/videographicsitem/videoplayer.cpp
index 83644db..83644db 100644
--- a/examples/video/videographicsitem/videoplayer.cpp
+++ b/examples/multimedia/videographicsitem/videoplayer.cpp
diff --git a/examples/video/videographicsitem/videoplayer.h b/examples/multimedia/videographicsitem/videoplayer.h
index 8e73e4c..8e73e4c 100644
--- a/examples/video/videographicsitem/videoplayer.h
+++ b/examples/multimedia/videographicsitem/videoplayer.h
diff --git a/examples/video/videowidget/main.cpp b/examples/multimedia/videowidget/main.cpp
index f5edf73..f5edf73 100644
--- a/examples/video/videowidget/main.cpp
+++ b/examples/multimedia/videowidget/main.cpp
diff --git a/examples/video/videowidget/videoplayer.cpp b/examples/multimedia/videowidget/videoplayer.cpp
index ed24714..ed24714 100644
--- a/examples/video/videowidget/videoplayer.cpp
+++ b/examples/multimedia/videowidget/videoplayer.cpp
diff --git a/examples/video/videowidget/videoplayer.h b/examples/multimedia/videowidget/videoplayer.h
index 6547415..6547415 100644
--- a/examples/video/videowidget/videoplayer.h
+++ b/examples/multimedia/videowidget/videoplayer.h
diff --git a/examples/video/videowidget/videowidget.cpp b/examples/multimedia/videowidget/videowidget.cpp
index 80688e1..80688e1 100644
--- a/examples/video/videowidget/videowidget.cpp
+++ b/examples/multimedia/videowidget/videowidget.cpp
diff --git a/examples/video/videowidget/videowidget.h b/examples/multimedia/videowidget/videowidget.h
index 8c343bf..8c343bf 100644
--- a/examples/video/videowidget/videowidget.h
+++ b/examples/multimedia/videowidget/videowidget.h
diff --git a/examples/video/videowidget/videowidget.pro b/examples/multimedia/videowidget/videowidget.pro
index 4a1d717..3f93745 100644
--- a/examples/video/videowidget/videowidget.pro
+++ b/examples/multimedia/videowidget/videowidget.pro
@@ -13,6 +13,12 @@ SOURCES = \
videowidget.cpp \
videowidgetsurface.cpp
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videowidget
+sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png images
+sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videowidget
+INSTALLS += target sources
+
symbian {
TARGET.UID3 = 0xA000D7C3
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/video/videowidget/videowidgetsurface.cpp b/examples/multimedia/videowidget/videowidgetsurface.cpp
index ec9b8b5..ec9b8b5 100644
--- a/examples/video/videowidget/videowidgetsurface.cpp
+++ b/examples/multimedia/videowidget/videowidgetsurface.cpp
diff --git a/examples/video/videowidget/videowidgetsurface.h b/examples/multimedia/videowidget/videowidgetsurface.h
index 83439d3..83439d3 100644
--- a/examples/video/videowidget/videowidgetsurface.h
+++ b/examples/multimedia/videowidget/videowidgetsurface.h
diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h
index c882f1f..f17299f 100644
--- a/examples/opengl/pbuffers/cube.h
+++ b/examples/opengl/pbuffers/cube.h
@@ -48,7 +48,9 @@
#include <QtGui/qvector3d.h>
#include <QtGui/qvector2d.h>
+QT_BEGIN_NAMESPACE
class QPropertyAnimation;
+QT_END_NAMESPACE
class Geometry
{
diff --git a/examples/opengl/pbuffers/glwidget.h b/examples/opengl/pbuffers/glwidget.h
index c019abe..1b46bfd 100644
--- a/examples/opengl/pbuffers/glwidget.h
+++ b/examples/opengl/pbuffers/glwidget.h
@@ -47,7 +47,9 @@
class Geometry;
class Cube;
class Tile;
+QT_BEGIN_NAMESPACE
class QGLPixelBuffer;
+QT_END_NAMESPACE
class GLWidget : public QGLWidget
{
diff --git a/examples/video/video.pro b/examples/video/video.pro
deleted file mode 100644
index f0b63b6..0000000
--- a/examples/video/video.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
- videographicsitem \
- videowidget
-
diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf
index 8892d2a..e21ee5c 100644
--- a/mkspecs/features/symbian/stl.prf
+++ b/mkspecs/features/symbian/stl.prf
@@ -15,7 +15,7 @@ INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE
INCLUDEPATH -= $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off
# libstdcppv5 is preferred over libstdcpp as it has/uses the throwing version of operator new
-exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll ) {
+exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll)|exists($${EPOCROOT}epoc32/release/winscw/udeb/libstdcppv5.dll) {
LIBS *= -llibstdcppv5.dll
# STDCPP turns on standard C++ new behaviour (ie. throwing new)
diff --git a/mkspecs/features/uitools.prf b/mkspecs/features/uitools.prf
index 6eba066..2d14b04 100644
--- a/mkspecs/features/uitools.prf
+++ b/mkspecs/features/uitools.prf
@@ -2,7 +2,9 @@ QT += xml
qt:load(qt)
# Include the correct version of the UiLoader library
-QTUITOOLS_LINKAGE = -lQtUiTools
+symbian: QTUITOOLS_LINKAGE = -lQtUiTools.lib
+else: QTUITOOLS_LINKAGE = -lQtUiTools
+
CONFIG(debug, debug|release) {
mac: QTUITOOLS_LINKAGE = -lQtUiTools_debug
win32: QTUITOOLS_LINKAGE = -lQtUiToolsd
diff --git a/projects.pro b/projects.pro
index 2a6a956..aa1eb71 100644
--- a/projects.pro
+++ b/projects.pro
@@ -8,7 +8,11 @@ TEMPLATE = subdirs
cross_compile: CONFIG += nostrip
isEmpty(QT_BUILD_PARTS) { #defaults
- QT_BUILD_PARTS = libs tools examples demos docs translations
+ symbian {
+ QT_BUILD_PARTS = libs tools examples demos
+ } else {
+ QT_BUILD_PARTS = libs tools examples demos docs translations
+ }
} else { #make sure the order makes sense
contains(QT_BUILD_PARTS, translations) {
QT_BUILD_PARTS -= translations
@@ -28,10 +32,6 @@ isEmpty(QT_BUILD_PARTS) { #defaults
}
}
-symbian {
- QT_BUILD_PARTS = libs tools examples demos
-}
-
#process the projects
for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
isEqual(PROJECT, tools) {
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 69dd627..5915fcf 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -419,269 +419,6 @@ SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator()
subs.clear();
}
-class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator
-{
-public:
- SymbianSubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : SubdirsMetaMakefileGenerator(p, n, op) { }
- virtual ~SymbianSubdirsMetaMakefileGenerator();
-
- virtual bool init();
- virtual bool write(const QString &);
-
-protected:
-
- static QMap<QString, QString> mmpPaths;
-
- static QMultiMap<QString, QString> mmpDependency;
-
- static QStringList getDependencyList(QString mmpFilename, int recursionDepth);
-
- static QStringList calculateRelativePaths(QString mmpParent, QStringList mmpChildren);
-
-private:
- QString cleanFromSpecialCharacters(QString& str);
-};
-
-QMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpPaths;
-
-QMultiMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpDependency;
-
-QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth)
-{
- QStringList list;
-
- QList<QString> values = mmpDependency.values(mmpFilename);
- if (recursionDepth < 0) {
- // special case; just first dependency level
- list = values;
- return list;
- }
- if (values.size() == 0) {
- //reached recursion END condition
- if (recursionDepth == 0) {
- --recursionDepth;
- return list; // empty list // no dependencies / return
- } else {
- list.append(mmpFilename);
- recursionDepth--;
- return list; // leaf // return
- }
- } else {
- recursionDepth++;
- for (int i = 0; i < values.size(); ++i) {
- QString current = values.at(i);
- QStringList tailList = getDependencyList(current, recursionDepth);
- for (int j = 0; j < tailList.size(); ++j) {
- QString path = tailList.at(j);
- list.append(path);
- }
- }
-
- if (recursionDepth > 0) {
- //for mmp somewhere in middle
- list.append(mmpFilename);
- }
- recursionDepth--;
- return list;
- }
-}
-
-SymbianSubdirsMetaMakefileGenerator::~SymbianSubdirsMetaMakefileGenerator() { }
-
-bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd)
-{
- return SubdirsMetaMakefileGenerator::write(oldpwd);
-}
-
-QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str)
-{
- QString tmp = str;
-
- tmp.replace(QString("/"), QString("_"));
- tmp.replace(QString("\\"), QString("_"));
- tmp.replace(QString("-"), QString("_"));
- tmp.replace(QString(":"), QString("_"));
- tmp.replace(QString("."), QString("_"));
-
- return tmp;
-}
-
-bool SymbianSubdirsMetaMakefileGenerator::init()
-{
- if (init_flag)
- return false;
-
- init_flag = true;
-
- // If we are here then we have template == subdirs
-
- Option::recursive = true;
-
- if (Option::recursive) {
- QString old_output_dir = QDir::cleanPath(Option::output_dir);
- if (!old_output_dir.endsWith('/'))
- old_output_dir += '/';
- QString old_output = Option::output.fileName();
- QString oldpwd = QDir::cleanPath(qmake_getpwd());
-
- if (!oldpwd.endsWith('/'))
- oldpwd += '/';
-
- // find the parent mmp filename
- int end = oldpwd.size() - 1;
- int start = oldpwd.lastIndexOf("/", end - 2);
- QString parentMmpFilename = oldpwd.mid(start + 1, end - start - 1);
- parentMmpFilename.prepend(oldpwd);
- parentMmpFilename = parentMmpFilename.append(Option::mmp_ext);
-
-
- const QStringList &subdirs = project->values("SUBDIRS");
- static int recurseDepth = -1;
- ++recurseDepth;
- for (int i = 0; i < subdirs.size(); ++i) {
- Subdir *sub = new Subdir;
- sub->indent = recurseDepth;
-
- QFileInfo subdir(subdirs.at(i));
- // childMmpFielname should be derived from subdirName
- QString subdirName = subdirs.at(i);
- if (!project->isEmpty(subdirs.at(i) + ".file"))
- subdir = project->first(subdirs.at(i) + ".file");
- else if (!project->isEmpty(subdirs.at(i) + ".subdir"))
- subdir = project->first(subdirs.at(i) + ".subdir");
- QString sub_name;
-
- QString childMmpFilename;
-
- if (subdir.isDir()) {
- subdir = QFileInfo(subdir.filePath() + "/" + subdir.fileName() + Option::pro_ext);
- childMmpFilename = subdir.fileName();
- childMmpFilename = subdir.absoluteFilePath();
- childMmpFilename.replace(Option::pro_ext, QString(""));
- childMmpFilename.append(Option::mmp_ext);
- } else {
- childMmpFilename = subdir.absoluteFilePath();
- childMmpFilename.replace(Option::pro_ext, Option::mmp_ext);
- sub_name = childMmpFilename;
- sub_name.replace(Option::mmp_ext, QString(""));
- sub_name.replace(0, sub_name.lastIndexOf("/") + 1, QString(""));
- project->values("SHADOW_BLD_INFS").append(QString("bld.inf.") + sub_name);
- }
-
- //handle sub project
- QMakeProject *sub_proj = new QMakeProject(project->properties());
- for (int ind = 0; ind < sub->indent; ++ind)
- printf(" ");
- sub->input_dir = subdir.absolutePath();
- if (subdir.isRelative() && old_output_dir != oldpwd) {
- sub->output_dir = old_output_dir + "/" + subdir.path();
- printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
- } else {
- sub->output_dir = sub->input_dir;
- printf("Reading %s\n", subdir.absoluteFilePath().toLatin1().constData());
- }
-
- // find the child mmp filename
- qmake_setpwd(sub->input_dir);
-
- QString newpwd = qmake_getpwd();
-
- Option::output_dir = sub->output_dir;
- if (Option::output_dir.at(Option::output_dir.length() - 1) != QLatin1Char('/'))
- Option::output_dir += QLatin1Char('/');
- sub_proj->read(subdir.fileName());
- if (!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
- fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n",
- subdir.fileName().toLatin1().constData(),
- sub_proj->values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
- delete sub;
- delete sub_proj;
- //continue;
- } else {
- // map mmpfile to its absolut filepath
- mmpPaths.insert(childMmpFilename, newpwd);
-
- // update mmp files dependency map
- mmpDependency.insert(parentMmpFilename, childMmpFilename);
-
- sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
- if (0 && sub->makefile->type() == SUBDIRSMETATYPE) {
- subs.append(sub);
- } else {
- const QString output_name = Option::output.fileName();
- Option::output.setFileName(sub->output_file);
- sub->makefile->write(sub->output_dir);
- delete sub;
- qmakeClearCaches();
- sub = 0;
- Option::output.setFileName(output_name);
- }
- }
-
- Option::output_dir = old_output_dir;
- qmake_setpwd(oldpwd);
-
- }
- --recurseDepth;
- Option::output.setFileName(old_output);
- Option::output_dir = old_output_dir;
- qmake_setpwd(oldpwd);
- }
-
- Subdir *self = new Subdir;
- self->input_dir = qmake_getpwd();
-
- // To fully expand find all dependencies:
- // Do as recursion, then insert result as subdirs data in project
- QString newpwd = qmake_getpwd();
- if (!newpwd.endsWith('/'))
- newpwd += '/';
- int end = newpwd.size() - 1;
- int start = newpwd.lastIndexOf("/", end - 2);
- QString mmpFilename = newpwd.mid(start + 1, end - start - 1);
- mmpFilename.prepend(newpwd);
- mmpFilename = mmpFilename.append(Option::mmp_ext);
-
- // map mmpfile to its absolute filepath
- mmpPaths.insert(mmpFilename, newpwd);
-
- QStringList directDependencyList = getDependencyList(mmpFilename, -1);
- for (int i = 0; i < directDependencyList.size(); ++i) {
- project->values("MMPFILES_DIRECT_DEPENDS").append(directDependencyList.at(i));
- }
-
- QStringList dependencyList = getDependencyList(mmpFilename, 0);
-
- self->output_dir = Option::output_dir;
- if (!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
- self->output_file = Option::output.fileName();
- self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
- self->makefile->init();
- subs.append(self);
-
- return true;
-}
-
-QStringList SymbianSubdirsMetaMakefileGenerator::calculateRelativePaths(QString mmpParent, QStringList mmpChildren)
-{
- QStringList mmpRelativePaths;
- QString parentDir = mmpPaths.value(mmpParent);
- QDir directory(parentDir);
- for (int i = 0; i < mmpChildren.size(); ++i) {
- QString childDir = mmpPaths.value(mmpChildren.at(i));
- if (mmpChildren.at(i) == mmpParent)
- mmpRelativePaths.append(mmpChildren.at(i));
- else {
- QString relativePath = directory.relativeFilePath(childDir);
- if (relativePath.startsWith(".."))
- mmpRelativePaths.append(childDir);
- else
- directory.relativeFilePath(relativePath);
- }
- }
- return mmpRelativePaths;
-}
-
//Factory things
QT_BEGIN_INCLUDE_NAMESPACE
#include "unixmake.h"
@@ -750,10 +487,7 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na
MetaMakefileGenerator *ret = 0;
if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
- if (proj->first("MAKEFILE_GENERATOR").startsWith("SYMBIAN") && proj->values("TEMPLATE").contains("subdirs")) {
- // new metamakefilegenerator type to support subdirs for symbian related projects
- ret = new SymbianSubdirsMetaMakefileGenerator(proj, name, op);
- } else if (proj->first("TEMPLATE").endsWith("subdirs"))
+ if (proj->first("TEMPLATE").endsWith("subdirs"))
ret = new SubdirsMetaMakefileGenerator(proj, name, op);
}
if (!ret)
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 3d24053..19af1da 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -1092,6 +1092,7 @@ void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t)
void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension)
{
// Read user defined bld inf rules
+
QMap<QString, QStringList> userBldInfRules;
for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
if (it.key().startsWith(BLD_INF_RULES_BASE)) {
@@ -1122,58 +1123,44 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
QString mmpfilename = escapeFilePath(fileFixify(project->projectFile()));
mmpfilename = mmpfilename.replace(mmpfilename.lastIndexOf("."), 4, Option::mmp_ext);
QString currentPath = qmake_getpwd();
+ QDir directory(currentPath);
- if (!currentPath.endsWith(QString("/")))
- currentPath.append("/");
-
- QStringList mmpProjects = project->values("MMPFILES_DIRECT_DEPENDS");
- QStringList shadowProjects = project->values("SHADOW_BLD_INFS");
-
- removeDuplicatedStrings(mmpProjects);
- removeDuplicatedStrings(shadowProjects);
+ const QStringList &subdirs = project->values("SUBDIRS");
+ foreach(QString item, subdirs) {
+ QString fixedItem;
+ if (!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ } else if (!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ } else {
+ fixedItem = item;
+ }
- // Go in reverse order as that is the way how we build the list
- QListIterator<QString> iT(mmpProjects);
- iT.toBack();
- while (iT.hasPrevious()) {
- QString fullMmpName = iT.previous();
- QString relativePath;
+ QFileInfo subdir(fileInfo(fixedItem));
+ QString relativePath = directory.relativeFilePath(fixedItem);
+ QString subdirFileName = subdir.completeBaseName();
+ QString fullProName = subdir.absoluteFilePath();;
QString bldinfFilename;
- QString fullProFilename = fullMmpName;
- fullProFilename.replace(Option::mmp_ext, Option::pro_ext);
- QString uid = generate_uid(fullProFilename);
-
- QString cleanMmpName = fullProFilename;
- cleanMmpName.replace(Option::pro_ext, QString(""));
- cleanMmpName.replace(0, cleanMmpName.lastIndexOf("/") + 1, QString(""));
-
- if (shadowProjects.contains(BLD_INF_FILENAME "." + cleanMmpName)) { // shadow project
- QDir directory(currentPath);
- relativePath = directory.relativeFilePath(fullProFilename);
- bldinfFilename = BLD_INF_FILENAME "." + cleanMmpName;
+ if (subdir.isDir()) {
+ // Subdir is a regular project
+ bldinfFilename = relativePath + QString("/") + QString(BLD_INF_FILENAME);
+ fullProName += QString("/") + subdirFileName + Option::pro_ext;
+ } else {
+ // Subdir is actually a .pro file
if (relativePath.contains("/")) {
- // Shadow .pro not in same directory as parent .pro
- if (relativePath.startsWith("..")) {
- // Shadow .pro out of parent .pro
- relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
- bldinfFilename.prepend("/").prepend(relativePath);
- } else {
- relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
- bldinfFilename.prepend("/").prepend(relativePath);
- }
+ // .pro not in same directory as parent .pro
+ relativePath.remove(relativePath.lastIndexOf("/") + 1, relativePath.length());
+ bldinfFilename = relativePath;
} else {
- // Shadow .pro and parent .pro in same directory
- bldinfFilename.prepend("./");
+ // .pro and parent .pro in same directory
+ bldinfFilename = QString("./");
}
- } else { // regular project
- QDir directory(currentPath);
- relativePath = directory.relativeFilePath(fullProFilename);
- relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
- bldinfFilename = relativePath.append("/").append(BLD_INF_FILENAME);
+ bldinfFilename += QString(BLD_INF_FILENAME ".") + subdirFileName;
}
- QString bldinfDefine = QString("BLD_INF_") + cleanMmpName + QString("_") + uid;
+ QString uid = generate_uid(fullProName);
+ QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid;
bldinfDefine = bldinfDefine.toUpper();
removeSpecialCharacters(bldinfDefine);
@@ -1195,6 +1182,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
t << endl;
// Add project mmps and old style extension makefiles
+
QString mmpTag;
if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES);
@@ -1204,9 +1192,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
t << endl << mmpTag << endl << endl;
writeBldInfMkFilePart(t, addDeploymentExtension);
- if (targetType == TypeSubdirs) {
- mmpProjects.removeOne(mmpfilename);
- } else {
+ if (targetType != TypeSubdirs) {
QString shortProFilename = project->projectFile();
shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
shortProFilename.replace(Option::pro_ext, QString(""));
@@ -1224,6 +1210,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
t << endl << BLD_INF_TAG_EXTENSIONS << endl << endl;
// Generate extension rules
+
writeBldInfExtensionRulesPart(t);
userItems = userBldInfRules.value(BLD_INF_TAG_EXTENSIONS);
@@ -1698,8 +1685,8 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
.arg(MAKE_CACHE_NAME)
.arg(OK_SIS_TARGET)
.arg(FAIL_SIS_NOCACHE_TARGET)
- .arg(FAIL_SIS_NOPKG_TARGET);
- t << siscommand << endl;
+ .arg(FAIL_SIS_NOPKG_TARGET);
+ t << siscommand << endl;
t << endl;
t << OK_SIS_TARGET ":" << endl;
@@ -1710,15 +1697,15 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
.arg("pkg");
t << pkgcommand << endl;
t << endl;
-
- t << FAIL_SIS_NOPKG_TARGET ":" << endl;
- t << "\t$(error PKG file does not exist, 'SIS' target is only supported for executables or projects with DEPLOYMENT statement)" << endl;
+
+ t << FAIL_SIS_NOPKG_TARGET ":" << endl;
+ t << "\t$(error PKG file does not exist, 'SIS' target is only supported for executables or projects with DEPLOYMENT statement)" << endl;
t << endl;
-
- t << FAIL_SIS_NOCACHE_TARGET ":" << endl;
- t << "\t$(error Project has to be build before calling 'SIS' target)" << endl;
+
+ t << FAIL_SIS_NOCACHE_TARGET ":" << endl;
+ t << "\t$(error Project has to be build before calling 'SIS' target)" << endl;
t << endl;
-
+
t << RESTORE_BUILD_TARGET ":" << endl;
t << "-include " MAKE_CACHE_NAME << endl;
@@ -1728,7 +1715,8 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
{
t << "dodistclean:" << endl;
- foreach(QString item, project->values("SUBDIRS")) {
+ const QStringList &subdirs = project->values("SUBDIRS");
+ foreach(QString item, subdirs) {
bool fromFile = false;
QString fixedItem;
if (!project->isEmpty(item + ".file")) {
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 89fe5bd..e49441b 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -519,7 +519,7 @@ static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;
// Checking for symbian build is primarily determined from the qmake spec,
// but if that is not specified, detect if symbian is the default spec
// by checking the MAKEFILE_GENERATOR variable value.
-static void init_isForSymbian(const QMap<QString, QStringList>& vars)
+static void init_symbian(const QMap<QString, QStringList>& vars)
{
if (isForSymbian_value != isForSymbian_NOT_SET)
return;
@@ -527,26 +527,27 @@ static void init_isForSymbian(const QMap<QString, QStringList>& vars)
QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();
if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {
isForSymbian_value = isForSymbian_ABLD;
- return;
- }
- if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
+ } else if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
isForSymbian_value = isForSymbian_SBSV2;
- return;
- }
-
- QStringList generatorList = vars["MAKEFILE_GENERATOR"];
-
- if (!generatorList.isEmpty()) {
- QString generator = generatorList.first();
- if (generator.startsWith("SYMBIAN_ABLD"))
- isForSymbian_value = isForSymbian_ABLD;
- else if (generator.startsWith("SYMBIAN_SBSV2"))
- isForSymbian_value = isForSymbian_SBSV2;
- else
- isForSymbian_value = isForSymbian_FALSE;
} else {
- isForSymbian_value = isForSymbian_FALSE;
+ QStringList generatorList = vars["MAKEFILE_GENERATOR"];
+
+ if (!generatorList.isEmpty()) {
+ QString generator = generatorList.first();
+ if (generator.startsWith("SYMBIAN_ABLD"))
+ isForSymbian_value = isForSymbian_ABLD;
+ else if (generator.startsWith("SYMBIAN_SBSV2"))
+ isForSymbian_value = isForSymbian_SBSV2;
+ else
+ isForSymbian_value = isForSymbian_FALSE;
+ } else {
+ isForSymbian_value = isForSymbian_FALSE;
+ }
}
+
+ // Force recursive on Symbian, as non-recursive is not really a viable option there
+ if (isForSymbian_value != isForSymbian_FALSE)
+ Option::recursive = true;
}
bool isForSymbian()
@@ -554,9 +555,9 @@ bool isForSymbian()
// If isForSymbian_value has not been initialized explicitly yet,
// call initializer with dummy map to check qmake spec.
if (isForSymbian_value == isForSymbian_NOT_SET)
- init_isForSymbian(QMap<QString, QStringList>());
+ init_symbian(QMap<QString, QStringList>());
- return (isForSymbian_value == isForSymbian_ABLD || isForSymbian_value == isForSymbian_SBSV2);
+ return (isForSymbian_value != isForSymbian_FALSE);
}
bool isForSymbianSbsv2()
@@ -564,7 +565,7 @@ bool isForSymbianSbsv2()
// If isForSymbian_value has not been initialized explicitly yet,
// call initializer with dummy map to check qmake spec.
if (isForSymbian_value == isForSymbian_NOT_SET)
- init_isForSymbian(QMap<QString, QStringList>());
+ init_symbian(QMap<QString, QStringList>());
return (isForSymbian_value == isForSymbian_SBSV2);
}
@@ -1463,7 +1464,7 @@ QMakeProject::read(uchar cmd)
return false;
}
- init_isForSymbian(base_vars);
+ init_symbian(base_vars);
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) {
debug_msg(1, "QMAKECACHE file: reading %s", Option::mkfile::cachefile.toLatin1().constData());
@@ -1715,7 +1716,7 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL
if(file.indexOf(Option::dir_sep) == -1 || !QFile::exists(file)) {
static QStringList *feature_roots = 0;
if(!feature_roots) {
- init_isForSymbian(base_vars);
+ init_symbian(base_vars);
feature_roots = new QStringList(qmake_feature_paths(prop));
qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots);
}
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index 2fdb092..af2c31e 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -376,20 +376,20 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState)
setState(newState);
if (
- LoadingState == oldPhononState
- and StoppedState == newPhononState
- ) {
- // Ensure initial volume is set on MMF API before starting playback
- doVolumeChanged();
-
- // Check whether play() was called while clip was being loaded. If so,
- // playback should be started now
- if (m_playPending) {
- TRACE_0("play was called while loading; starting playback now");
- m_playPending = false;
- play();
- }
- }
+ LoadingState == oldPhononState
+ and StoppedState == newPhononState
+ ) {
+ // Ensure initial volume is set on MMF API before starting playback
+ doVolumeChanged();
+
+ // Check whether play() was called while clip was being loaded. If so,
+ // playback should be started now
+ if (m_playPending) {
+ TRACE_0("play was called while loading; starting playback now");
+ m_playPending = false;
+ play();
+ }
+ }
TRACE_EXIT_0();
}
@@ -400,7 +400,7 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState)
void MMF::AbstractMediaPlayer::tick()
{
- // For the MWC compiler, we need to qualify the base class.
+ // For the MWC compiler, we need to qualify the base class.
emit MMF::AbstractPlayer::tick(currentTime());
}
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index ec39ab1..08558cf 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -87,7 +87,7 @@ public:
// VolumeObserver
virtual void volumeChanged(qreal volume);
-
+
void setVideoOutput(VideoOutput* videoOutput);
/**
@@ -146,9 +146,9 @@ private:
protected:
// Not owned
VideoOutput* m_videoOutput;
-
+
qreal m_volume;
-
+
private:
PrivateState m_state;
Phonon::ErrorType m_error;
diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp
index 5a00f60..bb0e5bc 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.cpp
+++ b/src/3rdparty/phonon/mmf/audiooutput.cpp
@@ -102,15 +102,17 @@ bool MMF::AudioOutput::activateOnMediaObject(MediaObject *mo)
QHash<QByteArray, QVariant> MMF::AudioOutput::audioOutputDescription(int index)
{
+ QHash<QByteArray, QVariant> retval;
+
if (index == AudioOutputDeviceID) {
QHash<QByteArray, QVariant> retval;
retval.insert("name", QCoreApplication::translate("Phonon::MMF", "Audio Output"));
retval.insert("description", QCoreApplication::translate("Phonon::MMF", "The audio output device"));
retval.insert("available", true);
-
- return retval;
}
+
+ return retval;
}
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index ceaf305..1d259a8 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -213,8 +213,8 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError)
}
/*
- if(aError == KErrNone) {
- if(m_nextSource.type() == MediaSource::Empty) {
+ if (aError == KErrNone) {
+ if (m_nextSource.type() == MediaSource::Empty) {
emit finished();
} else {
setSource(m_nextSource);
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index 76db5cb..29ac2df 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -112,7 +112,7 @@ MMF::MediaType MMF::MediaObject::fileMediaType
MediaType result = MediaTypeUnknown;
if (openRecognizer()) {
-
+
const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName));
m_file.Close();
diff --git a/src/3rdparty/phonon/mmf/mmf_medianode.cpp b/src/3rdparty/phonon/mmf/mmf_medianode.cpp
index b60d6f4..253c5e7 100644
--- a/src/3rdparty/phonon/mmf/mmf_medianode.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_medianode.cpp
@@ -74,7 +74,7 @@ bool MMF::MediaNode::applyNodesOnMediaObject(MediaNode *)
// data(length of the graph) which typically is very small.
// First, we go to the very beginning of the graph.
- MMF::MediaNode *current = this;
+ MMF::MediaNode *current = this;
do {
MediaNode *const candidate = current->source();
if (candidate)
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index c7fa791..d1d2337 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -16,7 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <QApplication> // for QApplication::activeWindow
+#include <QApplication> // for QApplication::activeWindow
#include <QUrl>
#include <QTimer>
#include <QWidget>
@@ -27,7 +27,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "mmf_videoplayer.h"
#include "utils.h"
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#include "objectdump.h"
#endif
@@ -45,8 +45,8 @@ using namespace Phonon::MMF;
//-----------------------------------------------------------------------------
MMF::VideoPlayer::VideoPlayer()
- : m_wsSession(0)
- , m_screenDevice(0)
+ : m_wsSession(CCoeEnv::Static()->WsSession())
+ , m_screenDevice(*CCoeEnv::Static()->ScreenDevice())
, m_window(0)
, m_totalTime(0)
, m_mmfOutputChangePending(false)
@@ -56,8 +56,8 @@ MMF::VideoPlayer::VideoPlayer()
MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player)
: AbstractMediaPlayer(player)
- , m_wsSession(0)
- , m_screenDevice(0)
+ , m_wsSession(CCoeEnv::Static()->WsSession())
+ , m_screenDevice(*CCoeEnv::Static()->ScreenDevice())
, m_window(0)
, m_totalTime(0)
, m_mmfOutputChangePending(false)
@@ -70,37 +70,37 @@ void MMF::VideoPlayer::construct()
TRACE_CONTEXT(VideoPlayer::VideoPlayer, EVideoApi);
TRACE_ENTRY_0();
- if(m_videoOutput)
- m_videoOutput->setObserver(this);
+ if (m_videoOutput)
+ m_videoOutput->setObserver(this);
const TInt priority = 0;
const TMdaPriorityPreference preference = EMdaPriorityPreferenceNone;
+ // Ignore return value - first call must always return true
getNativeWindowSystemHandles();
// TODO: is this the correct way to handle errors which occur when
// creating a Symbian object in the constructor of a Qt object?
-
- // TODO: check whether videoOutput is visible? If not, then the
- // corresponding window will not be active, meaning that the
+
+ // TODO: check whether videoOutput is visible? If not, then the
+ // corresponding window will not be active, meaning that the
// clipping region will be set to empty and the video will not be
// visible. If this is the case, we should set m_mmfOutputChangePending
// and respond to future showEvents from the videoOutput widget.
-
- TRAPD(err,
- m_player.reset(CVideoPlayerUtility::NewL
- (
- *this,
- priority, preference,
- *m_wsSession, *m_screenDevice,
- *m_window,
- m_windowRect, m_clipRect
- ))
- );
- if (KErrNone != err) {
+ TRAPD(err,
+ m_player.reset(CVideoPlayerUtility::NewL
+ (
+ *this,
+ priority, preference,
+ m_wsSession, m_screenDevice,
+ *m_window,
+ m_rect, m_rect
+ ))
+ );
+
+ if (KErrNone != err)
changeState(ErrorState);
- }
TRACE_EXIT_0();
}
@@ -120,13 +120,13 @@ MMF::VideoPlayer::~VideoPlayer()
void MMF::VideoPlayer::doPlay()
{
TRACE_CONTEXT(VideoPlayer::doPlay, EVideoApi);
-
+
// See comment in updateMmfOutput
- if(m_mmfOutputChangePending) {
+ if (m_mmfOutputChangePending) {
TRACE_0("MMF output change pending - pushing now");
updateMmfOutput();
}
-
+
m_player->Play();
}
@@ -149,20 +149,20 @@ void MMF::VideoPlayer::doStop()
void MMF::VideoPlayer::doSeek(qint64 ms)
{
TRACE_CONTEXT(VideoPlayer::doSeek, EVideoApi);
-
+
bool wasPlaying = false;
- if(state() == PlayingState) {
- // The call to SetPositionL does not have any effect if playback is
- // ongoing, so we pause before seeking.
- doPause();
- wasPlaying = true;
+ if (state() == PlayingState) {
+ // The call to SetPositionL does not have any effect if playback is
+ // ongoing, so we pause before seeking.
+ doPause();
+ wasPlaying = true;
}
TRAPD(err, m_player->SetPositionL(TTimeIntervalMicroSeconds(ms * 1000)));
- if(KErrNone == err) {
- if(wasPlaying)
- doPlay();
+ if (KErrNone == err) {
+ if (wasPlaying)
+ doPlay();
}
else {
TRACE("SetPositionL error %d", err);
@@ -251,15 +251,15 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError)
if (KErrNone == err) {
maxVolumeChanged(m_player->MaxVolume());
- if(m_videoOutput)
- m_videoOutput->setFrameSize(m_frameSize);
+ if (m_videoOutput)
+ m_videoOutput->setFrameSize(m_frameSize);
// See comment in updateMmfOutput
- if(m_mmfOutputChangePending) {
+ if (m_mmfOutputChangePending) {
TRACE_0("MMF output change pending - pushing now");
updateMmfOutput();
- }
-
+ }
+
emit totalTimeChanged(totalTime());
changeState(StoppedState);
} else {
@@ -300,8 +300,8 @@ void MMF::VideoPlayer::MvpuoPlayComplete(TInt aError)
TRACE_CONTEXT(VideoPlayer::MvpuoPlayComplete, EVideoApi)
TRACE_ENTRY("state %d error %d", state(), aError);
- // TODO
Q_UNUSED(aError); // suppress warnings in release builds
+ changeState(StoppedState);
TRACE_EXIT_0();
}
@@ -327,82 +327,91 @@ void MMF::VideoPlayer::videoOutputRegionChanged()
TRACE_CONTEXT(VideoPlayer::videoOutputRegionChanged, EVideoInternal);
TRACE_ENTRY("state %d", state());
- getNativeWindowSystemHandles();
+ const bool changed = getNativeWindowSystemHandles();
// See comment in updateMmfOutput
- if(state() == LoadingState)
- m_mmfOutputChangePending = true;
- else
- updateMmfOutput();
-
+ if (changed) {
+ if (state() == LoadingState)
+ m_mmfOutputChangePending = true;
+ else
+ updateMmfOutput();
+ }
+
TRACE_EXIT_0();
}
-// DEBUGGING *** DO NOT INTEGRATE ***
+
+#ifndef QT_NO_DEBUG
+
+// The following code is for debugging problems related to video visibility. It allows
+// the VideoPlayer instance to query the window server in order to determine the
+// DSA drawing region for the video window.
+
class CDummyAO : public CActive
{
public:
- CDummyAO() : CActive(CActive::EPriorityStandard) { CActiveScheduler::Add(this); }
- void RunL() { }
- void DoCancel() { }
- TRequestStatus& Status() { return iStatus; }
- void SetActive() { CActive::SetActive(); }
+ CDummyAO() : CActive(CActive::EPriorityStandard) { CActiveScheduler::Add(this); }
+ void RunL() { }
+ void DoCancel() { }
+ TRequestStatus& Status() { return iStatus; }
+ void SetActive() { CActive::SetActive(); }
};
-// DEBUGGING *** DO NOT INTEGRATE ***
void getDsaRegion(RWsSession &session, const RWindowBase &window)
{
- RDirectScreenAccess dsa(session);
- TInt err = dsa.Construct();
- CDummyAO ao;
- RRegion* region;
- err = dsa.Request(region, ao.Status(), window);
- ao.SetActive();
- dsa.Close();
- ao.Cancel();
- if(region) {
- qDebug() << "Phonon::MMF::getDsaRegion count" << region->Count();
- for(int i=0; i<region->Count(); ++i) {
- const TRect& rect = region->RectangleList()[i];
- qDebug() << "Phonon::MMF::getDsaRegion rect" << rect.iTl.iX << rect.iTl.iY << rect.iBr.iX << rect.iBr.iY;
- }
- region->Close();
- }
+ RDirectScreenAccess dsa(session);
+ TInt err = dsa.Construct();
+ CDummyAO ao;
+ RRegion* region;
+ err = dsa.Request(region, ao.Status(), window);
+ ao.SetActive();
+ dsa.Close();
+ ao.Cancel();
+ if (region) {
+ qDebug() << "Phonon::MMF::getDsaRegion count" << region->Count();
+ for (int i=0; i<region->Count(); ++i) {
+ const TRect& rect = region->RectangleList()[i];
+ qDebug() << "Phonon::MMF::getDsaRegion rect"
+ << rect.iTl.iX << rect.iTl.iY << rect.iBr.iX << rect.iBr.iY;
+ }
+ region->Close();
+ }
}
+#endif // _DEBUG
+
void MMF::VideoPlayer::updateMmfOutput()
{
TRACE_CONTEXT(VideoPlayer::updateMmfOutput, EVideoInternal);
TRACE_ENTRY_0();
-
- // Calling SetDisplayWindowL is a no-op unless the MMF controller has
+
+ // Calling SetDisplayWindowL is a no-op unless the MMF controller has
// been loaded, so we shouldn't do it. Instead, the
// m_mmfOutputChangePending flag is used to record the fact that we
- // need to call SetDisplayWindowL, and this is checked in
+ // need to call SetDisplayWindowL, and this is checked in
// MvpuoPrepareComplete, at which point the MMF controller has been
// loaded.
-
- getNativeWindowSystemHandles();
-
-// DEBUGGING *** DO NOT INTEGRATE ***
-getDsaRegion(*m_wsSession, *m_window);
+
+#ifndef QT_NO_DEBUG
+ getDsaRegion(m_wsSession, *m_window);
+#endif
TRAPD(err,
- m_player->SetDisplayWindowL
- (
- *m_wsSession, *m_screenDevice,
- *m_window,
- m_windowRect, m_clipRect
- )
- );
+ m_player->SetDisplayWindowL
+ (
+ m_wsSession, m_screenDevice,
+ *m_window,
+ m_rect, m_rect
+ )
+ );
if (KErrNone != err) {
TRACE("SetDisplayWindowL error %d", err);
setError(NormalError);
}
-
+
m_mmfOutputChangePending = false;
-
+
TRACE_EXIT_0();
}
@@ -416,9 +425,9 @@ void MMF::VideoPlayer::videoOutputChanged()
TRACE_CONTEXT(VideoPlayer::videoOutputChanged, EVideoInternal);
TRACE_ENTRY_0();
- if(m_videoOutput) {
- m_videoOutput->setObserver(this);
- m_videoOutput->setFrameSize(m_frameSize);
+ if (m_videoOutput) {
+ m_videoOutput->setObserver(this);
+ m_videoOutput->setFrameSize(m_frameSize);
}
videoOutputRegionChanged();
@@ -426,58 +435,56 @@ void MMF::VideoPlayer::videoOutputChanged()
TRACE_EXIT_0();
}
-void MMF::VideoPlayer::getNativeWindowSystemHandles()
+bool MMF::VideoPlayer::getNativeWindowSystemHandles()
{
TRACE_CONTEXT(VideoPlayer::getNativeWindowSystemHandles, EVideoInternal);
TRACE_ENTRY_0();
-
+
CCoeControl *control = 0;
-
- if(m_videoOutput)
- // Create native window
- control = m_videoOutput->winId();
+
+ if (m_videoOutput)
+ // Create native window
+ control = m_videoOutput->winId();
else
- // Get top-level window
- control = QApplication::activeWindow()->effectiveWinId();
-
- CCoeEnv* const coeEnv = control->ControlEnv();
- m_wsSession = &(coeEnv->WsSession());
- m_screenDevice = coeEnv->ScreenDevice();
- m_window = control->DrawableWindow();
-
-#ifdef _DEBUG
- if(m_videoOutput) {
- QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper);
- dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs
- ObjectDump::addDefaultAnnotators(*dumper);
- TRACE_0("Dumping VideoOutput:");
- dumper->dumpObject(*m_videoOutput);
+ // Get top-level window
+ control = QApplication::activeWindow()->effectiveWinId();
+
+#ifndef QT_NO_DEBUG
+ if (m_videoOutput) {
+ QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper);
+ dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs
+ ObjectDump::addDefaultAnnotators(*dumper);
+ TRACE_0("Dumping VideoOutput:");
+ dumper->dumpObject(*m_videoOutput);
}
else {
- TRACE_0("m_videoOutput is null - dumping top-level control info:");
- TRACE("control %08x", control);
- TRACE("control.parent %08x", control->Parent());
- TRACE("control.isVisible %d", control->IsVisible());
- TRACE("control.rect %d,%d %dx%d",
- control->Position().iX, control->Position().iY,
- control->Size().iWidth, control->Size().iHeight);
- TRACE("control.ownsWindow %d", control->OwnsWindow());
+ TRACE_0("m_videoOutput is null - dumping top-level control info:");
+ TRACE("control %08x", control);
+ TRACE("control.parent %08x", control->Parent());
+ TRACE("control.isVisible %d", control->IsVisible());
+ TRACE("control.rect %d,%d %dx%d",
+ control->Position().iX, control->Position().iY,
+ control->Size().iWidth, control->Size().iHeight);
+ TRACE("control.ownsWindow %d", control->OwnsWindow());
}
#endif
- m_windowRect = TRect(
- control->DrawableWindow()->AbsPosition(),
- control->DrawableWindow()->Size());
- m_clipRect = m_windowRect;
-
- TRACE("windowRect %d %d - %d %d",
- m_windowRect.iTl.iX, m_windowRect.iTl.iY,
- m_windowRect.iBr.iX, m_windowRect.iBr.iY);
- TRACE("clipRect %d %d - %d %d",
- m_clipRect.iTl.iX, m_clipRect.iTl.iY,
- m_clipRect.iBr.iX, m_clipRect.iBr.iY);
-
- TRACE_EXIT_0();
+ RWindowBase *const window = control->DrawableWindow();
+ const TRect rect(window->AbsPosition(), window->Size());
+
+ TRACE("rect %d %d - %d %d",
+ rect.iTl.iX, rect.iTl.iY,
+ rect.iBr.iX, rect.iBr.iY);
+
+ bool changed = false;
+
+ if (window != m_window || rect != m_rect) {
+ m_window = window;
+ m_rect = rect;
+ changed = true;
+ }
+
+ TRACE_RETURN("changed %d", changed);
}
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
index ee3650a..8072404 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
@@ -80,25 +80,26 @@ private:
// AbstractPlayer
virtual void videoOutputChanged();
-
- void getNativeWindowSystemHandles();
+
+ // Returns true if handles have changed
+ bool getNativeWindowSystemHandles();
+
void updateMmfOutput();
-
+
private:
QScopedPointer<CVideoPlayerUtility> m_player;
// Not owned
- RWsSession* m_wsSession;
- CWsScreenDevice* m_screenDevice;
+ RWsSession& m_wsSession;
+ CWsScreenDevice& m_screenDevice;
RWindowBase* m_window;
- TRect m_windowRect;
- TRect m_clipRect;
-
+ TRect m_rect;
+
QSize m_frameSize;
qint64 m_totalTime;
bool m_mmfOutputChangePending;
-
+
};
}
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp
index ef2b81c..9add439 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp
@@ -36,7 +36,7 @@ namespace ObjectDump
QAnnotator::~QAnnotator()
{
-
+
}
@@ -45,53 +45,53 @@ QAnnotator::~QAnnotator()
//-----------------------------------------------------------------------------
QList<QByteArray> QAnnotatorBasic::annotation(const QObject& object)
-{
+{
QList<QByteArray> result;
-
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << '[' << &object << ']';
stream << ' ';
stream << object.metaObject()->className();
-
- if(object.objectName() != "")
+
+ if (object.objectName() != "")
stream << " \"" << object.objectName() << '"';
-
- if(object.isWidgetType())
+
+ if (object.isWidgetType())
stream << " isWidget";
-
+
stream.flush();
result.append(array);
return result;
}
QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object)
-{
+{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
- if(widget) {
-
+ if (widget) {
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "widget: ";
-
- if(widget->isVisible())
+
+ if (widget->isVisible())
stream << "visible ";
else
stream << "invisible ";
-
+
stream << widget->x() << ',' << widget->y() << ' ';
stream << widget->size().width() << 'x'<< widget->size().height() << ' ';
-
+
stream << "hint " << widget->sizeHint().width() << 'x' << widget->sizeHint().height();
-
+
stream.flush();
result.append(array);
}
-
+
return result;
}
@@ -105,12 +105,12 @@ class QDumperBase
public:
QDumperBase();
~QDumperBase();
-
+
void setPrefix(const QString& prefix);
void addAnnotator(QAnnotator* annotator);
-
+
protected:
- QByteArray m_prefix;
+ QByteArray m_prefix;
QList<QAnnotator*> m_annotators;
};
@@ -139,7 +139,7 @@ void QDumperBase::addAnnotator(QAnnotator* annotator)
// Protect against an exception occurring during QList::append
QScopedPointer<QAnnotator> holder(annotator);
m_annotators.append(annotator);
- holder.take();
+ holder.take();
}
@@ -148,13 +148,13 @@ void QDumperBase::addAnnotator(QAnnotator* annotator)
//-----------------------------------------------------------------------------
class QDumperPrivate : public QDumperBase
-{
+{
public:
QDumperPrivate();
~QDumperPrivate();
void dumpObject(const QObject& object);
-
+
};
@@ -206,27 +206,27 @@ void QDumper::addAnnotator(QAnnotator* annotator)
}
void QDumper::dumpObject(const QObject& object)
-{
+{
d_func()->dumpObject(object);
}
-
+
//-----------------------------------------------------------------------------
// QVisitor
//-----------------------------------------------------------------------------
class QVisitorPrivate : public QDumperBase
-{
+{
public:
QVisitorPrivate();
~QVisitorPrivate();
-
+
void setIndent(unsigned indent);
-
+
void visitNode(const QObject& object);
void visitComplete();
-private:
+private:
class Node
{
public:
@@ -235,24 +235,24 @@ private:
QList<QByteArray> m_annotation;
QList<Node*> m_children;
-
+
typedef QList<Node*>::const_iterator child_iterator;
};
-
+
private:
Node* findNode(const QObject* object) const;
QByteArray branchBuffer(const QList<bool>& branches, bool isNodeLine, bool isLastChild) const;
void dumpRecursive(const Node& node, QList<bool> branches, bool isLastChild);
void dumpNode(const Node& node, const QList<bool>& branches, bool isLastChild);
-
+
private:
unsigned m_indent;
-
+
QScopedPointer<Node> m_root;
-
+
// Hash table used to associate internal nodes with QObjects
typedef QHash<const QObject*, Node*> Hash;
- Hash m_hash;
+ Hash m_hash;
};
static const unsigned DefaultIndent = 2;
@@ -274,21 +274,21 @@ void QVisitorPrivate::setIndent(unsigned indent)
}
// Builds up a mirror of the object tree, rooted in m_root, with each node
-// storing annotations generated by
+// storing annotations generated by
void QVisitorPrivate::visitNode(const QObject& object)
-{
+{
QObject* const objectParent = object.parent();
Node* const nodeParent = objectParent ? findNode(objectParent) : 0;
// Create a new node and store in scoped pointer for exception safety
Node* node = new Node;
QScopedPointer<Node> nodePtr(node);
-
+
// Associate node with QObject
m_hash.insert(&object, node);
-
+
// Insert node into internal tree
- if(nodeParent)
+ if (nodeParent)
{
nodeParent->m_children.append(nodePtr.take());
}
@@ -297,7 +297,7 @@ void QVisitorPrivate::visitNode(const QObject& object)
Q_ASSERT(m_root.isNull());
m_root.reset(nodePtr.take());
}
-
+
// Generate and store annotations
QAnnotator* annotator;
foreach(annotator, m_annotators)
@@ -322,71 +322,71 @@ QByteArray QVisitorPrivate::branchBuffer
(const QList<bool>& branches, bool isNodeLine, bool isLastChild) const
{
const int depth = branches.count();
-
+
const QByteArray indent(m_indent, ' ');
const QByteArray horiz(m_indent, '-');
QByteArray buffer;
QTextStream stream(&buffer);
-
+
for (int i=0; i<depth-1; ++i) {
- if(branches[i])
+ if (branches[i])
stream << '|';
else
stream << ' ';
stream << indent;
}
-
- if(depth) {
- if(isNodeLine)
+
+ if (depth) {
+ if (isNodeLine)
stream << '+' << horiz;
else {
- if(!isLastChild)
+ if (!isLastChild)
stream << '|';
else
stream << ' ';
stream << indent;
}
}
-
+
stream.flush();
buffer.push_front(m_prefix);
-
+
return buffer;
}
void QVisitorPrivate::dumpRecursive
(const Node& node, QList<bool> branches, bool isLastChild)
-{
+{
dumpNode(node, branches, isLastChild);
-
+
// Recurse down tree
const Node::child_iterator begin = node.m_children.begin();
const Node::child_iterator end = node.m_children.end();
- for(Node::child_iterator i = begin; end != i; ++i) {
-
+ for (Node::child_iterator i = begin; end != i; ++i) {
+
isLastChild = (end == i + 1);
-
- if(begin == i)
+
+ if (begin == i)
branches.push_back(!isLastChild);
else
branches.back() = !isLastChild;
-
+
static const bool isNodeLine = false;
const QByteArray buffer = branchBuffer(branches, isNodeLine, false);
qDebug() << buffer.constData();
-
+
dumpRecursive(**i, branches, isLastChild);
}
}
void QVisitorPrivate::dumpNode
(const Node& node, const QList<bool>& branches, bool isLastChild)
-{
+{
const QList<QByteArray>::const_iterator
begin = node.m_annotation.begin(), end = node.m_annotation.end();
-
- if(begin == end) {
+
+ if (begin == end) {
// No annotations - just dump the object pointer
const bool isNodeLine = true;
QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild);
@@ -394,7 +394,7 @@ void QVisitorPrivate::dumpNode
}
else {
// Dump annotations
- for(QList<QByteArray>::const_iterator i = begin; end != i; ++i) {
+ for (QList<QByteArray>::const_iterator i = begin; end != i; ++i) {
const bool isNodeLine = (begin == i);
QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild);
buffer.append(*i);
@@ -408,7 +408,7 @@ void QVisitorPrivate::dumpNode
QVisitorPrivate::Node::Node()
{
-
+
}
QVisitorPrivate::Node::~Node()
@@ -453,7 +453,7 @@ void QVisitor::visitPrepare()
}
void QVisitor::visitNode(const QObject& object)
-{
+{
d_func()->visitNode(object);
}
@@ -474,7 +474,7 @@ void addDefaultAnnotators(QDumper& dumper)
{
dumper.addAnnotator(new QAnnotatorBasic);
dumper.addAnnotator(new QAnnotatorWidget);
-
+
// Add platform-specific annotators
addDefaultAnnotators_sys(dumper);
}
@@ -483,7 +483,7 @@ void addDefaultAnnotators(QVisitor& visitor)
{
visitor.addAnnotator(new QAnnotatorBasic);
visitor.addAnnotator(new QAnnotatorWidget);
-
+
// Add platform-specific annotators
addDefaultAnnotators_sys(visitor);
}
@@ -492,7 +492,7 @@ void dumpTreeFromRoot(const QObject& root, QVisitor& visitor)
{
// Set up iteration range
ObjectTree::DepthFirstConstIterator begin(root), end;
-
+
// Invoke generic visitor algorithm
ObjectTree::visit(begin, end, visitor);
}
@@ -505,7 +505,7 @@ void dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor)
{
root = root->parent();
}
-
+
dumpTreeFromRoot(*root, visitor);
}
@@ -513,7 +513,7 @@ void dumpAncestors(const QObject& leaf, QVisitor& visitor)
{
// Set up iteration range
ObjectTree::AncestorConstIterator begin(leaf), end;
-
+
// Invoke generic visitor algorithm
ObjectTree::visit(begin, end, visitor);
}
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h
index cbd9bea..e94b3ac 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h
@@ -32,7 +32,7 @@ namespace ObjectDump
{
/**
- * Abstract base for annotator classes invoked by QVisitor.
+ * Abstract base for annotator classes invoked by QVisitor.
*/
class OBJECTDUMP_EXPORT QAnnotator : public QObject
{
@@ -72,29 +72,29 @@ class OBJECTDUMP_EXPORT QDumper : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDumper)
-
+
public:
QDumper();
~QDumper();
-
+
/**
* Specify a prefix, to be printed on each line of output.
*/
void setPrefix(const QString& prefix);
-
+
/**
* Takes ownership of annotator.
*/
void addAnnotator(QAnnotator* annotator);
-
+
/**
* Invoke each annotator on the object and write to debug output.
*/
void dumpObject(const QObject& object);
-
+
private:
QScopedPointer<QDumperPrivate> d_ptr;
-
+
};
@@ -107,36 +107,36 @@ class OBJECTDUMP_EXPORT QVisitor : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QVisitor)
-
+
public:
QVisitor();
~QVisitor();
-
+
/**
* Specify a prefix, to be printed on each line of output.
*/
void setPrefix(const QString& prefix);
-
+
/**
* Set number of spaces by which each level of the tree is indented.
*/
void setIndent(unsigned indent);
-
+
/**
* Called by the visitor algorithm before starting the visit.
*/
void visitPrepare();
-
+
/**
* Called by the visitor algorithm as each node is visited.
*/
void visitNode(const QObject& object);
-
+
/**
* Called by the visitor algorithm when the visit is complete.
*/
void visitComplete();
-
+
/**
* Takes ownership of annotator.
*/
@@ -144,7 +144,7 @@ public:
private:
QScopedPointer<QVisitorPrivate> d_ptr;
-
+
};
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
index 5ae10f9..03220a7 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
@@ -21,6 +21,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <coecntrl.h>
#include "objectdump_symbian.h"
+#include <QtGui/private/qwidget_p.h> // to access QWExtra
+
QT_BEGIN_NAMESPACE
namespace ObjectDump
@@ -28,92 +30,118 @@ namespace ObjectDump
namespace Symbian
{
+QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object)
+{
+ QList<QByteArray> result;
+
+ const QWidget* widget = qobject_cast<const QWidget*>(&object);
+ if (widget) {
+
+ const QWExtra* extra = qt_widget_private(const_cast<QWidget *>(widget))->extraData();
+
+ if (extra) {
+
+ QByteArray array;
+ QTextStream stream(&array);
+
+ stream << "widget (Symbian): ";
+ stream << "activated " << extra->activated << ' ';
+ stream << "disableBlit " << extra->disableBlit << ' ';
+
+ stream.flush();
+ result.append(array);
+ }
+ }
+
+ return result;
+}
+
QList<QByteArray> QAnnotatorControl::annotation(const QObject& object)
{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
- if(widget) {
-
+ if (widget) {
+
const CCoeControl* control = widget->effectiveWinId();
- if(control) {
-
+ if (control) {
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "control: " << control << ' ';
stream << "parent " << control->Parent() << ' ';
-
- if(control->IsVisible())
+
+ if (control->IsVisible())
stream << "visible ";
else
stream << "invisible ";
-
+
stream << control->Position().iX << ',' << control->Position().iY << ' ';
stream << control->Size().iWidth << 'x' << control->Size().iHeight;
-
- if(control->OwnsWindow())
+
+ if (control->OwnsWindow())
stream << " ownsWindow ";
-
+
stream.flush();
result.append(array);
}
}
-
+
return result;
}
QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
- if(widget) {
-
+ if (widget) {
+
const CCoeControl* control = widget->effectiveWinId();
- if(control) {
-
- RDrawableWindow& window = *(control->DrawableWindow());
-
+ RDrawableWindow *window = 0;
+
+ if (control && (window = control->DrawableWindow())) {
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "window: ";
-
+
// ClientHandle() is available first in 5.0.
#if !defined(__SERIES60_31__) && !defined(__S60_32__)
if (QSysInfo::s60Version() > QSysInfo::SV_S60_3_2)
- // Client-side window handle
- // Cast to a void pointer so that log output is in hexadecimal format.
- stream << "cli " << reinterpret_cast<const void*>(window.ClientHandle()) << ' ';
+ // Client-side window handle
+ // Cast to a void pointer so that log output is in hexadecimal format.
+ stream << "cli " << reinterpret_cast<const void*>(window->ClientHandle()) << ' ';
#endif
// Server-side address of CWsWindow object
// This is useful for correlation with the window tree dumped by the window
// server (see RWsSession::LogCommand).
// Cast to a void pointer so that log output is in hexadecimal format.
- stream << "srv " << reinterpret_cast<const void*>(window.WsHandle()) << ' ';
-
- stream << "group " << window.WindowGroupId() << ' ';
-
+ stream << "srv " << reinterpret_cast<const void*>(window->WsHandle()) << ' ';
+
+ stream << "group " << window->WindowGroupId() << ' ';
+
// Client-side handle to the parent window.
- // Cast to a void pointer so that log output is in hexadecimal format.
- stream << "parent " << reinterpret_cast<const void*>(window.Parent()) << ' ';
-
- stream << window.Position().iX << ',' << window.Position().iY << ' ';
- stream << '(' << window.AbsPosition().iX << ',' << window.AbsPosition().iY << ") ";
- stream << window.Size().iWidth << 'x' << window.Size().iHeight << ' ';
-
- const TDisplayMode displayMode = window.DisplayMode();
+ // Cast to a void pointer so that log output is in hexadecimal format.
+ stream << "parent " << reinterpret_cast<const void*>(window->Parent()) << ' ';
+
+ stream << window->Position().iX << ',' << window->Position().iY << ' ';
+ stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") ";
+ stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' ';
+
+ const TDisplayMode displayMode = window->DisplayMode();
stream << "mode " << displayMode << ' ';
-
- stream << "ord " << window.OrdinalPosition();
-
+
+ stream << "ord " << window->OrdinalPosition();
+
stream.flush();
result.append(array);
- }
+ }
}
-
+
return result;
}
@@ -121,12 +149,14 @@ QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
void addDefaultAnnotators_sys(QDumper& dumper)
{
+ dumper.addAnnotator(new Symbian::QAnnotatorWidget);
dumper.addAnnotator(new Symbian::QAnnotatorControl);
dumper.addAnnotator(new Symbian::QAnnotatorWindow);
}
void addDefaultAnnotators_sys(QVisitor& visitor)
{
+ visitor.addAnnotator(new Symbian::QAnnotatorWidget);
visitor.addAnnotator(new Symbian::QAnnotatorControl);
visitor.addAnnotator(new Symbian::QAnnotatorWindow);
}
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h
index 26ab308..563c862 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h
@@ -29,6 +29,16 @@ namespace Symbian
{
/**
+ * Annotator which returns Symbian-specific widget information
+ */
+class QAnnotatorWidget : public QAnnotator
+{
+ Q_OBJECT
+public:
+ QList<QByteArray> annotation(const QObject& object);
+};
+
+/**
* Annotator which returns control information
*/
class QAnnotatorControl : public QAnnotator
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp
index 5053b2d..bc61435 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp
@@ -28,38 +28,38 @@ namespace ObjectTree
DepthFirstConstIterator::DepthFirstConstIterator()
: m_pointee(0)
{
-
+
}
DepthFirstConstIterator::DepthFirstConstIterator
(const QObject& root)
: m_pointee(&root)
{
-
+
}
-
+
DepthFirstConstIterator&
DepthFirstConstIterator::operator++()
{
const QObjectList& children = m_pointee->children();
-
+
if (children.count() == 0) {
backtrack();
}
else {
m_history.push(0);
- m_pointee = children.first();
+ m_pointee = children.first();
}
-
+
return *this;
}
void DepthFirstConstIterator::backtrack()
-{
+{
if (m_history.count()) {
const int index = m_history.top();
m_history.pop();
-
+
const QObjectList& siblings = m_pointee->parent()->children();
if (siblings.count() > index + 1) {
m_history.push(index + 1);
@@ -70,7 +70,7 @@ void DepthFirstConstIterator::backtrack()
backtrack();
}
}
- else {
+ else {
// Reached end of search
m_pointee = 0;
}
@@ -80,7 +80,7 @@ void DepthFirstConstIterator::backtrack()
AncestorConstIterator::AncestorConstIterator()
{
-
+
}
AncestorConstIterator::AncestorConstIterator(const QObject& leaf)
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h
index f2729fa..98bdf14 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h
@@ -34,24 +34,24 @@ namespace ObjectTree
*/
class OBJECTDUMP_EXPORT DepthFirstConstIterator
{
-public:
+public:
DepthFirstConstIterator();
DepthFirstConstIterator(const QObject& root);
-
+
DepthFirstConstIterator& operator++();
-
+
inline bool operator==(const DepthFirstConstIterator& other) const
{ return other.m_pointee == m_pointee; }
-
+
inline bool operator!=(const DepthFirstConstIterator& other) const
{ return other.m_pointee != m_pointee; }
-
+
inline const QObject* operator->() const { return m_pointee; }
inline const QObject& operator*() const { return *m_pointee; }
-
+
private:
void backtrack();
-
+
private:
const QObject* m_pointee;
QStack<int> m_history;
@@ -62,40 +62,40 @@ private:
*/
class OBJECTDUMP_EXPORT AncestorConstIterator
{
-public:
+public:
AncestorConstIterator();
AncestorConstIterator(const QObject& root);
-
+
inline AncestorConstIterator& operator++()
{ m_ancestors.pop(); return *this; }
-
+
inline bool operator==(const AncestorConstIterator& other) const
{ return other.m_ancestors == m_ancestors; }
-
+
inline bool operator!=(const AncestorConstIterator& other) const
{ return other.m_ancestors != m_ancestors; }
-
+
inline const QObject* operator->() const { return m_ancestors.top(); }
inline const QObject& operator*() const { return *m_ancestors.top(); }
-
+
private:
QStack<const QObject*> m_ancestors;
-
+
};
/**
* Generic algorithm for visiting nodes in an object tree. Nodes in the
* tree are visited in a const context, therefore they are not modified
* by this algorithm.
- *
+ *
* Visitor must provide functions with the following signatures:
- *
+ *
* Called before visit begins
* void visitPrepare()
- *
+ *
* Called on each node visited
* void visitNode(const QObject& object)
- *
+ *
* Called when visit is complete
* void visitComplete()
*/
@@ -103,8 +103,8 @@ template <class Iterator, class Visitor>
void visit(Iterator begin, Iterator end, Visitor& visitor)
{
visitor.visitPrepare();
-
- for( ; begin != end; ++begin)
+
+ for ( ; begin != end; ++begin)
visitor.visitNode(*begin);
visitor.visitComplete();
diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp
index 2f5b68f..58d1ece 100644
--- a/src/3rdparty/phonon/mmf/utils.cpp
+++ b/src/3rdparty/phonon/mmf/utils.cpp
@@ -62,7 +62,7 @@ MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType)
}
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#include <hal.h>
#include <hal_data.h>
@@ -111,7 +111,7 @@ QColor MMF::Utils::getScreenPixel(const QPoint& pos)
TScreenInfo info;
TRAPD(err, getScreenInfoL(info));
QColor pixel;
- if(err == KErrNone and pos.x() < info.width and pos.y() < info.height)
+ if (err == KErrNone and pos.x() < info.width and pos.y() < info.height)
{
const int bytesPerPixel = info.bpp / 8;
Q_ASSERT(bytesPerPixel >= 3);
@@ -129,7 +129,7 @@ QColor MMF::Utils::getScreenPixel(const QPoint& pos)
pixel.setGreen(*ptr++);
pixel.setRed(*ptr++);
- if(bytesPerPixel == 4)
+ if (bytesPerPixel == 4)
pixel.setAlpha(*ptr++);
}
return pixel;
@@ -138,7 +138,7 @@ QColor MMF::Utils::getScreenPixel(const QPoint& pos)
// Debugging: for debugging video visibility
void MMF::Utils::dumpScreenPixelSample()
{
- for(int i=0; i<20; ++i) {
+ for (int i=0; i<20; ++i) {
const QPoint pos(i*10, i*10);
const QColor pixel = Utils::getScreenPixel(pos);
RDebug::Printf(
diff --git a/src/3rdparty/phonon/mmf/utils.h b/src/3rdparty/phonon/mmf/utils.h
index 38964d0..7e363e8 100644
--- a/src/3rdparty/phonon/mmf/utils.h
+++ b/src/3rdparty/phonon/mmf/utils.h
@@ -54,7 +54,7 @@ void panic(PanicCode code);
*/
MediaType mimeTypeToMediaType(const TDesC& mimeType);
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
/**
* Retrieve color of specified pixel from the screen.
*/
@@ -138,16 +138,16 @@ public:
#define _TRACE_MODULE Phonon::MMF
// Macros available for use by implementation code
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#define TRACE_CONTEXT(_fn, _cat) const ::Phonon::MMF::TTraceContext _tc((TText*)L ## #_fn, (TUint)this, _cat);
-#define TRACE_ENTRY_0() { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
-#define TRACE_ENTRY(string, args...) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
-#define TRACE_EXIT_0() { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
-#define TRACE_EXIT(string, args...) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
-#define TRACE_RETURN(string, result) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "r Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, result); } return result;
+#define TRACE_ENTRY_0() { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
+#define TRACE_ENTRY(string, args...) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
+#define TRACE_EXIT_0() { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
+#define TRACE_EXIT(string, args...) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
+#define TRACE_RETURN(string, result) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "r Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, result); } return result;
#define TRACE_PANIC(code) { _TRACE_PRINT(_TRACE_TEXT(L ## "! Phonon::MMF::%s [0x%08x] panic %d"), _tc.iFunction, _tc.iAddr, code); } Utils::panic(code);
-#define TRACE_0(string) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr); }
-#define TRACE(string, args...) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
+#define TRACE_0(string) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr); }
+#define TRACE(string, args...) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
#else
#define TRACE_CONTEXT(_fn, _cat)
#define TRACE_ENTRY_0()
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp
index 041b0a8..f0393a7 100644
--- a/src/3rdparty/phonon/mmf/videooutput.cpp
+++ b/src/3rdparty/phonon/mmf/videooutput.cpp
@@ -20,7 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "videooutput.h"
#include "videooutputobserver.h"
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#include "objectdump.h"
#endif
@@ -52,19 +52,19 @@ MMF::VideoOutput::VideoOutput(QWidget* parent)
TRACE_ENTRY("parent 0x%08x", parent);
setPalette(QPalette(Qt::black));
- setAttribute(Qt::WA_OpaquePaintEvent, true);
- setAttribute(Qt::WA_NoSystemBackground, true);
- setAutoFillBackground(false);
+ setAttribute(Qt::WA_OpaquePaintEvent, true);
+ setAttribute(Qt::WA_NoSystemBackground, true);
+ setAutoFillBackground(false);
- // Causes QSymbianControl::Draw not to BitBlt this widget's region of the
- // backing store. Since the backing store is (by default) a 16MU bitmap,
- // blitting it results in this widget's screen region in the final
- // framebuffer having opaque alpha values. This in turn causes the video
- // to be invisible when running on the target device.
- qt_widget_private(this)->extraData()->disableBlit = true;
+ // Causes QSymbianControl::Draw not to BitBlt this widget's region of the
+ // backing store. Since the backing store is (by default) a 16MU bitmap,
+ // blitting it results in this widget's screen region in the final
+ // framebuffer having opaque alpha values. This in turn causes the video
+ // to be invisible when running on the target device.
+ qt_widget_private(this)->extraData()->disableBlit = true;
dump();
-
+
TRACE_EXIT_0();
}
@@ -123,9 +123,7 @@ void MMF::VideoOutput::paintEvent(QPaintEvent* event)
TRACE("regions %d", event->region().numRects());
TRACE("type %d", event->type());
- dump();
-
- // Do not paint anything
+ // Do nothing
}
void MMF::VideoOutput::resizeEvent(QResizeEvent* event)
@@ -135,10 +133,7 @@ void MMF::VideoOutput::resizeEvent(QResizeEvent* event)
event->oldSize().width(), event->oldSize().height(),
event->size().width(), event->size().height());
- QWidget::resizeEvent(event);
-
- if (m_observer)
- m_observer->videoOutputRegionChanged();
+ videoOutputRegionChanged();
}
void MMF::VideoOutput::moveEvent(QMoveEvent* event)
@@ -148,10 +143,20 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event)
event->oldPos().x(), event->oldPos().y(),
event->pos().x(), event->pos().y());
- QWidget::moveEvent(event);
+ videoOutputRegionChanged();
+}
- if (m_observer)
- m_observer->videoOutputRegionChanged();
+bool MMF::VideoOutput::event(QEvent* event)
+{
+ TRACE_CONTEXT(VideoOutput::event, EVideoInternal);
+
+ if (event->type() == QEvent::WinIdChange) {
+ TRACE_0("WinIdChange");
+ videoOutputRegionChanged();
+ return true;
+ }
+ else
+ return QWidget::event(event);
}
@@ -159,9 +164,16 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event)
// Private functions
//-----------------------------------------------------------------------------
-void VideoOutput::dump() const
+void MMF::VideoOutput::videoOutputRegionChanged()
+{
+ dump();
+ if (m_observer)
+ m_observer->videoOutputRegionChanged();
+}
+
+void MMF::VideoOutput::dump() const
{
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
TRACE_CONTEXT(VideoOutput::dump, EVideoInternal);
QScopedPointer<ObjectDump::QVisitor> visitor(new ObjectDump::QVisitor);
visitor->setPrefix("Phonon::MMF"); // to aid searchability of logs
diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h
index 639a5ed..7bc0b52 100644
--- a/src/3rdparty/phonon/mmf/videooutput.h
+++ b/src/3rdparty/phonon/mmf/videooutput.h
@@ -49,10 +49,12 @@ protected:
void paintEvent(QPaintEvent* event);
void resizeEvent(QResizeEvent* event);
void moveEvent(QMoveEvent* event);
+ bool event(QEvent* event);
private:
void dump() const;
-
+ void videoOutputRegionChanged();
+
private:
QSize m_frameSize;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index b06b93a..41067f1 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -137,7 +137,7 @@ void QWebViewPrivate::_q_pageDestroyed()
It can be used in various applications to display web content live from the
Internet.
- The image below shows QWebView previewed in \QD with the Trolltech website.
+ The image below shows QWebView previewed in \QD with a Nokia website.
\image qwebview-url.png
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index c775a00..0d5f278 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -278,11 +278,11 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation, bool isTopL
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
{
- unregisterRunningAnimation(animation);
-
if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer)
return;
+ unregisterRunningAnimation(animation);
+
int idx = animations.indexOf(animation);
if (idx != -1) {
animations.removeAt(idx);
@@ -318,6 +318,7 @@ void QUnifiedTimer::unregisterRunningAnimation(QAbstractAnimation *animation)
runningPauseAnimations.removeOne(animation);
else
runningLeafAnimations--;
+ Q_ASSERT(runningLeafAnimations >= 0);
}
int QUnifiedTimer::closestPauseAnimationTimeToFinish()
@@ -328,9 +329,9 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish()
int timeToFinish;
if (animation->direction() == QAbstractAnimation::Forward)
- timeToFinish = animation->totalDuration() - QAbstractAnimationPrivate::get(animation)->totalCurrentTime;
+ timeToFinish = animation->duration() - animation->currentTime();
else
- timeToFinish = QAbstractAnimationPrivate::get(animation)->totalCurrentTime;
+ timeToFinish = animation->currentTime();
if (timeToFinish < closestTimeToFinish)
closestTimeToFinish = timeToFinish;
@@ -648,13 +649,13 @@ int QAbstractAnimation::currentLoop() const
*/
int QAbstractAnimation::totalDuration() const
{
- Q_D(const QAbstractAnimation);
- if (d->loopCount < 0)
- return -1;
int dura = duration();
- if (dura == -1)
+ if (dura <= 0)
+ return dura;
+ int loopcount = loopCount();
+ if (loopcount < 0)
return -1;
- return dura * d->loopCount;
+ return dura * loopcount;
}
/*!
@@ -685,7 +686,7 @@ void QAbstractAnimation::setCurrentTime(int msecs)
// Calculate new time and loop.
int dura = duration();
- int totalDura = (d->loopCount < 0 || dura == -1) ? -1 : dura * d->loopCount;
+ int totalDura = dura <= 0 ? dura : ((d->loopCount < 0) ? -1 : dura * d->loopCount);
if (totalDura != -1)
msecs = qMin(totalDura, msecs);
d->totalCurrentTime = msecs;
diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp
index d90f001..21e5b08 100644
--- a/src/corelib/animation/qpauseanimation.cpp
+++ b/src/corelib/animation/qpauseanimation.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
class QPauseAnimationPrivate : public QAbstractAnimationPrivate
{
public:
- QPauseAnimationPrivate() : QAbstractAnimationPrivate(), duration(0)
+ QPauseAnimationPrivate() : QAbstractAnimationPrivate(), duration(250)
{
isPause = true;
}
@@ -114,6 +114,7 @@ QPauseAnimation::~QPauseAnimation()
\brief the duration of the pause.
The duration of the pause. The duration should not be negative.
+ The default duration is 250 milliseconds.
*/
int QPauseAnimation::duration() const
{
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index ad4bc55..f28f94e 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -44,10 +44,6 @@
#include <QtCore/qglobal.h>
-#ifdef Q_OS_SYMBIAN
-# include <e32def.h>
-#endif
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ba05b00..e8d6df0 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1827,7 +1827,9 @@
\value TabFocus the widget accepts focus by tabbing.
\value ClickFocus the widget accepts focus by clicking.
\value StrongFocus the widget accepts focus by both tabbing
- and clicking.
+ and clicking. On Mac OS X this will also
+ be indicate that the widget accepts tab focus
+ when in 'Text/List focus mode'.
\value WheelFocus like Qt::StrongFocus plus the widget accepts
focus by using the mouse wheel.
\value NoFocus the widget does not accept focus.
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 1fd2165..a1c9833 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -2565,8 +2565,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
Example:
\snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 10
- The scope is QSettings::UserScope and the format is
- QSettings::NativeFormat.
+ The scope is set to QSettings::UserScope, and the format is
+ set to QSettings::NativeFormat (i.e. calling setDefaultFormat()
+ before calling this constructor has no effect).
\sa setDefaultFormat(), {Fallback Mechanism}
*/
@@ -2583,11 +2584,12 @@ QSettings::QSettings(const QString &organization, const QString &application, QO
If \a scope is QSettings::UserScope, the QSettings object searches
user-specific settings first, before it searches system-wide
- settings as a fallback. If \a scope is
- QSettings::SystemScope, the QSettings object ignores user-specific
- settings and provides access to system-wide settings.
+ settings as a fallback. If \a scope is QSettings::SystemScope, the
+ QSettings object ignores user-specific settings and provides
+ access to system-wide settings.
- The storage format is QSettings::NativeFormat.
+ The storage format is set to QSettings::NativeFormat (i.e. calling
+ setDefaultFormat() before calling this constructor has no effect).
If no application name is given, the QSettings object will
only access the organization-wide \l{Fallback Mechanism}{locations}.
@@ -2668,6 +2670,8 @@ QSettings::QSettings(const QString &fileName, Format format, QObject *parent)
The scope is QSettings::UserScope and the format is
defaultFormat() (QSettings::NativeFormat by default).
+ Use setDefaultFormat() before calling this constructor
+ to change the default format used by this constructor.
The code
@@ -3352,10 +3356,12 @@ QVariant QSettings::value(const QString &key, const QVariant &defaultValue) cons
/*!
\since 4.4
- Sets the default file format to the given \a format, used for storing
- settings for the QSettings(QObject *) constructor.
+ Sets the default file format to the given \a format, which is used
+ for storing settings for the QSettings(QObject *) constructor.
- If no default format is set, QSettings::NativeFormat is used.
+ If no default format is set, QSettings::NativeFormat is used. See
+ the documentation for the QSettings constructor you are using to
+ see if that constructor will ignore this function.
\sa format()
*/
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 5883042..9098515 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -228,6 +228,7 @@ QT_BEGIN_NAMESPACE
\value TouchBegin Beginning of a sequence of touch-screen and/or track-pad events (QTouchEvent)
\value TouchUpdate Touch-screen event (QTouchEvent)
\value TouchEnd End of touch-event sequence (QTouchEvent)
+ \value WinIdChange The window system identifer for this native widget has changed
\value Gesture A gesture was triggered (QGestureEvent)
\value GestureOverride A gesture override was triggered (QGestureEvent)
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index ee1e1b9..6427d17 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -283,6 +283,7 @@ public:
UpdateSoftKeys = 201, // Internal for compressing soft key updates
+ WinIdChange = 203,
Gesture = 198,
GestureOverride = 202,
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 02f77a1..b32696d 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -668,6 +668,7 @@ void QEventDispatcherSymbian::closingDown()
bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags )
{
bool handledAnyEvent = false;
+ bool oldNoSocketEventsValue = m_noSocketEvents;
QT_TRY {
Q_D(QAbstractEventDispatcher);
@@ -686,7 +687,6 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
block = false;
}
- bool oldNoSocketEventsValue = m_noSocketEvents;
if (flags & QEventLoop::ExcludeSocketNotifiers) {
m_noSocketEvents = true;
} else {
@@ -762,14 +762,14 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
};
emit awake();
-
- m_noSocketEvents = oldNoSocketEventsValue;
} QT_CATCH (const std::exception& ex) {
#ifndef QT_NO_EXCEPTIONS
CActiveScheduler::Current()->Error(qt_symbian_exception2Error(ex));
#endif
}
+ m_noSocketEvents = oldNoSocketEventsValue;
+
return handledAnyEvent;
}
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 1b559cf..54465bb 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -73,6 +73,10 @@
#include <private/qcore_mac_p.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <e32std.h>
+#endif
+
QT_BEGIN_NAMESPACE
enum {
@@ -1128,6 +1132,12 @@ QDate QDate::currentDate()
memset(&st, 0, sizeof(SYSTEMTIME));
GetLocalTime(&st);
d.jd = julianDayFromDate(st.wYear, st.wMonth, st.wDay);
+#elif defined(Q_OS_SYMBIAN)
+ TTime localTime;
+ localTime.HomeTime();
+ TDateTime localDateTime = localTime.DateTime();
+ // months and days are zero indexed
+ d.jd = julianDayFromDate(localDateTime.Year(), localDateTime.Month() + 1, localDateTime.Day() + 1 );
#else
// posix compliant system
time_t ltime;
@@ -1823,6 +1833,12 @@ QTime QTime::currentTime()
#if defined(Q_OS_WINCE)
ct.startTick = GetTickCount() % MSECS_PER_DAY;
#endif
+#elif defined(Q_OS_SYMBIAN)
+ TTime localTime;
+ localTime.HomeTime();
+ TDateTime localDateTime = localTime.DateTime();
+ ct.mds = MSECS_PER_HOUR * localDateTime.Hour() + MSECS_PER_MIN * localDateTime.Minute()
+ + 1000 * localDateTime.Second() + (localDateTime.MicroSecond() / 1000);
#elif defined(Q_OS_UNIX)
// posix compliant system
struct timeval tv;
@@ -2874,6 +2890,8 @@ QDateTime QDateTime::currentDateTime()
t.mds = MSECS_PER_HOUR * st.wHour + MSECS_PER_MIN * st.wMinute + 1000 * st.wSecond
+ st.wMilliseconds;
return QDateTime(d, t);
+#elif defined(Q_OS_SYMBIAN)
+ return QDateTime(QDate::currentDate(), QTime::currentTime());
#else
#if defined(Q_OS_UNIX)
// posix compliant system
@@ -3700,6 +3718,27 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time)
res.tm_mon = sysTime.wMonth - 1;
res.tm_year = sysTime.wYear - 1900;
brokenDown = &res;
+#elif defined(Q_OS_SYMBIAN)
+ // months and days are zero index based
+ _LIT(KUnixEpoch, "19700000:000000.000000");
+ TTimeIntervalSeconds utcOffset = User::UTCOffset();
+ TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC);
+ TTime epochTTime;
+ TInt err = epochTTime.Set(KUnixEpoch);
+ if(err == KErrNone) {
+ TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
+ utcTTime = utcTTime + utcOffset;
+ TDateTime utcDateTime = utcTTime.DateTime();
+ tm res;
+ res.tm_sec = utcDateTime.Second();
+ res.tm_min = utcDateTime.Minute();
+ res.tm_hour = utcDateTime.Hour();
+ res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct
+ res.tm_mon = utcDateTime.Month();
+ res.tm_year = utcDateTime.Year() - 1900;
+ res.tm_isdst = 0;
+ brokenDown = &res;
+ }
#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant version of localtime() where available
tzset();
@@ -3745,7 +3784,7 @@ static void localToUtc(QDate &date, QTime &time, int isdst)
localTM.tm_mon = fakeDate.month() - 1;
localTM.tm_year = fakeDate.year() - 1900;
localTM.tm_isdst = (int)isdst;
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
time_t secsSince1Jan1970UTC = toTime_tHelper(fakeDate, time);
#else
#if defined(Q_OS_WIN)
@@ -3770,6 +3809,27 @@ static void localToUtc(QDate &date, QTime &time, int isdst)
res.tm_year = sysTime.wYear - 1900;
res.tm_isdst = (int)isdst;
brokenDown = &res;
+#elif defined(Q_OS_SYMBIAN)
+ // months and days are zero index based
+ _LIT(KUnixEpoch, "19700000:000000.000000");
+ TTimeIntervalSeconds utcOffset = TTimeIntervalSeconds(0 - User::UTCOffset().Int());
+ TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC);
+ TTime epochTTime;
+ TInt err = epochTTime.Set(KUnixEpoch);
+ if(err == KErrNone) {
+ TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
+ utcTTime = utcTTime + utcOffset;
+ TDateTime utcDateTime = utcTTime.DateTime();
+ tm res;
+ res.tm_sec = utcDateTime.Second();
+ res.tm_min = utcDateTime.Minute();
+ res.tm_hour = utcDateTime.Hour();
+ res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct
+ res.tm_mon = utcDateTime.Month();
+ res.tm_year = utcDateTime.Year() - 1900;
+ res.tm_isdst = (int)isdst;
+ brokenDown = &res;
+ }
#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant version of gmtime() where available
tm res;
diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp
index 436ef94..762936a 100644
--- a/src/gui/dialogs/qerrormessage.cpp
+++ b/src/gui/dialogs/qerrormessage.cpp
@@ -245,12 +245,6 @@ QErrorMessage::QErrorMessage(QWidget * parent)
Q_D(QErrorMessage);
QGridLayout * grid = new QGridLayout(this);
d->icon = new QLabel(this);
-#ifdef QT_SOFTKEYS_ENABLED
- d->okAction = new QAction(this);
- d->okAction->setSoftKeyRole(QAction::PositiveSoftKey);
- connect(d->okAction, SIGNAL(triggered()), this, SLOT(accept()));
- addAction(d->okAction);
-#endif
#ifndef QT_NO_MESSAGEBOX
d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
@@ -262,6 +256,13 @@ QErrorMessage::QErrorMessage(QWidget * parent)
d->again->setChecked(true);
grid->addWidget(d->again, 1, 1, Qt::AlignTop);
d->ok = new QPushButton(this);
+#ifdef QT_SOFTKEYS_ENABLED
+ d->okAction = new QAction(d->ok);
+ d->okAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ connect(d->okAction, SIGNAL(triggered()), this, SLOT(accept()));
+ addAction(d->okAction);
+#endif
+
#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
d->ok->setFixedSize(0,0);
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm
index 667fc40..56a065a 100644
--- a/src/gui/dialogs/qprintdialog_mac.mm
+++ b/src/gui/dialogs/qprintdialog_mac.mm
@@ -122,6 +122,8 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
+#ifdef QT_MAC_USE_COCOA
+
@class QCocoaPrintPanelDelegate;
@interface QCocoaPrintPanelDelegate : NSObject {
@@ -197,6 +199,8 @@ QT_USE_NAMESPACE
}
@end
+#endif
+
QT_BEGIN_NAMESPACE
extern void macStartInterceptWindowTitle(QWidget *window);
diff --git a/src/gui/dialogs/qprogressdialog.cpp b/src/gui/dialogs/qprogressdialog.cpp
index 5fb10bf..f5024bb 100644
--- a/src/gui/dialogs/qprogressdialog.cpp
+++ b/src/gui/dialogs/qprogressdialog.cpp
@@ -453,7 +453,7 @@ void QProgressDialog::setCancelButton(QPushButton *cancelButton)
cancelButton->show();
#else
{
- d->cancelAction = new QAction(cancelButton->text(), this);
+ d->cancelAction = new QAction(cancelButton->text(), cancelButton);
d->cancelAction->setSoftKeyRole(QAction::NegativeSoftKey);
connect(d->cancelAction, SIGNAL(triggered()), this, SIGNAL(canceled()));
addAction(d->cancelAction);
diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp
index 0f6d353..0102e25 100644
--- a/src/gui/dialogs/qwizard.cpp
+++ b/src/gui/dialogs/qwizard.cpp
@@ -1340,7 +1340,7 @@ bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const
pushButton->setText(buttonDefaultText(wizStyle, which, this));
#ifdef QT_SOFTKEYS_ENABLED
- QAction *softKey = new QAction(pushButton->text(), antiFlickerWidget);
+ QAction *softKey = new QAction(pushButton->text(), pushButton);
QAction::SoftKeyRole softKeyRole;
switch(which) {
case QWizard::NextButton:
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index ee01fdc..91641b0 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -105,6 +105,7 @@
#include <QtGui/qpainter.h>
#include <QtCore/qrect.h>
#include <QtCore/qdebug.h>
+#include <private/qdrawhelper_p.h>
QT_BEGIN_NAMESPACE
@@ -893,15 +894,8 @@ void QGraphicsBlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
return;
}
- QPoint offset;
- if (source->isPixmap()) {
- // No point in drawing in device coordinates (pixmap will be scaled anyways).
- const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset);
- d->filter->draw(painter, offset, pixmap);
- return;
- }
-
// Draw pixmap in device coordinates to avoid pixmap scaling.
+ QPoint offset;
const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset);
QTransform restoreTransform = painter->worldTransform();
painter->setWorldTransform(QTransform());
@@ -1084,15 +1078,8 @@ void QGraphicsDropShadowEffect::draw(QPainter *painter, QGraphicsEffectSource *s
return;
}
- QPoint offset;
- if (source->isPixmap()) {
- // No point in drawing in device coordinates (pixmap will be scaled anyways).
- const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset);
- d->filter->draw(painter, offset, pixmap);
- return;
- }
-
// Draw pixmap in device coordinates to avoid pixmap scaling.
+ QPoint offset;
const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset);
QTransform restoreTransform = painter->worldTransform();
painter->setWorldTransform(QTransform());
@@ -1475,6 +1462,8 @@ void QGraphicsBloomEffect::setStrength(qreal strength)
The \a strength parameter holds the effect's new strength.
*/
+extern QPixmap qt_toRasterPixmap(const QPixmap &pixmap);
+
/*!
\reimp
*/
@@ -1486,42 +1475,37 @@ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source
return;
}
- const Qt::CoordinateSystem system = source->isPixmap()
- ? Qt::LogicalCoordinates : Qt::DeviceCoordinates;
QPoint offset;
- QPixmap pixmap = source->pixmap(system, &offset);
- QImage result = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ QPixmap pixmap = qt_toRasterPixmap(source->pixmap(Qt::DeviceCoordinates, &offset));
// Blur.
- QPainter blurPainter(&pixmap);
+ QImage overlay(pixmap.size(), QImage::Format_ARGB32_Premultiplied);
+ overlay.fill(0);
+
+ QPainter blurPainter(&overlay);
d->blurFilter.draw(&blurPainter, QPointF(), pixmap);
blurPainter.end();
// Brighten.
- QImage overlay = pixmap.toImage().convertToFormat(QImage::Format_ARGB32);
const int numBits = overlay.width() * overlay.height();
QRgb *bits = reinterpret_cast<QRgb *>(overlay.bits());
for (int i = 0; i < numBits; ++i) {
- const QRgb bit = bits[i];
- bits[i] = qRgba(d->colorTable[qRed(bit)], d->colorTable[qGreen(bit)],
- d->colorTable[qBlue(bit)], qAlpha(bit));
+ const QRgb pixel = INV_PREMUL(bits[i]);
+ bits[i] = PREMUL(qRgba(d->colorTable[qRed(pixel)], d->colorTable[qGreen(pixel)],
+ d->colorTable[qBlue(pixel)], qAlpha(pixel)));
}
// Composite.
- QPainter compPainter(&result);
+ QPainter compPainter(&pixmap);
compPainter.setCompositionMode(QPainter::CompositionMode_Overlay);
compPainter.setOpacity(d->strength);
compPainter.drawImage(0, 0, overlay);
compPainter.end();
- if (system == Qt::DeviceCoordinates) {
- QTransform restoreTransform = painter->worldTransform();
- painter->setWorldTransform(QTransform());
- painter->drawImage(offset, result);
- painter->setWorldTransform(restoreTransform);
- } else {
- painter->drawImage(offset, result);
- }
+ QTransform restoreTransform = painter->worldTransform();
+ painter->setWorldTransform(QTransform());
+ painter->drawPixmap(offset, pixmap);
+ painter->setWorldTransform(restoreTransform);
}
QT_END_NAMESPACE
diff --git a/src/gui/egl/qegl_qws.cpp b/src/gui/egl/qegl_qws.cpp
index 590b666..df1179a 100644
--- a/src/gui/egl/qegl_qws.cpp
+++ b/src/gui/egl/qegl_qws.cpp
@@ -83,7 +83,8 @@ static QScreen *screenForDevice(QPaintDevice *device)
screenNumber = 0;
screen = screen->subScreens()[screenNumber];
}
- while (screen->classId() == QScreen::ProxyClass) {
+ while (screen->classId() == QScreen::ProxyClass ||
+ screen->classId() == QScreen::TransformedClass) {
screen = static_cast<QProxyScreen *>(screen)->screen();
}
return screen;
diff --git a/src/gui/embedded/directfb.pri b/src/gui/embedded/directfb.pri
index fa4dd68..84253b5 100644
--- a/src/gui/embedded/directfb.pri
+++ b/src/gui/embedded/directfb.pri
@@ -1,7 +1,7 @@
# These defines might be necessary if your DirectFB driver doesn't
# support all of the DirectFB API.
#
-#DEFINES += QT_NO_DIRECTFB_SUBSURFACE
+#DEFINES += QT_DIRECTFB_SUBSURFACE
#DEFINES += QT_DIRECTFB_WINDOW_AS_CURSOR
#DEFINES += QT_NO_DIRECTFB_IMAGEPROVIDER
#DEFINES += QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp
index b7a3962..64c51ad 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp
@@ -57,6 +57,9 @@
#include <QtGui/qpainter.h>
#include <QtGui/qstyleoption.h>
#include <QtGui/qgraphicsview.h>
+#include <QtGui/qlistview.h>
+#include <QtGui/qlineedit.h>
+#include <QtGui/qtextedit.h>
QT_BEGIN_NAMESPACE
@@ -86,7 +89,9 @@ QT_BEGIN_NAMESPACE
of embedded widgets through creating a child proxy for each popup. This
means that when an embedded QComboBox shows its popup list, a new
QGraphicsProxyWidget is created automatically, embedding the popup, and
- positioning it correctly.
+ positioning it correctly. This only works if the popup is child of the
+ embedded widget (for example QToolButton::setMenu() requires the QMenu instance
+ to be child of the QToolButton).
\section1 Embedding a Widget with QGraphicsProxyWidget
@@ -184,6 +189,7 @@ QT_BEGIN_NAMESPACE
*/
extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);
+extern bool qt_tab_all_widgets;
/*!
\internal
@@ -369,6 +375,7 @@ QVariant QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(Qt::InputMethodQuer
/*!
\internal
+ Some of the logic is shared with QApplicationPrivate::focusNextPrevChild_helper
*/
QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next) const
{
@@ -382,14 +389,16 @@ QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next)
child = next ? child->d_func()->focus_next : child->d_func()->focus_prev;
if ((next && child == widget) || (!next && child == widget->d_func()->focus_prev)) {
return 0;
- }
+ }
}
QWidget *oldChild = child;
+ uint focus_flag = qt_tab_all_widgets ? Qt::TabFocus : Qt::StrongFocus;
do {
if (child->isEnabled()
&& child->isVisibleTo(widget)
- && (child->focusPolicy() & Qt::TabFocus)) {
+ && (child->focusPolicy() & focus_flag == focus_flag)
+ && !(child->d_func()->extra && child->d_func()->extra->focus_proxy)) {
return child;
}
child = next ? child->d_func()->focus_next : child->d_func()->focus_prev;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 0773559..a624b10 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5297,7 +5297,7 @@ void QGraphicsScene::setActivePanel(QGraphicsItem *item)
/*!
\since 4.4
- Returns the current active window, or 0 if there is no window is currently
+ Returns the current active window, or 0 if no window is currently
active.
\sa QGraphicsScene::setActiveWindow()
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index 5412e11..46c5431 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -78,6 +78,8 @@ static QString fallbackTheme()
return X11->desktopVersion >= 4
? QString::fromLatin1("oxygen")
: QString::fromLatin1("crystalsvg");
+ } else {
+ return QLatin1String("hicolor");
}
#endif
return QString();
@@ -87,6 +89,8 @@ QIconLoader::QIconLoader() :
m_themeKey(1), m_supportsSvg(false)
{
m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName();
+ if (m_systemTheme.isEmpty())
+ m_systemTheme = fallbackTheme();
QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid,
QLatin1String("/iconengines"),
@@ -107,6 +111,8 @@ void QIconLoader::updateSystemTheme()
// Only change if this is not explicitly set by the user
if (m_userTheme.isEmpty()) {
QString theme = qt_guiPlatformPlugin()->systemIconThemeName();
+ if (theme.isEmpty())
+ theme = fallbackTheme();
if (theme != m_systemTheme) {
m_systemTheme = theme;
invalidateKey();
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 9048387..21ab40c 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -377,6 +377,9 @@ bool QImageData::checkForAlphaPixels() const
\note If you would like to load QImage objects in a static build of Qt,
refer to the \l{How To Create Qt Plugins#Static Plugins}{Plugin HowTo}.
+ \warning Painting on a QImage with the format
+ QImage::Format_Indexed8 is not supported.
+
\tableofcontents
\section1 Reading and Writing Image Files
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 558ae54..c03a364 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -361,13 +361,7 @@ QPixmap QPixmap::copy(const QRect &rect) const
const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect;
- QPixmapData *d;
- QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem();
- if (gs)
- d = gs->createPixmapData(data->pixelType());
- else
- d = QGraphicsSystem::createDefaultPixmapData(data->pixelType());
-
+ QPixmapData *d = data->createCompatiblePixmapData();
d->copy(data.data(), r);
return QPixmap(d);
}
@@ -947,6 +941,9 @@ bool QPixmap::doImageIO(QImageWriter *writer, int quality) const
/*!
Fills the pixmap with the given \a color.
+ The effect of this function is undefined when the pixmap is
+ being painted on.
+
\sa {QPixmap#Pixmap Transformations}{Pixmap Transformations}
*/
@@ -955,6 +952,13 @@ void QPixmap::fill(const QColor &color)
if (isNull())
return;
+ // Some people are probably already calling fill while a painter is active, so to not break
+ // their programs, only print a warning and return when the fill operation could cause a crash.
+ if (paintingActive() && (color.alpha() != 255) && !hasAlphaChannel()) {
+ qWarning("QPixmap::fill: Cannot fill while pixmap is being painted on");
+ return;
+ }
+
detach();
data->fill(color);
}
@@ -1663,10 +1667,10 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
identifies the contents of the QPixmap object.
The x11Info() function returns information about the configuration
- of the X display used to display the widget. The
- x11PictureHandle() function returns the X11 Picture handle of the
- pixmap for XRender support. Note that the two latter functions are
- only available on x11.
+ of the X display used by the screen to which the pixmap currently
+ belongs. The x11PictureHandle() function returns the X11 Picture
+ handle of the pixmap for XRender support. Note that the two latter
+ functions are only available on x11.
\endtable
@@ -2084,7 +2088,7 @@ QPixmapData* QPixmap::pixmapData() const
/*! \fn const QX11Info &QPixmap::x11Info() const
\bold{X11 only:} Returns information about the configuration of
- the X display used to display the widget.
+ the X display used by the screen to which the pixmap currently belongs.
\warning This function is only available on X11.
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index de532fd..afa6f83 100644
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -166,6 +166,11 @@ QMacPixmapData::QMacPixmapData(PixelType type)
{
}
+QPixmapData *QMacPixmapData::createCompatiblePixmapData() const
+{
+ return new QMacPixmapData(pixelType());
+}
+
#define BEST_BYTE_ALIGNMENT 16
#define COMPTUE_BEST_BYTES_PER_ROW(bpr) \
(((bpr) + (BEST_BYTE_ALIGNMENT - 1)) & ~(BEST_BYTE_ALIGNMENT - 1))
diff --git a/src/gui/image/qpixmap_mac_p.h b/src/gui/image/qpixmap_mac_p.h
index 528dd1f..a3fb95f 100644
--- a/src/gui/image/qpixmap_mac_p.h
+++ b/src/gui/image/qpixmap_mac_p.h
@@ -65,6 +65,8 @@ public:
QMacPixmapData(PixelType type);
~QMacPixmapData();
+ QPixmapData *createCompatiblePixmapData() const;
+
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
void copy(const QPixmapData *data, const QRect &rect);
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index ad68b07..fc76dc3 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -55,6 +55,29 @@ QT_BEGIN_NAMESPACE
const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80 };
+QPixmap qt_toRasterPixmap(const QImage &image)
+{
+ QPixmapData *data =
+ new QRasterPixmapData(image.depth() == 1
+ ? QPixmapData::BitmapType
+ : QPixmapData::PixmapType);
+
+ data->fromImage(image, Qt::AutoColor);
+
+ return QPixmap(data);
+}
+
+QPixmap qt_toRasterPixmap(const QPixmap &pixmap)
+{
+ if (pixmap.isNull())
+ return QPixmap();
+
+ if (QPixmap(pixmap).data_ptr()->classId() == QPixmapData::RasterClass)
+ return pixmap;
+
+ return qt_toRasterPixmap(pixmap.toImage());
+}
+
QRasterPixmapData::QRasterPixmapData(PixelType type)
: QPixmapData(type, RasterClass)
{
@@ -64,6 +87,11 @@ QRasterPixmapData::~QRasterPixmapData()
{
}
+QPixmapData *QRasterPixmapData::createCompatiblePixmapData() const
+{
+ return new QRasterPixmapData(pixelType());
+}
+
void QRasterPixmapData::resize(int width, int height)
{
QImage::Format format;
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index da0405e..1553940 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -68,6 +68,8 @@ public:
QRasterPixmapData(PixelType type);
~QRasterPixmapData();
+ QPixmapData *createCompatiblePixmapData() const;
+
void resize(int width, int height);
void fromFile(const QString &filename, Qt::ImageConversionFlags flags);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 74543a0..ea9eff9 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -319,6 +319,11 @@ QX11PixmapData::QX11PixmapData(PixelType type)
{
}
+QPixmapData *QX11PixmapData::createCompatiblePixmapData() const
+{
+ return new QX11PixmapData(pixelType());
+}
+
void QX11PixmapData::resize(int width, int height)
{
setSerialNumber(++qt_pixmap_serial);
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index e34e690..2d6672d 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -71,6 +71,8 @@ public:
// Qt::ImageConversionFlags flags);
~QX11PixmapData();
+ QPixmapData *createCompatiblePixmapData() const;
+
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
void copy(const QPixmapData *data, const QRect &rect);
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index f12d397..b0b7d72 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -221,6 +221,7 @@ QPMCache::QPMCache()
}
QPMCache::~QPMCache()
{
+ clear();
free(keyArray);
}
diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp
index 93fc2eb..1ad1f02 100644
--- a/src/gui/image/qpixmapdata.cpp
+++ b/src/gui/image/qpixmapdata.cpp
@@ -43,6 +43,8 @@
#include <QtCore/qbuffer.h>
#include <QtGui/qbitmap.h>
#include <QtGui/qimagereader.h>
+#include <private/qgraphicssystem_p.h>
+#include <private/qapplication_p.h>
QT_BEGIN_NAMESPACE
@@ -67,6 +69,17 @@ QPixmapData::~QPixmapData()
{
}
+QPixmapData *QPixmapData::createCompatiblePixmapData() const
+{
+ QPixmapData *d;
+ QGraphicsSystem *gs = QApplicationPrivate::graphicsSystem();
+ if (gs)
+ d = gs->createPixmapData(pixelType());
+ else
+ d = QGraphicsSystem::createDefaultPixmapData(pixelType());
+ return d;
+}
+
static QImage makeBitmapCompliantIfNeeded(QPixmapData *d, const QImage &image, Qt::ImageConversionFlags flags)
{
if (d->pixelType() == QPixmapData::BitmapType) {
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index c26fba3..2f4f201 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -75,9 +75,11 @@ public:
enum ClassId { RasterClass, X11Class, MacClass, DirectFBClass,
OpenGLClass, OpenVGClass, CustomClass = 1024 };
- QPixmapData(PixelType pixelpType, int classId);
+ QPixmapData(PixelType pixelType, int classId);
virtual ~QPixmapData();
+ virtual QPixmapData *createCompatiblePixmapData() const;
+
virtual void resize(int width, int height) = 0;
virtual void fromImage(const QImage &image,
Qt::ImageConversionFlags flags) = 0;
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index df445db..9fcf776 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -591,7 +591,7 @@ QRectF QPixmapBlurFilter::boundingRectFor(const QRectF &rect) const
// Blur the image according to the blur radius
// Based on exponential blur algorithm by Jani Huhtanen
// (maximum radius is set to 16)
-static QImage blurred(const QImage& image, const QRect& rect, int radius)
+static QImage blurred(const QImage& image, const QRect& rect, int radius, bool alphaOnly = false)
{
int tab[] = { 14, 10, 8, 6, 5, 5, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 };
int alpha = (radius < 1) ? 16 : (radius > 17) ? 1 : tab[radius-1];
@@ -606,47 +606,53 @@ static QImage blurred(const QImage& image, const QRect& rect, int radius)
int rgba[4];
unsigned char* p;
+ int i1 = 0;
+ int i2 = 3;
+
+ if (alphaOnly)
+ i1 = i2 = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 3);
+
for (int col = c1; col <= c2; col++) {
p = result.scanLine(r1) + col * 4;
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p += bpl;
for (int j = r1; j < r2; j++, p += bpl)
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
for (int row = r1; row <= r2; row++) {
p = result.scanLine(row) + c1 * 4;
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p += 4;
for (int j = c1; j < c2; j++, p += 4)
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
for (int col = c1; col <= c2; col++) {
p = result.scanLine(r2) + col * 4;
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p -= bpl;
for (int j = r1; j < r2; j++, p -= bpl)
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
for (int row = r1; row <= r2; row++) {
p = result.scanLine(row) + c2 * 4;
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
rgba[i] = p[i] << 4;
p -= 4;
for (int j = c1; j < c2; j++, p -= 4)
- for (int i = 0; i < 4; i++)
+ for (int i = i1; i <= i2; i++)
p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4;
}
@@ -892,11 +898,11 @@ class QPixmapDropShadowFilterPrivate : public QPixmapFilterPrivate
{
public:
QPixmapDropShadowFilterPrivate()
- : offset(8, 8), color(63, 63, 63, 180), blurFilter(new QPixmapBlurFilter) {}
+ : offset(8, 8), color(63, 63, 63, 180), radius(1) {}
QPointF offset;
QColor color;
- QPixmapBlurFilter *blurFilter;
+ int radius;
};
/*!
@@ -940,8 +946,6 @@ public:
QPixmapDropShadowFilter::QPixmapDropShadowFilter(QObject *parent)
: QPixmapFilter(*new QPixmapDropShadowFilterPrivate, DropShadowFilter, parent)
{
- Q_D(QPixmapDropShadowFilter);
- d->blurFilter->setRadius(1);
}
/*!
@@ -951,8 +955,6 @@ QPixmapDropShadowFilter::QPixmapDropShadowFilter(QObject *parent)
*/
QPixmapDropShadowFilter::~QPixmapDropShadowFilter()
{
- Q_D(QPixmapDropShadowFilter);
- delete d->blurFilter;
}
/*!
@@ -967,7 +969,7 @@ QPixmapDropShadowFilter::~QPixmapDropShadowFilter()
int QPixmapDropShadowFilter::blurRadius() const
{
Q_D(const QPixmapDropShadowFilter);
- return d->blurFilter->radius();
+ return d->radius;
}
/*!
@@ -982,7 +984,7 @@ int QPixmapDropShadowFilter::blurRadius() const
void QPixmapDropShadowFilter::setBlurRadius(int radius)
{
Q_D(QPixmapDropShadowFilter);
- d->blurFilter->setRadius(radius);
+ d->radius = radius;
}
/*!
@@ -1056,7 +1058,7 @@ QRectF QPixmapDropShadowFilter::boundingRectFor(const QRectF &rect) const
{
Q_D(const QPixmapDropShadowFilter);
- const qreal delta = qreal(d->blurFilter->radius() * 2);
+ const qreal delta = qreal(d->radius * 2);
qreal x1 = qMin(rect.left(), rect.left() + d->offset.x() - delta);
qreal y1 = qMin(rect.top(), rect.top() + d->offset.y() - delta);
qreal x2 = qMax(rect.right(), rect.right() + d->offset.x() + delta);
@@ -1079,24 +1081,25 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
QPixmapDropShadowFilter *dropShadowFilter = static_cast<QPixmapDropShadowFilter*>(filter);
if (dropShadowFilter) {
dropShadowFilter->setColor(d->color);
- dropShadowFilter->setBlurRadius(d->blurFilter->radius());
+ dropShadowFilter->setBlurRadius(d->radius);
dropShadowFilter->setOffset(d->offset);
dropShadowFilter->draw(p, pos, px, src);
return;
}
- QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toRect()).toImage();
- QPainter tmpPainter(&tmp);
+ QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toAlignedRect()).toImage();
+
+ // blur the alpha channel
+ tmp = blurred(tmp, tmp.rect(), d->radius, true);
// blacken the image...
+ QPainter tmpPainter(&tmp);
tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
tmpPainter.fillRect(0, 0, tmp.width(), tmp.height(), d->color);
tmpPainter.end();
- const QPixmap pixTmp = QPixmap::fromImage(tmp);
-
// draw the blurred drop shadow...
- d->blurFilter->draw(p, pos + d->offset, pixTmp);
+ p->drawImage(pos + d->offset, tmp);
// Draw the actual pixmap...
p->drawPixmap(pos, px, src);
diff --git a/src/gui/inputmethod/qmacinputcontext_mac.cpp b/src/gui/inputmethod/qmacinputcontext_mac.cpp
index 116d233..994edb9 100644
--- a/src/gui/inputmethod/qmacinputcontext_mac.cpp
+++ b/src/gui/inputmethod/qmacinputcontext_mac.cpp
@@ -217,7 +217,11 @@ QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void
case kEventClassTextInput: {
handled_event = false;
QWidget *widget = QApplicationPrivate::focus_widget;
- if(!widget || (context && widget->inputContext() != context)) {
+ bool canCompose = widget && (!context || widget->inputContext() == context)
+ && !(widget->inputMethodHints() & Qt::ImhDigitsOnly
+ || widget->inputMethodHints() & Qt::ImhFormattedNumbersOnly
+ || widget->inputMethodHints() & Qt::ImhHiddenText);
+ if(!canCompose) {
handled_event = false;
} else if(ekind == kEventTextInputOffsetToPos) {
if(!widget->testAttribute(Qt::WA_InputMethodEnabled)) {
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 13a1662..d91cedd 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -3029,7 +3029,7 @@ void QAbstractItemView::update(const QModelIndex &index)
//this test is important for peformance reason
//For example in dataChanged we simply update all the cells without checking
//it can be a major bottleneck to update rects that aren't even part of the viewport
- if (d->viewport->geometry().intersects(rect))
+ if (d->viewport->rect().intersects(rect))
d->viewport->update(rect);
}
}
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 243f542..88002e0 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -1105,13 +1105,13 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
++row;
if (row >= rowCount)
return QModelIndex();
- return d->model->index(row, 0, d->root);
+ return d->model->index(row, d->column, d->root);
}
const QRect initialRect = rectForIndex(current);
QRect rect = initialRect;
if (rect.isEmpty()) {
- return d->model->index(0, 0, d->root);
+ return d->model->index(0, d->column, d->root);
}
if (d->gridSize().isValid()) rect.setSize(d->gridSize());
@@ -1900,7 +1900,7 @@ void QListModeViewBase::updateVerticalScrollBar(const QSize &step)
if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
&& ((flow() == QListView::TopToBottom && !isWrapping())
|| (flow() == QListView::LeftToRight && isWrapping()))) {
- const int steps = (flow() == QListView::TopToBottom ? flowPositions : segmentPositions).count() - 1;
+ const int steps = (flow() == QListView::TopToBottom ? scrollValueMap : segmentPositions).count() - 1;
if (steps > 0) {
const int pageSteps = perItemScrollingPageSteps(viewport()->height(), contentsSize.height(), isWrapping());
verticalScrollBar()->setSingleStep(1);
@@ -1939,7 +1939,7 @@ int QListModeViewBase::verticalScrollToValue(int index, QListView::ScrollHint hi
bool above, bool below, const QRect &area, const QRect &rect) const
{
if (verticalScrollMode() == QAbstractItemView::ScrollPerItem) {
- int value = qBound(0, verticalScrollBar()->value(), flowPositions.count() - 1);
+ int value = qBound(0, scrollValueMap.at(verticalScrollBar()->value()), flowPositions.count() - 1);
if (above)
hint = QListView::PositionAtTop;
else if (below)
@@ -1986,9 +1986,9 @@ int QListModeViewBase::verticalOffset() const
}
} else if (flow() == QListView::TopToBottom && !flowPositions.isEmpty()) {
int value = verticalScrollBar()->value();
- if (value > flowPositions.count())
+ if (value > scrollValueMap.count())
return 0;
- return flowPositions.at(value) - spacing();
+ return flowPositions.at(scrollValueMap.at(value)) - spacing();
}
}
return QCommonListViewBase::verticalOffset();
@@ -2043,8 +2043,8 @@ void QListModeViewBase::scrollContentsBy(int dx, int dy, bool scrollElasticBand)
if (vertical && flow() == QListView::TopToBottom && dy != 0) {
int currentValue = qBound(0, verticalValue, max);
int previousValue = qBound(0, currentValue + dy, max);
- int currentCoordinate = flowPositions.at(currentValue);
- int previousCoordinate = flowPositions.at(previousValue);
+ int currentCoordinate = flowPositions.at(scrollValueMap.at(currentValue));
+ int previousCoordinate = flowPositions.at(scrollValueMap.at(previousValue));
dy = previousCoordinate - currentCoordinate;
} else if (horizontal && flow() == QListView::LeftToRight && dx != 0) {
int currentValue = qBound(0, horizontalValue, max);
@@ -2113,6 +2113,7 @@ QPoint QListModeViewBase::initStaticLayout(const QListViewLayoutInfo &info)
segmentPositions.clear();
segmentStartRows.clear();
segmentExtents.clear();
+ scrollValueMap.clear();
x = info.bounds.left() + info.spacing;
y = info.bounds.top() + info.spacing;
segmentPositions.append(info.flow == QListView::LeftToRight ? y : x);
@@ -2204,6 +2205,7 @@ void QListModeViewBase::doStaticLayout(const QListViewLayoutInfo &info)
deltaSegPosition = 0;
}
// save the flow position of this item
+ scrollValueMap.append(flowPositions.count());
flowPositions.append(flowPosition);
// prepare for the next item
deltaSegPosition = qMax(deltaSegHint, deltaSegPosition);
@@ -2229,6 +2231,7 @@ void QListModeViewBase::doStaticLayout(const QListViewLayoutInfo &info)
// if it is the last batch, save the end of the segments
if (info.last == info.max) {
segmentExtents.append(flowPosition);
+ scrollValueMap.append(flowPositions.count());
flowPositions.append(flowPosition);
segmentPositions.append(info.wrap ? segPosition + deltaSegPosition : INT_MAX);
}
@@ -2306,7 +2309,14 @@ QRect QListModeViewBase::mapToViewport(const QRect &rect) const
int QListModeViewBase::perItemScrollingPageSteps(int length, int bounds, bool wrap) const
{
- const QVector<int> positions = (wrap ? segmentPositions : flowPositions);
+ QVector<int> positions;
+ if (wrap)
+ positions = segmentPositions;
+ else {
+ positions.reserve(scrollValueMap.size());
+ foreach (int itemShown, scrollValueMap)
+ positions.append(flowPositions.at(itemShown));
+ }
if (positions.isEmpty() || bounds <= length)
return positions.count();
if (uniformItemSizes()) {
diff --git a/src/gui/itemviews/qlistview_p.h b/src/gui/itemviews/qlistview_p.h
index b6785da..de4c7f3 100644
--- a/src/gui/itemviews/qlistview_p.h
+++ b/src/gui/itemviews/qlistview_p.h
@@ -205,6 +205,7 @@ public:
QVector<int> segmentPositions;
QVector<int> segmentStartRows;
QVector<int> segmentExtents;
+ QVector<int> scrollValueMap;
// used when laying out in batches
int batchSavedPosition;
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 210534e..f37d8c7 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2908,6 +2908,8 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
layout(item);
q->setState(oldState);
+ if (model->canFetchMore(index))
+ model->fetchMore(index);
if (emitSignal) {
emit q->expanded(index);
#ifndef QT_NO_ANIMATION
@@ -2915,8 +2917,6 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
beginAnimatedOperation();
#endif //QT_NO_ANIMATION
}
- if (model->canFetchMore(index))
- model->fetchMore(index);
}
void QTreeViewPrivate::collapse(int item, bool emitSignal)
@@ -3005,10 +3005,12 @@ void QTreeViewPrivate::beginAnimatedOperation()
animatedOperation.setEndValue(animatedOperation.top() + h);
}
- animatedOperation.after = renderTreeToPixmapForAnimation(rect);
+ if (!rect.isEmpty()) {
+ animatedOperation.after = renderTreeToPixmapForAnimation(rect);
- q->setState(QAbstractItemView::AnimatingState);
- animatedOperation.start(); //let's start the animation
+ q->setState(QAbstractItemView::AnimatingState);
+ animatedOperation.start(); //let's start the animation
+ }
}
void QTreeViewPrivate::drawAnimatedOperation(QPainter *painter) const
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index 53c2611..8859358 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -84,6 +84,7 @@ SOURCES += \
kernel/qgesturerecognizer.cpp \
kernel/qgesturemanager.cpp \
kernel/qsoftkeymanager.cpp \
+ kernel/qdesktopwidget.cpp \
kernel/qguiplatformplugin.cpp
win32 {
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 6a6e549..5f5650f 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -276,7 +276,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
This enum describes how an action should be placed in the softkey bar. Currently this enum only
has an effect on the Symbian platform.
- \value NoSoftKey This action should be used as a softkey
+ \value NoSoftKey This action should not be used as a softkey
\value PositiveSoftKey This action is used to describe a softkey with a positive or non-destructive
role such as Ok, Select, or Options.
\value NegativeSoftKey This action is used to describe a soft ey with a negative or destructive role
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 5476e36..c4249d9 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -68,9 +68,6 @@
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
#include "qmessagebox.h"
-#include "qlineedit.h"
-#include "qlistview.h"
-#include "qtextedit.h"
#include <QtGui/qgraphicsproxywidget.h>
#include "qinputcontext.h"
@@ -2498,9 +2495,12 @@ void QApplication::setActiveWindow(QWidget* act)
/*!internal
* Helper function that returns the new focus widget, but does not set the focus reason.
* Returns 0 if a new focus widget could not be found.
+ * Shared with QGraphicsProxyWidgetPrivate::findFocusChild()
*/
QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next)
{
+ uint focus_flag = qt_tab_all_widgets ? Qt::TabFocus : Qt::StrongFocus;
+
QWidget *f = toplevel->focusWidget();
if (!f)
f = toplevel;
@@ -2508,22 +2508,11 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool
QWidget *w = f;
QWidget *test = f->d_func()->focus_next;
while (test && test != f) {
- if ((test->focusPolicy() & Qt::TabFocus)
+ if ((test->focusPolicy() & focus_flag) == focus_flag
&& !(test->d_func()->extra && test->d_func()->extra->focus_proxy)
&& test->isVisibleTo(toplevel) && test->isEnabled()
&& !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test))
- && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))
- && (qt_tab_all_widgets
-#ifndef QT_NO_LINEEDIT
- || qobject_cast<QLineEdit*>(test)
-#endif
-#ifndef QT_NO_TEXTEDIT
- || qobject_cast<QTextEdit*>(test)
-#endif
-#ifndef QT_NO_ITEMVIEWS
- || qobject_cast<QListView*>(test)
-#endif
- )) {
+ && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) {
w = test;
if (next)
break;
@@ -5646,7 +5635,7 @@ Qt::GestureType QApplication::registerGestureRecognizer(QGestureRecognizer *reco
Unregisters all gesture recognizers of the specified \a type.
- \sa registerGestureRecognizer
+ \sa registerGestureRecognizer()
*/
void QApplication::unregisterGestureRecognizer(Qt::GestureType type)
{
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 6d50e55..cb9dda4 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -464,12 +464,47 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
QT_TRYCATCH_LEAVING(HandlePointerEvent(pEvent));
}
+typedef QPair<QWidget*,QMouseEvent> Event;
+
+/*
+ * Helper function called by HandlePointerEvent - separated to keep that function readable
+ */
+static void generateEnterLeaveEvents(QList<Event> &events, QWidget *widgetUnderPointer,
+ QPoint globalPos, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
+{
+ //moved to another widget, create enter and leave events
+ if (S60->lastPointerEventTarget) {
+ QMouseEvent mEventLeave(QEvent::Leave, S60->lastPointerEventTarget->mapFromGlobal(
+ S60->lastCursorPos), S60->lastCursorPos, button, QApplicationPrivate::mouse_buttons,
+ modifiers);
+ events.append(Event(S60->lastPointerEventTarget, mEventLeave));
+ }
+ if (widgetUnderPointer) {
+ QMouseEvent mEventEnter(QEvent::Enter, widgetUnderPointer->mapFromGlobal(globalPos),
+ globalPos, button, QApplicationPrivate::mouse_buttons, modifiers);
+
+ events.append(Event(widgetUnderPointer, mEventEnter));
+#ifndef QT_NO_CURSOR
+ S60->curWin = widgetUnderPointer->effectiveWinId();
+ if (!QApplication::overrideCursor()) {
+#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
+ if (S60->brokenPointerCursors)
+ qt_symbian_set_pointer_sprite(widgetUnderPointer->cursor());
+ else
+#endif
+ qt_symbian_setWindowCursor(widgetUnderPointer->cursor(), S60->curWin);
+ }
+#endif
+ }
+}
+
+
void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
{
- //### refactor me, getting too complex
QMouseEvent::Type type;
Qt::MouseButton button;
mapS60MouseEventTypeToQt(&type, &button, &pEvent);
+ Qt::KeyboardModifiers modifiers = mapToQtModifiers(pEvent.iModifiers);
if (m_previousEventLongTap)
if (type == QEvent::MouseButtonRelease){
@@ -481,79 +516,76 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
return;
// store events for later sending/saving
- QWidget *alienWidget;
- typedef QPair<QWidget*,QMouseEvent> Event;
QList<Event > events;
QPoint widgetPos = QPoint(pEvent.iPosition.iX, pEvent.iPosition.iY);
TPoint controlScreenPos = PositionRelativeToScreen();
QPoint globalPos = QPoint(controlScreenPos.iX, controlScreenPos.iY) + widgetPos;
- if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick || type == QEvent::MouseMove)
- {
- // get the widget where the event happened
- alienWidget = qwidget->childAt(widgetPos);
- if (!alienWidget)
- alienWidget = qwidget;
- S60->mousePressTarget = alienWidget;
+ // widgets interested in the event
+ QWidget *widgetUnderPointer = qwidget->childAt(widgetPos);
+ if (!widgetUnderPointer)
+ widgetUnderPointer = qwidget; //i.e. this container widget
+
+ QWidget *widgetWithMouseGrab = QWidget::mouseGrabber();
+
+ // handle auto grab of pointer when pressing / releasing
+ if (!widgetWithMouseGrab && type == QEvent::MouseButtonPress) {
+ //if previously auto-grabbed, generate a fake mouse release (platform bug: mouse release event was lost)
+ if (S60->mousePressTarget) {
+ QMouseEvent mEvent(QEvent::MouseButtonRelease, S60->mousePressTarget->mapFromGlobal(globalPos), globalPos,
+ button, QApplicationPrivate::mouse_buttons, modifiers);
+ events.append(Event(S60->mousePressTarget,mEvent));
+ }
+ //auto grab the mouse
+ widgetWithMouseGrab = S60->mousePressTarget = widgetUnderPointer;
+ widgetWithMouseGrab->grabMouse();
+ }
+ if (widgetWithMouseGrab && widgetWithMouseGrab == S60->mousePressTarget && type == QEvent::MouseButtonRelease) {
+ //release the auto grab - note this release event still goes to the autograb widget
+ S60->mousePressTarget = 0;
+ widgetWithMouseGrab->releaseMouse();
}
- alienWidget = S60->mousePressTarget;
+ QWidget *widgetToReceiveMouseEvent;
+ if (widgetWithMouseGrab)
+ widgetToReceiveMouseEvent = widgetWithMouseGrab;
+ else
+ widgetToReceiveMouseEvent = widgetUnderPointer;
- if (alienWidget != S60->lastPointerEventTarget)
- if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick || type == QEvent::MouseMove)
- {
- //moved to another widget, create enter and leave events
- if (S60->lastPointerEventTarget)
- {
- QMouseEvent mEventLeave(QEvent::Leave, S60->lastPointerEventTarget->mapFromGlobal(S60->lastCursorPos), S60->lastCursorPos,
- button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers));
- events.append(Event(S60->lastPointerEventTarget,mEventLeave));
- }
- if (alienWidget) {
- QMouseEvent mEventEnter(QEvent::Enter, alienWidget->mapFromGlobal(globalPos),
- globalPos, button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(
- pEvent.iModifiers));
+ //queue QEvent::Enter and QEvent::Leave, if the pointer has moved
+ if (widgetUnderPointer != S60->lastPointerEventTarget && (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick || type == QEvent::MouseMove))
+ generateEnterLeaveEvents(events, widgetUnderPointer, globalPos, button, modifiers);
- events.append(Event(alienWidget, mEventEnter));
-#ifndef QT_NO_CURSOR
- S60->curWin = alienWidget->effectiveWinId();
- if (!QApplication::overrideCursor()) {
-#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
- if (S60->brokenPointerCursors)
- qt_symbian_set_pointer_sprite(alienWidget->cursor());
- else
-#endif
- qt_symbian_setWindowCursor(alienWidget->cursor(), S60->curWin);
- }
-#endif
- }
- }
+ //save global state
S60->lastCursorPos = globalPos;
+ S60->lastPointerEventPos = widgetPos;
+ S60->lastPointerEventTarget = widgetUnderPointer;
+
#if !defined(QT_NO_CURSOR) && !defined(Q_SYMBIAN_FIXED_POINTER_CURSORS)
if (S60->brokenPointerCursors)
qt_symbian_move_cursor_sprite();
#endif
- S60->lastPointerEventPos = widgetPos;
- S60->lastPointerEventTarget = alienWidget;
- if (alienWidget)
- {
- QMouseEvent mEvent(type, alienWidget->mapFromGlobal(globalPos), globalPos,
- button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers));
- events.append(Event(alienWidget,mEvent));
- QEventDispatcherS60 *dispatcher;
- // It is theoretically possible for someone to install a different event dispatcher.
- if ((dispatcher = qobject_cast<QEventDispatcherS60 *>(alienWidget->d_func()->threadData->eventDispatcher)) != 0) {
- if (dispatcher->excludeUserInputEvents()) {
- for (int i=0;i < events.count();++i)
- {
- Event next = events[i];
- dispatcher->saveInputEvent(this, next.first, new QMouseEvent(next.second));
- }
- return;
+
+ //queue this event.
+ Q_ASSERT(widgetToReceiveMouseEvent);
+ QMouseEvent mEvent(type, widgetToReceiveMouseEvent->mapFromGlobal(globalPos), globalPos,
+ button, QApplicationPrivate::mouse_buttons, modifiers);
+ events.append(Event(widgetToReceiveMouseEvent,mEvent));
+ QEventDispatcherS60 *dispatcher;
+ // It is theoretically possible for someone to install a different event dispatcher.
+ if ((dispatcher = qobject_cast<QEventDispatcherS60 *>(widgetToReceiveMouseEvent->d_func()->threadData->eventDispatcher)) != 0) {
+ if (dispatcher->excludeUserInputEvents()) {
+ for (int i=0;i < events.count();++i)
+ {
+ Event next = events[i];
+ dispatcher->saveInputEvent(this, next.first, new QMouseEvent(next.second));
}
+ return;
}
}
+
+ //send events in the queue
for (int i=0;i < events.count();++i)
{
Event next = events[i];
@@ -1123,6 +1155,11 @@ void qt_init(QApplicationPrivate * /* priv */, int)
;
}
*/
+
+ // Register WId with the metatype system. This is to enable
+ // QWidgetPrivate::create_sys to used delayed slot invokation in order
+ // to destroy WId objects during reparenting.
+ qRegisterMetaType<WId>("WId");
}
/*****************************************************************************
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index b1c5fc5..4c2a14a 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1066,7 +1066,10 @@ extern "C" {
sendToPopup = true;
}
- if (widgetToGetKey->testAttribute(Qt::WA_InputMethodEnabled)) {
+ if (widgetToGetKey->testAttribute(Qt::WA_InputMethodEnabled)
+ && !(widgetToGetKey->inputMethodHints() & Qt::ImhDigitsOnly
+ || widgetToGetKey->inputMethodHints() & Qt::ImhFormattedNumbersOnly
+ || widgetToGetKey->inputMethodHints() & Qt::ImhHiddenText)) {
[qt_mac_nativeview_for(widgetToGetKey) interpretKeyEvents:[NSArray arrayWithObject: theEvent]];
}
if (sendKeyEvents && !composing) {
@@ -1420,29 +1423,29 @@ Qt::DropAction QDragManager::drag(QDrag *o)
// convert the image to NSImage.
NSImage *image = (NSImage *)qt_mac_create_nsimage(pix);
[image retain];
- DnDParams *dndParams = [QT_MANGLE_NAMESPACE(QCocoaView) currentMouseEvent];
+ DnDParams dndParams = *[QT_MANGLE_NAMESPACE(QCocoaView) currentMouseEvent];
// save supported actions
- [dndParams->view setSupportedActions: qt_mac_mapDropActions(dragPrivate()->possible_actions)];
- NSPoint imageLoc = {dndParams->localPoint.x - hotspot.x(),
- dndParams->localPoint.y + pix.height() - hotspot.y()};
+ [dndParams.view setSupportedActions: qt_mac_mapDropActions(dragPrivate()->possible_actions)];
+ NSPoint imageLoc = {dndParams.localPoint.x - hotspot.x(),
+ dndParams.localPoint.y + pix.height() - hotspot.y()};
NSSize mouseOffset = {0.0, 0.0};
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
- NSPoint windowPoint = [dndParams->theEvent locationInWindow];
+ NSPoint windowPoint = [dndParams.theEvent locationInWindow];
dragPrivate()->executed_action = Qt::ActionMask;
// do the drag
- [dndParams->view retain];
- [dndParams->view dragImage:image
+ [dndParams.view retain];
+ [dndParams.view dragImage:image
at:imageLoc
offset:mouseOffset
- event:dndParams->theEvent
+ event:dndParams.theEvent
pasteboard:pboard
- source:dndParams->view
+ source:dndParams.view
slideBack:YES];
- [dndParams->view release];
+ [dndParams.view release];
[image release];
dragPrivate()->executed_action = Qt::IgnoreAction;
object = 0;
- Qt::DropAction performedAction(qt_mac_mapNSDragOperation(dndParams->performedAction));
+ Qt::DropAction performedAction(qt_mac_mapNSDragOperation(dndParams.performedAction));
// do post drag processing, if required.
if(performedAction != Qt::IgnoreAction) {
// check if the receiver points us to a file location.
diff --git a/src/gui/kernel/qdesktopwidget.cpp b/src/gui/kernel/qdesktopwidget.cpp
new file mode 100644
index 0000000..b1e1008
--- /dev/null
+++ b/src/gui/kernel/qdesktopwidget.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+
+QT_BEGIN_NAMESPACE
+
+#include "qdesktopwidget.h"
+#include "qwidget_p.h"
+
+const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const
+{
+ QRect rect = QWidgetPrivate::screenGeometry(widget);
+ if (rect.isNull())
+ return screenGeometry(screenNumber(widget));
+ else return rect;
+}
+
+const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const
+{
+ QRect rect = QWidgetPrivate::screenGeometry(widget);
+ if (rect.isNull())
+ return availableGeometry(screenNumber(widget));
+ else
+ return rect;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/gui/kernel/qdesktopwidget.h b/src/gui/kernel/qdesktopwidget.h
index 85f479e..6e3447c 100644
--- a/src/gui/kernel/qdesktopwidget.h
+++ b/src/gui/kernel/qdesktopwidget.h
@@ -75,14 +75,12 @@ public:
QWidget *screen(int screen = -1);
const QRect screenGeometry(int screen = -1) const;
- const QRect screenGeometry(const QWidget *widget) const
- { return screenGeometry(screenNumber(widget)); }
+ const QRect screenGeometry(const QWidget *widget) const;
const QRect screenGeometry(const QPoint &point) const
{ return screenGeometry(screenNumber(point)); }
const QRect availableGeometry(int screen = -1) const;
- const QRect availableGeometry(const QWidget *widget) const
- { return availableGeometry(screenNumber(widget)); }
+ const QRect availableGeometry(const QWidget *widget) const;
const QRect availableGeometry(const QPoint &point) const
{ return availableGeometry(screenNumber(point)); }
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 4826704..2ff6d65 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3563,6 +3563,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
\brief The QTouchEvent class contains parameters that describe a touch event.
\since 4.6
\ingroup events
+ \ingroup multitouch
\section1 Enabling Touch Events
@@ -4195,6 +4196,7 @@ QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::T
\class QGestureEvent
\since 4.6
\ingroup events
+ \ingroup gestures
\brief The QGestureEvent class provides the description of triggered gestures.
@@ -4316,4 +4318,44 @@ bool QGestureEvent::isAccepted(QGesture *gesture) const
return gesture ? gesture->d_func()->accept : false;
}
+#ifdef Q_NO_USING_KEYWORD
+/*!
+ \fn void QGestureEvent::setAccepted(bool accepted)
+
+ Sets or clears the event's internal flag that determines whether it should
+ be delivered to other objects.
+
+ Calling this function with a value of true for \a accepted indicates that the
+ caller has accepted the event and that it should not be propagated further.
+ Calling this function with a value of false indicates that the caller has
+ ignored the event and that it should be delivered to other objects.
+
+ For convenience, the accept flag can also be set with accept(), and cleared
+ with ignore().
+
+ \sa QEvent::accepted
+*/
+/*!
+ \fn bool QGestureEvent::isAccepted() const
+
+ Returns true is the event has been accepted; otherwise returns false.
+
+ \sa QEvent::accepted
+*/
+/*!
+ \fn void QGestureEvent::accept()
+
+ Accepts the event, the equivalent of calling setAccepted(true).
+
+ \sa QEvent::accept()
+*/
+/*!
+ \fn void QGestureEvent::ignore()
+
+ Ignores the event, the equivalent of calling setAccepted(false).
+
+ \sa QEvent::ignore()
+*/
+#endif
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 3639a45..fc8df49 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -47,15 +47,19 @@ QT_BEGIN_NAMESPACE
/*!
\class QGesture
\since 4.6
+ \ingroup gestures
\brief The QGesture class represents a gesture, containing properties that
describe the corresponding user input.
- QGesture objects are delivered to widgets and \l{QGraphicsObject}s with
- \l{QGestureEvent}s.
+ Gesture objects are not constructed directly by developers. They are created by
+ the QGestureRecognizer object that is registered with the application; see
+ QApplication::registerGestureRecognizer().
+
+ \section1 Gesture Properties
The class has a list of properties that can be queried by the user to get
- some gesture-specific arguments. For example, the QPinchGesture gesture has a scale
+ some gesture-specific arguments. For example, the pinch gesture has a scale
factor that is exposed as a property.
Developers of custom gesture recognizers can add additional properties in
@@ -63,6 +67,23 @@ QT_BEGIN_NAMESPACE
by adding new dynamic properties to a QGesture object, or by subclassing
the QGesture class (or one of its subclasses).
+ \section1 Lifecycle of a Gesture Object
+
+ A QGesture instance is created when the application calls QWidget::grabGesture()
+ or QGraphicsObject::grabGesture() to configure a widget or graphics object (the
+ target object) for gesture input. One gesture object is created for each target
+ object.
+
+ The registered gesture recognizer monitors the input events for the target
+ object via its \l{QGestureRecognizer::}{filterEvent()} function, updating the
+ properties of the gesture object as required.
+
+ The gesture object may be delivered to the target object in a QGestureEvent if
+ the corresponding gesture is active or has just been canceled. Each event that
+ is delivered contains a list of gesture objects, since support for more than
+ one gesture may be enabled for the target object. Due to the way events are
+ handled in Qt, gesture events may be filtered by other objects.
+
\sa QGestureEvent, QGestureRecognizer
*/
@@ -165,8 +186,55 @@ void QGesture::unsetHotSpot()
d_func()->isHotSpotSet = false;
}
-// QPanGesture
+/*!
+ \class QPanGesture
+ \since 4.6
+ \brief The QPanGesture class describes a panning gesture made by the user.
+ \ingroup gestures
+
+ \image pangesture.png
+ \sa {Gestures Programming}, QPinchGesture, QSwipeGesture
+*/
+
+/*!
+ \property QPanGesture::totalOffset
+ \brief the total offset from the first input position to the current input
+ position
+
+ The total offset measures the total change in position of the user's input
+ covered by the gesture on the input device.
+*/
+
+/*!
+ \property QPanGesture::lastOffset
+ \brief the last offset recorded for this gesture
+
+ The last offset contains the change in position of the user's input as
+ reported in the \l offset property when a previous gesture event was
+ delivered for this gesture.
+
+ If no previous event was delivered with information about this gesture
+ (i.e., this gesture object contains information about the first movement
+ in the gesture) then this property contains a zero size.
+*/
+
+/*!
+ \property QPanGesture::offset
+ \brief the offset from the previous input position to the current input
+ position
+
+ The offset measures the change in position of the user's input on the
+ input device.
+*/
+
+/*!
+ \property QPanGesture::acceleration
+*/
+
+/*!
+ \internal
+*/
QPanGesture::QPanGesture(QObject *parent)
: QGesture(*new QPanGesturePrivate, parent)
{
@@ -214,8 +282,139 @@ void QPanGesture::setAcceleration(qreal value)
d_func()->acceleration = value;
}
-// QPinchGesture
+/*!
+ \class QPinchGesture
+ \since 4.6
+ \brief The QPinchGesture class describes a pinch gesture made my the user.
+ \ingroup multitouch
+ \ingroup gestures
+
+ A pinch gesture is a form of multitouch user input in which the user typically
+ touches two points on the input device with a thumb and finger, before moving
+ them closer together or further apart to change the scale factor, zoom, or level
+ of detail of the user interface.
+
+ \image pinchgesture.png
+
+ Instead of repeatedly applying the same pinching gesture, the user may
+ continue to touch the input device in one place, and apply a second touch
+ to a new point, continuing the gesture. When this occurs, gesture events
+ will continue to be delivered to the target object, containing an instance
+ of QPinchGesture in the Qt::GestureUpdated state.
+
+ \sa {Gestures Programming}, QPanGesture, QSwipeGesture
+*/
+
+/*!
+ \enum QPinchGesture::WhatChange
+
+ This enum describes the changes that can occur to the properties of
+ the gesture object.
+
+ \value ScaleFactorChanged The scale factor held by scaleFactor changed.
+ \value RotationAngleChanged The rotation angle held by rotationAngle changed.
+ \value CenterPointChanged The center point held by centerPoint changed.
+
+ \sa whatChanged
+*/
+
+/*!
+ \property QPinchGesture::whatChanged
+ \brief the property of the gesture that has changed
+
+ This property indicates which of the other properties has changed since
+ the previous gesture event included information about this gesture. You
+ can use this information to determine which aspect of your user interface
+ needs to be updated.
+
+ \sa scaleFactor, rotationAngle, centerPoint
+*/
+
+/*!
+ \property QPinchGesture::totalScaleFactor
+ \brief the total scale factor
+
+ The total scale factor measures the total change in scale factor from the
+ original value to the current scale factor.
+
+ \sa scaleFactor, lastScaleFactor
+*/
+/*!
+ \property QPinchGesture::lastScaleFactor
+ \brief the last scale factor recorded for this gesture
+
+ The last scale factor contains the scale factor reported in the
+ \l scaleFactor property when a previous gesture event included
+ information about this gesture.
+
+ If no previous event was delivered with information about this gesture
+ (i.e., this gesture object contains information about the first movement
+ in the gesture) then this property contains zero.
+
+ \sa scaleFactor, totalScaleFactor
+*/
+/*!
+ \property QPinchGesture::scaleFactor
+ \brief the current scale factor
+
+ The scale factor measures the scale factor associated with the distance
+ between two of the user's inputs on a multitouch device.
+
+ \sa totalScaleFactor, lastScaleFactor
+*/
+
+/*!
+ \property QPinchGesture::totalRotationAngle
+ \brief the total angle covered by the gesture
+
+ This total angle measures the complete angle covered by the gesture. Usually, this
+ is equal to the value held by the \l rotationAngle property, except in the case where
+ the user performs multiple rotations by removing and repositioning one of the touch
+ points, as described above. In this case, the total angle will be the sum of the
+ rotation angles for the multiple stages of the gesture.
+
+ \sa rotationAngle, lastRotationAngle
+*/
+/*!
+ \property QPinchGesture::lastRotationAngle
+ \brief the last reported angle covered by the gesture motion
+
+ The last rotation angle is the angle as reported in the \l rotationAngle property
+ when a previous gesture event was delivered for this gesture.
+
+ \sa rotationAngle, totalRotationAngle
+*/
+/*!
+ \property QPinchGesture::rotationAngle
+ \brief the angle covered by the gesture motion
+
+ \sa totalRotationAngle, lastRotationAngle
+*/
+/*!
+ \property QPinchGesture::startCenterPoint
+ \brief the starting position of the center point
+
+ \sa centerPoint, lastCenterPoint
+*/
+/*!
+ \property QPinchGesture::lastCenterPoint
+ \brief the last position of the center point recorded for this gesture
+
+ \sa centerPoint, startCenterPoint
+*/
+/*!
+ \property QPinchGesture::centerPoint
+ \brief the current center point
+
+ The center point is the midpoint between the two input points in the gesture.
+
+ \sa startCenterPoint, lastCenterPoint
+*/
+
+/*!
+ \internal
+*/
QPinchGesture::QPinchGesture(QObject *parent)
: QGesture(*new QPinchGesturePrivate, parent)
{
@@ -325,8 +524,65 @@ void QPinchGesture::setRotationAngle(qreal value)
d_func()->rotationAngle = value;
}
-// QSwipeGesture
+/*!
+ \class QSwipeGesture
+ \since 4.6
+ \brief The QSwipeGesture class describes a swipe gesture made by the user.
+ \ingroup gestures
+
+ \image swipegesture.png
+
+ \sa {Gestures Programming}, QPanGesture, QPinchGesture
+*/
+
+/*!
+ \enum QSwipeGesture::SwipeDirection
+
+ This enum describes the possible directions for the gesture's motion
+ along the horizontal and vertical axes.
+
+ \value NoDirection The gesture had no motion associated with it on a particular axis.
+ \value Left The gesture involved a horizontal motion to the left.
+ \value Right The gesture involved a horizontal motion to the right.
+ \value Up The gesture involved an upward vertical motion.
+ \value Down The gesture involved a downward vertical motion.
+*/
+
+/*!
+ \property QSwipeGesture::horizontalDirection
+ \brief the horizontal direction of the gesture
+
+ If the gesture has a horizontal component, the horizontal direction
+ is either Left or Right; otherwise, it is NoDirection.
+
+ \sa verticalDirection, swipeAngle
+*/
+
+/*!
+ \property QSwipeGesture::verticalDirection
+ \brief the vertical direction of the gesture
+
+ If the gesture has a vertical component, the vertical direction
+ is either Up or Down; otherwise, it is NoDirection.
+
+ \sa horizontalDirection, swipeAngle
+*/
+
+/*!
+ \property QSwipeGesture::swipeAngle
+ \brief the angle of the motion associated with the gesture
+
+ If the gesture has either a horizontal or vertical component, the
+ swipe angle describes the angle between the direction of motion and the
+ x-axis as defined using the standard widget
+ \l{The Coordinate System}{coordinate system}.
+
+ \sa horizontalDirection, verticalDirection
+*/
+/*!
+ \internal
+*/
QSwipeGesture::QSwipeGesture(QObject *parent)
: QGesture(*new QSwipeGesturePrivate, parent)
{
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index 0034819..02eb526 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -51,12 +51,12 @@
QT_BEGIN_HEADER
+Q_DECLARE_METATYPE(Qt::GestureState)
+
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
-Q_DECLARE_METATYPE(Qt::GestureState)
-
class QGesturePrivate;
class Q_GUI_EXPORT QGesture : public QObject
{
@@ -180,8 +180,12 @@ public:
friend class QPinchGestureRecognizer;
};
+QT_END_NAMESPACE
+
Q_DECLARE_METATYPE(QPinchGesture::WhatChanged)
+QT_BEGIN_NAMESPACE
+
class QSwipeGesturePrivate;
class Q_GUI_EXPORT QSwipeGesture : public QGesture
{
diff --git a/src/gui/kernel/qgesturerecognizer.cpp b/src/gui/kernel/qgesturerecognizer.cpp
index 2af087f..9de3bcc 100644
--- a/src/gui/kernel/qgesturerecognizer.cpp
+++ b/src/gui/kernel/qgesturerecognizer.cpp
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
\class QGestureRecognizer
\since 4.6
\brief The QGestureRecognizer class provides the infrastructure for gesture recognition.
+ \ingroup gestures
Gesture recognizers are responsible for creating and managing QGesture objects and
monitoring input events sent to QWidget and QGraphicsObject subclasses.
@@ -65,9 +66,11 @@ QT_BEGIN_NAMESPACE
about the user's input.
Gestures are created when the framework calls createGesture() to handle user input
- for a particular target QWidget or QGraphicsObject instance. Once a QGesture has been
- created for one of these objects, the gesture recognizer will receive events for it
- in its filterEvent() handler function.
+ for a particular instance of a QWidget or QGraphicsObject subclass. A QGesture object
+ is created for each widget or item that is configured to use gestures.
+
+ Once a QGesture has been created for a target object, the gesture recognizer will
+ receive events for it in its filterEvent() handler function.
When a gesture is canceled, the reset() function is called, giving the recognizer the
chance to update the appropriate properties in the corresponding QGesture object.
@@ -75,15 +78,18 @@ QT_BEGIN_NAMESPACE
\section1 Supporting New Gestures
To add support for new gestures, you need to derive from QGestureRecognizer to create
- a custom recognizer class and register it with the application by calling
- QApplication::registerGestureRecognizer(). You can also derive from QGesture to create
- a custom gesture class, or rely on dynamic properties to express specific details
- of the gesture you want to handle.
+ a custom recognizer class, construct an instance of this class, and register it with
+ the application by calling QApplication::registerGestureRecognizer(). You can also
+ subclass QGesture to create a custom gesture class, or rely on dynamic properties
+ to express specific details of the gesture you want to handle.
Your custom QGestureRecognizer subclass needs to reimplement the filterEvent() function
to handle and filter the incoming input events for QWidget and QGraphicsObject subclasses.
- Although the logic for gesture recognition is implemented in this function, the state of
- recognition for each target object can be recorded in the QGesture object supplied.
+ Although the logic for gesture recognition is implemented in this function, you can
+ store persistent information about the state of the recognition process in the QGesture
+ object supplied. The filterEvent() function must return a value of Qt::GestureState that
+ indicates the state of recognition for a given gesture and target object. This determines
+ whether or not a gesture event will be delivered to a target object.
If you choose to represent a gesture by a custom QGesture subclass, you will need to
reimplement the createGesture() function to construct instances of your gesture class.
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 1214f08..6116a5e 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -125,7 +125,6 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
break;
}
action->setSoftKeyRole(softKeyRole);
- action->setEnabled(actionWidget->isEnabled());
return action;
}
@@ -210,7 +209,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys)
for (int index = 0; index < softkeys.count(); index++) {
const QAction* softKeyAction = softkeys.at(index);
switch (softKeyAction->softKeyRole()) {
- // Positive Actions go on LSK
+ // Positive Actions on the LSK
case QAction::PositiveSoftKey:
position = 0;
break;
@@ -253,7 +252,8 @@ bool QSoftKeyManager::handleCommand(int command)
QAction *action = softKeys.at(i);
if (action->softKeyRole() != QAction::NoSoftKey) {
if (j == index) {
- if (action->isEnabled()) {
+ QWidget *parent = action->parentWidget();
+ if (parent && parent->isEnabled()) {
action->activate(QAction::Trigger);
return true;
}
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 7dc3ae9..b7a96b0 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -149,24 +149,6 @@ static inline bool hasBackingStoreSupport()
#endif
}
-/*!
- \internal
-
- Returns true if \a p or any of its parents enable the
- Qt::BypassGraphicsProxyWidget window flag. Used in QWidget::show() and
- QWidget::setParent() to determine whether it's necessary to embed the
- widget into a QGraphicsProxyWidget or not.
-*/
-static inline bool bypassGraphicsProxyWidget(QWidget *p)
-{
- while (p) {
- if (p->windowFlags() & Qt::BypassGraphicsProxyWidget)
- return true;
- p = p->parentWidget();
- }
- return false;
-}
-
#ifdef Q_WS_MAC
# define QT_NO_PAINT_DEBUG
#endif
@@ -1355,6 +1337,8 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
d->setWindowIcon_sys(true);
if (isWindow() && !d->topData()->iconText.isEmpty())
d->setWindowIconText_helper(d->topData()->iconText);
+ if (isWindow() && !d->topData()->caption.isEmpty())
+ d->setWindowTitle_helper(d->topData()->caption);
if (windowType() != Qt::Desktop) {
d->updateSystemBackground();
@@ -1502,6 +1486,8 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
mapper->remove(data.winid);
}
+ const WId oldWinId = data.winid;
+
data.winid = id;
#if defined(Q_WS_X11)
hd = id; // X11: hd == ident
@@ -1509,6 +1495,16 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
if (mapper && id && !userDesktopWidget) {
mapper->insert(data.winid, q);
}
+
+ if(oldWinId != id) {
+ // Do not emit an event when the old winId is destroyed. This only
+ // happens (a) during widget destruction, and (b) immediately prior
+ // to creation of a new winId, for example as a result of re-parenting.
+ if(id != 0) {
+ QEvent e(QEvent::WinIdChange);
+ QCoreApplication::sendEvent(q, &e);
+ }
+ }
}
void QWidgetPrivate::createTLExtra()
@@ -2227,8 +2223,8 @@ QWidget *QWidget::find(WId id)
against. If Qt is using Carbon, the {WId} is actually an HIViewRef. If Qt
is using Cocoa, {WId} is a pointer to an NSView.
- \note We recommend that you do not store this value as it is likely to
- change at run-time.
+ This value may change at run-time. An event with type QEvent::WinIdChange
+ will be sent to the widget following a change in window system identifier.
\sa find()
*/
@@ -5473,6 +5469,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
return pixmap;
}
+#ifndef QT_NO_GRAPHICSVIEW
/*!
\internal
@@ -5481,7 +5478,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
If successful, the function returns the proxy that embeds the widget, or 0 if no embedded
widget was found.
*/
-QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(QWidget *origin)
+QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(const QWidget *origin)
{
if (origin) {
QWExtra *extra = origin->d_func()->extra;
@@ -5491,6 +5488,7 @@ QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(QWidget *origi
}
return 0;
}
+#endif
/*!
\property QWidget::locale
@@ -5665,9 +5663,8 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
void QWidgetPrivate::setWindowTitle_helper(const QString &title)
{
Q_Q(QWidget);
- if (!q->testAttribute(Qt::WA_WState_Created))
- createWinId();
- setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q));
+ if (q->testAttribute(Qt::WA_WState_Created))
+ setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q));
}
void QWidgetPrivate::setWindowIconText_helper(const QString &title)
@@ -11998,3 +11995,10 @@ void QWidget::clearMask()
XRender extension is not supported on the X11 display, or if the
handle could not be created.
*/
+
+#ifdef Q_OS_SYMBIAN
+void QWidgetPrivate::_q_delayedDestroy(WId winId)
+{
+ delete winId;
+}
+#endif
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h
index 3501c6e..e603a1a 100644
--- a/src/gui/kernel/qwidget.h
+++ b/src/gui/kernel/qwidget.h
@@ -726,14 +726,11 @@ private:
friend class QGLContext;
friend class QGLWidget;
friend class QGLWindowSurface;
- friend class QGLWindowSurfaceGLPaintDevice;
- friend class QVGWindowSurface;
friend class QX11PaintEngine;
friend class QWin32PaintEngine;
friend class QShortcutPrivate;
friend class QShortcutMap;
friend class QWindowSurface;
- friend class QD3DWindowSurface;
friend class QGraphicsProxyWidget;
friend class QGraphicsProxyWidgetPrivate;
friend class QStyleSheetStyle;
@@ -776,6 +773,9 @@ private:
private:
Q_DISABLE_COPY(QWidget)
Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden())
+#ifdef Q_OS_SYMBIAN
+ Q_PRIVATE_SLOT(d_func(), void _q_delayedDestroy(WId winId))
+#endif
QWidgetData *data;
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index c966aa3..05c6a5b 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -305,6 +305,8 @@ bool qt_mac_insideKeyWindow(const QWidget *w)
{
#ifdef QT_MAC_USE_COCOA
return [[reinterpret_cast<NSView *>(w->winId()) window] isKeyWindow];
+#else
+ Q_UNUSED(w);
#endif
return false;
}
@@ -3301,7 +3303,11 @@ void QWidgetPrivate::show_sys()
[window miniaturize:window];
#endif
} else if (!q->testAttribute(Qt::WA_ShowWithoutActivating)) {
+#ifndef QT_MAC_USE_COCOA
qt_event_request_activate(q);
+#else
+ [qt_mac_window_for(q) makeKeyWindow];
+#endif
}
} else if(topData()->embedded || !q->parentWidget() || q->parentWidget()->isVisible()) {
#ifndef QT_MAC_USE_COCOA
@@ -3404,8 +3410,13 @@ void QWidgetPrivate::hide_sys()
}
#endif
}
- if(w && w->isVisible() && !w->isMinimized())
- qt_event_request_activate(w);
+ if(w && w->isVisible() && !w->isMinimized()) {
+#ifndef QT_MAC_USE_COCOA
+ qt_event_request_activate(w);
+#else
+ [qt_mac_window_for(w) makeKeyWindow];
+#endif
+ }
}
} else {
invalidateBuffer(q->rect());
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index a549740..24699c4 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -63,7 +63,9 @@
#include "QtGui/qstyle.h"
#include "QtGui/qapplication.h"
#include <private/qgraphicseffect_p.h>
-
+#include "QtGui/qgraphicsproxywidget.h"
+#include "QtGui/qgraphicsscene.h"
+#include "QtGui/qgraphicsview.h"
#include <private/qgesture_p.h>
#ifdef Q_WS_WIN
@@ -180,7 +182,9 @@ struct QWExtra {
// Regular pointers (keep them together to avoid gaps on 64 bits architectures).
void *glContext; // if the widget is hijacked by QGLWindowSurface
QTLWExtra *topextra; // only useful for TLWs
+#ifndef QT_NO_GRAPHICSVIEW
QGraphicsProxyWidget *proxyWidget; // if the widget is embedded
+#endif
#ifndef QT_NO_CURSOR
QCursor *curs;
#endif
@@ -235,6 +239,24 @@ struct QWExtra {
#endif
};
+/*!
+ \internal
+
+ Returns true if \a p or any of its parents enable the
+ Qt::BypassGraphicsProxyWidget window flag. Used in QWidget::show() and
+ QWidget::setParent() to determine whether it's necessary to embed the
+ widget into a QGraphicsProxyWidget or not.
+*/
+static inline bool bypassGraphicsProxyWidget(const QWidget *p)
+{
+ while (p) {
+ if (p->windowFlags() & Qt::BypassGraphicsProxyWidget)
+ return true;
+ p = p->parentWidget();
+ }
+ return false;
+}
+
class Q_GUI_EXPORT QWidgetPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QWidget)
@@ -296,7 +318,8 @@ public:
void setMask_sys(const QRegion &);
#ifdef Q_OS_SYMBIAN
void setSoftKeys_sys(const QList<QAction*> &softkeys);
- void activateSymbianWindow();
+ void activateSymbianWindow(WId wid = 0);
+ void _q_delayedDestroy(WId winId);
#endif
void raise_sys();
@@ -344,7 +367,9 @@ public:
QPainter *beginSharedPainter();
bool endSharedPainter();
- static QGraphicsProxyWidget * nearestGraphicsProxyWidget(QWidget *origin);
+#ifndef QT_NO_GRAPHICSVIEW
+ static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin);
+#endif
QWindowSurface *createDefaultWindowSurface();
QWindowSurface *createDefaultWindowSurface_sys();
void repaint_sys(const QRegion &rgn);
@@ -441,6 +466,31 @@ public:
void setModal_sys();
+ // This is an helper function that return the available geometry for
+ // a widget and takes care is this one is in QGraphicsView.
+ // If the widget is not embed in a scene then the geometry available is
+ // null, we let QDesktopWidget decide for us.
+ static QRect screenGeometry(const QWidget *widget)
+ {
+ QRect screen;
+#ifndef QT_NO_GRAPHICSVIEW
+ QGraphicsProxyWidget *ancestorProxy = widget->d_func()->nearestGraphicsProxyWidget(widget);
+ //It's embedded if it has an ancestor
+ if (ancestorProxy) {
+ if (!bypassGraphicsProxyWidget(widget)) {
+ // One view, let be smart and return the viewport rect then the popup is aligned
+ if (ancestorProxy->scene()->views().size() == 1) {
+ QGraphicsView *view = ancestorProxy->scene()->views().at(0);
+ screen = view->mapToScene(view->viewport()->rect()).boundingRect().toRect();
+ } else {
+ screen = ancestorProxy->scene()->sceneRect().toRect();
+ }
+ }
+ }
+#endif
+ return screen;
+ }
+
inline void setRedirected(QPaintDevice *replacement, const QPoint &offset)
{
Q_ASSERT(q_func()->testAttribute(Qt::WA_WState_InPaintEvent));
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index b0d405a..abf5ba5 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -56,6 +56,12 @@
#include <aknappui.h>
#endif
+// This is necessary in order to be able to perform delayed invokation on slots
+// which take arguments of type WId. One example is
+// QWidgetPrivate::_q_delayedDestroy, which is used to delay destruction of
+// CCoeControl objects until after the CONE event handler has finished running.
+Q_DECLARE_METATYPE(WId)
+
QT_BEGIN_NAMESPACE
extern bool qt_nograb();
@@ -318,8 +324,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
bool desktop = (type == Qt::Desktop);
//bool tool = (type == Qt::Tool || type == Qt::Drawer);
- WId id = 0;
-
if (popup)
flags |= Qt::WindowStaysOnTopHint; // a popup stays on top
@@ -341,13 +345,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
data.crect.setSize(QSize(width, height));
}
- CCoeControl *destroyw = 0;
+ CCoeControl *const destroyw = destroyOldWindow ? data.winid : 0;
createExtra();
if (window) {
- if (destroyOldWindow)
- destroyw = data.winid;
- id = window;
setWinId(window);
TRect tr = window->Rect();
data.crect.setRect(tr.iTl.iX, tr.iTl.iY, tr.Width(), tr.Height());
@@ -355,10 +356,15 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
} else if (topLevel) {
if (!q->testAttribute(Qt::WA_Moved) && !q->testAttribute(Qt::WA_DontShowOnScreen))
data.crect.moveTopLeft(QPoint(clientRect.iTl.iX, clientRect.iTl.iY));
- QSymbianControl *control= q_check_ptr(new QSymbianControl(q));
- id = (WId)control;
- setWinId(id);
- QT_TRAP_THROWING(control->ConstructL(true,desktop));
+
+ QScopedPointer<QSymbianControl> control( q_check_ptr(new QSymbianControl(q)) );
+ QT_TRAP_THROWING(control->ConstructL(true, desktop));
+
+ // Symbian windows are always created in an inactive state
+ // We perform this assignment for the case where the window is being re-created
+ // as aa result of a call to setParent_sys, on either this widget or one of its
+ // ancestors.
+ extra->activated = 0;
if (!desktop) {
TInt stackingFlags;
@@ -368,7 +374,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
stackingFlags = ECoeStackFlagStandard;
}
control->MakeVisible(false);
- QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags));
+ QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control.data(), ECoeStackPriorityDefault, stackingFlags));
// Avoid keyboard focus to a hidden window.
control->setFocusSafely(false);
@@ -391,11 +397,22 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
int x, y, w, h;
data.crect.getRect(&x, &y, &w, &h);
control->SetRect(TRect(TPoint(x, y), TSize(w, h)));
+
+ // We wait until the control is fully constructed before calling setWinId, because
+ // this generates a WinIdChanged event.
+ setWinId(control.take());
+
} else if (q->testAttribute(Qt::WA_NativeWindow) || paintOnScreen()) { // create native child widget
- QSymbianControl *control = new QSymbianControl(q);
- setWinId(control);
+
+ QScopedPointer<QSymbianControl> control( q_check_ptr(new QSymbianControl(q)) );
QT_TRAP_THROWING(control->ConstructL(!parentWidget));
+ // Symbian windows are always created in an inactive state
+ // We perform this assignment for the case where the window is being re-created
+ // as aa result of a call to setParent_sys, on either this widget or one of its
+ // ancestors.
+ extra->activated = 0;
+
TInt stackingFlags;
if ((q->windowType() & Qt::Popup) == Qt::Popup) {
stackingFlags = ECoeStackFlagRefusesAllKeys | ECoeStackFlagRefusesFocus;
@@ -403,7 +420,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
stackingFlags = ECoeStackFlagStandard;
}
control->MakeVisible(false);
- QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags));
+ QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control.data(), ECoeStackPriorityDefault, stackingFlags));
// Avoid keyboard focus to a hidden window.
control->setFocusSafely(false);
@@ -418,12 +435,21 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
| EPointerFilterMove | EPointerFilterDrag, 0);
if (q->isVisible() && q->testAttribute(Qt::WA_Mapped))
- activateSymbianWindow();
+ activateSymbianWindow(control.data());
+
+ // We wait until the control is fully constructed before calling setWinId, because
+ // this generates a WinIdChanged event.
+ setWinId(control.take());
}
if (destroyw) {
destroyw->ControlEnv()->AppUi()->RemoveFromStack(destroyw);
- CBase::Delete(destroyw);
+
+ // Delay deletion of the control in case this function is called in the
+ // context of a CONE event handler such as
+ // CCoeControl::ProcessPointerEventL
+ QMetaObject::invokeMethod(q, "_q_delayedDestroy",
+ Qt::QueuedConnection, Q_ARG(WId, destroyw));
}
if (q->testAttribute(Qt::WA_AcceptTouchEvents))
@@ -468,7 +494,7 @@ void QWidgetPrivate::show_sys()
invalidateBuffer(q->rect());
}
-void QWidgetPrivate::activateSymbianWindow()
+void QWidgetPrivate::activateSymbianWindow(WId wid)
{
Q_Q(QWidget);
@@ -476,8 +502,12 @@ void QWidgetPrivate::activateSymbianWindow()
Q_ASSERT(q->testAttribute(Qt::WA_Mapped));
Q_ASSERT(!extra->activated);
- WId id = q->internalWinId();
- QT_TRAP_THROWING(id->ActivateL());
+ if(!wid)
+ wid = q->internalWinId();
+
+ Q_ASSERT(wid);
+
+ QT_TRAP_THROWING(wid->ActivateL());
extra->activated = 1;
}
@@ -520,8 +550,13 @@ void QWidgetPrivate::raise_sys()
Q_Q(QWidget);
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
- if (q->internalWinId())
+ if (q->internalWinId()) {
q->internalWinId()->DrawableWindow()->SetOrdinalPosition(0);
+
+ // If toplevel widget, raise app to foreground
+ if (q->isWindow())
+ S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup().Identifier(), 0);
+ }
}
void QWidgetPrivate::lower_sys()
@@ -571,8 +606,14 @@ void QWidgetPrivate::reparentChildren()
w->d_func()->invalidateBuffer(w->rect());
WId parent = q->effectiveWinId();
WId child = w->effectiveWinId();
- if (parent != child)
- child->SetParent(parent);
+ if (parent != child) {
+ // Child widget is native. Because Symbian windows cannot be
+ // re-parented, we must re-create the window.
+ const WId window = 0;
+ const bool initializeWindow = false;
+ const bool destroyOldWindow = true;
+ w->d_func()->create_sys(window, initializeWindow, destroyOldWindow);
+ }
// ### TODO: We probably also need to update the component array here
w->d_func()->reparentChildren();
} else {
diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp
index 4a0d30c..2fe69e4 100644
--- a/src/gui/kernel/qwidget_wince.cpp
+++ b/src/gui/kernel/qwidget_wince.cpp
@@ -474,7 +474,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
int normal = SW_SHOWNOACTIVATE;
if ((oldstate & Qt::WindowMinimized) && !(newstate & Qt::WindowMinimized))
- newstate |= Qt::WindowActive;
+ newstate |= Qt::WindowActive;
if (newstate & Qt::WindowActive)
normal = SW_SHOWNORMAL;
if (isWindow()) {
@@ -490,13 +490,13 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
d->topData()->normalGeometry = geometry();
}
if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) {
- if (!(newstate & Qt::WindowMaximized)) {
+ if (!(newstate & Qt::WindowMaximized)) {
int style = GetWindowLong(internalWinId(), GWL_STYLE) | WS_BORDER | WS_POPUP | WS_CAPTION;
SetWindowLong(internalWinId(), GWL_STYLE, style);
SetWindowLong(internalWinId(), GWL_EXSTYLE, GetWindowLong (internalWinId(), GWL_EXSTYLE) & ~ WS_EX_NODRAG);
}
- if (isVisible() && newstate & Qt::WindowMaximized)
- qt_wince_maximize(this);
+ if (isVisible() && newstate & Qt::WindowMaximized)
+ qt_wince_maximize(this);
if (isVisible() && !(newstate & Qt::WindowMinimized)) {
ShowWindow(internalWinId(), (newstate & Qt::WindowMaximized) ? max : normal);
if (!(newstate & Qt::WindowFullScreen)) {
@@ -558,18 +558,10 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
else if (newstate & Qt::WindowMaximized) {
ShowWindow(internalWinId(), max);
qt_wince_maximize(this);
+ } else {
+ ShowWindow(internalWinId(), normal);
}
}
- if ((newstate & Qt::WindowMaximized) && !(newstate & Qt::WindowFullScreen)) {
- QRect r = d->topData()->normalGeometry;
-#ifdef Q_WS_WINCE_WM
- if (!inherits("QDialog") && !inherits("QMdiArea") && !isVisible()) {
- d->data.crect.setRect(0, 0, -1, -1);
- }
-#else
- qt_wince_maximize(this);
-#endif
- }
}
data->window_state = newstate;
QWindowStateChangeEvent e(oldstate);
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 283dfb2..663178f 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -518,14 +518,18 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (!window)
initializeWindow = true;
+ QX11Info *parentXinfo = parentWidget ? &parentWidget->d_func()->xinfo : 0;
+
if (desktop &&
qt_x11_create_desktop_on_screen >= 0 &&
qt_x11_create_desktop_on_screen != xinfo.screen()) {
// desktop on a certain screen other than the default requested
QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
xinfo.setX11Data(xd);
- } else if (parentWidget && parentWidget->d_func()->xinfo.screen() != xinfo.screen()) {
- xinfo = parentWidget->d_func()->xinfo;
+ } else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
+ || parentXinfo->visual() != xinfo.visual()))
+ {
+ xinfo = *parentXinfo;
}
//get display, screen number, root window and desktop geometry for
@@ -920,6 +924,43 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
#endif
}
+static void qt_x11_recreateWidget(QWidget *widget)
+{
+ if (widget->inherits("QGLWidget")) {
+ // We send QGLWidgets a ParentChange event which causes them to
+ // recreate their GL context, which in turn causes them to choose
+ // their visual again. Now that WA_TranslucentBackground is set,
+ // QGLContext::chooseVisual will select an ARGB visual.
+ QEvent e(QEvent::ParentChange);
+ QApplication::sendEvent(widget, &e);
+ } else {
+ // For regular widgets, reparent them with their parent which
+ // also triggers a recreation of the native window
+ QPoint pos = widget->pos();
+ bool visible = widget->isVisible();
+ if (visible)
+ widget->hide();
+
+ widget->setParent(widget->parentWidget(), widget->windowFlags());
+ widget->move(pos);
+ if (visible)
+ widget->show();
+ }
+}
+
+static void qt_x11_recreateNativeWidgetsRecursive(QWidget *widget)
+{
+ if (widget->testAttribute(Qt::WA_NativeWindow))
+ qt_x11_recreateWidget(widget);
+
+ const QObjectList &children = widget->children();
+ for (int i = 0; i < children.size(); ++i) {
+ QWidget *child = qobject_cast<QWidget*>(children.at(i));
+ if (child)
+ qt_x11_recreateNativeWidgetsRecursive(child);
+ }
+}
+
void QWidgetPrivate::x11UpdateIsOpaque()
{
#ifndef QT_NO_XRENDER
@@ -930,29 +971,9 @@ void QWidgetPrivate::x11UpdateIsOpaque()
bool topLevel = (data.window_flags & Qt::Window);
int screen = xinfo.screen();
if (topLevel && X11->use_xrender
- && X11->argbVisuals[screen] && xinfo.depth() != 32) {
-
- if (q->inherits("QGLWidget")) {
- // We send QGLWidgets a ParentChange event which causes them to
- // recreate their GL context, which in turn causes them to choose
- // their visual again. Now that WA_TranslucentBackground is set,
- // QGLContext::chooseVisual will select an ARGB visual.
- QEvent e(QEvent::ParentChange);
- QApplication::sendEvent(q, &e);
- }
- else {
- // For regular widgets, reparent them with their parent which
- // also triggers a recreation of the native window
- QPoint pos = q->pos();
- bool visible = q->isVisible();
- if (visible)
- q->hide();
-
- q->setParent(q->parentWidget(), q->windowFlags());
- q->move(pos);
- if (visible)
- q->show();
- }
+ && X11->argbVisuals[screen] && xinfo.depth() != 32)
+ {
+ qt_x11_recreateNativeWidgetsRecursive(q);
}
#endif
}
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index 89adaf5..f8dd424 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -374,9 +374,9 @@ template <typename T> void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl,
const uchar *src = srcPixels + y * sbpl;
const uchar *srcEnd = src + srcOffset;
while (src < srcEnd) {
-#if defined(QT_ARCH_ARM) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_))
+#if defined(QT_ARCH_ARM) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU))
// non-16-bit aligned memory access is not possible on PowerPC,
- // ARM <v6 (QT_ARCH_ARMV6) & SH & AVR32
+ // ARM <v6 (QT_ARCH_ARMV6) & SH & AVR32 & SPARC w/GCC
quint16 spix = (quint16(src[2])<<8) + src[1];
#else
quint16 spix = *(quint16 *) (src + 1);
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index 95c0b44..6114938 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -65,4 +65,9 @@ int QPaintDevice::metric(PaintDeviceMetric) const
return 0;
}
+Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric)
+{
+ return device->metric(metric);
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h
index 92aa3cb..c8e86b8 100644
--- a/src/gui/painting/qpaintdevice.h
+++ b/src/gui/painting/qpaintdevice.h
@@ -137,6 +137,7 @@ public:
friend class QPainter;
friend class QFontEngineMac;
friend class QX11PaintEngine;
+ friend Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, PaintDeviceMetric metric);
};
#ifdef QT3_SUPPORT
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 6037bd5..fab2d8d 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2376,6 +2376,7 @@ void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap)
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
if (s->matrix.type() <= QTransform::TxTranslate) {
+ ensurePen();
drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
} else {
drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color()));
@@ -2389,6 +2390,7 @@ void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap)
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
if (s->matrix.type() <= QTransform::TxTranslate) {
+ ensurePen();
drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
} else {
drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color()));
@@ -4213,13 +4215,6 @@ void QRasterBuffer::prepare(QCustomRasterPaintDevice *device)
drawHelper = qDrawHelper + format;
}
-class MetricAccessor : public QWidget {
-public:
- int metric(PaintDeviceMetric m) {
- return QWidget::metric(m);
- }
-};
-
int QCustomRasterPaintDevice::metric(PaintDeviceMetric m) const
{
switch (m) {
@@ -4231,7 +4226,7 @@ int QCustomRasterPaintDevice::metric(PaintDeviceMetric m) const
break;
}
- return (static_cast<MetricAccessor*>(widget)->metric(m));
+ return qt_paint_device_metric(widget, m);
}
int QCustomRasterPaintDevice::bytesPerLine() const
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index f271af9..cddad7d 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1608,9 +1608,21 @@ void QPainter::restore()
\warning A paint device can only be painted by one painter at a
time.
+ \warning Painting on a QImage with the format
+ QImage::Format_Indexed8 is not supported.
+
\sa end(), QPainter()
*/
+static inline void qt_cleanup_painter_state(QPainterPrivate *d)
+{
+ d->states.clear();
+ delete d->state;
+ d->state = 0;
+ d->engine = 0;
+ d->device = 0;
+}
+
bool QPainter::begin(QPaintDevice *pd)
{
Q_ASSERT(pd);
@@ -1656,15 +1668,21 @@ bool QPainter::begin(QPaintDevice *pd)
printf("QPainter::begin(), device=%p, type=%d\n", pd, pd->devType());
#endif
-
- d->device = pd;
if (pd->devType() == QInternal::Pixmap)
static_cast<QPixmap *>(pd)->detach();
else if (pd->devType() == QInternal::Image)
static_cast<QImage *>(pd)->detach();
d->engine = pd->paintEngine();
- d->extended = d->engine && d->engine->isExtended() ? static_cast<QPaintEngineEx *>(d->engine) : 0;
+
+ if (!d->engine) {
+ qWarning("QPainter::begin: Paint device returned engine == 0, type: %d", pd->devType());
+ return false;
+ }
+
+ d->device = pd;
+
+ d->extended = d->engine->isExtended() ? static_cast<QPaintEngineEx *>(d->engine) : 0;
if (d->emulationEngine)
d->emulationEngine->real_engine = d->extended;
@@ -1677,11 +1695,6 @@ bool QPainter::begin(QPaintDevice *pd)
d->state->redirectionMatrix.translate(-redirectionOffset.x(), -redirectionOffset.y());
d->state->brushOrigin = QPointF();
- if (!d->engine) {
- qWarning("QPainter::begin: Paint device returned engine == 0, type: %d", pd->devType());
- return false;
- }
-
// Slip a painter state into the engine before we do any other operations
if (d->extended)
d->extended->setState(d->state);
@@ -1700,8 +1713,7 @@ bool QPainter::begin(QPaintDevice *pd)
&& !paintOutsidePaintEvent && !inPaintEvent) {
qWarning("QPainter::begin: Widget painting can only begin as a "
"result of a paintEvent");
- d->engine = 0;
- d->device = 0;
+ qt_cleanup_painter_state(d);
return false;
}
@@ -1719,8 +1731,7 @@ bool QPainter::begin(QPaintDevice *pd)
Q_ASSERT(pm);
if (pm->isNull()) {
qWarning("QPainter::begin: Cannot paint on a null pixmap");
- d->engine = 0;
- d->device = 0;
+ qt_cleanup_painter_state(d);
return false;
}
@@ -1736,8 +1747,12 @@ bool QPainter::begin(QPaintDevice *pd)
Q_ASSERT(img);
if (img->isNull()) {
qWarning("QPainter::begin: Cannot paint on a null image");
- d->engine = 0;
- d->device = 0;
+ qt_cleanup_painter_state(d);
+ return false;
+ } else if (img->format() == QImage::Format_Indexed8) {
+ // Painting on indexed8 images is not supported.
+ qWarning("QPainter::begin: Cannot paint on an image with the QImage::Format_Indexed8 format");
+ qt_cleanup_painter_state(d);
return false;
}
if (img->depth() == 1) {
@@ -1760,12 +1775,8 @@ bool QPainter::begin(QPaintDevice *pd)
if (d->engine->isActive()) {
end();
} else {
- d->states.clear();
- delete d->state;
- d->state = 0;
+ qt_cleanup_painter_state(d);
}
- d->engine = 0;
- d->device = 0;
return false;
} else {
d->engine->setActive(begun);
@@ -1828,10 +1839,7 @@ bool QPainter::end()
if (!d->engine) {
qWarning("QPainter::end: Painter not active, aborted");
- d->states.clear();
- delete d->state;
- d->state = 0;
- d->device = 0;
+ qt_cleanup_painter_state(d);
return false;
}
@@ -1862,8 +1870,6 @@ bool QPainter::end()
delete d->engine;
}
- d->engine = 0;
-
if (d->emulationEngine) {
delete d->emulationEngine;
d->emulationEngine = 0;
@@ -1873,11 +1879,8 @@ bool QPainter::end()
d->extended = 0;
}
- d->states.clear();
- delete d->state;
- d->state = 0;
+ qt_cleanup_painter_state(d);
- d->device = 0;
return ended;
}
@@ -2051,8 +2054,7 @@ QPoint QPainter::brushOrigin() const
Sets the brush origin to \a position.
The brush origin specifies the (0, 0) coordinate of the painter's
- brush. This setting only applies to pattern brushes and pixmap
- brushes.
+ brush.
Note that while the brushOrigin() was necessary to adopt the
parent's background for a widget in Qt 3, this is no longer the
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 66d0c9d..b602690 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -310,7 +310,7 @@ struct QBoolToType
template <typename T>
void qScanConvert(QScanConverter &d, T allVertical)
{
- qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), topOrder);
+ qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder));
int line = 0;
for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) {
for (; line < d.m_lines.size() && d.m_lines.at(line).top == y; ++line) {
@@ -319,7 +319,7 @@ void qScanConvert(QScanConverter &d, T allVertical)
QScanConverter::Line *l = &d.m_lines.at(line);
d.m_active.resize(d.m_active.size() + 1);
int j;
- for (j = d.m_active.size() - 2; j >= 0 && xOrder(l, d.m_active.at(j)); --j)
+ for (j = d.m_active.size() - 2; j >= 0 && QT_PREPEND_NAMESPACE(xOrder)(l, d.m_active.at(j)); --j)
d.m_active.at(j+1) = d.m_active.at(j);
d.m_active.at(j+1) = l;
} else {
@@ -334,7 +334,7 @@ void qScanConvert(QScanConverter &d, T allVertical)
for (int i = 1; i < numActive; ++i) {
QScanConverter::Line *l = d.m_active.at(i);
int j;
- for (j = i-1; j >= 0 && xOrder(l, d.m_active.at(j)); --j)
+ for (j = i-1; j >= 0 && QT_PREPEND_NAMESPACE(xOrder)(l, d.m_active.at(j)); --j)
d.m_active.at(j+1) = d.m_active.at(j);
d.m_active.at(j+1) = l;
}
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 9063945..c57b3c1 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -969,13 +969,31 @@ QPointF qt_curves_for_arc(const QRectF &rect, qreal startAngle, qreal sweepLengt
}
+static inline void qdashstroker_moveTo(qfixed x, qfixed y, void *data) {
+ ((QStroker *) data)->moveTo(x, y);
+}
+
+static inline void qdashstroker_lineTo(qfixed x, qfixed y, void *data) {
+ ((QStroker *) data)->lineTo(x, y);
+}
+
+static inline void qdashstroker_cubicTo(qfixed, qfixed, qfixed, qfixed, qfixed, qfixed, void *) {
+ Q_ASSERT(0);
+// ((QStroker *) data)->cubicTo(c1x, c1y, c2x, c2y, ex, ey);
+}
+
+
/*******************************************************************************
* QDashStroker members
*/
QDashStroker::QDashStroker(QStroker *stroker)
- : m_stroker(stroker), m_dashOffset(0)
+ : m_stroker(stroker), m_dashOffset(0), m_stroke_width(1), m_miter_limit(1)
{
-
+ if (m_stroker) {
+ setMoveToHook(qdashstroker_moveTo);
+ setLineToHook(qdashstroker_lineTo);
+ setCubicToHook(qdashstroker_cubicTo);
+ }
}
QVector<qfixed> QDashStroker::patternForStyle(Qt::PenStyle style)
@@ -1012,10 +1030,16 @@ void QDashStroker::processCurrentSubpath()
int dashCount = qMin(m_dashPattern.size(), 32);
qfixed dashes[32];
+ if (m_stroker) {
+ m_customData = m_stroker;
+ m_stroke_width = m_stroker->strokeWidth();
+ m_miter_limit = m_stroker->miterLimit();
+ }
+
qreal longestLength = 0;
qreal sumLength = 0;
for (int i=0; i<dashCount; ++i) {
- dashes[i] = qMax(m_dashPattern.at(i), qreal(0)) * m_stroker->strokeWidth();
+ dashes[i] = qMax(m_dashPattern.at(i), qreal(0)) * m_stroke_width;
sumLength += dashes[i];
if (dashes[i] > longestLength)
longestLength = dashes[i];
@@ -1031,7 +1055,7 @@ void QDashStroker::processCurrentSubpath()
int idash = 0; // Index to current dash
qreal pos = 0; // The position on the curve, 0 <= pos <= path.length
qreal elen = 0; // element length
- qreal doffset = m_dashOffset * m_stroker->strokeWidth();
+ qreal doffset = m_dashOffset * m_stroke_width;
// make sure doffset is in range [0..sumLength)
doffset -= qFloor(doffset / sumLength) * sumLength;
@@ -1056,7 +1080,7 @@ void QDashStroker::processCurrentSubpath()
qfixed2d line_to_pos;
// Pad to avoid clipping the borders of thick pens.
- qfixed padding = qt_real_to_fixed(qMax(m_stroker->strokeWidth(), m_stroker->miterLimit()) * longestLength);
+ qfixed padding = qt_real_to_fixed(qMax(m_stroke_width, m_miter_limit) * longestLength);
qfixed2d clip_tl = { qt_real_to_fixed(m_clip_rect.left()) - padding,
qt_real_to_fixed(m_clip_rect.top()) - padding };
qfixed2d clip_br = { qt_real_to_fixed(m_clip_rect.right()) + padding ,
@@ -1108,7 +1132,7 @@ void QDashStroker::processCurrentSubpath()
// continue the current dash, without starting a
// new subpath.
if (!has_offset || !hasMoveTo) {
- m_stroker->moveTo(move_to_pos.x, move_to_pos.y);
+ emitMoveTo(move_to_pos.x, move_to_pos.y);
hasMoveTo = true;
}
@@ -1120,7 +1144,7 @@ void QDashStroker::processCurrentSubpath()
|| (line_to_pos.x > clip_tl.x && line_to_pos.x < clip_br.x
&& line_to_pos.y > clip_tl.y && line_to_pos.y < clip_br.y))
{
- m_stroker->lineTo(line_to_pos.x, line_to_pos.y);
+ emitLineTo(line_to_pos.x, line_to_pos.y);
}
} else {
move_to_pos.x = qt_real_to_fixed(p2.x());
@@ -1134,6 +1158,7 @@ void QDashStroker::processCurrentSubpath()
estart = estop;
prev = e;
}
+
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index d33eeb4..a10ebd9 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -171,7 +171,6 @@ protected:
QRectF m_clip_rect;
-private:
void *m_customData;
qStrokerMoveToHook m_moveTo;
qStrokerLineToHook m_lineTo;
@@ -258,12 +257,18 @@ public:
virtual void begin(void *data);
virtual void end();
+ inline void setStrokeWidth(qreal width) { m_stroke_width = width; }
+ inline void setMiterLimit(qreal limit) { m_miter_limit = limit; }
+
protected:
virtual void processCurrentSubpath();
QStroker *m_stroker;
QVector<qfixed> m_dashPattern;
qreal m_dashOffset;
+
+ qreal m_stroke_width;
+ qreal m_miter_limit;
};
@@ -361,16 +366,16 @@ inline void QStroker::emitCubicTo(qfixed c1x, qfixed c1y,
*/
inline void QDashStroker::begin(void *data)
{
- Q_ASSERT(m_stroker);
- m_stroker->begin(data);
+ if (m_stroker)
+ m_stroker->begin(data);
QStrokerOps::begin(data);
}
inline void QDashStroker::end()
{
- Q_ASSERT(m_stroker);
QStrokerOps::end();
- m_stroker->end();
+ if (m_stroker)
+ m_stroker->end();
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 25b6aba..9e5707d 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -230,7 +230,14 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
#ifdef Q_WS_MAC
+
+#ifdef QT_MAC_USE_COCOA
+ // For cocoa the margin is built into the glyph it seems..
+ return 0;
+#else
return 2;
+#endif
+
#else
return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
#endif
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index 611ca59..e630253 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QS60MainAppUi
\since 4.6
- \brief Helper class for S60 migration
+ \brief The QS60MainAppUi class is a helper class for S60 migration.
\warning This class is provided only to get access to S60 specific
functionality in the application framework classes. It is not
diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp
index 54df17e..7405784 100644
--- a/src/gui/s60framework/qs60maindocument.cpp
+++ b/src/gui/s60framework/qs60maindocument.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QS60MainDocument
\since 4.6
- \brief Helper class for S60 migration
+ \brief The QS60MainDocument class is a helper class for S60 migration.
\warning This class is provided only to get access to S60 specific
functionality in the application framework classes. It is not
diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp
index d27b1ec..a617102 100644
--- a/src/gui/styles/qwindowsmobilestyle.cpp
+++ b/src/gui/styles/qwindowsmobilestyle.cpp
@@ -6003,7 +6003,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
}
painter->restore();
break;
-#endif // QT_NO_SLIDER
+#endif // QT_NO_SCROLLBAR
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton
= qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 758d8af..8ce437d 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -119,6 +119,28 @@ OSStatus QMacFontPath::closePath(void *data)
}
+
+void qmacfontengine_gamma_correct(QImage *image)
+{
+ extern uchar qt_pow_rgb_gamma[256];
+
+ // gamma correct the pixels back to linear color space...
+ int h = image->height();
+ int w = image->width();
+
+ for (int y=0; y<h; ++y) {
+ uint *pixels = (uint *) image->scanLine(y);
+ for (int x=0; x<w; ++x) {
+ uint p = pixels[x];
+ uint r = qt_pow_rgb_gamma[qRed(p)];
+ uint g = qt_pow_rgb_gamma[qGreen(p)];
+ uint b = qt_pow_rgb_gamma[qBlue(p)];
+ pixels[x] = (r << 16) | (g << 8) | b | 0xff000000;
+ }
+ }
+}
+
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool kerning)
: QFontEngineMulti(0)
@@ -534,7 +556,7 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
}
}
-QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph)
+QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, int margin, bool aa)
{
const glyph_metrics_t br = boundingBox(glyph);
QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32);
@@ -549,9 +571,10 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph)
8, im.bytesPerLine(), colorspace,
cgflags);
CGContextSetFontSize(ctx, fontDef.pixelSize);
- CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold
- && !(fontDef.styleStrategy & QFont::NoAntialias));
- CGContextSetShouldSmoothFonts(ctx, false);
+ CGContextSetShouldAntialias(ctx, aa ||
+ (fontDef.pointSize > qt_antialiasing_threshold
+ && !(fontDef.styleStrategy & QFont::NoAntialias)));
+ CGContextSetShouldSmoothFonts(ctx, aa);
CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx);
CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0);
@@ -586,6 +609,13 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph)
CGContextRelease(ctx);
+ return im;
+}
+
+QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph)
+{
+ QImage im = imageForGlyph(glyph, 0, false);
+
QImage indexed(im.width(), im.height(), QImage::Format_Indexed8);
QVector<QRgb> colors(256);
for (int i=0; i<256; ++i)
@@ -605,6 +635,16 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph)
return indexed;
}
+QImage QCoreTextFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTransform &x)
+{
+ if (x.type() >= QTransform::TxScale)
+ return QFontEngine::alphaRGBMapForGlyph(glyph, margin, x);
+
+ QImage im = imageForGlyph(glyph, margin, true);
+ qmacfontengine_gamma_correct(&im);
+ return im;
+}
+
void QCoreTextFontEngine::recalcAdvances(int numGlyphs, QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
{
Q_ASSERT(false);
@@ -790,7 +830,6 @@ static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATS
surrogates += (str[i].unicode() >= 0xd800 && str[i].unicode() < 0xdc00
&& str[i+1].unicode() >= 0xdc00 && str[i+1].unicode() < 0xe000);
}
- Q_ASSERT(*nfo->numGlyphs == item->length - surrogates);
#endif
for (nextCharStop = item->from; nextCharStop < item->from + item->length; ++nextCharStop)
if (item->charAttributes[nextCharStop].charStop)
@@ -816,10 +855,13 @@ static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATS
QFixed xAdvance = FixedToQFixed(layoutData[glyphIdx + 1].realPos - layoutData[glyphIdx].realPos);
if (glyphId != 0xffff || i == 0) {
- nfo->glyphs->glyphs[i] = (glyphId & 0x00ffffff) | (fontIdx << 24);
+ if (i < nfo->glyphs->numGlyphs)
+ {
+ nfo->glyphs->glyphs[i] = (glyphId & 0x00ffffff) | (fontIdx << 24);
- nfo->glyphs->advances_y[i] = yAdvance;
- nfo->glyphs->advances_x[i] = xAdvance;
+ nfo->glyphs->advances_y[i] = yAdvance;
+ nfo->glyphs->advances_x[i] = xAdvance;
+ }
} else {
// ATSUI gives us 0xffff as glyph id at the index in the glyph array for
// a character position that maps to a ligtature. Such a glyph id does not
@@ -989,6 +1031,8 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph
nfo.flags = flags;
nfo.shaperItem = shaperItem;
+ int prevNumGlyphs = *nglyphs;
+
QVarLengthArray<int> mappedFonts(len);
for (int i = 0; i < len; ++i)
mappedFonts[i] = 0;
@@ -1100,6 +1144,8 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph
}
ATSUClearLayoutCache(textLayout, kATSUFromTextBeginning);
+ if (prevNumGlyphs < *nfo.numGlyphs)
+ return false;
return true;
}
@@ -1505,19 +1551,7 @@ QImage QFontEngineMac::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTra
im = im.transformed(t);
}
- extern uchar qt_pow_rgb_gamma[256];
-
- // gamma correct the pixels back to linear color space...
- for (int y=0; y<im.height(); ++y) {
- uint *pixels = (uint *) im.scanLine(y);
- for (int x=0; x<im.width(); ++x) {
- uint p = pixels[x];
- uint r = qt_pow_rgb_gamma[qRed(p)];
- uint g = qt_pow_rgb_gamma[qGreen(p)];
- uint b = qt_pow_rgb_gamma[qBlue(p)];
- pixels[x] = (r << 16) | (g << 8) | b | 0xff000000;
- }
- }
+ qmacfontengine_gamma_correct(&im);
return im;
}
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 50124fa..728c344 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -448,12 +448,13 @@ public:
virtual bool getSfntTableData(uint /*tag*/, uchar * /*buffer*/, uint * /*length*/) const;
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
virtual QImage alphaMapForGlyph(glyph_t);
+ virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t);
virtual qreal minRightBearing() const;
virtual qreal minLeftBearing() const;
-
private:
+ QImage imageForGlyph(glyph_t glyph, int margin, bool colorful);
CTFontRef ctfont;
CGFontRef cgFont;
QCoreTextFontEngineMulti *parentEngine;
diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp
index 4f20094..e101830 100644
--- a/src/gui/text/qtextengine_mac.cpp
+++ b/src/gui/text/qtextengine_mac.cpp
@@ -50,7 +50,6 @@ static void heuristicSetGlyphAttributes(const QChar *uc, int length, QGlyphLayou
{
// ### zeroWidth and justification are missing here!!!!!
- Q_ASSERT(num_glyphs <= length);
Q_UNUSED(num_glyphs);
// qDebug("QScriptEngine::heuristicSetGlyphAttributes, num_glyphs=%d", item->num_glyphs);
@@ -596,7 +595,7 @@ void QTextEngine::shapeTextMac(int item) const
}
while (true) {
- ensureSpace(num_glyphs);
+ ensureSpace(num_glyphs);
num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used;
QGlyphLayout g = availableGlyphs(&si);
@@ -611,9 +610,9 @@ void QTextEngine::shapeTextMac(int item) const
log_clusters,
attributes())) {
- heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs);
- break;
- }
+ heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs);
+ break;
+ }
}
si.num_glyphs = num_glyphs;
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index b606538..0e888d6 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2174,11 +2174,14 @@ void QComboBox::insertSeparator(int index)
/*!
Removes the item at the given \a index from the combobox.
This will update the current index if the index is removed.
+
+ This function does nothing if \a index is out of range.
*/
void QComboBox::removeItem(int index)
{
- Q_ASSERT(index >= 0 && index < count());
Q_D(QComboBox);
+ if (index < 0 || index >= count())
+ return;
d->model->removeRows(index, 1, d->root);
}
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 280ca63..10f8db8 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -560,7 +560,7 @@ QAction* QDialogButtonBoxPrivate::createSoftKey(QAbstractButton *button, QDialog
Q_Q(QDialogButtonBox);
QAction::SoftKeyRole softkeyRole;
- QAction *action = new QAction(button->text(), q);
+ QAction *action = new QAction(button->text(), button);
switch (role) {
case ApplyRole:
@@ -581,7 +581,6 @@ QAction* QDialogButtonBoxPrivate::createSoftKey(QAbstractButton *button, QDialog
}
QObject::connect(action, SIGNAL(triggered()), button, SIGNAL(clicked()));
action->setSoftKeyRole(softkeyRole);
- action->setEnabled(button->isEnabled());
return action;
}
#endif
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 5930540..7f9ff82 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -1290,7 +1290,7 @@ void QLineControl::setCursorBlinkPeriod(int msec)
m_blinkStatus = 1;
} else {
m_blinkTimer = 0;
- if (m_blinkStatus == 0)
+ if (m_blinkStatus == 1)
emit updateNeeded(inputMask().isEmpty() ? cursorRect() : QRect());
}
m_blinkPeriod = msec;
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 687e1bc..324bc90 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -180,6 +180,21 @@ int QMenuPrivate::scrollerHeight() const
}
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
+QRect QMenuPrivate::popupGeometry(const QWidget *widget) const
+{
+#ifdef Q_WS_WIN
+ return QApplication::desktop()->screenGeometry(widget);
+#elif defined Q_WS_X11
+ if (X11->desktopEnvironment == DE_KDE)
+ return QApplication::desktop()->screenGeometry(widget);
+ else
+ return QApplication::desktop()->availableGeometry(widget);
+#else
+ return QApplication::desktop()->availableGeometry(widget);
+#endif
+}
+
+//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(int screen) const
{
#ifdef Q_WS_WIN
@@ -234,7 +249,7 @@ void QMenuPrivate::updateActionRects() const
}
int max_column_width = 0,
- dh = popupGeometry(QApplication::desktop()->screenNumber(q)).height(),
+ dh = popupGeometry(q).height(),
y = 0;
QStyle *style = q->style();
QStyleOption opt;
@@ -744,7 +759,7 @@ void QMenuPrivate::scrollMenu(QAction *action, QMenuScroller::ScrollLocation loc
if (newScrollFlags & QMenuScroller::ScrollUp)
newOffset -= vmargin;
- QRect screen = popupGeometry(QApplication::desktop()->screenNumber(q));
+ QRect screen = popupGeometry(q);
const int desktopFrame = q->style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, q);
if (q->height() < screen.height()-(desktopFrame*2)-1) {
QRect geom = q->geometry();
@@ -1789,7 +1804,15 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
d->updateActionRects();
QPoint pos = p;
QSize size = sizeHint();
- QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(p));
+ QRect screen;
+#ifndef QT_NO_GRAPHICSVIEW
+ bool isEmbedded = d->nearestGraphicsProxyWidget(this);
+ if (isEmbedded)
+ screen = d->popupGeometry(this);
+ else
+#endif
+ screen = d->popupGeometry(QApplication::desktop()->screenNumber(p));
+
const int desktopFrame = style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, this);
bool adjustToDesktop = !window()->testAttribute(Qt::WA_DontShowOnScreen);
#ifdef QT_KEYPAD_NAVIGATION
@@ -2927,7 +2950,7 @@ void QMenu::internalDelayedPopup()
QPoint pos(rightPos);
QMenu *caused = qobject_cast<QMenu*>(d->activeMenu->d_func()->causedPopup.widget);
- const QRect availGeometry(d->popupGeometry(QApplication::desktop()->screenNumber(caused)));
+ const QRect availGeometry(d->popupGeometry(caused));
if (isRightToLeft()) {
pos = leftPos;
if ((caused && caused->x() < x()) || pos.x() < availGeometry.left()) {
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 4fc3d3d..cee38ee 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1425,7 +1425,7 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
SetMenuItemProperty(data.submenuHandle, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), &caused);
#else
NSMenu *subMenu = static_cast<NSMenu *>(action->action->menu()->macMenu());
- if ([subMenu supermenu] != nil) {
+ if ([subMenu supermenu] && [subMenu supermenu] != [item menu]) {
// The menu is already a sub-menu of another one. Cocoa will throw an exception,
// in such cases. For the time being, a new QMenu with same set of actions is the
// only workaround.
@@ -1718,7 +1718,7 @@ QMenuBarPrivate::QMacMenuBarPrivate::syncAction(QMacMenuAction *action)
GetMenuItemProperty(action->menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(caused), 0, &caused);
SetMenuItemProperty(submenu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), &caused);
#else
- if ([submenu supermenu] != nil)
+ if ([submenu supermenu] && [submenu supermenu] != [item menu])
return;
else
[item setSubmenu:submenu];
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index 9c4f260..6a8e4b0 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -192,7 +192,8 @@ public:
mutable QVector<QRect> actionRects;
mutable QWidgetList widgetItems;
void updateActionRects() const;
- QRect popupGeometry(int screen=-1) const;
+ QRect popupGeometry(const QWidget *widget) const;
+ QRect popupGeometry(int screen = -1) const;
mutable uint ncols : 4; //4 bits is probably plenty
uint collapsibleSeparators : 1;
diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp
index 1352e1b..eb34336 100644
--- a/src/gui/widgets/qpushbutton.cpp
+++ b/src/gui/widgets/qpushbutton.cpp
@@ -590,7 +590,7 @@ void QPushButtonPrivate::_q_popupPressed()
int x = globalPos.x();
int y = globalPos.y();
if (horizontal) {
- if (globalPos.y() + rect.height() + menuSize.height() <= QApplication::desktop()->height()) {
+ if (globalPos.y() + rect.height() + menuSize.height() <= QApplication::desktop()->availableGeometry(q).height()) {
y += rect.height();
} else {
y -= menuSize.height();
@@ -598,7 +598,7 @@ void QPushButtonPrivate::_q_popupPressed()
if (q->layoutDirection() == Qt::RightToLeft)
x += rect.width() - menuSize.width();
} else {
- if (globalPos.x() + rect.width() + menu->sizeHint().width() <= QApplication::desktop()->width())
+ if (globalPos.x() + rect.width() + menu->sizeHint().width() <= QApplication::desktop()->availableGeometry(q).width())
x += rect.width();
else
x -= menuSize.width();
diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp
index 2b0de96..e6ef8f3 100644
--- a/src/multimedia/video/qvideosurfaceformat.cpp
+++ b/src/multimedia/video/qvideosurfaceformat.cpp
@@ -58,7 +58,7 @@ public:
, scanLineDirection(QVideoSurfaceFormat::TopToBottom)
, pixelAspectRatio(1, 1)
, yuvColorSpace(QVideoSurfaceFormat::YCbCr_Undefined)
- , frameRate(0, 0)
+ , frameRate(0.0)
{
}
@@ -73,7 +73,7 @@ public:
, pixelAspectRatio(1, 1)
, yuvColorSpace(QVideoSurfaceFormat::YCbCr_Undefined)
, viewport(QPoint(0, 0), size)
- , frameRate(0, 0)
+ , frameRate(0.0)
{
}
@@ -100,7 +100,7 @@ public:
&& frameSize == other.frameSize
&& pixelAspectRatio == other.pixelAspectRatio
&& viewport == other.viewport
- && frameRate == other.frameRate
+ && frameRatesEqual(frameRate, other.frameRate)
&& yuvColorSpace == other.yuvColorSpace
&& propertyNames.count() == other.propertyNames.count()) {
for (int i = 0; i < propertyNames.count(); ++i) {
@@ -115,6 +115,11 @@ public:
}
}
+ inline static bool frameRatesEqual(qreal r1, qreal r2)
+ {
+ return qAbs(r1 - r2) <= 0.00001 * qMin(qAbs(r1), qAbs(r2));
+ }
+
QVideoFrame::PixelFormat pixelFormat;
QAbstractVideoBuffer::HandleType handleType;
QVideoSurfaceFormat::Direction scanLineDirection;
@@ -122,7 +127,7 @@ public:
QSize pixelAspectRatio;
QVideoSurfaceFormat::YuvColorSpace yuvColorSpace;
QRect viewport;
- QVideoSurfaceFormat::FrameRate frameRate;
+ qreal frameRate;
QList<QByteArray> propertyNames;
QList<QVariant> propertyValues;
};
@@ -201,15 +206,6 @@ public:
The full range Y'CbCr color space used in JPEG files.
*/
-
-/*!
- \typedef QVideoSurfaceFormat::FrameRate
-
- A pair of integers representing the frame rate of a video stream.
-
- The first number is the numerator and the second the denominator.
-*/
-
/*!
Constructs a null video stream format.
*/
@@ -415,41 +411,24 @@ void QVideoSurfaceFormat::setScanLineDirection(Direction direction)
}
/*!
- Returns the frame rate of a video stream.
-
- The frame rate is a rational number represented by a pair of integers.
- The first integer is the numerator and the second the denominator.
+ Returns the frame rate of a video stream in frames per second.
*/
-QVideoSurfaceFormat::FrameRate QVideoSurfaceFormat::frameRate() const
+qreal QVideoSurfaceFormat::frameRate() const
{
return d->frameRate;
}
/*!
- Sets the frame \a rate of a video stream.
-
- The frame rate is a rational number represented by a pair of integers.
- The first integer is the numerator and the second the denominator.
+ Sets the frame \a rate of a video stream in frames per second.
*/
-void QVideoSurfaceFormat::setFrameRate(const FrameRate &rate)
+void QVideoSurfaceFormat::setFrameRate(qreal rate)
{
d->frameRate = rate;
}
/*!
- \overload
-
- Sets the \a numerator and \a denominator of the frame rate of a video stream.
-*/
-
-void QVideoSurfaceFormat::setFrameRate(int numerator, int denominator)
-{
- d->frameRate = qMakePair(numerator, denominator);
-}
-
-/*!
Returns a video stream's pixel aspect ratio.
*/
@@ -599,8 +578,8 @@ void QVideoSurfaceFormat::setProperty(const char *name, const QVariant &value)
if (qVariantCanConvert<Direction>(value))
d->scanLineDirection = qvariant_cast<Direction>(value);
} else if (qstrcmp(name, "frameRate") == 0) {
- if (qVariantCanConvert<FrameRate>(value))
- d->frameRate = qvariant_cast<FrameRate>(value);
+ if (qVariantCanConvert<qreal>(value))
+ d->frameRate = qvariant_cast<qreal>(value);
} else if (qstrcmp(name, "pixelAspectRatio") == 0) {
if (qVariantCanConvert<QSize>(value))
d->pixelAspectRatio = qvariant_cast<QSize>(value);
diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h
index b3005bd..1f4a5cb 100644
--- a/src/multimedia/video/qvideosurfaceformat.h
+++ b/src/multimedia/video/qvideosurfaceformat.h
@@ -87,8 +87,6 @@ public:
#endif
};
- typedef QPair<int, int> FrameRate;
-
QVideoSurfaceFormat();
QVideoSurfaceFormat(
const QSize &size,
@@ -120,9 +118,8 @@ public:
Direction scanLineDirection() const;
void setScanLineDirection(Direction direction);
- FrameRate frameRate() const;
- void setFrameRate(const FrameRate &rate);
- void setFrameRate(int numerator, int denominator = 1);
+ qreal frameRate() const;
+ void setFrameRate(qreal rate);
QSize pixelAspectRatio() const;
void setPixelAspectRatio(const QSize &ratio);
@@ -147,7 +144,6 @@ Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoSurfaceFormat &);
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QVideoSurfaceFormat::FrameRate)
Q_DECLARE_METATYPE(QVideoSurfaceFormat::Direction)
Q_DECLARE_METATYPE(QVideoSurfaceFormat::YuvColorSpace)
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 81fac57..6962ab3 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -105,6 +105,9 @@ void QHttpNetworkConnectionChannel::init()
QObject::connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError>&)),
this, SLOT(_q_sslErrors(const QList<QSslError>&)),
Qt::DirectConnection);
+ QObject::connect(sslSocket, SIGNAL(encryptedBytesWritten(qint64)),
+ this, SLOT(_q_encryptedBytesWritten(qint64)),
+ Qt::DirectConnection);
}
#endif
}
@@ -881,6 +884,15 @@ void QHttpNetworkConnectionChannel::_q_sslErrors(const QList<QSslError> &errors)
//QNetworkReply::NetworkError errorCode = QNetworkReply::ProtocolFailure;
emit connection->sslErrors(errors);
}
+
+void QHttpNetworkConnectionChannel::_q_encryptedBytesWritten(qint64 bytes)
+{
+ Q_UNUSED(bytes);
+ // bytes have been written to the socket. write even more of them :)
+ if (isSocketWriting())
+ sendRequest();
+ // otherwise we do nothing
+}
#endif
QT_END_NAMESPACE
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index 1d1153e..127a431 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -180,6 +180,7 @@ public:
#ifndef QT_NO_OPENSSL
void _q_encrypted(); // start sending request (https)
void _q_sslErrors(const QList<QSslError> &errors); // ssl errors from the socket
+ void _q_encryptedBytesWritten(qint64 bytes); // proceed sending
#endif
};
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 439d564..b1160aa 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -95,9 +95,10 @@ static void ensureInitialized()
/*!
\class QNetworkAccessManager
\brief The QNetworkAccessManager class allows the application to
- post network requests and receive replies
+ send network requests and receive replies
\since 4.4
+ \ingroup network
\inmodule QtNetwork
\reentrant
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index 4eb53bf..9ab4057 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -59,9 +59,10 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
\class QNetworkReply
\since 4.4
\brief The QNetworkReply class contains the data and headers for a request
- posted with QNetworkAccessManager
+ sent with QNetworkAccessManager
\reentrant
+ \ingroup network
\inmodule QtNetwork
The QNetworkReply class contains the data and meta data related to
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 33bc57b..86195c6 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QNetworkRequest
- \brief The QNetworkRequest class holds one request to be sent with the Network Access API.
+ \brief The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
\since 4.4
\ingroup network
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp
index c3b89ed..6f92424 100644
--- a/src/network/kernel/qnetworkproxy_win.cpp
+++ b/src/network/kernel/qnetworkproxy_win.cpp
@@ -399,7 +399,12 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
if (isBypassed(query.peerHostName(), sp->proxyBypass))
return sp->defaultResult;
- return parseServerList(query, sp->proxyServerList);
+ QList<QNetworkProxy> result = parseServerList(query, sp->proxyServerList);
+ // In some cases, this was empty. See SF task 00062670
+ if (result.isEmpty())
+ return sp->defaultResult;
+
+ return result;
}
QT_END_NAMESPACE
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 86ccef2..9fb0b47 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -1578,6 +1578,13 @@ bool QAbstractSocket::setSocketDescriptor(int socketDescriptor, SocketState sock
*/
void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)
{
+#ifndef QT_NO_OPENSSL
+ if (QSslSocket *sslSocket = qobject_cast<QSslSocket*>(this)) {
+ sslSocket->setSocketOption(option, value);
+ return;
+ }
+#endif
+
if (!d_func()->socketEngine)
return;
@@ -1600,6 +1607,12 @@ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, cons
*/
QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option)
{
+#ifndef QT_NO_OPENSSL
+ if (QSslSocket *sslSocket = qobject_cast<QSslSocket*>(this)) {
+ return sslSocket->socketOption(option);
+ }
+#endif
+
if (!d_func()->socketEngine)
return QVariant();
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 0e9cb4f..ad766c1 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -149,6 +149,13 @@
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (\l{http://www.openssl.org/}).
+ \note Be aware of the difference between the bytesWritten() signal and
+ the encryptedBytesWritten() signal. For a QTcpSocket, bytesWritten()
+ will get emitted as soon as data has been written to the TCP socket.
+ For a QSslSocket, bytesWritten() will get emitted when the data
+ is being encrypted and encryptedBytesWritten()
+ will get emitted as soon as data has been written to the TCP socket.
+
\sa QSslCertificate, QSslCipher, QSslError
*/
@@ -460,6 +467,22 @@ bool QSslSocket::setSocketDescriptor(int socketDescriptor, SocketState state, Op
return retVal;
}
+void QSslSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)
+{
+ Q_D(QSslSocket);
+ if (d->plainSocket)
+ d->plainSocket->setSocketOption(option, value);
+}
+
+QVariant QSslSocket::socketOption(QAbstractSocket::SocketOption option)
+{
+ Q_D(QSslSocket);
+ if (d->plainSocket)
+ return d->plainSocket->socketOption(option);
+ else
+ return QVariant();
+}
+
/*!
Returns the current mode for the socket; either UnencryptedMode, where
QSslSocket behaves identially to QTcpSocket, or one of SslClientMode or
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index a41e600..adb206c 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -90,6 +90,10 @@ public:
bool setSocketDescriptor(int socketDescriptor, SocketState state = ConnectedState,
OpenMode openMode = ReadWrite);
+ // ### Qt 5: Make virtual
+ void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
+ QVariant socketOption(QAbstractSocket::SocketOption option);
+
SslMode mode() const;
bool isEncrypted() const;
diff --git a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
index 24606bc..ab2026c 100644
--- a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
+++ b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
@@ -52,7 +52,7 @@ public:
QGLCustomShaderStagePrivate() :
m_manager(0) {}
- QGLEngineShaderManager* m_manager;
+ QPointer<QGLEngineShaderManager> m_manager;
QByteArray m_source;
};
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index 6712bf6..3eef808 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -131,7 +131,6 @@ static const char* const qglslPositionWithPatternBrushVertexShader = "\
gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
gl_Position.w = invertedHTexCoordsZ; \
patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \
- patternTexCoords.y = -patternTexCoords.y; \
}";
static const char* const qglslAffinePositionWithPatternBrushVertexShader
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 8130151..13efbda 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -469,8 +469,6 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
QPointF translationPoint;
if (style <= Qt::DiagCrossPattern) {
- translationPoint = q->state()->brushOrigin;
-
QColor col = qt_premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::PatternColor), col);
@@ -528,8 +526,6 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::HalfViewportSize), halfViewportSize);
}
else if (style == Qt::TexturePattern) {
- translationPoint = q->state()->brushOrigin;
-
const QPixmap& texPixmap = currentBrush->texture();
if (qHasPixmapTexture(*currentBrush) && currentBrush->texture().isQBitmap()) {
@@ -546,9 +542,13 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
else
qWarning("QGL2PaintEngineEx: Unimplemented fill style");
+ const QPointF &brushOrigin = q->state()->brushOrigin;
+ QTransform matrix = q->state()->matrix;
+ matrix.translate(brushOrigin.x(), brushOrigin.y());
+
QTransform translate(1, 0, 0, 1, -translationPoint.x(), -translationPoint.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, height);
- QTransform inv_matrix = gl_to_qt * (brushQTransform * q->state()->matrix).inverted() * translate;
+ QTransform inv_matrix = gl_to_qt * (brushQTransform * matrix).inverted() * translate;
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::BrushTransform), inv_matrix);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::BrushTexture), QT_BRUSH_TEXTURE_UNIT);
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index d434725..e561932 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -126,14 +126,12 @@ wince*: {
embedded {
SOURCES += qgl_qws.cpp \
- qglpaintdevice_qws.cpp \
qglpixelbuffer_egl.cpp \
qglscreen_qws.cpp \
qglwindowsurface_qws.cpp \
qgl_egl.cpp
- HEADERS += qglpaintdevice_qws_p.h \
- qglscreen_qws.h \
+ HEADERS += qglscreen_qws.h \
qglwindowsurface_qws_p.h \
qgl_egl_p.h
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 8aef8b4..39f04d4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -76,7 +76,6 @@
#endif
#ifdef Q_WS_QWS
-#include <private/qglpaintdevice_qws_p.h>
#include <private/qglwindowsurface_qws_p.h>
#endif
@@ -1978,6 +1977,32 @@ GLuint QGLContext::bindTexture(const QString &fileName)
return tx_id;
}
+static inline QRgb qt_gl_convertToGLFormatHelper(QRgb src_pixel, GLenum texture_format)
+{
+ if (texture_format == GL_BGRA) {
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return ((src_pixel << 24) & 0xff000000)
+ | ((src_pixel >> 24) & 0x000000ff)
+ | ((src_pixel << 8) & 0x00ff0000)
+ | ((src_pixel >> 8) & 0x0000ff00);
+ } else {
+ return src_pixel;
+ }
+ } else { // GL_RGBA
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (src_pixel << 8) | ((src_pixel >> 24) & 0xff);
+ } else {
+ return ((src_pixel << 16) & 0xff0000)
+ | ((src_pixel >> 16) & 0xff)
+ | (src_pixel & 0xff00ff00);
+ }
+ }
+}
+
+QRgb qt_gl_convertToGLFormat(QRgb src_pixel, GLenum texture_format)
+{
+ return qt_gl_convertToGLFormatHelper(src_pixel, texture_format);
+}
static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum texture_format)
{
@@ -2006,25 +2031,7 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu
const uint *src = (const quint32 *) (srcPixels - (srcy >> 16) * sbpl);
int srcx = basex;
for (int x=0; x<target_width; ++x) {
- uint src_pixel = src[srcx >> 16];
- if (texture_format == GL_BGRA) {
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- dest[x] = ((src_pixel << 24) & 0xff000000)
- | ((src_pixel >> 24) & 0x000000ff)
- | ((src_pixel << 8) & 0x00ff0000)
- | ((src_pixel >> 8) & 0x0000ff00);
- } else {
- dest[x] = src_pixel;
- }
- } else { // GL_RGBA
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- dest[x] = (src_pixel << 8) | ((src_pixel >> 24) & 0xff);
- } else {
- dest[x] = ((src_pixel << 16) & 0xff0000)
- | ((src_pixel >> 16) & 0xff)
- | (src_pixel & 0xff00ff00);
- }
- }
+ dest[x] = qt_gl_convertToGLFormatHelper(src[srcx >> 16], texture_format);
srcx += ix;
}
dest = (quint32 *)(((uchar *) dest) + dbpl);
@@ -2352,7 +2359,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
#if defined(Q_WS_X11)
// Try to use texture_from_pixmap
- if (pd->classId() == QPixmapData::X11Class) {
+ if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType) {
texture = bindTextureFromNativePixmap(pd, key, options);
if (texture) {
texture->options |= QGLContext::MemoryManagedBindOption;
@@ -4735,16 +4742,19 @@ Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_2_engine)
Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_engine)
#endif
-#ifdef Q_WS_QWS
Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine()
{
-#if !defined(QT_OPENGL_ES_2)
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
return qt_gl_engine();
+#elif defined(QT_OPENGL_ES_2)
+ return qt_gl_2_engine();
#else
- return 0; // XXX
+ if (qt_gl_preferGL2Engine())
+ return qt_gl_2_engine();
+ else
+ return qt_gl_engine();
#endif
}
-#endif
/*!
\internal
@@ -4754,16 +4764,7 @@ Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine()
*/
QPaintEngine *QGLWidget::paintEngine() const
{
-#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
- return qt_gl_engine();
-#elif defined(QT_OPENGL_ES_2)
- return qt_gl_2_engine();
-#else
- if (qt_gl_preferGL2Engine())
- return qt_gl_2_engine();
- else
- return qt_gl_engine();
-#endif
+ return qt_qgl_paint_engine();
}
#ifdef QT3_SUPPORT
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 8d4f673..129e7f7 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -505,9 +505,7 @@ private:
};
-#ifdef Q_WS_QWS
-extern QPaintEngine* qt_qgl_paint_engine();
-#endif
+extern Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine();
bool qt_gl_preferGL2Engine();
diff --git a/src/opengl/qgl_qws.cpp b/src/opengl/qgl_qws.cpp
index bb23ace..5e59975 100644
--- a/src/opengl/qgl_qws.cpp
+++ b/src/opengl/qgl_qws.cpp
@@ -73,7 +73,8 @@ static QGLScreen *glScreenForDevice(QPaintDevice *device)
screenNumber = 0;
screen = screen->subScreens()[screenNumber];
}
- while (screen->classId() == QScreen::ProxyClass) {
+ while (screen->classId() == QScreen::ProxyClass ||
+ screen->classId() == QScreen::TransformedClass) {
screen = static_cast<QProxyScreen *>(screen)->screen();
}
if (screen->classId() == QScreen::GLClass)
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 8fc95cf..7374594 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -331,8 +331,22 @@ void QGLFBOGLPaintDevice::setFBO(QGLFramebufferObject* f,
}
}
+QGLContext *QGLFBOGLPaintDevice::context() const
+{
+ QGLContext *fboContext = const_cast<QGLContext *>(fbo->d_ptr->fbo_guard.context());
+ QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
+
+ if (QGLContextPrivate::contextGroup(fboContext) == QGLContextPrivate::contextGroup(currentContext))
+ return currentContext;
+ else
+ return fboContext;
+}
+
void QGLFBOGLPaintDevice::ensureActiveTarget()
{
+ if (QGLContext::currentContext() != context())
+ context()->makeCurrent();
+
QGLContext* ctx = const_cast<QGLContext*>(QGLContext::currentContext());
Q_ASSERT(ctx);
const GLuint fboId = fbo->d_func()->fbo();
@@ -344,6 +358,9 @@ void QGLFBOGLPaintDevice::ensureActiveTarget()
void QGLFBOGLPaintDevice::beginPaint()
{
+ if (QGLContext::currentContext() != context())
+ context()->makeCurrent();
+
// We let QFBO track the previously bound FBO rather than doing it
// ourselves here. This has the advantage that begin/release & bind/end
// work as expected.
@@ -1189,7 +1206,8 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const
bool QGLFramebufferObject::isBound() const
{
Q_D(const QGLFramebufferObject);
- return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo();
+ const QGLContext *current = QGLContext::currentContext();
+ return current ? current->d_ptr->current_fbo == d->fbo() : false;
}
/*!
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index 9fe80b8..122c42e 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -109,7 +109,7 @@ class QGLFBOGLPaintDevice : public QGLPaintDevice
public:
virtual QPaintEngine* paintEngine() const {return fbo->paintEngine();}
virtual QSize size() const {return fbo->size();}
- virtual QGLContext* context() const {return const_cast<QGLContext *>(QGLContext::currentContext());}
+ virtual QGLContext* context() const;
virtual QGLFormat format() const {return fboFormat;}
virtual void ensureActiveTarget();
virtual void beginPaint();
diff --git a/src/opengl/qglpaintdevice_p.h b/src/opengl/qglpaintdevice_p.h
index 1e7ba8d..63ba5da 100644
--- a/src/opengl/qglpaintdevice_p.h
+++ b/src/opengl/qglpaintdevice_p.h
@@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
-class QGLPaintDevice : public QPaintDevice
+class Q_OPENGL_EXPORT QGLPaintDevice : public QPaintDevice
{
public:
QGLPaintDevice();
diff --git a/src/opengl/qglpaintdevice_qws.cpp b/src/opengl/qglpaintdevice_qws.cpp
deleted file mode 100644
index 600efa6..0000000
--- a/src/opengl/qglpaintdevice_qws.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qglpaintdevice_qws_p.h>
-#include <private/qgl_p.h>
-#include <private/qpaintengine_opengl_p.h>
-#include <private/qglwindowsurface_qws_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWSGLPaintDevicePrivate
-{
-public:
- QWidget *widget;
-};
-
-class QMetricAccessor : public QWidget {
-public:
- int metric(PaintDeviceMetric m) {
- return QWidget::metric(m);
- }
-};
-
-QWSGLPaintDevice::QWSGLPaintDevice(QWidget *widget) :
- d_ptr(new QWSGLPaintDevicePrivate)
-{
- Q_D(QWSGLPaintDevice);
- d->widget = widget;
-}
-
-QWSGLPaintDevice::~QWSGLPaintDevice()
-{
-}
-
-QPaintEngine* QWSGLPaintDevice::paintEngine() const
-{
-#if !defined(QT_OPENGL_ES_2)
- return qt_qgl_paint_engine();
-#else
- return 0; // XXX
-#endif
-}
-
-int QWSGLPaintDevice::metric(PaintDeviceMetric m) const
-{
- Q_D(const QWSGLPaintDevice);
- Q_ASSERT(d->widget);
-
- return ((QMetricAccessor *) d->widget)->metric(m);
-}
-
-QWSGLWindowSurface* QWSGLPaintDevice::windowSurface() const
-{
- Q_D(const QWSGLPaintDevice);
- return static_cast<QWSGLWindowSurface*>(d->widget->windowSurface());
-}
-
-QT_END_NAMESPACE
diff --git a/src/opengl/qglpaintdevice_qws_p.h b/src/opengl/qglpaintdevice_qws_p.h
deleted file mode 100644
index 6dc9d31..0000000
--- a/src/opengl/qglpaintdevice_qws_p.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWSGLPAINTDEVICE_GL_P_H
-#define QWSGLPAINTDEVICE_GL_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 QGLWindowSurface class. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qscopedpointer.h>
-#include <QPaintDevice>
-
-QT_BEGIN_NAMESPACE
-
-class QWidget;
-class QWSGLWindowSurface;
-class QWSGLPaintDevicePrivate;
-
-class Q_OPENGL_EXPORT QWSGLPaintDevice : public QPaintDevice
-{
- Q_DECLARE_PRIVATE(QWSGLPaintDevice)
-public:
- QWSGLPaintDevice(QWidget *widget);
- ~QWSGLPaintDevice();
-
- QPaintEngine *paintEngine() const;
-
- int metric(PaintDeviceMetric m) const;
-
- QWSGLWindowSurface *windowSurface() const;
-
-private:
- friend class QWSGLWindowSurface;
- QScopedPointer<QWSGLPaintDevicePrivate> d_ptr;
-};
-
-
-QT_END_NAMESPACE
-
-#endif // QWSGLPAINTDEVICE_GL_P_H
diff --git a/src/opengl/qglwindowsurface_qws.cpp b/src/opengl/qglwindowsurface_qws.cpp
index 6bf3257..5041cb9 100644
--- a/src/opengl/qglwindowsurface_qws.cpp
+++ b/src/opengl/qglwindowsurface_qws.cpp
@@ -43,7 +43,6 @@
#include <QtGui/QWidget>
#include <QtOpenGL/QGLWidget>
#include "private/qglwindowsurface_qws_p.h"
-#include "private/qglpaintdevice_qws_p.h"
#include "private/qpaintengine_opengl_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 3e4a8e7..80628a2 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -66,7 +66,6 @@
#include "util/fragmentprograms_p.h"
#ifdef Q_WS_QWS
-#include "private/qglpaintdevice_qws_p.h"
#include "private/qglwindowsurface_qws_p.h"
#include "qwsmanager_qws.h"
#include "private/qwsmanager_p.h"
@@ -1222,7 +1221,7 @@ inline void QOpenGLPaintEnginePrivate::setGradientOps(const QBrush &brush, const
fragment_brush = FRAGMENT_PROGRAM_BRUSH_CONICAL;
else if (current_style == Qt::SolidPattern)
fragment_brush = FRAGMENT_PROGRAM_BRUSH_SOLID;
- else if (current_style == Qt::TexturePattern)
+ else if (current_style == Qt::TexturePattern && !brush.texture().isQBitmap())
fragment_brush = FRAGMENT_PROGRAM_BRUSH_TEXTURE;
else
fragment_brush = FRAGMENT_PROGRAM_BRUSH_PATTERN;
@@ -1596,7 +1595,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
qreal realRadius = g->radius();
QTransform translate(1, 0, 0, 1, -realFocal.x(), -realFocal.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
setInvMatrixData(inv_matrix);
@@ -1609,7 +1609,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
QPointF realCenter = g->center();
QTransform translate(1, 0, 0, 1, -realCenter.x(), -realCenter.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
setInvMatrixData(inv_matrix);
@@ -1621,8 +1622,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
QPointF realFinal = g->finalStop();
QTransform translate(1, 0, 0, 1, -realStart.x(), -realStart.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
-
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
setInvMatrixData(inv_matrix);
@@ -1633,10 +1634,9 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF
linear_data[2] = 1.0f / (l.x() * l.x() + l.y() * l.y());
} else if (style != Qt::SolidPattern) {
- QTransform translate(1, 0, 0, 1, brush_origin.x(), brush_origin.y());
QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
-
- QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate;
+ QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y());
+ QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted();
setInvMatrixData(inv_matrix);
}
@@ -4310,6 +4310,16 @@ void QOpenGLPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QR
void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &offset)
{
Q_D(QOpenGLPaintEngine);
+ if (pm.depth() == 1) {
+ QPixmap tpx(pm.size());
+ tpx.fill(Qt::transparent);
+ QPainter p(&tpx);
+ p.setPen(d->cpen);
+ p.drawPixmap(0, 0, pm);
+ p.end();
+ drawTiledPixmap(r, tpx, offset);
+ return;
+ }
QImage scaled;
const int sz = d->max_texture_size;
@@ -5206,7 +5216,7 @@ void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType *
device->context()->d_func()->bindTexture(cbrush.textureImage(), GL_TEXTURE_2D, GL_RGBA,
QGLContext::InternalBindOption);
else
- device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, true),
+ device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, false),
GL_TEXTURE_2D, GL_RGBA,
QGLContext::InternalBindOption);
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index cbb310b..83ebece 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -240,6 +240,11 @@ QGLPixmapData::~QGLPixmapData()
}
}
+QPixmapData *QGLPixmapData::createCompatiblePixmapData() const
+{
+ return new QGLPixmapData(pixelType());
+}
+
bool QGLPixmapData::isValid() const
{
return w > 0 && h > 0;
@@ -421,6 +426,10 @@ QImage QGLPixmapData::fillImage(const QColor &color) const
if (pixelType() == BitmapType) {
img = QImage(w, h, QImage::Format_MonoLSB);
+ img.setNumColors(2);
+ img.setColor(0, QColor(Qt::color0).rgba());
+ img.setColor(1, QColor(Qt::color1).rgba());
+
if (color == Qt::color1)
img.fill(1);
else
@@ -559,6 +568,7 @@ QPaintEngine* QGLPixmapData::paintEngine() const
return m_source.paintEngine();
}
+extern QRgb qt_gl_convertToGLFormat(QRgb src_pixel, GLenum texture_format);
// If copyBack is true, bind will copy the contents of the render
// FBO to the texture (which is not bound to the texture, as it's
@@ -568,17 +578,26 @@ GLuint QGLPixmapData::bind(bool copyBack) const
if (m_renderFbo && copyBack) {
copyBackFromRenderFbo(true);
} else {
- if (m_hasFillColor) {
- m_dirty = true;
- m_source = QImage(w, h, QImage::Format_ARGB32_Premultiplied);
- m_source.fill(PREMUL(m_fillColor.rgba()));
- m_hasFillColor = false;
- }
ensureCreated();
}
GLuint id = m_texture.id;
glBindTexture(GL_TEXTURE_2D, id);
+
+ if (m_hasFillColor) {
+ if (!useFramebufferObjects()) {
+ m_source = QImage(w, h, QImage::Format_ARGB32_Premultiplied);
+ m_source.fill(PREMUL(m_fillColor.rgba()));
+ }
+
+ m_hasFillColor = false;
+
+ GLenum format = qt_gl_preferredTextureFormat();
+ QImage tx(w, h, QImage::Format_ARGB32_Premultiplied);
+ tx.fill(qt_gl_convertToGLFormat(m_fillColor.rgba(), format));
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, format, GL_UNSIGNED_BYTE, tx.bits());
+ }
+
return id;
}
diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h
index f67a7c2..6190d38 100644
--- a/src/opengl/qpixmapdata_gl_p.h
+++ b/src/opengl/qpixmapdata_gl_p.h
@@ -101,6 +101,8 @@ public:
QGLPixmapData(PixelType type);
~QGLPixmapData();
+ QPixmapData *createCompatiblePixmapData() const;
+
// Re-implemented from QPixmapData:
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 7f8577a..2816eca 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -280,22 +280,12 @@ QGLContext* QGLWindowSurfaceGLPaintDevice::context() const
int QGLWindowSurfaceGLPaintDevice::metric(PaintDeviceMetric m) const
{
- return d->q_ptr->window()->metric(m);
+ return qt_paint_device_metric(d->q_ptr->window(), m);
}
-Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_2_engine)
-
-#if !defined (QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_engine)
-#endif
-
QPaintEngine *QGLWindowSurfaceGLPaintDevice::paintEngine() const
{
-#if !defined(QT_OPENGL_ES_2)
- if (!qt_gl_preferGL2Engine())
- return qt_gl_window_surface_engine();
-#endif
- return qt_gl_window_surface_2_engine();
+ return qt_qgl_paint_engine();
}
QGLWindowSurface::QGLWindowSurface(QWidget *window)
@@ -428,6 +418,12 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
return;
}
+ //### Find out why d_ptr->geometry_updated isn't always false.
+ // flush() should not be called when d_ptr->geometry_updated is true. It assumes that either
+ // d_ptr->fbo or d_ptr->pb is allocated and has the correct size.
+ if (d_ptr->geometry_updated)
+ return;
+
QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget();
Q_ASSERT(parent);
diff --git a/src/opengl/util/composition_mode_colorburn.glsl b/src/opengl/util/composition_mode_colorburn.glsl
index a5a153f..c913b97 100644
--- a/src/opengl/util/composition_mode_colorburn.glsl
+++ b/src/opengl/util/composition_mode_colorburn.glsl
@@ -5,8 +5,8 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = mix(src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
- src.a * (src.rgb * dst.a + dst.rgb * src.a - src.a * dst.a) / max(src.rgb, 0.00001) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ result.rgb = mix(src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),
+ src.a * (src.rgb * dst.a + dst.rgb * src.a - src.a * dst.a) / max(src.rgb, 0.00001) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),
step(src.a * dst.a, src.rgb * dst.a + dst.rgb * src.a));
result.a = src.a + dst.a - src.a * dst.a;
return result;
diff --git a/src/opengl/util/composition_mode_colordodge.glsl b/src/opengl/util/composition_mode_colordodge.glsl
index c194441..b75e83c 100644
--- a/src/opengl/util/composition_mode_colordodge.glsl
+++ b/src/opengl/util/composition_mode_colordodge.glsl
@@ -5,8 +5,8 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- vec3 temp = src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
- result.rgb = mix(dst.rgb * src.a / max(1 - src.rgb / max(src.a, 0.000001), 0.000001) + temp,
+ vec3 temp = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
+ result.rgb = mix(dst.rgb * src.a / max(1.0 - src.rgb / max(src.a, 0.000001), 0.000001) + temp,
src.a * dst.a + temp,
step(src.a * dst.a, src.rgb * dst.a + dst.rgb * src.a));
diff --git a/src/opengl/util/composition_mode_darken.glsl b/src/opengl/util/composition_mode_darken.glsl
index c1e83fd..8bbb82b 100644
--- a/src/opengl/util/composition_mode_darken.glsl
+++ b/src/opengl/util/composition_mode_darken.glsl
@@ -3,7 +3,7 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = min(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.rgb = min(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/composition_mode_difference.glsl b/src/opengl/util/composition_mode_difference.glsl
index ca13ce7..3c46ec7 100644
--- a/src/opengl/util/composition_mode_difference.glsl
+++ b/src/opengl/util/composition_mode_difference.glsl
@@ -3,7 +3,7 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = src.rgb + dst.rgb - 2 * min(src.rgb * dst.a, dst.rgb * src.a);
+ result.rgb = src.rgb + dst.rgb - 2.0 * min(src.rgb * dst.a, dst.rgb * src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/composition_mode_exclusion.glsl b/src/opengl/util/composition_mode_exclusion.glsl
index ccd1183..59c2da9 100644
--- a/src/opengl/util/composition_mode_exclusion.glsl
+++ b/src/opengl/util/composition_mode_exclusion.glsl
@@ -3,7 +3,7 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = (src.rgb * dst.a + dst.rgb * src.a - 2 * src.rgb * dst.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.rgb = (src.rgb * dst.a + dst.rgb * src.a - 2.0 * src.rgb * dst.rgb) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/composition_mode_hardlight.glsl b/src/opengl/util/composition_mode_hardlight.glsl
index 9dd4de3..4ea3550 100644
--- a/src/opengl/util/composition_mode_hardlight.glsl
+++ b/src/opengl/util/composition_mode_hardlight.glsl
@@ -5,9 +5,9 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = mix(2 * src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
- src.a * dst.a - 2 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
- step(src.a, 2 * src.rgb));
+ result.rgb = mix(2.0 * src.rgb * dst.rgb + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),
+ src.a * dst.a - 2.0 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),
+ step(src.a, 2.0 * src.rgb));
result.a = src.a + dst.a - src.a * dst.a;
return result;
diff --git a/src/opengl/util/composition_mode_lighten.glsl b/src/opengl/util/composition_mode_lighten.glsl
index 1fbd27a..13ef507 100644
--- a/src/opengl/util/composition_mode_lighten.glsl
+++ b/src/opengl/util/composition_mode_lighten.glsl
@@ -3,7 +3,7 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = max(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.rgb = max(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/composition_mode_multiply.glsl b/src/opengl/util/composition_mode_multiply.glsl
index 268345a..f90b7f0 100644
--- a/src/opengl/util/composition_mode_multiply.glsl
+++ b/src/opengl/util/composition_mode_multiply.glsl
@@ -3,7 +3,7 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.rgb = src.rgb * dst.rgb + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/composition_mode_overlay.glsl b/src/opengl/util/composition_mode_overlay.glsl
index a9b7226..f621bde 100644
--- a/src/opengl/util/composition_mode_overlay.glsl
+++ b/src/opengl/util/composition_mode_overlay.glsl
@@ -5,9 +5,9 @@
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
- result.rgb = mix(2 * src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
- src.a * dst.a - 2 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
- step(dst.a, 2 * dst.rgb));
+ result.rgb = mix(2.0 * src.rgb * dst.rgb + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),
+ src.a * dst.a - 2.0 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a),
+ step(dst.a, 2.0 * dst.rgb));
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/composition_mode_softlight.glsl b/src/opengl/util/composition_mode_softlight.glsl
index 0237827..4777b74 100644
--- a/src/opengl/util/composition_mode_softlight.glsl
+++ b/src/opengl/util/composition_mode_softlight.glsl
@@ -8,11 +8,11 @@ vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
float da = max(dst.a, 0.00001);
- result.rgb = mix(dst.rgb * (src.a - (1 - dst.rgb / da) * (2 * src.rgb - src.a)),
- mix(dst.rgb * (src.a - (1 - dst.rgb / da) * (2 * src.rgb - src.a) * (3 - 8 * dst.rgb / da)),
- (dst.rgb * src.a + (sqrt(dst.rgb / da) * dst.a - dst.rgb) * (2 * src.rgb - src.a)),
- step(dst.a, 8 * dst.rgb)),
- step(src.a, 2 * src.rgb)) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.rgb = mix(dst.rgb * (src.a - (1.0 - dst.rgb / da) * (2.0 * src.rgb - src.a)),
+ mix(dst.rgb * (src.a - (1.0 - dst.rgb / da) * (2.0 * src.rgb - src.a) * (3.0 - 8.0 * dst.rgb / da)),
+ (dst.rgb * src.a + (sqrt(dst.rgb / da) * dst.a - dst.rgb) * (2.0 * src.rgb - src.a)),
+ step(dst.a, 8.0 * dst.rgb)),
+ step(src.a, 2.0 * src.rgb)) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/conical_brush.glsl b/src/opengl/util/conical_brush.glsl
index 83ee2f5..b3ec1d7 100644
--- a/src/opengl/util/conical_brush.glsl
+++ b/src/opengl/util/conical_brush.glsl
@@ -20,7 +20,7 @@ vec4 brush()
/* float val = fmod((atan2(-A.y, A.x) + angle) / (2.0 * M_PI), 1); */
if (abs(A.y) == abs(A.x))
A.y += 0.002;
- float t = (atan2(-A.y, A.x) + angle) / (2.0 * M_PI);
+ float t = (atan(-A.y, A.x) + angle) / (2.0 * M_PI);
float val = t - floor(t);
return texture1D(palette, val);
}
diff --git a/src/opengl/util/ellipse.glsl b/src/opengl/util/ellipse.glsl
deleted file mode 100644
index 860ae77..0000000
--- a/src/opengl/util/ellipse.glsl
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "ellipse_functions.glsl"
-
-void main()
-{
- gl_FragColor = ellipse();
-}
diff --git a/src/opengl/util/ellipse_aa.glsl b/src/opengl/util/ellipse_aa.glsl
index f7a6454..257e3bb 100644
--- a/src/opengl/util/ellipse_aa.glsl
+++ b/src/opengl/util/ellipse_aa.glsl
@@ -1,6 +1,58 @@
-#include "ellipse_functions.glsl"
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+uniform vec2 ellipse_offset;
+
+// ellipse equation
+
+// s^2/a^2 + t^2/b^2 = 1
+//
+// implicit equation:
+// g(s,t) = 1 - s^2/r_s^2 - t^2/r_t^2
+
+// distance from ellipse:
+// grad = [dg/dx dg/dy]
+// d(s, t) ~= g(s, t) / |grad|
+
+// dg/dx = dg/ds * ds/dx + dg/dt * dt/dx
+// dg/dy = dg/ds * ds/dy + dg/dt * dt/dy
+
+float ellipse_aa()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy + ellipse_offset, 1);
+ float inv_w = 1.0 / hcoords.z;
+ vec2 st = hcoords.xy * inv_w;
+
+ vec4 xy = vec4(mat[0].xy, mat[1].xy);
+ vec2 h = vec2(mat[0].z, mat[1].z);
+
+ vec4 dstdxy = (xy.xzyw - h.xyxy * st.xxyy) * inv_w;
+
+ //dstdxy.x = (mat[0].x - mat[0].z * st.x) * inv_w; // ds/dx
+ //dstdxy.y = (mat[1].x - mat[1].z * st.x) * inv_w; // ds/dy
+ //dstdxy.z = (mat[0].y - mat[0].z * st.y) * inv_w; // dt/dx
+ //dstdxy.w = (mat[1].y - mat[1].z * st.y) * inv_w; // dt/dy
+
+ vec2 inv_r = gl_TexCoord[0].xy;
+ vec2 n = st * inv_r;
+ float g = 1.0 - dot(n, n);
+
+ vec2 dgdst = -2.0 * n * inv_r;
+
+ vec2 grad = vec2(dot(dgdst, dstdxy.xz),
+ dot(dgdst, dstdxy.yw));
+
+ return smoothstep(-0.5, 0.5, g * inversesqrt(dot(grad, grad)));
+}
void main()
{
- gl_FragColor = ellipse_aa();
+ gl_FragColor = ellipse_aa().xxxx;
}
diff --git a/src/opengl/util/ellipse_aa_copy.glsl b/src/opengl/util/ellipse_aa_copy.glsl
deleted file mode 100644
index 5372f58..0000000
--- a/src/opengl/util/ellipse_aa_copy.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-uniform vec2 r; // r_x and r_y
-
-uniform sampler2D texture;
-uniform vec2 inv_texture_size;
-
-#include "ellipse_functions.glsl"
-
-void main()
-{
- gl_FragColor = ellipse_aa() * texture2D(texture, gl_FragCoord.xy * inv_texture_size);
-}
diff --git a/src/opengl/util/ellipse_aa_radial.glsl b/src/opengl/util/ellipse_aa_radial.glsl
deleted file mode 100644
index 0878f99..0000000
--- a/src/opengl/util/ellipse_aa_radial.glsl
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "ellipse_functions.glsl"
-
-uniform sampler1D palette;
-uniform vec2 fmp;
-uniform float fmp2_m_radius2;
-uniform vec4 inv_matrix;
-uniform vec2 inv_matrix_offset;
-
-void main()
-{
- // float2 A = frag_coord.xy;//mul(inv_matrix, frag_coord.xy) + inv_matrix_offset;
- mat2 mat;
- mat[0][0] = inv_matrix.x;
- mat[0][1] = inv_matrix.y;
- mat[1][0] = inv_matrix.z;
- mat[1][1] = inv_matrix.w;
- vec2 A = gl_FragCoord.xy * mat + inv_matrix_offset;
- vec2 B = fmp;
- float a = fmp2_m_radius2;
- float b = 2.0*dot(A, B);
- float c = -dot(A, A);
- float val = (-b + sqrt(b*b - 4.0*a*c)) / (2.0*a);
- gl_FragColor = texture1D(palette, val) * ellipse_aa();
-}
diff --git a/src/opengl/util/ellipse_functions.glsl b/src/opengl/util/ellipse_functions.glsl
deleted file mode 100644
index eed18e8..0000000
--- a/src/opengl/util/ellipse_functions.glsl
+++ /dev/null
@@ -1,63 +0,0 @@
-uniform vec3 inv_matrix_m0;
-uniform vec3 inv_matrix_m1;
-uniform vec3 inv_matrix_m2;
-
-uniform vec2 ellipse_offset;
-
-float ellipse()
-{
- vec2 st = gl_TexCoord[0].st;
-
- if (dot(st, st) > 1)
- discard;
-
- return 1.0;
-}
-
-// ellipse equation
-
-// s^2/a^2 + t^2/b^2 = 1
-//
-// implicit equation:
-// g(s,t) = 1 - s^2/r_s^2 - t^2/r_t^2
-
-// distance from ellipse:
-// grad = [dg/dx dg/dy]
-// d(s, t) ~= g(s, t) / |grad|
-
-// dg/dx = dg/ds * ds/dx + dg/dt * dt/dx
-// dg/dy = dg/ds * ds/dy + dg/dt * dt/dy
-
-float ellipse_aa()
-{
- mat3 mat;
-
- mat[0] = inv_matrix_m0;
- mat[1] = inv_matrix_m1;
- mat[2] = inv_matrix_m2;
-
- vec3 hcoords = mat * vec3(gl_FragCoord.xy + ellipse_offset, 1);
- float inv_w = 1.0 / hcoords.z;
- vec2 st = hcoords.xy * inv_w;
-
- vec4 xy = vec4(mat[0].xy, mat[1].xy);
- vec2 h = vec2(mat[0].z, mat[1].z);
-
- vec4 dstdxy = (xy.xzyw - h.xyxy * st.xxyy) * inv_w;
-
- //dstdxy.x = (mat[0].x - mat[0].z * st.x) * inv_w; // ds/dx
- //dstdxy.y = (mat[1].x - mat[1].z * st.x) * inv_w; // ds/dy
- //dstdxy.z = (mat[0].y - mat[0].z * st.y) * inv_w; // dt/dx
- //dstdxy.w = (mat[1].y - mat[1].z * st.y) * inv_w; // dt/dy
-
- vec2 inv_r = gl_TexCoord[0].xy;
- vec2 n = st * inv_r;
- float g = 1.0 - dot(n, n);
-
- vec2 dgdst = -2.0 * n * inv_r;
-
- vec2 grad = vec2(dot(dgdst, dstdxy.xz),
- dot(dgdst, dstdxy.yw));
-
- return smoothstep(-0.5, 0.5, g * inversesqrt(dot(grad, grad)));
-}
diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h
index 340023c..9154c6e 100644
--- a/src/opengl/util/fragmentprograms_p.h
+++ b/src/opengl/util/fragmentprograms_p.h
@@ -38,6 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#ifndef FRAGMENTPROGRAMS_P_H
#define FRAGMENTPROGRAMS_P_H
@@ -131,58 +132,57 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA =
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "ADD R4.x, fragment.position, c[0];\n"
+ "ADD R3.z, fragment.position.x, c[0].x;\n"
"ADD R0.y, fragment.position, -c[0].x;\n"
- "MAX R3.w, fragment.texcoord[0].y, R0.y;\n"
+ "MAX R4.x, fragment.texcoord[0].y, R0.y;\n"
"ADD R0.x, fragment.position.y, c[0];\n"
- "MIN R3.z, R0.x, fragment.texcoord[0].x;\n"
+ "MIN R3.w, R0.x, fragment.texcoord[0].x;\n"
"ADD R2.z, fragment.position.x, -c[0].x;\n"
- "MOV R0.yw, R3.w;\n"
- "MOV R0.xz, R3.z;\n"
- "MAD R1, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n"
- "MAD R1.zw, fragment.position.x, c[0].y, -R1;\n"
- "MOV R0.z, R1.x;\n"
- "MOV R0.w, R1.z;\n"
- "MOV R0.y, R1.w;\n"
- "MOV R0.x, R1.y;\n"
- "MIN R2.xy, R0.zwzw, R0;\n"
- "SGE R1.xy, R0, R0.zwzw;\n"
- "ADD R1.zw, -fragment.texcoord[0], -fragment.texcoord[0];\n"
- "MAX R0.xy, R0.zwzw, R0;\n"
- "MAD R3.xy, R1, R1.zwzw, fragment.texcoord[0].zwzw;\n"
- "MOV R2.w, R4.x;\n"
- "ADD R1, -R2.xxyy, R2.zwzw;\n"
- "MAD R1, R1, R3.xxyy, R3.w;\n"
- "ADD R3.xy, R1.ywzw, R1.xzzw;\n"
- "ADD R4.zw, R3.z, -R1.xyxz;\n"
- "ADD R1.zw, -R3.w, R1.xyyw;\n"
- "ADD R1.xy, R4.x, -R2;\n"
- "MUL R1.xy, R1, R1.zwzw;\n"
- "MAD R3.xy, -R3, c[0].x, R3.z;\n"
- "ADD R2.w, R4.x, -R2.z;\n"
- "MUL R0.zw, R3.xyxy, R2.w;\n"
- "ADD R2.w, R3.z, -R3;\n"
- "ADD R3.xy, -R2.z, R0;\n"
+ "MOV R2.w, R3.z;\n"
+ "MOV R0.yw, R4.x;\n"
+ "MOV R0.xz, R3.w;\n"
+ "MAD R0, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n"
+ "MAD R0.zw, fragment.position.x, c[0].y, -R0;\n"
+ "MOV R2.x, R0;\n"
+ "MOV R2.y, R0.z;\n"
+ "MOV R1.w, R0;\n"
+ "MOV R1.z, R0.y;\n"
+ "MIN R1.xy, R2, R1.zwzw;\n"
+ "SGE R0.xy, R1.zwzw, R2;\n"
+ "ADD R0.zw, -fragment.texcoord[0], -fragment.texcoord[0];\n"
+ "MAD R3.xy, R0, R0.zwzw, fragment.texcoord[0].zwzw;\n"
+ "ADD R0, -R1.xxyy, R2.zwzw;\n"
+ "MAD R0, R0, R3.xxyy, R4.x;\n"
+ "ADD R3.xy, R0.ywzw, R0.xzzw;\n"
+ "ADD R4.zw, R3.w, -R0.xyxz;\n"
+ "ADD R0.zw, -R4.x, R0.xyyw;\n"
+ "ADD R0.xy, R3.z, -R1;\n"
+ "MAX R1.zw, R2.xyxy, R1;\n"
+ "MUL R0.xy, R0, R0.zwzw;\n"
+ "MAD R3.xy, -R3, c[0].x, R3.w;\n"
+ "ADD R2.w, R3.z, -R2.z;\n"
+ "MUL R2.xy, R3, R2.w;\n"
+ "ADD R2.w, R3, -R4.x;\n"
+ "ADD R3.xy, -R2.z, R1.zwzw;\n"
"MUL R3.xy, R4.zwzw, R3;\n"
- "ADD R4.zw, R2.xyxy, R0.xyxy;\n"
- "MAD R1.zw, R4, c[0].x, -R2.z;\n"
- "MAD R1.xy, -R1, c[0].x, R2.w;\n"
- "MAD R4.zw, R2.w, R1, -R1.xyxy;\n"
- "SGE R1.zw, R4.x, R0.xyxy;\n"
- "MAD R3.xy, R3, c[0].x, -R0.zwzw;\n"
- "MAD R1.xy, R1.zwzw, R4.zwzw, R1;\n"
- "MAD R0.zw, R1, R3.xyxy, R0;\n"
- "ADD R1.zw, R0, -R1.xyxy;\n"
- "SGE R0.zw, R2.z, R2.xyxy;\n"
- "MAD R0.zw, R0, R1, R1.xyxy;\n"
- "ADD R0.zw, -R2.w, R0;\n"
- "SGE R1.xy, R4.x, R2;\n"
- "MAD R0.zw, R1.xyxy, R0, R2.w;\n"
- "SGE R0.xy, R0, R2.z;\n"
- "MUL R0.xy, R0.zwzw, R0;\n"
- "ADD R0.x, R2.w, -R0;\n"
- "SGE R0.z, R3, R3.w;\n"
- "ADD R0.x, R0, -R0.y;\n"
+ "ADD R4.zw, R1.xyxy, R1;\n"
+ "MAD R0.zw, R4, c[0].x, -R2.z;\n"
+ "MAD R0.xy, -R0, c[0].x, R2.w;\n"
+ "MAD R4.zw, R0, R2.w, -R0.xyxy;\n"
+ "SGE R0.zw, R3.z, R1;\n"
+ "MAD R0.xy, R0.zwzw, R4.zwzw, R0;\n"
+ "MAD R3.xy, R3, c[0].x, -R2;\n"
+ "MAD R0.zw, R0, R3.xyxy, R2.xyxy;\n"
+ "ADD R2.xy, R0.zwzw, -R0;\n"
+ "SGE R0.zw, R2.z, R1.xyxy;\n"
+ "MAD R0.xy, R0.zwzw, R2, R0;\n"
+ "SGE R0.zw, R1, R2.z;\n"
+ "ADD R0.xy, R0, -R2.w;\n"
+ "SGE R1.xy, R3.z, R1;\n"
+ "MAD R0.xy, R1, R0, R2.w;\n"
+ "MAD R0.x, -R0, R0.z, R2.w;\n"
+ "SGE R0.z, R3.w, R4.x;\n"
+ "MAD R0.x, -R0.y, R0.w, R0;\n"
"MUL result.color, R0.x, R0.z;\n"
"END\n"
;
@@ -200,27 +200,27 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_ELLIPSE_AA =
"MAD R0.xyz, R0.x, c[0], R1;\n"
"ADD R0.xyz, R0, c[2];\n"
"RCP R2.z, R0.z;\n"
- "MUL R1.zw, R0.xyxy, R2.z;\n"
- "MUL R2.xy, R1.zwzw, fragment.texcoord[0];\n"
- "MOV R1.x, c[0].z;\n"
- "MOV R1.y, c[1].z;\n"
- "MOV R0.xy, c[0];\n"
- "MOV R0.zw, c[1].xyxy;\n"
- "MAD R0, R1.zzww, -R1.xyxy, R0.xzyw;\n"
+ "MUL R0.zw, R0.xyxy, R2.z;\n"
+ "MUL R2.xy, R0.zwzw, fragment.texcoord[0];\n"
+ "MOV R1.xy, c[0];\n"
+ "MOV R1.zw, c[1].xyxy;\n"
+ "MOV R0.x, c[0].z;\n"
+ "MOV R0.y, c[1].z;\n"
+ "MAD R0, R0.zzww, -R0.xyxy, R1.xzyw;\n"
"MUL R1.xy, R2, fragment.texcoord[0];\n"
"MUL R0, R2.z, R0;\n"
"MUL R1.xy, R1, c[4].x;\n"
"MUL R1.zw, R1.xyxy, R0.xyxz;\n"
- "MUL R0.xy, R1, R0.ywzw;\n"
- "ADD R0.w, R0.x, R0.y;\n"
- "MUL R0.xy, R2, R2;\n"
- "ADD R0.x, R0, R0.y;\n"
- "ADD R0.z, R1, R1.w;\n"
- "MUL R0.zw, R0, R0;\n"
+ "MUL R0.zw, R1.xyxy, R0.xyyw;\n"
"ADD R0.y, R0.z, R0.w;\n"
- "RSQ R0.y, R0.y;\n"
- "ADD R0.x, -R0, c[4].y;\n"
- "MAD_SAT R0.x, R0.y, R0, -c[4].z;\n"
+ "ADD R0.x, R1.z, R1.w;\n"
+ "MUL R0.xy, R0, R0;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, R2.xyxy, R2.xyxy;\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.y, -R0.z, c[4];\n"
+ "RSQ R0.x, R0.x;\n"
+ "MAD_SAT R0.x, R0, R0.y, -c[4].z;\n"
"MUL R0.y, -R0.x, c[4].w;\n"
"ADD R0.y, R0, c[5].x;\n"
"MUL R0.x, R0, R0;\n"
@@ -407,13 +407,13 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R3;\n"
"MUL R0.xy, fragment.position, c[1];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "ADD R1.y, -fragment.color.primary.w, c[4].x;\n"
- "MAX R1.x, fragment.color.primary.w, c[4].y;\n"
- "MUL R2.xyz, R0, R1.y;\n"
+ "ADD R1.x, -fragment.color.primary.w, c[4];\n"
+ "MAX R1.y, fragment.color.primary.w, c[4];\n"
+ "MUL R2.xyz, R0, R1.x;\n"
"ADD R1.w, -R0, c[4].x;\n"
"MAD R3.xyz, fragment.color.primary, R1.w, R2;\n"
- "RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -fragment.color.primary, R1.x, c[4].x;\n"
+ "RCP R1.y, R1.y;\n"
+ "MAD R1.xyz, -fragment.color.primary, R1.y, c[4].x;\n"
"MAX R1.xyz, R1, c[4].y;\n"
"MUL R2.xyz, fragment.color.primary.w, R0;\n"
"MUL R1.w, fragment.color.primary, R0;\n"
@@ -519,8 +519,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..3],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -529,39 +529,39 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R5;\n"
"MUL R0.xy, fragment.position, c[1];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.x, R0.w, c[4].y;\n"
+ "MAX R1.x, R0.w, c[4].z;\n"
"RCP R1.w, R1.x;\n"
- "MUL R2.xyz, R0, R1.w;\n"
- "MUL R1.xyz, -R2, c[5].x;\n"
- "RSQ R2.w, R2.x;\n"
- "ADD R4.xyz, R1, c[4].w;\n"
+ "MUL R1.xyz, R0, R1.w;\n"
+ "MUL R4.xyz, -R1, c[4].w;\n"
+ "RSQ R2.x, R1.x;\n"
+ "RSQ R2.z, R1.z;\n"
+ "RSQ R2.y, R1.y;\n"
"MAD R1.xyz, -R0, R1.w, c[4].x;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "RCP R2.x, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R5.xyz, R0.w, R2, -R0;\n"
- "MAD R2.xyz, fragment.color.primary, c[4].z, -fragment.color.primary.w;\n"
- "MUL R3.xyz, R1, R2;\n"
- "MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n"
- "MUL R4.xyz, R5, R2;\n"
+ "MAD R3.xyz, R0.w, R2, -R0;\n"
+ "MAD R2.xyz, fragment.color.primary, c[4].y, -fragment.color.primary.w;\n"
+ "MUL R3.xyz, R2, R3;\n"
+ "ADD R5.xyz, R4, c[5].x;\n"
+ "MUL R4.xyz, R1, R2;\n"
"MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
- "MUL R3.xyz, R0, R3;\n"
- "MAD R4.xyz, fragment.color.primary.w, R0, R4;\n"
- "ADD R5.xyz, R4, -R3;\n"
- "MUL R4.xyz, R0, c[5].x;\n"
- "SGE R2.xyz, R4, R0.w;\n"
- "MAD R2.xyz, R2, R5, R3;\n"
+ "MUL R2.xyz, fragment.color.primary, c[4].y;\n"
+ "MAD R5.xyz, -R4, R5, fragment.color.primary.w;\n"
+ "MAD R3.xyz, fragment.color.primary.w, R0, R3;\n"
+ "MAD R4.xyz, -R0, R5, R3;\n"
+ "MUL R3.xyz, R0, c[4].w;\n"
+ "MUL R5.xyz, R0, R5;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MAD R3.xyz, R3, R4, R5;\n"
+ "MAD R3.xyz, -R0, R1, R3;\n"
"MUL R1.xyz, R0, R1;\n"
- "MUL R3.xyz, fragment.color.primary, c[4].z;\n"
- "ADD R2.xyz, R2, -R1;\n"
- "SGE R3.xyz, R3, fragment.color.primary.w;\n"
- "MAD R1.xyz, R3, R2, R1;\n"
- "ADD R1.w, -R0, c[4].x;\n"
- "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
- "ADD R1.w, -fragment.color.primary, c[4].x;\n"
- "MAD R2.xyz, R0, R1.w, R1;\n"
+ "SGE R2.xyz, R2, fragment.color.primary.w;\n"
+ "MAD R2.xyz, R2, R3, R1;\n"
+ "ADD R1.x, -R0.w, c[4];\n"
+ "MAD R2.xyz, fragment.color.primary, R1.x, R2;\n"
+ "ADD R1.x, -fragment.color.primary.w, c[4];\n"
+ "MAD R2.xyz, R0, R1.x, R2;\n"
"ADD R1.z, fragment.color.primary.w, R0.w;\n"
"MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
"ADD R1.xy, fragment.position, c[2];\n"
@@ -861,8 +861,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[3] = { program.local[0],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -871,41 +871,41 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R5;\n"
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.x, R0.w, c[1].y;\n"
+ "MAX R1.x, R0.w, c[1].z;\n"
"RCP R1.w, R1.x;\n"
- "MUL R2.xyz, R0, R1.w;\n"
- "MUL R1.xyz, -R2, c[2].x;\n"
- "ADD R4.xyz, R1, c[1].w;\n"
- "MAD R1.xyz, -R0, R1.w, c[1].x;\n"
- "RSQ R2.w, R2.x;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "RCP R2.x, R2.w;\n"
+ "MUL R1.xyz, R0, R1.w;\n"
+ "MUL R4.xyz, -R1, c[1].w;\n"
+ "RSQ R2.x, R1.x;\n"
+ "RSQ R2.z, R1.z;\n"
+ "RSQ R2.y, R1.y;\n"
+ "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R5.xyz, R0.w, R2, -R0;\n"
- "MAD R2.xyz, fragment.color.primary, c[1].z, -fragment.color.primary.w;\n"
- "MUL R3.xyz, R1, R2;\n"
- "MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n"
- "MUL R4.xyz, R5, R2;\n"
+ "MAD R3.xyz, R0.w, R2, -R0;\n"
+ "MAD R2.xyz, fragment.color.primary, c[1].y, -fragment.color.primary.w;\n"
+ "MUL R3.xyz, R2, R3;\n"
+ "MAD R3.xyz, fragment.color.primary.w, R0, R3;\n"
+ "MAD R1.xyz, -R0, R1.w, c[1].x;\n"
+ "ADD R5.xyz, R4, c[2].x;\n"
+ "MUL R4.xyz, R1, R2;\n"
"MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
- "MUL R3.xyz, R0, R3;\n"
- "MAD R4.xyz, fragment.color.primary.w, R0, R4;\n"
- "ADD R5.xyz, R4, -R3;\n"
- "MUL R4.xyz, R0, c[2].x;\n"
- "SGE R2.xyz, R4, R0.w;\n"
- "MAD R2.xyz, R2, R5, R3;\n"
+ "MAD R5.xyz, -R4, R5, fragment.color.primary.w;\n"
+ "MAD R4.xyz, -R0, R5, R3;\n"
+ "MUL R3.xyz, R0, c[1].w;\n"
+ "MUL R2.xyz, fragment.color.primary, c[1].y;\n"
+ "MUL R5.xyz, R0, R5;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MAD R3.xyz, R3, R4, R5;\n"
+ "MAD R3.xyz, -R0, R1, R3;\n"
"MUL R1.xyz, R0, R1;\n"
- "MUL R3.xyz, fragment.color.primary, c[1].z;\n"
- "ADD R2.xyz, R2, -R1;\n"
- "SGE R3.xyz, R3, fragment.color.primary.w;\n"
- "MAD R1.xyz, R3, R2, R1;\n"
- "ADD R1.w, -R0, c[1].x;\n"
- "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
- "ADD R1.w, fragment.color.primary, R0;\n"
- "ADD R2.x, -fragment.color.primary.w, c[1];\n"
- "MAD result.color.xyz, R0, R2.x, R1;\n"
- "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "SGE R2.xyz, R2, fragment.color.primary.w;\n"
+ "MAD R2.xyz, R2, R3, R1;\n"
+ "ADD R1.x, -R0.w, c[1];\n"
+ "MAD R2.xyz, fragment.color.primary, R1.x, R2;\n"
+ "ADD R1.x, fragment.color.primary.w, R0.w;\n"
+ "ADD R1.y, -fragment.color.primary.w, c[1].x;\n"
+ "MAD result.color.xyz, R0, R1.y, R2;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1.x;\n"
"END\n"
;
@@ -1085,18 +1085,18 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"ADD R0.z, R0, R0.w;\n"
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MOV R0.x, c[9];\n"
"MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
"ADD R3.xy, fragment.position, c[7];\n"
- "MUL R0.y, R0.z, c[9];\n"
- "MUL R0.x, R0, c[9];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[9].x;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, R0.x, R0.y;\n"
+ "RCP R0.x, R0.z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.z, R0.x, R0;\n"
"TEX R1, R0.z, texture[2], 1D;\n"
"MUL R0.xy, fragment.position, c[6];\n"
"TEX R0, R0, texture[0], 2D;\n"
@@ -1125,24 +1125,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MOV R0.x, c[9];\n"
"MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
"MUL R1.xy, fragment.position, c[6];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "MUL R0.y, R0.z, c[9];\n"
- "MUL R0.x, R0, c[9];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[9].x;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
+ "RCP R0.x, R0.z;\n"
"ADD R2.w, -R1, c[9].z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
@@ -1283,20 +1283,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MOV R0.x, c[9];\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[9];\n"
- "MUL R0.x, R0, c[9];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "RCP R0.x, R0.z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
"TEX R0, R0, texture[2], 1D;\n"
"MAX R1.x, R0.w, c[9].w;\n"
"RCP R1.x, R1.x;\n"
@@ -1350,17 +1350,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[9];\n"
- "MUL R0.x, R0, c[9];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[9].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
"MUL R2.xyz, R0.w, R1;\n"
@@ -1408,24 +1408,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MOV R0.x, c[9];\n"
"MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
"MUL R1.xy, fragment.position, c[6];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "MUL R0.y, R0.z, c[9];\n"
- "MUL R0.x, R0, c[9];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[9].x;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
+ "RCP R0.x, R0.z;\n"
"ADD R2.w, -R1, c[9].z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
@@ -1457,7 +1457,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..8],\n"
" { 2, 4, 1, 9.9999997e-006 },\n"
- " { 3, 8 } };\n"
+ " { 8, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -1469,65 +1469,65 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R0.xyz, fragment.position.x, c[2], R0;\n"
"ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MAX R0.w, R1, c[9];\n"
+ "RCP R2.w, R0.w;\n"
+ "MUL R5.xyz, R1, R2.w;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MOV R0.x, c[9];\n"
+ "RSQ R2.x, R5.x;\n"
+ "RSQ R2.z, R5.z;\n"
+ "RSQ R2.y, R5.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[9];\n"
- "MUL R0.x, R0, c[9];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[9].x;\n"
- "MUL R1.y, R0.z, c[1].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "ADD R1.x, -R0, R0.y;\n"
- "RCP R1.y, R1.y;\n"
- "MUL R0.xy, fragment.position, c[6];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.z, R0.w, c[9].w;\n"
- "RCP R2.w, R1.z;\n"
- "MUL R2.xyz, R0, R2.w;\n"
- "MAD R6.xyz, -R2, c[10].y, c[10].x;\n"
- "MAD R3.xyz, -R0, R2.w, c[9].z;\n"
- "RSQ R2.w, R2.x;\n"
- "RCP R2.x, R2.w;\n"
- "MUL R1.x, R1, R1.y;\n"
- "TEX R1, R1, texture[2], 1D;\n"
- "MAD R4.xyz, R1, c[9].x, -R1.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R5.xyz, -R5, R6, R1.w;\n"
- "MAD R3.xyz, -R3, R4, R1.w;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MUL R5.xyz, R0, R5;\n"
- "MUL R3.xyz, R0, R3;\n"
- "ADD R2.w, -R0, c[9].z;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
+ "RSQ R0.z, R0.z;\n"
+ "RCP R0.x, R0.z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAD R3.xyz, R0, c[9].x, -R0.w;\n"
+ "MAD R6.xyz, -R5, c[10].x, c[10].y;\n"
+ "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R0.w, R2, -R0;\n"
- "MUL R2.xyz, R2, R4;\n"
- "MAD R2.xyz, R1.w, R0, R2;\n"
- "ADD R6.xyz, R2, -R5;\n"
- "MUL R4.xyz, R1, c[9].x;\n"
- "MUL R2.xyz, R0, c[10].y;\n"
- "SGE R2.xyz, R2, R0.w;\n"
- "MAD R2.xyz, R2, R6, R5;\n"
+ "MAD R2.xyz, R1.w, R2, -R1;\n"
+ "MUL R2.xyz, R3, R2;\n"
+ "MAD R4.xyz, R0.w, R1, R2;\n"
+ "MAD R2.xyz, -R1, R2.w, c[9].z;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MUL R3.xyz, R0, c[9].x;\n"
+ "MUL R4.xyz, R1, c[10].x;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
+ "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "MAD R2.xyz, R4, R2, R3;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[9].z;\n"
- "MAD R2.xyz, R0, R2.x, R1;\n"
- "ADD R1.z, R1.w, R0.w;\n"
- "MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[7];\n"
- "MUL R1.xy, R1, c[5];\n"
- "TEX R1, R1, texture[1], 2D;\n"
- "ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[8];\n"
- "MAD result.color, R1.x, R2, R0;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, -R0.w, c[9].z;\n"
+ "MAD R2.xyz, R1, R0.x, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, R0, c[5];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[8];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -1642,23 +1642,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[8];\n"
- "MUL R0.x, R0, c[8];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.z, R0.y;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.y, R0.x, c[8].x;\n"
+ "MUL R0.z, R0, c[8].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.x, R0.x;\n"
+ "RCP R0.z, R0.x;\n"
+ "ADD R0.y, -R0, R0.z;\n"
"MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
"MUL R2.xyz, R1, c[5].y;\n"
- "MOV R0.y, c[8].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "MOV R0.x, c[8];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R0.x, R0.x;\n"
+ "MUL R0.x, R0.y, R0;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R3.xyz, R0.w, R2;\n"
"MUL R2.xyz, R0, c[5].x;\n"
@@ -1689,22 +1689,22 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.z, R0.y;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.x, R0.x;\n"
+ "RCP R0.z, R0.x;\n"
+ "ADD R0.y, -R0, R0.z;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R0.x, R0.x;\n"
+ "MUL R0.x, R0.y, R0;\n"
"TEX R0, R0, texture[1], 1D;\n"
"ADD R2.x, -R1.w, c[6].z;\n"
"MUL R2.xyz, R0, R2.x;\n"
@@ -1733,16 +1733,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
@@ -1765,27 +1765,27 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MOV R0.x, c[6];\n"
"MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
"MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[6].x;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "RCP R0.x, R0.z;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[6].z;\n"
"MUL R2.xyz, R2, c[6].x;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
@@ -1822,17 +1822,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
@@ -1865,17 +1865,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
@@ -1904,20 +1904,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MOV R0.x, c[6];\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "RCP R0.x, R0.z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MAX R1.x, R0.w, c[6].w;\n"
"RCP R1.x, R1.x;\n"
@@ -1965,17 +1965,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0.w, R1;\n"
@@ -2017,24 +2017,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MOV R0.x, c[6];\n"
"MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
"MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.z, R0.x, R0.x, -R0.y;\n"
- "MOV R0.y, c[6].x;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RSQ R0.z, R0.z;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[1], 1D;\n"
+ "RCP R0.x, R0.z;\n"
"ADD R2.w, -R1, c[6].z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
@@ -2060,7 +2060,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..5],\n"
" { 2, 4, 1, 9.9999997e-006 },\n"
- " { 3, 8 } };\n"
+ " { 8, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2072,59 +2072,59 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R0.xyz, fragment.position.x, c[2], R0;\n"
"ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MAX R0.w, R1, c[6];\n"
+ "RCP R2.w, R0.w;\n"
+ "MUL R5.xyz, R1, R2.w;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MOV R0.x, c[6];\n"
+ "RSQ R2.x, R5.x;\n"
+ "RSQ R2.z, R5.z;\n"
+ "RSQ R2.y, R5.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MAX R0.z, R1.w, c[6].w;\n"
- "RCP R2.w, R0.z;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "MAD R6.xyz, -R2, c[7].y, c[7].x;\n"
- "MAD R3.xyz, -R1, R2.w, c[6].z;\n"
- "RSQ R2.w, R2.x;\n"
- "RCP R2.x, R2.w;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "ADD R0.x, -R0, R0.y;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.z, R0.y, R0.y, -R0;\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
+ "RSQ R0.z, R0.z;\n"
+ "RCP R0.x, R0.z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0.y, R0;\n"
+ "MUL R0.x, R0, R0.z;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R4.xyz, R0, c[6].x, -R0.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R5.xyz, -R5, R6, R0.w;\n"
- "MAD R3.xyz, -R3, R4, R0.w;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MUL R5.xyz, R1, R5;\n"
- "MUL R3.xyz, R1, R3;\n"
+ "MAD R3.xyz, R0, c[6].x, -R0.w;\n"
+ "MAD R6.xyz, -R5, c[7].x, c[7].y;\n"
+ "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
"MAD R2.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, R2, R4;\n"
- "MAD R2.xyz, R0.w, R1, R2;\n"
- "ADD R6.xyz, R2, -R5;\n"
- "MUL R4.xyz, R0, c[6].x;\n"
- "MUL R2.xyz, R1, c[7].y;\n"
- "SGE R2.xyz, R2, R1.w;\n"
- "MAD R2.xyz, R2, R6, R5;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MAD R2.xyz, R4, R2, R3;\n"
+ "MUL R2.xyz, R3, R2;\n"
+ "MAD R4.xyz, R0.w, R1, R2;\n"
+ "MAD R2.xyz, -R1, R2.w, c[6].z;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MUL R3.xyz, R0, c[6].x;\n"
+ "MUL R4.xyz, R1, c[7].x;\n"
+ "MUL R6.xyz, R1, R6;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
"ADD R2.w, -R1, c[6].z;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[6].z;\n"
- "MAD result.color.xyz, R1, R2.y, R0;\n"
- "MAD result.color.w, -R0, R1, R2.x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, R0.w, R1.w;\n"
+ "ADD R0.y, -R0.w, c[6].z;\n"
+ "MAD result.color.xyz, R1, R0.y, R2;\n"
+ "MAD result.color.w, -R0, R1, R0.x;\n"
"END\n"
;
@@ -2146,16 +2146,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
@@ -2187,17 +2187,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.y, R0.z, c[6];\n"
- "MUL R0.x, R0, c[6];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
+ "MUL R0.y, R0.x, c[6].x;\n"
+ "MUL R0.z, R0, c[6].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.w, R0.x, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
+ "ADD R0.x, -R0.y, R0.z;\n"
+ "RCP R0.y, R0.w;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[6].x;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0.w, R1;\n"
@@ -2225,8 +2225,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
"MUL R0.y, R0.z, c[8];\n"
@@ -2235,12 +2235,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"RSQ R0.y, R0.y;\n"
"RCP R0.y, R0.y;\n"
"ADD R1.x, -R0, R0.y;\n"
- "MOV R0.z, c[8].x;\n"
- "MUL R0.z, R0, c[1].x;\n"
- "RCP R1.y, R0.z;\n"
- "ADD R0.xy, fragment.position, c[6];\n"
- "MUL R0.xy, R0, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "MOV R0.x, c[8];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R1.y, R0.x;\n"
+ "ADD R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "MUL R0.zw, R0, c[5].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R1.x, R1, R1.y;\n"
"DP4 R1.y, R0, c[7];\n"
"TEX R0, R1, texture[1], 1D;\n"
@@ -2260,19 +2260,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
"MUL R0.xy, R0, c[0];\n"
- "ADD R0.x, R0, R0.y;\n"
"ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
"MUL R0.y, R0.z, c[5];\n"
"MUL R0.x, R0, c[5];\n"
"MAD R0.z, R0.x, R0.x, -R0.y;\n"
"MOV R0.y, c[5].x;\n"
"RSQ R0.z, R0.z;\n"
- "MUL R0.y, R0, c[1].x;\n"
- "RCP R0.z, R0.z;\n"
- "RCP R0.y, R0.y;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "MUL R0.x, R0, R0.y;\n"
+ "MUL R0.w, R0.y, c[1].x;\n"
+ "RCP R0.y, R0.z;\n"
+ "RCP R0.z, R0.w;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.x, R0, R0.z;\n"
"TEX result.color, R0, texture[0], 1D;\n"
"END\n"
;
@@ -2280,9 +2280,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
"PARAM c[13] = { program.local[0..9],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2349,9 +2349,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2410,9 +2410,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2467,9 +2467,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 2, 1 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2542,9 +2542,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2606,9 +2606,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2670,9 +2670,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 1, 1e-006 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2747,9 +2747,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 1, 9.9999997e-006 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2761,16 +2761,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.z, R0.x;\n"
- "ABS R0.w, R0.y;\n"
- "ADD R0.w, R0, -R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
"ADD R1.x, R0.y, c[8];\n"
- "ABS R0.w, R0;\n"
- "CMP R0.y, -R0.w, R0, R1.x;\n"
- "ABS R0.w, -R0.y;\n"
- "MAX R1.x, R0.z, R0.w;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R1.x;\n"
+ "ABS R0.z, -R0.y;\n"
+ "MAX R1.x, R0.w, R0.z;\n"
"RCP R1.y, R1.x;\n"
- "MIN R1.x, R0.z, R0.w;\n"
+ "MIN R1.x, R0.w, R0.z;\n"
"MUL R1.x, R1, R1.y;\n"
"MUL R1.y, R1.x, R1.x;\n"
"MAD R1.z, R1.y, c[8].y, c[8];\n"
@@ -2779,8 +2779,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"MAD R1.z, R1, R1.y, -c[9].y;\n"
"MAD R1.y, R1.z, R1, c[9].z;\n"
"MUL R1.x, R1.y, R1;\n"
- "ADD R0.z, -R0, R0.w;\n"
"ADD R1.y, -R1.x, c[9].w;\n"
+ "ADD R0.z, -R0.w, R0;\n"
"CMP R0.z, -R0, R1.y, R1.x;\n"
"ADD R0.w, -R0.z, c[10].x;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
@@ -2825,9 +2825,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 2, 1 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2900,10 +2900,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[12] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1, 9.9999997e-006 },\n"
- " { 2, 3, 8 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 1, 2 },\n"
+ " { 9.9999997e-006, 8, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2916,86 +2916,86 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.z, R0.x;\n"
- "ABS R0.w, R0.y;\n"
- "ADD R0.w, R0, -R0.z;\n"
- "ADD R1.x, R0.y, c[8].y;\n"
- "ABS R0.w, R0;\n"
- "CMP R0.y, -R0.w, R0, R1.x;\n"
- "ABS R0.w, -R0.y;\n"
- "MAX R1.x, R0.z, R0.w;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R1.x, R0.y, c[8];\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R1.x;\n"
+ "ABS R0.z, -R0.y;\n"
+ "MAX R1.x, R0.w, R0.z;\n"
"RCP R1.y, R1.x;\n"
- "MIN R1.x, R0.z, R0.w;\n"
+ "MIN R1.x, R0.w, R0.z;\n"
"MUL R1.x, R1, R1.y;\n"
"MUL R1.y, R1.x, R1.x;\n"
- "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
- "MAD R1.z, R1, R1.y, -c[9];\n"
- "MAD R1.z, R1, R1.y, c[9].w;\n"
- "MAD R1.z, R1, R1.y, -c[10].x;\n"
- "MAD R1.y, R1.z, R1, c[10];\n"
+ "MAD R1.z, R1.y, c[8].y, c[8];\n"
+ "MAD R1.z, R1, R1.y, -c[8].w;\n"
+ "MAD R1.z, R1, R1.y, c[9].x;\n"
+ "MAD R1.z, R1, R1.y, -c[9].y;\n"
+ "MAD R1.y, R1.z, R1, c[9].z;\n"
"MUL R1.x, R1.y, R1;\n"
- "ADD R1.y, -R1.x, c[8].w;\n"
- "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[9].w;\n"
+ "ADD R0.z, -R0.w, R0;\n"
"CMP R0.z, -R0, R1.y, R1.x;\n"
- "ADD R0.w, -R0.z, c[8].z;\n"
+ "ADD R0.w, -R0.z, c[10].x;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"CMP R0.x, -R0.y, -R0, R0;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MAX R0.y, R1.w, c[11].x;\n"
+ "RCP R2.w, R0.y;\n"
+ "MUL R5.xyz, R1, R2.w;\n"
+ "RSQ R2.x, R5.x;\n"
+ "RSQ R2.z, R5.z;\n"
+ "RSQ R2.y, R5.y;\n"
"ADD R0.x, R0, c[0];\n"
- "MUL R1.x, R0, c[8];\n"
- "FLR R1.y, R1.x;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "MAX R2.x, R0.w, c[10].w;\n"
- "RCP R2.w, R2.x;\n"
- "MUL R2.xyz, R0, R2.w;\n"
- "MAD R6.xyz, -R2, c[11].z, c[11].y;\n"
- "MAD R3.xyz, -R0, R2.w, c[10].z;\n"
- "RSQ R2.w, R2.x;\n"
- "RCP R2.x, R2.w;\n"
- "ADD R1.x, R1, -R1.y;\n"
- "TEX R1, R1, texture[2], 1D;\n"
- "MAD R4.xyz, R1, c[11].x, -R1.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R5.xyz, -R5, R6, R1.w;\n"
- "MAD R3.xyz, -R3, R4, R1.w;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MUL R5.xyz, R0, R5;\n"
- "MUL R3.xyz, R0, R3;\n"
- "ADD R2.w, -R0, c[10].z;\n"
+ "MUL R0.x, R0, c[10].y;\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAD R3.xyz, R0, c[10].w, -R0.w;\n"
+ "MAD R6.xyz, -R5, c[11].y, c[11].z;\n"
+ "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R0.w, R2, -R0;\n"
- "MUL R2.xyz, R2, R4;\n"
- "MAD R2.xyz, R1.w, R0, R2;\n"
- "ADD R6.xyz, R2, -R5;\n"
- "MUL R4.xyz, R1, c[11].x;\n"
- "MUL R2.xyz, R0, c[11].z;\n"
- "SGE R2.xyz, R2, R0.w;\n"
- "MAD R2.xyz, R2, R6, R5;\n"
+ "MAD R2.xyz, R1.w, R2, -R1;\n"
+ "MUL R2.xyz, R3, R2;\n"
+ "MAD R4.xyz, R0.w, R1, R2;\n"
+ "MAD R2.xyz, -R1, R2.w, c[10].z;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MUL R3.xyz, R0, c[10].w;\n"
+ "MUL R4.xyz, R1, c[11].y;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "ADD R2.w, -R1, c[10].z;\n"
+ "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "MAD R2.xyz, R4, R2, R3;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[10].z;\n"
- "MAD R2.xyz, R0, R2.x, R1;\n"
- "ADD R1.z, R1.w, R0.w;\n"
- "MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[6];\n"
- "MUL R1.xy, R1, c[4];\n"
- "TEX R1, R1, texture[1], 2D;\n"
- "ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[7];\n"
- "MAD result.color, R1.x, R2, R0;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, -R0.w, c[10].z;\n"
+ "MAD R2.xyz, R1, R0.x, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[7];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 2 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3055,9 +3055,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..7],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 2, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3120,9 +3120,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..6],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3183,9 +3183,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3238,9 +3238,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3288,9 +3288,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 2, 1 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3356,9 +3356,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3414,9 +3414,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3472,9 +3472,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 1, 1e-006 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3542,9 +3542,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 1, 9.9999997e-006 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3556,16 +3556,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.z, R0.x;\n"
- "ABS R0.w, R0.y;\n"
- "ADD R0.w, R0, -R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
"ADD R1.x, R0.y, c[5];\n"
- "ABS R0.w, R0;\n"
- "CMP R0.y, -R0.w, R0, R1.x;\n"
- "ABS R0.w, -R0.y;\n"
- "MAX R1.x, R0.z, R0.w;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R1.x;\n"
+ "ABS R0.z, -R0.y;\n"
+ "MAX R1.x, R0.w, R0.z;\n"
"RCP R1.y, R1.x;\n"
- "MIN R1.x, R0.z, R0.w;\n"
+ "MIN R1.x, R0.w, R0.z;\n"
"MUL R1.x, R1, R1.y;\n"
"MUL R1.y, R1.x, R1.x;\n"
"MAD R1.z, R1.y, c[5].y, c[5];\n"
@@ -3574,8 +3574,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"MAD R1.z, R1, R1.y, -c[6].y;\n"
"MAD R1.y, R1.z, R1, c[6].z;\n"
"MUL R1.x, R1.y, R1;\n"
- "ADD R0.z, -R0, R0.w;\n"
"ADD R1.y, -R1.x, c[6].w;\n"
+ "ADD R0.z, -R0.w, R0;\n"
"CMP R0.z, -R0, R1.y, R1.x;\n"
"ADD R0.w, -R0.z, c[7].x;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
@@ -3614,9 +3614,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
- " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
- " { 3.1415927, 0.15915494, 2, 1 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3683,10 +3683,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 1, 9.9999997e-006 },\n"
- " { 2, 3, 8 } };\n"
+ " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
+ " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
+ " { 3.141593, 0.15915494, 1, 2 },\n"
+ " { 9.9999997e-006, 8, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3699,80 +3699,80 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.z, R0.x;\n"
- "ABS R0.w, R0.y;\n"
- "ADD R0.w, R0, -R0.z;\n"
- "ADD R1.x, R0.y, c[5].y;\n"
- "ABS R0.w, R0;\n"
- "CMP R0.y, -R0.w, R0, R1.x;\n"
- "ABS R0.w, -R0.y;\n"
- "MAX R1.x, R0.z, R0.w;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R1.x, R0.y, c[5];\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R1.x;\n"
+ "ABS R0.z, -R0.y;\n"
+ "MAX R1.x, R0.w, R0.z;\n"
"RCP R1.y, R1.x;\n"
- "MIN R1.x, R0.z, R0.w;\n"
+ "MIN R1.x, R0.w, R0.z;\n"
"MUL R1.x, R1, R1.y;\n"
"MUL R1.y, R1.x, R1.x;\n"
- "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
- "MAD R1.z, R1, R1.y, -c[6];\n"
- "MAD R1.z, R1, R1.y, c[6].w;\n"
- "MAD R1.z, R1, R1.y, -c[7].x;\n"
- "MAD R1.y, R1.z, R1, c[7];\n"
+ "MAD R1.z, R1.y, c[5].y, c[5];\n"
+ "MAD R1.z, R1, R1.y, -c[5].w;\n"
+ "MAD R1.z, R1, R1.y, c[6].x;\n"
+ "MAD R1.z, R1, R1.y, -c[6].y;\n"
+ "MAD R1.y, R1.z, R1, c[6].z;\n"
"MUL R1.x, R1.y, R1;\n"
- "ADD R0.z, -R0, R0.w;\n"
- "ADD R1.y, -R1.x, c[5].w;\n"
+ "ADD R1.y, -R1.x, c[6].w;\n"
+ "ADD R0.z, -R0.w, R0;\n"
"CMP R0.z, -R0, R1.y, R1.x;\n"
- "ADD R0.w, -R0.z, c[5].z;\n"
+ "ADD R0.w, -R0.z, c[7].x;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
- "CMP R0.x, -R0.y, -R0, R0;\n"
"MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MAX R2.x, R1.w, c[7].w;\n"
- "RCP R2.w, R2.x;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "MAD R6.xyz, -R2, c[8].z, c[8].y;\n"
- "MAD R3.xyz, -R1, R2.w, c[7].z;\n"
- "RSQ R2.w, R2.x;\n"
- "RCP R2.x, R2.w;\n"
+ "MAX R0.y, R1.w, c[8].x;\n"
+ "RCP R2.w, R0.y;\n"
+ "MUL R5.xyz, R1, R2.w;\n"
+ "RSQ R2.x, R5.x;\n"
+ "RSQ R2.z, R5.z;\n"
+ "RSQ R2.y, R5.y;\n"
"ADD R0.x, R0, c[0];\n"
- "MUL R0.x, R0, c[5];\n"
+ "MUL R0.x, R0, c[7].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R4.xyz, R0, c[8].x, -R0.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R5.xyz, -R5, R6, R0.w;\n"
- "MAD R3.xyz, -R3, R4, R0.w;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MUL R5.xyz, R1, R5;\n"
- "MUL R3.xyz, R1, R3;\n"
+ "MAD R3.xyz, R0, c[7].w, -R0.w;\n"
+ "MAD R6.xyz, -R5, c[8].y, c[8].z;\n"
+ "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
"MAD R2.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, R2, R4;\n"
- "MAD R2.xyz, R0.w, R1, R2;\n"
- "ADD R6.xyz, R2, -R5;\n"
- "MUL R4.xyz, R0, c[8].x;\n"
- "MUL R2.xyz, R1, c[8].z;\n"
- "SGE R2.xyz, R2, R1.w;\n"
- "MAD R2.xyz, R2, R6, R5;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MAD R2.xyz, R4, R2, R3;\n"
+ "MUL R2.xyz, R3, R2;\n"
+ "MAD R4.xyz, R0.w, R1, R2;\n"
+ "MAD R2.xyz, -R1, R2.w, c[7].z;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MUL R3.xyz, R0, c[7].w;\n"
+ "MUL R4.xyz, R1, c[8].y;\n"
+ "MUL R6.xyz, R1, R6;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
"ADD R2.w, -R1, c[7].z;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[7].z;\n"
- "MAD result.color.xyz, R1, R2.y, R0;\n"
- "MAD result.color.w, -R0, R1, R2.x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, R0.w, R1.w;\n"
+ "ADD R0.y, -R0.w, c[7].z;\n"
+ "MAD result.color.xyz, R1, R0.y, R2;\n"
+ "MAD result.color.w, -R0, R1, R0.x;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 2 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3826,9 +3826,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..4],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565, 2, 1 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3885,9 +3885,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_MASK =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..6],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
@@ -3919,11 +3919,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.w, -R0.z, c[7].z;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
"CMP R0.x, -R0.y, -R0, R0;\n"
- "ADD R0.z, R0.x, c[0].x;\n"
- "MUL R1.x, R0.z, c[7];\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R1.x, R0, c[7];\n"
"FLR R1.y, R1.x;\n"
- "ADD R0.xy, fragment.position, c[5];\n"
- "MUL R0.xy, R0, c[4];\n"
+ "ADD R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "MUL R0.xy, R0.zwzw, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R1.x, R1, -R1.y;\n"
"DP4 R1.y, R0, c[6];\n"
@@ -3935,9 +3935,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..3],\n"
- " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
- " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
- " { 0.33299461, 0.99999565 } };\n"
+ " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n"
+ " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n"
+ " { 0.33299461, 0.99999559 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
@@ -4356,8 +4356,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -4365,58 +4365,58 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R2.xyz, fragment.position.y, c[2];\n"
- "MAD R3.xyz, fragment.position.x, c[1], R2;\n"
"MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.x, R0.w, c[8].y;\n"
- "RCP R2.w, R1.x;\n"
- "MUL R1.xyz, R0, R2.w;\n"
- "RSQ R1.w, R1.x;\n"
- "RSQ R2.y, R1.y;\n"
- "ADD R3.xyz, R3, c[3];\n"
- "RCP R2.x, R1.w;\n"
- "RCP R1.w, R3.z;\n"
- "MUL R3.xy, R3, R1.w;\n"
- "RSQ R1.w, R1.z;\n"
- "RCP R2.z, R1.w;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R6.xyz, R0.w, R2, -R0;\n"
- "MUL R2.xyz, -R1, c[9].x;\n"
- "ADD R5.xyz, R2, c[8].w;\n"
- "MAD R2.xyz, -R0, R2.w, c[8].x;\n"
- "MUL R3.xy, R3, c[0];\n"
- "ADD R1.w, R3.x, R3.y;\n"
- "MUL R1.w, R1, c[0].z;\n"
- "TEX R1, R1.w, texture[2], 1D;\n"
- "MAD R3.xyz, R1, c[8].z, -R1.w;\n"
- "MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R1.w;\n"
- "MAD R2.xyz, -R2, R3, R1.w;\n"
- "MUL R5.xyz, R6, R3;\n"
- "MUL R4.xyz, R0, R4;\n"
- "MAD R5.xyz, R1.w, R0, R5;\n"
- "ADD R6.xyz, R5, -R4;\n"
- "MUL R5.xyz, R0, c[9].x;\n"
- "SGE R3.xyz, R5, R0.w;\n"
- "MAD R3.xyz, R3, R6, R4;\n"
- "MUL R2.xyz, R0, R2;\n"
- "MUL R4.xyz, R1, c[8].z;\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MAX R0.w, R1, c[8].z;\n"
+ "RCP R2.w, R0.w;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R2.x;\n"
+ "MUL R5.xyz, -R2, c[8].w;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "RSQ R0.z, R2.y;\n"
+ "RSQ R0.y, R2.z;\n"
+ "MAD R2.xyz, -R1, R2.w, c[8].x;\n"
+ "RCP R3.x, R0.w;\n"
+ "RCP R3.y, R0.z;\n"
+ "RCP R3.z, R0.y;\n"
+ "MUL R0.x, R0, c[0].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAD R4.xyz, R1.w, R3, -R1;\n"
+ "MAD R3.xyz, R0, c[8].y, -R0.w;\n"
+ "MUL R4.xyz, R3, R4;\n"
+ "ADD R6.xyz, R5, c[9].x;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MUL R3.xyz, R0, c[8].y;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MUL R4.xyz, R1, c[8].w;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "ADD R3.xyz, R3, -R2;\n"
- "MAD R2.xyz, R4, R3, R2;\n"
- "ADD R2.w, -R0, c[8].x;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[8];\n"
- "MAD R2.xyz, R0, R2.x, R1;\n"
- "ADD R1.z, R1.w, R0.w;\n"
- "MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[6];\n"
- "MUL R1.xy, R1, c[4];\n"
- "TEX R1, R1, texture[1], 2D;\n"
- "ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[7];\n"
- "MAD result.color, R1.x, R2, R0;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R0.x, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[7];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -4815,8 +4815,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -4824,52 +4824,52 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R2.xyz, fragment.position.y, c[2];\n"
- "MAD R3.xyz, fragment.position.x, c[1], R2;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.x, R1.w, c[5].y;\n"
- "RCP R2.w, R0.x;\n"
- "MUL R0.xyz, R1, R2.w;\n"
- "RSQ R0.w, R0.x;\n"
- "RSQ R2.y, R0.y;\n"
- "ADD R3.xyz, R3, c[3];\n"
- "RCP R2.x, R0.w;\n"
- "RCP R0.w, R3.z;\n"
- "MUL R3.xy, R3, R0.w;\n"
- "RSQ R0.w, R0.z;\n"
- "RCP R2.z, R0.w;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R6.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, -R0, c[6].x;\n"
- "ADD R5.xyz, R2, c[5].w;\n"
+ "MAX R0.w, R1, c[5].z;\n"
+ "RCP R2.w, R0.w;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R2.x;\n"
+ "MUL R5.xyz, -R2, c[5].w;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "RSQ R0.z, R2.y;\n"
+ "RSQ R0.y, R2.z;\n"
"MAD R2.xyz, -R1, R2.w, c[5].x;\n"
- "MUL R3.xy, R3, c[0];\n"
- "ADD R0.w, R3.x, R3.y;\n"
- "MUL R0.w, R0, c[0].z;\n"
- "TEX R0, R0.w, texture[1], 1D;\n"
- "MAD R3.xyz, R0, c[5].z, -R0.w;\n"
- "MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R0.w;\n"
- "MUL R5.xyz, R6, R3;\n"
+ "RCP R3.x, R0.w;\n"
+ "RCP R3.y, R0.z;\n"
+ "RCP R3.z, R0.y;\n"
+ "MUL R0.x, R0, c[0].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MAD R4.xyz, R1.w, R3, -R1;\n"
+ "MAD R3.xyz, R0, c[5].y, -R0.w;\n"
+ "MUL R4.xyz, R3, R4;\n"
+ "ADD R6.xyz, R5, c[6].x;\n"
+ "MUL R5.xyz, R2, R3;\n"
"MAD R2.xyz, -R2, R3, R0.w;\n"
- "MUL R4.xyz, R1, R4;\n"
- "MAD R5.xyz, R0.w, R1, R5;\n"
- "ADD R6.xyz, R5, -R4;\n"
- "MUL R5.xyz, R1, c[6].x;\n"
- "SGE R3.xyz, R5, R1.w;\n"
- "MAD R3.xyz, R3, R6, R4;\n"
+ "MUL R3.xyz, R0, c[5].y;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MUL R4.xyz, R1, c[5].w;\n"
+ "MUL R6.xyz, R1, R6;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
"MUL R2.xyz, R1, R2;\n"
- "MUL R4.xyz, R0, c[5].z;\n"
- "ADD R3.xyz, R3, -R2;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MAD R2.xyz, R4, R3, R2;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
"ADD R2.w, -R1, c[5].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[5].x;\n"
- "MAD result.color.xyz, R1, R2.y, R0;\n"
- "MAD result.color.w, -R0, R1, R2.x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, R0.w, R1.w;\n"
+ "ADD R0.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R0.y, R2;\n"
+ "MAD result.color.w, -R0, R1, R0.x;\n"
"END\n"
;
@@ -5333,8 +5333,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -5343,55 +5343,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R5;\n"
"TEMP R6;\n"
"MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.x, R0.w, c[8].y;\n"
- "RCP R2.w, R1.x;\n"
- "MUL R1.xyz, R0, R2.w;\n"
- "RSQ R1.w, R1.x;\n"
- "RCP R2.x, R1.w;\n"
- "RSQ R1.w, R1.y;\n"
- "RSQ R2.z, R1.z;\n"
- "MUL R3.xyz, fragment.position.y, c[2];\n"
- "MAD R3.xyz, fragment.position.x, c[1], R3;\n"
- "ADD R3.xyz, R3, c[3];\n"
- "RCP R2.y, R1.w;\n"
- "RCP R1.w, R3.z;\n"
- "MUL R3.xy, R3, R1.w;\n"
- "RCP R2.z, R2.z;\n"
- "MAD R6.xyz, R0.w, R2, -R0;\n"
- "MUL R2.xyz, -R1, c[9].x;\n"
- "ADD R5.xyz, R2, c[8].w;\n"
- "MAD R2.xyz, -R0, R2.w, c[8].x;\n"
- "MUL R3.xy, R3, c[0];\n"
- "TEX R1, R3, texture[2], 2D;\n"
- "MAD R3.xyz, R1, c[8].z, -R1.w;\n"
- "MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R1.w;\n"
- "MAD R2.xyz, -R2, R3, R1.w;\n"
- "MUL R5.xyz, R6, R3;\n"
- "MUL R4.xyz, R0, R4;\n"
- "MAD R5.xyz, R1.w, R0, R5;\n"
- "ADD R6.xyz, R5, -R4;\n"
- "MUL R5.xyz, R0, c[9].x;\n"
- "SGE R3.xyz, R5, R0.w;\n"
- "MAD R3.xyz, R3, R6, R4;\n"
- "MUL R2.xyz, R0, R2;\n"
- "MUL R4.xyz, R1, c[8].z;\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MAX R0.x, R1.w, c[8].z;\n"
+ "RCP R2.w, R0.x;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R2.x;\n"
+ "RCP R3.x, R0.w;\n"
+ "RSQ R0.w, R2.y;\n"
+ "MUL R5.xyz, -R2, c[8].w;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "RSQ R0.z, R2.z;\n"
+ "MAD R2.xyz, -R1, R2.w, c[8].x;\n"
+ "RCP R3.y, R0.w;\n"
+ "RCP R3.z, R0.z;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MAD R4.xyz, R1.w, R3, -R1;\n"
+ "MAD R3.xyz, R0, c[8].y, -R0.w;\n"
+ "MUL R4.xyz, R3, R4;\n"
+ "ADD R6.xyz, R5, c[9].x;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MUL R3.xyz, R0, c[8].y;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MUL R4.xyz, R1, c[8].w;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "ADD R3.xyz, R3, -R2;\n"
- "MAD R2.xyz, R4, R3, R2;\n"
- "ADD R2.w, -R0, c[8].x;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[8];\n"
- "MAD R2.xyz, R0, R2.x, R1;\n"
- "ADD R1.z, R1.w, R0.w;\n"
- "MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[6];\n"
- "MUL R1.xy, R1, c[4];\n"
- "TEX R1, R1, texture[1], 2D;\n"
- "ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[7];\n"
- "MAD result.color, R1.x, R2, R0;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R0.x, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[7];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -5475,10 +5475,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MUL R0.xyz, fragment.position.y, c[2];\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
- "RCP R1.x, R0.z;\n"
- "MUL R0.xy, R0, R1.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
"MUL R2.xyz, R1, c[4].y;\n"
"MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
@@ -5508,10 +5508,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MUL R0.xyz, fragment.position.y, c[2];\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
- "RCP R1.x, R0.z;\n"
- "MUL R0.xy, R0, R1.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
"MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2.x, -R1.w, c[5];\n"
@@ -5768,8 +5768,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -5779,48 +5779,48 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R6;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.x, R1.w, c[5].y;\n"
+ "MAX R0.x, R1.w, c[5].z;\n"
"RCP R2.w, R0.x;\n"
- "MUL R0.xyz, R1, R2.w;\n"
- "RSQ R0.w, R0.x;\n"
- "RCP R2.x, R0.w;\n"
- "RSQ R0.w, R0.y;\n"
- "RSQ R2.z, R0.z;\n"
- "MUL R3.xyz, fragment.position.y, c[2];\n"
- "MAD R3.xyz, fragment.position.x, c[1], R3;\n"
- "ADD R3.xyz, R3, c[3];\n"
- "RCP R2.y, R0.w;\n"
- "RCP R0.w, R3.z;\n"
- "MUL R3.xy, R3, R0.w;\n"
- "RCP R2.z, R2.z;\n"
- "MAD R6.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, -R0, c[6].x;\n"
- "ADD R5.xyz, R2, c[5].w;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R2.x;\n"
+ "RCP R3.x, R0.w;\n"
+ "RSQ R0.w, R2.y;\n"
+ "MUL R5.xyz, -R2, c[5].w;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "RSQ R0.z, R2.z;\n"
"MAD R2.xyz, -R1, R2.w, c[5].x;\n"
- "MUL R3.xy, R3, c[0];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "MAD R3.xyz, R0, c[5].z, -R0.w;\n"
- "MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R0.w;\n"
- "MUL R5.xyz, R6, R3;\n"
+ "RCP R3.y, R0.w;\n"
+ "RCP R3.z, R0.z;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MAD R4.xyz, R1.w, R3, -R1;\n"
+ "MAD R3.xyz, R0, c[5].y, -R0.w;\n"
+ "MUL R4.xyz, R3, R4;\n"
+ "ADD R6.xyz, R5, c[6].x;\n"
+ "MUL R5.xyz, R2, R3;\n"
"MAD R2.xyz, -R2, R3, R0.w;\n"
- "MUL R4.xyz, R1, R4;\n"
- "MAD R5.xyz, R0.w, R1, R5;\n"
- "ADD R6.xyz, R5, -R4;\n"
- "MUL R5.xyz, R1, c[6].x;\n"
- "SGE R3.xyz, R5, R1.w;\n"
- "MAD R3.xyz, R3, R6, R4;\n"
+ "MUL R3.xyz, R0, c[5].y;\n"
+ "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "MAD R5.xyz, -R1, R6, R4;\n"
+ "MUL R4.xyz, R1, c[5].w;\n"
+ "MUL R6.xyz, R1, R6;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R1, R2, R4;\n"
"MUL R2.xyz, R1, R2;\n"
- "MUL R4.xyz, R0, c[5].z;\n"
- "ADD R3.xyz, R3, -R2;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MAD R2.xyz, R4, R3, R2;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
"ADD R2.w, -R1, c[5].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[5].x;\n"
- "MAD result.color.xyz, R1, R2.y, R0;\n"
- "MAD result.color.w, -R0, R1, R2.x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.x, R0.w, R1.w;\n"
+ "ADD R0.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R0.y, R2;\n"
+ "MAD result.color.w, -R0, R1, R0.x;\n"
"END\n"
;
@@ -5927,12 +5927,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.zw, R0.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[0];\n"
- "MOV R1.y, -R1;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, c[0].xyxy;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
"MUL R0.xy, fragment.position, c[7];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "TEX R1.x, R1, texture[2], 2D;\n"
+ "ADD R1.x, -R1, c[10];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R0, c[4].y;\n"
"MUL R3.xyz, R1.w, R2;\n"
@@ -5968,12 +5968,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.zw, R0.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[0];\n"
- "MOV R1.y, -R1;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, c[0].xyxy;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
"MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "TEX R1.x, R1, texture[2], 2D;\n"
+ "ADD R1.x, -R1, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2.x, -R0.w, c[8];\n"
"MUL R2.xyz, R1, R2.x;\n"
@@ -5993,7 +5993,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..7] };\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6004,12 +6005,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[2], 2D;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "ADD R0.z, -R0.x, c[8].x;\n"
"ADD R3.xy, fragment.position, c[6];\n"
+ "MUL R1, fragment.color.primary, R0.z;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2, R1, R0;\n"
"MAD R2, -R1, R0, R2;\n"
"MUL R3.xy, R3, c[4];\n"
@@ -6023,7 +6024,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 2, 1 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6035,25 +6036,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[2], 2D;\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[8].y;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "ADD R0.x, -R0, c[8];\n"
+ "MUL R1, fragment.color.primary, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
"ADD R3.xyz, R1.w, -R1;\n"
"ADD R2.xyz, R0.w, -R0;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[8].x;\n"
+ "MUL R2.xyz, R2, c[8].y;\n"
"MAD R2.xyz, R1.w, R0.w, -R2;\n"
"MUL R4.xyz, R1, R2.w;\n"
"MUL R3.xyz, R1, R0;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[8].y;\n"
- "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R3.xyz, R3, c[8].y, R4;\n"
"MAD R3.xyz, R0, R2.x, R3;\n"
"MAD R1.xyz, R0, R2.x, R1;\n"
- "MUL R2.xyz, R0, c[8].x;\n"
+ "MUL R2.xyz, R0, c[8].y;\n"
"ADD R1.xyz, R1, -R3;\n"
"SGE R2.xyz, R2, R0.w;\n"
"MAD R2.xyz, R2, R1, R3;\n"
@@ -6082,11 +6083,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
"MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, -R1, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R3.xyz, R1.w, R0;\n"
"MUL R2.xyz, R1, R0.w;\n"
@@ -6120,11 +6120,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
"MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, -R1, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R3.xyz, R1.w, R0;\n"
"MUL R2.xyz, R1, R0.w;\n"
@@ -6159,13 +6158,13 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
"TEX R0.x, R0, texture[2], 2D;\n"
+ "ADD R0.x, -R0, c[8];\n"
"MUL R1, fragment.color.primary, R0.x;\n"
"MAX R0.x, R1.w, c[8].y;\n"
"RCP R0.x, R0.x;\n"
- "MAD R0.xyz, -R1, R0.x, c[8].x;\n"
- "MAX R2.xyz, R0, c[8].y;\n"
+ "MAD R2.xyz, -R1, R0.x, c[8].x;\n"
+ "MAX R2.xyz, R2, c[8].y;\n"
"MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R2.w, -R1, c[8].x;\n"
@@ -6210,12 +6209,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "ADD R1.x, -R0, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"MAD R2.xyz, -R1.w, R0.w, R3;\n"
@@ -6249,7 +6247,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 2, 1 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6261,23 +6259,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[2], 2D;\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[8].y;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "ADD R0.x, -R0, c[8];\n"
+ "MUL R1, fragment.color.primary, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
"ADD R3.xyz, R1.w, -R1;\n"
"ADD R2.xyz, R0.w, -R0;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[8].x;\n"
+ "MUL R2.xyz, R2, c[8].y;\n"
"MAD R2.xyz, R1.w, R0.w, -R2;\n"
"MUL R4.xyz, R1, R2.w;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
"MUL R3.xyz, R1, R0;\n"
- "ADD R2.w, -R1, c[8].y;\n"
- "MAD R3.xyz, R3, c[8].x, R4;\n"
- "MUL R1.xyz, R1, c[8].x;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R3.xyz, R3, c[8].y, R4;\n"
+ "MUL R1.xyz, R1, c[8].y;\n"
"SGE R1.xyz, R1, R1.w;\n"
"MAD R3.xyz, R0, R2.w, R3;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
@@ -6297,8 +6295,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6306,50 +6304,50 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[2];\n"
- "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
- "ADD R1.xyz, R0, c[3];\n"
- "RCP R0.z, R1.z;\n"
- "MUL R1.xy, R1, R0.z;\n"
- "MUL R1.xy, R1, c[0];\n"
- "MOV R1.y, -R1;\n"
"MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.z, R0.w, c[8].y;\n"
- "RCP R2.w, R1.z;\n"
+ "MAX R1.w, R0, c[8].z;\n"
+ "RCP R2.w, R1.w;\n"
"MUL R2.xyz, R0, R2.w;\n"
- "MUL R6.xyz, -R2, c[9].x;\n"
- "MAD R3.xyz, -R0, R2.w, c[8].x;\n"
+ "RSQ R1.w, R2.x;\n"
+ "MUL R5.xyz, -R2, c[8].w;\n"
+ "MUL R1.xyz, fragment.position.y, c[2];\n"
+ "MAD R1.xyz, fragment.position.x, c[1], R1;\n"
+ "ADD R1.xyz, R1, c[3];\n"
+ "RCP R1.z, R1.z;\n"
+ "MUL R1.xy, R1, R1.z;\n"
+ "MUL R1.xy, R1, c[0];\n"
"TEX R1.x, R1, texture[2], 2D;\n"
+ "RSQ R1.z, R2.y;\n"
+ "RSQ R1.y, R2.z;\n"
+ "MAD R2.xyz, -R0, R2.w, c[8].x;\n"
+ "RCP R3.x, R1.w;\n"
+ "RCP R3.y, R1.z;\n"
+ "RCP R3.z, R1.y;\n"
+ "ADD R1.x, -R1, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MAD R4.xyz, R1, c[8].z, -R1.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R3.xyz, -R3, R4, R1.w;\n"
- "ADD R6.xyz, R6, c[8].w;\n"
- "MAD R5.xyz, -R5, R6, R1.w;\n"
- "RSQ R2.x, R2.x;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MUL R5.xyz, R0, R5;\n"
- "MUL R3.xyz, R0, R3;\n"
+ "MAD R4.xyz, R0.w, R3, -R0;\n"
+ "MAD R3.xyz, R1, c[8].y, -R1.w;\n"
+ "MUL R4.xyz, R3, R4;\n"
+ "ADD R6.xyz, R5, c[9].x;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, R3, R1.w;\n"
+ "MUL R3.xyz, R1, c[8].y;\n"
+ "MAD R6.xyz, -R5, R6, R1.w;\n"
+ "MAD R4.xyz, R1.w, R0, R4;\n"
+ "MAD R5.xyz, -R0, R6, R4;\n"
+ "MUL R4.xyz, R0, c[8].w;\n"
+ "SGE R3.xyz, R3, R1.w;\n"
"ADD R2.w, -R0, c[8].x;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R0.w, R2, -R0;\n"
- "MUL R2.xyz, R2, R4;\n"
- "MAD R2.xyz, R1.w, R0, R2;\n"
- "ADD R6.xyz, R2, -R5;\n"
- "MUL R4.xyz, R1, c[8].z;\n"
- "MUL R2.xyz, R0, c[9].x;\n"
- "SGE R2.xyz, R2, R0.w;\n"
- "MAD R2.xyz, R2, R6, R5;\n"
- "SGE R4.xyz, R4, R1.w;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "MAD R2.xyz, R4, R2, R3;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[8];\n"
- "MAD R2.xyz, R0, R2.x, R1;\n"
+ "MUL R6.xyz, R0, R6;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R0, R2, R4;\n"
+ "MUL R2.xyz, R0, R2;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R1.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R1.x, R2;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
"ADD R1.xy, fragment.position, c[6];\n"
@@ -6364,7 +6362,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 2 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6375,17 +6373,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
"MUL R0.xy, fragment.position, c[5];\n"
+ "ADD R1.x, -R1, c[8];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2.xyz, R1, R0;\n"
"MUL R3.xyz, R1.w, R0;\n"
"MUL R1.xyz, R1, R0.w;\n"
"MIN R1.xyz, R1, R3;\n"
- "MAD R2.xyz, -R1, c[8].x, R2;\n"
+ "MAD R2.xyz, -R1, c[8].y, R2;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
"ADD R1.xy, fragment.position, c[6];\n"
@@ -6400,7 +6397,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 2, 1 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6411,19 +6408,18 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
"MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, -R1, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"MUL R2.xyz, R1, R0;\n"
- "MAD R2.xyz, -R2, c[8].x, R3;\n"
- "ADD R2.w, -R0, c[8].y;\n"
+ "MAD R2.xyz, -R2, c[8].y, R3;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[8].y;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
"MAD R2.xyz, R0, R2.x, R1;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
@@ -6448,13 +6444,13 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.zw, R0.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[0];\n"
- "MOV R1.y, -R1;\n"
- "MUL R0.xy, fragment.position, c[6];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R2.xyz, R0, c[4].y;\n"
- "TEX R1.x, R1, texture[1], 2D;\n"
+ "ADD R1.x, -R1, c[7];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R3.xyz, R1.w, R2;\n"
"MUL R2.xyz, R1, c[4].x;\n"
@@ -6483,12 +6479,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.zw, R0.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[0];\n"
- "MOV R1.y, -R1;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "TEX R1.x, R1, texture[1], 2D;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
+ "ADD R1.x, -R1, c[5];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2.x, -R0.w, c[5];\n"
"MUL R2.xyz, R1, R2.x;\n"
@@ -6502,7 +6498,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[5] = { program.local[0..4] };\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6512,11 +6509,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R1.x, -R0, c[5];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2, R1, R0;\n"
"MAD result.color, -R1, R0, R2;\n"
@@ -6526,7 +6522,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 2, 1 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6537,25 +6533,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R0.x, -R0, c[5];\n"
+ "MUL R1, fragment.color.primary, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"ADD R3.xyz, R1.w, -R1;\n"
"ADD R2.xyz, R0.w, -R0;\n"
"MUL R2.xyz, R2, R3;\n"
- "ADD R2.w, -R0, c[5].y;\n"
- "MUL R2.xyz, R2, c[5].x;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MUL R2.xyz, R2, c[5].y;\n"
"MAD R2.xyz, R1.w, R0.w, -R2;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
"MUL R3.xyz, R1, R2.w;\n"
"MUL R1.xyz, R1, R0;\n"
- "ADD R2.w, -R1, c[5].y;\n"
- "MAD R1.xyz, R1, c[5].x, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R1.xyz, R1, c[5].y, R3;\n"
"MAD R1.xyz, R0, R2.w, R1;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
- "MUL R0.xyz, R0, c[5].x;\n"
+ "MUL R0.xyz, R0, c[5].y;\n"
"ADD R2.w, R1, R0;\n"
"ADD R2.xyz, R2, -R1;\n"
"SGE R0.xyz, R0, R0.w;\n"
@@ -6578,11 +6574,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R1.x, -R0, c[5];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R1, R0.w;\n"
"MUL R3.xyz, R1.w, R0;\n"
@@ -6610,11 +6605,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R1.x, -R0, c[5];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R1, R0.w;\n"
"MUL R3.xyz, R1.w, R0;\n"
@@ -6642,31 +6636,31 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
"TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R0.x, -R0, c[5];\n"
"MUL R1, fragment.color.primary, R0.x;\n"
"MAX R0.x, R1.w, c[5].y;\n"
"RCP R0.x, R0.x;\n"
- "MAD R0.xyz, -R1, R0.x, c[5].x;\n"
- "MAX R2.xyz, R0, c[5].y;\n"
+ "MAD R3.xyz, -R1, R0.x, c[5].x;\n"
+ "MAX R3.xyz, R3, c[5].y;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[5].x;\n"
- "MUL R3.xyz, R0, R2.w;\n"
+ "ADD R2.x, -R1.w, c[5];\n"
+ "MUL R2.xyz, R0, R2.x;\n"
"ADD R2.w, -R0, c[5].x;\n"
- "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
"MUL R0.xyz, R1.w, R0;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.y, R2.y;\n"
- "RCP R2.z, R2.z;\n"
- "MAD R2.xyz, R0, R2, R3;\n"
+ "RCP R3.x, R3.x;\n"
+ "RCP R3.y, R3.y;\n"
+ "RCP R3.z, R3.z;\n"
+ "MAD R3.xyz, R0, R3, R2;\n"
"MAD R0.xyz, R1, R0.w, R0;\n"
- "MAD R3.xyz, R1.w, R0.w, R3;\n"
+ "MAD R2.xyz, R1.w, R0.w, R2;\n"
"MUL R2.w, R1, R0;\n"
"ADD R1.x, R1.w, R0.w;\n"
- "ADD R3.xyz, R3, -R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
"SGE R0.xyz, R0, R2.w;\n"
- "MAD result.color.xyz, R0, R3, R2;\n"
+ "MAD result.color.xyz, R0, R2, R3;\n"
"MAD result.color.w, -R1, R0, R1.x;\n"
"END\n"
;
@@ -6687,12 +6681,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R1.x, -R0, c[5];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"ADD R2.w, -R0, c[5].x;\n"
@@ -6720,7 +6713,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 2, 1 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6732,38 +6725,38 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[5].y;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R0.x, -R0, c[5];\n"
+ "MUL R1, fragment.color.primary, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
"ADD R3.xyz, R1.w, -R1;\n"
"ADD R2.xyz, R0.w, -R0;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[5].x;\n"
+ "MUL R2.xyz, R2, c[5].y;\n"
"MAD R2.xyz, R1.w, R0.w, -R2;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
"MUL R4.xyz, R1, R2.w;\n"
"MUL R3.xyz, R1, R0;\n"
- "MAD R2.xyz, R1, R2.w, R2;\n"
- "ADD R2.w, -R1, c[5].y;\n"
- "MUL R1.xyz, R1, c[5].x;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "MAD R3.xyz, R3, c[5].x, R4;\n"
- "MAD R0.xyz, R0, R2.w, R3;\n"
- "ADD R2.w, R1, R0;\n"
- "ADD R2.xyz, R2, -R0;\n"
+ "MUL R1.xyz, R1, c[5].y;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R3.xyz, R3, c[5].y, R4;\n"
+ "MAD R3.xyz, R0, R2.w, R3;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R1.w, R0.w;\n"
+ "ADD R0.xyz, R0, -R3;\n"
"SGE R1.xyz, R1, R1.w;\n"
- "MAD result.color.xyz, R1, R2, R0;\n"
- "MAD result.color.w, -R1, R0, R2;\n"
+ "MAD result.color.xyz, R1, R0, R3;\n"
+ "MAD result.color.w, -R1, R0, R2.x;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 9.9999997e-006, 2, 3 },\n"
- " { 8 } };\n"
+ " { 1, 2, 9.9999997e-006, 8 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6771,59 +6764,59 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[2];\n"
- "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
- "ADD R1.xyz, R0, c[3];\n"
- "RCP R0.z, R1.z;\n"
- "MUL R1.xy, R1, R0.z;\n"
- "MUL R1.xy, R1, c[0];\n"
- "MOV R1.y, -R1;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.z, R0.w, c[5].y;\n"
- "RCP R2.w, R1.z;\n"
+ "MAX R1.w, R0, c[5].z;\n"
+ "RCP R2.w, R1.w;\n"
"MUL R2.xyz, R0, R2.w;\n"
- "MUL R6.xyz, -R2, c[6].x;\n"
- "MAD R3.xyz, -R0, R2.w, c[5].x;\n"
+ "RSQ R1.w, R2.x;\n"
+ "MUL R5.xyz, -R2, c[5].w;\n"
+ "MUL R1.xyz, fragment.position.y, c[2];\n"
+ "MAD R1.xyz, fragment.position.x, c[1], R1;\n"
+ "ADD R1.xyz, R1, c[3];\n"
+ "RCP R1.z, R1.z;\n"
+ "MUL R1.xy, R1, R1.z;\n"
+ "MUL R1.xy, R1, c[0];\n"
"TEX R1.x, R1, texture[1], 2D;\n"
+ "RSQ R1.z, R2.y;\n"
+ "RSQ R1.y, R2.z;\n"
+ "MAD R2.xyz, -R0, R2.w, c[5].x;\n"
+ "RCP R3.x, R1.w;\n"
+ "RCP R3.y, R1.z;\n"
+ "RCP R3.z, R1.y;\n"
+ "ADD R1.x, -R1, c[5];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MAD R4.xyz, R1, c[5].z, -R1.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R3.xyz, -R3, R4, R1.w;\n"
- "ADD R6.xyz, R6, c[5].w;\n"
- "MAD R5.xyz, -R5, R6, R1.w;\n"
- "RSQ R2.x, R2.x;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MUL R5.xyz, R0, R5;\n"
- "MUL R3.xyz, R0, R3;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R0.w, R2, -R0;\n"
- "MUL R2.xyz, R2, R4;\n"
- "MAD R2.xyz, R1.w, R0, R2;\n"
- "ADD R6.xyz, R2, -R5;\n"
- "MUL R4.xyz, R1, c[5].z;\n"
- "MUL R2.xyz, R0, c[6].x;\n"
- "SGE R2.xyz, R2, R0.w;\n"
- "MAD R2.xyz, R2, R6, R5;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "SGE R4.xyz, R4, R1.w;\n"
- "MAD R2.xyz, R4, R2, R3;\n"
+ "MAD R4.xyz, R0.w, R3, -R0;\n"
+ "MAD R3.xyz, R1, c[5].y, -R1.w;\n"
+ "MUL R4.xyz, R3, R4;\n"
+ "ADD R6.xyz, R5, c[6].x;\n"
+ "MUL R5.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, R3, R1.w;\n"
+ "MUL R3.xyz, R1, c[5].y;\n"
+ "MAD R6.xyz, -R5, R6, R1.w;\n"
+ "MAD R4.xyz, R1.w, R0, R4;\n"
+ "MAD R5.xyz, -R0, R6, R4;\n"
+ "MUL R4.xyz, R0, c[5].w;\n"
+ "MUL R6.xyz, R0, R6;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, -R0, R2, R4;\n"
+ "MUL R2.xyz, R0, R2;\n"
+ "SGE R3.xyz, R3, R1.w;\n"
+ "MAD R2.xyz, R3, R4, R2;\n"
"ADD R2.w, -R0, c[5].x;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, R1.w, R0.w;\n"
- "ADD R2.y, -R1.w, c[5].x;\n"
- "MAD result.color.xyz, R0, R2.y, R1;\n"
- "MAD result.color.w, -R1, R0, R2.x;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R1.x, R1.w, R0.w;\n"
+ "ADD R1.y, -R1.w, c[5].x;\n"
+ "MAD result.color.xyz, R0, R1.y, R2;\n"
+ "MAD result.color.w, -R1, R0, R1.x;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 2 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6834,18 +6827,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R1.x, -R0, c[5];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R3.xyz, R1.w, R0;\n"
"MUL R2.xyz, R1, R0.w;\n"
"ADD R0.xyz, R1, R0;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R1.x, R1.w, R0.w;\n"
- "MAD result.color.xyz, -R2, c[5].x, R0;\n"
+ "MAD result.color.xyz, -R2, c[5].y, R0;\n"
"MAD result.color.w, -R1, R0, R1.x;\n"
"END\n"
;
@@ -6853,7 +6845,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 2, 1 } };\n"
+ " { 1, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6864,20 +6856,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "ADD R1.x, -R0, c[5];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R0, R0.zwzw, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"MUL R2.xyz, R1, R0;\n"
- "MAD R2.xyz, -R2, c[5].x, R3;\n"
- "ADD R2.w, -R0, c[5].y;\n"
+ "MAD R2.xyz, -R2, c[5].y, R3;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
"ADD R2.x, R1.w, R0.w;\n"
- "ADD R2.y, -R1.w, c[5];\n"
+ "ADD R2.y, -R1.w, c[5].x;\n"
"MAD result.color.xyz, R0, R2.y, R1;\n"
"MAD result.color.w, -R1, R0, R2.x;\n"
"END\n"
@@ -6885,29 +6876,31 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_MASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..6] };\n"
+ "PARAM c[8] = { program.local[0..6],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
- "ADD R1.xyz, R0, c[3];\n"
- "RCP R0.z, R1.z;\n"
- "MUL R0.zw, R1.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[0];\n"
- "MOV R1.y, -R1;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R0.zw, R0, c[0].xyxy;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
"ADD R0.xy, fragment.position, c[5];\n"
"MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "TEX R1.x, R1, texture[1], 2D;\n"
- "DP4 R0.x, R0, c[6];\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
- "MUL result.color, R1, R0.x;\n"
+ "DP4 R1.y, R0, c[6];\n"
+ "ADD R1.x, -R1, c[7];\n"
+ "MUL R0, fragment.color.primary, R1.x;\n"
+ "MUL result.color, R0, R1.y;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[4] = { program.local[0..3] };\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
@@ -6915,8 +6908,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
- "MOV R0.y, -R0;\n"
"TEX R0.x, R0, texture[0], 2D;\n"
+ "ADD R0.x, -R0, c[4];\n"
"MUL result.color, fragment.color.primary, R0.x;\n"
"END\n"
;
diff --git a/src/opengl/util/generator.cpp b/src/opengl/util/generator.cpp
index 62d19ff..0202fe1 100644
--- a/src/opengl/util/generator.cpp
+++ b/src/opengl/util/generator.cpp
@@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE
QT_USE_NAMESPACE
+#define TAB " "
+
typedef QPair<QString, QString> QStringPair;
QString readSourceFile(const QString &sourceFile, bool fragmentProgram = false)
@@ -243,6 +245,30 @@ QString trimmed(QString source)
return result;
}
+void writeVariablesEnum(QTextStream &out, const char *name, const QSet<QString> &s)
+{
+ out << "enum " << name << " {";
+ QSet<QString>::const_iterator it = s.begin();
+ if (it != s.end()) {
+ out << "\n" TAB "VAR_" << it->toUpper();
+ for (++it; it != s.end(); ++it)
+ out << ",\n" TAB "VAR_" << it->toUpper();
+ }
+ out << "\n};\n\n";
+}
+
+void writeTypesEnum(QTextStream &out, const char *name, const QList<QStringPair> &s)
+{
+ out << "enum " << name << " {";
+ QList<QStringPair>::const_iterator it = s.begin();
+ if (it != s.end()) {
+ out << "\n" TAB << it->first;
+ for (++it; it != s.end(); ++it)
+ out << ",\n" TAB << it->first;
+ }
+ out << "\n};\n\n";
+}
+
void writeIncludeFile(const QSet<QString> &variables,
const QList<QStringPair> &brushes,
const QList<QStringPair> &compositionModes,
@@ -257,7 +283,7 @@ void writeIncludeFile(const QSet<QString> &variables,
QTextStream out(&includeFile);
- QLatin1String tab(" ");
+ QLatin1String tab(TAB);
out << "/****************************************************************************\n"
"**\n"
@@ -265,7 +291,7 @@ void writeIncludeFile(const QSet<QString> &variables,
"** All rights reserved.\n"
"** Contact: Nokia Corporation (qt-info@nokia.com)\n"
"**\n"
- "** This file is part of the test suite of the Qt Toolkit.\n"
+ "** This file is part of the QtOpenGL module of the Qt Toolkit.\n"
"**\n"
"** $QT_BEGIN_LICENSE:LGPL$\n"
"** No Commercial Usage\n"
@@ -315,25 +341,10 @@ void writeIncludeFile(const QSet<QString> &variables,
"//\n"
"\n";
- out << "enum FragmentVariable {\n";
- foreach (QString str, variables)
- out << tab << "VAR_" << str.toUpper() << ",\n";
- out << "};\n\n";
-
- out << "enum FragmentBrushType {\n";
- foreach (QStringPair brush, brushes)
- out << tab << brush.first << ",\n";
- out << "};\n\n";
-
- out << "enum FragmentCompositionModeType {\n";
- foreach (QStringPair mode, compositionModes)
- out << tab << mode.first << ",\n";
- out << "};\n\n";
-
- out << "enum FragmentMaskType {\n";
- foreach (QStringPair mask, masks)
- out << tab << mask.first << ",\n";
- out << "};\n\n";
+ writeVariablesEnum(out, "FragmentVariable", variables);
+ writeTypesEnum(out, "FragmentBrushType", brushes);
+ writeTypesEnum(out, "FragmentCompositionModeType", compositionModes);
+ writeTypesEnum(out, "FragmentMaskType", masks);
out << "static const unsigned int num_fragment_variables = " << variables.size() << ";\n\n";
out << "static const unsigned int num_fragment_brushes = " << brushes.size() << ";\n";
diff --git a/src/opengl/util/masks.conf b/src/opengl/util/masks.conf
index 733ac81..d853d0b 100644
--- a/src/opengl/util/masks.conf
+++ b/src/opengl/util/masks.conf
@@ -1,3 +1,2 @@
FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA trap_exact_aa.glsl
FRAGMENT_PROGRAM_MASK_ELLIPSE_AA ellipse_aa.glsl
-#FRAGMENT_PROGRAM_MASK_ELLIPSE ellipse.glsl
diff --git a/src/opengl/util/pattern_brush.glsl b/src/opengl/util/pattern_brush.glsl
index e070449..31702b8 100644
--- a/src/opengl/util/pattern_brush.glsl
+++ b/src/opengl/util/pattern_brush.glsl
@@ -17,9 +17,7 @@ vec4 brush()
coords *= inv_brush_texture_size;
- coords.y = -coords.y;
-
- float alpha = texture2D(brush_texture, coords).r;
+ float alpha = 1.0 - texture2D(brush_texture, coords).r;
return gl_Color * alpha;
}
diff --git a/src/opengl/util/simple_porter_duff.glsl b/src/opengl/util/simple_porter_duff.glsl
index 83aef48..4cb0599 100644
--- a/src/opengl/util/simple_porter_duff.glsl
+++ b/src/opengl/util/simple_porter_duff.glsl
@@ -7,10 +7,10 @@ vec4 composite(vec4 src, vec4 dst)
result.xyz = porterduff_ab.x * src.xyz * dst.a
+ porterduff_ab.y * dst.xyz * src.a
- + porterduff_xyz.y * src.xyz * (1 - dst.a)
- + porterduff_xyz.z * dst.xyz * (1 - src.a);
+ + porterduff_xyz.y * src.xyz * (1.0 - dst.a)
+ + porterduff_xyz.z * dst.xyz * (1.0 - src.a);
- result.a = dot(porterduff_xyz, vec3(src.a * dst.a, src.a * (1 - dst.a), dst.a * (1 - src.a)));
+ result.a = dot(porterduff_xyz, vec3(src.a * dst.a, src.a * (1.0 - dst.a), dst.a * (1.0 - src.a)));
return result;
}
diff --git a/src/opengl/util/trap_exact_aa.glsl b/src/opengl/util/trap_exact_aa.glsl
index b96f87d..1637f43 100644
--- a/src/opengl/util/trap_exact_aa.glsl
+++ b/src/opengl/util/trap_exact_aa.glsl
@@ -14,7 +14,7 @@ float quad_aa()
vec2 invA = gl_TexCoord[0].zw;
// transform right line to left to be able to use same calculations for both
- vecX.zw = 2 * gl_FragCoord.x - vecX.zw;
+ vecX.zw = 2.0 * gl_FragCoord.x - vecX.zw;
vec2 topX = vec2(vecX.x, vecX.z);
vec2 bottomX = vec2(vecX.y, vecX.w);
@@ -33,18 +33,18 @@ float quad_aa()
vec2 temp = mix(area - 0.5 * (right - bottomXTemp) * (intersectY.yw - bottom), // left < bottom < right < top
(0.5 * (topXTemp + bottomXTemp) - left) * area, // left < bottom < top < right
- step(topXTemp, right));
+ step(topXTemp, right.xx));
vec2 excluded = 0.5 * (top - intersectY.xz) * (topXTemp - left); // bottom < left < top < right
excluded = mix((top - 0.5 * (intersectY.yw + intersectY.xz)) * (right - left), // bottom < left < right < top
- excluded, step(topXTemp, right));
+ excluded, step(topXTemp, right.xx));
excluded = mix(temp, // left < bottom < right (see calculation of temp)
- excluded, step(bottomXTemp, left));
+ excluded, step(bottomXTemp, left.xx));
excluded = mix(vec2(area, area), // right < bottom < top
- excluded, step(bottomXTemp, right));
+ excluded, step(bottomXTemp, right.xx));
excluded *= step(left, topXTemp);
@@ -53,6 +53,6 @@ float quad_aa()
void main()
{
- gl_FragColor = quad_aa();
+ gl_FragColor = quad_aa().xxxx;
}
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index e0c99d7..da07c1d 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -2872,6 +2872,24 @@ void qt_vg_drawVGImage(QPainter *painter, const QPointF& pos, VGImage vgImg)
drawVGImage(engine->vgPrivate(), pos, vgImg);
}
+// Used by qpixmapfilter_vg.cpp to draw filtered VGImage's as a stencil.
+void qt_vg_drawVGImageStencil
+ (QPainter *painter, const QPointF& pos, VGImage vgImg, const QBrush& brush)
+{
+ QVGPaintEngine *engine =
+ static_cast<QVGPaintEngine *>(painter->paintEngine());
+
+ QVGPaintEnginePrivate *d = engine->vgPrivate();
+
+ QTransform transform(d->imageTransform);
+ transform.translate(pos.x(), pos.y());
+ d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform);
+
+ d->ensureBrush(brush);
+ d->setImageMode(VG_DRAW_IMAGE_STENCIL);
+ vgDrawImage(vgImg);
+}
+
void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
QPixmapData *pd = pm.pixmapData();
@@ -3328,9 +3346,6 @@ QPixmapFilter *QVGPaintEngine::pixmapFilter(int type, const QPixmapFilter *proto
d->convolutionFilter.reset(new QVGPixmapConvolutionFilter);
return d->convolutionFilter.data();
case QPixmapFilter::ColorizeFilter:
- // Strength parameter does not work with current implementation.
- if ((static_cast<const QPixmapColorizeFilter *>(prototype))->strength() != 1.0f)
- break;
if (!d->colorizeFilter)
d->colorizeFilter.reset(new QVGPixmapColorizeFilter);
return d->colorizeFilter.data();
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 2003f3b..f86e116 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -101,6 +101,11 @@ QVGPixmapData::~QVGPixmapData()
#endif
}
+QPixmapData *QVGPixmapData::createCompatiblePixmapData() const
+{
+ return new QVGPixmapData(pixelType());
+}
+
bool QVGPixmapData::isValid() const
{
return (w > 0 && h > 0);
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index 99115df..f552c7b 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -72,6 +72,8 @@ public:
QVGPixmapData(PixelType type);
~QVGPixmapData();
+ QPixmapData *createCompatiblePixmapData() const;
+
// Is this pixmap valid (i.e. non-zero in size)?
bool isValid() const;
diff --git a/src/openvg/qpixmapfilter_vg.cpp b/src/openvg/qpixmapfilter_vg.cpp
index 613f4ea..8e104db 100644
--- a/src/openvg/qpixmapfilter_vg.cpp
+++ b/src/openvg/qpixmapfilter_vg.cpp
@@ -58,6 +58,8 @@ QVGPixmapConvolutionFilter::~QVGPixmapConvolutionFilter()
extern void qt_vg_drawVGImage
(QPainter *painter, const QPointF& pos, VGImage vgImg);
+extern void qt_vg_drawVGImageStencil
+ (QPainter *painter, const QPointF& pos, VGImage vgImg, const QBrush& brush);
void QVGPixmapConvolutionFilter::draw
(QPainter *painter, const QPointF &dest,
@@ -123,8 +125,7 @@ void QVGPixmapConvolutionFilter::draw
}
QVGPixmapColorizeFilter::QVGPixmapColorizeFilter()
- : QPixmapColorizeFilter(),
- firstTime(true)
+ : QPixmapColorizeFilter()
{
}
@@ -136,7 +137,7 @@ void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const
{
if (src.pixmapData()->classId() != QPixmapData::OpenVGClass) {
// The pixmap data is not an instance of QVGPixmapData, so fall
- // back to the default convolution filter implementation.
+ // back to the default colorize filter implementation.
QPixmapColorizeFilter::draw(painter, dest, src, srcRect);
return;
}
@@ -154,50 +155,45 @@ void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const
if (dstImage == VG_INVALID_HANDLE)
return;
- // Recompute the color matrix if the color has changed.
+ // Determine the weights for the matrix from the color and strength.
QColor c = color();
- if (c != prevColor || firstTime) {
- prevColor = c;
-
- // Determine the weights for the matrix from the color.
- VGfloat weights[3];
- VGfloat invweights[3];
- VGfloat alpha = c.alphaF();
- weights[0] = c.redF() * alpha;
- weights[1] = c.greenF() * alpha;
- weights[2] = c.blueF() * alpha;
- invweights[0] = 1.0f - weights[0];
- invweights[1] = 1.0f - weights[1];
- invweights[2] = 1.0f - weights[2];
-
- // Grayscale weights.
- static const VGfloat redGray = 11.0f / 32.0f;
- static const VGfloat greenGray = 16.0f / 32.0f;
- static const VGfloat blueGray = 1.0f - (redGray + greenGray);
-
- matrix[0][0] = redGray * invweights[0];
- matrix[0][1] = redGray * invweights[1];
- matrix[0][2] = redGray * invweights[2];
- matrix[0][3] = 0.0f;
- matrix[1][0] = greenGray * invweights[0];
- matrix[1][1] = greenGray * invweights[1];
- matrix[1][2] = greenGray * invweights[2];
- matrix[1][3] = 0.0f;
- matrix[2][0] = blueGray * invweights[0];
- matrix[2][1] = blueGray * invweights[1];
- matrix[2][2] = blueGray * invweights[2];
- matrix[2][3] = 0.0f;
- matrix[3][0] = 0.0f;
- matrix[3][1] = 0.0f;
- matrix[3][2] = 0.0f;
- matrix[3][3] = 1.0f;
- matrix[4][0] = weights[0];
- matrix[4][1] = weights[1];
- matrix[4][2] = weights[2];
- matrix[4][3] = 0.0f;
- }
-
- firstTime = false;
+ VGfloat strength = this->strength();
+ VGfloat weights[3];
+ VGfloat invweights[3];
+ VGfloat alpha = c.alphaF();
+ weights[0] = c.redF() * alpha;
+ weights[1] = c.greenF() * alpha;
+ weights[2] = c.blueF() * alpha;
+ invweights[0] = (1.0f - weights[0]) * strength;
+ invweights[1] = (1.0f - weights[1]) * strength;
+ invweights[2] = (1.0f - weights[2]) * strength;
+
+ // Grayscale weights.
+ static const VGfloat redGray = 11.0f / 32.0f;
+ static const VGfloat greenGray = 16.0f / 32.0f;
+ static const VGfloat blueGray = 1.0f - (redGray + greenGray);
+
+ VGfloat matrix[5][4];
+ matrix[0][0] = redGray * invweights[0] + (1.0f - strength);
+ matrix[0][1] = redGray * invweights[1];
+ matrix[0][2] = redGray * invweights[2];
+ matrix[0][3] = 0.0f;
+ matrix[1][0] = greenGray * invweights[0];
+ matrix[1][1] = greenGray * invweights[1] + (1.0f - strength);
+ matrix[1][2] = greenGray * invweights[2];
+ matrix[1][3] = 0.0f;
+ matrix[2][0] = blueGray * invweights[0];
+ matrix[2][1] = blueGray * invweights[1];
+ matrix[2][2] = blueGray * invweights[2] + (1.0f - strength);
+ matrix[2][3] = 0.0f;
+ matrix[3][0] = 0.0f;
+ matrix[3][1] = 0.0f;
+ matrix[3][2] = 0.0f;
+ matrix[3][3] = 1.0f;
+ matrix[4][0] = weights[0] * strength;
+ matrix[4][1] = weights[1] * strength;
+ matrix[4][2] = weights[2] * strength;
+ matrix[4][3] = 0.0f;
vgColorMatrix(dstImage, srcImage, matrix[0]);
@@ -219,8 +215,7 @@ void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const
}
QVGPixmapDropShadowFilter::QVGPixmapDropShadowFilter()
- : QPixmapDropShadowFilter(),
- firstTime(true)
+ : QPixmapDropShadowFilter()
{
}
@@ -244,49 +239,11 @@ void QVGPixmapDropShadowFilter::draw(QPainter *painter, const QPointF &dest, con
return;
QSize size = pd->size();
- VGImage tmpImage = vgCreateImage
- (VG_sARGB_8888_PRE, size.width(), size.height(),
- VG_IMAGE_QUALITY_FASTER);
- if (tmpImage == VG_INVALID_HANDLE)
- return;
-
VGImage dstImage = vgCreateImage
- (VG_sARGB_8888_PRE, size.width(), size.height(),
+ (VG_A_8, size.width(), size.height(),
VG_IMAGE_QUALITY_FASTER);
- if (dstImage == VG_INVALID_HANDLE) {
- vgDestroyImage(tmpImage);
+ if (dstImage == VG_INVALID_HANDLE)
return;
- }
-
- // Recompute the color matrix if the color has changed.
- QColor c = color();
- if (c != prevColor || firstTime) {
- prevColor = c;
-
- matrix[0][0] = 0.0f;
- matrix[0][1] = 0.0f;
- matrix[0][2] = 0.0f;
- matrix[0][3] = 0.0f;
- matrix[1][0] = 0.0f;
- matrix[1][1] = 0.0f;
- matrix[1][2] = 0.0f;
- matrix[1][3] = 0.0f;
- matrix[2][0] = 0.0f;
- matrix[2][1] = 0.0f;
- matrix[2][2] = 0.0f;
- matrix[2][3] = 0.0f;
- matrix[3][0] = c.redF();
- matrix[3][1] = c.greenF();
- matrix[3][2] = c.blueF();
- matrix[3][3] = c.alphaF();
- matrix[4][0] = 0.0f;
- matrix[4][1] = 0.0f;
- matrix[4][2] = 0.0f;
- matrix[4][3] = 0.0f;
- }
-
- // Blacken the source image.
- vgColorMatrix(tmpImage, srcImage, matrix[0]);
// Clamp the radius range. We divide by 2 because the OpenVG blur
// is "too blurry" compared to the default raster implementation.
@@ -298,9 +255,7 @@ void QVGPixmapDropShadowFilter::draw(QPainter *painter, const QPointF &dest, con
radiusF = maxRadius;
// Blur the blackened source image.
- vgGaussianBlur(dstImage, tmpImage, radiusF, radiusF, VG_TILE_PAD);
-
- firstTime = false;
+ vgGaussianBlur(dstImage, srcImage, radiusF, radiusF, VG_TILE_PAD);
VGImage child = VG_INVALID_HANDLE;
@@ -314,11 +269,10 @@ void QVGPixmapDropShadowFilter::draw(QPainter *painter, const QPointF &dest, con
child = vgChildImage(dstImage, srect.x(), srect.y(), srect.width(), srect.height());
}
- qt_vg_drawVGImage(painter, dest + offset(), child);
+ qt_vg_drawVGImageStencil(painter, dest + offset(), child, color());
if(child != dstImage)
vgDestroyImage(child);
- vgDestroyImage(tmpImage);
vgDestroyImage(dstImage);
// Now draw the actual pixmap over the top.
diff --git a/src/openvg/qpixmapfilter_vg_p.h b/src/openvg/qpixmapfilter_vg_p.h
index 58111ec..efbbc7b 100644
--- a/src/openvg/qpixmapfilter_vg_p.h
+++ b/src/openvg/qpixmapfilter_vg_p.h
@@ -79,11 +79,6 @@ public:
~QVGPixmapColorizeFilter();
void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const;
-
-private:
- mutable VGfloat matrix[5][4];
- mutable QColor prevColor;
- mutable bool firstTime;
};
class Q_OPENVG_EXPORT QVGPixmapDropShadowFilter : public QPixmapDropShadowFilter
@@ -94,11 +89,6 @@ public:
~QVGPixmapDropShadowFilter();
void draw(QPainter *p, const QPointF &pos, const QPixmap &px, const QRectF &src) const;
-
-private:
- mutable VGfloat matrix[5][4];
- mutable QColor prevColor;
- mutable bool firstTime;
};
class Q_OPENVG_EXPORT QVGPixmapBlurFilter : public QPixmapBlurFilter
diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp
index 6cc2e27..661e06a 100644
--- a/src/openvg/qwindowsurface_vg.cpp
+++ b/src/openvg/qwindowsurface_vg.cpp
@@ -111,7 +111,7 @@ QPaintEngine *QVGWindowSurface::paintEngine() const
int QVGWindowSurface::metric(PaintDeviceMetric met) const
{
- return window()->metric(met);
+ return qt_paint_device_metric(window(), met);
}
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
index 8662df6..57b1950 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
@@ -207,7 +207,7 @@ void QDirectFBMouseHandlerPrivate::readMouseData()
int wheel = 0;
if (input.type == DIET_AXISMOTION) {
-#ifdef QT_NO_DIRECTFB_LAYER
+#if defined(QT_NO_DIRECTFB_LAYER) || defined(QT_DIRECTFB_WINDOW_AS_CURSOR)
if (input.flags & DIEF_AXISABS) {
switch (input.axis) {
case DIAI_X: x = input.axisabs; break;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 0f7a6de..449bc0d 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -99,8 +99,11 @@ public:
qint64 cursorImageKey;
QDirectFBScreen *q;
+ static QDirectFBScreen *instance;
};
+QDirectFBScreen *QDirectFBScreenPrivate::instance = 0;
+
QDirectFBScreenPrivate::QDirectFBScreenPrivate(QDirectFBScreen *qptr)
: QWSGraphicsSystem(qptr), dfb(0), flipFlags(DSFLIP_NONE),
directFBFlags(QDirectFBScreen::NoFlags), alphaPixmapFormat(QImage::Format_Invalid),
@@ -802,13 +805,21 @@ void QDirectFBScreenCursor::set(const QImage &image, int hotx, int hoty)
QDirectFBScreen::QDirectFBScreen(int display_id)
: QScreen(display_id, DirectFBClass), d_ptr(new QDirectFBScreenPrivate(this))
{
+ QDirectFBScreenPrivate::instance = this;
}
QDirectFBScreen::~QDirectFBScreen()
{
+ if (QDirectFBScreenPrivate::instance == this)
+ QDirectFBScreenPrivate::instance = 0;
delete d_ptr;
}
+QDirectFBScreen *QDirectFBScreen::instance()
+{
+ return QDirectFBScreenPrivate::instance;
+}
+
int QDirectFBScreen::depth(DFBSurfacePixelFormat format)
{
switch (format) {
@@ -1050,6 +1061,26 @@ static inline bool setIntOption(const QStringList &arguments, const QString &var
return false;
}
+static inline QColor colorFromName(const QString &name)
+{
+ QRegExp rx("#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])");
+ rx.setCaseSensitivity(Qt::CaseInsensitive);
+ if (rx.exactMatch(name)) {
+ Q_ASSERT(rx.numCaptures() == 4);
+ int ints[4];
+ int i;
+ for (i=0; i<4; ++i) {
+ bool ok;
+ ints[i] = rx.cap(i + 1).toUInt(&ok, 16);
+ if (!ok || ints[i] > 255)
+ break;
+ }
+ if (i == 4)
+ return QColor(ints[0], ints[1], ints[2], ints[3]);
+ }
+ return QColor(name);
+}
+
bool QDirectFBScreen::connect(const QString &displaySpec)
{
DFBResult result = DFB_OK;
@@ -1282,18 +1313,50 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
#endif
#ifdef QT_DIRECTFB_WM
surface->Release(surface);
+ QColor backgroundColor;
#else
- QRegExp backgroundColorRegExp(QLatin1String("bgcolor=?(.+)"));
+ QColor &backgroundColor = d_ptr->backgroundColor;
+#endif
+
+ QRegExp backgroundColorRegExp(QLatin1String("bgcolor=(.+)"));
backgroundColorRegExp.setCaseSensitivity(Qt::CaseInsensitive);
if (displayArgs.indexOf(backgroundColorRegExp) != -1) {
- d_ptr->backgroundColor.setNamedColor(backgroundColorRegExp.cap(1));
+ backgroundColor = colorFromName(backgroundColorRegExp.cap(1));
}
- if (!d_ptr->backgroundColor.isValid())
- d_ptr->backgroundColor = Qt::green;
- d_ptr->primarySurface->Clear(d_ptr->primarySurface, d_ptr->backgroundColor.red(),
- d_ptr->backgroundColor.green(), d_ptr->backgroundColor.blue(),
- d_ptr->backgroundColor.alpha());
+#ifdef QT_NO_DIRECTFB_WM
+ if (!backgroundColor.isValid())
+ backgroundColor = Qt::green;
+ d_ptr->primarySurface->Clear(d_ptr->primarySurface, backgroundColor.red(),
+ backgroundColor.green(), backgroundColor.blue(),
+ backgroundColor.alpha());
d_ptr->primarySurface->Flip(d_ptr->primarySurface, 0, d_ptr->flipFlags);
+#else
+ if (backgroundColor.isValid()) {
+ DFBResult result = d_ptr->dfbLayer->SetCooperativeLevel(d_ptr->dfbLayer, DLSCL_ADMINISTRATIVE);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBScreen::connect "
+ "Unable to set cooperative level", result);
+ }
+ result = d_ptr->dfbLayer->SetBackgroundColor(d_ptr->dfbLayer, backgroundColor.red(), backgroundColor.green(),
+ backgroundColor.blue(), backgroundColor.alpha());
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBScreenCursor::connect: "
+ "Unable to set background color", result);
+ }
+
+ result = d_ptr->dfbLayer->SetBackgroundMode(d_ptr->dfbLayer, DLBM_COLOR);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBScreenCursor::connect: "
+ "Unable to set background mode", result);
+ }
+
+ result = d_ptr->dfbLayer->SetCooperativeLevel(d_ptr->dfbLayer, DLSCL_SHARED);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBScreen::connect "
+ "Unable to set cooperative level", result);
+ }
+
+ }
#endif
return true;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 5e8c5c6..0520cdc 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -54,8 +54,8 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
-#if !defined QT_NO_DIRECTFB_SUBSURFACE && !defined QT_DIRECTFB_SUBSURFACE
-#define QT_DIRECTFB_SUBSURFACE
+#if !defined QT_DIRECTFB_SUBSURFACE && !defined QT_NO_DIRECTFB_SUBSURFACE
+#define QT_NO_DIRECTFB_SUBSURFACE
#endif
#if !defined QT_NO_DIRECTFB_LAYER && !defined QT_DIRECTFB_LAYER
#define QT_DIRECTFB_LAYER
@@ -163,12 +163,7 @@ public:
QWSWindowSurface *createSurface(QWidget *widget) const;
QWSWindowSurface *createSurface(const QString &key) const;
- static inline QDirectFBScreen *instance() {
- QScreen *inst = QScreen::instance();
- Q_ASSERT(!inst || inst->classId() == QScreen::DirectFBClass);
- return static_cast<QDirectFBScreen*>(inst);
- }
-
+ static QDirectFBScreen *instance();
void waitIdle();
IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
#ifdef QT_DIRECTFB_SUBSURFACE
diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c
index ac9dc8d..17345a9 100644
--- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c
+++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c
@@ -617,6 +617,16 @@ void pvrQwsGetGeometry(PvrQwsDrawable *drawable, PvrQwsRect *rect)
*rect = drawable->rect;
}
+void pvrQwsSetRotation(PvrQwsDrawable *drawable, int angle)
+{
+ if (drawable->rotationAngle != angle) {
+ drawable->rotationAngle = angle;
+
+ /* Force the buffers to be recreated if the rotation angle changes */
+ pvrQwsInvalidateBuffers(drawable);
+ }
+}
+
int pvrQwsGetStride(PvrQwsDrawable *drawable)
{
if (drawable->backBuffersValid)
@@ -818,63 +828,3 @@ void pvrQwsSetSwapFunction
drawable->swapFunction = func;
drawable->userData = userData;
}
-
-unsigned long pvrQwsGetMemoryId(PvrQwsDrawable *drawable)
-{
- unsigned long addr;
- unsigned long start;
- unsigned long end;
- unsigned long off;
- unsigned long offset;
- FILE *file;
- char buffer[BUFSIZ];
- char flags[16];
-
- if (!drawable->backBuffersValid)
- return 0;
- addr = (unsigned long)
- (drawable->backBuffers[drawable->currentBackBuffer]->pBase);
-
- /* Search /proc/self/maps for the memory region that contains "addr".
- The file offset for that memory region is the identifier we need */
- file = fopen("/proc/self/maps", "r");
- if (!file) {
- perror("/proc/self/maps");
- return 0;
- }
- offset = 0;
- while (fgets(buffer, sizeof(buffer), file)) {
- if (sscanf(buffer, "%lx-%lx %s %lx",
- &start, &end, flags, &off) < 4)
- continue;
- if (start <= addr && addr < end) {
- offset = off;
- break;
- }
- }
- fclose(file);
- return offset;
-}
-
-void *pvrQwsMapMemory(unsigned long id, int size)
-{
- void *addr;
- int fd = open("/dev/pvrsrv", O_RDWR, 0);
- if (fd < 0) {
- perror("/dev/pvrsrv");
- return 0;
- }
- addr = mmap(0, (size_t)size, PROT_READ | PROT_WRITE,
- MAP_SHARED, fd, (off_t)id);
- if (addr == (void *)(-1)) {
- perror("mmap pvr memory region");
- addr = 0;
- }
- close(fd);
- return addr;
-}
-
-void pvrQwsUnmapMemory(void *addr, int size)
-{
- munmap(addr, size);
-}
diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h
index 952ff6f..55e0310 100644
--- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h
+++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h
@@ -126,6 +126,9 @@ void pvrQwsSetGeometry(PvrQwsDrawable *drawable, const PvrQwsRect *rect);
/* Get the current geometry for a drawable */
void pvrQwsGetGeometry(PvrQwsDrawable *drawable, PvrQwsRect *rect);
+/* Set the rotation angle in degrees */
+void pvrQwsSetRotation(PvrQwsDrawable *drawable, int angle);
+
/* Get the line stride for a drawable. Returns zero if the buffers
are not allocated or have been invalidated */
int pvrQwsGetStride(PvrQwsDrawable *drawable);
@@ -159,21 +162,6 @@ int pvrQwsSwapBuffers(PvrQwsDrawable *drawable, int repaintOnly);
void pvrQwsSetSwapFunction
(PvrQwsDrawable *drawable, PvrQwsSwapFunction func, void *userData);
-/* Get a memory identifier for the indicated drawable's buffer.
- The identifier can be passed to another process and then
- passed to pvrQwsMapMemory() to map the drawable's buffer into
- the other process's address space. Returns zero if the
- memory identifier could not be determined. This should only
- be used for pixmap drawables */
-unsigned long pvrQwsGetMemoryId(PvrQwsDrawable *drawable);
-
-/* Map the memory buffer of a foreign application's drawable, as
- indicated by "id" and "size". Returns null if the map failed */
-void *pvrQwsMapMemory(unsigned long id, int size);
-
-/* Unmap the memory obtained from pvrQwsMapMemory() */
-void pvrQwsUnmapMemory(void *addr, int size);
-
#ifdef __cplusplus
};
#endif
diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h
index cf80a90..dcd4e4f 100644
--- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h
+++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h
@@ -114,6 +114,7 @@ struct _PvrQwsDrawable
int isFullScreen;
int strideBytes;
int stridePixels;
+ int rotationAngle;
PvrQwsSwapFunction swapFunction;
void *userData;
PvrQwsDrawable *nextWinId;
diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
index 253f39f..28b2251 100644
--- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
+++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
@@ -132,6 +132,16 @@ static WSEGLError wseglCloseDisplay(WSEGLDisplayHandle display)
return WSEGL_SUCCESS;
}
+static WSEGLRotationAngle wseglRotationValue(int degrees)
+{
+ switch (degrees) {
+ case 90: return WSEGL_ROTATE_90;
+ case 180: return WSEGL_ROTATE_180;
+ case 270: return WSEGL_ROTATE_270;
+ default: return WSEGL_ROTATE_0;
+ }
+}
+
/* Create the WSEGL drawable version of a native window */
static WSEGLError wseglCreateWindowDrawable
(WSEGLDisplayHandle display, WSEGLConfig *config,
@@ -152,7 +162,7 @@ static WSEGLError wseglCreateWindowDrawable
*drawable = (WSEGLDrawableHandle)screen;
if (!pvrQwsAllocBuffers(screen))
return WSEGL_OUT_OF_MEMORY;
- *rotationAngle = WSEGL_ROTATE_0;
+ *rotationAngle = wseglRotationValue(screen->rotationAngle);
return WSEGL_SUCCESS;
}
@@ -163,7 +173,7 @@ static WSEGLError wseglCreateWindowDrawable
/* The drawable is ready to go */
*drawable = (WSEGLDrawableHandle)draw;
- *rotationAngle = WSEGL_ROTATE_0;
+ *rotationAngle = wseglRotationValue(draw->rotationAngle);
if (!pvrQwsAllocBuffers(draw))
return WSEGL_OUT_OF_MEMORY;
return WSEGL_SUCCESS;
diff --git a/src/plugins/gfxdrivers/powervr/README b/src/plugins/gfxdrivers/powervr/README
index 4dce87f..513e7f5 100644
--- a/src/plugins/gfxdrivers/powervr/README
+++ b/src/plugins/gfxdrivers/powervr/README
@@ -31,9 +31,10 @@ strictly Unix-style markers.
* IMPORTANT: To build the QScreen plugin and the WSEGL library it depends *
* on, the pvr2d.h, wsegl.h headers for your platform are required. You *
* can find a copy of these headers in src/3rdparty/powervr for SGX based *
-* platforms like the TI OMAP3xxx. They may also work on MBX platforms too *
-* depending on how old your libEGL is. You can tell Qt where to find *
-* these headers by setting QMAKE_INCDIR_POWERVR in the mkspec. *
+* platforms like the TI OMAP3xxx. They probably will not work on MBX *
+* because of differences in the layout of certain PVR2D structures. *
+* You can tell Qt where to find the actual headers for your system by *
+* setting QMAKE_INCDIR_POWERVR in the mkspec. *
***************************************************************************
When you start a Qt/Embedded application, you should modify the QWS_DISPLAY
@@ -51,6 +52,11 @@ on the device with:
hellogl_es -qws
+The driver also supports screen rotation if Qt is configured with the
+-qt-gfx-transformed option and the QWS_DISPLAY variable is wrapped in a
+"Transformed" declaration:
+
+ Transformed:powervr:mmWidth40:mmHeight54:Rot90:0
Know Issues:
* A QGLWidget may not have window decorations if it is a top-level window.
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
index 61f2225..1dec9ea 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
@@ -44,6 +44,9 @@
#include "pvrqwsdrawable_p.h"
#include <QRegExp>
#include <qwindowsystem_qws.h>
+#ifndef QT_NO_QWS_TRANSFORMED
+#include <qscreentransformed_qws.h>
+#endif
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/kd.h>
@@ -62,6 +65,7 @@ PvrEglScreen::PvrEglScreen(int displayId)
ttyfd = -1;
doGraphicsMode = true;
oldKdMode = KD_TEXT;
+ parent = 0;
// Make sure that the EGL layer is initialized and the drivers loaded.
EGLDisplay dpy = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY);
@@ -192,7 +196,7 @@ bool PvrEglScreen::hasOpenGL()
QWSWindowSurface* PvrEglScreen::createSurface(QWidget *widget) const
{
if (qobject_cast<QGLWidget*>(widget))
- return new PvrEglWindowSurface(widget, (QScreen *)this, displayId);
+ return new PvrEglWindowSurface(widget, (PvrEglScreen *)this, displayId);
return QScreen::createSurface(widget);
}
@@ -206,6 +210,67 @@ QWSWindowSurface* PvrEglScreen::createSurface(const QString &key) const
}
//![1]
+#ifndef QT_NO_QWS_TRANSFORMED
+
+static const QScreen *parentScreen
+ (const QScreen *current, const QScreen *lookingFor)
+{
+ if (!current)
+ return 0;
+ switch (current->classId()) {
+ case QScreen::ProxyClass:
+ case QScreen::TransformedClass: {
+ const QScreen *child =
+ static_cast<const QProxyScreen *>(current)->screen();
+ if (child == lookingFor)
+ return current;
+ else
+ return parentScreen(child, lookingFor);
+ }
+ // Not reached.
+
+ case QScreen::MultiClass: {
+ QList<QScreen *> screens = current->subScreens();
+ foreach (QScreen *screen, screens) {
+ if (screen == lookingFor)
+ return current;
+ const QScreen *parent = parentScreen(screen, lookingFor);
+ if (parent)
+ return parent;
+ }
+ }
+ break;
+
+ default: break;
+ }
+ return 0;
+}
+
+int PvrEglScreen::transformation() const
+{
+ // We need to search for our parent screen, which is assumed to be
+ // "Transformed". If it isn't, then there is no transformation.
+ // There is no direct method to get the parent screen so we need
+ // to search every screen until we find ourselves.
+ if (!parent && qt_screen != this)
+ parent = parentScreen(qt_screen, this);
+ if (!parent)
+ return 0;
+ if (parent->classId() != QScreen::TransformedClass)
+ return 0;
+ return 90 * static_cast<const QTransformedScreen *>(parent)
+ ->transformation();
+}
+
+#else
+
+int PvrEglScreen::transformation() const
+{
+ return 0;
+}
+
+#endif
+
void PvrEglScreen::sync()
{
// Put code here to synchronize 2D and 3D operations if necessary.
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h
index 8bf42c7..5769e70 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h
@@ -46,16 +46,18 @@
#include <QGLScreen>
#include "pvrqwsdrawable.h"
+class PvrEglScreen;
+
class PvrEglScreenSurfaceFunctions : public QGLScreenSurfaceFunctions
{
public:
- PvrEglScreenSurfaceFunctions(QScreen *s, int screenNum)
+ PvrEglScreenSurfaceFunctions(PvrEglScreen *s, int screenNum)
: screen(s), displayId(screenNum) {}
bool createNativeWindow(QWidget *widget, EGLNativeWindowType *native);
private:
- QScreen *screen;
+ PvrEglScreen *screen;
int displayId;
};
@@ -80,6 +82,8 @@ public:
QWSWindowSurface* createSurface(QWidget *widget) const;
QWSWindowSurface* createSurface(const QString &key) const;
+ int transformation() const;
+
private:
void sync();
void openTty();
@@ -89,6 +93,7 @@ private:
int ttyfd, oldKdMode;
QString ttyDevice;
bool doGraphicsMode;
+ mutable const QScreen *parent;
};
#endif
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
index 2c5ac21..4a3787f 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
@@ -46,7 +46,7 @@
#include <QWSDisplay>
PvrEglWindowSurface::PvrEglWindowSurface
- (QWidget *widget, QScreen *screen, int screenNum)
+ (QWidget *widget, PvrEglScreen *screen, int screenNum)
: QWSGLWindowSurface(widget)
{
setSurfaceFlags(QWSWindowSurface::Opaque);
@@ -63,6 +63,7 @@ PvrEglWindowSurface::PvrEglWindowSurface
pvrRect.y = pos.y();
pvrRect.width = size.width();
pvrRect.height = size.height();
+ transformRects(&pvrRect, 1);
// Try to recover a previous PvrQwsDrawable object for the widget
// if there is one. This can happen when a PvrEglWindowSurface
@@ -75,6 +76,7 @@ PvrEglWindowSurface::PvrEglWindowSurface
pvrQwsSetGeometry(drawable, &pvrRect);
else
drawable = pvrQwsCreateWindow(screenNum, (long)widget, &pvrRect);
+ pvrQwsSetRotation(drawable, screen->transformation());
}
PvrEglWindowSurface::PvrEglWindowSurface()
@@ -113,7 +115,9 @@ void PvrEglWindowSurface::setGeometry(const QRect &rect)
pvrRect.y = rect.y();
pvrRect.width = rect.width();
pvrRect.height = rect.height();
+ transformRects(&pvrRect, 1);
pvrQwsSetGeometry(drawable, &pvrRect);
+ pvrQwsSetRotation(drawable, screen->transformation());
}
QWSGLWindowSurface::setGeometry(rect);
}
@@ -127,7 +131,9 @@ bool PvrEglWindowSurface::move(const QPoint &offset)
pvrRect.y = rect.y();
pvrRect.width = rect.width();
pvrRect.height = rect.height();
+ transformRects(&pvrRect, 1);
pvrQwsSetGeometry(drawable, &pvrRect);
+ pvrQwsSetRotation(drawable, screen->transformation());
}
return QWSGLWindowSurface::move(offset);
}
@@ -200,7 +206,9 @@ void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id)
pvrRect.y = rect.y();
pvrRect.width = rect.width();
pvrRect.height = rect.height();
+ transformRects(&pvrRect, 1);
pvrQwsSetVisibleRegion(drawable, &pvrRect, 1);
+ pvrQwsSetRotation(drawable, screen->transformation());
if (!pvrQwsSwapBuffers(drawable, 1))
screen->solidFill(QColor(0, 0, 0), region);
} else {
@@ -213,9 +221,53 @@ void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id)
pvrRects[index].width = rect.width();
pvrRects[index].height = rect.height();
}
+ transformRects(pvrRects, rects.size());
pvrQwsSetVisibleRegion(drawable, pvrRects, rects.size());
+ pvrQwsSetRotation(drawable, screen->transformation());
if (!pvrQwsSwapBuffers(drawable, 1))
screen->solidFill(QColor(0, 0, 0), region);
delete [] pvrRects;
}
}
+
+void PvrEglWindowSurface::transformRects(PvrQwsRect *rects, int count) const
+{
+ switch (screen->transformation()) {
+ case 0: break;
+
+ case 90:
+ {
+ for (int index = 0; index < count; ++index) {
+ int x = rects[index].y;
+ int y = screen->height() - (rects[index].x + rects[index].width);
+ rects[index].x = x;
+ rects[index].y = y;
+ qSwap(rects[index].width, rects[index].height);
+ }
+ }
+ break;
+
+ case 180:
+ {
+ for (int index = 0; index < count; ++index) {
+ int x = screen->width() - (rects[index].x + rects[index].width);
+ int y = screen->height() - (rects[index].y + rects[index].height);
+ rects[index].x = x;
+ rects[index].y = y;
+ }
+ }
+ break;
+
+ case 270:
+ {
+ for (int index = 0; index < count; ++index) {
+ int x = screen->width() - (rects[index].y + rects[index].height);
+ int y = rects[index].x;
+ rects[index].x = x;
+ rects[index].y = y;
+ qSwap(rects[index].width, rects[index].height);
+ }
+ }
+ break;
+ }
+}
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
index 58a5fb2..b0a161c 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
@@ -45,12 +45,12 @@
#include <private/qglwindowsurface_qws_p.h>
#include "pvrqwsdrawable.h"
-class QScreen;
+class PvrEglScreen;
class PvrEglWindowSurface : public QWSGLWindowSurface
{
public:
- PvrEglWindowSurface(QWidget *widget, QScreen *screen, int screenNum);
+ PvrEglWindowSurface(QWidget *widget, PvrEglScreen *screen, int screenNum);
PvrEglWindowSurface();
~PvrEglWindowSurface();
@@ -76,8 +76,10 @@ public:
private:
QWidget *widget;
PvrQwsDrawable *drawable;
- QScreen *screen;
+ PvrEglScreen *screen;
QPaintDevice *pdevice;
+
+ void transformRects(PvrQwsRect *rects, int count) const;
};
#endif
diff --git a/src/plugins/graphicssystems/shivavg/shivavgwindowsurface.cpp b/src/plugins/graphicssystems/shivavg/shivavgwindowsurface.cpp
index df623ba..955aa55 100644
--- a/src/plugins/graphicssystems/shivavg/shivavgwindowsurface.cpp
+++ b/src/plugins/graphicssystems/shivavg/shivavgwindowsurface.cpp
@@ -350,21 +350,9 @@ QPaintEngine *ShivaVGWindowSurface::paintEngine() const
return d_ptr->engine;
}
-// We need to get access to QWidget::metric() from ShivaVGWindowSurface::metric,
-// but it is not a friend of QWidget. To get around this, we create a
-// fake QX11PaintEngine class, which is a friend.
-class QX11PaintEngine
-{
-public:
- static int metric(const QWidget *widget, QPaintDevice::PaintDeviceMetric met)
- {
- return widget->metric(met);
- }
-};
-
int ShivaVGWindowSurface::metric(PaintDeviceMetric met) const
{
- return QX11PaintEngine::metric(window(), met);
+ return qt_paint_device_metric(window(), met);
}
QT_END_NAMESPACE
diff --git a/src/qt3support/widgets/q3combobox.cpp b/src/qt3support/widgets/q3combobox.cpp
index 9e7fd77..2aee4ac 100644
--- a/src/qt3support/widgets/q3combobox.cpp
+++ b/src/qt3support/widgets/q3combobox.cpp
@@ -2234,7 +2234,8 @@ bool Q3ComboBox::autoCompletion() const
return d->useCompletion;
}
-/*!\reimp
+/*!
+ \internal
*/
void Q3ComboBox::styleChange( QStyle& s )
{
diff --git a/src/qt3support/widgets/q3toolbar.cpp b/src/qt3support/widgets/q3toolbar.cpp
index dbe3afd..00ff47b 100644
--- a/src/qt3support/widgets/q3toolbar.cpp
+++ b/src/qt3support/widgets/q3toolbar.cpp
@@ -422,7 +422,7 @@ void Q3ToolBar::addSeparator()
}
/*!
- \internal
+ \internal
*/
void Q3ToolBar::styleChange(QStyle &oldStyle)
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index b1f36be..360036a 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2164,7 +2164,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
if (debugger)
debugger->evaluateStart(sourceId);
- exec->clearException();
+ clearExceptions();
JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject());
JSC::EvalExecutable executable(exec, source);
@@ -2381,7 +2381,7 @@ bool QScriptEngine::hasUncaughtException() const
{
Q_D(const QScriptEngine);
JSC::ExecState* exec = d->globalExec();
- return exec->hadException();
+ return exec->hadException() || d->currentException().isValid();
}
/*!
@@ -2398,8 +2398,13 @@ bool QScriptEngine::hasUncaughtException() const
QScriptValue QScriptEngine::uncaughtException() const
{
Q_D(const QScriptEngine);
+ QScriptValue result;
JSC::ExecState* exec = d->globalExec();
- return const_cast<QScriptEnginePrivate*>(d)->scriptValueFromJSCValue(exec->exception());
+ if (exec->hadException())
+ result = const_cast<QScriptEnginePrivate*>(d)->scriptValueFromJSCValue(exec->exception());
+ else
+ result = d->currentException();
+ return result;
}
/*!
@@ -2452,6 +2457,7 @@ void QScriptEngine::clearExceptions()
Q_D(QScriptEngine);
JSC::ExecState* exec = d->currentFrame;
exec->clearException();
+ d->clearCurrentException();
}
/*!
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index f1fc135..cde116d 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -183,6 +183,10 @@ public:
void agentDeleted(QScriptEngineAgent *agent);
+ void setCurrentException(QScriptValue exception) { m_currentException = exception; }
+ QScriptValue currentException() const { return m_currentException; }
+ void clearCurrentException() { m_currentException.d_ptr.reset(); }
+
#ifndef QT_NO_QOBJECT
JSC::JSValue newQObject(QObject *object,
QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership,
@@ -263,6 +267,7 @@ public:
QSet<QString> extensionsBeingImported;
QHash<intptr_t, QScript::UStringSourceProviderWithFeedback*> loadedScripts;
+ QScriptValue m_currentException;
#ifndef QT_NO_QOBJECT
QHash<QObject*, QScript::QObjectData*> m_qobjectData;
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index bc2eea2..0ca7ecc 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -156,6 +156,7 @@ void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& fra
QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
q_ptr->exceptionThrow(sourceID, value, hasHandler);
engine->currentFrame = oldFrame;
+ engine->setCurrentException(value);
};
void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& frame, intptr_t sourceID)
@@ -165,6 +166,7 @@ void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& fra
QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
q_ptr->exceptionCatch(sourceID, value);
engine->currentFrame = oldFrame;
+ engine->clearCurrentException();
}
void QScriptEngineAgentPrivate::atStatement(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno, int column)
diff --git a/src/script/api/qscriptvalue.h b/src/script/api/qscriptvalue.h
index 32f7a43..aba3327 100644
--- a/src/script/api/qscriptvalue.h
+++ b/src/script/api/qscriptvalue.h
@@ -70,6 +70,7 @@ typedef QList<QScriptValue> QScriptValueList;
typedef double qsreal;
class QScriptValuePrivate;
+class QScriptEnginePrivate;
struct QScriptValuePrivatePointerDeleter;
class Q_SCRIPT_EXPORT QScriptValue
{
@@ -226,6 +227,8 @@ private:
QExplicitlySharedDataPointer<QScriptValuePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptValue)
+
+ friend class QScriptEnginePrivate;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QScriptValue::ResolveFlags)
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index ff9458b..e686873 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -1455,7 +1455,7 @@ bool QODBCResult::exec()
else
#endif
{
- QByteArray str = val.toString().toUtf8();
+ QByteArray str = val.toString().toAscii();
if (*ind != SQL_NULL_DATA)
*ind = str.length();
int strSize = str.length();
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index d96755a..da695dc 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -317,11 +317,10 @@ void QTestLog::warn(const char *msg)
void QTestLog::info(const char *msg, const char *file, int line)
{
- QTEST_ASSERT(QTest::testLogger);
QTEST_ASSERT(msg);
- QTEST_ASSERT(file);
- QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line);
+ if (QTest::testLogger)
+ QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line);
}
void QTestLog::setLogMode(LogMode mode)
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index e76f0f7..0d3469d 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -151,6 +151,7 @@ private slots:
void subControlRectsWithOffset_data();
void subControlRectsWithOffset();
void task260974_menuItemRectangleForComboBoxPopup();
+ void removeItem();
protected slots:
void onEditTextChanged( const QString &newString );
@@ -2398,5 +2399,22 @@ void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
#endif
}
+void tst_QComboBox::removeItem()
+{
+ QComboBox cb;
+ cb.removeItem(-1);
+ cb.removeItem(1);
+ cb.removeItem(0);
+ QCOMPARE(cb.count(), 0);
+
+ cb.addItem("foo");
+ cb.removeItem(-1);
+ QCOMPARE(cb.count(), 1);
+ cb.removeItem(1);
+ QCOMPARE(cb.count(), 1);
+ cb.removeItem(0);
+ QCOMPARE(cb.count(), 0);
+}
+
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 2426ce9..9269164 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -2007,8 +2007,10 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
edit1->setText("QLineEdit 1");
QLineEdit *edit2 = new QLineEdit;
edit2->setText("QLineEdit 2");
+ QFontComboBox *fontComboBox = new QFontComboBox;
QVBoxLayout *vlayout = new QVBoxLayout;
vlayout->addWidget(edit1);
+ vlayout->addWidget(fontComboBox);
vlayout->addWidget(edit2);
QGroupBox *box = new QGroupBox("QGroupBox");
@@ -2020,8 +2022,10 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
edit1_2->setText("QLineEdit 1_2");
QLineEdit *edit2_2 = new QLineEdit;
edit2_2->setText("QLineEdit 2_2");
+ QFontComboBox *fontComboBox2 = new QFontComboBox;
vlayout = new QVBoxLayout;
vlayout->addWidget(edit1_2);
+ vlayout->addWidget(fontComboBox2);
vlayout->addWidget(edit2_2);
QGroupBox *box_2 = new QGroupBox("QGroupBox 2");
@@ -2062,8 +2066,10 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
EventSpy eventSpy(edit1);
EventSpy eventSpy2(edit2);
+ EventSpy eventSpy3(fontComboBox);
EventSpy eventSpy1_2(edit1_2);
EventSpy eventSpy2_2(edit2_2);
+ EventSpy eventSpy2_3(fontComboBox2);
EventSpy eventSpyBox(box);
// Tab into group box
@@ -2084,11 +2090,24 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1);
QCOMPARE(eventSpy.counts[QEvent::FocusOut], 0);
+ // Tab to the font combobox
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
+ QApplication::processEvents();
+ fontComboBox->hasFocus();
+ QVERIFY(!edit2->hasFocus());
+ QCOMPARE(eventSpy3.counts[QEvent::FocusIn], 1);
+ QCOMPARE(eventSpy3.counts[QEvent::FocusOut], 0);
+ QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1);
+ QCOMPARE(eventSpy.counts[QEvent::FocusOut], 1);
+
// Tab into line edit 2
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
QApplication::processEvents();
edit2->hasFocus();
QVERIFY(!edit1->hasFocus());
+ QCOMPARE(eventSpy2.counts[QEvent::FocusIn], 1);
+ QCOMPARE(eventSpy2.counts[QEvent::FocusOut], 0);
+ QCOMPARE(eventSpy3.counts[QEvent::FocusOut], 1);
QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1);
QCOMPARE(eventSpy.counts[QEvent::FocusOut], 1);
@@ -2106,6 +2125,16 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
QCOMPARE(eventSpy1_2.counts[QEvent::FocusIn], 1);
QCOMPARE(eventSpy1_2.counts[QEvent::FocusOut], 0);
+ // Tab into right font combobox
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
+ QApplication::processEvents();
+ QVERIFY(!edit1_2->hasFocus());
+ fontComboBox2->hasFocus();
+ QCOMPARE(eventSpy1_2.counts[QEvent::FocusIn], 1);
+ QCOMPARE(eventSpy1_2.counts[QEvent::FocusOut], 1);
+ QCOMPARE(eventSpy2_3.counts[QEvent::FocusIn], 1);
+ QCOMPARE(eventSpy2_3.counts[QEvent::FocusOut], 0);
+
// Tab into right bottom line edit
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
QApplication::processEvents();
@@ -2113,6 +2142,8 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
edit2_2->hasFocus();
QCOMPARE(eventSpy1_2.counts[QEvent::FocusIn], 1);
QCOMPARE(eventSpy1_2.counts[QEvent::FocusOut], 1);
+ QCOMPARE(eventSpy2_3.counts[QEvent::FocusIn], 1);
+ QCOMPARE(eventSpy2_3.counts[QEvent::FocusOut], 1);
QCOMPARE(eventSpy2_2.counts[QEvent::FocusIn], 1);
QCOMPARE(eventSpy2_2.counts[QEvent::FocusOut], 0);
@@ -2129,6 +2160,12 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
QVERIFY(!rightDial->hasFocus());
edit2_2->hasFocus();
+ // Backtab into the right font combobox
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
+ QApplication::processEvents();
+ QVERIFY(!edit2_2->hasFocus());
+ fontComboBox2->hasFocus();
+
// Backtab into line edit 1
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QApplication::processEvents();
@@ -2147,10 +2184,16 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
QVERIFY(!rightDial->hasFocus());
edit2->hasFocus();
- // Backtab into line edit 1
+ // Backtab into the font combobox
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QApplication::processEvents();
QVERIFY(!edit2->hasFocus());
+ fontComboBox->hasFocus();
+
+ // Backtab into line edit 1
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
+ QApplication::processEvents();
+ QVERIFY(!fontComboBox->hasFocus());
edit1->hasFocus();
// Backtab into line box
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index 920231d..3286768 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -1836,7 +1836,7 @@ void tst_QHeaderView::preserveHiddenSectionWidth()
model.insertRow(1);
view.showSection(2);
QCOMPARE(view.sectionSize(0), 100);
- QCOMPARE(view.sectionSize(1), 30);
+ QCOMPARE(view.sectionSize(1), view.defaultSectionSize());
QCOMPARE(view.sectionSize(2), 50);
}
diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro
index 6d55c13..297f868 100644
--- a/tests/auto/qlabel/qlabel.pro
+++ b/tests/auto/qlabel/qlabel.pro
@@ -1,19 +1,10 @@
load(qttest_p4)
-SOURCES += tst_qlabel.cpp
-
-wince*:{
- DEFINES += SRCDIR=\\\"\\\"
-} else:!symbian {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
-
-wince*|symbian {
- addFiles.sources = *.png testdata
+SOURCES += tst_qlabel.cpp
+wince*::DEFINES += SRCDIR=\\\"\\\"
+else:!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
+wince*|symbian {
+ addFiles.sources = *.png \
+ testdata
addFiles.path = .
DEPLOYMENT += addFiles
}
-
-
-
-
-
diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp
index dd03ef3..9eae9c9 100644
--- a/tests/auto/qlabel/tst_qlabel.cpp
+++ b/tests/auto/qlabel/tst_qlabel.cpp
@@ -50,6 +50,7 @@
#include <qlineedit.h>
#include <qmovie.h>
#include <qpicture.h>
+#include <qmessagebox.h>
//TESTED_CLASS=
//TESTED_FILES=
@@ -112,6 +113,9 @@ private slots:
void task226479_movieResize();
void emptyPixmap();
+ void unicodeText_data();
+ void unicodeText();
+
private:
QLabel *testWidget;
QPointer<Widget> test_box;
@@ -451,5 +455,59 @@ void tst_QLabel::emptyPixmap()
QCOMPARE(label1.sizeHint(), label4.sizeHint());
}
+/**
+ Test for QTBUG-4848 - unicode data corrupting QLabel display
+*/
+void tst_QLabel::unicodeText_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<QString>("languageName");
+
+ /*
+ The "glass" phrase in Thai was the initial report for bug QTBUG-4848, was
+ originally found on http://www.columbia.edu/kermit/utf8.html.
+
+ The phrase is from an internet tradition regarding a striking phrase
+ that is translated into many different languages. The utf8 strings
+ below were generated by using http://translate.google.com.
+
+ The glass phrase in Thai contains the ้ว character which manifests bug
+ QTBUG-4848
+
+ The last long phrase is an excerpt from Churchills "on the beaches"
+ speech, also translated using http://translate.google.com.
+ */
+
+ QTest::newRow("english") << QString::fromUtf8("I can eat glass and it doesn't hurt me.") << QString("english");
+ QTest::newRow("thai") << QString::fromUtf8("ฉันจะกินแก้วและไม่เจ็บฉัน") << QString("thai");
+ QTest::newRow("chinese") << QString::fromUtf8("我可以吃玻璃,并没有伤害我。") << QString("chinese");
+ QTest::newRow("arabic") << QString::fromUtf8("أستطيع أكل الزجاج ، وأنه لا يؤذيني.") << QString("arabic");
+ QTest::newRow("russian") << QString::fromUtf8("Я могу есть стекло, и не больно.") << QString("russian");
+ QTest::newRow("korean") << QString::fromUtf8("유리를 먹을 수있는, 그리고 그게 날 다치게하지 않습니다.") << QString("korean");
+ QTest::newRow("greek") << QString::fromUtf8("Μπορώ να φάτε γυαλί και δεν μου κάνει κακό.") << QString("greek");
+ QTest::newRow("german") << QString::fromUtf8("Ich kann Glas essen und es macht mich nicht heiß.") << QString("german");
+
+ QTest::newRow("thai_long") << QString::fromUtf8("เราจะต่อสู้ในทะเลและมหาสมุทร. เราจะต่อสู้ด้วยความมั่นใจเติบโตและความเจริญเติบโตในอากาศเราจะปกป้องเกาะของเราค่าใช้จ่ายใดๆอาจ."
+ "เราจะต่อสู้บนชายหาดเราจะต่อสู้ในบริเวณเชื่อมโยงไปถึงเราจะต่อสู้ในช่องและในถนนที่เราจะต่อสู้ในภูเขานั้นเราจะไม่ยอม.")
+ << QString("thai_long");
+}
+
+void tst_QLabel::unicodeText()
+{
+ const QString testDataPath("testdata/unicodeText");
+ QFETCH(QString, text);
+ QFETCH(QString, languageName);
+ QFrame frame;
+ QVBoxLayout *layout = new QVBoxLayout();
+ QLabel *label = new QLabel(text, &frame);
+ layout->addWidget(label);
+ layout->setMargin(8);
+ frame.setLayout(layout);
+ frame.show();
+ QTest::qWaitForWindowShown(&frame);
+ QVERIFY(frame.isVisible()); // was successfully sized and shown
+ testWidget->show();
+}
+
QTEST_MAIN(tst_QLabel)
#include "tst_qlabel.moc"
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 7599ce6a06..ed02317 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -116,6 +116,8 @@ private slots:
void keyboardSearch();
void shiftSelectionWithNonUniformItemSizes();
void clickOnViewportClearsSelection();
+ void task262152_setModelColumnNavigate();
+ void taskQTBUG_2233_scrollHiddenRows();
};
// Testing get/set functions
@@ -1767,6 +1769,53 @@ void tst_QListView::clickOnViewportClearsSelection()
}
+void tst_QListView::task262152_setModelColumnNavigate()
+{
+ QListView view;
+ QStandardItemModel model(3,2);
+ model.setItem(0,1,new QStandardItem("[0,1]"));
+ model.setItem(1,1,new QStandardItem("[1,1]"));
+ model.setItem(2,1,new QStandardItem("[2,1]"));
+
+ view.setModel(&model);
+ view.setModelColumn(1);
+
+ view.show();
+ QTest::qWait(30);
+ QTest::keyClick(&view, Qt::Key_Down);
+ QTest::qWait(10);
+ QCOMPARE(view.currentIndex(), model.index(1,1));
+ QTest::keyClick(&view, Qt::Key_Down);
+ QTest::qWait(10);
+ QCOMPARE(view.currentIndex(), model.index(2,1));
+
+}
+
+void tst_QListView::taskQTBUG_2233_scrollHiddenRows()
+{
+ const int rowCount = 200;
+
+ QListView view;
+ QStringListModel model(&view);
+ QStringList list;
+ for (int i = 0; i < rowCount; ++i)
+ list << QString::fromAscii("Item %1").arg(i);
+
+ model.setStringList(list);
+ view.setModel(&model);
+ view.setViewMode(QListView::ListMode);
+ view.setFlow(QListView::TopToBottom);
+ for (int i = 0; i < rowCount / 2; ++i)
+ view.setRowHidden(2 * i, true);
+ view.resize(250, 130);
+
+ for (int i = 0; i < 10; ++i) {
+ view.verticalScrollBar()->setValue(i);
+ QModelIndex index = view.indexAt(QPoint(20,0));
+ QVERIFY(index.isValid());
+ QCOMPARE(index.row(), 2 * i + 1);
+ }
+}
QTEST_MAIN(tst_QListView)
#include "tst_qlistview.moc"
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index 4eb149f..f12fa92 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -675,7 +675,13 @@ void tst_QMenu::activeSubMenuPosition()
#ifdef Q_OS_WINCE_WM
QSKIP("Not true for Windows Mobile Soft Keys", SkipSingle);
#endif
+
+#ifdef Q_OS_SYMBIAN
+ // On Symbian, QS60Style::pixelMetric(QStyle::PM_SubMenuOverlap) is different with other styles.
+ QVERIFY(sub->pos().x() < main->pos().x());
+#else
QVERIFY(sub->pos().x() > main->pos().x());
+#endif
QCOMPARE(sub->activeAction(), subAction);
}
@@ -778,6 +784,11 @@ void tst_QMenu::menuSizeHint()
int maxWidth =0;
QRect result;
foreach(QAction *action, menu.actions()) {
+#ifdef QT_SOFTKEYS_ENABLED
+ // Softkey actions are not widgets and have no geometry.
+ if (menu.actionGeometry(action).topLeft() == QPoint(0,0))
+ continue;
+#endif
maxWidth = qMax(maxWidth, menu.actionGeometry(action).width());
result |= menu.actionGeometry(action);
QCOMPARE(result.x(), left + hmargin + panelWidth);
@@ -816,6 +827,9 @@ void tst_QMenu::task258920_mouseBorder()
QSKIP("Mouse move related signals for Windows Mobile unavailable", SkipAll);
#endif
Menu258920 menu;
+ // On Symbian, styleHint(QStyle::SH_Menu_MouseTracking) in QS60Style is false.
+ // For other styles which inherit from QWindowsStyle, the value is true.
+ menu.setMouseTracking(true);
QAction *action = menu.addAction("test");
menu.popup(QApplication::desktop()->availableGeometry().center());
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index e4f267d..8ed83cb 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -238,6 +238,8 @@ private slots:
void taskQT4444_dontOverflowDashOffset();
+ void painterBegin();
+
private:
void fillData();
QColor baseColor( int k, int intensity=255 );
@@ -4312,5 +4314,43 @@ void tst_QPainter::taskQT4444_dontOverflowDashOffset()
QVERIFY(true); // Don't crash
}
+void tst_QPainter::painterBegin()
+{
+ QImage nullImage;
+ QImage indexed8Image(16, 16, QImage::Format_Indexed8);
+ QImage rgb32Image(16, 16, QImage::Format_RGB32);
+ QImage argb32Image(16, 16, QImage::Format_ARGB32_Premultiplied);
+
+ QPainter p;
+
+ // Painting on null image should fail.
+ QVERIFY(!p.begin(&nullImage));
+
+ // Check that the painter is not messed up by using it on another image.
+ QVERIFY(p.begin(&rgb32Image));
+ QVERIFY(p.end());
+
+ // If painting on indexed8 image fails, the painter state should still be OK.
+ if (p.begin(&indexed8Image))
+ QVERIFY(p.end());
+ QVERIFY(p.begin(&rgb32Image));
+ QVERIFY(p.end());
+
+ // Try opening a painter on the two different images.
+ QVERIFY(p.begin(&rgb32Image));
+ QVERIFY(!p.begin(&argb32Image));
+ QVERIFY(p.end());
+
+ // Try opening two painters on the same image.
+ QVERIFY(p.begin(&rgb32Image));
+ QPainter q;
+ QVERIFY(!q.begin(&rgb32Image));
+ QVERIFY(!q.end());
+ QVERIFY(p.end());
+
+ // Try ending an inactive painter.
+ QVERIFY(!p.end());
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
index 62b43c4..b11efa0 100644
--- a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
+++ b/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
@@ -169,7 +169,7 @@ void tst_QPauseAnimation::noTimerUpdates()
animation.start();
QTest::qWait(animation.totalDuration() + 100);
QVERIFY(animation.state() == QAbstractAnimation::Stopped);
- QCOMPARE(animation.m_updateCurrentTimeCount, 2);
+ QCOMPARE(animation.m_updateCurrentTimeCount, 1 + loopCount);
timer->setConsistentTiming(false);
}
@@ -399,6 +399,7 @@ void tst_QPauseAnimation::multipleSequentialGroups()
void tst_QPauseAnimation::zeroDuration()
{
TestablePauseAnimation animation;
+ animation.setDuration(0);
animation.start();
QTest::qWait(animation.totalDuration() + 100);
QVERIFY(animation.state() == QAbstractAnimation::Stopped);
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 51ef2da..7dd17e5 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -130,6 +130,7 @@ private slots:
void valueChanged();
void twoAnimations();
void deletedInUpdateCurrentTime();
+ void totalDuration();
};
tst_QPropertyAnimation::tst_QPropertyAnimation()
@@ -1199,5 +1200,18 @@ void tst_QPropertyAnimation::deletedInUpdateCurrentTime()
QCOMPARE(o.value(), 1000);
}
+void tst_QPropertyAnimation::totalDuration()
+{
+ QPropertyAnimation anim;
+ QCOMPARE(anim.totalDuration(), 250);
+ anim.setLoopCount(2);
+ QCOMPARE(anim.totalDuration(), 2*250);
+ anim.setLoopCount(-1);
+ QCOMPARE(anim.totalDuration(), -1);
+ anim.setDuration(0);
+ QCOMPARE(anim.totalDuration(), 0);
+}
+
+
QTEST_MAIN(tst_QPropertyAnimation)
#include "tst_qpropertyanimation.moc"
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index 283e489..82c8ccd 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -109,6 +109,7 @@ private slots:
void extension_invoctaion();
void extension();
void isEvaluatingInExtension();
+ void hasUncaughtException();
private:
double m_testProperty;
@@ -2182,5 +2183,42 @@ void tst_QScriptEngineAgent::isEvaluatingInExtension()
QVERIFY(spy->wasEvaluating);
}
+class NewSpy :public QScriptEngineAgent
+{
+ bool m_result;
+public:
+ NewSpy(QScriptEngine* eng) : QScriptEngineAgent(eng), m_result(false) {}
+ void functionExit (qint64, const QScriptValue &scriptValue)
+ {
+ if (engine()->hasUncaughtException()) m_result = true;
+ }
+
+ bool isPass() { return m_result; }
+ void reset() { m_result = false; }
+};
+
+void tst_QScriptEngineAgent::hasUncaughtException()
+{
+ QScriptEngine eng;
+ NewSpy* spy = new NewSpy(&eng);
+ eng.setAgent(spy);
+ QScriptValue scriptValue;
+
+ // Check unhandled exception.
+ eng.evaluate("function init () {Unknown.doSth ();}");
+ scriptValue = QScriptValue(eng.globalObject().property("init")).call();
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY2(spy->isPass(), "At least one of a functionExit event should set hasUncaughtException flag.");
+ spy->reset();
+
+ // Check catched exception.
+ eng.evaluate("function innerFoo() { throw new Error('ciao') }");
+ eng.evaluate("function foo() {try { innerFoo() } catch (e) {} }");
+ scriptValue = QScriptValue(eng.globalObject().property("foo")).call();
+ QVERIFY(!eng.hasUncaughtException());
+ QVERIFY2(spy->isPass(), "At least one of a functionExit event should set hasUncaughtException flag.");
+}
+
+
QTEST_MAIN(tst_QScriptEngineAgent)
#include "tst_qscriptengineagent.moc"
diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
index 832605e..6efa85b 100644
--- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
+++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
@@ -43,9 +43,15 @@
#include "qevent.h"
#include "qdialog.h"
+#include "qpushbutton.h"
#include "qdialogbuttonbox.h"
#include "private/qsoftkeymanager_p.h"
+#ifdef Q_WS_S60
+static const int s60CommandStart = 6000;
+#endif
+
+
class tst_QSoftKeyManager : public QObject
{
Q_OBJECT
@@ -171,22 +177,52 @@ void tst_QSoftKeyManager::handleCommand()
}
/*
- This tests that softkey enable state follows the state of widget that owns the action
- to which the softkey is related to.
+ This tests that the state of a widget that owns softkey action is respected when handling the softkey
+ command.
*/
void tst_QSoftKeyManager::checkSoftkeyEnableStates()
{
- QWidget w1, w2;
- w1.setEnabled(false);
- w2.setEnabled(true);
+ QDialog w;
+ QDialogButtonBox *buttons = new QDialogButtonBox(
+ QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Help,
+ Qt::Horizontal,
+ &w);
+ QPushButton *pBDefaults = buttons->button(QDialogButtonBox::RestoreDefaults);
+ QPushButton *pBHelp = buttons->button(QDialogButtonBox::Help);
+ pBHelp->setEnabled(false);
+ w.show();
+ QApplication::processEvents();
- QAction *disabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w1);
- QAction *enabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w2);
+ QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //restore defaults action
+ QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //disabled help action
- QVERIFY(disabledAction->isEnabled()==false);
- QVERIFY(enabledAction->isEnabled()==true);
+ //Verify that enabled button gets all the action trigger signals and
+ //disabled button gets none.
+ for (int i = 0; i < 10; i++) {
+ //simulate "Restore Defaults" softkey press
+ qApp->symbianHandleCommand(s60CommandStart);
+ //simulate "help" softkey press
+ qApp->symbianHandleCommand(s60CommandStart + 1);
+ }
+ QApplication::processEvents();
+ QCOMPARE(spy0.count(), 10);
+ QCOMPARE(spy1.count(), 0);
+ spy0.clear();
+ spy1.clear();
+
+ for (int i = 0; i < 10; i++) {
+ //simulate "Restore Defaults" softkey press
+ qApp->symbianHandleCommand(s60CommandStart);
+ //simulate "help" softkey press
+ qApp->symbianHandleCommand(s60CommandStart + 1);
+ //switch enabled button to disabled and vice versa
+ pBHelp->setEnabled(!pBHelp->isEnabled());
+ pBDefaults->setEnabled(!pBDefaults->isEnabled());
+ }
+ QApplication::processEvents();
+ QCOMPARE(spy0.count(), 5);
+ QCOMPARE(spy1.count(), 5);
}
-
QTEST_MAIN(tst_QSoftKeyManager)
#include "tst_qsoftkeymanager.moc"
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 13d68ff..82b6066 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1072,17 +1072,20 @@ void tst_QSqlDatabase::recordMySQL()
int revision = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 2, 2 ).toInt();
int vernum = (major << 16) + (minor << 8) + revision;
-#ifdef QT3_SUPPORT
/* The below is broken in mysql below 5.0.15
see http://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html
specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded
with space on insert, and trailing spaces are removed on select.
*/
if( vernum >= ((5 << 16) + 15) ) {
+#ifdef QT3_SUPPORT
bin10 = FieldDef("binary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abc ")));
varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abcv ")));
- }
+#else
+ bin10 = FieldDef("binary(10)", QVariant::ByteArray, QString("123abc "));
+ varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QString("123abcv "));
#endif
+ }
static QDateTime dt(QDate::currentDate(), QTime(1, 2, 3, 0));
static const FieldDef fieldDefs[] = {
@@ -2468,7 +2471,7 @@ void tst_QSqlDatabase::mysql_savepointtest()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 1 ).toInt()<4.1 )
+ if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 1 ).toDouble()<4.1 )
QSKIP( "Test requires MySQL >= 4.1", SkipSingle );
QSqlQuery q(db);
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index 546c105..98030d1 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -194,7 +194,6 @@ private slots:
void sqlServerReturn0_data() { generic_data(); }
void sqlServerReturn0();
-
private:
// returns all database connections
void generic_data(const QString &engine=QString());
@@ -510,9 +509,7 @@ void tst_QSqlQuery::mysqlOutValues()
QVERIFY_SQL( q, exec( "create procedure " + qTableName( "qtestproc" ) + " () "
"BEGIN select * from " + qTableName( "qtest" ) + " order by id; END" ) );
QVERIFY_SQL( q, exec( "call " + qTableName( "qtestproc" ) + "()" ) );
- QEXPECT_FAIL("", "There's a mysql bug that means only selects think they return data when running in prepared mode", Continue);
QVERIFY_SQL( q, next() );
- QEXPECT_FAIL("", "There's a mysql bug that means only selects think they return data when running in prepared mode", Continue);
QCOMPARE( q.value( 1 ).toString(), QString( "VarChar1" ) );
QVERIFY_SQL( q, exec( "drop procedure " + qTableName( "qtestproc" ) ) );
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 91b2cc5..da58725 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -172,6 +172,7 @@ private slots:
void expandAndCollapse_data();
void expandAndCollapse();
void expandAndCollapseAll();
+ void expandWithNoChildren();
void keyboardNavigation();
void headerSections();
void moveCursor_data();
@@ -1548,6 +1549,19 @@ void tst_QTreeView::expandAndCollapseAll()
// QCOMPARE(collapsedSpy.count(), count);
}
+void tst_QTreeView::expandWithNoChildren()
+{
+ QTreeView tree;
+ QStandardItemModel model(1,1);
+ tree.setModel(&model);
+ tree.setAnimated(true);
+ tree.doItemsLayout();
+ //this test should not output warnings
+ tree.expand(model.index(0,0));
+}
+
+
+
void tst_QTreeView::keyboardNavigation()
{
const int rows = 10;
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp
index 11c4543..6defd7b 100644
--- a/tests/auto/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp
@@ -49,6 +49,9 @@
#include <qheaderview.h>
#include <qlineedit.h>
#include <QScrollBar>
+#include <QStyledItemDelegate>
+
+#include "../../shared/util.h"
//TESTED_CLASS=
@@ -163,6 +166,7 @@ private slots:
void task217309();
void setCurrentItemExpandsParent();
void task239150_editorWidth();
+ void setTextUpdate();
public slots:
void itemSelectionChanged();
@@ -3233,6 +3237,41 @@ void tst_QTreeWidget::task239150_editorWidth()
+void tst_QTreeWidget::setTextUpdate()
+{
+ QTreeWidget treeWidget;
+ treeWidget.setColumnCount(2);
+
+ class MyItemDelegate : public QStyledItemDelegate
+ {
+ public:
+ MyItemDelegate() : numPaints(0) { }
+ void paint(QPainter *painter,
+ const QStyleOptionViewItem &option, const QModelIndex &index) const
+ {
+ numPaints++;
+ QStyledItemDelegate::paint(painter, option, index);
+ }
+
+ mutable int numPaints;
+ } delegate;
+
+ treeWidget.setItemDelegate(&delegate);
+ treeWidget.show();
+ QStringList strList;
+ strList << "variable1" << "0";
+ QTreeWidgetItem *item = new QTreeWidgetItem(strList);
+ treeWidget.insertTopLevelItem(0, item);
+ QTest::qWait(50);
+ QTRY_VERIFY(delegate.numPaints > 0);
+ delegate.numPaints = 0;
+
+ item->setText(1, "42");
+ QApplication::processEvents();
+ QTRY_VERIFY(delegate.numPaints > 0);
+}
+
+
QTEST_MAIN(tst_QTreeWidget)
#include "tst_qtreewidget.moc"
diff --git a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
index bc6fe68..9623e80 100644
--- a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
+++ b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
@@ -120,7 +120,7 @@ void tst_QVideoSurfaceFormat::constructNull()
QCOMPARE(format.frameHeight(), -1);
QCOMPARE(format.viewport(), QRect());
QCOMPARE(format.scanLineDirection(), QVideoSurfaceFormat::TopToBottom);
- QCOMPARE(format.frameRate(), QVideoSurfaceFormat::FrameRate());
+ QCOMPARE(format.frameRate(), 0.0);
QCOMPARE(format.pixelAspectRatio(), QSize(1, 1));
QCOMPARE(format.yuvColorSpace(), QVideoSurfaceFormat::YCbCr_Undefined);
}
@@ -159,7 +159,7 @@ void tst_QVideoSurfaceFormat::construct()
QCOMPARE(format.frameHeight(), frameSize.height());
QCOMPARE(format.viewport(), viewport);
QCOMPARE(format.scanLineDirection(), QVideoSurfaceFormat::TopToBottom);
- QCOMPARE(format.frameRate(), QVideoSurfaceFormat::FrameRate());
+ QCOMPARE(format.frameRate(), 0.0);
QCOMPARE(format.pixelAspectRatio(), QSize(1, 1));
QCOMPARE(format.yuvColorSpace(), QVideoSurfaceFormat::YCbCr_Undefined);
}
@@ -315,21 +315,21 @@ void tst_QVideoSurfaceFormat::scanLineDirection()
void tst_QVideoSurfaceFormat::frameRate_data()
{
- QTest::addColumn<QVideoSurfaceFormat::FrameRate>("frameRate");
+ QTest::addColumn<qreal>("frameRate");
QTest::newRow("null")
- << QVideoSurfaceFormat::FrameRate(0, 0);
+ << 0.0;
QTest::newRow("1/1")
- << QVideoSurfaceFormat::FrameRate(1, 1);
+ << 1.0;
QTest::newRow("24/1")
- << QVideoSurfaceFormat::FrameRate(24, 1);
+ << 24.0;
QTest::newRow("15/2")
- << QVideoSurfaceFormat::FrameRate(15, 2);
+ << 7.5;
}
void tst_QVideoSurfaceFormat::frameRate()
{
- QFETCH(QVideoSurfaceFormat::FrameRate, frameRate);
+ QFETCH(qreal, frameRate);
{
QVideoSurfaceFormat format(QSize(64, 64), QVideoFrame::Format_RGB32);
@@ -337,29 +337,16 @@ void tst_QVideoSurfaceFormat::frameRate()
format.setFrameRate(frameRate);
QCOMPARE(format.frameRate(), frameRate);
- QCOMPARE(qvariant_cast<QVideoSurfaceFormat::FrameRate>(format.property("frameRate")),
- frameRate);
- }
- {
- QVideoSurfaceFormat format(QSize(64, 64), QVideoFrame::Format_RGB32);
-
- format.setFrameRate(frameRate.first, frameRate.second);
-
- QCOMPARE(format.frameRate(), frameRate);
- QCOMPARE(
- qvariant_cast<QVideoSurfaceFormat::FrameRate>(format.property("frameRate")),
- frameRate);
+ QCOMPARE(qvariant_cast<qreal>(format.property("frameRate")), frameRate);
}
{
QVideoSurfaceFormat format(QSize(64, 64), QVideoFrame::Format_RGB32);
format.setFrameRate(frameRate);
- format.setProperty(
- "frameRate", qVariantFromValue<QVideoSurfaceFormat::FrameRate>(frameRate));
+ format.setProperty("frameRate", frameRate);
QCOMPARE(format.frameRate(), frameRate);
- QCOMPARE(qvariant_cast<QVideoSurfaceFormat::FrameRate>(format.property("frameRate")),
- frameRate);
+ QCOMPARE(qvariant_cast<qreal>(format.property("frameRate")), frameRate);
}
}
@@ -609,13 +596,13 @@ void tst_QVideoSurfaceFormat::compare()
QCOMPARE(format1 == format2, true);
QCOMPARE(format1 != format2, false);
- format1.setFrameRate(QVideoSurfaceFormat::FrameRate(15, 2));
+ format1.setFrameRate(7.5);
// Not equal frame rate differs.
QCOMPARE(format1 == format2, false);
QCOMPARE(format1 != format2, true);
- format2.setFrameRate(15, 2);
+ format2.setFrameRate(7.50001);
// Equal.
QCOMPARE(format1 == format2, true);
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 4cb9f72..a03f112 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -242,7 +242,12 @@ private slots:
void setFixedSize();
void ensureCreated();
+ void winIdChangeEvent();
+#ifdef Q_OS_SYMBIAN
+ void reparentCausesChildWinIdChange();
+#else
void persistentWinId();
+#endif
void qobject_castInDestroyedSlot();
void showHideEvent_data();
@@ -4352,6 +4357,146 @@ void tst_QWidget::ensureCreated()
}
}
+class WinIdChangeWidget : public QWidget {
+public:
+ WinIdChangeWidget(QWidget *p = 0)
+ : QWidget(p)
+ , m_winIdChangeEventCount(0)
+ {
+
+ }
+protected:
+ bool event(QEvent *e)
+ {
+ if (e->type() == QEvent::WinIdChange) {
+ ++m_winIdChangeEventCount;
+ return true;
+ }
+ return QWidget::event(e);
+ }
+public:
+ int m_winIdChangeEventCount;
+};
+
+void tst_QWidget::winIdChangeEvent()
+{
+ {
+ // Transforming an alien widget into a native widget
+ WinIdChangeWidget widget;
+ const WId winIdBefore = widget.internalWinId();
+ const WId winIdAfter = widget.winId();
+ QVERIFY(winIdBefore != winIdAfter);
+ QCOMPARE(widget.m_winIdChangeEventCount, 1);
+ }
+
+ {
+ // Changing parent of a native widget
+ QWidget parent1, parent2;
+ WinIdChangeWidget child(&parent1);
+ const WId winIdBefore = child.winId();
+ QCOMPARE(child.m_winIdChangeEventCount, 1);
+ child.setParent(&parent2);
+ const WId winIdAfter = child.internalWinId();
+#ifdef Q_OS_SYMBIAN
+ QVERIFY(winIdBefore != winIdAfter);
+ QCOMPARE(child.m_winIdChangeEventCount, 2);
+#else
+ QCOMPARE(winIdBefore, winIdAfter);
+ QCOMPARE(child.m_winIdChangeEventCount, 1);
+#endif
+ }
+
+ {
+ // Changing parent of an alien widget
+ QWidget parent1, parent2;
+ WinIdChangeWidget child(&parent1);
+ const WId winIdBefore = child.internalWinId();
+ child.setParent(&parent2);
+ const WId winIdAfter = child.internalWinId();
+ QCOMPARE(winIdBefore, winIdAfter);
+ QCOMPARE(child.m_winIdChangeEventCount, 0);
+ }
+
+ {
+ // Making native child widget into a top-level window
+ QWidget parent;
+ WinIdChangeWidget child(&parent);
+ child.winId();
+ const WId winIdBefore = child.internalWinId();
+ QCOMPARE(child.m_winIdChangeEventCount, 1);
+ const Qt::WindowFlags flags = child.windowFlags();
+ child.setWindowFlags(flags | Qt::Window);
+ const WId winIdAfter = child.internalWinId();
+ QVERIFY(winIdBefore != winIdAfter);
+ QCOMPARE(child.m_winIdChangeEventCount, 2);
+ }
+}
+
+#ifdef Q_OS_SYMBIAN
+void tst_QWidget::reparentCausesChildWinIdChange()
+{
+ QWidget *parent = new QWidget;
+ QWidget *w1 = new QWidget;
+ QWidget *w2 = new QWidget;
+ QWidget *w3 = new QWidget;
+ w1->setParent(parent);
+ w2->setParent(w1);
+ w3->setParent(w2);
+
+ WId winId1 = w1->winId();
+ WId winId2 = w2->winId();
+ WId winId3 = w3->winId();
+
+ // reparenting causes winIds of the widget being reparented, and all of its children, to change
+ w1->setParent(0);
+ QVERIFY(w1->winId() != winId1);
+ winId1 = w1->winId();
+ QVERIFY(w2->winId() != winId2);
+ winId2 = w2->winId();
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w1->setParent(parent);
+ QVERIFY(w1->winId() != winId1);
+ winId1 = w1->winId();
+ QVERIFY(w2->winId() != winId2);
+ winId2 = w2->winId();
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w2->setParent(0);
+ QVERIFY(w2->winId() != winId2);
+ winId2 = w2->winId();
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w2->setParent(parent);
+ QVERIFY(w2->winId() != winId2);
+ winId2 = w2->winId();
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w2->setParent(w1);
+ QVERIFY(w2->winId() != winId2);
+ winId2 = w2->winId();
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w3->setParent(0);
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w3->setParent(w1);
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ w3->setParent(w2);
+ QVERIFY(w3->winId() != winId3);
+ winId3 = w3->winId();
+
+ delete parent;
+}
+#else
void tst_QWidget::persistentWinId()
{
QWidget *parent = new QWidget;
@@ -4408,6 +4553,7 @@ void tst_QWidget::persistentWinId()
delete parent;
}
+#endif // Q_OS_SYMBIAN
class ShowHideEventWidget : public QWidget
{
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index ed3d150..36293f8 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -1112,6 +1112,10 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
"QML Properties",
"property",
"properties");
+ FastSection qmlattachedproperties(qmlClassNode,
+ "QML Attached Properties",
+ "property",
+ "properties");
FastSection qmlsignals(qmlClassNode,
"QML Signals",
"signal",
@@ -1128,7 +1132,11 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
NodeList::ConstIterator p = qpgn->childNodes().begin();
while (p != qpgn->childNodes().end()) {
if ((*p)->type() == Node::QmlProperty) {
- insert(qmlproperties,*p,style,Okay);
+ const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p);
+ if (pn->isAttached())
+ insert(qmlattachedproperties,*p,style,Okay);
+ else
+ insert(qmlproperties,*p,style,Okay);
}
++p;
}
@@ -1142,17 +1150,23 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
++c;
}
append(sections,qmlproperties);
+ append(sections,qmlattachedproperties);
append(sections,qmlsignals);
append(sections,qmlmethods);
}
else if (style == Detailed) {
FastSection qmlproperties(qmlClassNode,"QML Property Documentation");
+ FastSection qmlattachedproperties(qmlClassNode,"QML Attached Property Documentation");
FastSection qmlsignals(qmlClassNode,"QML Signal Documentation");
FastSection qmlmethods(qmlClassNode,"QML Method Documentation");
NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
while (c != qmlClassNode->childNodes().end()) {
if ((*c)->subType() == Node::QmlPropertyGroup) {
- insert(qmlproperties,*c,style,Okay);
+ const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c);
+ if (pgn->isAttached())
+ insert(qmlattachedproperties,*c,style,Okay);
+ else
+ insert(qmlproperties,*c,style,Okay);
}
else if ((*c)->type() == Node::QmlSignal) {
insert(qmlsignals,*c,style,Okay);
@@ -1163,6 +1177,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
++c;
}
append(sections,qmlproperties);
+ append(sections,qmlattachedproperties);
append(sections,qmlsignals);
append(sections,qmlmethods);
}
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index d93e24c..ad43b2b 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -88,6 +88,7 @@ QT_BEGIN_NAMESPACE
#ifdef QDOC_QML
#define COMMAND_QMLCLASS Doc::alias("qmlclass")
#define COMMAND_QMLPROPERTY Doc::alias("qmlproperty")
+#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty")
#define COMMAND_QMLINHERITS Doc::alias("inherits")
#define COMMAND_QMLSIGNAL Doc::alias("qmlsignal")
#define COMMAND_QMLMETHOD Doc::alias("qmlmethod")
@@ -482,6 +483,7 @@ QSet<QString> CppCodeParser::topicCommands()
<< COMMAND_VARIABLE
<< COMMAND_QMLCLASS
<< COMMAND_QMLPROPERTY
+ << COMMAND_QMLATTACHEDPROPERTY
<< COMMAND_QMLSIGNAL
<< COMMAND_QMLMETHOD;
#else
@@ -759,32 +761,40 @@ bool CppCodeParser::splitQmlArg(const Doc& doc,
/*!
Process the topic \a command group with arguments \a args.
- Currently, this function is called only for \e{qmlproperty}.
+ Currently, this function is called only for \e{qmlproperty}
+ and \e{qmlattachedproperty}.
*/
Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
const QString& command,
const QStringList& args)
{
QmlPropGroupNode* qmlPropGroup = 0;
- if (command == COMMAND_QMLPROPERTY) {
+ if ((command == COMMAND_QMLPROPERTY) ||
+ (command == COMMAND_QMLATTACHEDPROPERTY)) {
QString type;
QString element;
QString property;
+ bool attached = (command == COMMAND_QMLATTACHEDPROPERTY);
QStringList::ConstIterator arg = args.begin();
if (splitQmlPropertyArg(doc,(*arg),type,element,property)) {
Node* n = tre->findNode(QStringList(element),Node::Fake);
if (n && n->subType() == Node::QmlClass) {
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(n);
if (qmlClass)
- qmlPropGroup = new QmlPropGroupNode(qmlClass,property);
+ qmlPropGroup = new QmlPropGroupNode(qmlClass,
+ property,
+ attached);
}
}
if (qmlPropGroup) {
- new QmlPropertyNode(qmlPropGroup,property,type);
+ new QmlPropertyNode(qmlPropGroup,property,type,attached);
++arg;
while (arg != args.end()) {
if (splitQmlPropertyArg(doc,(*arg),type,element,property)) {
- new QmlPropertyNode(qmlPropGroup,property,type);
+ new QmlPropertyNode(qmlPropGroup,
+ property,
+ type,
+ attached);
}
++arg;
}
@@ -1969,7 +1979,8 @@ bool CppCodeParser::matchDocsAndStuff()
There is a topic command. Process it.
*/
#ifdef QDOC_QML
- if (topic == COMMAND_QMLPROPERTY) {
+ if ((topic == COMMAND_QMLPROPERTY) ||
+ (topic == COMMAND_QMLATTACHEDPROPERTY)) {
Doc nodeDoc = doc;
Node *node = processTopicCommandGroup(nodeDoc,topic,args);
if (node != 0) {
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index c02dc2e..18c7916 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1240,7 +1240,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
generateHeader(title, inner, marker, true);
generateTitle(title, subtitleText, SmallSubTitle, inner, marker);
-#ifdef QDOC_QML
+#ifdef QDOC_QML
if (classe && !classe->qmlElement().isEmpty()) {
generateInstantiatedBy(classe,marker);
}
@@ -3468,12 +3468,12 @@ QString HtmlGenerator::refForNode(const Node *node)
}
break;
case Node::Property:
-#ifdef QDOC_QML
+#ifdef QDOC_QML
case Node::QmlProperty:
#endif
ref = node->name() + "-prop";
break;
-#ifdef QDOC_QML
+#ifdef QDOC_QML
case Node::QmlSignal:
ref = node->name() + "-signal";
break;
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 558808f..49f2cc9 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1158,8 +1158,12 @@ QString QmlClassNode::fileBase() const
Constructor for the Qml property group node. \a parent is
always a QmlClassNode.
*/
-QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name)
- : FakeNode(parent, name, QmlPropertyGroup), isdefault(false)
+QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent,
+ const QString& name,
+ bool attached)
+ : FakeNode(parent, name, QmlPropertyGroup),
+ isdefault(false),
+ att(attached)
{
// nothing.
}
@@ -1169,11 +1173,13 @@ QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name)
*/
QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent,
const QString& name,
- const QString& type)
+ const QString& type,
+ bool attached)
: LeafNode(QmlProperty, parent, name),
dt(type),
sto(Trool_Default),
- des(Trool_Default)
+ des(Trool_Default),
+ att(attached)
{
// nothing.
}
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index f933270..fed4ea1 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -369,15 +369,19 @@ class QmlClassNode : public FakeNode
class QmlPropGroupNode : public FakeNode
{
public:
- QmlPropGroupNode(QmlClassNode* parent, const QString& name);
+ QmlPropGroupNode(QmlClassNode* parent,
+ const QString& name,
+ bool attached);
virtual ~QmlPropGroupNode() { }
const QString& element() const { return name(); }
void setDefault() { isdefault = true; }
bool isDefault() const { return isdefault; }
+ bool isAttached() const { return att; }
private:
bool isdefault;
+ bool att;
};
class QmlPropertyNode : public LeafNode
@@ -385,7 +389,8 @@ class QmlPropertyNode : public LeafNode
public:
QmlPropertyNode(QmlPropGroupNode* parent,
const QString& name,
- const QString& type);
+ const QString& type,
+ bool attached);
virtual ~QmlPropertyNode() { }
void setDataType(const QString& dataType) { dt = dataType; }
@@ -396,6 +401,7 @@ class QmlPropertyNode : public LeafNode
QString qualifiedDataType() const { return dt; }
bool isStored() const { return fromTrool(sto,true); }
bool isDesignable() const { return fromTrool(des,false); }
+ bool isAttached() const { return att; }
const QString& element() const { return parent()->name(); }
@@ -408,6 +414,7 @@ class QmlPropertyNode : public LeafNode
QString dt;
Trool sto;
Trool des;
+ bool att;
};
class QmlSignalNode : public LeafNode
diff --git a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf b/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf
deleted file mode 100644
index 0d78cda..0000000
--- a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf
+++ /dev/null
@@ -1,29 +0,0 @@
-include(qt-build-docs-with-xcode.qdocconf)
-
-# Ensures that the generated index contains a URL that can be used by the
-# tools documentation (assistant.qdocconf, designer.qdocconf, linguist.qdocconf,
-# qmake.qdocconf).
-
-url = ./
-
-# Ensures that the documentation for the tools is not included in the generated
-# .qhp file.
-
-qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \
- $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/taskmenuextension.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \
- $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \
- $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \
- $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
-
-outputdir = $QT_BUILD_TREE/doc-build/html-qt
-base = file:$QT_BUILD_TREE/doc-build/html-qt
diff --git a/tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf b/tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf
deleted file mode 100644
index e4be476..0000000
--- a/tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf
+++ /dev/null
@@ -1,3 +0,0 @@
-include( qt-build-docs.qdocconf )
-
-HTML.generatemacrefs = "true"
diff --git a/tools/qdoc3/test/qt-with-xcode.qdocconf b/tools/qdoc3/test/qt-with-xcode.qdocconf
deleted file mode 100644
index 932f6d9..0000000
--- a/tools/qdoc3/test/qt-with-xcode.qdocconf
+++ /dev/null
@@ -1,3 +0,0 @@
-include( qt.qdocconf )
-
-HTML.generatemacrefs = "true"
diff --git a/tools/qtestlib/wince/cetest/main.cpp b/tools/qtestlib/wince/cetest/main.cpp
index 9df70e7..e00c0e7 100644
--- a/tools/qtestlib/wince/cetest/main.cpp
+++ b/tools/qtestlib/wince/cetest/main.cpp
@@ -237,6 +237,8 @@ int main(int argc, char **argv)
debugOutput(QString::fromLatin1("Using Project File:").append(proFile),1);
}
+ Option::before_user_vars.append("CONFIG+=build_pass");
+
// read target and deployment rules
int qmakeArgc = 1;
char* qmakeArgv[] = { "qmake.exe" };
diff --git a/translations/designer_pl.ts b/translations/designer_pl.ts
index 001b54a..0c196d8 100644
--- a/translations/designer_pl.ts
+++ b/translations/designer_pl.ts
@@ -4709,7 +4709,7 @@ Czy chcesz nadpisać szablon?</translation>
<message>
<location line="+1"/>
<source>The file &quot;%1&quot; has changed outside Designer. Do you want to reload it?</source>
- <translation>Plik &quot;%1&quot; zmienił się na zewnątrz Designera. Czy chcesz go ponownie załadować?</translation>
+ <translation type="unfinished">Plik &quot;%1&quot; zmienił się na zewnątrz Designera. Czy chcesz go ponownie załadować?</translation>
</message>
</context>
<context>
diff --git a/translations/linguist_pl.ts b/translations/linguist_pl.ts
index 93b3a1d..b59ebc3 100644
--- a/translations/linguist_pl.ts
+++ b/translations/linguist_pl.ts
@@ -1511,32 +1511,32 @@ Wszystkie pliki (*)</translation>
<message>
<location line="+30"/>
<source>Russian</source>
- <translation>Rosyjskie</translation>
+ <translation>rosyjski</translation>
</message>
<message>
<location line="+1"/>
<source>German</source>
- <translation>Niemieckie</translation>
+ <translation>niemiecki</translation>
</message>
<message>
<location line="+1"/>
<source>Japanese</source>
- <translation>Japońskie</translation>
+ <translation>japoński</translation>
</message>
<message>
<location line="+1"/>
<source>French</source>
- <translation>Francuskie</translation>
+ <translation>francuski</translation>
</message>
<message>
<location line="+1"/>
<source>Polish</source>
- <translation>Polskie</translation>
+ <translation>polski</translation>
</message>
<message>
<location line="+1"/>
<source>Chinese</source>
- <translation>Chińskie</translation>
+ <translation>chiński</translation>
</message>
<message>
<location line="+53"/>
@@ -1581,7 +1581,7 @@ Wszystkie pliki (*)</translation>
<message>
<location line="+232"/>
<source>%1 translation (%2)</source>
- <translation>%1 tłumaczenie (%2)</translation>
+ <translation>Tłumaczenie na język %1 (%2)</translation>
</message>
<message>
<location line="+9"/>
@@ -1591,7 +1591,7 @@ Wszystkie pliki (*)</translation>
<message>
<location line="+5"/>
<source>%1 translation</source>
- <translation>%1 tłumaczenie</translation>
+ <translation>Tłumaczenie na język %1</translation>
</message>
<message>
<location line="+1"/>
diff --git a/translations/qt_pl.ts b/translations/qt_pl.ts
index 8afb485..424fd31 100644
--- a/translations/qt_pl.ts
+++ b/translations/qt_pl.ts
@@ -8513,12 +8513,12 @@ Proszę wybrać inną nazwę pliku.</translation>
<location line="+5"/>
<location line="+24"/>
<source>Circular inheritance of base type %1.</source>
- <translation>Zapętlenie w dziedziczeniu podstawowego typu %1.</translation>
+ <translation>Cykliczne dziedziczenie podstawowego typu %1.</translation>
</message>
<message>
<location line="+11"/>
<source>Circular inheritance of union %1.</source>
- <translation>Zapętlenie w dziedziczeniu unii %1.</translation>
+ <translation>Cykliczne dziedziczenie unii %1.</translation>
</message>
<message>
<location line="+25"/>
@@ -9143,7 +9143,7 @@ Proszę wybrać inną nazwę pliku.</translation>
<message>
<location line="+7"/>
<source>Fixed value constraint of element %1 differs from value constraint in base particle.</source>
- <translation>Ostateczne ograniczenie wartości elementu %1 różni się od ograniczenia wartości w podstawowym elemencie.</translation>
+ <translation>Ograniczenie stałej wartości elementu %1 różni się od ograniczenia wartości w podstawowym elemencie.</translation>
</message>
<message>
<location line="+7"/>
@@ -9793,7 +9793,7 @@ Proszę wybrać inną nazwę pliku.</translation>
<message>
<location line="+6"/>
<source>Fixed value constrained not allowed if element is nillable.</source>
- <translation>Ograniczenie sztywnej wartości jest niedozwolone gdy element jest zerowalny.</translation>
+ <translation>Ograniczenie stałej wartości jest niedozwolone gdy element jest zerowalny.</translation>
</message>
<message>
<location line="+32"/>
@@ -9842,7 +9842,7 @@ Proszę wybrać inną nazwę pliku.</translation>
<message>
<location line="+18"/>
<source>Element %1 can not contain other elements, as it has a fixed content.</source>
- <translation>Element %1 nie może zawierać innych elementów ponieważ posiada on sztywną zawartość.</translation>
+ <translation>Element %1 nie może zawierać innych elementów ponieważ posiada on stałą zawartość.</translation>
</message>
<message>
<location line="+43"/>