diff options
148 files changed, 3594 insertions, 3871 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 @@ -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/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/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/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 d6ade22..05940e4 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -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/images/pangesture.png b/doc/src/images/pangesture.png Binary files differnew file mode 100644 index 0000000..24caf91 --- /dev/null +++ b/doc/src/images/pangesture.png diff --git a/doc/src/images/pinchgesture.png b/doc/src/images/pinchgesture.png Binary files differnew file mode 100644 index 0000000..95614c4 --- /dev/null +++ b/doc/src/images/pinchgesture.png diff --git a/doc/src/images/swipegesture.png b/doc/src/images/swipegesture.png Binary files differnew file mode 100644 index 0000000..0b7d35a --- /dev/null +++ b/doc/src/images/swipegesture.png 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/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/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/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 7b91fbf..56e2316 100644 --- a/examples/gestures/imageviewer/imagewidget.h +++ b/examples/gestures/imagegestures/imagewidget.h @@ -53,28 +53,28 @@ 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(); @@ -93,6 +93,8 @@ private: float verticalOffset; float rotationAngle; float scaleFactor; +//! [class definition end] }; +//! [class definition end] #endif diff --git a/examples/gestures/imageviewer/main.cpp b/examples/gestures/imagegestures/main.cpp index c3d03f3..9c99f31 100644 --- a/examples/gestures/imageviewer/main.cpp +++ b/examples/gestures/imagegestures/main.cpp @@ -41,36 +41,7 @@ #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); -} +#include "mainwidget.h" int main(int argc, char *argv[]) { @@ -86,5 +57,3 @@ int main(int argc, char *argv[]) return app.exec(); } - -#include "main.moc" diff --git a/doc/src/snippets/gestures/qgesture.h b/examples/gestures/imagegestures/mainwidget.cpp index 3fc89a1..51e9f1e 100644 --- a/doc/src/snippets/gestures/qgesture.h +++ b/examples/gestures/imagegestures/mainwidget.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,63 +39,18 @@ ** ****************************************************************************/ -#ifndef QGESTURE_H -#define QGESTURE_H +#include "imagewidget.h" +#include "mainwidget.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 +MainWidget::MainWidget(QWidget *parent) + : QMainWindow(parent) { - 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; + resize(400, 300); + imageWidget = new ImageWidget(this); + setCentralWidget(imageWidget); +} - 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 +void MainWidget::openDirectory(const QString &path) +{ + imageWidget->openDirectory(path); +} diff --git a/doc/src/snippets/gestures/imageviewer/tapandholdgesture.h b/examples/gestures/imagegestures/mainwidget.h index 682342e..71b09b0 100644 --- a/doc/src/snippets/gestures/imageviewer/tapandholdgesture.h +++ b/examples/gestures/imagegestures/mainwidget.h @@ -39,36 +39,27 @@ ** ****************************************************************************/ -#ifndef TAPANDHOLDGESTURE_H -#define TAPANDHOLDGESTURE_H +#ifndef MAINWIDGET_H +#define MAINWIDGET_H -#include <QtCore/QBasicTimer> -#include <QtGui/QGesture> -#include <QtGui/QWidget> +#include <QMainWindow> -class TapAndHoldGesture : public QGesture +class ImageWidget; + +class MainWidget : public QMainWindow { Q_OBJECT - Q_PROPERTY(QPoint pos READ pos) public: - TapAndHoldGesture(QWidget *parent); - - bool filterEvent(QEvent *event); - void reset(); + MainWidget(QWidget *parent = 0); - QPoint pos() const; - -protected: - void timerEvent(QTimerEvent *event); +public slots: + void openDirectory(const QString &path); private: - QBasicTimer timer; - int iteration; - QPoint position; - QPoint startPosition; - static const int iterationCount; - static const int iterationTimeout; + bool loadImage(const QString &fileName); + + ImageWidget *imageWidget; }; -#endif // TAPANDHOLDGESTURE_H +#endif 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/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/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/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/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/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/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/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 b990fe2..6f6d706 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5643,7 +5643,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/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/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 8da415f..de08312 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1355,6 +1355,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(); @@ -5677,9 +5679,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) 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_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 8ce5001..abf5ba5 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -550,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() 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/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 240403d..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())); 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/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/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 a5732fb..ad766c1 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -467,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/qgl.cpp b/src/opengl/qgl.cpp index 0d00f59..39f04d4 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1977,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) { @@ -2005,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); @@ -2351,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; 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/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 1a11476..80628a2 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -1221,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; @@ -1595,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); @@ -1608,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); @@ -1620,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); @@ -1632,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); } @@ -4309,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; @@ -5205,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 df84a76..2816eca 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -418,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 fdd61ea..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(); 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 3305bbb..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, @@ -213,8 +215,7 @@ void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const } QVGPixmapDropShadowFilter::QVGPixmapDropShadowFilter() - : QPixmapDropShadowFilter(), - firstTime(true) + : QPixmapDropShadowFilter() { } @@ -238,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. @@ -292,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; @@ -308,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 f79b6c2..efbbc7b 100644 --- a/src/openvg/qpixmapfilter_vg_p.h +++ b/src/openvg/qpixmapfilter_vg_p.h @@ -89,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/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c index c1b655a..17345a9 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c @@ -828,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 b9e035f..55e0310 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h @@ -162,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/README b/src/plugins/gfxdrivers/powervr/README index 322a6b2..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 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/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/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/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/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 758821b..1b898f4 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -4362,11 +4362,13 @@ public: } protected: - bool event(QEvent *e){ - if(e->type() == QEvent::WinIdChange) + bool event(QEvent *e) + { + if (e->type() == QEvent::WinIdChange) { ++m_winIdChangeEventCount; - else - return QWidget::event(e); + return true; + } + return QWidget::event(e); } public: int m_winIdChangeEventCount; 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/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" }; |